Commit fb35320c authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark Committed by Tomaz Canabrava
Browse files

add action to disable/enable mouse tracking

parent 3d641325
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui name="konsolepart" version="13" translationDomain="konsole">
<gui name="konsolepart" version="14" translationDomain="konsole">
<Menu name="session-popup-menu">
<Action name="edit_copy_contextmenu"/>
<Action name="edit_paste"/>
......@@ -21,6 +21,8 @@
</Menu>
<Separator/>
<Action name="view-readonly" />
<Action name="allow-mouse-tracking" />
<Separator/>
<Action name="switch-profile"/>
<Action name="edit-current-profile"/>
<Action name="manage-profiles"/>
......
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui name="session" version="29">
<gui name="session" version="30">
<MenuBar>
<Menu name="file">
<Action name="file_save_as" group="session-operations"/>
......@@ -32,6 +32,7 @@
<Action name="monitor-process-finish" group="session-view-operations"/>
<Separator group="session-view-operations"/>
<Action name="view-readonly" group="session-view-operations"/>
<Action name="allow-mouse-tracking" group="session-view-operations"/>
<Separator group="session-view-operations"/>
<Action name="enlarge-font" group="session-view-operations"/>
<Action name="reset-font-size" group="session-view-operations"/>
......@@ -57,6 +58,8 @@
<Action name="adjust-history"/>
<Separator/>
<Action name="view-readonly" />
<Action name="allow-mouse-tracking" />
<Separator/>
<Action name="switch-profile"/>
<Action name="edit-current-profile"/>
</Menu>
......
......@@ -560,6 +560,19 @@ void SessionController::toggleReadOnly()
}
}
void SessionController::toggleAllowMouseTracking()
{
QAction *action = qobject_cast<QAction*>(sender());
if (action == nullptr) {
// Crash if running in debug build (aka. someone developing)
Q_ASSERT(false && "Invalid function called toggleAllowMouseTracking");
return;
}
_view->setAllowMouseTracking(action->isChecked());
}
void SessionController::removeSearchFilter()
{
if (_searchFilter == nullptr) {
......@@ -730,6 +743,12 @@ void SessionController::setupCommonActions()
#endif
&Konsole::SessionController::changeCodec);
// Mouse tracking enabled
action = collection->addAction(QStringLiteral("allow-mouse-tracking"), this, &SessionController::toggleAllowMouseTracking);
action->setText(i18nc("@item:inmenu Allows terminal applications to request mouse tracking", "Allow mouse tracking"));
action->setCheckable(true);
action->setChecked(true); // the default state
// Read-only
action = collection->addAction(QStringLiteral("view-readonly"), this, &SessionController::toggleReadOnly);
action->setText(i18nc("@item:inmenu A read only (locked) session", "Read-only"));
......
......@@ -257,6 +257,7 @@ private Q_SLOTS:
void sendForegroundColor(uint terminator);
void sendBackgroundColor(uint terminator);
void toggleReadOnly();
void toggleAllowMouseTracking();
// other
void setupSearchBar();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment