ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/s10k/Vago/windowMessagesWizard/wmformatpage.cpp
(Generate patch)

Comparing s10k/Vago/windowMessagesWizard/wmformatpage.cpp (file contents):
Revision 1092 by s10k, Sat Dec 30 13:43:28 2017 UTC vs.
Revision 1093 by s10k, Sat Dec 30 13:57:32 2017 UTC

# Line 1 | Line 1
1   #include "wmformatpage.h"
2   #include "ui_wmformatpage.h"
3  
4 < WmFormatPage::WmFormatPage(Logger *myLogger, QWidget *parent) :
4 > WmFormatPage::WmFormatPage(QWidget *parent) :
5      QWizardPage(parent),
6      ui(new Ui::WmFormatPage)
7   {
8      ui->setupUi(this);
9  
10    this->myLogger = myLogger;
11
10      this->setTitle("Pages Formatting");
11      this->setSubTitle("Create and format the pages here.\nNote that Oni doesn't support partial words formatting so the whole line will be formatted.");
12      setupComboBoxTextSize();
# Line 50 | Line 48 | void WmFormatPage::initializePage()
48          ui->pbDeleteCurrentPage->setEnabled(true);
49          break;
50      case WINDOW_TYPE::ENUM_END:
51 <        UtilVago::showAndLogErrorPopUp(this->myLogger, "An error ocurred: WmFormatPage::initializePage invalid WINDOW_TYPE");
51 >        UtilVago::showAndLogErrorPopUp("An error ocurred: WmFormatPage::initializePage invalid WINDOW_TYPE");
52          break;
53      }
54  
# Line 71 | Line 69 | bool WmFormatPage::validatePage(){
69                  currentPage->getFooterText().toPlainText().trimmed() == ""
70                  )
71          {
72 <            Util::showErrorPopUp("You need to fill at least one text section in all pages!");
72 >            Util::Dialogs::showError("You need to fill at least one text section in all pages!");
73              return false;
74          }
75  
# Line 79 | Line 77 | bool WmFormatPage::validatePage(){
77  
78      // If we can add more than one page, ask the user if he already added them all
79      if(ui->pbAddPageAfter->isEnabled()){
80 <        return Util::showQuestionPopUp(this, "Have you added all the window pages?");
80 >        return Util::Dialogs::showQuestion(this, "Have you added all the window pages?");
81      }
82  
83      return true;
# Line 125 | Line 123 | void WmFormatPage::addPage(bool afterCur
123          this->currentPages[indexForInsertion]->showFooterText();
124          break;
125      case WINDOW_TYPE::ENUM_END:
126 <        UtilVago::showAndLogErrorPopUp(this->myLogger, "An error ocurred: WmFormatPage::addPage invalid WINDOW_TYPE");
126 >        UtilVago::showAndLogErrorPopUp("An error ocurred: WmFormatPage::addPage invalid WINDOW_TYPE");
127          break;
128      }
129  
# Line 189 | Line 187 | void WmFormatPage::formatText(FormatType
187      }
188  
189      if(textEdits.size() == 0){
190 <        Util::showPopUp("Select some text first.");
190 >        Util::Dialogs::showInfo("Select some text first.");
191          return;
192      }
193  
# Line 251 | Line 249 | void WmFormatPage::formatText(FormatType
249                  double newFontSize = ui->cbTextSize->currentText().toDouble(&ok);
250  
251                  if(!ok){
252 <                    Util::showErrorPopUp("The inputted font size is not valid!");
252 >                    Util::Dialogs::showError("The inputted font size is not valid!");
253                      ui->cbTextSize->setCurrentIndex(0); // reset to default number
254                      return;
255                  }
# Line 278 | Line 276 | void WmFormatPage::on_pbAddPageBefore_cl
276   void WmFormatPage::on_pbDeleteCurrentPage_clicked()
277   {
278      if(ui->twPages->count() <= 1){
279 <        Util::showErrorPopUp("You must have at least one page!");
279 >        Util::Dialogs::showError("You must have at least one page!");
280          return;
281      }
282  
283 <    if(Util::showQuestionPopUp(this, "Are you sure do you want to delete the current page?")){
283 >    if(Util::Dialogs::showQuestion(this, "Are you sure do you want to delete the current page?")){
284          int indexToDelete = ui->twPages->currentIndex();
285  
286          currentPages.removeAt(indexToDelete);

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)