mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Qt: add open file location to screenshot preview
Remove duplicate slash from screenshot path
This commit is contained in:
parent
bd49ad358c
commit
f27de28ee9
4 changed files with 5 additions and 4 deletions
|
@ -301,7 +301,7 @@ void gs_frame::take_screenshot(const std::vector<u8> sshot_data, const u32 sshot
|
||||||
std::thread(
|
std::thread(
|
||||||
[sshot_width, sshot_height](const std::vector<u8> sshot_data)
|
[sshot_width, sshot_height](const std::vector<u8> sshot_data)
|
||||||
{
|
{
|
||||||
std::string screen_path = fs::get_config_dir() + "/screenshots/";
|
std::string screen_path = fs::get_config_dir() + "screenshots/";
|
||||||
|
|
||||||
if (!fs::create_dir(screen_path) && fs::g_tls_error != fs::error::exist)
|
if (!fs::create_dir(screen_path) && fs::g_tls_error != fs::error::exist)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@ screenshot_manager_dialog::screenshot_manager_dialog(QWidget* parent) : QDialog(
|
||||||
m_grid->setIconSize(QSize(160, 90));
|
m_grid->setIconSize(QSize(160, 90));
|
||||||
m_grid->setGridSize(m_grid->iconSize() + QSize(10, 10));
|
m_grid->setGridSize(m_grid->iconSize() + QSize(10, 10));
|
||||||
|
|
||||||
const std::string screen_path = fs::get_config_dir() + "/screenshots/";
|
const std::string screen_path = fs::get_config_dir() + "screenshots/";
|
||||||
const QStringList filter{ QStringLiteral("*.png") };
|
const QStringList filter{ QStringLiteral("*.png") };
|
||||||
QDirIterator dir_iter(QString::fromStdString(screen_path), filter, QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
QDirIterator dir_iter(QString::fromStdString(screen_path), filter, QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||||
|
|
||||||
|
|
|
@ -27,13 +27,14 @@ screenshot_preview::screenshot_preview(const QString& filepath, QWidget* parent)
|
||||||
|
|
||||||
connect(this, &screenshot_preview::customContextMenuRequested, this, &screenshot_preview::show_context_menu);
|
connect(this, &screenshot_preview::customContextMenuRequested, this, &screenshot_preview::show_context_menu);
|
||||||
}
|
}
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
void screenshot_preview::show_context_menu(const QPoint & pos)
|
void screenshot_preview::show_context_menu(const QPoint & pos)
|
||||||
{
|
{
|
||||||
QMenu* menu = new QMenu();
|
QMenu* menu = new QMenu();
|
||||||
menu->addAction(tr("&Copy"), [this]() { QGuiApplication::clipboard()->setImage(m_image); });
|
menu->addAction(tr("&Copy"), [this]() { QGuiApplication::clipboard()->setImage(m_image); });
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
menu->addAction(tr("&Open file location"), [this]() { gui::utils::open_dir(m_filepath); });
|
||||||
|
menu->addSeparator();
|
||||||
|
|
||||||
QAction* reset_act = menu->addAction(tr("To &Normal Size"), [this]() { scale(m_image.size()); });
|
QAction* reset_act = menu->addAction(tr("To &Normal Size"), [this]() { scale(m_image.size()); });
|
||||||
reset_act->setEnabled(pixmap()->size() != m_image.size());
|
reset_act->setEnabled(pixmap()->size() != m_image.size());
|
||||||
|
|
|
@ -11,7 +11,7 @@ public:
|
||||||
screenshot_preview(const QString& filepath, QWidget* parent = nullptr);
|
screenshot_preview(const QString& filepath, QWidget* parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent* event);
|
void resizeEvent(QResizeEvent* event) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void show_context_menu(const QPoint& pos);
|
void show_context_menu(const QPoint& pos);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue