mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-15 18:31:14 +00:00
Implement "Clear History" for Recent menus
This also fixes a couple minor related bugs in the menu.
This commit is contained in:
1 parent
6f21bacd82
commit
b7eb5c6516
2 files changed
+26
-7
No files matched your search
@@ -98,6 +98,11 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
|
||||
QObject::connect(ui->action_Launch_Application_Window, &QAction::triggered, this,
|
||||
&MainWindow::on_action_Launch_Application_triggered);
|
||||
|
||||
QObject::connect(ui->action_Clear_Capture_History, &QAction::triggered, this,
|
||||
&MainWindow::ClearRecentCaptures);
|
||||
QObject::connect(ui->action_Clear_Log_History, &QAction::triggered, this,
|
||||
&MainWindow::ClearRecentFiles);
|
||||
|
||||
contextChooserMenu = new QMenu(this);
|
||||
|
||||
FillRemotesMenu(contextChooserMenu, true);
|
||||
@@ -727,6 +732,12 @@ void MainWindow::SetTitle()
|
||||
SetTitle(m_Ctx.LogFilename());
|
||||
}
|
||||
|
||||
void MainWindow::ClearRecentFiles()
|
||||
{
|
||||
m_Ctx.Config().RecentLogFiles.clear();
|
||||
PopulateRecentFiles();
|
||||
}
|
||||
|
||||
void MainWindow::PopulateRecentFiles()
|
||||
{
|
||||
ui->menu_Recent_Logs->clear();
|
||||
@@ -748,6 +759,12 @@ void MainWindow::PopulateRecentFiles()
|
||||
ui->menu_Recent_Logs->addAction(ui->action_Clear_Log_History);
|
||||
}
|
||||
|
||||
void MainWindow::ClearRecentCaptures()
|
||||
{
|
||||
m_Ctx.Config().RecentCaptureSettings.clear();
|
||||
PopulateRecentCaptures();
|
||||
}
|
||||
|
||||
void MainWindow::PopulateRecentCaptures()
|
||||
{
|
||||
ui->menu_Recent_Capture_Settings->clear();
|
||||
@@ -766,7 +783,7 @@ void MainWindow::PopulateRecentCaptures()
|
||||
}
|
||||
|
||||
ui->menu_Recent_Capture_Settings->addSeparator();
|
||||
ui->menu_Recent_Capture_Settings->addAction(ui->action_Clear_Log_History);
|
||||
ui->menu_Recent_Capture_Settings->addAction(ui->action_Clear_Capture_History);
|
||||
}
|
||||
|
||||
void MainWindow::ShowLiveCapture(LiveCapture *live)
|
||||
@@ -914,9 +931,9 @@ void MainWindow::recentCapture(const QString &filename)
|
||||
|
||||
if(res == QMessageBox::Yes)
|
||||
{
|
||||
m_Ctx.Config().RecentLogFiles.removeOne(filename);
|
||||
m_Ctx.Config().RecentCaptureSettings.removeOne(filename);
|
||||
|
||||
PopulateRecentFiles();
|
||||
PopulateRecentCaptures();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +79,6 @@ public:
|
||||
void OnInjectTrigger(uint32_t PID, const QList<EnvironmentModification> &env, const QString &name,
|
||||
CaptureOptions opts, std::function<void(LiveCapture *)> callback);
|
||||
|
||||
void PopulateRecentFiles();
|
||||
|
||||
void ShowLiveCapture(LiveCapture *live);
|
||||
void LiveCaptureClosed(LiveCapture *live);
|
||||
|
||||
@@ -95,6 +93,9 @@ public:
|
||||
void showTimelineBar() { on_action_Timeline_triggered(); }
|
||||
void showPythonShell() { on_action_Python_Shell_triggered(); }
|
||||
void showPerformanceCounterViewer() { on_action_Counter_Viewer_triggered(); }
|
||||
public slots:
|
||||
void ClearRecentFiles();
|
||||
void PopulateRecentFiles();
|
||||
private slots:
|
||||
// automatic slots
|
||||
void on_action_Exit_triggered();
|
||||
@@ -134,6 +135,9 @@ private slots:
|
||||
void switchContext();
|
||||
void contextChooser_menuShowing();
|
||||
|
||||
void PopulateRecentCaptures();
|
||||
void ClearRecentCaptures();
|
||||
|
||||
private:
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
void changeEvent(QEvent *event) override;
|
||||
@@ -175,8 +179,6 @@ private:
|
||||
void SetTitle(const QString &filename);
|
||||
void SetTitle();
|
||||
|
||||
void PopulateRecentCaptures();
|
||||
|
||||
void recentLog(const QString &filename);
|
||||
void recentCapture(const QString &filename);
|
||||
|
||||
|
||||
Reference in new issue
Block a user