frontend-tools: Add context menu to Scripts list
This commit is contained in:
parent
3107eda0d2
commit
c39aef03fe
4 changed files with 30 additions and 0 deletions
|
|
@ -16,6 +16,7 @@
|
|||
#include <QResizeEvent>
|
||||
#include <QAction>
|
||||
#include <QMessageBox>
|
||||
#include <QMenu>
|
||||
#include <QUrl>
|
||||
#include <QDesktopServices>
|
||||
|
||||
|
|
@ -389,6 +390,30 @@ void ScriptsTool::on_reloadScripts_clicked()
|
|||
on_scripts_currentRowChanged(ui->scripts->currentRow());
|
||||
}
|
||||
|
||||
void ScriptsTool::on_scripts_customContextMenuRequested(const QPoint &pos)
|
||||
{
|
||||
|
||||
QListWidgetItem *item = ui->scripts->itemAt(pos);
|
||||
|
||||
QMenu popup(this);
|
||||
|
||||
obs_frontend_push_ui_translation(obs_module_get_string);
|
||||
|
||||
popup.addAction(tr("Add"), this, SLOT(on_addScripts_clicked()));
|
||||
|
||||
if (item) {
|
||||
popup.addSeparator();
|
||||
popup.addAction(obs_module_text("Reload"), this,
|
||||
SLOT(on_reloadScripts_clicked()));
|
||||
popup.addSeparator();
|
||||
popup.addAction(tr("Remove"), this,
|
||||
SLOT(on_removeScripts_clicked()));
|
||||
}
|
||||
obs_frontend_pop_ui_translation();
|
||||
|
||||
popup.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void ScriptsTool::on_scriptLog_clicked()
|
||||
{
|
||||
scriptLogWindow->show();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue