Browse Source

changed: the program is testing for the update only once a day

updated: translations


git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@243 e52654a7-88a9-db11-a3e9-0013d4bc506e
master
Tomasz Sowa 13 years ago
parent
commit
6f48d6414f
  1. 89
      src/languages.cpp
  2. 22
      src/programresources.cpp
  3. 9
      src/programresources.h
  4. 2
      src/ttcalc_update.ini
  5. 11
      src/update.cpp

89
src/languages.cpp

@ -463,7 +463,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_danish, "&Danish");
InsertGuiPair(menu_view_lang_chinese, "&Chinese");
InsertGuiPair(menu_view_lang_russian, "&Russian");
InsertGuiPair(menu_view_lang_swedish, "&Swedish");
InsertGuiPair(menu_view_lang_swedish, "S&wedish");
InsertGuiPair(menu_view_close_program, "&Close");
InsertGuiPair(menu_edit_undo, "&Undo \tCtrl+Z");
InsertGuiPair(menu_edit_cut, "Cu&t \tCtrl+X");
@ -474,7 +474,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_edit_copy_result, "Copy &result \tCtrl+R");
InsertGuiPair(menu_edit_copy_both, "Copy &both \tCtrl+B"); // copying in this way: "input edit = output edit"
InsertGuiPair(menu_edit_select_all, "Select &all \tEsc");
InsertGuiPair(menu_edit_bracket, "Bracke&t \tCtrl+0"); // inserting brackets: (...)
InsertGuiPair(menu_edit_bracket, "Brac&ket \tCtrl+0"); // inserting brackets: (...)
InsertGuiPair(menu_help_help, "&Help");
InsertGuiPair(menu_help_project_page, "&Project page");
InsertGuiPair(menu_help_check_update, "&Check update...");
@ -661,15 +661,15 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_russian, "&Rosyjski");
InsertGuiPair(menu_view_lang_swedish, "&Szwedzki");
InsertGuiPair(menu_view_close_program, "&Zamknij");
InsertGuiPair(menu_edit_undo, "&Cofnij");
InsertGuiPair(menu_edit_undo, "&Cofnij \tCtrl+Z");
InsertGuiPair(menu_edit_cut, "Wy&tnij \tCtrl+X");
InsertGuiPair(menu_edit_copy, "&Kopiuj \tCtrl+C");
InsertGuiPair(menu_edit_paste, "&Wklej");
InsertGuiPair(menu_edit_del, "&Usuñ \tDel");
InsertGuiPair(menu_edit_paste_formula, "&Wklej formu酬 \tCtrl+V");
InsertGuiPair(menu_edit_copy_result, "&Kopiuj wynik \tCtrl+R");
InsertGuiPair(menu_edit_paste_formula, "Wklej &formu³ê \tCtrl+V");
InsertGuiPair(menu_edit_copy_result, "Kopiuj w&ynik \tCtrl+R");
InsertGuiPair(menu_edit_copy_both, "Kopiuj &obydwa \tCtrl+B");
InsertGuiPair(menu_edit_select_all, "Zaznacz &wszystko \tEsc");
InsertGuiPair(menu_edit_select_all, "Zaznacz w&szystko \tEsc");
InsertGuiPair(menu_edit_bracket, "&Nawiasy \tCtrl+0");
InsertGuiPair(menu_help_help, "&Pomoc");
InsertGuiPair(menu_help_project_page, "&Strona projektu");
@ -864,17 +864,17 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_edit_copy, "&Copiar \tCtrl+C");
InsertGuiPair(menu_edit_paste, "&Pegar"); // cutting, copying, pasting the the edit which has a focus
InsertGuiPair(menu_edit_del, "&Borrar \tDel");
InsertGuiPair(menu_edit_copy_result, "&Copiar resultado");
InsertGuiPair(menu_edit_copy_result, "Copiar &resultado \tCtrl+R");
InsertGuiPair(menu_edit_copy_both, "Copiar &ambos \tCtrl+B"); // copying in this way: "input edit = output edit"
InsertGuiPair(menu_edit_paste_formula, "Pegar &fórmula\tCtrl+V"); // pasting directly to the input edit
InsertGuiPair(menu_edit_select_all, "Seleccionar &todo \tEsc");
InsertGuiPair(menu_edit_bracket, "Corche&tes \tCtrl+0"); // inserting brackets: (...)
InsertGuiPair(menu_edit_bracket, "C&orchetes \tCtrl+0"); // inserting brackets: (...)
InsertGuiPair(menu_update_available, "&Nueva versión disponible");
InsertGuiPair(menu_help_help, "&Ayuda");
InsertGuiPair(menu_help_project_page, "&Pagina del proyecto");
InsertGuiPair(menu_help_check_update, "&Comprobar actualizaciones...");
InsertGuiPair(menu_help_about, "&Acerca de");
InsertGuiPair(menu_help_about, "Acerca &de");
InsertGuiPair(cant_init_calculations, "No se puede inicializar el modulo de cálculo");
InsertGuiPair(message_box_error_caption,"TTCalc");
@ -1047,28 +1047,28 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_normal_view, "No&rmal visning");
InsertGuiPair(menu_view_compact_view, "K&ompakt visning");
InsertGuiPair(menu_view_always_on_top, "&Altid øverst");
InsertGuiPair(menu_view_pad, "&Pad");
InsertGuiPair(menu_view_pad, "Re&digeringsvindue");
InsertGuiPair(menu_view_lang_english, "&Engelsk");
InsertGuiPair(menu_view_lang_polish, "&Polsk");
InsertGuiPair(menu_view_lang_spanish, "&Spansk");
InsertGuiPair(menu_view_lang_danish, "&Dansk");
InsertGuiPair(menu_view_lang_chinese, "&Kinesisk");
InsertGuiPair(menu_view_lang_russian, "&Russisk");
InsertGuiPair(menu_view_lang_swedish, "&Svensk");
InsertGuiPair(menu_view_close_program, "&Afslut");
InsertGuiPair(menu_edit_undo, "&Fortryd");
InsertGuiPair(menu_view_lang_swedish, "S&vensk");
InsertGuiPair(menu_view_close_program, "Afslu&t");
InsertGuiPair(menu_edit_undo, "&Fortryd \tCtrl+Z");
InsertGuiPair(menu_edit_cut, "Kli&p \tCtrl+X");
InsertGuiPair(menu_edit_copy, "&Kopier \tCtrl+C");
InsertGuiPair(menu_edit_paste, "&Sæt ind"); // cutting, copying, pasting the the edit which has a focus
InsertGuiPair(menu_edit_del, "&Slet \tDel");
InsertGuiPair(menu_edit_copy_result, "Kopier &resultatet");
InsertGuiPair(menu_edit_del, "S&let \tDel");
InsertGuiPair(menu_edit_copy_result, "Kopier &resultatet \tCtrl+R");
InsertGuiPair(menu_edit_copy_both, "Kopier &begge \tCtrl+B"); // copying in this way: "input edit = output edit"
InsertGuiPair(menu_edit_paste_formula, "Inds鎡 &formular\tCtrl+V"); // pasting directly to the input edit
InsertGuiPair(menu_edit_paste_formula, "Indsæt f&ormular\tCtrl+V"); // pasting directly to the input edit
InsertGuiPair(menu_edit_select_all, "Marker &alt \tEsc");
InsertGuiPair(menu_edit_bracket, "Bracke&t \tCtrl+0"); // inserting brackets: (...)
InsertGuiPair(menu_help_help, "&Hjælp");
InsertGuiPair(menu_help_project_page, "&Projekt side");
InsertGuiPair(menu_help_check_update, "&Opdater...");
InsertGuiPair(menu_help_check_update, "O&pdater...");
InsertGuiPair(menu_help_about, "&Om");
InsertGuiPair(menu_update_available, "Der er en &ny version tilgængelig");
@ -1137,7 +1137,7 @@ void Languages::InitGuiMessagesTab()
#endif
InsertGuiPair(update_download_error, "Der var et problem ved download, prøv igen senere.");
InsertGuiPair(pad_title, "Pad");
InsertGuiPair(pad_title, "Redigeringsvindue");
InsertGuiPair(pad_menu_file, "&Fil");
InsertGuiPair(pad_menu_edit, "&Rediger");
InsertGuiPair(pad_menu_file_new, "&Ny"); // temporarily not used
@ -1249,13 +1249,13 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_russian, "&Russian");
InsertGuiPair(menu_view_lang_swedish, "&Swedish");
InsertGuiPair(menu_view_close_program, "&¹Ø±Õ");
InsertGuiPair(menu_edit_undo, "&取消");
InsertGuiPair(menu_edit_undo, "&È¡Ïû \tCtrl+Z");
InsertGuiPair(menu_edit_cut, "Cu&t \tCtrl+X");
InsertGuiPair(menu_edit_copy, "&Copy \tCtrl+C");
InsertGuiPair(menu_edit_paste, "&Paste");
InsertGuiPair(menu_edit_del, "&Delete \tDel");
InsertGuiPair(menu_edit_paste_formula, "&Õ³Ìù");
InsertGuiPair(menu_edit_copy_result, "&复制结果");
InsertGuiPair(menu_edit_copy_result, "&¸´Öƽá¹û \tCtrl+R");
InsertGuiPair(menu_edit_copy_both, "Copy &both \tCtrl+B");
InsertGuiPair(menu_edit_select_all, "Select &all \tEsc");
InsertGuiPair(menu_edit_bracket, "Bracke&t \tCtrl+0");
@ -1293,13 +1293,16 @@ void Languages::InitGuiMessagesTab()
"\r\n"
#endif
"Translations:\r\n"
"English Author\r\n" // one tabulator between language and the name of the author
"Polish Author\r\n"
"Spanish Alejandro S. Valdezate <alesanval@gmail.com>\r\n"
"Danish Rune Bisgaard Vammen <runebisgaard@gmail.com>\r\n"
"Chinese Juis <zsyfly@gmail.com>\r\n"
"Russian Vladimir Gladilovich <vdgladilovich@gmail.com>\r\n"
"Swedish Lars 'Bafvert' Gafvert <lars.gafvert@gmail.com>\r\n"
"Spanish Alejandro S. Valdezate\r\n"
" alesanval@gmail.com\r\n"
"Danish Rune Bisgaard Vammen\r\n"
" runebisgaard@gmail.com\r\n"
"Chinese Juis\r\n"
" zsyfly@gmail.com\r\n"
"Russian Vladimir Gladilovich\r\n"
" vdgladilovich@gmail.com\r\n"
"Swedish Lars 'Bafvert' Gafvert\r\n"
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " portable version");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
@ -1443,12 +1446,11 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_close_program, "&Çàêðûòü");
InsertGuiPair(menu_edit_undo, "&Îòìåíèòü äåéñòâèå \tCtrl+Z");
InsertGuiPair(menu_edit_cut, "Âû&ðåçàòü \tCtrl+X");
InsertGuiPair(menu_edit_copy, "&Êîïèðîâàòü \tCtrl+C");
InsertGuiPair(menu_edit_paste, "&Âñòàâèòü"); // cutting, copying, pasting the the edit which has a focus
InsertGuiPair(menu_edit_del, "&Óäàëèòü \tDel");
InsertGuiPair(menu_edit_copy_result, "&暑镨痤忄螯 疱珞朦蜞<EFBFBD>");
InsertGuiPair(menu_edit_copy_result, "Ê&îïèðîâàòü ðåçóëüòàò \tCtrl+R");
InsertGuiPair(menu_edit_copy_both, "Êîïèðîâàòü ââîä &è âûâîä \tCtrl+B"); // copying in this way: "input edit = output edit"
InsertGuiPair(menu_edit_paste_formula, "Âñòàâèòü â &ôîðìóëó \tCtrl+V"); // pasting directly to the input edit
InsertGuiPair(menu_edit_select_all, "Âûä&åëèòü âñ¸ \tEsc");
@ -1497,7 +1499,7 @@ void Languages::InitGuiMessagesTab()
" zsyfly@gmail.com\r\n"
"Ðóññêèé Vladimir Gladilovich\r\n"
" vdgladilovich@gmail.com\r\n"
"剽邃耜栝 Lars 'Bafvert' Gafvert\r\n"
"Øâåäñêèé Lars 'Bafvert' Gafvert\r\n"
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " ïåðåíîñíàÿ âåðñèÿ");
@ -1640,17 +1642,17 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_chinese, "&Kinesiska");
InsertGuiPair(menu_view_lang_russian, "&Ryska");
InsertGuiPair(menu_view_lang_swedish, "S&venska");
InsertGuiPair(menu_view_close_program, "&Avsluta");
InsertGuiPair(menu_edit_undo, "&舗gra");
InsertGuiPair(menu_view_close_program, "A&vsluta");
InsertGuiPair(menu_edit_undo, "&Ångra \tCtrl+Z");
InsertGuiPair(menu_edit_cut, "Cu&t \tCtrl+X");
InsertGuiPair(menu_edit_copy, "&Copy \tCtrl+C");
InsertGuiPair(menu_edit_paste, "&Paste");
InsertGuiPair(menu_edit_del, "&Delete \tDel");
InsertGuiPair(menu_edit_paste_formula, "&Klistra in");
InsertGuiPair(menu_edit_copy_result, "&Kopiera result");
InsertGuiPair(menu_edit_paste_formula, "Klistra &in");
InsertGuiPair(menu_edit_copy_result, "&Kopiera result \tCtrl+R");
InsertGuiPair(menu_edit_copy_both, "Copy &both \tCtrl+B");
InsertGuiPair(menu_edit_select_all, "Select &all \tEsc");
InsertGuiPair(menu_edit_bracket, "Bracke&t \tCtrl+0");
InsertGuiPair(menu_edit_bracket, "B&racket \tCtrl+0");
InsertGuiPair(menu_help_help, "&Hjälp");
InsertGuiPair(menu_help_project_page, "&Projektsida");
InsertGuiPair(menu_help_check_update, "&Check update...");
@ -1685,13 +1687,16 @@ void Languages::InitGuiMessagesTab()
"\r\n"
#endif
"Translations:\r\n"
"English Author\r\n" // one tabulator between language and the name of the author
"Polish Author\r\n"
"Spanish Alejandro S. Valdezate <alesanval@gmail.com>\r\n"
"Danish Rune Bisgaard Vammen <runebisgaard@gmail.com>\r\n"
"Chinese Juis <zsyfly@gmail.com>\r\n"
"Russian Vladimir Gladilovich <vdgladilovich@gmail.com>\r\n"
"Swedish Lars 'Bafvert' Gafvert <lars.gafvert@gmail.com>\r\n"
"Spanish Alejandro S. Valdezate\r\n"
" alesanval@gmail.com\r\n"
"Danish Rune Bisgaard Vammen\r\n"
" runebisgaard@gmail.com\r\n"
"Chinese Juis\r\n"
" zsyfly@gmail.com\r\n"
"Russian Vladimir Gladilovich\r\n"
" vdgladilovich@gmail.com\r\n"
"Swedish Lars 'Bafvert' Gafvert\r\n"
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " transportabel version");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");

22
src/programresources.cpp

@ -598,6 +598,18 @@ bool ProgramResources::GetUpdateExists()
}
void ProgramResources::SetLastUpdate(time_t t)
{
last_update = t;
}
time_t ProgramResources::GetLastUpdate()
{
return last_update;
}
ProgramResources::ProgramResources()
{
@ -668,6 +680,8 @@ ProgramResources::ProgramResources()
show_pad = false;
check_update_startup = true;
update_exists = false; // for dynamic menu
last_update = 0;
}
@ -1024,7 +1038,8 @@ std::string ini_value[30];
iparser.Associate( "global|disp.grouping", &ini_value[23] );
iparser.Associate( "global|disp.input_comma", &ini_value[24] );
iparser.Associate( "global|disp.param_sep", &ini_value[25] );
iparser.Associate( "global|update_start", &ini_value[26] );
iparser.Associate( "global|update.onstartup", &ini_value[26] );
iparser.Associate( "global|update.last", &ini_value[27] );
iparser.Associate( "variables", &temp_variables );
iparser.Associate( "functions", &temp_functions );
@ -1104,6 +1119,8 @@ std::string ini_value[30];
if( !ini_value[26].empty() )
check_update_startup = bool( atoi(ini_value[26].c_str()) );
last_update = (time_t)atol(ini_value[27].c_str());
return err;
}
@ -1128,7 +1145,8 @@ std::ofstream file( configuration_file.c_str() );
file << "size.x = " << x_size << std::endl;
file << "size.y = " << y_size << std::endl;
file << "maximized = " << (int)maximized << std::endl;
file << "update_start = " << (int)check_update_startup << std::endl;
file << "update.onstartup = " << (int)check_update_startup << std::endl;
file << "update.last = " << (long)last_update << std::endl;
file << "pad = " << (int)show_pad << std::endl;
file << "pad.x = " << pad_x_pos << std::endl;
file << "pad.y = " << pad_y_pos << std::endl;

9
src/programresources.h

@ -54,6 +54,7 @@
#include <vector>
#include <cstdlib>
#include <windows.h>
#include <ctime>
/*!
@ -449,6 +450,13 @@ public:
bool GetUpdateExists();
/*!
setting/getting the time of the last update
*/
void SetLastUpdate(time_t t);
time_t GetLastUpdate();
private:
bool IsWhiteCharacter(int c);
@ -521,6 +529,7 @@ private:
bool check_update_startup;
bool update_exists;
time_t last_update;
};

2
src/ttcalc_update.ini

@ -13,7 +13,7 @@ url = http://downloads.sourceforge.net/project/ttcalc/ttcalc/ttcalc-0.8.7/ttcalc
filename = ttcalc-portable-0.8.7-bin.tar
version.major = 9
version.minor = 9
version.revision = 1
version.revision = 0
version.prerelease = 0

11
src/update.cpp

@ -272,7 +272,7 @@ DownloadIni down_ini;
if( hwnd )
down_ini.AttachProgress(GetDlgItem(hwnd, IDC_PROGRESS));
if( down_ini.DownloadUrl("http://ttcalc.sourceforge.net/ttcalc_update.ini", continue_download_) )
if( down_ini.DownloadUrl("http://update.ttmath.org/ttcalc_update.ini", continue_download_) )
{
IniParser iparser;
std::string ini_value[4];
@ -632,8 +632,15 @@ using namespace Update;
void CheckUpdateInBackground()
{
if( GetPrgRes()->GetCheckUpdateStartup() )
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 )
{
// this setting can be added also when a user selects manually the test for an update
GetPrgRes()->SetLastUpdate(now);
unsigned int thread_id;
_beginthreadex(0, 0, Update::UpdateBackgroundProc, 0, 0, &thread_id);
}

Loading…
Cancel
Save