Browse Source

added: 'prerelease' testing to the update checker

updated: Russian translations


git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@237 e52654a7-88a9-db11-a3e9-0013d4bc506e
master
Tomasz Sowa 13 years ago
parent
commit
3fd5347310
  1. 125
      src/languages.cpp
  2. 14
      src/resource.rc
  3. 9
      src/ttcalc_update.ini
  4. 20
      src/update.cpp

125
src/languages.cpp

@ -272,8 +272,7 @@ void Languages::InitErrorMessagesTab()
InsertErrorPair(ttmath::err_functions_loop,"Ôóíêöèè ðåêóððåíòíû");
InsertErrorPair(ttmath::err_must_be_only_one_value,"Ïåðåìåííûå èëè ôóíêöèè äîëæíû âîçâðàùàòü òîëüêî îäíî çíà÷åíèå");
InsertErrorPair(ttmath::err_still_calculating,"Ïîäñ÷èòûâàåì...");
InsertErrorPair(ttmath::err_percent_from,"Incorrectly used percentage operator");
InsertErrorPair(ttmath::err_percent_from,"Íåïðàâèëüíîå èñïîëüçîâàíèå îïåðàòîðà ïðîöåíòà");
/*
swedish messages relating to ttmath library
@ -1390,20 +1389,21 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(display_always_scientific,"Âñåãäà");
InsertGuiPair(display_not_always_scientific,"Êîãäà ïîêàçàòåëü ñòåïåíè áîëüøå");
InsertGuiPair(display_group_scientific, "Âûâîäèòü ðåçóëüòàò â ýêñïîíåíöèàëüíîì âèäå");
InsertGuiPair(display_deg_rad_grad, "Trigonometric functions");
InsertGuiPair(display_deg_rad_grad, "Òðèãîíîìåòðè÷åñêèå ôóíêöèè");
InsertGuiPair(display_grouping, "Ãðóïïèðîâàíèå"); // e.g. 1`000`000
InsertGuiPair(display_grouping_none, "Íè÷åãî");
InsertGuiPair(display_grouping_space, "Ïðîáåë");
InsertGuiPair(display_input_decimal_point, "Äåñÿòè÷íàÿ òî÷êà ïðè ââîäå"); // Decimal point in formula
InsertGuiPair(display_input_decimal_point_item1, " . èëè ,");
InsertGuiPair(display_output_decimal_point, "Äåñÿòè÷íàÿ òî÷êà ïðè âûâîäå"); // Decimal point in result
InsertGuiPair(display_param_sep, "Ïàðàìåòðû ðàçäåëåíû:");
InsertGuiPair(display_param_sep_item2, " ; èëè .");
InsertGuiPair(display_param_sep_item3, " ; èëè ,");
InsertGuiPair(convert_type, "Òèï");
InsertGuiPair(convert_input, "Ââîä");
InsertGuiPair(convert_output, "Âûâîä");
InsertGuiPair(convert_dynamic_output, "Àâòîïðåôèêñ");
InsertGuiPair(display_grouping, "Grouping");
InsertGuiPair(display_grouping_none, "None");
InsertGuiPair(display_grouping_space, "Space");
InsertGuiPair(display_input_decimal_point, "Input decimal point");
InsertGuiPair(display_input_decimal_point_item1, " . or ,");
InsertGuiPair(display_output_decimal_point, "Output decimal point");
InsertGuiPair(display_param_sep, "Parameters separated by");
InsertGuiPair(display_param_sep_item2, " ; or .");
InsertGuiPair(display_param_sep_item3, " ; or ,");
InsertGuiPair(menu_view, "&Âèä");
InsertGuiPair(menu_edit, "&Ïðàâêà");
@ -1413,30 +1413,32 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_normal_view, "&Îáû÷íûé âèä");
InsertGuiPair(menu_view_compact_view, "&Êîìïàêòíûé âèä");
InsertGuiPair(menu_view_always_on_top, "&Âñåãäà ïîâåðõ äðóãèõ îêîí");
InsertGuiPair(menu_view_pad, "&Pad");
InsertGuiPair(menu_view_pad, "Á&ëîêíîò");
InsertGuiPair(menu_view_lang_english, "&Àíãëèéñêèé");
InsertGuiPair(menu_view_lang_polish, "&Ïîëüñêèé");
InsertGuiPair(menu_view_lang_spanish, "&Èñïàíñêèé");
InsertGuiPair(menu_view_lang_danish, "&Äàòñêèé");
InsertGuiPair(menu_view_lang_chinese, "&Êèòàéñêèé");
InsertGuiPair(menu_view_lang_russian, "&Ðóññêèé");
InsertGuiPair(menu_view_lang_swedish, "&Swedish");
InsertGuiPair(menu_view_lang_swedish, "&Øâåäñêèé");
InsertGuiPair(menu_view_close_program, "&Çàêðûòü");
InsertGuiPair(menu_edit_undo, "&Îòìåíèòü äåéñòâèå");
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_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, "&Êîïèðîâàòü ðåçóëüòàò");
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_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");
InsertGuiPair(menu_edit_bracket, "Âñòàâèòü ñêî&áêè \tCtrl+0"); // inserting brackets: (...)
InsertGuiPair(menu_help_check_update, "Ïðîâåðèòü î&áíîâëåíèÿ...");
InsertGuiPair(menu_update_available, "&Äîñòóïíà íîâàÿ âåðñèÿ!");
InsertGuiPair(menu_help_help, "&Ïîìîùü");
InsertGuiPair(menu_help_project_page, "&Ñàéò ïðîåêòà");
InsertGuiPair(menu_help_check_update, "&Check update...");
InsertGuiPair(menu_help_about, "&Î ïðîãðàììå");
InsertGuiPair(menu_update_available, "&New version is available");
InsertGuiPair(cant_init_calculations, "Íå ìîãó èíèöèàëèçèðîâàòü ìîäóëü äëÿ ðàñ÷åòîâ");
InsertGuiPair(message_box_error_caption,"TTCalc");
@ -1451,7 +1453,7 @@ void Languages::InitGuiMessagesTab()
"Ëèöåíçèÿ: BSD (open source)\r\n"
"Ñàéò ïðîåêòà: http://ttcalc.sourceforge.net\r\n"
"Áèáëèîòåêà Bignum: TTMath %d.%d.%d%s\r\n"
"Bignum type: binary floating point numbers\r\n"
"Òèï Bignum: Äâîè÷íàÿ ñèñòåìà ñ÷èñëåíèÿ, ÷èñëà ñ ïëàâàþùåé çàïÿòîé\r\n"
"ßçûê ïðîãðàììèðîâàíèÿ: C++\r\n"
"Êîìïèëÿòîð: %s\r\n"
"%s" // for upx
@ -1465,14 +1467,14 @@ void Languages::InitGuiMessagesTab()
" 32 áèòà íà ïîêàçàòåëü ñòåïåíè), òî åñòü +/-6.9e+646457021.\r\n"
"\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"
"Ïåðåâîä÷èêè:\r\n"
"Àíãëèéñêèé Àâòîð\r\n" // one tabulator (+ some spaces if needed)
"Ïîëüñêèé Àâòîð\r\n"
"Èñïàíñêèé Alejandro S. Valdezate <alesanval@gmail.com>\r\n"
"Äàòñêèé Rune Bisgaard Vammen <runebisgaard@gmail.com>\r\n"
"Êèòàéñêèé Juis <zsyfly@gmail.com>\r\n"
"Ðóññêèé Vladimir Gladilovich <vdgladilovich@gmail.com>\r\n"
"Øâåäñêèé Lars 'Bafvert' Gafvert <lars.gafvert@gmail.com>\r\n"
);
InsertGuiPair(about_text_portable_version, " ïåðåíîñíàÿ âåðñèÿ");
InsertGuiPair(about_text_exe_packer, "óïàêîâùèê EXE: UPX 3.03\r\n");
@ -1481,37 +1483,38 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(unknown_error, "Íåèçâåñòíàÿ îøèáêà");
InsertGuiPair(cant_find_help, "Íå óäàåòñÿ íàéòè ôàéëû ïîìîùè");
InsertGuiPair(cant_open_project_page, "Íå óäàåòñÿ îòêðûòü ñàéò ïðîåêòà");
InsertGuiPair(update_title, "Check for a new version");
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_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_version, "There is not a new version available.");
InsertGuiPair(update_download_from, "Downloading from...");
InsertGuiPair(update_title, "Ïîèñê íîâîé âåðñèè");
InsertGuiPair(update_button_next, "Äàëåå");
InsertGuiPair(update_button_finish, "Ãîòîâî");
InsertGuiPair(update_button_cancel, "Îòìåíà");
InsertGuiPair(update_check_at_startup, "Ïðîâåðÿòü íàëè÷èå íîâîé âåðñèè ïðè çàãðóçêå ïðîãðàììû");
InsertGuiPair(update_check_for_info, "Íàæìèòå Äàëåå, ÷òîáû ïðîâåðèòü íàëè÷èå îáíîâëåíèé...");
InsertGuiPair(update_is_new_version, "Äîñòóïíà âåðñèÿ %d.%d.%d, íàæìèòå Äàëåå, ÷òîáû ñêà÷àòü å¸...");
InsertGuiPair(update_no_new_version, "Íåò íîâûõ âåðñèé.");
InsertGuiPair(update_download_from, "Çàãðóæàåì ñ...");
#ifndef TTCALC_PORTABLE
InsertGuiPair(update_downloaded_info1, "A new setup program has been downloaded.");
InsertGuiPair(update_downloaded_info2, "Press Finish to close TTCalc and run the installer.");
InsertGuiPair(update_downloaded_info1, "Íîâûé äèñòðèáóòèâ çàãðóæåí.");
InsertGuiPair(update_downloaded_info2, "Íàæìèòå Ãîòîâî, ÷òîáû çàêðûòü TTCalc è çàïóñòèòü óñòàíîâùèê.");
#else
InsertGuiPair(update_downloaded_info1, "A new version of TTCalc has been downloaded.");
InsertGuiPair(update_downloaded_info1, "Íîâûé äèñòðèáóòèâ çàãðóæåí.");
InsertGuiPair(update_downloaded_info2, "");
#endif
InsertGuiPair(update_download_error, "There was a problem with downloading, please try again later.");
InsertGuiPair(pad_title, "Pad");
InsertGuiPair(pad_menu_file, "&File");
InsertGuiPair(pad_menu_edit, "&Edit");
InsertGuiPair(pad_menu_file_new, "&New"); // temporarily not used
InsertGuiPair(pad_menu_file_open, "&Open...");
InsertGuiPair(pad_menu_file_saveas, "Save &as...");
InsertGuiPair(pad_menu_file_close, "&Close");
InsertGuiPair(pad_menu_edit_undo, "&Undo \tCtrl+Z");
InsertGuiPair(pad_menu_edit_cut, "Cu&t \tCtrl+X");
InsertGuiPair(pad_menu_edit_copy, "&Copy \tCtrl+C");
InsertGuiPair(pad_menu_edit_paste, "&Paste \tCtrl+V");
InsertGuiPair(pad_menu_edit_del, "&Del \tDel");
InsertGuiPair(pad_menu_edit_select_all, "Select &all \tCtrl+A");
InsertGuiPair(update_download_error, "Ïðîáëåìà ñ çàãðóçêîé, ïîïðîáóéòå åùå ðàç ïîçäíåå.");
InsertGuiPair(pad_title, "Áëîêíîò");
InsertGuiPair(pad_menu_file, "&Ôàéë");
InsertGuiPair(pad_menu_edit, "&Ïðàâêà");
InsertGuiPair(pad_menu_file_new, "&Íîâûé"); // temporarily not used
InsertGuiPair(pad_menu_file_open, "&Îòêðûòü...");
InsertGuiPair(pad_menu_file_saveas, "Ñîõðàíèòü &êàê...");
InsertGuiPair(pad_menu_file_close, "&Çàêðûòü");
InsertGuiPair(pad_menu_edit_undo, "&Îòìåíèòü \tCtrl+Z");
InsertGuiPair(pad_menu_edit_cut, "Âû&ðåçàòü \tCtrl+X");
InsertGuiPair(pad_menu_edit_copy, "&Êîïèðîâàòü \tCtrl+C");
InsertGuiPair(pad_menu_edit_paste, "&Âñòàâèòü \tCtrl+V");
InsertGuiPair(pad_menu_edit_del, "&Óäàëèòü \tDel");
InsertGuiPair(pad_menu_edit_select_all, "Âûä&åëèòü âñ¸ \tCtrl+A");

14
src/resource.rc

@ -248,13 +248,13 @@ CAPTION "tab5"
FONT 8, "Ms Shell Dlg"
BEGIN
CONTROL "Input base",IDC_LABEL_DISPLAY_INPUT,"Static",
SS_LEFTNOWORDWRAP | WS_GROUP,8,4,43,8
SS_LEFTNOWORDWRAP | WS_GROUP,10,4,43,8
CONTROL "Output base",IDC_LABEL_DISPLAY_OUTPUT,"Static",
SS_LEFTNOWORDWRAP | WS_GROUP,8,18,43,8
SS_LEFTNOWORDWRAP | WS_GROUP,10,18,43,8
CONTROL "Rounding",IDC_LABEL_DISPLAY_ROUNDING,"Static",
SS_LEFTNOWORDWRAP | WS_GROUP,8,32,43,8
SS_LEFTNOWORDWRAP | WS_GROUP,10,32,43,8
CONTROL "Grouping",IDC_LABEL_DISPLAY_GROUPING,"Static",SS_LEFTNOWORDWRAP |
WS_GROUP,8,46,43,8
WS_GROUP,10,46,43,8
CONTROL "Input decimal point",IDC_LABEL_INPUT_DECIMAL_POINT,
"Static",SS_LEFTNOWORDWRAP | WS_GROUP,143,4,87,8
CONTROL "Output decimal point",IDC_LABEL_OUTPUT_DECIMAL_POINT,"Static",
@ -283,7 +283,7 @@ BEGIN
BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_LEFT | WS_TABSTOP,142,
60,140,10
CONTROL "Always",IDC_RADIO_DISPLAY_ALWAYS_SCIENTIFIC,"Button",
BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,14,
BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,16,
87,54,10
CONTROL "When the exponent is greater than:",
IDC_RADIO_DISPLAY_NOT_ALWAYS_SCIENTIFIC,"Button",
@ -293,8 +293,8 @@ BEGIN
CONTROL "",IDC_UPDOWN_DISPLAY_WHEN_SCIENTIFIC,"msctls_updown32",
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,276,84,
11,14
GROUPBOX "Print scientific value",IDC_LABEL_GROUP_SCIENTIFIC,8,75,
275,27
GROUPBOX "Print scientific value",IDC_LABEL_GROUP_SCIENTIFIC,10,75,
273,27
END

9
src/ttcalc_update.ini

@ -3,14 +3,17 @@
[normal]
url = http://downloads.sourceforge.net/project/ttcalc/ttcalc/ttcalc-0.8.7/ttcalc-0.8.7-setup.exe?use_mirror=dfn
filename = ttcalc-0.8.7-setup.exe
version.major = 0
version.major = 9
version.minor = 9
version.revision = 1
version.revision = 0
version.prerelease = 0
[portable]
url = http://downloads.sourceforge.net/project/ttcalc/ttcalc/ttcalc-0.8.7/ttcalc-portable-0.8.7-bin.tar.gz?use_mirror=dfn
filename = ttcalc-portable-0.8.7-bin.tar
version.major = 0
version.major = 9
version.minor = 9
version.revision = 1
version.prerelease = 0

20
src/update.cpp

@ -60,7 +60,7 @@ namespace Update
int major;
int minor;
int revision;
int prerelease;
// this is set by another thread at the beginning
namespace Background
@ -70,6 +70,7 @@ namespace Update
int major_;
int minor_;
int revision_;
int prerelease_;
}
}
@ -263,7 +264,8 @@ void DownloadProgram::Close()
make sure you don't write directly to any global variables (from Update namespace etc)
*/
bool CheckUpdateFromIni(HWND hwnd, std::string & url_, std::string & remote_file_name_,
int & major_, int & minor_, int & revision_, bool * continue_download_)
int & major_, int & minor_, int & revision_, int & prerelease_,
bool * continue_download_)
{
DownloadIni down_ini;
@ -273,7 +275,7 @@ DownloadIni down_ini;
if( down_ini.DownloadUrl("http://ttcalc.sourceforge.net/ttcalc_update.ini", continue_download_) )
{
IniParser iparser;
std::string ini_value[3];
std::string ini_value[4];
iparser.SectionCaseSensitive(false);
@ -283,12 +285,15 @@ DownloadIni down_ini;
iparser.Associate("normal|version.major", &ini_value[0] );
iparser.Associate("normal|version.minor", &ini_value[1] );
iparser.Associate("normal|version.revision", &ini_value[2] );
iparser.Associate("normal|version.prerelease", &ini_value[3] );
#else
iparser.Associate("portable|url", &url_ );
iparser.Associate("portable|filename", &remote_file_name_ );
iparser.Associate("portable|version.major", &ini_value[0] );
iparser.Associate("portable|version.minor", &ini_value[1] );
iparser.Associate("portable|version.revision", &ini_value[2] );
iparser.Associate("portable|version.prerelease",&ini_value[3] );
#endif
IniParser::Error err = iparser.ReadFromFile( down_ini.GetFileName() );
@ -298,6 +303,7 @@ DownloadIni down_ini;
major_ = atoi(ini_value[0].c_str());
minor_ = atoi(ini_value[1].c_str());
revision_ = atoi(ini_value[2].c_str());
prerelease_ = atoi(ini_value[3].c_str());
if( major_ > TTCALC_MAJOR_VER )
return true;
@ -307,6 +313,10 @@ DownloadIni down_ini;
else
if( major_ == TTCALC_MAJOR_VER && minor_ == TTCALC_MINOR_VER && revision_ > TTCALC_REVISION_VER )
return true;
else
if( major_ == TTCALC_MAJOR_VER && minor_ == TTCALC_MINOR_VER && revision_ == TTCALC_REVISION_VER &&
prerelease_ < TTCALC_PRERELEASE_VER )
return true;
}
}
@ -333,7 +343,7 @@ char buffer[200];
ShowWindow(GetDlgItem(hwnd, IDC_PROGRESS), SW_SHOW);
CheckMessages();
if( CheckUpdateFromIni(hwnd, url, remote_file_name, major, minor, revision, &continue_down) )
if( CheckUpdateFromIni(hwnd, url, remote_file_name, major, minor, revision, prerelease, &continue_down) )
{
level = 1;
sprintf(buffer, pl->GuiMessage(Languages::update_is_new_version), major, minor, revision);
@ -567,7 +577,7 @@ unsigned __stdcall UpdateBackgroundProc(void *)
{
using namespace Background;
if( CheckUpdateFromIni(0, url_, remote_file_name_, major_, minor_, revision_, 0) )
if( CheckUpdateFromIni(0, url_, remote_file_name_, major_, minor_, revision_, prerelease_, 0) )
{
HWND main = GetPrgRes()->GetMainWindow();
SendMessage(main, WM_UPDATE_EXISTS, 0, 0);

Loading…
Cancel
Save