forked from teamnwah/openmw-tes3coop
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 <components/file_order_list/datafilespage.hpp>
|
||||
#include <components/file_order_list/datafileslist.hpp>
|
||||
|
||||
#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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "utils/naturalsort.hpp"
|
||||
#include "utils/textinputdialog.hpp"
|
||||
|
||||
#include "datafilespage.hpp"
|
||||
#include "datafileslist.hpp"
|
||||
|
||||
#include <boost/version.hpp>
|
||||
/**
|
||||
|
@ -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()) {
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef DATAFILESPAGE_H
|
||||
#define DATAFILESPAGE_H
|
||||
#ifndef DATAFILESLIST_H
|
||||
#define DATAFILESLIST_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QModelIndex>
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in a new issue