mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:23:53 +00:00
Added ability to get the previous profile when a new one is selected
This commit is contained in:
parent
be47750a45
commit
c911f62e8b
5 changed files with 14 additions and 12 deletions
|
@ -9,6 +9,7 @@ set(LAUNCHER
|
||||||
lineedit.hpp
|
lineedit.hpp
|
||||||
maindialog.hpp
|
maindialog.hpp
|
||||||
playpage.hpp
|
playpage.hpp
|
||||||
|
combobox.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(MOC_HDRS
|
SET(MOC_HDRS
|
||||||
|
@ -16,6 +17,7 @@ SET(MOC_HDRS
|
||||||
lineedit.hpp
|
lineedit.hpp
|
||||||
maindialog.hpp
|
maindialog.hpp
|
||||||
playpage.hpp
|
playpage.hpp
|
||||||
|
combobox.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
source_group(apps\\launcher FILES ${ESMTOOL})
|
source_group(apps\\launcher FILES ${ESMTOOL})
|
||||||
|
|
|
@ -51,7 +51,8 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
||||||
profileList << "Default" << "New" << "Yeah" << "Cool story bro!";
|
profileList << "Default" << "New" << "Yeah" << "Cool story bro!";
|
||||||
mProfileModel->setStringList(profileList);
|
mProfileModel->setStringList(profileList);
|
||||||
|
|
||||||
mProfileComboBox = new QComboBox(this);
|
|
||||||
|
mProfileComboBox = new ComboBox(this);
|
||||||
mProfileComboBox->setModel(mProfileModel);
|
mProfileComboBox->setModel(mProfileModel);
|
||||||
|
|
||||||
mProfileComboBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
|
mProfileComboBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
|
||||||
|
@ -77,7 +78,7 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
||||||
|
|
||||||
QVBoxLayout *pageLayout = new QVBoxLayout(this);
|
QVBoxLayout *pageLayout = new QVBoxLayout(this);
|
||||||
// Add some space above and below the page items
|
// Add some space above and below the page items
|
||||||
QSpacerItem *vSpacer1 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
//QSpacerItem *vSpacer1 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
QSpacerItem *vSpacer2 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
QSpacerItem *vSpacer2 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
QSpacerItem *vSpacer3 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
QSpacerItem *vSpacer3 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
|
|
||||||
|
@ -97,8 +98,8 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
||||||
connect(mPluginsTable, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(setCheckstate(QModelIndex)));
|
connect(mPluginsTable, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(setCheckstate(QModelIndex)));
|
||||||
connect(mPluginsModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(resizeRows()));
|
connect(mPluginsModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(resizeRows()));
|
||||||
|
|
||||||
connect(mProfileComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(profileChanged(const QString&)));
|
//connect(mProfileComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(profileChanged(const QString&)));
|
||||||
|
connect(mProfileComboBox, SIGNAL(textChanged(const QString&, const QString&)), this, SLOT(profileChanged(const QString&, const QString&)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataFilesPage::setupDataFiles()
|
void DataFilesPage::setupDataFiles()
|
||||||
|
@ -349,12 +350,13 @@ void DataFilesPage::uncheckPlugins()
|
||||||
void DataFilesPage::resizeRows()
|
void DataFilesPage::resizeRows()
|
||||||
{
|
{
|
||||||
// Contents changed
|
// Contents changed
|
||||||
|
qDebug() << "test";
|
||||||
mPluginsTable->resizeRowsToContents();
|
mPluginsTable->resizeRowsToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataFilesPage::profileChanged(const QString &profile)
|
void DataFilesPage::profileChanged(const QString ¤t, const QString &previous)
|
||||||
{
|
{
|
||||||
qDebug() << "Profile changed";
|
qDebug() << "Profile changed " << current << previous;
|
||||||
uncheckPlugins();
|
uncheckPlugins();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,11 @@
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
|
#include "combobox.hpp"
|
||||||
|
|
||||||
class QTableWidget;
|
class QTableWidget;
|
||||||
class QTableView;
|
class QTableView;
|
||||||
class QComboBox;
|
class ComboBox;
|
||||||
class QStandardItemModel;
|
class QStandardItemModel;
|
||||||
class QItemSelection;
|
class QItemSelection;
|
||||||
class QItemSelectionModel;
|
class QItemSelectionModel;
|
||||||
|
@ -19,7 +20,7 @@ class DataFilesPage : public QWidget
|
||||||
public:
|
public:
|
||||||
DataFilesPage(QWidget *parent = 0);
|
DataFilesPage(QWidget *parent = 0);
|
||||||
|
|
||||||
QComboBox *mProfileComboBox;
|
ComboBox *mProfileComboBox;
|
||||||
QStringListModel *mProfileModel;
|
QStringListModel *mProfileModel;
|
||||||
|
|
||||||
const QStringList checkedPlugins();
|
const QStringList checkedPlugins();
|
||||||
|
@ -29,7 +30,7 @@ public slots:
|
||||||
void masterSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
void masterSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
||||||
void setCheckstate(QModelIndex index);
|
void setCheckstate(QModelIndex index);
|
||||||
void resizeRows();
|
void resizeRows();
|
||||||
void profileChanged(const QString &profile);
|
void profileChanged(const QString ¤t, const QString &previous);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTableWidget *mMastersWidget;
|
QTableWidget *mMastersWidget;
|
||||||
|
|
|
@ -18,8 +18,6 @@ MainDialog::MainDialog()
|
||||||
mIconWidget = new QListWidget;
|
mIconWidget = new QListWidget;
|
||||||
mIconWidget->setViewMode(QListView::IconMode);
|
mIconWidget->setViewMode(QListView::IconMode);
|
||||||
mIconWidget->setWrapping(false);
|
mIconWidget->setWrapping(false);
|
||||||
mIconWidget->setObjectName("IconWidget");
|
|
||||||
qDebug() << mIconWidget->objectName();
|
|
||||||
|
|
||||||
mIconWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Just to be sure
|
mIconWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Just to be sure
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ PlayPage::PlayPage(QWidget *parent) : QWidget(parent)
|
||||||
|
|
||||||
file.open(QFile::ReadOnly);
|
file.open(QFile::ReadOnly);
|
||||||
QString styleSheet = QLatin1String(file.readAll());
|
QString styleSheet = QLatin1String(file.readAll());
|
||||||
qDebug() << styleSheet;
|
|
||||||
setStyleSheet(styleSheet);
|
setStyleSheet(styleSheet);
|
||||||
|
|
||||||
QGroupBox *playBox = new QGroupBox(this);
|
QGroupBox *playBox = new QGroupBox(this);
|
||||||
|
|
Loading…
Reference in a new issue