From 0e66d144260a3674b03689f82c225196edf10ea3 Mon Sep 17 00:00:00 2001 From: Martin Raiber Date: Mon, 10 Sep 2012 01:38:34 +0200 Subject: [PATCH] Updated icon (they came from fossy777) --- ConfigPath.cpp | 2 +- Logs.cpp | 2 +- Settings.cpp | 45 ++++++++++++++++--------------- TrayIcon.cpp | 4 +-- TrayIcon.h | 5 +++- UrBackupClientGUI.rc | 8 +++--- UrBackupClientGUI.vcxproj | 1 + UrBackupClientGUI.vcxproj.filters | 3 +++ main.cpp | 12 ++++----- resource.h | 2 +- urbackup.nsi | 3 +-- urbackup_notray.nsi | 3 +-- urbackup_update.nsi | 5 ++-- 13 files changed, 49 insertions(+), 46 deletions(-) diff --git a/ConfigPath.cpp b/ConfigPath.cpp index 6142372..89c697f 100644 --- a/ConfigPath.cpp +++ b/ConfigPath.cpp @@ -42,7 +42,7 @@ ConfigPath::ConfigPath(wxWindow* parent) { mod=false; - SetIcon(wxIcon(res_path+wxT("backup-ok-big.")+ico_ext, ico_type)); + SetIcon(wxIcon(res_path+wxT("backup-ok.")+ico_ext, ico_type)); dirs=Connector::getSharedPaths(); diff --git a/Logs.cpp b/Logs.cpp index c151209..24f8b11 100644 --- a/Logs.cpp +++ b/Logs.cpp @@ -27,7 +27,7 @@ extern wxBitmapType ico_type; Logs::Logs(wxWindow* parent) : GUILogfiles(parent) { - SetIcon(wxIcon(res_path+wxT("backup-ok-big.")+ico_ext, ico_type)); + SetIcon(wxIcon(res_path+wxT("backup-ok.")+ico_ext, ico_type)); logentries=Connector::getLogEntries(); if(Connector::hasError()) diff --git a/Settings.cpp b/Settings.cpp index 23ac748..738aa9e 100644 --- a/Settings.cpp +++ b/Settings.cpp @@ -117,7 +117,7 @@ wxTextValidator getDigitSlashValidator(void) Settings::Settings(wxWindow* parent) : GUISettings(parent) { - SetIcon(wxIcon(res_path+wxT("backup-ok-big.")+ico_ext, ico_type)); + SetIcon(wxIcon(res_path+wxT("backup-ok.")+ico_ext, ico_type)); settings=new CFileSettingsReader("urbackup/data/settings.cfg"); std::wstring t; @@ -671,44 +671,45 @@ void Settings::OnOkClick( wxCommandEvent& event ) std::string ndata; + std::vector keys=settings->getKeys(); - for(size_t i=0;i::iterator iter=n_vals.find(key); - if(iter!=n_vals.end()) - { - ndata+=iter->second; - } - else - { - std::wstring val; - if(settings->getValue(keys[i], &val) ) - ndata+=ConvertToUTF8(val); - } - ndata+="\n"; - } for(std::map::iterator it=n_vals.begin();it!=n_vals.end();++it) { - bool found=false; const std::string &nkey=it->first; + std::string def_value; + bool found_key=false; + + std::wstring key_w=ConvertToUnicode(nkey); for(size_t i=0;igetValue(it->first+"_def", &def_value) || def_value!=it->second ) { ndata+=nkey+"="+it->second+"\n"; } } + for(size_t i=0;i::iterator iter=n_vals.find(key); + if(iter==n_vals.end()) + { + std::wstring val; + if(settings->getValue(keys[i], &val) ) + { + ndata+=key+"="+ConvertToUTF8(val)+"\n"; + } + } + } + Connector::updateSettings(ndata); Close(); diff --git a/TrayIcon.cpp b/TrayIcon.cpp index 06a3437..3e2c8a6 100644 --- a/TrayIcon.cpp +++ b/TrayIcon.cpp @@ -76,7 +76,7 @@ void TrayIcon::OnPopupClick(wxCommandEvent &evt) int rc=Connector::startBackup(full); if(rc==1) { - SetIcon(wxIcon(res_path+wxT("backup-progress.")+ico_ext, ico_type), wxT("Warte auf Server...")); + SetIcon(wxIcon(res_path+wxT("backup-progress.")+ico_ext, ico_type, ICON_WIDTH, ICON_HEIGHT), wxT("Warte auf Server...")); if(timer!=NULL) timer->Start(1000); } @@ -99,7 +99,7 @@ void TrayIcon::OnPopupClick(wxCommandEvent &evt) int rc=Connector::startImage(full); if(rc==1) { - SetIcon(wxIcon(res_path+wxT("backup-progress.")+ico_ext, ico_type), _("Waiting for server...")); + SetIcon(wxIcon(res_path+wxT("backup-progress.")+ico_ext, ico_type, ICON_WIDTH, ICON_HEIGHT), _("Waiting for server...")); if(timer!=NULL) timer->Start(1000); } diff --git a/TrayIcon.h b/TrayIcon.h index ed02d2c..7742eed 100644 --- a/TrayIcon.h +++ b/TrayIcon.h @@ -34,4 +34,7 @@ public: private: int balloon_action; std::string new_ident; -}; \ No newline at end of file +}; + +#define ICON_WIDTH 16 +#define ICON_HEIGHT 16 \ No newline at end of file diff --git a/UrBackupClientGUI.rc b/UrBackupClientGUI.rc index ba025b5..57f86c4 100644 --- a/UrBackupClientGUI.rc +++ b/UrBackupClientGUI.rc @@ -13,13 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// Deutsch (Deutschland) resources +// German (Germany) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) -#ifdef _WIN32 LANGUAGE LANG_GERMAN, SUBLANG_GERMAN #pragma code_page(1252) -#endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -54,8 +52,8 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_ICON1 ICON "icon1.ico" -#endif // Deutsch (Deutschland) resources +IDI_ICON1 ICON "icon3.ico" +#endif // German (Germany) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/UrBackupClientGUI.vcxproj b/UrBackupClientGUI.vcxproj index 87536e4..7289e81 100644 --- a/UrBackupClientGUI.vcxproj +++ b/UrBackupClientGUI.vcxproj @@ -214,6 +214,7 @@ + diff --git a/UrBackupClientGUI.vcxproj.filters b/UrBackupClientGUI.vcxproj.filters index 3ce899c..3804de1 100644 --- a/UrBackupClientGUI.vcxproj.filters +++ b/UrBackupClientGUI.vcxproj.filters @@ -112,6 +112,9 @@ Ressourcendateien + + Ressourcendateien + diff --git a/main.cpp b/main.cpp index 43b74ca..1331b3b 100644 --- a/main.cpp +++ b/main.cpp @@ -143,7 +143,7 @@ bool MyApp::OnInit() //wxInitAllImageHandlers(); tray=new TrayIcon; - bool b=tray->SetIcon(wxIcon(res_path+wxT("backup-ok.")+ico_ext, ico_type), wxT("UrBackup Client")); + bool b=tray->SetIcon(wxIcon(res_path+wxT("backup-ok.")+ico_ext, ico_type, ICON_WIDTH, ICON_HEIGHT), wxT("UrBackup Client")); if(!b) { std::cout << "Setting icon failed." << std::endl; @@ -245,7 +245,7 @@ void MyTimer::Notify() { last_status=_("Cannot connect to backup server"); if(tray!=NULL) - tray->SetIcon(wxIcon(res_path+wxT("backup-bad.")+ico_ext, ico_type), last_status); + tray->SetIcon(wxIcon(res_path+wxT("backup-bad.")+ico_ext, ico_type, ICON_WIDTH, ICON_HEIGHT), last_status); icon_type=4; } working=false; @@ -348,25 +348,25 @@ void MyTimer::Notify() { case 0: if(tray!=NULL) - tray->SetIcon(wxIcon(res_path+wxT("backup-ok.")+ico_ext, ico_type), status_text); + tray->SetIcon(wxIcon(res_path+wxT("backup-ok.")+ico_ext, ico_type, ICON_WIDTH, ICON_HEIGHT), status_text); if(timer!=NULL) timer->Start(60000); break; case 1: if(tray!=NULL) - tray->SetIcon(wxIcon(res_path+wxT("backup-progress.")+ico_ext, ico_type), status_text); + tray->SetIcon(wxIcon(res_path+wxT("backup-progress.")+ico_ext, ico_type, ICON_WIDTH, ICON_HEIGHT), status_text); if(timer!=NULL) timer->Start(10000); break; case 2: if(tray!=NULL) - tray->SetIcon(wxIcon(res_path+wxT("backup-bad.")+ico_ext, ico_type), status_text); + tray->SetIcon(wxIcon(res_path+wxT("backup-bad.")+ico_ext, ico_type, ICON_WIDTH, ICON_HEIGHT), status_text); if(timer!=NULL) timer->Start(60000); break; case 3: if(tray!=NULL) - tray->SetIcon(wxIcon(res_path+wxT("backup-progress-pause.")+ico_ext, ico_type), status_text); + tray->SetIcon(wxIcon(res_path+wxT("backup-progress-pause.")+ico_ext, ico_type, ICON_WIDTH, ICON_HEIGHT), status_text); if(timer!=NULL) timer->Start(60000); diff --git a/resource.h b/resource.h index 7670281..cf62560 100644 --- a/resource.h +++ b/resource.h @@ -8,7 +8,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/urbackup.nsi b/urbackup.nsi index 39c3895..6b412b5 100644 --- a/urbackup.nsi +++ b/urbackup.nsi @@ -2,7 +2,7 @@ !include "${NSISDIR}\Contrib\Modern UI\System.nsh" !include WinVer.nsh !include "x64.nsh" -!define MUI_ICON "backup-ok.ico" +!define MUI_ICON "icon3.ico" SetCompressor /FINAL /SOLID lzma @@ -172,7 +172,6 @@ Section "install" ${EndIf} File "data\backup-bad.ico" File "data\backup-ok.ico" - File "data\backup-ok-big.ico" File "data\backup-progress.ico" File "data\new.txt" File "data\logo1.png" diff --git a/urbackup_notray.nsi b/urbackup_notray.nsi index ffde0f1..35556b4 100644 --- a/urbackup_notray.nsi +++ b/urbackup_notray.nsi @@ -2,7 +2,7 @@ !include "${NSISDIR}\Contrib\Modern UI\System.nsh" !include WinVer.nsh !include "x64.nsh" -!define MUI_ICON "backup-ok.ico" +!define MUI_ICON "icon3.ico" SetCompressor /FINAL /SOLID lzma @@ -166,7 +166,6 @@ Section "install" ${EndIf} File "data\backup-bad.ico" File "data\backup-ok.ico" - File "data\backup-ok-big.ico" File "data\backup-progress.ico" File "data\new.txt" File "data\logo1.png" diff --git a/urbackup_update.nsi b/urbackup_update.nsi index 71f4508..29801d2 100644 --- a/urbackup_update.nsi +++ b/urbackup_update.nsi @@ -1,8 +1,8 @@ -!define MUI_BRANDINGTEXT "UrBackup Update 0.40.1" +!define MUI_BRANDINGTEXT "UrBackup Update 1.0" !include "${NSISDIR}\Contrib\Modern UI\System.nsh" !include WinVer.nsh !include "x64.nsh" -!define MUI_ICON "backup-ok.ico" +!define MUI_ICON "icon3.ico" SetCompressor /FINAL /SOLID lzma @@ -161,7 +161,6 @@ Section "install" ${EndIf} File "data\backup-bad.ico" File "data\backup-ok.ico" - File "data\backup-ok-big.ico" File "data\backup-progress.ico" File "data\new.txt" File "data\logo1.png"