Adding WIP code to dynamically change the autocomplete fields

pull/456/head
Thunderforge 7 years ago
parent fb27f34a32
commit d58cce9c72

@ -163,3 +163,8 @@ void Launcher::AdvancedPage::saveSettingBool(QCheckBox *checkbox, const std::str
if (cValue != mEngineSettings.getBool(setting, group))
mEngineSettings.setBool(setting, group, cValue);
}
void Launcher::AdvancedPage::slotSelectedDataFilesChanged(QStringList selectedFiles)
{
loadCellsForAutocomplete(selectedFiles);
}

@ -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();

@ -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);
}

@ -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 &current);
void slotProfileRenamed(const QString &previous, const QString &current);
void slotProfileDeleted(const QString &item);
void slotSelectedFilesChanged (QStringList selectedFiles);
void updateOkButton(const QString &text);

@ -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)));
}

@ -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);
}

@ -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:

Loading…
Cancel
Save