From f70102c52966db845ba5b11841917122ee88ef9c Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Tue, 9 Aug 2022 15:35:32 +0600 Subject: [PATCH] qt: Add ability to open screenshots folder --- src/qt/qt_mainwindow.cpp | 8 ++++++++ src/qt/qt_mainwindow.hpp | 2 ++ src/qt/qt_mainwindow.ui | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index f05c32ba6..38abfda62 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -74,6 +74,7 @@ extern "C" { #include #include #include +#include #include #include @@ -2122,3 +2123,10 @@ void MainWindow::on_actionShow_non_primary_monitors_triggered() blitDummied = false; } + +void MainWindow::on_actionOpen_screenshots_folder_triggered() +{ + QDir(QString(usr_path) + QString("/screenshots/")).mkpath("."); + QDesktopServices::openUrl(QUrl(QString("file:///") + usr_path + QString("/screenshots/"))); +} + diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index c33decb44..feb50fb94 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -129,6 +129,8 @@ protected: private slots: void on_actionShow_non_primary_monitors_triggered(); + void on_actionOpen_screenshots_folder_triggered(); + private: Ui::MainWindow *ui; std::unique_ptr status; diff --git a/src/qt/qt_mainwindow.ui b/src/qt/qt_mainwindow.ui index 522d2f081..b1e954693 100644 --- a/src/qt/qt_mainwindow.ui +++ b/src/qt/qt_mainwindow.ui @@ -91,6 +91,8 @@ + + @@ -778,6 +780,11 @@ 6 + + + Open screenshots folder... + +