mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-25 07:56:37 +00:00 
			
		
		
		
	Rename datafilespage to datafileslist
This commit is contained in:
		
							parent
							
								
									f029a9011a
								
							
						
					
					
						commit
						ac62dd050d
					
				
					 5 changed files with 36 additions and 36 deletions
				
			
		|  | @ -1,6 +1,6 @@ | ||||||
| #include <QtGui> | #include <QtGui> | ||||||
| 
 | 
 | ||||||
| #include <components/file_order_list/datafilespage.hpp> | #include <components/file_order_list/datafileslist.hpp> | ||||||
| 
 | 
 | ||||||
| #include "maindialog.hpp" | #include "maindialog.hpp" | ||||||
| #include "playpage.hpp" | #include "playpage.hpp" | ||||||
|  | @ -124,16 +124,16 @@ void MainDialog::createPages() | ||||||
| { | { | ||||||
|     mPlayPage = new PlayPage(this); |     mPlayPage = new PlayPage(this); | ||||||
|     mGraphicsPage = new GraphicsPage(mCfgMgr, 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
 |     // Set the combobox of the play page to imitate the combobox on the datafilespage
 | ||||||
|     mPlayPage->mProfilesComboBox->setModel(mDataFilesPage->mProfilesComboBox->model()); |     mPlayPage->mProfilesComboBox->setModel(mDataFilesList->mProfilesComboBox->model()); | ||||||
|     mPlayPage->mProfilesComboBox->setCurrentIndex(mDataFilesPage->mProfilesComboBox->currentIndex()); |     mPlayPage->mProfilesComboBox->setCurrentIndex(mDataFilesList->mProfilesComboBox->currentIndex()); | ||||||
| 
 | 
 | ||||||
|     // Add the pages to the stacked widget
 |     // Add the pages to the stacked widget
 | ||||||
|     mPagesWidget->addWidget(mPlayPage); |     mPagesWidget->addWidget(mPlayPage); | ||||||
|     mPagesWidget->addWidget(mGraphicsPage); |     mPagesWidget->addWidget(mGraphicsPage); | ||||||
|     mPagesWidget->addWidget(mDataFilesPage); |     mPagesWidget->addWidget(mDataFilesList); | ||||||
| 
 | 
 | ||||||
|     // Select the first page
 |     // Select the first page
 | ||||||
|     mIconWidget->setCurrentItem(mIconWidget->item(0), QItemSelectionModel::Select); |     mIconWidget->setCurrentItem(mIconWidget->item(0), QItemSelectionModel::Select); | ||||||
|  | @ -142,9 +142,9 @@ void MainDialog::createPages() | ||||||
| 
 | 
 | ||||||
|     connect(mPlayPage->mProfilesComboBox, |     connect(mPlayPage->mProfilesComboBox, | ||||||
|             SIGNAL(currentIndexChanged(int)), |             SIGNAL(currentIndexChanged(int)), | ||||||
|             mDataFilesPage->mProfilesComboBox, SLOT(setCurrentIndex(int))); |             mDataFilesList->mProfilesComboBox, SLOT(setCurrentIndex(int))); | ||||||
| 
 | 
 | ||||||
|     connect(mDataFilesPage->mProfilesComboBox, |     connect(mDataFilesList->mProfilesComboBox, | ||||||
|             SIGNAL(currentIndexChanged(int)), |             SIGNAL(currentIndexChanged(int)), | ||||||
|             mPlayPage->mProfilesComboBox, SLOT(setCurrentIndex(int))); |             mPlayPage->mProfilesComboBox, SLOT(setCurrentIndex(int))); | ||||||
| 
 | 
 | ||||||
|  | @ -190,7 +190,7 @@ bool MainDialog::setup() | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // Setup the Data Files page
 |     // Setup the Data Files page
 | ||||||
|     if (!mDataFilesPage->setupDataFiles()) { |     if (!mDataFilesList->setupDataFiles()) { | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -208,7 +208,7 @@ void MainDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous) | ||||||
| void MainDialog::closeEvent(QCloseEvent *event) | void MainDialog::closeEvent(QCloseEvent *event) | ||||||
| { | { | ||||||
|     // Now write all config files
 |     // Now write all config files
 | ||||||
|     mDataFilesPage->writeConfig(); |     mDataFilesList->writeConfig(); | ||||||
|     mGraphicsPage->writeConfig(); |     mGraphicsPage->writeConfig(); | ||||||
| 
 | 
 | ||||||
|     // Save user settings
 |     // Save user settings
 | ||||||
|  | @ -221,7 +221,7 @@ void MainDialog::closeEvent(QCloseEvent *event) | ||||||
| void MainDialog::play() | void MainDialog::play() | ||||||
| { | { | ||||||
|     // First do a write of all the configs, just to be sure
 |     // First do a write of all the configs, just to be sure
 | ||||||
|     mDataFilesPage->writeConfig(); |     mDataFilesList->writeConfig(); | ||||||
|     mGraphicsPage->writeConfig(); |     mGraphicsPage->writeConfig(); | ||||||
| 
 | 
 | ||||||
|     // Save user settings
 |     // Save user settings
 | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ class QString; | ||||||
| 
 | 
 | ||||||
| class PlayPage; | class PlayPage; | ||||||
| class GraphicsPage; | class GraphicsPage; | ||||||
| class DataFilesPage; | class DataFilesList; | ||||||
| 
 | 
 | ||||||
| class MainDialog : public QMainWindow | class MainDialog : public QMainWindow | ||||||
| { | { | ||||||
|  | @ -39,7 +39,7 @@ private: | ||||||
| 
 | 
 | ||||||
|     PlayPage *mPlayPage; |     PlayPage *mPlayPage; | ||||||
|     GraphicsPage *mGraphicsPage; |     GraphicsPage *mGraphicsPage; | ||||||
|     DataFilesPage *mDataFilesPage; |     DataFilesList *mDataFilesList; | ||||||
| 
 | 
 | ||||||
|     Files::ConfigurationManager mCfgMgr; |     Files::ConfigurationManager mCfgMgr; | ||||||
|     Settings::Manager mSettings; |     Settings::Manager mSettings; | ||||||
|  |  | ||||||
|  | @ -67,7 +67,7 @@ add_component_dir (translation | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
| add_component_qt_dir (file_order_list | 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 |     utils/filedialog utils/lineedit utils/profilescombobox utils/textinputdialog utils/naturalsort | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,7 +12,7 @@ | ||||||
| #include "utils/naturalsort.hpp" | #include "utils/naturalsort.hpp" | ||||||
| #include "utils/textinputdialog.hpp" | #include "utils/textinputdialog.hpp" | ||||||
| 
 | 
 | ||||||
| #include "datafilespage.hpp" | #include "datafileslist.hpp" | ||||||
| 
 | 
 | ||||||
| #include <boost/version.hpp> | #include <boost/version.hpp> | ||||||
| /**
 | /**
 | ||||||
|  | @ -46,7 +46,7 @@ bool rowSmallerThan(const QModelIndex &index1, const QModelIndex &index2) | ||||||
|     return index1.row() <= index2.row(); |     return index1.row() <= index2.row(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, QWidget *parent) | DataFilesList::DataFilesList(Files::ConfigurationManager &cfg, QWidget *parent) | ||||||
|     : QWidget(parent) |     : QWidget(parent) | ||||||
|     , mCfgMgr(cfg) |     , mCfgMgr(cfg) | ||||||
| { | { | ||||||
|  | @ -180,7 +180,7 @@ DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, QWidget *parent) | ||||||
|     setupConfig(); |     setupConfig(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::createActions() | void DataFilesList::createActions() | ||||||
| { | { | ||||||
|     // Refresh the plugins
 |     // Refresh the plugins
 | ||||||
|     QAction *refreshAction = new QAction(tr("Refresh"), this); |     QAction *refreshAction = new QAction(tr("Refresh"), this); | ||||||
|  | @ -218,7 +218,7 @@ void DataFilesPage::createActions() | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::setupConfig() | void DataFilesList::setupConfig() | ||||||
| { | { | ||||||
|     // Open our config file
 |     // Open our config file
 | ||||||
|     QString config = QString::fromStdString((mCfgMgr.getUserPath() / "launcher.cfg").string()); |     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
 |     // Don't read the config if no masters are found
 | ||||||
|     if (mMastersModel->rowCount() < 1) |     if (mMastersModel->rowCount() < 1) | ||||||
|  | @ -340,7 +340,7 @@ void DataFilesPage::readConfig() | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool DataFilesPage::showDataFilesWarning() | bool DataFilesList::showDataFilesWarning() | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
|     QMessageBox msgBox; |     QMessageBox msgBox; | ||||||
|  | @ -381,7 +381,7 @@ bool DataFilesPage::showDataFilesWarning() | ||||||
|     return true; |     return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool DataFilesPage::setupDataFiles() | bool DataFilesList::setupDataFiles() | ||||||
| { | { | ||||||
|     // We use the Configuration Manager to retrieve the configuration values
 |     // We use the Configuration Manager to retrieve the configuration values
 | ||||||
|     boost::program_options::variables_map variables; |     boost::program_options::variables_map variables; | ||||||
|  | @ -451,7 +451,7 @@ bool DataFilesPage::setupDataFiles() | ||||||
|     return true; |     return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::writeConfig(QString profile) | void DataFilesList::writeConfig(QString profile) | ||||||
| { | { | ||||||
|     // Don't overwrite the config if no masters are found
 |     // Don't overwrite the config if no masters are found
 | ||||||
|     if (mMastersModel->rowCount() < 1) |     if (mMastersModel->rowCount() < 1) | ||||||
|  | @ -606,7 +606,7 @@ void DataFilesPage::writeConfig(QString profile) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::newProfile() | void DataFilesList::newProfile() | ||||||
| { | { | ||||||
|     if (mNewProfileDialog->exec() == QDialog::Accepted) { |     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()) { |     if (text.isEmpty()) { | ||||||
|          mNewProfileDialog->setOkButtonEnabled(false); |          mNewProfileDialog->setOkButtonEnabled(false); | ||||||
|  | @ -633,7 +633,7 @@ void DataFilesPage::updateOkButton(const QString &text) | ||||||
|             : mNewProfileDialog->setOkButtonEnabled(false); |             : mNewProfileDialog->setOkButtonEnabled(false); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::deleteProfile() | void DataFilesList::deleteProfile() | ||||||
| { | { | ||||||
|     QString profile = mProfilesComboBox->currentText(); |     QString profile = mProfilesComboBox->currentText(); | ||||||
| 
 | 
 | ||||||
|  | @ -670,7 +670,7 @@ void DataFilesPage::deleteProfile() | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::check() | void DataFilesList::check() | ||||||
| { | { | ||||||
|     // Check the current selection
 |     // Check the current selection
 | ||||||
|     if (!mPluginsTable->selectionModel()->hasSelection()) { |     if (!mPluginsTable->selectionModel()->hasSelection()) { | ||||||
|  | @ -690,7 +690,7 @@ void DataFilesPage::check() | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::uncheck() | void DataFilesList::uncheck() | ||||||
| { | { | ||||||
|     // uncheck the current selection
 |     // uncheck the current selection
 | ||||||
|     if (!mPluginsTable->selectionModel()->hasSelection()) { |     if (!mPluginsTable->selectionModel()->hasSelection()) { | ||||||
|  | @ -710,7 +710,7 @@ void DataFilesPage::uncheck() | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::refresh() | void DataFilesList::refresh() | ||||||
| { | { | ||||||
|     mPluginsModel->sort(0); |     mPluginsModel->sort(0); | ||||||
| 
 | 
 | ||||||
|  | @ -722,7 +722,7 @@ void DataFilesPage::refresh() | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::setCheckState(QModelIndex index) | void DataFilesList::setCheckState(QModelIndex index) | ||||||
| { | { | ||||||
|     if (!index.isValid()) |     if (!index.isValid()) | ||||||
|         return; |         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); |     QRegExp regExp(filter, Qt::CaseInsensitive, QRegExp::FixedString); | ||||||
|     mPluginsProxyModel->setFilterRegExp(regExp); |     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; |     qDebug() << "Profile is changed from: " << previous << " to " << current; | ||||||
|     // Prevent the deletion of the default profile
 |     // Prevent the deletion of the default profile
 | ||||||
|  | @ -785,7 +785,7 @@ void DataFilesPage::profileChanged(const QString &previous, const QString &curre | ||||||
|     readConfig(); |     readConfig(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::profileRenamed(const QString &previous, const QString ¤t) | void DataFilesList::profileRenamed(const QString &previous, const QString ¤t) | ||||||
| { | { | ||||||
|     if (previous.isEmpty()) |     if (previous.isEmpty()) | ||||||
|         return; |         return; | ||||||
|  | @ -815,7 +815,7 @@ void DataFilesPage::profileRenamed(const QString &previous, const QString &curre | ||||||
|      readConfig(); |      readConfig(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DataFilesPage::showContextMenu(const QPoint &point) | void DataFilesList::showContextMenu(const QPoint &point) | ||||||
| { | { | ||||||
|     // Make sure there are plugins in the view
 |     // Make sure there are plugins in the view
 | ||||||
|     if (!mPluginsTable->selectionModel()->hasSelection()) { |     if (!mPluginsTable->selectionModel()->hasSelection()) { | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| #ifndef DATAFILESPAGE_H | #ifndef DATAFILESLIST_H | ||||||
| #define DATAFILESPAGE_H | #define DATAFILESLIST_H | ||||||
| 
 | 
 | ||||||
| #include <QWidget> | #include <QWidget> | ||||||
| #include <QModelIndex> | #include <QModelIndex> | ||||||
|  | @ -20,12 +20,12 @@ class TextInputDialog; | ||||||
| 
 | 
 | ||||||
| namespace Files { struct ConfigurationManager; } | namespace Files { struct ConfigurationManager; } | ||||||
| 
 | 
 | ||||||
| class DataFilesPage : public QWidget | class DataFilesList : public QWidget | ||||||
| { | { | ||||||
|     Q_OBJECT |     Q_OBJECT | ||||||
| 
 | 
 | ||||||
| public: | public: | ||||||
|     DataFilesPage(Files::ConfigurationManager& cfg, QWidget *parent = 0); |     DataFilesList(Files::ConfigurationManager& cfg, QWidget *parent = 0); | ||||||
| 
 | 
 | ||||||
|     ProfilesComboBox *mProfilesComboBox; |     ProfilesComboBox *mProfilesComboBox; | ||||||
| 
 | 
 | ||||||
		Loading…
	
		Reference in a new issue