feat: add F5 hotkey to reload instances
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
3beaa58718
commit
d8f6b8e1e8
@ -884,6 +884,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
|
|||||||
view = new InstancesView(ui->centralWidget, APPLICATION->instances().get());
|
view = new InstancesView(ui->centralWidget, APPLICATION->instances().get());
|
||||||
|
|
||||||
connect(view, &InstancesView::showContextMenu, this, &MainWindow::showInstanceContextMenu);
|
connect(view, &InstancesView::showContextMenu, this, &MainWindow::showInstanceContextMenu);
|
||||||
|
connect(view, &InstancesView::refreshInstances, this, &MainWindow::refreshInstances);
|
||||||
connect(filterView, &QLineEdit::textEdited, view, &InstancesView::setFilterQuery);
|
connect(filterView, &QLineEdit::textEdited, view, &InstancesView::setFilterQuery);
|
||||||
|
|
||||||
ui->verticalLayout->addWidget(view);
|
ui->verticalLayout->addWidget(view);
|
||||||
|
@ -181,6 +181,9 @@ bool InstancesView::eventFilter(QObject* obj, QEvent* event)
|
|||||||
case Qt::Key_Enter:
|
case Qt::Key_Enter:
|
||||||
activateInstance(currentView()->selectionModel()->currentIndex());
|
activateInstance(currentView()->selectionModel()->currentIndex());
|
||||||
return true;
|
return true;
|
||||||
|
case Qt::Key_F5:
|
||||||
|
emit refreshInstances();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QObject::eventFilter(obj, event);
|
return QObject::eventFilter(obj, event);
|
||||||
|
@ -59,6 +59,7 @@ class InstancesView : public QStackedWidget {
|
|||||||
void instanceActivated(InstancePtr inst);
|
void instanceActivated(InstancePtr inst);
|
||||||
void currentInstanceChanged(InstancePtr current, InstancePtr previous);
|
void currentInstanceChanged(InstancePtr current, InstancePtr previous);
|
||||||
void showContextMenu(const QPoint pos, InstancePtr inst);
|
void showContextMenu(const QPoint pos, InstancePtr inst);
|
||||||
|
void refreshInstances();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void activateInstance(const QModelIndex& index);
|
void activateInstance(const QModelIndex& index);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user