OSDN Git Service

Switched the method of how the Designer UI file is used in the CueSheetImport class...
authorLoRd_MuldeR <mulder2@gmx.de>
Sat, 15 Dec 2012 22:23:22 +0000 (23:23 +0100)
committerLoRd_MuldeR <mulder2@gmx.de>
Sat, 15 Dec 2012 22:23:22 +0000 (23:23 +0100)
src/Config.h
src/Dialog_CueImport.cpp
src/Dialog_CueImport.h

index 3ee4a7e..fcbc503 100644 (file)
@@ -30,7 +30,7 @@
 #define VER_LAMEXP_MINOR_LO                                    7
 #define VER_LAMEXP_TYPE                                                Alpha
 #define VER_LAMEXP_PATCH                                       6
-#define VER_LAMEXP_BUILD                                       1218
+#define VER_LAMEXP_BUILD                                       1219
 
 ///////////////////////////////////////////////////////////////////////////////
 // Tool versions (minimum expected versions!)
index 4f29c70..5cd461e 100644 (file)
 
 #include "Dialog_CueImport.h"
 
+//UIC includes
+#include "../tmp/UIC_CueSheetImport.h"
+
+//LameXP includes
 #include "Global.h"
 #include "Model_CueSheet.h"
 #include "Model_AudioFile.h"
@@ -30,6 +34,7 @@
 #include "Thread_CueSplitter.h"
 #include "LockedFile.h"
 
+//Qt includes
 #include <QFileInfo>
 #include <QMessageBox>
 #include <QTimer>
 CueImportDialog::CueImportDialog(QWidget *parent, FileListModel *fileList, const QString &cueFile)
 :
        QDialog(parent),
+       ui(new Ui::CueSheetImport),
        m_cueFileName(cueFile),
        m_fileList(fileList)
 {
        //Init the dialog, from the .ui file
-       setupUi(this);
+       ui->setupUi(this);
 
        //Fix size
        setMinimumSize(this->size());
@@ -64,25 +70,26 @@ CueImportDialog::CueImportDialog(QWidget *parent, FileListModel *fileList, const
        connect(m_model, SIGNAL(modelReset()), this, SLOT(modelChanged()));
        
        //Setup table view
-       treeView->setModel(m_model);
-       treeView->header()->setStretchLastSection(false);
-       treeView->header()->setResizeMode(QHeaderView::ResizeToContents);
-       treeView->header()->setResizeMode(1, QHeaderView::Stretch);
-       treeView->header()->setMovable(false);
-       treeView->setItemsExpandable(false);
+       ui->treeView->setModel(m_model);
+       ui->treeView->header()->setStretchLastSection(false);
+       ui->treeView->header()->setResizeMode(QHeaderView::ResizeToContents);
+       ui->treeView->header()->setResizeMode(1, QHeaderView::Stretch);
+       ui->treeView->header()->setMovable(false);
+       ui->treeView->setItemsExpandable(false);
 
        //Enable up/down button
-       connect(imprtButton, SIGNAL(clicked()), this, SLOT(importButtonClicked()));
-       connect(browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
-       connect(loadOtherButton, SIGNAL(clicked()), this, SLOT(loadOtherButtonClicked()));
+       connect(ui->imprtButton, SIGNAL(clicked()), this, SLOT(importButtonClicked()));
+       connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
+       connect(ui->loadOtherButton, SIGNAL(clicked()), this, SLOT(loadOtherButtonClicked()));
 
        //Translate
-       labelHeaderText->setText(QString("<b>%1</b><br>%2").arg(tr("Import Cue Sheet"), tr("The following Cue Sheet will be split and imported into LameXP.")));
+       ui->labelHeaderText->setText(QString("<b>%1</b><br>%2").arg(tr("Import Cue Sheet"), tr("The following Cue Sheet will be split and imported into LameXP.")));
 }
 
 CueImportDialog::~CueImportDialog(void)
 {
        LAMEXP_DELETE(m_model);
+       LAMEXP_DELETE(ui);
 }
 
 ////////////////////////////////////////////////////////////
@@ -222,10 +229,10 @@ int CueImportDialog::exec(void)
 
 void CueImportDialog::modelChanged(void)
 {
-       treeView->expandAll();
-       editOutputDir->setText(QDir::toNativeSeparators(m_outputDir));
-       labelArtist->setText(m_model->getAlbumPerformer().isEmpty() ? tr("Unknown Artist") : m_model->getAlbumPerformer());
-       labelAlbum->setText(m_model->getAlbumTitle().isEmpty() ? tr("Unknown Album") : m_model->getAlbumTitle());
+       ui->treeView->expandAll();
+       ui->editOutputDir->setText(QDir::toNativeSeparators(m_outputDir));
+       ui->labelArtist->setText(m_model->getAlbumPerformer().isEmpty() ? tr("Unknown Artist") : m_model->getAlbumPerformer());
+       ui->labelAlbum->setText(m_model->getAlbumTitle().isEmpty() ? tr("Unknown Album") : m_model->getAlbumTitle());
 }
 
 void CueImportDialog::browseButtonClicked(void)
index a63e032..59939f1 100644 (file)
 #pragma once
 
 #include <QDialog>
-#include "../tmp/UIC_CueSheetImport.h"
-
-#include "Model_AudioFile.h"
 
 class CueSheetModel;
 class LockedFile;
+class AudioFileModel;
 class FileListModel;
 
-class CueImportDialog : public QDialog, private Ui::CueSheetImport
+//UIC forward declartion
+namespace Ui {
+       class CueSheetImport;
+}
+
+//CueImportDialog class
+class CueImportDialog : public QDialog
 {
        Q_OBJECT
 
@@ -51,6 +55,8 @@ private slots:
        void analyzedFile(const AudioFileModel &file);
 
 private:
+       Ui::CueSheetImport *ui; //for Qt UIC
+       
        void importCueSheet(void);
        bool analyzeFiles(QStringList &files);
        void splitFiles(void);