From 66190aa0fc671330684220f13d161f16bdc0f0b2 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 23 Sep 2010 18:35:06 +0000 Subject: [PATCH] - MGR: Display the default action in the system tray menu in bold again. - MGR: If connected to the localhost, don't display the computer name in the window title. - MGR: Change the exit menu item text to be a little more specific about what is being shutdown. Use the same scheme as the exit text in the status bar so that it'll automatically be localized. - SCR: Remove some old Win9x code. clientgui/ AdvancedFrame.cpp BOINCTaskBar.cpp clientscr/ screensaver_win.cpp, .h svn path=/trunk/boinc/; revision=22402 --- checkin_notes | 15 +++++++++++++++ clientgui/AdvancedFrame.cpp | 30 ++++++++++++++++++++++++++---- clientgui/BOINCTaskBar.cpp | 2 +- clientscr/screensaver_win.cpp | 27 +-------------------------- clientscr/screensaver_win.h | 1 - 5 files changed, 43 insertions(+), 32 deletions(-) diff --git a/checkin_notes b/checkin_notes index 074fd9b5f4..a67cef9d8f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6748,3 +6748,18 @@ David 22 Sept 2010 client/ cs_notice.cpp + +Rom 23 Sept 2010 + - MGR: Display the default action in the system tray menu in bold again. + - MGR: If connected to the localhost, don't display the computer name + in the window title. + - MGR: Change the exit menu item text to be a little more specific about + what is being shutdown. Use the same scheme as the exit text in the + status bar so that it'll automatically be localized. + - SCR: Remove some old Win9x code. + + clientgui/ + AdvancedFrame.cpp + BOINCTaskBar.cpp + clientscr/ + screensaver_win.cpp, .h diff --git a/clientgui/AdvancedFrame.cpp b/clientgui/AdvancedFrame.cpp index d780508789..9f0b13aee2 100644 --- a/clientgui/AdvancedFrame.cpp +++ b/clientgui/AdvancedFrame.cpp @@ -37,6 +37,7 @@ #include "BOINCBaseFrame.h" #include "BOINCBaseView.h" #include "BOINCTaskBar.h" +#include "BOINCClientManager.h" #include "BOINCDialupManager.h" #include "AdvancedFrame.h" #include "ViewNotices.h" @@ -279,6 +280,7 @@ bool CAdvancedFrame::CreateMenu() { CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); ACCT_MGR_INFO ami; bool is_acct_mgr_detected = false; + bool is_boinc_started_by_manager = false; wxString strMenuName; wxString strMenuDescription; @@ -293,6 +295,11 @@ bool CAdvancedFrame::CreateMenu() { is_acct_mgr_detected = ami.acct_mgr_url.size() ? true : false; } + if (pDoc->m_pClientManager->WasBOINCStartedByManager()) { + is_boinc_started_by_manager = true; + } + + // File menu wxMenu *menuFile = new wxMenu; @@ -316,9 +323,24 @@ bool CAdvancedFrame::CreateMenu() { _("Exit %s"), pSkinAdvanced->GetApplicationName().c_str() ); + if (is_boinc_started_by_manager) { + // %s is the application short name + // i.e. 'BOINC', 'GridRepublic' + strMenuName.Printf( + _("Exit %s"), + pSkinAdvanced->GetApplicationShortName().c_str() + ); + } else { + // %s is the application name + // i.e. 'BOINC Manager', 'GridRepublic Manager' + strMenuName.Printf( + _("Exit %s"), + pSkinAdvanced->GetApplicationName().c_str() + ); + } menuFile->Append( wxID_EXIT, - _("E&xit"), + strMenuName, strMenuDescription ); @@ -1879,11 +1901,11 @@ void CAdvancedFrame::OnFrameRender(wxTimerEvent& WXUNUSED(event)) { } if (pDoc->IsComputerNameLocal(strComputerName)) { - strComputerName = wxT("localhost"); + strTitle.Printf(wxT("%s"), m_strBaseTitle.c_str()); + } else { + strTitle.Printf(_("%s - (%s)"), m_strBaseTitle.c_str(), strComputerName.c_str()); } - strTitle.Printf(_("%s - (%s)"), m_strBaseTitle.c_str(), strComputerName.c_str()); - if (pDoc->IsReconnecting()) { strStatusText.Printf(_("Connecting to %s"), strComputerName.c_str()); } else { diff --git a/clientgui/BOINCTaskBar.cpp b/clientgui/BOINCTaskBar.cpp index 70da0971cf..8dd25bba3f 100644 --- a/clientgui/BOINCTaskBar.cpp +++ b/clientgui/BOINCTaskBar.cpp @@ -551,7 +551,7 @@ void CTaskBarIcon::AdjustMenuItems(wxMenu* pMenu) { pMenu->Remove(pMenuItem); font = pMenuItem->GetFont(); - if (pMenuItem->GetId() != wxID_OPEN) { + if (pMenuItem->GetId() != ID_OPENBOINCMANAGER) { font.SetWeight(wxFONTWEIGHT_NORMAL); } else { font.SetWeight(wxFONTWEIGHT_BOLD); diff --git a/clientscr/screensaver_win.cpp b/clientscr/screensaver_win.cpp index 93f7ebd66b..c194b32997 100644 --- a/clientscr/screensaver_win.cpp +++ b/clientscr/screensaver_win.cpp @@ -349,9 +349,6 @@ HRESULT CScreensaver::Run() { DestroyGraphicsWindowPromotionThread(); DestroyInputActivityThread(); break; - case sm_passwordchange: - ChangePassword(); - break; } return S_OK; } @@ -1596,7 +1593,7 @@ VOID CScreensaver::FireInterruptSaverEvent() { // A message was received (mouse move, keydown, etc.) that may mean -// the screen saver should show the password dialog and/or shut down. +// the screen saver should shut down. // VOID CScreensaver::InterruptSaver() { BOINCTRACE(_T("CScreensaver::InterruptSaver Function Begin\n")); @@ -1819,25 +1816,3 @@ VOID CScreensaver::DoPaint(HWND hwnd, HDC hdc, LPPAINTSTRUCT lpps) { if(hFont) DeleteObject(hFont); } - - - -VOID CScreensaver::ChangePassword() { - // Load the password change DLL - HINSTANCE mpr = LoadLibrary(_T("MPR.DLL")); - - if (mpr != NULL) { - // Grab the password change function from it - typedef DWORD (PASCAL *PWCHGPROC)(LPCSTR, HWND, DWORD, LPVOID); - PWCHGPROC pwd = (PWCHGPROC)GetProcAddress(mpr, "PwdChangePasswordA"); - - // Do the password change - if (pwd != NULL) { - pwd("SCRSAVE", m_hWndParent, 0, NULL); - } - - // Free the library - FreeLibrary(mpr); - } -} - diff --git a/clientscr/screensaver_win.h b/clientscr/screensaver_win.h index b0b06ceb27..cab3085172 100644 --- a/clientscr/screensaver_win.h +++ b/clientscr/screensaver_win.h @@ -218,7 +218,6 @@ protected: VOID FireInterruptSaverEvent(); VOID InterruptSaver(); VOID ShutdownSaver(); - VOID ChangePassword(); VOID DoConfig();