Mercurial > octave
view libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h @ 23404:314ac710f2ae
highlight error messages in gui and provide links to open files (bug #35619)
* QTerminal.cc (handleCustomContextMenuReques): use method via selecting the
message only in windows
* Filter.cpp (Filter::HotSpot::type(), Filter::HotSpot::setType): make Type
a type in Filter, not in HotSpot;
(RegExpFilter::RegExpFilter) create a filter with the corresponding type
instead of different filters for different types;
(RegExpFilter::HotSpot::HotSpot): A found hot spot is created with the types
of the filter that found that hot spot;
(RegExpFilter::process): remove some old debug message, which were already
commented out, call newHotSpot with type as new parameter;
(RegExpFilter::newHotSpot, UrlFilter::newHotSpot): new parameter type;
(UrlFilter::process): derive this method for UrlFilter, too, allowing
to connect signals for opening files later on;
(UrlFilter::HotSpot::HotSpot): no extra action here, get type from filter;
(UrlFilter::HotSpot::urlType): add new url type;
(UrlFilter::HotSpot::activate): depending on link type, open link as before
or call method for opening the file mentioned in the link;
(UrlFilter::ErrorLinkRegExp): const defined reg. expression for error link;
(UrlFilter::UrlFilter): set reg. expression depending on type;
(UrlFilter::HotSpot::actions): in a case of a file link, only prepare
an open, but no copy action for the context menu;
(UrlFilter::request_open_file): method emitting the signal to the main window
for opening the desired file at desired line;
* Filter.h: make Filter class inherit from QObject for using singals, move
enum Type from HotSpot to Filter and add the types Error and ErrorLink,
Filter and Filter::HotSpot ctors with type parameter, add file opening
signal to RegExpFilter and FilterObject, add Q_OBJECT directives, add
method to FilterObject returning the instance variable _urlObject, add
new urlType ErrorLink, add own process method and open file slot to
UrlFilter, FilterObject: open file slot only emitting open file singal
* QUnixTerminalImpl.cpp (ctor): initialize instance variable _parent;
(initialize): add new filters for errors and for links to related files,
connect latters signal to the appropriate main windows slot;
* QUnixTerminalImpl.h: add instance variable _parent for signal connections
* TerminalView.cpp (paintFilters): underline Link and ErrorLink, draw
rectangle with transparency for Error and LinkError;
(mousePressEvent, mouseMoveEvent): treat Link and ErrorLink the same way
author | Torsten <mttl@mailbox.org> |
---|---|
date | Mon, 17 Apr 2017 21:28:55 +0200 |
parents | fee531225679 |
children | 980f39c3ab90 |
line wrap: on
line source
/* Copyright (C) 2008 e_k (e_k@users.sourceforge.net) Copyright (C) 2012-2016 Jacob Dawid <jacob.dawid@cybercatalyst.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef Q_UNIXTERMINALIMPL #define Q_UNIXTERMINALIMPL #include <QtGui> #include "unix/kpty.h" #include "unix/TerminalModel.h" #include "unix/TerminalView.h" #include "QTerminal.h" class QUnixTerminalImpl : public QTerminal { Q_OBJECT int fdstderr; public: QUnixTerminalImpl(QWidget *parent = 0); virtual ~QUnixTerminalImpl(); void setTerminalFont(const QFont &font); void setSize(int h, int v); void sendText(const QString& text); void setCursorType(CursorType type, bool blinking); void setBackgroundColor (const QColor& color); void setForegroundColor (const QColor& color); void setSelectionColor (const QColor& color); void setCursorColor (bool useForegroundColor, const QColor& color); void setScrollBufferSize(int value); QString selectedText(); void has_extra_interrupt (bool extra_interrupt); QList<QAction*> get_hotspot_actions (const QPoint& at); public slots: void copyClipboard(); void pasteClipboard(); void selectAll(); protected: void showEvent(QShowEvent *); virtual void resizeEvent(QResizeEvent *); private: void initialize(); void connectToPty(); TerminalView *m_terminalView; TerminalModel *m_terminalModel; KPty *m_kpty; bool _extra_interrupt; QWidget *_parent; }; #endif // Q_UNIXTERMINALIMPL