mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 11:09:42 +00:00
Merge branch 'data_files_refresh' into 'master'
Implement a refresh button on data files page See merge request OpenMW/openmw!166
This commit is contained in:
commit
ed06fc2aa8
7 changed files with 97 additions and 5 deletions
|
@ -88,6 +88,7 @@ Programmers
|
||||||
Jacob Essex (Yacoby)
|
Jacob Essex (Yacoby)
|
||||||
Jake Westrip (16bitint)
|
Jake Westrip (16bitint)
|
||||||
James Carty (MrTopCat)
|
James Carty (MrTopCat)
|
||||||
|
James Moore (moore.work)
|
||||||
James Stephens (james-h-stephens)
|
James Stephens (james-h-stephens)
|
||||||
Jan-Peter Nilsson (peppe)
|
Jan-Peter Nilsson (peppe)
|
||||||
Jan Borsodi (am0s)
|
Jan Borsodi (am0s)
|
||||||
|
|
|
@ -252,6 +252,7 @@
|
||||||
Feature #5091: Human-readable light source duration
|
Feature #5091: Human-readable light source duration
|
||||||
Feature #5094: Unix like console hotkeys
|
Feature #5094: Unix like console hotkeys
|
||||||
Feature #5098: Allow user controller bindings
|
Feature #5098: Allow user controller bindings
|
||||||
|
Feature #5114: Refresh launcher mod list
|
||||||
Feature #5121: Handle NiTriStrips and NiTriStripsData
|
Feature #5121: Handle NiTriStrips and NiTriStripsData
|
||||||
Feature #5122: Use magic glow for enchanted arrows
|
Feature #5122: Use magic glow for enchanted arrows
|
||||||
Feature #5131: Custom skeleton bones
|
Feature #5131: Custom skeleton bones
|
||||||
|
|
|
@ -62,10 +62,13 @@ void Launcher::DataFilesPage::buildView()
|
||||||
{
|
{
|
||||||
ui.verticalLayout->insertWidget (0, mSelector->uiWidget());
|
ui.verticalLayout->insertWidget (0, mSelector->uiWidget());
|
||||||
|
|
||||||
|
QToolButton * refreshButton = mSelector->refreshButton();
|
||||||
|
|
||||||
//tool buttons
|
//tool buttons
|
||||||
ui.newProfileButton->setToolTip ("Create a new Content List");
|
ui.newProfileButton->setToolTip ("Create a new Content List");
|
||||||
ui.cloneProfileButton->setToolTip ("Clone the current Content List");
|
ui.cloneProfileButton->setToolTip ("Clone the current Content List");
|
||||||
ui.deleteProfileButton->setToolTip ("Delete an existing Content List");
|
ui.deleteProfileButton->setToolTip ("Delete an existing Content List");
|
||||||
|
refreshButton->setToolTip("Refresh Data Files");
|
||||||
|
|
||||||
//combo box
|
//combo box
|
||||||
ui.profilesComboBox->addItem(mDefaultContentListName);
|
ui.profilesComboBox->addItem(mDefaultContentListName);
|
||||||
|
@ -76,6 +79,7 @@ void Launcher::DataFilesPage::buildView()
|
||||||
ui.newProfileButton->setDefaultAction (ui.newProfileAction);
|
ui.newProfileButton->setDefaultAction (ui.newProfileAction);
|
||||||
ui.cloneProfileButton->setDefaultAction (ui.cloneProfileAction);
|
ui.cloneProfileButton->setDefaultAction (ui.cloneProfileAction);
|
||||||
ui.deleteProfileButton->setDefaultAction (ui.deleteProfileAction);
|
ui.deleteProfileButton->setDefaultAction (ui.deleteProfileAction);
|
||||||
|
refreshButton->setDefaultAction(ui.refreshDataFilesAction);
|
||||||
|
|
||||||
//establish connections
|
//establish connections
|
||||||
connect (ui.profilesComboBox, SIGNAL (currentIndexChanged(int)),
|
connect (ui.profilesComboBox, SIGNAL (currentIndexChanged(int)),
|
||||||
|
@ -86,6 +90,8 @@ void Launcher::DataFilesPage::buildView()
|
||||||
|
|
||||||
connect (ui.profilesComboBox, SIGNAL (signalProfileChanged(QString, QString)),
|
connect (ui.profilesComboBox, SIGNAL (signalProfileChanged(QString, QString)),
|
||||||
this, SLOT (slotProfileChangedByUser(QString, QString)));
|
this, SLOT (slotProfileChangedByUser(QString, QString)));
|
||||||
|
|
||||||
|
connect(ui.refreshDataFilesAction, SIGNAL(triggered()),this, SLOT(slotRefreshButtonClicked()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Launcher::DataFilesPage::loadSettings()
|
bool Launcher::DataFilesPage::loadSettings()
|
||||||
|
@ -114,6 +120,8 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
||||||
if (!mDataLocal.isEmpty())
|
if (!mDataLocal.isEmpty())
|
||||||
paths.insert(0, mDataLocal);
|
paths.insert(0, mDataLocal);
|
||||||
|
|
||||||
|
mSelector->clearFiles();
|
||||||
|
|
||||||
for (const QString &path : paths)
|
for (const QString &path : paths)
|
||||||
mSelector->addFiles(path);
|
mSelector->addFiles(path);
|
||||||
|
|
||||||
|
@ -166,9 +174,18 @@ QStringList Launcher::DataFilesPage::selectedFilePaths()
|
||||||
ContentSelectorModel::ContentFileList items = mSelector->selectedFiles();
|
ContentSelectorModel::ContentFileList items = mSelector->selectedFiles();
|
||||||
QStringList filePaths;
|
QStringList filePaths;
|
||||||
for (const ContentSelectorModel::EsmFile *item : items)
|
for (const ContentSelectorModel::EsmFile *item : items)
|
||||||
|
{
|
||||||
|
QFile file(item->filePath());
|
||||||
|
|
||||||
|
if(file.exists())
|
||||||
{
|
{
|
||||||
filePaths.append(item->filePath());
|
filePaths.append(item->filePath());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
slotRefreshButtonClicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
return filePaths;
|
return filePaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,6 +238,18 @@ void Launcher::DataFilesPage::slotProfileDeleted (const QString &item)
|
||||||
removeProfile (item);
|
removeProfile (item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Launcher::DataFilesPage:: refreshDataFilesView ()
|
||||||
|
{
|
||||||
|
QString currentProfile = ui.profilesComboBox->currentText();
|
||||||
|
saveSettings(currentProfile);
|
||||||
|
populateFileViews(currentProfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Launcher::DataFilesPage::slotRefreshButtonClicked ()
|
||||||
|
{
|
||||||
|
refreshDataFilesView();
|
||||||
|
}
|
||||||
|
|
||||||
void Launcher::DataFilesPage::slotProfileChangedByUser(const QString &previous, const QString ¤t)
|
void Launcher::DataFilesPage::slotProfileChangedByUser(const QString &previous, const QString ¤t)
|
||||||
{
|
{
|
||||||
setProfile(previous, current, true);
|
setProfile(previous, current, true);
|
||||||
|
|
|
@ -61,6 +61,7 @@ namespace Launcher
|
||||||
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 slotAddonDataChanged ();
|
void slotAddonDataChanged ();
|
||||||
|
void slotRefreshButtonClicked ();
|
||||||
|
|
||||||
void updateNewProfileOkButton(const QString &text);
|
void updateNewProfileOkButton(const QString &text);
|
||||||
void updateCloneProfileOkButton(const QString &text);
|
void updateCloneProfileOkButton(const QString &text);
|
||||||
|
@ -100,6 +101,7 @@ namespace Launcher
|
||||||
void checkForDefaultProfile();
|
void checkForDefaultProfile();
|
||||||
void populateFileViews(const QString& contentModelName);
|
void populateFileViews(const QString& contentModelName);
|
||||||
void reloadCells(QStringList selectedFiles);
|
void reloadCells(QStringList selectedFiles);
|
||||||
|
void refreshDataFilesView ();
|
||||||
|
|
||||||
class PathIterator
|
class PathIterator
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,6 +45,9 @@ namespace ContentSelectorView
|
||||||
QWidget *uiWidget() const
|
QWidget *uiWidget() const
|
||||||
{ return ui.contentGroupBox; }
|
{ return ui.contentGroupBox; }
|
||||||
|
|
||||||
|
QToolButton *refreshButton() const
|
||||||
|
{ return ui.refreshButton; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,16 @@
|
||||||
<enum>Qt::DefaultContextMenu</enum>
|
<enum>Qt::DefaultContextMenu</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@ -32,6 +41,24 @@
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="gameSelectorGroup" native="true">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="ContentSelectorView::ComboBox" name="gameFileView">
|
<widget class="ContentSelectorView::ComboBox" name="gameFileView">
|
||||||
<property name="editable">
|
<property name="editable">
|
||||||
|
@ -39,6 +66,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="refreshButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableView" name="addonView">
|
<widget class="QTableView" name="addonView">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
|
|
@ -159,6 +159,22 @@
|
||||||
<string>Uncheck Selection</string>
|
<string>Uncheck Selection</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="refreshDataFilesAction">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="view-refresh">
|
||||||
|
<normaloff/>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Refresh Data Files</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Refresh Data Files</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+R</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
Loading…
Reference in a new issue