summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAl <gabriel.cortesi@outlook.com>2018-02-28 21:00:11 +0100
committerGitHub <noreply@github.com>2018-02-28 21:00:11 +0100
commit5fcd51aad81c9c4495a19306d13c4f55bd2519f8 (patch)
tree2f98d93dde78db5c01dda7d8973fab93471920f5 /src
parent4a45e1a2a7aad41ba45a2652092bd46894a40f23 (diff)
parentc1421d07345617e7776dd8bdf0aec4dbef52a72a (diff)
Merge pull request #247 from Al12rs/new_vfs_library
- Added "Open Folders" drop-down menu over modlist.
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp52
-rw-r--r--src/mainwindow.h3
-rw-r--r--src/mainwindow.ui31
-rw-r--r--src/resources.qrc3
-rw-r--r--src/resources/open-Folder-Icon.pngbin0 -> 17646 bytes
5 files changed, 68 insertions, 21 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index abac9317..fe93b546 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -301,6 +301,8 @@ MainWindow::MainWindow(QSettings &initSettings
ui->listOptionsBtn->setMenu(modListContextMenu());
+ ui->openFolderMenu->setMenu(openFolderMenu());
+
updateDownloadListDelegate();
ui->savegameList->installEventFilter(this);
@@ -3033,6 +3035,11 @@ void MainWindow::openInstanceFolder()
::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.settings().getBaseDirectory()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
}
+void MainWindow::openInstallFolder()
+{
+ ::ShellExecuteW(nullptr, L"explore", ToWString(qApp->applicationDirPath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+}
+
void MainWindow::openProfileFolder()
{
::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.currentProfile()->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
@@ -3219,6 +3226,30 @@ static void addMenuAsPushButton(QMenu *menu, QMenu *subMenu)
menu->addAction(action);
}
+QMenu *MainWindow::openFolderMenu()
+{
+
+ QMenu *FolderMenu = new QMenu(this);
+
+
+ FolderMenu->addAction(tr("Open Instance folder"), this, SLOT(openInstanceFolder()));
+
+ FolderMenu->addAction(tr("Open Profile folder"), this, SLOT(openProfileFolder()));
+
+ FolderMenu->addAction(tr("Open Downloads folder"), this, SLOT(openDownloadsFolder()));
+
+ FolderMenu->addAction(tr("Open MO Install folder"), this, SLOT(openInstallFolder()));
+
+ FolderMenu->addSeparator();
+
+ FolderMenu->addAction(tr("Open Game folder"), this, SLOT(openGameFolder()));
+
+ FolderMenu->addAction(tr("Open MyGames folder"), this, SLOT(openMyGamesFolder()));
+
+
+ return FolderMenu;
+}
+
QMenu *MainWindow::modListContextMenu()
{
QMenu *menu = new QMenu(this);
@@ -3237,24 +3268,6 @@ QMenu *MainWindow::modListContextMenu()
menu->addAction(tr("Export to csv..."), this, SLOT(exportModListCSV()));
- menu->addSeparator();
-
- QMenu *openSubMenu = new QMenu(this);
-
-
- openSubMenu->addAction(tr("Open Instance folder"), this, SLOT(openInstanceFolder()));
-
- openSubMenu->addAction(tr("Open Profile folder"), this, SLOT(openProfileFolder()));
-
- openSubMenu->addAction(tr("Open Downloads folder"), this, SLOT(openDownloadsFolder()));
-
- openSubMenu->addAction(tr("Open Game folder"), this, SLOT(openGameFolder()));
-
- openSubMenu->addAction(tr("Open MyGames folder"), this, SLOT(openMyGamesFolder()));
-
- openSubMenu->setTitle(tr("Open Folder..."));
-
- menu->addMenu(openSubMenu);
return menu;
}
@@ -3698,6 +3711,9 @@ void MainWindow::languageChange(const QString &newLanguage)
updateProblemsButton();
ui->listOptionsBtn->setMenu(modListContextMenu());
+
+ ui->openFolderMenu->setMenu(openFolderMenu());
+
}
void MainWindow::writeDataToFile(QFile &file, const QString &directory, const DirectoryEntry &directoryEntry)
diff --git a/src/mainwindow.h b/src/mainwindow.h
index b7eca72e..2c2e2723 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -277,6 +277,8 @@ private:
QMenu *modListContextMenu();
+ QMenu *openFolderMenu();
+
std::set<QString> enabledArchives();
void scheduleUpdateButton();
@@ -485,6 +487,7 @@ private slots:
void disableVisibleMods();
void exportModListCSV();
void openInstanceFolder();
+ void openInstallFolder();
void openDownloadsFolder();
void openProfileFolder();
void openGameFolder();
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index f9e64349..31522c03 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -176,7 +176,7 @@
<number>2</number>
</property>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="0,1,0,0,0,0">
+ <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="0,1,0,0,0,0,0">
<item>
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
@@ -248,9 +248,33 @@ p, li { white-space: pre-wrap; }
<height>16</height>
</size>
</property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="openFolderMenu">
+ <property name="toolTip">
+ <string>Quickly open in Explorer relevant Folders...</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/MO/gui/open_folder</normaloff>:/MO/gui/open_folder</iconset>
+ </property>
</widget>
</item>
<item>
+
+
+
+
+
+
+
+
+
+
<widget class="QPushButton" name="restoreModsButton">
<property name="toolTip">
<string>Restore Backup...</string>
@@ -439,7 +463,7 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,0,1,1,1">
+ <layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,0,1,1,1,0">
<item>
<widget class="QPushButton" name="displayCategoriesBtn">
<property name="maximumSize">
@@ -944,6 +968,9 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
<widget class="QWidget" name="bsaTab">
+
+
+
<attribute name="title">
<string>Archives</string>
</attribute>
diff --git a/src/resources.qrc b/src/resources.qrc
index 9b66a38c..618d3cfc 100644
--- a/src/resources.qrc
+++ b/src/resources.qrc
@@ -70,7 +70,8 @@
<file alias="inactive">resources/status_inactive.png</file>
<file alias="app_icon">resources/mo_icon.png</file>
<file alias="package">resources/package.png</file>
- <file alias="instance_switch">resources/switch-instance-icon.png</file>
+ <file alias="instance_switch">resources/switch-instance-icon.png</file>
+ <file alias="open_folder">resources/open-Folder-Icon.png</file>
</qresource>
<qresource prefix="/MO/gui/content">
<file alias="plugin">resources/contents/jigsaw-piece.png</file>
diff --git a/src/resources/open-Folder-Icon.png b/src/resources/open-Folder-Icon.png
new file mode 100644
index 00000000..345671f7
--- /dev/null
+++ b/src/resources/open-Folder-Icon.png
Binary files differ