mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 10:00:40 +00:00
Restore removed LastCaptureExe saving last exe selected. Closes #1318
This commit is contained in:
@@ -274,6 +274,8 @@ DECLARE_REFLECTION_STRUCT(BugReport);
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, QString, rdcstr, LastCapturePath, "") \
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, QString, rdcstr, LastCaptureExe, "") \
|
||||
\
|
||||
CONFIG_SETTING(public, QVariantList, rdcarray<rdcstr>, RecentCaptureSettings) \
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, QString, rdcstr, TemporaryCaptureDirectory, "") \
|
||||
@@ -459,6 +461,10 @@ For more information about some of these settings that are user-facing see
|
||||
The path containing the last executable that was captured, which is useful as a default location
|
||||
for browsing.
|
||||
|
||||
.. data:: LastCaptureExe
|
||||
|
||||
The filename of the last executable that was captured, inside :data:`LastCapturePath`.
|
||||
|
||||
.. data:: RecentCaptureSettings
|
||||
|
||||
A ``list`` of ``str`` with the recently opened capture settings files.
|
||||
|
||||
@@ -1153,7 +1153,7 @@ QString RDDialog::getOpenFileName(QWidget *parent, const QString &caption, const
|
||||
}
|
||||
|
||||
QString RDDialog::getExecutableFileName(QWidget *parent, const QString &caption, const QString &dir,
|
||||
QFileDialog::Options options)
|
||||
const QString &defaultExe, QFileDialog::Options options)
|
||||
{
|
||||
QString d = dir;
|
||||
if(d.isEmpty())
|
||||
@@ -1175,6 +1175,8 @@ QString RDDialog::getExecutableFileName(QWidget *parent, const QString &caption,
|
||||
fileProxy->setRequirePermissions(QDir::Executable);
|
||||
fd.setProxyModel(fileProxy);
|
||||
}
|
||||
if(!defaultExe.isEmpty())
|
||||
fd.selectFile(defaultExe);
|
||||
show(&fd);
|
||||
|
||||
if(fd.result() == QFileDialog::Accepted)
|
||||
|
||||
@@ -564,6 +564,7 @@ struct RDDialog
|
||||
|
||||
static QString getExecutableFileName(QWidget *parent = NULL, const QString &caption = QString(),
|
||||
const QString &dir = QString(),
|
||||
const QString &defaultExe = QString(),
|
||||
QFileDialog::Options options = QFileDialog::Options());
|
||||
|
||||
static QString getSaveFileName(QWidget *parent = NULL, const QString &caption = QString(),
|
||||
|
||||
@@ -633,12 +633,14 @@ bool CaptureDialog::checkAllowClose()
|
||||
void CaptureDialog::on_exePathBrowse_clicked()
|
||||
{
|
||||
QString initDir;
|
||||
QString initExe;
|
||||
|
||||
QFileInfo f(ui->exePath->text());
|
||||
QDir dir = f.dir();
|
||||
if(f.isAbsolute() && dir.exists())
|
||||
{
|
||||
initDir = dir.absolutePath();
|
||||
initExe = f.fileName();
|
||||
}
|
||||
else if(m_Ctx.Replay().CurrentRemote())
|
||||
{
|
||||
@@ -647,6 +649,8 @@ void CaptureDialog::on_exePathBrowse_clicked()
|
||||
else if(!m_Ctx.Config().LastCapturePath.isEmpty())
|
||||
{
|
||||
initDir = m_Ctx.Config().LastCapturePath;
|
||||
if(!m_Ctx.Config().LastCaptureExe.isEmpty())
|
||||
initExe = m_Ctx.Config().LastCaptureExe;
|
||||
}
|
||||
|
||||
QString filename;
|
||||
@@ -659,7 +663,7 @@ void CaptureDialog::on_exePathBrowse_clicked()
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = RDDialog::getExecutableFileName(this, tr("Choose executable"), initDir);
|
||||
filename = RDDialog::getExecutableFileName(this, tr("Choose executable"), initDir, initExe);
|
||||
}
|
||||
|
||||
if(!filename.isEmpty())
|
||||
@@ -1038,6 +1042,7 @@ void CaptureDialog::SetExecutableFilename(const rdcstr &filename)
|
||||
else
|
||||
{
|
||||
m_Ctx.Config().LastCapturePath = QFileInfo(fn).absolutePath();
|
||||
m_Ctx.Config().LastCaptureExe = QFileInfo(fn).fileName();
|
||||
}
|
||||
|
||||
m_Ctx.Config().Save();
|
||||
|
||||
Reference in New Issue
Block a user