1#include "FrmTermWidget.h"
5#include <QDesktopServices>
6#include <QLoggingCategory>
8Q_DECLARE_LOGGING_CATEGORY(Terminal)
10CFrmTermWidget::CFrmTermWidget(QWidget *parent) : QTermWidget(0, parent)
12 setContextMenuPolicy(Qt::CustomContextMenu);
13 bool check = connect(
this, SIGNAL(customContextMenuRequested(
const QPoint &)),
14 this, SLOT(slotCustomContextMenuCall(
const QPoint &)));
17 check = connect(
this, SIGNAL(urlActivated(
const QUrl&,
bool)),
18 this, SLOT(slotActivateUrl(
const QUrl&,
bool)));
22CFrmTermWidget::~CFrmTermWidget()
24 qDebug(Terminal) <<
"CFrmTermWidget::~CFrmTermWidget()";
27void CFrmTermWidget::slotCustomContextMenuCall(
const QPoint & pos)
31 menu.addAction(tr(
"Copy selection to clipboard"),
this, SLOT(copyClipboard()));
32 menu.addAction(tr(
"Paste clipboard"),
this, SLOT(pasteClipboard()));
33 menu.addAction(tr(
"Paste selection"),
this, SLOT(pasteSelection()));
35 menu.addAction(tr(
"Zoom in"),
this, SLOT(zoomIn()));
36 menu.addAction(tr(
"Zoom out"),
this, SLOT(zoomOut()));
37 menu.addAction(tr(
"Zoom reset"),
this, SIGNAL(sigZoomReset()));
39 menu.addAction(tr(
"Clear"),
this, SLOT(clear()));
41 menu.exec(mapToGlobal(pos));
44void CFrmTermWidget::slotActivateUrl(
const QUrl& url,
bool fromContextMenu)
46 if (QApplication::keyboardModifiers() & Qt::ControlModifier || fromContextMenu) {
47 QDesktopServices::openUrl(url);