mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=11999
This commit is contained in:
parent
07f49fd5bf
commit
16d5fa497c
|
@ -1353,3 +1353,16 @@ David 29 Jan 2007
|
|||
MainDocument.cpp
|
||||
ViewProjects.cpp
|
||||
ViewProjectsGrid.cpp
|
||||
|
||||
Rom 30 Jan 2007
|
||||
- MGR: Give the user a change to abort a core client shutdown when they
|
||||
select 'shutdown current client'.
|
||||
- MGR: Special case the authorization error dialog when it is attempting
|
||||
to use the default password, so that it also informs the user they
|
||||
need to run the manager from the same directory as the CC.
|
||||
|
||||
clientgui/
|
||||
AdvancedFrame.cpp, .h
|
||||
BOINCBaseFrame.cpp, .h
|
||||
MainDocument.cpp, .h
|
||||
|
|
@ -50,6 +50,7 @@
|
|||
#include "DlgAbout.h"
|
||||
#include "DlgOptions.h"
|
||||
#include "DlgSelectComputer.h"
|
||||
#include "DlgGenericMessage.h"
|
||||
#include "wizardex.h"
|
||||
#include "BOINCWizards.h"
|
||||
#include "BOINCBaseWizard.h"
|
||||
|
@ -207,6 +208,7 @@ CAdvancedFrame::CAdvancedFrame(wxString title, wxIcon* icon) :
|
|||
|
||||
// Working Variables
|
||||
m_strBaseTitle = title;
|
||||
m_bDisplayShutdownClientWarning = true;
|
||||
|
||||
|
||||
// Initialize Application
|
||||
|
@ -742,6 +744,7 @@ bool CAdvancedFrame::SaveState() {
|
|||
pConfig->SetPath(strBaseConfigLocation);
|
||||
|
||||
pConfig->Write(wxT("CurrentPage"), m_pNotebook->GetSelection());
|
||||
pConfig->Write(wxT("DisplayShutdownClientWarning"), m_bDisplayShutdownClientWarning);
|
||||
|
||||
|
||||
#ifdef __WXMAC__
|
||||
|
@ -820,7 +823,7 @@ bool CAdvancedFrame::RestoreState() {
|
|||
pConfig->Read(wxT("CurrentPage"), &iCurrentPage, (ID_LIST_WORKVIEW - ID_LIST_BASE));
|
||||
m_pNotebook->SetSelection(iCurrentPage);
|
||||
}
|
||||
|
||||
pConfig->Read(wxT("DisplayShutdownClientWarning"), &m_bDisplayShutdownClientWarning, true);
|
||||
|
||||
#ifdef __WXMAC__
|
||||
RestoreWindowDimensions();
|
||||
|
@ -1063,21 +1066,59 @@ void CAdvancedFrame::OnSelectComputer(wxCommandEvent& WXUNUSED(event)) {
|
|||
|
||||
|
||||
void CAdvancedFrame::OnClientShutdown(wxCommandEvent& WXUNUSED(event)) {
|
||||
wxCommandEvent evtSelectNewComputer(wxEVT_COMMAND_MENU_SELECTED, ID_FILESELECTCOMPUTER);
|
||||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
|
||||
CDlgGenericMessage dlg(this);
|
||||
wxString strDialogTitle = wxEmptyString;
|
||||
wxString strDialogMessage = wxEmptyString;
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::OnClientShutdown - Function Begin"));
|
||||
|
||||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
wxCommandEvent evtSelectNewComputer(wxEVT_COMMAND_MENU_SELECTED, ID_FILESELECTCOMPUTER);
|
||||
|
||||
wxASSERT(pDoc);
|
||||
wxASSERT(pSkinAdvanced);
|
||||
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
||||
wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
|
||||
|
||||
|
||||
// Stop all timers
|
||||
StopTimers();
|
||||
|
||||
pDoc->CoreClientQuit();
|
||||
|
||||
// Since the core cliet we were connected to just shutdown, prompt for a new one.
|
||||
ProcessEvent(evtSelectNewComputer);
|
||||
// %s is the application name
|
||||
// i.e. 'BOINC Manager', 'GridRepublic Manager'
|
||||
strDialogTitle.Printf(
|
||||
_("Shutdown the current client..."),
|
||||
pSkinAdvanced->GetApplicationName().c_str()
|
||||
);
|
||||
|
||||
// 1st %s is the application name
|
||||
// i.e. 'BOINC Manager', 'GridRepublic Manager'
|
||||
// 2nd %s is the project name
|
||||
// i.e. 'BOINC', 'GridRepublic'
|
||||
strDialogMessage.Printf(
|
||||
_("%s is going to shutdown the core client it is currently connected to.\n"
|
||||
"NOTE: Choosing 'OK' will cause the select new computer dialog to appear \n"
|
||||
"so you can attach to a different core client."),
|
||||
pSkinAdvanced->GetApplicationName().c_str()
|
||||
);
|
||||
|
||||
dlg.SetTitle(strDialogTitle);
|
||||
dlg.m_DialogMessage->SetLabel(strDialogMessage);
|
||||
dlg.Fit();
|
||||
dlg.Centre();
|
||||
|
||||
if (wxID_OK == dlg.ShowModal()) {
|
||||
if (dlg.m_DialogDisableMessage->GetValue()) {
|
||||
m_bDisplayShutdownClientWarning = false;
|
||||
}
|
||||
|
||||
pDoc->CoreClientQuit();
|
||||
|
||||
// Since the core cliet we were connected to just shutdown, prompt for a new one.
|
||||
ProcessEvent(evtSelectNewComputer);
|
||||
}
|
||||
|
||||
|
||||
// Restart timers
|
||||
StartTimers();
|
||||
|
|
|
@ -104,6 +104,8 @@ private:
|
|||
wxNotebook* m_pNotebook;
|
||||
CStatusBar* m_pStatusbar;
|
||||
|
||||
bool m_bDisplayShutdownClientWarning;
|
||||
|
||||
wxString m_strBaseTitle;
|
||||
|
||||
bool CreateMenu();
|
||||
|
|
|
@ -343,7 +343,7 @@ void CBOINCBaseFrame::FireReloadSkin() {
|
|||
}
|
||||
|
||||
|
||||
void CBOINCBaseFrame::ShowConnectionBadPasswordAlert() {
|
||||
void CBOINCBaseFrame::ShowConnectionBadPasswordAlert( bool bUsedDefaultPassword ) {
|
||||
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
|
||||
wxString strDialogTitle = wxEmptyString;
|
||||
|
||||
|
@ -361,11 +361,20 @@ void CBOINCBaseFrame::ShowConnectionBadPasswordAlert() {
|
|||
pSkinAdvanced->GetApplicationName().c_str()
|
||||
);
|
||||
|
||||
ShowAlert(
|
||||
strDialogTitle,
|
||||
_("The password you have provided is incorrect, please try again."),
|
||||
wxOK | wxICON_ERROR
|
||||
);
|
||||
if ( bUsedDefaultPassword ) {
|
||||
ShowAlert(
|
||||
strDialogTitle,
|
||||
_("Authorization failed connecting to running client.\n"
|
||||
"Make sure you start this program in the same directory as the client."),
|
||||
wxOK | wxICON_ERROR
|
||||
);
|
||||
} else {
|
||||
ShowAlert(
|
||||
strDialogTitle,
|
||||
_("The password you have provided is incorrect, please try again."),
|
||||
wxOK | wxICON_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::ShowConnectionBadPasswordAlert - Function End"));
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
void FireRefreshView();
|
||||
void FireConnect();
|
||||
void FireReloadSkin();
|
||||
void ShowConnectionBadPasswordAlert();
|
||||
void ShowConnectionBadPasswordAlert( bool bUsedDefaultPassword );
|
||||
void ShowConnectionFailedAlert();
|
||||
void ShowNotCurrentlyConnectedAlert();
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ CNetworkConnection::CNetworkConnection(CMainDocument* pDocument) :
|
|||
m_bForceReconnect = false;
|
||||
m_bReconnectOnError = false;
|
||||
m_bNewConnection = false;
|
||||
m_bUsedDefaultPassword = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,6 +95,7 @@ void CNetworkConnection::Poll() {
|
|||
if (m_bUseDefaultPassword) {
|
||||
GetLocalPassword(m_strNewComputerPassword);
|
||||
m_bUseDefaultPassword = FALSE;
|
||||
m_bUsedDefaultPassword = true;
|
||||
}
|
||||
|
||||
retval = m_pDocument->rpc.authorize(m_strNewComputerPassword.mb_str());
|
||||
|
@ -107,6 +109,7 @@ void CNetworkConnection::Poll() {
|
|||
wxLogTrace(wxT("Function Status"), wxT("CNetworkConnection::Poll - RPC Authorization Failed '%d'"), retval);
|
||||
SetStateError();
|
||||
}
|
||||
m_bUsedDefaultPassword = false;
|
||||
} else if (ERR_RETRY != retval) {
|
||||
wxLogTrace(wxT("Function Status"), wxT("CNetworkConnection::Poll - RPC Connection Failed '%d'"), retval);
|
||||
SetStateError();
|
||||
|
@ -211,7 +214,7 @@ void CNetworkConnection::SetStateErrorAuthentication() {
|
|||
|
||||
m_bConnectEvent = false;
|
||||
|
||||
pFrame->ShowConnectionBadPasswordAlert();
|
||||
pFrame->ShowConnectionBadPasswordAlert(m_bUsedDefaultPassword);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ private:
|
|||
bool m_bConnected;
|
||||
bool m_bReconnecting;
|
||||
bool m_bUseDefaultPassword;
|
||||
bool m_bUsedDefaultPassword;
|
||||
bool m_bNewConnection;
|
||||
wxString m_strNewComputerName;
|
||||
wxString m_strNewComputerPassword;
|
||||
|
|
Loading…
Reference in New Issue