This also shuffles some code around so it makes more sense. One example of an issue this fixes is to start creating an account, get to review page, click 'back' button - and get taken back to an empty scene window, thanks to the account creation page dismissing itself before opening the review page).
There are still some awkward flow issues (create account, manual entry, next, next, review -> back to editor visually for a second before review page opens) but those are slightly trickier to fix. Signed-off-by: Robin Burchell <[email protected]> --- src/accountsetuppage.cpp | 27 +++++++++++++++++++++++---- src/accountsetuppage.h | 4 ++-- src/emailapplication.cpp | 22 ---------------------- src/emailapplication.h | 2 -- 4 files changed, 25 insertions(+), 30 deletions(-) diff --git a/src/accountsetuppage.cpp b/src/accountsetuppage.cpp index 3d42237..51cae03 100644 --- a/src/accountsetuppage.cpp +++ b/src/accountsetuppage.cpp @@ -21,6 +21,8 @@ #include "accountsetuppage.h" #include "accountinfo.h" +#include "manualaccounteditpage.h" +#include "reviewaccountpage.h" static void displayError (QString msg) { @@ -42,6 +44,7 @@ AccountSetupPage::AccountSetupPage(QGraphicsItem *parent) : MApplicationPage(parent), m_account(new AccountInfo()) { + connect(m_account, SIGNAL(accountReady()), this, SLOT(showFolderPage())); } AccountSetupPage::~AccountSetupPage() @@ -237,11 +240,27 @@ void AccountSetupPage::setupAccount() m_account->setOutServerAddress("smtp." + emailAddress); m_account->setOutAuthentication (AccountInfo::Authentication_None); m_account->setOutPort (25); - emit manualAccountEdit(m_account); - dismiss(); + + showManualAccountEditPage(); return; } - emit verifyAccount(m_account); - dismiss(); + showReviewAccountPage(); +} + +void AccountSetupPage::showManualAccountEditPage() +{ + MApplicationPage *manualAccountEditPage = new ManualAccountEditPage(m_account); + connect (manualAccountEditPage, SIGNAL(verifyAccount(AccountInfo *)), this, + SLOT(showReviewAccountPage())); + manualAccountEditPage->appear(); +} + +void AccountSetupPage::showReviewAccountPage() +{ + MApplicationPage *reviewAccountPage = new ReviewAccountPage(m_account); + connect(reviewAccountPage, SIGNAL(manualAccountEdit(AccountInfo *)), this, + SLOT(showManualAccountEditPage())); + reviewAccountPage->appear(MSceneWindow::DestroyWhenDone); + } diff --git a/src/accountsetuppage.h b/src/accountsetuppage.h index 0db2c0b..f81e8e9 100644 --- a/src/accountsetuppage.h +++ b/src/accountsetuppage.h @@ -27,12 +27,12 @@ public: virtual void createContent(); signals: - void verifyAccount(AccountInfo *); - void manualAccountEdit(AccountInfo *); void emailSettingsTriggered(); private slots: void setupAccount(); + void showManualAccountEditPage(); + void showReviewAccountPage(); private: AccountInfo *m_account; diff --git a/src/emailapplication.cpp b/src/emailapplication.cpp index 70afd97..6951c6a 100644 --- a/src/emailapplication.cpp +++ b/src/emailapplication.cpp @@ -19,8 +19,6 @@ #include "folderpage.h" #include "messagelistpage.h" #include "conversationpage.h" -#include "manualaccounteditpage.h" -#include "reviewaccountpage.h" #include "mailmanager.h" EmailApplication::EmailApplication(int &argc, char **argv) @@ -67,10 +65,6 @@ void EmailApplication::showFolderPage() void EmailApplication::showAccountSetupPage() { m_accountSetupPage = new AccountSetupPage(); - connect (m_accountSetupPage, SIGNAL(manualAccountEdit(AccountInfo *)), this, - SLOT(showManualAccountEditPage(AccountInfo *))); - connect (m_accountSetupPage, SIGNAL(verifyAccount(AccountInfo *)), this, - SLOT(showReviewAccountPage(AccountInfo *))); connect (m_accountSetupPage, SIGNAL(emailSettingsTriggered()), this, SLOT(showEmailSettingsPage())); m_accountSetupPage->appear(MSceneWindow::DestroyWhenDismissed); @@ -108,22 +102,6 @@ void EmailApplication::showConversationPage(QMailMessageId messageId) conversationPage->appear(); } -void EmailApplication::showManualAccountEditPage(AccountInfo *account) -{ - MApplicationPage *manualAccountEditPage = new ManualAccountEditPage(account); - connect (manualAccountEditPage, SIGNAL(verifyAccount(AccountInfo *)), this, - SLOT(showReviewAccountPage(AccountInfo *))); - manualAccountEditPage->appear(); -} - -void EmailApplication::showReviewAccountPage(AccountInfo *account) -{ - MApplicationPage *reviewAccountPage = new ReviewAccountPage (account); - connect (account, SIGNAL(accountReady()), this, SLOT(showFolderPage())); - connect (reviewAccountPage, SIGNAL(manualAccountEdit(AccountInfo *)), this, - SLOT(showManualAccountEditPage(AccountInfo *))); - reviewAccountPage->appear(MSceneWindow::DestroyWhenDismissed); -} void EmailApplication::showEditExistingAccountPage(QMailAccountId id) { MApplicationPage *editExistingAccountPage = new EditExistingAccountPage (id); diff --git a/src/emailapplication.h b/src/emailapplication.h index f0c7b9b..adecd11 100644 --- a/src/emailapplication.h +++ b/src/emailapplication.h @@ -41,8 +41,6 @@ public slots: void showAccountSetupPage(); void showMessageListPage(QMailFolderId); void showConversationPage(QMailMessageId); - void showManualAccountEditPage(AccountInfo *); - void showReviewAccountPage(AccountInfo *); void showEmailSettingsPage(); void showEditExistingAccountPage(QMailAccountId); -- 1.7.4.1 _______________________________________________ MeeGo-dev mailing list [email protected] http://lists.meego.com/listinfo/meego-dev http://wiki.meego.com/Mailing_list_guidelines
