diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index bd077c12f..383799e2a 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -162,4 +162,9 @@ void Launcher::AdvancedPage::saveSettingBool(QCheckBox *checkbox, const std::str bool cValue = checkbox->checkState(); if (cValue != mEngineSettings.getBool(setting, group)) mEngineSettings.setBool(setting, group, cValue); +} + +void Launcher::AdvancedPage::slotSelectedDataFilesChanged(QStringList selectedFiles) +{ + loadCellsForAutocomplete(selectedFiles); } \ No newline at end of file diff --git a/apps/launcher/advancedpage.hpp b/apps/launcher/advancedpage.hpp index 654214f29..c40ae2da1 100644 --- a/apps/launcher/advancedpage.hpp +++ b/apps/launcher/advancedpage.hpp @@ -29,6 +29,9 @@ namespace Launcher */ void loadCellsForAutocomplete(QStringList filePaths); + public slots: + void slotSelectedDataFilesChanged(QStringList selectedFiles); + private slots: void on_skipMenuCheckBox_stateChanged(int state); void on_runScriptAfterStartupBrowseButton_clicked(); diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 484c8c56b..8d4d2422f 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -37,6 +37,8 @@ Launcher::DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, Config: connect(mProfileDialog->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(updateOkButton(QString))); + connect(mSelector, SIGNAL(signalSelectedFilesChanged(QStringList)), + this, SLOT(slotSelectedFilesChanged(QStringList))); buildView(); loadSettings(); @@ -319,3 +321,8 @@ bool Launcher::DataFilesPage::showDeleteMessageBox (const QString &text) return (msgBox.clickedButton() == deleteButton); } + +void Launcher::DataFilesPage::slotSelectedFilesChanged(QStringList selectedFilesChanged) +{ + emit signalSelectedFilesChanged(selectedFilesChanged); +} \ No newline at end of file diff --git a/apps/launcher/datafilespage.hpp b/apps/launcher/datafilespage.hpp index 9955737d5..fb9f9e04f 100644 --- a/apps/launcher/datafilespage.hpp +++ b/apps/launcher/datafilespage.hpp @@ -7,6 +7,7 @@ #include <QDir> #include <QFile> +#include <QStringList> class QSortFilterProxyModel; class QAbstractItemModel; @@ -49,6 +50,7 @@ namespace Launcher signals: void signalProfileChanged (int index); + void signalSelectedFilesChanged(QStringList selectedFiles); public slots: void slotProfileChanged (int index); @@ -58,6 +60,7 @@ namespace Launcher void slotProfileChangedByUser(const QString &previous, const QString ¤t); void slotProfileRenamed(const QString &previous, const QString ¤t); void slotProfileDeleted(const QString &item); + void slotSelectedFilesChanged (QStringList selectedFiles); void updateOkButton(const QString &text); diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 9967cbddc..f3afb2732 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -142,6 +142,7 @@ void Launcher::MainDialog::createPages() connect(mPlayPage, SIGNAL(signalProfileChanged(int)), mDataFilesPage, SLOT(slotProfileChanged(int))); connect(mDataFilesPage, SIGNAL(signalProfileChanged(int)), mPlayPage, SLOT(setProfilesIndex(int))); + connect(mDataFilesPage, SIGNAL(signalSelectedFilesChanged(QStringList)), mAdvancedPage, SLOT(slotSelectedDataFilesChanged(QStringList))); } diff --git a/components/contentselector/view/contentselector.cpp b/components/contentselector/view/contentselector.cpp index f4da7e6ad..4798d160c 100644 --- a/components/contentselector/view/contentselector.cpp +++ b/components/contentselector/view/contentselector.cpp @@ -216,6 +216,8 @@ void ContentSelectorView::ContentSelector::slotShowContextMenu(const QPoint& pos { QPoint globalPos = ui.addonView->viewport()->mapToGlobal(pos); 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) @@ -240,3 +242,14 @@ void ContentSelectorView::ContentSelector::slotCheckMultiSelectedItems() { 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); +} \ No newline at end of file diff --git a/components/contentselector/view/contentselector.hpp b/components/contentselector/view/contentselector.hpp index 9f775d597..5015306ab 100644 --- a/components/contentselector/view/contentselector.hpp +++ b/components/contentselector/view/contentselector.hpp @@ -56,11 +56,13 @@ namespace ContentSelectorView void buildContextMenu(); void setGameFileSelected(int index, bool selected); void setCheckStateForMultiSelectedItems(bool checked); + void emitSelectedFilesChanged(); signals: void signalCurrentGamefileIndexChanged (int); void signalAddonDataChanged (const QModelIndex& topleft, const QModelIndex& bottomright); + void signalSelectedFilesChanged(QStringList selectedFiles); private slots: