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
)
){
wasShown = IsShown();
Show();
wasVisible = wxGetApp().IsApplicationVisible();
if (!wasVisible) {
wxGetApp().ShowApplication(true);
}
if (!pDoc->project((char*)strProjectURL.c_str())) {
wasShown = IsShown();
Show();
wasVisible = wxGetApp().IsApplicationVisible();
if (!wasVisible) {
wxGetApp().ShowApplication(true);
}
pWizard = new CWizardAttach(this);
pWizard = new CWizardAttach(this);
if (pWizard->RunSimpleProjectAttach(
wxURI::Unescape(strProjectName),
wxURI::Unescape(strProjectURL),
wxURI::Unescape(strProjectAuthenticator),
wxURI::Unescape(strProjectInstitution),
wxURI::Unescape(strProjectDescription),
wxURI::Unescape(strProjectKnown)
)
) {
// If successful, display the projects tab
m_pNotebook->SetSelection(ID_ADVTASKSVIEW - ID_ADVVIEWBASE);
} else {
// If failure, display the notices tab
m_pNotebook->SetSelection(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE);
if (pWizard->RunSimpleProjectAttach(
wxURI::Unescape(strProjectName),
wxURI::Unescape(strProjectURL),
wxURI::Unescape(strProjectAuthenticator),
wxURI::Unescape(strProjectInstitution),
wxURI::Unescape(strProjectDescription),
wxURI::Unescape(strProjectKnown)
)
) {
// If successful, display the projects tab
m_pNotebook->SetSelection(ID_ADVTASKSVIEW - ID_ADVVIEWBASE);
} else {
// If failure, display the notices tab
m_pNotebook->SetSelection(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE);
}
}
} else if (ami.acct_mgr_url.size() && ami.have_credentials) {
// Fall through

View File

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

View File

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