mirror of https://github.com/RPCS3/rpcs3.git
Qt: add open file location to screenshot preview
Remove duplicate slash from screenshot path
This commit is contained in:
parent
bd49ad358c
commit
f27de28ee9
|
@ -301,7 +301,7 @@ void gs_frame::take_screenshot(const std::vector<u8> sshot_data, const u32 sshot
|
|||
std::thread(
|
||||
[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)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ screenshot_manager_dialog::screenshot_manager_dialog(QWidget* parent) : QDialog(
|
|||
m_grid->setIconSize(QSize(160, 90));
|
||||
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") };
|
||||
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);
|
||||
}
|
||||
#include <QDebug>
|
||||
|
||||
void screenshot_preview::show_context_menu(const QPoint & pos)
|
||||
{
|
||||
QMenu* menu = new QMenu();
|
||||
menu->addAction(tr("&Copy"), [this]() { QGuiApplication::clipboard()->setImage(m_image); });
|
||||
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()); });
|
||||
reset_act->setEnabled(pixmap()->size() != m_image.size());
|
||||
|
|
|
@ -11,7 +11,7 @@ public:
|
|||
screenshot_preview(const QString& filepath, QWidget* parent = nullptr);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void show_context_menu(const QPoint& pos);
|
||||
|
|
Loading…
Reference in New Issue