summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-05-22 14:17:51 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-05-22 14:17:51 +0000
commit7e7e825f9db54674870e289eb6505427dd8a542c (patch)
treef7f006ce81efdc9667e0766e326dba24369b70a0
parent3407044d99f61abb50e7adad7fd86fbb8ad1d9c2 (diff)
added timezone translation
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@177 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r--tipper/common.h1
-rw-r--r--tipper/m_tipper.h2
-rw-r--r--tipper/tipper.mdsp7
-rw-r--r--tipper/tipper_8.sln3
-rw-r--r--tipper/tipper_8.vcproj133
-rw-r--r--tipper/translations.cpp31
-rw-r--r--tipper/version.h2
7 files changed, 173 insertions, 6 deletions
diff --git a/tipper/common.h b/tipper/common.h
index fa8541c..3cf7253 100644
--- a/tipper/common.h
+++ b/tipper/common.h
@@ -39,6 +39,7 @@
#define MIRANDA_VER 0x0600 // for tabbed options
+#include <win2k.h>
#include <newpluginapi.h>
#include <statusmodes.h>
#include <m_database.h>
diff --git a/tipper/m_tipper.h b/tipper/m_tipper.h
index 790ec26..e5a5a16 100644
--- a/tipper/m_tipper.h
+++ b/tipper/m_tipper.h
@@ -38,4 +38,4 @@ typedef struct {
#define MS_AWAY_GETPROTOSTATUSMESSAGET MS_AWAY_GETPROTOSTATUSMESSAGEW
#else
#define MS_AWAY_GETPROTOSTATUSMESSAGET MS_AWAY_GETPROTOSTATUSMESSAGE
-#endif \ No newline at end of file
+#endif
diff --git a/tipper/tipper.mdsp b/tipper/tipper.mdsp
index 01d8952..aa71f20 100644
--- a/tipper/tipper.mdsp
+++ b/tipper/tipper.mdsp
@@ -104,7 +104,8 @@ extraResourceOptions=
1=resource.rc
[Other]
[History]
-message_pump.cpp,4377
-tipper.cpp,1265
+version.h,586
popwin.cpp,2562
-version.h,820
+tipper.cpp,1265
+message_pump.cpp,4377
+m_tipper.h,1664
diff --git a/tipper/tipper_8.sln b/tipper/tipper_8.sln
index ef56c93..467d54a 100644
--- a/tipper/tipper_8.sln
+++ b/tipper/tipper_8.sln
@@ -6,11 +6,14 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
+ Release (ansi)|Win32 = Release (ansi)|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2C818919-A38F-44FF-BD91-A6A204AC592A}.Debug|Win32.ActiveCfg = Debug|Win32
{2C818919-A38F-44FF-BD91-A6A204AC592A}.Debug|Win32.Build.0 = Debug|Win32
+ {2C818919-A38F-44FF-BD91-A6A204AC592A}.Release (ansi)|Win32.ActiveCfg = Release (ansi)|Win32
+ {2C818919-A38F-44FF-BD91-A6A204AC592A}.Release (ansi)|Win32.Build.0 = Release (ansi)|Win32
{2C818919-A38F-44FF-BD91-A6A204AC592A}.Release|Win32.ActiveCfg = Release|Win32
{2C818919-A38F-44FF-BD91-A6A204AC592A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
diff --git a/tipper/tipper_8.vcproj b/tipper/tipper_8.vcproj
index 51e763e..9a2c9c1 100644
--- a/tipper/tipper_8.vcproj
+++ b/tipper/tipper_8.vcproj
@@ -180,6 +180,91 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release (ansi)|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="common.h"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib ws2_32.lib"
+ OutputFile="..\..\bin\$(ConfigurationName)\plugins\$(ProjectName).dll"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ AdditionalManifestDependencies="&quot;type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;X86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;&quot;"
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ EmbedManifest="false"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -208,6 +293,14 @@
UsePrecompiledHeader="2"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\options.cpp"
@@ -228,6 +321,14 @@
UsePrecompiledHeader="2"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\popwin.cpp"
@@ -248,6 +349,14 @@
UsePrecompiledHeader="2"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\str_utils.cpp"
@@ -276,6 +385,14 @@
UsePrecompiledHeader="1"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\translations.cpp"
@@ -360,6 +477,14 @@
Name="VCResourceCompilerTool"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\version.rc"
@@ -380,6 +505,14 @@
Name="VCResourceCompilerTool"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
</File>
</Filter>
</Files>
diff --git a/tipper/translations.cpp b/tipper/translations.cpp
index 17ce9b1..7dcc1fe 100644
--- a/tipper/translations.cpp
+++ b/tipper/translations.cpp
@@ -550,6 +550,31 @@ TCHAR *empty_xStatus_name_to_default_name(HANDLE hContact, const char *module_na
return buff;
}
+TCHAR *timezone_to_time(HANDLE hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen) {
+ int timezone = DBGetContactSettingByte(hContact,module_name,setting_name,256);
+ if(timezone==256 || (char)timezone==-100) {
+ return 0;
+ }
+
+ TIME_ZONE_INFORMATION tzi;
+ FILETIME ft;
+ LARGE_INTEGER lift;
+ SYSTEMTIME st;
+
+ timezone=(char)timezone;
+ GetSystemTimeAsFileTime(&ft);
+ if(GetTimeZoneInformation(&tzi) == TIME_ZONE_ID_DAYLIGHT)
+ timezone += tzi.DaylightBias / 30;
+
+ lift.QuadPart = *(__int64*)&ft;
+ lift.QuadPart -= (__int64)timezone * BIGI(30) * BIGI(60) * BIGI(10000000);
+ *(__int64*)&ft = lift.QuadPart;
+ FileTimeToSystemTime(&ft, &st);
+ GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff, bufflen);
+
+ return buff;
+}
+
int ServiceAddTranslation(WPARAM wParam, LPARAM lParam) {
if(!lParam) return 1;
@@ -562,7 +587,7 @@ int ServiceAddTranslation(WPARAM wParam, LPARAM lParam) {
void InitTranslations() {
next_func_id = DBGetContactSettingDword(0, MODULE, "NextFuncId", 1);
-#define INT_TRANS_COUNT 18
+#define INT_TRANS_COUNT 19
DBVTranslation internal_translations[INT_TRANS_COUNT] = {
{
(TranslateFunc*)null_translation,
@@ -635,6 +660,10 @@ void InitTranslations() {
{
(TranslateFunc*)seconds_to_time_difference,
_T("DWORD seconds to time difference")
+ },
+ {
+ (TranslateFunc*)timezone_to_time,
+ _T("BYTE timezone to time")
}
};
diff --git a/tipper/version.h b/tipper/version.h
index 28f3f31..85f17ca 100644
--- a/tipper/version.h
+++ b/tipper/version.h
@@ -4,7 +4,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 4
#define __RELEASE_NUM 0
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM