summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
45cb64f)
Ctrl-Q is commonly used to close the application, and Ctrl-W usually is
used to close the current tab. According to the Qt::Modifier
documentation this setup should work seamlessly on Mac OS where Meta is
usually used in place of Ctrl.
This fixes bug #899.
session_selector_.setCornerWidget(static_tab_widget_, Qt::TopLeftCorner);
session_selector_.setTabsClosable(true);
session_selector_.setCornerWidget(static_tab_widget_, Qt::TopLeftCorner);
session_selector_.setTabsClosable(true);
+ close_application_shortcut_ = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this, SLOT(close()));
+ close_application_shortcut_->setAutoRepeat(false);
+
+ close_current_tab_shortcut_ = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this, SLOT(on_close_current_tab()));
+
connect(new_session_button_, SIGNAL(clicked(bool)),
this, SLOT(on_new_session_clicked()));
connect(run_stop_button_, SIGNAL(clicked(bool)),
connect(new_session_button_, SIGNAL(clicked(bool)),
this, SLOT(on_new_session_clicked()));
connect(run_stop_button_, SIGNAL(clicked(bool)),
+void MainWindow::on_close_current_tab()
+{
+ int tab = session_selector_.currentIndex();
+
+ on_tab_close_requested(tab);
+}
+
void on_actionAbout_triggered();
void on_actionAbout_triggered();
+ void on_close_current_tab();
+
private:
DeviceManager &device_manager_;
private:
DeviceManager &device_manager_;
QIcon icon_grey_;
QShortcut *run_stop_shortcut_;
QIcon icon_grey_;
QShortcut *run_stop_shortcut_;
+ QShortcut *close_application_shortcut_;
+ QShortcut *close_current_tab_shortcut_;