changed: now ttcalc only once a three days checks for an update

fixed:   option: "parameters separated by" was not correctly read from the config file
added:   the setup program now addes language.setup key to the ttcalc.ini
         (it creates ttcalc.ini if it doesn't exist)
         so when ttcalc starts for the first time it can choose the same language



git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@352 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2011-06-03 22:41:55 +00:00
parent 547f01bf34
commit c4f316d7d3
16 changed files with 391 additions and 155 deletions

View File

@ -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 <morbel at gmx.net>
* 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):

View File

@ -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

View File

@ -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

176
src/Makefile.cpp.dep Normal file
View File

@ -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

View File

@ -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

1
src/Makefile.help.dep Normal file
View File

@ -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

1
src/Makefile.o.dep Normal file
View File

@ -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

View File

@ -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

View File

@ -37,9 +37,39 @@
#include "compileconfig.h"
#include "languages.h"
#include <string.h>
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<len ; ++i)
{
if( strcmp(lang.c_str(), langtab[i]) == 0 )
{
SetCurrentLanguage((Languages::Country)i);
break;
}
}
}
const char * Languages::ErrorMessage(Country country, ttmath::ErrorCode code)
{
@ -604,7 +634,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(update_button_next, "Next");
InsertGuiPair(update_button_finish, "Finish");
InsertGuiPair(update_button_cancel, "Cancel");
InsertGuiPair(update_check_at_startup, "Always check for the update on startup");
InsertGuiPair(update_check_at_startup, "Once every three days check for an update automatically");
InsertGuiPair(update_check_for_info, "Press Next to check for the update...");
InsertGuiPair(update_is_new_version, "Version %d.%d.%d is available, press Next to download...");
InsertGuiPair(update_no_new_version1, "There is not a newer version available.");
@ -811,7 +841,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(update_button_next, "Dalej");
InsertGuiPair(update_button_finish, "Zakoñcz");
InsertGuiPair(update_button_cancel, "Anuluj");
InsertGuiPair(update_check_at_startup, "Zawsze sprawdzaj aktualizacje podczas uruchamiania");
InsertGuiPair(update_check_at_startup, "Raz na trzy dni sprawdŸ dostêpnoœæ aktualizacji automatycznie");
InsertGuiPair(update_check_for_info, "Wciœnij Dalej aby sprawdziæ dostêpnoœæ aktualizacji...");
InsertGuiPair(update_is_new_version, "Wersja %d.%d.%d jest dostêpna, wciœnij Dalej aby j¹ pobraæ...");
InsertGuiPair(update_no_new_version1, "Nie ma dostêpnej nowszej wersji programu.");
@ -1024,7 +1054,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(update_button_next, "Siguiente");
InsertGuiPair(update_button_finish, "Finalizar");
InsertGuiPair(update_button_cancel, "Cancelar");
InsertGuiPair(update_check_at_startup, "Comprobar siempre al comienzo si hay una nueva versión");
InsertGuiPair(update_check_at_startup, "Comprobar siempre al comienzo si hay una nueva versión"); // this text has been changed, need correction!
InsertGuiPair(update_check_for_info, "Pulse Siguiente para ver si hay actualizaciones...");
InsertGuiPair(update_is_new_version, "La versión %d.%d.%d está disponible, pulse Siguiente para descargar...");
InsertGuiPair(update_no_new_version1, "No hay versiones nuevas disponibles.");
@ -1234,7 +1264,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(update_button_next, "Næste");
InsertGuiPair(update_button_finish, "Færdig");
InsertGuiPair(update_button_cancel, "Annuler");
InsertGuiPair(update_check_at_startup, "Tjek altid for opdateringer ved opstart");
InsertGuiPair(update_check_at_startup, "Tjek altid for opdateringer ved opstart"); // this text has been changed, need correction!
InsertGuiPair(update_check_for_info, "Tryk på Næste for at tjekke for opdateringen...");
InsertGuiPair(update_is_new_version, "Version %d.%d.%d er tilgængelig, tryk på Næste for at downloade...");
InsertGuiPair(update_no_new_version1, "Der er ingen ny version tilgængelig.");
@ -1444,7 +1474,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(update_button_next, "ÏÂÒ»²½");
InsertGuiPair(update_button_finish, "Íê³É");
InsertGuiPair(update_button_cancel, "È¡Ïû");
InsertGuiPair(update_check_at_startup, "Æô¶¯Ê±×ÜÊǼì²é¸üÐÂ");
InsertGuiPair(update_check_at_startup, "Æô¶¯Ê±×ÜÊǼì²é¸üÐÂ"); // this text has been changed, need correction!
InsertGuiPair(update_check_for_info, "°´\"ÏÂÒ»²½\"½øÐиüÐÂ...");
InsertGuiPair(update_is_new_version, "°æ±¾ %d.%d.%d ¿ÉÓÃ, °´\"ÏÂÒ»²½\"ÏÂÔØ...");
InsertGuiPair(update_no_new_version1, "ûÓпÉÓõÄа汾¡£");
@ -1659,7 +1689,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(update_button_next, "Äàëåå");
InsertGuiPair(update_button_finish, "Ãîòîâî");
InsertGuiPair(update_button_cancel, "Îòìåíà");
InsertGuiPair(update_check_at_startup, "Ïðîâåðÿòü íàëè÷èå îáíîâëåíèé ïðè çàãðóçêå ïðîãðàììû");
InsertGuiPair(update_check_at_startup, "Ïðîâåðÿòü íàëè÷èå îáíîâëåíèé ïðè çàãðóçêå ïðîãðàììû"); // this text has been changed, need correction!
InsertGuiPair(update_check_for_info, "Íàæìèòå Äàëåå, ÷òîáû ïðîâåðèòü íàëè÷èå îáíîâëåíèé...");
InsertGuiPair(update_is_new_version, "Äîñòóïíà âåðñèÿ %d.%d.%d, íàæìèòå Äàëåå, ÷òîáû ñêà÷àòü å¸...");
InsertGuiPair(update_no_new_version1, "Íåò íîâûõ âåðñèé.");
@ -2079,7 +2109,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(update_button_next, "Continua");
InsertGuiPair(update_button_finish, "Finito");
InsertGuiPair(update_button_cancel, "Annulla");
InsertGuiPair(update_check_at_startup, "Controlla sempre aggiornamenti all'avvio");
InsertGuiPair(update_check_at_startup, "Controlla sempre aggiornamenti all'avvio"); // this text has been changed, need correction!
InsertGuiPair(update_check_for_info, "Premi Continua per controllare gli aggiornamenti...");
InsertGuiPair(update_is_new_version, "Versione %d.%d.%d disponibile, premi Continua per scaricare...");
InsertGuiPair(update_no_new_version1, "Nessuna versione nuova disponibile.");
@ -2287,7 +2317,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(update_button_next, "Weiter");
InsertGuiPair(update_button_finish, "Ende");
InsertGuiPair(update_button_cancel, "Abbrechen");
InsertGuiPair(update_check_at_startup, "Beim Start des Programms immer nach Update suchen");
InsertGuiPair(update_check_at_startup, "Beim Start des Programms immer nach Update suchen"); // this text has been changed, need correction!
InsertGuiPair(update_check_for_info, "\"Weiter\", um die Update-Suche zu starten...");
InsertGuiPair(update_is_new_version, "Version %d.%d.%d ist verfügbar \"Weiter\", um den Download zu starten...");
InsertGuiPair(update_no_new_version1, "Es ist keine neuere Version verfügbar.");

View File

@ -201,9 +201,11 @@ public:
// the first item must be with zero index
// and next items must be about one greater (0,1,2,3..)
// (after conversion to 'int' we pass it into the std::vector)
// lastnotexisting should be the last item
// make sure SelectCurrentLanguage(const std::string & lang) is able to recognize a language
enum Country
{
en = 0, pl, sp, da, chn, ru, swe, it, ger
en = 0, pl, sp, da, chn, ru, swe, it, ger, lastnotexisting
};
@ -238,9 +240,18 @@ public:
void SetCurrentLanguage(Country c)
{
// we are reading a language from *.ini file
// and it is stored as a number
if( int(c) < 0 || int(c) >= (int)Languages::lastnotexisting )
c = en;
current_country = c;
}
void SelectCurrentLanguage(const std::string & lang);
Country GetCurrentLanguage()
{
return current_country;

View File

@ -1431,8 +1431,11 @@ MENUITEMINFO mi;
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);

View File

@ -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 ; i<len ; ++i)
if( !ini_value[i].empty() )
return true;
return false;
}
void ProgramResources::ReadGlobalSection(std::string * ini_value)
{
always_on_top = Int(ini_value[0]) == 1;
view = Int(ini_value[1]) == 0 ? view_normal : view_compact;
maximized = Int(ini_value[2]) == 1;
x_pos = Int( ini_value[3] );
y_pos = Int( ini_value[4] );
x_size = Int( ini_value[5] );
y_size = Int( ini_value[12] );
CheckCoordinates();
SetPrecision( Int(ini_value[6]) );
SetBaseInput( Int(ini_value[7]) );
SetBaseOutput( Int(ini_value[8]) );
SetDisplayAlwaysScientific( Int(ini_value[9]) == 1 );
SetDisplayWhenScientific( Int(ini_value[10]) );
SetDisplayRounding( Int(ini_value[11]) );
languages.SetCurrentLanguage((Languages::Country)Int(ini_value[13]));
SetDecimalPoint( Int(ini_value[14]) );
// remove zeroes - if there is not in the config then will be true by default
// (from the constructor)
if( !ini_value[15].empty() )
SetRemovingZeroes( Int(ini_value[15]) == 1 );
SetDegRadGrad( Int(ini_value[16]) );
pad_x_pos = Int( ini_value[17] );
pad_y_pos = Int( ini_value[18] );
pad_x_size = Int( ini_value[19] );
pad_y_size = Int( ini_value[20] );
pad_maximized = Int(ini_value[21]) == 1;
show_pad = Int(ini_value[22]) == 1;
CheckPadCoordinates();
SetGrouping( Int(ini_value[23]) );
SetInputDecimalPoint( Int(ini_value[24]) );
SetParamSep( Int(ini_value[25]) );
// check update once a three day - true by default (if there is not in the config)
// (default from the constructor)
if( !ini_value[26].empty() )
check_update_startup = Int(ini_value[26]) == 1;
last_update = (time_t)atol(ini_value[27].c_str());
SetGroupingDigits( Int(ini_value[28]) );
}
void ProgramResources::SaveToFile()
{

View File

@ -505,7 +505,9 @@ private:
void CheckCoordinates();
void CheckPadCoordinates();
void AddVariablesFunctions(IniParser::Section & temp_variables, IniParser::Section & temp_functions, bool if_not_exist);
void ReadGlobalSection(std::string * ini_value);
int Int(const std::string & text);
bool IsGlobalSectionSet(std::string * ini_value, size_t len);
ttmath::Objects variables;
ttmath::Objects functions;

View File

@ -361,20 +361,20 @@ BEGIN
END
#endif
IDD_UPDATE_DIALOG DIALOG DISCARDABLE 0, 0, 357, 86
IDD_UPDATE_DIALOG DIALOG DISCARDABLE 0, 0, 409, 87
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Check for update"
FONT 8, "MS Sans Serif"
BEGIN
CTEXT "Checking for update",IDC_UPDATE_INFO1,7,15,343,10
CTEXT "Checking for update",IDC_UPDATE_INFO1,7,15,394,10
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,
38,343,14
DEFPUSHBUTTON "Next",IDC_BUTTON_NEXT,226,65,60,14
PUSHBUTTON "Cancel",IDC_BUTTON_CANCEL,290,65,60,14
CTEXT "url",IDC_UPDATE_INFO2,7,26,343,8
38,395,14
DEFPUSHBUTTON "Next",IDC_BUTTON_NEXT,279,65,60,14
PUSHBUTTON "Cancel",IDC_BUTTON_CANCEL,342,65,60,14
CTEXT "url",IDC_UPDATE_INFO2,7,26,394,8
CONTROL "Always check for the update on sturtup",
IDC_CHECK_UPDATE_STURTUP,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,67,206,10
WS_TABSTOP,7,67,269,10
END
#ifndef TTCALC_PORTABLE

View File

@ -935,6 +935,7 @@ TCITEM tab;
}
BOOL WmTabCommand_SetPrecision1(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
#ifndef TTCALC_PORTABLE

View File

@ -599,7 +599,7 @@ using namespace Background;
if( CheckUpdateFromIni(0, url_, remote_file_name_, major_, minor_, revision_, prerelease_, 0) )
{
HWND main = GetPrgRes()->GetMainWindow();
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);