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

Comparing:
Vago/trunk/Vago/soundWizard/soundpage2.cpp (file contents), Revision 771 by s10k, Sun Mar 31 19:02:16 2013 UTC vs.
s10k/Vago/soundWizard/soundpage2.cpp (file contents), Revision 1092 by s10k, Sat Dec 30 13:43:28 2017 UTC

# Line 2 | Line 2
2   #include "ui_soundpage2.h"
3  
4   const QStringList SoundPage2::allowedFiles = QStringList() << "*.wav" <<  "*.aif" <<  "*.aifc" << "*.afc";
5 const QString SoundPage2::codecLocalHelpFile=GlobalVars::HelpLocation + "/XMLSNDD.html#Source_file_creation";
5  
6 < SoundPage2::SoundPage2(QWidget *parent) :
6 > SoundPage2::SoundPage2(QString appLocation, QWidget *parent) :
7      QWizardPage(parent),
8      ui(new Ui::soundpage2)
9   {
10      ui->setupUi(this);
11      this->soundTable=ui->twSoundFiles;
12 +    this->codecLocalHelpFile=appLocation+"/"+GlobalVars::HelpDir + "/XMLSNDD.html#Source_file_creation";
13      ui->twSoundFiles->removeColumn(2); // Only two columns
14  
15 +    ui->label->setText("<html>Add here the files you want to convert. "
16 +                       "All the files will have the same properties applied.<br/>"
17 +                       "Don't forget to first convert the files to an oni compatible codec. "
18 +                       "More information <a href='file:///"+this->codecLocalHelpFile+"'>here.</a></html>"); // Don't use rich text in qtdesigner because it generates platform dependent code
19 +
20      // Drop signal for Packages table
21      connect(ui->twSoundFiles, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addResourcesSounds(DropTableWidget*,QStringList)));
22      // Signal for click in label (display local help)
# Line 66 | Line 71 | void SoundPage2::addResourcesSounds(Drop
71  
72      //Pre-processing (check if received only folders)
73      foreach(QString myFile, resources){
74 <        QString currFileExt=QFileInfo(myFile).completeSuffix();
74 >        QString currFileExt="."+QFileInfo(myFile).completeSuffix();
75          if(QDir(myFile).exists()){
76              Util::showErrorPopUp("Only files are allowed for this operation.");
77              return;
78          }
79  
80          foreach(QString vext, this->allowedFiles){
81 <            vext.remove("*.");
82 <            if(vext==currFileExt){
81 >            vext.remove("*");
82 >            if(currFileExt.endsWith(vext)){
83                  fileExtValid=true;
84                  break;
85              }

Diff Legend

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