forked from mirror/openmw-tes3mp
Adding WIP code to dynamically change the autocomplete fields
This commit is contained in:
parent
fb27f34a32
commit
d58cce9c72
7 changed files with 34 additions and 0 deletions
|
@ -163,3 +163,8 @@ void Launcher::AdvancedPage::saveSettingBool(QCheckBox *checkbox, const std::str
|
||||||
if (cValue != mEngineSettings.getBool(setting, group))
|
if (cValue != mEngineSettings.getBool(setting, group))
|
||||||
mEngineSettings.setBool(setting, group, cValue);
|
mEngineSettings.setBool(setting, group, cValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Launcher::AdvancedPage::slotSelectedDataFilesChanged(QStringList selectedFiles)
|
||||||
|
{
|
||||||
|
loadCellsForAutocomplete(selectedFiles);
|
||||||
|
}
|
|
@ -29,6 +29,9 @@ namespace Launcher
|
||||||
*/
|
*/
|
||||||
void loadCellsForAutocomplete(QStringList filePaths);
|
void loadCellsForAutocomplete(QStringList filePaths);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void slotSelectedDataFilesChanged(QStringList selectedFiles);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_skipMenuCheckBox_stateChanged(int state);
|
void on_skipMenuCheckBox_stateChanged(int state);
|
||||||
void on_runScriptAfterStartupBrowseButton_clicked();
|
void on_runScriptAfterStartupBrowseButton_clicked();
|
||||||
|
|
|
@ -37,6 +37,8 @@ Launcher::DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, Config:
|
||||||
|
|
||||||
connect(mProfileDialog->lineEdit(), SIGNAL(textChanged(QString)),
|
connect(mProfileDialog->lineEdit(), SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(updateOkButton(QString)));
|
this, SLOT(updateOkButton(QString)));
|
||||||
|
connect(mSelector, SIGNAL(signalSelectedFilesChanged(QStringList)),
|
||||||
|
this, SLOT(slotSelectedFilesChanged(QStringList)));
|
||||||
|
|
||||||
buildView();
|
buildView();
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
@ -319,3 +321,8 @@ bool Launcher::DataFilesPage::showDeleteMessageBox (const QString &text)
|
||||||
|
|
||||||
return (msgBox.clickedButton() == deleteButton);
|
return (msgBox.clickedButton() == deleteButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Launcher::DataFilesPage::slotSelectedFilesChanged(QStringList selectedFilesChanged)
|
||||||
|
{
|
||||||
|
emit signalSelectedFilesChanged(selectedFilesChanged);
|
||||||
|
}
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
class QSortFilterProxyModel;
|
class QSortFilterProxyModel;
|
||||||
class QAbstractItemModel;
|
class QAbstractItemModel;
|
||||||
|
@ -49,6 +50,7 @@ namespace Launcher
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void signalProfileChanged (int index);
|
void signalProfileChanged (int index);
|
||||||
|
void signalSelectedFilesChanged(QStringList selectedFiles);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void slotProfileChanged (int index);
|
void slotProfileChanged (int index);
|
||||||
|
@ -58,6 +60,7 @@ namespace Launcher
|
||||||
void slotProfileChangedByUser(const QString &previous, const QString ¤t);
|
void slotProfileChangedByUser(const QString &previous, const QString ¤t);
|
||||||
void slotProfileRenamed(const QString &previous, const QString ¤t);
|
void slotProfileRenamed(const QString &previous, const QString ¤t);
|
||||||
void slotProfileDeleted(const QString &item);
|
void slotProfileDeleted(const QString &item);
|
||||||
|
void slotSelectedFilesChanged (QStringList selectedFiles);
|
||||||
|
|
||||||
void updateOkButton(const QString &text);
|
void updateOkButton(const QString &text);
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,7 @@ void Launcher::MainDialog::createPages()
|
||||||
|
|
||||||
connect(mPlayPage, SIGNAL(signalProfileChanged(int)), mDataFilesPage, SLOT(slotProfileChanged(int)));
|
connect(mPlayPage, SIGNAL(signalProfileChanged(int)), mDataFilesPage, SLOT(slotProfileChanged(int)));
|
||||||
connect(mDataFilesPage, SIGNAL(signalProfileChanged(int)), mPlayPage, SLOT(setProfilesIndex(int)));
|
connect(mDataFilesPage, SIGNAL(signalProfileChanged(int)), mPlayPage, SLOT(setProfilesIndex(int)));
|
||||||
|
connect(mDataFilesPage, SIGNAL(signalSelectedFilesChanged(QStringList)), mAdvancedPage, SLOT(slotSelectedDataFilesChanged(QStringList)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -216,6 +216,8 @@ void ContentSelectorView::ContentSelector::slotShowContextMenu(const QPoint& pos
|
||||||
{
|
{
|
||||||
QPoint globalPos = ui.addonView->viewport()->mapToGlobal(pos);
|
QPoint globalPos = ui.addonView->viewport()->mapToGlobal(pos);
|
||||||
mContextMenu->exec(globalPos);
|
mContextMenu->exec(globalPos);
|
||||||
|
// TODO This is a temporary workaround to demonstrate that the selected files signal can be sent
|
||||||
|
emitSelectedFilesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentSelectorView::ContentSelector::setCheckStateForMultiSelectedItems(bool checked)
|
void ContentSelectorView::ContentSelector::setCheckStateForMultiSelectedItems(bool checked)
|
||||||
|
@ -240,3 +242,14 @@ void ContentSelectorView::ContentSelector::slotCheckMultiSelectedItems()
|
||||||
{
|
{
|
||||||
setCheckStateForMultiSelectedItems(true);
|
setCheckStateForMultiSelectedItems(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ContentSelectorView::ContentSelector::emitSelectedFilesChanged()
|
||||||
|
{
|
||||||
|
//retrieve the files selected for the profile
|
||||||
|
ContentSelectorModel::ContentFileList items = selectedFiles();
|
||||||
|
QStringList filePaths;
|
||||||
|
foreach(const ContentSelectorModel::EsmFile *item, items) {
|
||||||
|
filePaths.append(item->filePath());
|
||||||
|
}
|
||||||
|
emit signalSelectedFilesChanged(filePaths);
|
||||||
|
}
|
|
@ -56,11 +56,13 @@ namespace ContentSelectorView
|
||||||
void buildContextMenu();
|
void buildContextMenu();
|
||||||
void setGameFileSelected(int index, bool selected);
|
void setGameFileSelected(int index, bool selected);
|
||||||
void setCheckStateForMultiSelectedItems(bool checked);
|
void setCheckStateForMultiSelectedItems(bool checked);
|
||||||
|
void emitSelectedFilesChanged();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void signalCurrentGamefileIndexChanged (int);
|
void signalCurrentGamefileIndexChanged (int);
|
||||||
|
|
||||||
void signalAddonDataChanged (const QModelIndex& topleft, const QModelIndex& bottomright);
|
void signalAddonDataChanged (const QModelIndex& topleft, const QModelIndex& bottomright);
|
||||||
|
void signalSelectedFilesChanged(QStringList selectedFiles);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue