diff --git a/CHANGELOG b/CHANGELOG index 0781822..d41583b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -Version 0.9.3 prerelease (2011.05.29): +Version 0.9.3 prerelease (2011.06.04): * added: German translation made by Moritz Beleites * added: on display tab: an option how many digits should be grouped @@ -10,6 +10,7 @@ Version 0.9.3 prerelease (2011.05.29): * updated: Chinese translation * fixed: ttcalc didn't correctly delete variables/functions from its config file so when you restarted the program you still had the deleted variables/functions + * fixed: option: "parameters separated by" was not correctly read from the config file Version 0.9.2 (2010.09.24): diff --git a/setup/innosetup.iss b/setup/innosetup.iss index 06ac544..ccd376b 100644 --- a/setup/innosetup.iss +++ b/setup/innosetup.iss @@ -1,5 +1,4 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! +; innosetup script [Setup] AppName=TTCalc @@ -24,13 +23,14 @@ UsePreviousAppDir=yes [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" -Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" +Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" -Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl" +Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl" Name: "chinese"; MessagesFile: "compiler:Languages\ChineseSimp-12-5.1.11.isl" Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" -Name: "swedish"; MessagesFile: "compiler:Languages\Swedish.isl" +Name: "swedish"; MessagesFile: "compiler:Languages\Swedish-10-5.1.11.isl" Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" [InstallDelete] ; prior to 0.8.3 we were using mingwm10.dll (now it is not needed and will be deleted if exists) @@ -41,16 +41,22 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ [Files] Source: "..\src\ttcalc.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\help\ttcalc.chm"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\COPYRIGHT"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\CHANGELOG"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\README"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\help\ttcalc.chm"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\COPYRIGHT"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\CHANGELOG"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\README"; DestDir: "{app}"; Flags: ignoreversion ; now we do not use *.ini file in the installer -; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Dirs] +Name: "{userappdata}/TTCalc" ; Flags: uninsneveruninstall + +[INI] +Filename: "{userappdata}/TTCalc/ttcalc.ini"; Section: "GLOBAL"; Key: "language.setup"; String: "{language}" + [Icons] Name: "{group}\TTCalc"; Filename: "{app}\ttcalc.exe"; WorkingDir: "{app}" -Name: "{group}\Help"; Filename: "{app}\ttcalc.chm"; WorkingDir: "{app}" +Name: "{group}\Help"; Filename: "{app}\ttcalc.chm"; WorkingDir: "{app}" Name: "{group}\{cm:UninstallProgram,TTCalc}"; Filename: "{uninstallexe}" Name: "{commondesktop}\TTCalc"; Filename: "{app}\ttcalc.exe"; WorkingDir: "{app}"; Tasks: desktopicon diff --git a/src/Makefile b/src/Makefile index 3513690..89d74e1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,3 +1,6 @@ +include Makefile.o.dep +include Makefile.help.dep + CC = g++ #CFLAGS = -Wall -pedantic -s -O2 -mwindows -I../../ttmath -DTTCALC_CONVERT CFLAGS = -Wall -pedantic -s -O2 -mwindows -I../../ttmath -DTTMATH_DONT_USE_WCHAR @@ -14,10 +17,14 @@ setupname = ttcalc-setup.exe all: ttcalc -include Makefile.dep +%.o: %.cpp + $(CC) -c $(CFLAGS) $< -ttcalc: $(o) +ttcalc: $(name) + + +$(name): $(o) $(CC) -o $(name) $(CFLAGS) $(o) -lcomctl32 -lwininet @@ -26,18 +33,34 @@ resource.o: resource.rc windres resource.rc resource.o -help: $(helpdep) +help: ../help/$(helpname) + + +../help/$(helpname): $(helpsrc) Makefile.help.sh +setup: ../setup/$(setupname) -setup: $(setupdep) + +../setup/$(setupname): $(name) ../help/$(helpname) ../setup/innosetup.iss ../setup/COPYRIGHT ../COPYRIGHT ../CHANGELOG ../README iscc ../setup/innosetup.iss +depend: + makedepend -Y. -I../../ttmath -f- *.cpp | sed "s/[\\]/\//g" > Makefile.cpp.dep + echo -n "o = resource.o " > Makefile.o.dep + ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep + echo -n "helpsrc = " > Makefile.help.dep + ls -1 ../help/*.html ../help/*.css ../help/*.hhp ../help/*.hhk ../help/*.hhc | xargs -I foo echo -n foo " " >> Makefile.help.dep + + clean: rm -f *.o rm -f $(name) rm -f ttcalcp.exe rm -f ../help/$(helpname) rm -f ../setup/$(setupname) + + +include Makefile.cpp.dep diff --git a/src/Makefile.cpp.dep b/src/Makefile.cpp.dep new file mode 100644 index 0000000..fc925dd --- /dev/null +++ b/src/Makefile.cpp.dep @@ -0,0 +1,176 @@ +# DO NOT DELETE + +calculation.o: compileconfig.h parsermanager.h resource.h programresources.h +calculation.o: iniparser.h languages.h bigtypes.h +calculation.o: ../../ttmath/ttmath/ttmath.h ../../ttmath/ttmath/ttmathbig.h +calculation.o: ../../ttmath/ttmath/ttmathint.h +calculation.o: ../../ttmath/ttmath/ttmathuint.h +calculation.o: ../../ttmath/ttmath/ttmathtypes.h +calculation.o: ../../ttmath/ttmath/ttmathmisc.h +calculation.o: ../../ttmath/ttmath/ttmathuint_x86.h +calculation.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +calculation.o: ../../ttmath/ttmath/ttmathuint_noasm.h +calculation.o: ../../ttmath/ttmath/ttmaththreads.h +calculation.o: ../../ttmath/ttmath/ttmathobjects.h +calculation.o: ../../ttmath/ttmath/ttmathparser.h +calculation.o: ../../ttmath/ttmath/ttmath.h threadcontroller.h +calculation.o: ../../ttmath/ttmath/ttmathobjects.h stopcalculating.h +calculation.o: ../../ttmath/ttmath/ttmathtypes.h convert.h tabs.h messages.h +convert.o: convert.h compileconfig.h bigtypes.h ../../ttmath/ttmath/ttmath.h +convert.o: ../../ttmath/ttmath/ttmathbig.h ../../ttmath/ttmath/ttmathint.h +convert.o: ../../ttmath/ttmath/ttmathuint.h ../../ttmath/ttmath/ttmathtypes.h +convert.o: ../../ttmath/ttmath/ttmathmisc.h +convert.o: ../../ttmath/ttmath/ttmathuint_x86.h +convert.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +convert.o: ../../ttmath/ttmath/ttmathuint_noasm.h +convert.o: ../../ttmath/ttmath/ttmaththreads.h +convert.o: ../../ttmath/ttmath/ttmathobjects.h +convert.o: ../../ttmath/ttmath/ttmathparser.h ../../ttmath/ttmath/ttmath.h +download.o: compileconfig.h download.h +functions.o: compileconfig.h tabs.h resource.h messages.h +functions.o: ../../ttmath/ttmath/ttmathtypes.h programresources.h iniparser.h +functions.o: languages.h bigtypes.h ../../ttmath/ttmath/ttmath.h +functions.o: ../../ttmath/ttmath/ttmathbig.h ../../ttmath/ttmath/ttmathint.h +functions.o: ../../ttmath/ttmath/ttmathuint.h +functions.o: ../../ttmath/ttmath/ttmathtypes.h +functions.o: ../../ttmath/ttmath/ttmathmisc.h +functions.o: ../../ttmath/ttmath/ttmathuint_x86.h +functions.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +functions.o: ../../ttmath/ttmath/ttmathuint_noasm.h +functions.o: ../../ttmath/ttmath/ttmaththreads.h +functions.o: ../../ttmath/ttmath/ttmathobjects.h +functions.o: ../../ttmath/ttmath/ttmathparser.h ../../ttmath/ttmath/ttmath.h +functions.o: threadcontroller.h ../../ttmath/ttmath/ttmathobjects.h +functions.o: stopcalculating.h convert.h +iniparser.o: compileconfig.h iniparser.h +languages.o: compileconfig.h languages.h bigtypes.h +languages.o: ../../ttmath/ttmath/ttmath.h ../../ttmath/ttmath/ttmathbig.h +languages.o: ../../ttmath/ttmath/ttmathint.h ../../ttmath/ttmath/ttmathuint.h +languages.o: ../../ttmath/ttmath/ttmathtypes.h +languages.o: ../../ttmath/ttmath/ttmathmisc.h +languages.o: ../../ttmath/ttmath/ttmathuint_x86.h +languages.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +languages.o: ../../ttmath/ttmath/ttmathuint_noasm.h +languages.o: ../../ttmath/ttmath/ttmaththreads.h +languages.o: ../../ttmath/ttmath/ttmathobjects.h +languages.o: ../../ttmath/ttmath/ttmathparser.h ../../ttmath/ttmath/ttmath.h +mainwindow.o: compileconfig.h winmain.h programresources.h iniparser.h +mainwindow.o: languages.h bigtypes.h ../../ttmath/ttmath/ttmath.h +mainwindow.o: ../../ttmath/ttmath/ttmathbig.h ../../ttmath/ttmath/ttmathint.h +mainwindow.o: ../../ttmath/ttmath/ttmathuint.h +mainwindow.o: ../../ttmath/ttmath/ttmathtypes.h +mainwindow.o: ../../ttmath/ttmath/ttmathmisc.h +mainwindow.o: ../../ttmath/ttmath/ttmathuint_x86.h +mainwindow.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +mainwindow.o: ../../ttmath/ttmath/ttmathuint_noasm.h +mainwindow.o: ../../ttmath/ttmath/ttmaththreads.h +mainwindow.o: ../../ttmath/ttmath/ttmathobjects.h +mainwindow.o: ../../ttmath/ttmath/ttmathparser.h ../../ttmath/ttmath/ttmath.h +mainwindow.o: threadcontroller.h ../../ttmath/ttmath/ttmathobjects.h +mainwindow.o: stopcalculating.h ../../ttmath/ttmath/ttmathtypes.h convert.h +mainwindow.o: resource.h messages.h tabs.h pad.h update.h download.h misc.h +pad.o: ../../ttmath/ttmath/ttmath.h ../../ttmath/ttmath/ttmathbig.h +pad.o: ../../ttmath/ttmath/ttmathint.h ../../ttmath/ttmath/ttmathuint.h +pad.o: ../../ttmath/ttmath/ttmathtypes.h ../../ttmath/ttmath/ttmathmisc.h +pad.o: ../../ttmath/ttmath/ttmathuint_x86.h +pad.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +pad.o: ../../ttmath/ttmath/ttmathuint_noasm.h +pad.o: ../../ttmath/ttmath/ttmaththreads.h +pad.o: ../../ttmath/ttmath/ttmathobjects.h ../../ttmath/ttmath/ttmathparser.h +pad.o: ../../ttmath/ttmath/ttmath.h programresources.h compileconfig.h +pad.o: iniparser.h languages.h bigtypes.h threadcontroller.h +pad.o: ../../ttmath/ttmath/ttmathobjects.h stopcalculating.h +pad.o: ../../ttmath/ttmath/ttmathtypes.h convert.h resource.h messages.h +pad.o: pad.h +parsermanager.o: compileconfig.h parsermanager.h resource.h +parsermanager.o: programresources.h iniparser.h languages.h bigtypes.h +parsermanager.o: ../../ttmath/ttmath/ttmath.h ../../ttmath/ttmath/ttmathbig.h +parsermanager.o: ../../ttmath/ttmath/ttmathint.h +parsermanager.o: ../../ttmath/ttmath/ttmathuint.h +parsermanager.o: ../../ttmath/ttmath/ttmathtypes.h +parsermanager.o: ../../ttmath/ttmath/ttmathmisc.h +parsermanager.o: ../../ttmath/ttmath/ttmathuint_x86.h +parsermanager.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +parsermanager.o: ../../ttmath/ttmath/ttmathuint_noasm.h +parsermanager.o: ../../ttmath/ttmath/ttmaththreads.h +parsermanager.o: ../../ttmath/ttmath/ttmathobjects.h +parsermanager.o: ../../ttmath/ttmath/ttmathparser.h +parsermanager.o: ../../ttmath/ttmath/ttmath.h threadcontroller.h +parsermanager.o: ../../ttmath/ttmath/ttmathobjects.h stopcalculating.h +parsermanager.o: ../../ttmath/ttmath/ttmathtypes.h convert.h tabs.h +parsermanager.o: messages.h +programresources.o: compileconfig.h programresources.h iniparser.h +programresources.o: languages.h bigtypes.h ../../ttmath/ttmath/ttmath.h +programresources.o: ../../ttmath/ttmath/ttmathbig.h +programresources.o: ../../ttmath/ttmath/ttmathint.h +programresources.o: ../../ttmath/ttmath/ttmathuint.h +programresources.o: ../../ttmath/ttmath/ttmathtypes.h +programresources.o: ../../ttmath/ttmath/ttmathmisc.h +programresources.o: ../../ttmath/ttmath/ttmathuint_x86.h +programresources.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +programresources.o: ../../ttmath/ttmath/ttmathuint_noasm.h +programresources.o: ../../ttmath/ttmath/ttmaththreads.h +programresources.o: ../../ttmath/ttmath/ttmathobjects.h +programresources.o: ../../ttmath/ttmath/ttmathparser.h +programresources.o: ../../ttmath/ttmath/ttmath.h threadcontroller.h +programresources.o: ../../ttmath/ttmath/ttmathobjects.h stopcalculating.h +programresources.o: ../../ttmath/ttmath/ttmathtypes.h convert.h +tabs.o: compileconfig.h tabs.h resource.h messages.h +tabs.o: ../../ttmath/ttmath/ttmathtypes.h programresources.h iniparser.h +tabs.o: languages.h bigtypes.h ../../ttmath/ttmath/ttmath.h +tabs.o: ../../ttmath/ttmath/ttmathbig.h ../../ttmath/ttmath/ttmathint.h +tabs.o: ../../ttmath/ttmath/ttmathuint.h ../../ttmath/ttmath/ttmathtypes.h +tabs.o: ../../ttmath/ttmath/ttmathmisc.h ../../ttmath/ttmath/ttmathuint_x86.h +tabs.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +tabs.o: ../../ttmath/ttmath/ttmathuint_noasm.h +tabs.o: ../../ttmath/ttmath/ttmaththreads.h +tabs.o: ../../ttmath/ttmath/ttmathobjects.h +tabs.o: ../../ttmath/ttmath/ttmathparser.h ../../ttmath/ttmath/ttmath.h +tabs.o: threadcontroller.h ../../ttmath/ttmath/ttmathobjects.h +tabs.o: stopcalculating.h convert.h +threadcontroller.o: threadcontroller.h ../../ttmath/ttmath/ttmathobjects.h +threadcontroller.o: stopcalculating.h compileconfig.h +threadcontroller.o: ../../ttmath/ttmath/ttmathtypes.h +update.o: compileconfig.h update.h download.h programresources.h iniparser.h +update.o: languages.h bigtypes.h ../../ttmath/ttmath/ttmath.h +update.o: ../../ttmath/ttmath/ttmathbig.h ../../ttmath/ttmath/ttmathint.h +update.o: ../../ttmath/ttmath/ttmathuint.h ../../ttmath/ttmath/ttmathtypes.h +update.o: ../../ttmath/ttmath/ttmathmisc.h +update.o: ../../ttmath/ttmath/ttmathuint_x86.h +update.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +update.o: ../../ttmath/ttmath/ttmathuint_noasm.h +update.o: ../../ttmath/ttmath/ttmaththreads.h +update.o: ../../ttmath/ttmath/ttmathobjects.h +update.o: ../../ttmath/ttmath/ttmathparser.h ../../ttmath/ttmath/ttmath.h +update.o: threadcontroller.h ../../ttmath/ttmath/ttmathobjects.h +update.o: stopcalculating.h ../../ttmath/ttmath/ttmathtypes.h convert.h +update.o: messages.h resource.h winmain.h tabs.h pad.h misc.h +variables.o: compileconfig.h tabs.h resource.h messages.h +variables.o: ../../ttmath/ttmath/ttmathtypes.h programresources.h iniparser.h +variables.o: languages.h bigtypes.h ../../ttmath/ttmath/ttmath.h +variables.o: ../../ttmath/ttmath/ttmathbig.h ../../ttmath/ttmath/ttmathint.h +variables.o: ../../ttmath/ttmath/ttmathuint.h +variables.o: ../../ttmath/ttmath/ttmathtypes.h +variables.o: ../../ttmath/ttmath/ttmathmisc.h +variables.o: ../../ttmath/ttmath/ttmathuint_x86.h +variables.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +variables.o: ../../ttmath/ttmath/ttmathuint_noasm.h +variables.o: ../../ttmath/ttmath/ttmaththreads.h +variables.o: ../../ttmath/ttmath/ttmathobjects.h +variables.o: ../../ttmath/ttmath/ttmathparser.h ../../ttmath/ttmath/ttmath.h +variables.o: threadcontroller.h ../../ttmath/ttmath/ttmathobjects.h +variables.o: stopcalculating.h convert.h +winmain.o: compileconfig.h winmain.h programresources.h iniparser.h +winmain.o: languages.h bigtypes.h ../../ttmath/ttmath/ttmath.h +winmain.o: ../../ttmath/ttmath/ttmathbig.h ../../ttmath/ttmath/ttmathint.h +winmain.o: ../../ttmath/ttmath/ttmathuint.h ../../ttmath/ttmath/ttmathtypes.h +winmain.o: ../../ttmath/ttmath/ttmathmisc.h +winmain.o: ../../ttmath/ttmath/ttmathuint_x86.h +winmain.o: ../../ttmath/ttmath/ttmathuint_x86_64.h +winmain.o: ../../ttmath/ttmath/ttmathuint_noasm.h +winmain.o: ../../ttmath/ttmath/ttmaththreads.h +winmain.o: ../../ttmath/ttmath/ttmathobjects.h +winmain.o: ../../ttmath/ttmath/ttmathparser.h ../../ttmath/ttmath/ttmath.h +winmain.o: threadcontroller.h ../../ttmath/ttmath/ttmathobjects.h +winmain.o: stopcalculating.h ../../ttmath/ttmath/ttmathtypes.h convert.h +winmain.o: resource.h messages.h tabs.h pad.h update.h download.h diff --git a/src/Makefile.dep b/src/Makefile.dep deleted file mode 100644 index c41eb21..0000000 --- a/src/Makefile.dep +++ /dev/null @@ -1,53 +0,0 @@ -# add "resource.o" to "o" as well -o = resource.o calculation.o convert.o download.o functions.o iniparser.o languages.o mainwindow.o misc.o pad.o parsermanager.o programresources.o tabs.o threadcontroller.o update.o variables.o winmain.o - - -calculation.o: calculation.cpp compileconfig.h parsermanager.h resource.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h tabs.h messages.h -convert.o: convert.cpp convert.h compileconfig.h bigtypes.h -download.o: download.cpp compileconfig.h download.h -functions.o: functions.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h -iniparser.o: iniparser.cpp compileconfig.h iniparser.h -languages.o: languages.cpp compileconfig.h languages.h bigtypes.h -mainwindow.o: mainwindow.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h tabs.h pad.h update.h download.h misc.h -misc.o: misc.cpp -pad.o: pad.cpp programresources.h compileconfig.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h pad.h -parsermanager.o: parsermanager.cpp compileconfig.h parsermanager.h resource.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h tabs.h messages.h -programresources.o: programresources.cpp compileconfig.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h -tabs.o: tabs.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h -threadcontroller.o: threadcontroller.cpp threadcontroller.h stopcalculating.h compileconfig.h -update.o: update.cpp compileconfig.h update.h download.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h messages.h resource.h winmain.h tabs.h pad.h misc.h -variables.o: variables.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h -winmain.o: winmain.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h tabs.h pad.h update.h download.h - - - -.SUFFIXES: .cpp .o - -.cpp.o: - $(CC) -c $(CFLAGS) $< - - -helpdep = ../help/accuracy.html \ -../help/arithmetic_functions.html \ -../help/bitwise_functions.html \ -../help/conversions_deg_rad_grad.html \ -../help/help.hhp \ -../help/hyperbolic_functions.html \ -../help/index.hhk \ -../help/index.html \ -../help/inverse_hyperbolic_functions.html \ -../help/inverse_trigonometric_functions.html \ -../help/logarithm_exponential.html \ -../help/logical_functions.html \ -../help/operators_priority.html \ -../help/other_functions.html \ -../help/rounding_functions.html \ -../help/styles.css \ -../help/tips.html \ -../help/toc.hhc \ -../help/trigonometric_functions.html \ -../help/userfunctions.html \ -../help/values_and_std_operators.html - - -setupdep = ttcalc help ../setup/innosetup.iss ../setup/COPYRIGHT ../COPYRIGHT ../CHANGELOG ../README diff --git a/src/Makefile.help.dep b/src/Makefile.help.dep new file mode 100644 index 0000000..0fe3a1d --- /dev/null +++ b/src/Makefile.help.dep @@ -0,0 +1 @@ +helpsrc = ../help/accuracy.html ../help/arithmetic_functions.html ../help/bitwise_functions.html ../help/conversions_deg_rad_grad.html ../help/help.hhp ../help/hyperbolic_functions.html ../help/index.hhk ../help/index.html ../help/inverse_hyperbolic_functions.html ../help/inverse_trigonometric_functions.html ../help/logarithm_exponential.html ../help/logical_functions.html ../help/operators_priority.html ../help/other_functions.html ../help/rounding_functions.html ../help/styles.css ../help/tips.html ../help/toc.hhc ../help/trigonometric_functions.html ../help/userfunctions.html ../help/values_and_std_operators.html \ No newline at end of file diff --git a/src/Makefile.o.dep b/src/Makefile.o.dep new file mode 100644 index 0000000..caf2064 --- /dev/null +++ b/src/Makefile.o.dep @@ -0,0 +1 @@ +o = resource.o calculation.o convert.o download.o functions.o iniparser.o languages.o mainwindow.o misc.o pad.o parsermanager.o programresources.o tabs.o threadcontroller.o update.o variables.o winmain.o \ No newline at end of file diff --git a/src/Makefileportable b/src/Makefileportable index 67ffc53..08b2de0 100644 --- a/src/Makefileportable +++ b/src/Makefileportable @@ -1,21 +1,31 @@ +include Makefile.o.dep +include Makefile.help.dep + + CC = g++ CFLAGS = -Wall -pedantic -s -Os -fno-default-inline -mwindows -I../../ttmath -DTTCALC_PORTABLE -DTTMATH_DONT_USE_WCHAR name = ttcalcp.exe compressor = upx + + all: ttcalc -include Makefile.dep -ttcalc: $(o) +%.o: %.cpp + $(CC) -c $(CFLAGS) $< + + +ttcalc: $(name) + + +$(name): $(o) $(CC) -o $(name) $(CFLAGS) $(o) -lcomctl32 -lwininet $(compressor) -7 $(name) - + + resource.o: resource.rc windres -DTTCALC_PORTABLE resource.rc resource.o -clean: - rm -f *.o - rm -f $(name) - rm -f ../help/$(helpname) +include Makefile.cpp.dep diff --git a/src/languages.cpp b/src/languages.cpp index 87763d5..43515d3 100644 --- a/src/languages.cpp +++ b/src/languages.cpp @@ -37,9 +37,39 @@ #include "compileconfig.h" #include "languages.h" +#include +void Languages::SelectCurrentLanguage(const std::string & lang) +{ + // those names should be the same as in [Languages] section in innosetup.iss file + + const char * langtab[] = { + "english", + "polish", + "spanish", + "danish", + "chinese", + "russian", + "swedish", + "italian", + "german" }; + + current_country = en; // default is english + size_t len = sizeof(langtab) / sizeof(const char*); + size_t i; + + for(i=0 ; i= (int)Languages::lastnotexisting ) + c = en; + current_country = c; } + void SelectCurrentLanguage(const std::string & lang); + + Country GetCurrentLanguage() { return current_country; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d4a97cc..10f88ab 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1429,10 +1429,13 @@ MENUITEMINFO mi; mi.dwTypeData = const_cast(GetPrgRes()->GetLanguages()->GuiMessage(Languages::menu_update_available)); mi.cch = 0; mi.wID = IDM_UPDATE_AVAILABLE; - + HMENU menu = GetMenu(hWnd); - InsertMenuItem(menu, IDM_UPDATE_AVAILABLE_INDEX, true, &mi); + if( !menu ) + return true; + + InsertMenuItem(menu, IDM_UPDATE_AVAILABLE_INDEX, true, &mi); GetPrgRes()->SetUpdateExists(true); // used for the dynamic menu (for changing languages) DrawMenuBar(hWnd); diff --git a/src/programresources.cpp b/src/programresources.cpp index 0fd3170..0830d42 100644 --- a/src/programresources.cpp +++ b/src/programresources.cpp @@ -619,7 +619,7 @@ void ProgramResources::SetGroupingDigits(int digits) grouping_digits = digits; if( grouping_digits < 1 || grouping_digits > 9 ) - grouping_digits = 1; + grouping_digits = 3; // 3 by default } @@ -1106,6 +1106,7 @@ IniParser iparser; IniParser::Section temp_variables, temp_functions; IniParser::Section::iterator ic; std::string ini_value[30]; +std::string language_setup; iparser.ConvertValueToSmallLetters(false); iparser.SectionCaseSensitive(false); @@ -1113,6 +1114,7 @@ std::string ini_value[30]; // we have variables and functions case-sensitive iparser.PatternCaseSensitive(true); + iparser.Associate( "global|language.setup", &language_setup ); iparser.Associate( "global|always.on.top", &ini_value[0] ); iparser.Associate( "global|view", &ini_value[1] ); iparser.Associate( "global|maximized", &ini_value[2] ); @@ -1152,72 +1154,94 @@ std::string ini_value[30]; if( err == IniParser::err_cant_open_file ) return err; - AddVariablesFunctions(temp_variables, temp_functions, false); - - // we're setting various values - always_on_top = bool( atoi(ini_value[0].c_str()) ); - view = atoi(ini_value[1].c_str()) == 0 ? view_normal : view_compact; - maximized = bool( atoi(ini_value[2].c_str()) ); - - x_pos = atoi( ini_value[3].c_str() ); - y_pos = atoi( ini_value[4].c_str() ); - x_size = atoi( ini_value[5].c_str() ); - y_size = atoi( ini_value[12].c_str() ); - CheckCoordinates(); - - SetPrecision( atoi(ini_value[6].c_str()) ); - SetBaseInput( atoi(ini_value[7].c_str()) ); - SetBaseOutput( atoi(ini_value[8].c_str()) ); - - SetDisplayAlwaysScientific( bool(atoi(ini_value[9].c_str())) ); - SetDisplayWhenScientific( atoi(ini_value[10].c_str()) ); - SetDisplayRounding( atoi(ini_value[11].c_str()) ); - - // remove zeroes - in there is not in the config then will be true by default - // (from the constructor) - if( !ini_value[15].empty() ) - SetRemovingZeroes( bool(atoi(ini_value[15].c_str())) ); - - - int lang_int = atoi(ini_value[13].c_str()); - - if( lang_int < 0 || lang_int > 8 ) - lang_int = 0; - - languages.SetCurrentLanguage((Languages::Country)lang_int); - - SetDecimalPoint( atoi(ini_value[14].c_str()) ); - SetDegRadGrad( atoi(ini_value[16].c_str()) ); - - pad_x_pos = atoi( ini_value[17].c_str() ); - pad_y_pos = atoi( ini_value[18].c_str() ); - pad_x_size = atoi( ini_value[19].c_str() ); - pad_y_size = atoi( ini_value[20].c_str() ); - pad_maximized = bool( atoi(ini_value[21].c_str()) ); - show_pad = bool( atoi(ini_value[22].c_str()) ); - CheckPadCoordinates(); - - SetGrouping( atoi(ini_value[23].c_str()) ); - SetInputDecimalPoint( atoi(ini_value[24].c_str()) ); - SetParamSep( atoi(ini_value[24].c_str()) ); - if( err != IniParser::err_ok ) bad_line = iparser.GetBadLine(); - // check update at startup - true by default (if there is not in the config) - // (default from the constructor) - if( !ini_value[26].empty() ) - check_update_startup = bool( atoi(ini_value[26].c_str()) ); + AddVariablesFunctions(temp_variables, temp_functions, false); - last_update = (time_t)atol(ini_value[27].c_str()); + // the first file is created by the installer and has only language.setup option + // if the rest options are not set then we are not calling ReadGlobalSection() + if( IsGlobalSectionSet(ini_value, sizeof(ini_value)/sizeof(std::string)) ) + ReadGlobalSection(ini_value); - if( !ini_value[28].empty() ) - SetGroupingDigits( atoi(ini_value[28].c_str()) ); + if( !language_setup.empty() ) + languages.SelectCurrentLanguage(language_setup); // we don't have to remember this variable return err; } +int ProgramResources::Int(const std::string & text) +{ + return atoi(text.c_str()); +} + + +bool ProgramResources::IsGlobalSectionSet(std::string * ini_value, size_t len) +{ + for(size_t i=0 ; iGetMainWindow(); - SendMessage(main, WM_UPDATE_EXISTS, 0, 0); + PostMessage(main, WM_UPDATE_EXISTS, 0, 0); } } catch(...) @@ -658,8 +658,8 @@ void CheckUpdateInBackground() time_t last = GetPrgRes()->GetLastUpdate(); time_t now = time(0); - // testing only once a day (86400 = 60*60*24) - if( GetPrgRes()->GetCheckUpdateStartup() && last+86400 < now ) + // testing only once a three days (259200 = 60*60*24 * 3) + if( GetPrgRes()->GetCheckUpdateStartup() && last+259200 < now ) { // this setting can be added also when a user selects manually the test for an update GetPrgRes()->SetLastUpdate(now);