forked from mirror/openmw-tes3mp
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
|
||||
maindialog.hpp
|
||||
playpage.hpp
|
||||
combobox.hpp
|
||||
)
|
||||
|
||||
SET(MOC_HDRS
|
||||
|
@ -16,6 +17,7 @@ SET(MOC_HDRS
|
|||
lineedit.hpp
|
||||
maindialog.hpp
|
||||
playpage.hpp
|
||||
combobox.hpp
|
||||
)
|
||||
|
||||
source_group(apps\\launcher FILES ${ESMTOOL})
|
||||
|
|
|
@ -51,7 +51,8 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
|||
profileList << "Default" << "New" << "Yeah" << "Cool story bro!";
|
||||
mProfileModel->setStringList(profileList);
|
||||
|
||||
mProfileComboBox = new QComboBox(this);
|
||||
|
||||
mProfileComboBox = new ComboBox(this);
|
||||
mProfileComboBox->setModel(mProfileModel);
|
||||
|
||||
mProfileComboBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
|
||||
|
@ -77,7 +78,7 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
|||
|
||||
QVBoxLayout *pageLayout = new QVBoxLayout(this);
|
||||
// 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 *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(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()
|
||||
|
@ -349,12 +350,13 @@ void DataFilesPage::uncheckPlugins()
|
|||
void DataFilesPage::resizeRows()
|
||||
{
|
||||
// Contents changed
|
||||
qDebug() << "test";
|
||||
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();
|
||||
|
||||
}
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
|
||||
#include <QWidget>
|
||||
#include <QModelIndex>
|
||||
#include "combobox.hpp"
|
||||
|
||||
class QTableWidget;
|
||||
class QTableView;
|
||||
class QComboBox;
|
||||
class ComboBox;
|
||||
class QStandardItemModel;
|
||||
class QItemSelection;
|
||||
class QItemSelectionModel;
|
||||
|
@ -19,7 +20,7 @@ class DataFilesPage : public QWidget
|
|||
public:
|
||||
DataFilesPage(QWidget *parent = 0);
|
||||
|
||||
QComboBox *mProfileComboBox;
|
||||
ComboBox *mProfileComboBox;
|
||||
QStringListModel *mProfileModel;
|
||||
|
||||
const QStringList checkedPlugins();
|
||||
|
@ -29,7 +30,7 @@ public slots:
|
|||
void masterSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
||||
void setCheckstate(QModelIndex index);
|
||||
void resizeRows();
|
||||
void profileChanged(const QString &profile);
|
||||
void profileChanged(const QString ¤t, const QString &previous);
|
||||
|
||||
private:
|
||||
QTableWidget *mMastersWidget;
|
||||
|
|
|
@ -18,8 +18,6 @@ MainDialog::MainDialog()
|
|||
mIconWidget = new QListWidget;
|
||||
mIconWidget->setViewMode(QListView::IconMode);
|
||||
mIconWidget->setWrapping(false);
|
||||
mIconWidget->setObjectName("IconWidget");
|
||||
qDebug() << mIconWidget->objectName();
|
||||
|
||||
mIconWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Just to be sure
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ PlayPage::PlayPage(QWidget *parent) : QWidget(parent)
|
|||
|
||||
file.open(QFile::ReadOnly);
|
||||
QString styleSheet = QLatin1String(file.readAll());
|
||||
qDebug() << styleSheet;
|
||||
setStyleSheet(styleSheet);
|
||||
|
||||
QGroupBox *playBox = new QGroupBox(this);
|
||||
|
|
Loading…
Reference in a new issue