NOISSUE add button for opening the config folder from mods pages

This commit is contained in:
Petr Mrázek 2016-11-26 14:59:27 +01:00
parent dccf9d7219
commit ce70407363
5 changed files with 22 additions and 1 deletions

View File

@ -185,6 +185,11 @@ void ModFolderPage::on_rmModBtn_clicked()
m_mods->deleteMods(selection.indexes());
}
void ModFolderPage::on_configFolderBtn_clicked()
{
DesktopServices::openDirectory(m_inst->instanceConfigFolder(), true);
}
void ModFolderPage::on_viewModBtn_clicked()
{
DesktopServices::openDirectory(m_mods->dir().absolutePath(), true);

View File

@ -69,7 +69,7 @@ protected:
protected:
BaseInstance *m_inst;
private:
protected:
Ui::ModFolderPage *ui;
std::shared_ptr<ModList> m_mods;
QSortFilterProxyModel *m_filterModel;
@ -92,6 +92,7 @@ slots:
void on_viewModBtn_clicked();
void on_enableModBtn_clicked();
void on_disableModBtn_clicked();
void on_configFolderBtn_clicked();
};
class CoreModFolderPage : public ModFolderPage

View File

@ -69,6 +69,16 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="configFolderBtn">
<property name="toolTip">
<string>Open the 'config' folder in the system file manager.</string>
</property>
<property name="text">
<string>View configs</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@ -162,6 +172,7 @@
<tabstop>rmModBtn</tabstop>
<tabstop>enableModBtn</tabstop>
<tabstop>disableModBtn</tabstop>
<tabstop>configFolderBtn</tabstop>
<tabstop>viewModBtn</tabstop>
</tabstops>
<resources/>

View File

@ -1,5 +1,6 @@
#pragma once
#include "ModFolderPage.h"
#include "ui_ModFolderPage.h"
class ResourcePackPage : public ModFolderPage
{
@ -8,6 +9,7 @@ public:
: ModFolderPage(instance, instance->resourcePackList(), "resourcepacks",
"resourcepacks", tr("Resource packs"), "Resource-packs", parent)
{
ui->configFolderBtn->setHidden(true);
}
virtual ~ResourcePackPage() {}

View File

@ -1,5 +1,6 @@
#pragma once
#include "ModFolderPage.h"
#include "ui_ModFolderPage.h"
class TexturePackPage : public ModFolderPage
{
@ -8,6 +9,7 @@ public:
: ModFolderPage(instance, instance->texturePackList(), "texturepacks", "resourcepacks",
tr("Texture packs"), "Texture-packs", parent)
{
ui->configFolderBtn->setHidden(true);
}
virtual ~TexturePackPage() {}
virtual bool shouldDisplay() const override