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

Comparing s10k/Vago/soundWizard/soundpage2.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 54 | Line 54 | void SoundPage2::on_tbRemoveFiles_clicke
54      int size = ui->twSoundFiles->selectionModel()->selectedRows().size();
55  
56      if(size==0){
57 <        Util::showPopUp("Select a row first.");
57 >        Util::Dialogs::showInfo("Select a row first.");
58          return;
59      }
60  
61 <    if(Util::showQuestionPopUp(this,"Are you sure you want to delete the selected rows?")){
61 >    if(Util::Dialogs::showQuestion(this,"Are you sure you want to delete the selected rows?")){
62          for(int i=0; i<size; i++){
63              ui->twSoundFiles->removeRow(ui->twSoundFiles->selectionModel()->selectedRows().at(size-i-1).row());
64          }
# Line 70 | Line 70 | void SoundPage2::addResourcesSounds(Drop
70      bool fileExtValid=false;
71  
72      //Pre-processing (check if received only folders)
73 <    foreach(QString myFile, resources){
73 >    for(const QString &myFile : resources){
74          QString currFileExt="."+QFileInfo(myFile).completeSuffix();
75          if(QDir(myFile).exists()){
76 <            Util::showErrorPopUp("Only files are allowed for this operation.");
76 >            Util::Dialogs::showError("Only files are allowed for this operation.");
77              return;
78          }
79  
80 <        foreach(QString vext, this->allowedFiles){
80 >        for(QString vext : this->allowedFiles){
81              vext.remove("*");
82              if(currFileExt.endsWith(vext)){
83                  fileExtValid=true;
# Line 86 | Line 86 | void SoundPage2::addResourcesSounds(Drop
86          }
87  
88          if(!fileExtValid){
89 <            Util::showErrorPopUp("Files must be in the follow formats:\n" +
89 >            Util::Dialogs::showError("Files must be in the follow formats:\n" +
90                                   this->allowedFiles.join(" "));
91              return;
92          }
93      }
94  
95 <    foreach(QString currentFile, resources){
95 >    for(const QString &currentFile : resources){
96  
97          //Get actual number rows
98          int twSize=myTable->rowCount();
# Line 102 | Line 102 | void SoundPage2::addResourcesSounds(Drop
102  
103          //Add to table and list to
104          QTableWidgetItem *newName = new QTableWidgetItem(QFileInfo(currentFile).baseName());
105 <        QTableWidgetItem *newFileLocation = new QTableWidgetItem(Util::normalizePath(currentFile));
105 >        QTableWidgetItem *newFileLocation = new QTableWidgetItem(Util::FileSystem::normalizePath(currentFile));
106  
107          myTable->setItem(twSize,0,newName);
108          myTable->setItem(twSize,1,newFileLocation);
# Line 124 | Line 124 | bool SoundPage2::validatePage(){
124      QStringList namesList;
125  
126      if(ui->twSoundFiles->rowCount()==0){
127 <        Util::showErrorPopUp("You need to add some sound files first!");
127 >        Util::Dialogs::showError("You need to add some sound files first!");
128          return false;
129      }
130  
# Line 132 | Line 132 | bool SoundPage2::validatePage(){
132          namesList << ui->twSoundFiles->item(i,0)->text();
133      }
134  
135 <    if(ui->rbOther->isChecked() && Util::checkEmptySpaces(QStringList() << ui->leOtherLocation->text())){
136 <        Util::showErrorPopUp("Please input a directory to output the files.");
135 >    if(ui->rbOther->isChecked() && Util::Validation::checkEmptySpaces(QStringList() << ui->leOtherLocation->text())){
136 >        Util::Dialogs::showError("Please input a directory to output the files.");
137          return false;
138      }
139  
140      if(ui->rbOther->isChecked() && !QDir(ui->leOtherLocation->text()).exists()){
141 <        Util::showErrorPopUp("Invalid directory specified in other location. Please fix it.");
141 >        Util::Dialogs::showError("Invalid directory specified in other location. Please fix it.");
142          return false;
143      }
144  

Diff Legend

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