--- s10k/Vago/windowMessagesWizard/wmformatpage.cpp 2017/12/30 13:43:28 1092 +++ s10k/Vago/windowMessagesWizard/wmformatpage.cpp 2017/12/30 13:57:32 1093 @@ -1,14 +1,12 @@ #include "wmformatpage.h" #include "ui_wmformatpage.h" -WmFormatPage::WmFormatPage(Logger *myLogger, QWidget *parent) : +WmFormatPage::WmFormatPage(QWidget *parent) : QWizardPage(parent), ui(new Ui::WmFormatPage) { ui->setupUi(this); - this->myLogger = myLogger; - this->setTitle("Pages Formatting"); this->setSubTitle("Create and format the pages here.\nNote that Oni doesn't support partial words formatting so the whole line will be formatted."); setupComboBoxTextSize(); @@ -50,7 +48,7 @@ void WmFormatPage::initializePage() ui->pbDeleteCurrentPage->setEnabled(true); break; case WINDOW_TYPE::ENUM_END: - UtilVago::showAndLogErrorPopUp(this->myLogger, "An error ocurred: WmFormatPage::initializePage invalid WINDOW_TYPE"); + UtilVago::showAndLogErrorPopUp("An error ocurred: WmFormatPage::initializePage invalid WINDOW_TYPE"); break; } @@ -71,7 +69,7 @@ bool WmFormatPage::validatePage(){ currentPage->getFooterText().toPlainText().trimmed() == "" ) { - Util::showErrorPopUp("You need to fill at least one text section in all pages!"); + Util::Dialogs::showError("You need to fill at least one text section in all pages!"); return false; } @@ -79,7 +77,7 @@ bool WmFormatPage::validatePage(){ // If we can add more than one page, ask the user if he already added them all if(ui->pbAddPageAfter->isEnabled()){ - return Util::showQuestionPopUp(this, "Have you added all the window pages?"); + return Util::Dialogs::showQuestion(this, "Have you added all the window pages?"); } return true; @@ -125,7 +123,7 @@ void WmFormatPage::addPage(bool afterCur this->currentPages[indexForInsertion]->showFooterText(); break; case WINDOW_TYPE::ENUM_END: - UtilVago::showAndLogErrorPopUp(this->myLogger, "An error ocurred: WmFormatPage::addPage invalid WINDOW_TYPE"); + UtilVago::showAndLogErrorPopUp("An error ocurred: WmFormatPage::addPage invalid WINDOW_TYPE"); break; } @@ -189,7 +187,7 @@ void WmFormatPage::formatText(FormatType } if(textEdits.size() == 0){ - Util::showPopUp("Select some text first."); + Util::Dialogs::showInfo("Select some text first."); return; } @@ -251,7 +249,7 @@ void WmFormatPage::formatText(FormatType double newFontSize = ui->cbTextSize->currentText().toDouble(&ok); if(!ok){ - Util::showErrorPopUp("The inputted font size is not valid!"); + Util::Dialogs::showError("The inputted font size is not valid!"); ui->cbTextSize->setCurrentIndex(0); // reset to default number return; } @@ -278,11 +276,11 @@ void WmFormatPage::on_pbAddPageBefore_cl void WmFormatPage::on_pbDeleteCurrentPage_clicked() { if(ui->twPages->count() <= 1){ - Util::showErrorPopUp("You must have at least one page!"); + Util::Dialogs::showError("You must have at least one page!"); return; } - if(Util::showQuestionPopUp(this, "Are you sure do you want to delete the current page?")){ + if(Util::Dialogs::showQuestion(this, "Are you sure do you want to delete the current page?")){ int indexToDelete = ui->twPages->currentIndex(); currentPages.removeAt(indexToDelete);