diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 7eb31e76b..43b8f317a 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include "maindialog.hpp" #include "playpage.hpp" @@ -124,16 +124,16 @@ void MainDialog::createPages() { mPlayPage = new PlayPage(this); mGraphicsPage = new GraphicsPage(mCfgMgr, this); - mDataFilesPage = new DataFilesPage(mCfgMgr, this); + mDataFilesList = new DataFilesList(mCfgMgr, this); // Set the combobox of the play page to imitate the combobox on the datafilespage - mPlayPage->mProfilesComboBox->setModel(mDataFilesPage->mProfilesComboBox->model()); - mPlayPage->mProfilesComboBox->setCurrentIndex(mDataFilesPage->mProfilesComboBox->currentIndex()); + mPlayPage->mProfilesComboBox->setModel(mDataFilesList->mProfilesComboBox->model()); + mPlayPage->mProfilesComboBox->setCurrentIndex(mDataFilesList->mProfilesComboBox->currentIndex()); // Add the pages to the stacked widget mPagesWidget->addWidget(mPlayPage); mPagesWidget->addWidget(mGraphicsPage); - mPagesWidget->addWidget(mDataFilesPage); + mPagesWidget->addWidget(mDataFilesList); // Select the first page mIconWidget->setCurrentItem(mIconWidget->item(0), QItemSelectionModel::Select); @@ -142,9 +142,9 @@ void MainDialog::createPages() connect(mPlayPage->mProfilesComboBox, SIGNAL(currentIndexChanged(int)), - mDataFilesPage->mProfilesComboBox, SLOT(setCurrentIndex(int))); + mDataFilesList->mProfilesComboBox, SLOT(setCurrentIndex(int))); - connect(mDataFilesPage->mProfilesComboBox, + connect(mDataFilesList->mProfilesComboBox, SIGNAL(currentIndexChanged(int)), mPlayPage->mProfilesComboBox, SLOT(setCurrentIndex(int))); @@ -190,7 +190,7 @@ bool MainDialog::setup() } // Setup the Data Files page - if (!mDataFilesPage->setupDataFiles()) { + if (!mDataFilesList->setupDataFiles()) { return false; } @@ -208,7 +208,7 @@ void MainDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous) void MainDialog::closeEvent(QCloseEvent *event) { // Now write all config files - mDataFilesPage->writeConfig(); + mDataFilesList->writeConfig(); mGraphicsPage->writeConfig(); // Save user settings @@ -221,7 +221,7 @@ void MainDialog::closeEvent(QCloseEvent *event) void MainDialog::play() { // First do a write of all the configs, just to be sure - mDataFilesPage->writeConfig(); + mDataFilesList->writeConfig(); mGraphicsPage->writeConfig(); // Save user settings diff --git a/apps/launcher/maindialog.hpp b/apps/launcher/maindialog.hpp index bf98011cc..5a39c11a9 100644 --- a/apps/launcher/maindialog.hpp +++ b/apps/launcher/maindialog.hpp @@ -15,7 +15,7 @@ class QString; class PlayPage; class GraphicsPage; -class DataFilesPage; +class DataFilesList; class MainDialog : public QMainWindow { @@ -39,7 +39,7 @@ private: PlayPage *mPlayPage; GraphicsPage *mGraphicsPage; - DataFilesPage *mDataFilesPage; + DataFilesList *mDataFilesList; Files::ConfigurationManager mCfgMgr; Settings::Manager mSettings; diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index a6812dbb3..3798f66b7 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -67,7 +67,7 @@ add_component_dir (translation ) add_component_qt_dir (file_order_list - datafilespage model/modelitem model/datafilesmodel model/esm/esmfile + datafileslist model/modelitem model/datafilesmodel model/esm/esmfile utils/filedialog utils/lineedit utils/profilescombobox utils/textinputdialog utils/naturalsort ) diff --git a/components/file_order_list/datafilespage.cpp b/components/file_order_list/datafileslist.cpp similarity index 97% rename from components/file_order_list/datafilespage.cpp rename to components/file_order_list/datafileslist.cpp index 6b0539c1d..bf4f8cb86 100644 --- a/components/file_order_list/datafilespage.cpp +++ b/components/file_order_list/datafileslist.cpp @@ -12,7 +12,7 @@ #include "utils/naturalsort.hpp" #include "utils/textinputdialog.hpp" -#include "datafilespage.hpp" +#include "datafileslist.hpp" #include /** @@ -46,7 +46,7 @@ bool rowSmallerThan(const QModelIndex &index1, const QModelIndex &index2) return index1.row() <= index2.row(); } -DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, QWidget *parent) +DataFilesList::DataFilesList(Files::ConfigurationManager &cfg, QWidget *parent) : QWidget(parent) , mCfgMgr(cfg) { @@ -180,7 +180,7 @@ DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, QWidget *parent) setupConfig(); } -void DataFilesPage::createActions() +void DataFilesList::createActions() { // Refresh the plugins QAction *refreshAction = new QAction(tr("Refresh"), this); @@ -218,7 +218,7 @@ void DataFilesPage::createActions() } -void DataFilesPage::setupConfig() +void DataFilesList::setupConfig() { // Open our config file QString config = QString::fromStdString((mCfgMgr.getUserPath() / "launcher.cfg").string()); @@ -265,7 +265,7 @@ void DataFilesPage::setupConfig() } -void DataFilesPage::readConfig() +void DataFilesList::readConfig() { // Don't read the config if no masters are found if (mMastersModel->rowCount() < 1) @@ -340,7 +340,7 @@ void DataFilesPage::readConfig() } -bool DataFilesPage::showDataFilesWarning() +bool DataFilesList::showDataFilesWarning() { QMessageBox msgBox; @@ -381,7 +381,7 @@ bool DataFilesPage::showDataFilesWarning() return true; } -bool DataFilesPage::setupDataFiles() +bool DataFilesList::setupDataFiles() { // We use the Configuration Manager to retrieve the configuration values boost::program_options::variables_map variables; @@ -451,7 +451,7 @@ bool DataFilesPage::setupDataFiles() return true; } -void DataFilesPage::writeConfig(QString profile) +void DataFilesList::writeConfig(QString profile) { // Don't overwrite the config if no masters are found if (mMastersModel->rowCount() < 1) @@ -606,7 +606,7 @@ void DataFilesPage::writeConfig(QString profile) } -void DataFilesPage::newProfile() +void DataFilesList::newProfile() { if (mNewProfileDialog->exec() == QDialog::Accepted) { @@ -621,7 +621,7 @@ void DataFilesPage::newProfile() } } -void DataFilesPage::updateOkButton(const QString &text) +void DataFilesList::updateOkButton(const QString &text) { if (text.isEmpty()) { mNewProfileDialog->setOkButtonEnabled(false); @@ -633,7 +633,7 @@ void DataFilesPage::updateOkButton(const QString &text) : mNewProfileDialog->setOkButtonEnabled(false); } -void DataFilesPage::deleteProfile() +void DataFilesList::deleteProfile() { QString profile = mProfilesComboBox->currentText(); @@ -670,7 +670,7 @@ void DataFilesPage::deleteProfile() } } -void DataFilesPage::check() +void DataFilesList::check() { // Check the current selection if (!mPluginsTable->selectionModel()->hasSelection()) { @@ -690,7 +690,7 @@ void DataFilesPage::check() } } -void DataFilesPage::uncheck() +void DataFilesList::uncheck() { // uncheck the current selection if (!mPluginsTable->selectionModel()->hasSelection()) { @@ -710,7 +710,7 @@ void DataFilesPage::uncheck() } } -void DataFilesPage::refresh() +void DataFilesList::refresh() { mPluginsModel->sort(0); @@ -722,7 +722,7 @@ void DataFilesPage::refresh() } -void DataFilesPage::setCheckState(QModelIndex index) +void DataFilesList::setCheckState(QModelIndex index) { if (!index.isValid()) return; @@ -751,13 +751,13 @@ void DataFilesPage::setCheckState(QModelIndex index) } -void DataFilesPage::filterChanged(const QString filter) +void DataFilesList::filterChanged(const QString filter) { QRegExp regExp(filter, Qt::CaseInsensitive, QRegExp::FixedString); mPluginsProxyModel->setFilterRegExp(regExp); } -void DataFilesPage::profileChanged(const QString &previous, const QString ¤t) +void DataFilesList::profileChanged(const QString &previous, const QString ¤t) { qDebug() << "Profile is changed from: " << previous << " to " << current; // Prevent the deletion of the default profile @@ -785,7 +785,7 @@ void DataFilesPage::profileChanged(const QString &previous, const QString &curre readConfig(); } -void DataFilesPage::profileRenamed(const QString &previous, const QString ¤t) +void DataFilesList::profileRenamed(const QString &previous, const QString ¤t) { if (previous.isEmpty()) return; @@ -815,7 +815,7 @@ void DataFilesPage::profileRenamed(const QString &previous, const QString &curre readConfig(); } -void DataFilesPage::showContextMenu(const QPoint &point) +void DataFilesList::showContextMenu(const QPoint &point) { // Make sure there are plugins in the view if (!mPluginsTable->selectionModel()->hasSelection()) { diff --git a/components/file_order_list/datafilespage.hpp b/components/file_order_list/datafileslist.hpp similarity index 92% rename from components/file_order_list/datafilespage.hpp rename to components/file_order_list/datafileslist.hpp index 13668ec30..7bb6605ab 100644 --- a/components/file_order_list/datafilespage.hpp +++ b/components/file_order_list/datafileslist.hpp @@ -1,5 +1,5 @@ -#ifndef DATAFILESPAGE_H -#define DATAFILESPAGE_H +#ifndef DATAFILESLIST_H +#define DATAFILESLIST_H #include #include @@ -20,12 +20,12 @@ class TextInputDialog; namespace Files { struct ConfigurationManager; } -class DataFilesPage : public QWidget +class DataFilesList : public QWidget { Q_OBJECT public: - DataFilesPage(Files::ConfigurationManager& cfg, QWidget *parent = 0); + DataFilesList(Files::ConfigurationManager& cfg, QWidget *parent = 0); ProfilesComboBox *mProfilesComboBox;