MGR: In the simple attach scenario, only launch the attach wizard if we are not already attached to the project.

This commit is contained in:
Rom Walton 2015-01-06 17:33:37 -05:00
parent 6bc87783dc
commit a88c671310
3 changed files with 41 additions and 37 deletions

View File

@ -1783,29 +1783,31 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
strProjectName, strProjectURL, strProjectAuthenticator, strProjectInstitution, strProjectDescription, strProjectKnown strProjectName, strProjectURL, strProjectAuthenticator, strProjectInstitution, strProjectDescription, strProjectKnown
) )
){ ){
wasShown = IsShown(); if (!pDoc->project((char*)strProjectURL.c_str())) {
Show(); wasShown = IsShown();
wasVisible = wxGetApp().IsApplicationVisible(); Show();
if (!wasVisible) { wasVisible = wxGetApp().IsApplicationVisible();
wxGetApp().ShowApplication(true); if (!wasVisible) {
} wxGetApp().ShowApplication(true);
}
pWizard = new CWizardAttach(this); pWizard = new CWizardAttach(this);
if (pWizard->RunSimpleProjectAttach( if (pWizard->RunSimpleProjectAttach(
wxURI::Unescape(strProjectName), wxURI::Unescape(strProjectName),
wxURI::Unescape(strProjectURL), wxURI::Unescape(strProjectURL),
wxURI::Unescape(strProjectAuthenticator), wxURI::Unescape(strProjectAuthenticator),
wxURI::Unescape(strProjectInstitution), wxURI::Unescape(strProjectInstitution),
wxURI::Unescape(strProjectDescription), wxURI::Unescape(strProjectDescription),
wxURI::Unescape(strProjectKnown) wxURI::Unescape(strProjectKnown)
) )
) { ) {
// If successful, display the projects tab // If successful, display the projects tab
m_pNotebook->SetSelection(ID_ADVTASKSVIEW - ID_ADVVIEWBASE); m_pNotebook->SetSelection(ID_ADVTASKSVIEW - ID_ADVVIEWBASE);
} else { } else {
// If failure, display the notices tab // If failure, display the notices tab
m_pNotebook->SetSelection(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE); m_pNotebook->SetSelection(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE);
}
} }
} else if (ami.acct_mgr_url.size() && ami.have_credentials) { } else if (ami.acct_mgr_url.size() && ami.have_credentials) {
// Fall through // Fall through

View File

@ -224,7 +224,7 @@ private:
public: public:
int CachedProjectStatusUpdate(bool bForce = false); int CachedProjectStatusUpdate(bool bForce = false);
PROJECT* project(unsigned int); PROJECT* project(unsigned int);
PROJECT* project(char* url); PROJECT* project(char* url);
float m_fProjectTotalResourceShare; float m_fProjectTotalResourceShare;
int GetProjectCount(); int GetProjectCount();

View File

@ -714,23 +714,25 @@ void CSimpleFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
strProjectName, strProjectURL, strProjectAuthenticator, strProjectInstitution, strProjectDescription, strProjectKnown strProjectName, strProjectURL, strProjectAuthenticator, strProjectInstitution, strProjectDescription, strProjectKnown
) )
){ ){
wasShown = IsShown(); if (!pDoc->project((char*)strProjectURL.c_str())) {
Show(); wasShown = IsShown();
wasVisible = wxGetApp().IsApplicationVisible(); Show();
if (!wasVisible) { wasVisible = wxGetApp().IsApplicationVisible();
wxGetApp().ShowApplication(true); if (!wasVisible) {
} wxGetApp().ShowApplication(true);
}
pWizard = new CWizardAttach(this); pWizard = new CWizardAttach(this);
pWizard->RunSimpleProjectAttach( pWizard->RunSimpleProjectAttach(
wxURI::Unescape(strProjectName), wxURI::Unescape(strProjectName),
wxURI::Unescape(strProjectURL), wxURI::Unescape(strProjectURL),
wxURI::Unescape(strProjectAuthenticator), wxURI::Unescape(strProjectAuthenticator),
wxURI::Unescape(strProjectInstitution), wxURI::Unescape(strProjectInstitution),
wxURI::Unescape(strProjectDescription), wxURI::Unescape(strProjectDescription),
wxURI::Unescape(strProjectKnown) wxURI::Unescape(strProjectKnown)
); );
}
} else if (ami.acct_mgr_url.size() && ami.have_credentials) { } else if (ami.acct_mgr_url.size() && ami.have_credentials) {
// Fall through // Fall through
// //