Cherry-picking upstream version 0.9.0.
* Bumped build dependency libqtermwidget5-0-dev to >= 0.9.0~ * Bumped build dependency lxqt-build-tools to >= 0.5.0~ * Removed not needed build dependency qtbase5-private-dev * Refreshed metadata patch
This commit is contained in:
parent
9f9f06d3b8
commit
1a89bbe97a
0
debian/.gitignore → .gitignore
vendored
0
debian/.gitignore → .gitignore
vendored
48
CHANGELOG
48
CHANGELOG
@ -1,7 +1,53 @@
|
|||||||
|
|
||||||
qterminal-0.8.0 / 2017-10-21
|
qterminal-0.9.0 / 2018-05-21
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
* Bump version to 0.9.0
|
||||||
|
* Spanish translation update
|
||||||
|
* Now building out-of-source is mandatory
|
||||||
|
* Fix tab texts, especially for vertical tabs
|
||||||
|
* CMake: Prevent in-source builds
|
||||||
|
* Fixed some lxde mentions
|
||||||
|
* Sort color schemes alphabetically
|
||||||
|
* Support modifying $TERM and use xterm-256color by default
|
||||||
|
* Convert connect to the new syntax - termwidgetholder.cpp
|
||||||
|
* Convert connect to the new syntax - termwidget.cpp
|
||||||
|
* Convert connect to the new syntax - tabwidget.cpp
|
||||||
|
* Convert connect to the new syntax - propertiesdialog.cpp
|
||||||
|
* Convert connect to the new syntax - mainwindow.cpp, part 1
|
||||||
|
* Convert connect to the new syntax - fontdialog.cpp
|
||||||
|
* Convert connect to the new syntax - bookmarkswidget.cpp
|
||||||
|
* Fix tabbar
|
||||||
|
* Close tab on middle clicking
|
||||||
|
* A real shortcut editor
|
||||||
|
* Allow to change tab title color
|
||||||
|
* Make tab closing button configurable
|
||||||
|
* Make active tab text bold to make it more visible
|
||||||
|
* Fix a typo
|
||||||
|
* Fixes an error in the d3fa804 fix of #304
|
||||||
|
* new config: show terminal size on resize
|
||||||
|
* Fixes #304
|
||||||
|
* Fix bracket paste
|
||||||
|
* Fixes tabAt() when tabBar is not at north position
|
||||||
|
* Fix terminal menubar
|
||||||
|
* Drop Qt foreach
|
||||||
|
* Set QTERMWIDGET_MINIMUM_VERSION
|
||||||
|
* Fix a typo in qterminal_drop.desktop
|
||||||
|
* Fix tab icon display in proxy style.
|
||||||
|
* Switch tab eliding to ElideMiddle.
|
||||||
|
* Adjust default tab width to 500 and enable limit by default.
|
||||||
|
* Forward declare TabBar.
|
||||||
|
* Add option for configuring tab width limit.
|
||||||
|
* Add maximum tab width and proper text eliding.
|
||||||
|
* Enable bidi by default
|
||||||
|
* Fix UI
|
||||||
|
* Add RTL support button
|
||||||
|
* Update Catalan translation
|
||||||
|
|
||||||
|
0.8.0 / 2017-10-21
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Release 0.8.0: Update changelog
|
||||||
* Set version to 0.8.0
|
* Set version to 0.8.0
|
||||||
* Update information on distribution package
|
* Update information on distribution package
|
||||||
* Added legacy font setting support
|
* Added legacy font setting support
|
||||||
|
@ -5,8 +5,9 @@ project(qterminal)
|
|||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
# qterminal version
|
# qterminal version
|
||||||
set(STR_VERSION "0.8.0")
|
set(STR_VERSION "0.9.0")
|
||||||
set(LXQTBT_MINIMUM_VERSION "0.4.0")
|
set(LXQTBT_MINIMUM_VERSION "0.5.0")
|
||||||
|
set(QTERMWIDGET_MINIMUM_VERSION "0.9.0")
|
||||||
|
|
||||||
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
|
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
|
||||||
|
|
||||||
@ -23,8 +24,10 @@ elseif(UNIX)
|
|||||||
find_package(Qt5X11Extras REQUIRED)
|
find_package(Qt5X11Extras REQUIRED)
|
||||||
find_package(Qt5DBus)
|
find_package(Qt5DBus)
|
||||||
endif()
|
endif()
|
||||||
find_package(QTermWidget5 REQUIRED)
|
find_package(QTermWidget5 ${QTERMWIDGET_MINIMUM_VERSION} REQUIRED)
|
||||||
find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
|
find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
|
||||||
|
|
||||||
|
include(LXQtPreventInSourceBuilds)
|
||||||
include(LXQtTranslateTs)
|
include(LXQtTranslateTs)
|
||||||
include(LXQtCompilerSettings NO_POLICY_SCOPE)
|
include(LXQtCompilerSettings NO_POLICY_SCOPE)
|
||||||
message(STATUS "Qt version: ${Qt5Core_VERSION}")
|
message(STATUS "Qt version: ${Qt5Core_VERSION}")
|
||||||
@ -42,13 +45,17 @@ elseif(UNIX)
|
|||||||
message(STATUS "X11_X11_LIB: ${X11_X11_LIB}")
|
message(STATUS "X11_X11_LIB: ${X11_X11_LIB}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-DSTR_VERSION=\"${STR_VERSION}\")
|
add_definitions(
|
||||||
|
-DSTR_VERSION=\"${STR_VERSION}\"
|
||||||
|
-DQT_NO_FOREACH
|
||||||
|
)
|
||||||
|
|
||||||
set(EXE_NAME qterminal)
|
set(EXE_NAME qterminal)
|
||||||
|
|
||||||
set(QTERM_SRC
|
set(QTERM_SRC
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
src/mainwindow.cpp
|
src/mainwindow.cpp
|
||||||
|
src/tabbar.cpp
|
||||||
src/tabwidget.cpp
|
src/tabwidget.cpp
|
||||||
src/termwidget.cpp
|
src/termwidget.cpp
|
||||||
src/termwidgetholder.cpp
|
src/termwidgetholder.cpp
|
||||||
@ -63,6 +70,7 @@ set(QTERM_SRC
|
|||||||
set(QTERM_MOC_SRC
|
set(QTERM_MOC_SRC
|
||||||
src/qterminalapp.h
|
src/qterminalapp.h
|
||||||
src/mainwindow.h
|
src/mainwindow.h
|
||||||
|
src/tabbar.h
|
||||||
src/tabwidget.h
|
src/tabwidget.h
|
||||||
src/termwidget.h
|
src/termwidget.h
|
||||||
src/termwidgetholder.h
|
src/termwidgetholder.h
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# Bug reports
|
# Bug reports
|
||||||
|
|
||||||
Please file bugs on the qterminal github tracker:
|
Please file bugs on the qterminal github tracker:
|
||||||
https://github.com/lxde/qterminal/issues
|
https://github.com/lxqt/qterminal/issues
|
||||||
|
|
||||||
Please file qtermwidget-related bugs on the qtermwidget github tracker:
|
Please file qtermwidget-related bugs on the qtermwidget github tracker:
|
||||||
https://github.com/lxde/qtermwidget/issues
|
https://github.com/lxqt/qtermwidget/issues
|
||||||
|
|
||||||
|
|
||||||
# Code contributions
|
# Code contributions
|
||||||
|
10
README.md
10
README.md
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
QTerminal is a lightweight Qt terminal emulator based on [QTermWidget](https://github.com/lxde/qtermwidget).
|
QTerminal is a lightweight Qt terminal emulator based on [QTermWidget](https://github.com/lxqt/qtermwidget).
|
||||||
|
|
||||||
It is maintained by the LXQt project but can be used independently from this desktop environment. The only bonds are [lxqt-build-tools](https://github.com/lxde/lxqt-build-tools) representing a build dependency and the localization files which were outsourced to LXQt repository [lxqt-l10n](https://github.com/lxde/lxqt-l10n).
|
It is maintained by the LXQt project but can be used independently from this desktop environment. The only bonds are [lxqt-build-tools](https://github.com/lxqt/lxqt-build-tools) representing a build dependency and the localization files which were outsourced to LXQt repository [lxqt-l10n](https://github.com/lxqt/lxqt-l10n).
|
||||||
|
|
||||||
This project is licensed under the terms of the [GPLv2](https://www.gnu.org/licenses/gpl-2.0.en.html) or any later version. See the LICENSE file for the full text of the license.
|
This project is licensed under the terms of the [GPLv2](https://www.gnu.org/licenses/gpl-2.0.en.html) or any later version. See the LICENSE file for the full text of the license.
|
||||||
|
|
||||||
@ -12,10 +12,10 @@ This project is licensed under the terms of the [GPLv2](https://www.gnu.org/lice
|
|||||||
|
|
||||||
### Compiling sources
|
### Compiling sources
|
||||||
|
|
||||||
Dependencies are qtx11extras ≥ 5.2 and [QTermWidget](https://github.com/lxde/qtermwidget).
|
Dependencies are qtx11extras ≥ 5.2 and [QTermWidget](https://github.com/lxqt/qtermwidget).
|
||||||
In order to build CMake ≥ 3.0.2 and [lxqt-build-tools](https://github.com/lxde/lxqt-build-tools) are needed as well as optionally Git to pull latest VCS checkouts. The localization files were outsourced to repository [lxqt-l10n](https://github.com/lxde/lxqt-l10n) so the corresponding dependencies are needed, too. Please refer to this repository's `README.md` for further information.
|
In order to build CMake ≥ 3.0.2 and [lxqt-build-tools](https://github.com/lxqt/lxqt-build-tools) are needed as well as optionally Git to pull latest VCS checkouts. The localization files were outsourced to repository [lxqt-l10n](https://github.com/lxqt/lxqt-l10n) so the corresponding dependencies are needed, too. Please refer to this repository's `README.md` for further information.
|
||||||
|
|
||||||
Code configuration is handled by CMake. Building out of source is strongly recommended. CMake variable `CMAKE_INSTALL_PREFIX` will normally have to be set to `/usr`.
|
Code configuration is handled by CMake. Building out of source is required. CMake variable `CMAKE_INSTALL_PREFIX` will normally have to be set to `/usr`.
|
||||||
|
|
||||||
To build run `make`, to install `make install` which accepts variable `DESTDIR` as usual.
|
To build run `make`, to install `make install` which accepts variable `DESTDIR` as usual.
|
||||||
|
|
||||||
|
10
debian/changelog
vendored
10
debian/changelog
vendored
@ -1,3 +1,13 @@
|
|||||||
|
qterminal (0.9.0-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Cherry-picking upstream version 0.9.0.
|
||||||
|
* Bumped build dependency libqtermwidget5-0-dev to >= 0.9.0~
|
||||||
|
* Bumped build dependency lxqt-build-tools to >= 0.5.0~
|
||||||
|
* Removed not needed build dependency qtbase5-private-dev
|
||||||
|
* Refreshed metadata patch
|
||||||
|
|
||||||
|
-- Alf Gaida <agaida@siduction.org> Thu, 24 May 2018 01:56:48 +0200
|
||||||
|
|
||||||
qterminal (0.8.0-5) unstable; urgency=medium
|
qterminal (0.8.0-5) unstable; urgency=medium
|
||||||
|
|
||||||
* Bumped compat to 11
|
* Bumped compat to 11
|
||||||
|
5
debian/control
vendored
5
debian/control
vendored
@ -7,13 +7,12 @@ Section: x11
|
|||||||
Priority: optional
|
Priority: optional
|
||||||
Build-Depends: debhelper (>= 11~),
|
Build-Depends: debhelper (>= 11~),
|
||||||
libkf5windowsystem-dev,
|
libkf5windowsystem-dev,
|
||||||
libqtermwidget5-0-dev (>= 0.8.0),
|
libqtermwidget5-0-dev (>= 0.9.0~),
|
||||||
libqt5svg5-dev,
|
libqt5svg5-dev,
|
||||||
libqt5x11extras5-dev,
|
libqt5x11extras5-dev,
|
||||||
libutf8proc-dev,
|
libutf8proc-dev,
|
||||||
libx11-dev,
|
libx11-dev,
|
||||||
lxqt-build-tools (>= 0.4.0),
|
lxqt-build-tools (>= 0.5.0~),
|
||||||
qtbase5-private-dev
|
|
||||||
Standards-Version: 4.1.4
|
Standards-Version: 4.1.4
|
||||||
Vcs-Browser: https://salsa.debian.org/lxqt-team/qterminal
|
Vcs-Browser: https://salsa.debian.org/lxqt-team/qterminal
|
||||||
Vcs-Git: https://salsa.debian.org/lxqt-team/qterminal.git
|
Vcs-Git: https://salsa.debian.org/lxqt-team/qterminal.git
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
Description: Fixed appdata and path
|
Description: <short summary of the patch>
|
||||||
* should be pushed to upstream soon
|
|
||||||
|
|
||||||
Author: Alf Gaida <agaida@siduction.org>
|
Author: Alf Gaida <agaida@siduction.org>
|
||||||
Last-Update: 2017-11-05
|
Last-Update: 2018-05-23
|
||||||
|
|
||||||
--- qterminal-0.8.0.orig/CMakeLists.txt
|
--- a/CMakeLists.txt
|
||||||
+++ qterminal-0.8.0/CMakeLists.txt
|
+++ b/CMakeLists.txt
|
||||||
@@ -205,7 +205,7 @@ install(FILES
|
@@ -213,7 +213,7 @@
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
qterminal.appdata.xml
|
qterminal.appdata.xml
|
||||||
@ -15,8 +13,8 @@ Last-Update: 2017-11-05
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(NOT APPLEBUNDLE)
|
if(NOT APPLEBUNDLE)
|
||||||
--- qterminal-0.8.0.orig/qterminal.appdata.xml
|
--- a/qterminal.appdata.xml
|
||||||
+++ qterminal-0.8.0/qterminal.appdata.xml
|
+++ b/qterminal.appdata.xml
|
||||||
@@ -1,6 +1,6 @@
|
@@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
-<application>
|
-<application>
|
||||||
@ -30,10 +28,11 @@ Last-Update: 2017-11-05
|
|||||||
<caption>Find bar and highlighted match.</caption>
|
<caption>Find bar and highlighted match.</caption>
|
||||||
</screenshot>
|
</screenshot>
|
||||||
</screenshots>
|
</screenshots>
|
||||||
|
- <url type="homepage">https://github.com/lxqt/qterminal</url>
|
||||||
|
-</application>
|
||||||
+
|
+
|
||||||
+ <developer_name>LXQt Team</developer_name>
|
+ <developer_name>LXQt Team</developer_name>
|
||||||
<url type="homepage">https://github.com/lxde/qterminal</url>
|
+ <url type="homepage">https://github.com/lxde/qterminal</url>
|
||||||
-</application>
|
|
||||||
+ <url type="bugtracker">https://github.com/qterminal/issues</url>
|
+ <url type="bugtracker">https://github.com/qterminal/issues</url>
|
||||||
+ <url type="help">https://github.com/lxde/lxqt/wiki</url>
|
+ <url type="help">https://github.com/lxde/lxqt/wiki</url>
|
||||||
+ <url type="translate">http://github.com/lxde/lxqt-l10n</url>
|
+ <url type="translate">http://github.com/lxde/lxqt-l10n</url>
|
2
debian/patches/series
vendored
2
debian/patches/series
vendored
@ -1 +1 @@
|
|||||||
appdata-metainfo.patch
|
appdata.patch
|
||||||
|
@ -39,5 +39,5 @@
|
|||||||
<caption>Find bar and highlighted match.</caption>
|
<caption>Find bar and highlighted match.</caption>
|
||||||
</screenshot>
|
</screenshot>
|
||||||
</screenshots>
|
</screenshots>
|
||||||
<url type="homepage">https://github.com/lxde/qterminal</url>
|
<url type="homepage">https://github.com/lxqt/qterminal</url>
|
||||||
</application>
|
</application>
|
||||||
|
@ -2,10 +2,13 @@
|
|||||||
Name=QTerminal
|
Name=QTerminal
|
||||||
Type=Application
|
Type=Application
|
||||||
GenericName=Terminal emulator
|
GenericName=Terminal emulator
|
||||||
|
GenericName[es]=Emulador de terminal
|
||||||
|
|
||||||
Comment=Terminal emulator
|
Comment=Terminal emulator
|
||||||
|
Comment[ca]=Emulador de terminal
|
||||||
Comment[de]=Befehlszeile verwenden
|
Comment[de]=Befehlszeile verwenden
|
||||||
Comment[el]=Προσομοιωτής τερματικού
|
Comment[el]=Προσομοιωτής τερματικού
|
||||||
|
Comment[es]=Emulador de terminal
|
||||||
Comment[fr]=Terminal
|
Comment[fr]=Terminal
|
||||||
Comment[lt]=Terminalo emuliatorius
|
Comment[lt]=Terminalo emuliatorius
|
||||||
Comment[pl]=Emulator terminala
|
Comment[pl]=Emulator terminala
|
||||||
@ -33,7 +36,7 @@ Name[cs]=Vysouvací terminál
|
|||||||
Name[da]=Terminal der ruller ned
|
Name[da]=Terminal der ruller ned
|
||||||
Name[de]=Aufklapp-Terminal
|
Name[de]=Aufklapp-Terminal
|
||||||
Name[el]=Αναπτυσσόμενο τερματικό
|
Name[el]=Αναπτυσσόμενο τερματικό
|
||||||
Name[es]=Terminal de menú desplegable
|
Name[es]=Terminal desplegable
|
||||||
Name[et]=Lahtikeriv terminal
|
Name[et]=Lahtikeriv terminal
|
||||||
Name[fr]=Terminal déroulant
|
Name[fr]=Terminal déroulant
|
||||||
Name[hr]=Spuštajući terminal
|
Name[hr]=Spuštajući terminal
|
||||||
|
@ -8,7 +8,7 @@ CONFIG += link_pkgconfig \
|
|||||||
|
|
||||||
PKGCONFIG += qtermwidget5
|
PKGCONFIG += qtermwidget5
|
||||||
|
|
||||||
DEFINES += STR_VERSION=\\\"0.7.0\\\"
|
DEFINES += STR_VERSION=\\\"0.9.0\\\"
|
||||||
|
|
||||||
SOURCES += $$files(src/*.cpp)
|
SOURCES += $$files(src/*.cpp)
|
||||||
HEADERS += $$files(src/*.h)
|
HEADERS += $$files(src/*.h)
|
||||||
|
@ -6,8 +6,10 @@ Categories=Qt;System;TerminalEmulator;
|
|||||||
Icon=utilities-terminal
|
Icon=utilities-terminal
|
||||||
|
|
||||||
Name=QTerminal drop down
|
Name=QTerminal drop down
|
||||||
|
Name[ca]=QTerminal desplegable
|
||||||
Name[de]=QTerminal herabhängend
|
Name[de]=QTerminal herabhängend
|
||||||
Name[el]=QTerminal αναπτυσσόμενο
|
Name[el]=QTerminal αναπτυσσόμενο
|
||||||
|
Name[es]=QTerminal desplegable
|
||||||
Name[lt]=QTerminal išskleidžiamasis
|
Name[lt]=QTerminal išskleidžiamasis
|
||||||
Name[pl]=QTerminal (tryb rozwijany)
|
Name[pl]=QTerminal (tryb rozwijany)
|
||||||
Name[pt]=QTerminal suspenso
|
Name[pt]=QTerminal suspenso
|
||||||
@ -23,7 +25,7 @@ GenericName[da]=Terminal der ruller ned
|
|||||||
GenericName[de]=Aufklapp-Terminal
|
GenericName[de]=Aufklapp-Terminal
|
||||||
GenericName[el]=Αναπτυσσόμενο τερματικό
|
GenericName[el]=Αναπτυσσόμενο τερματικό
|
||||||
GenericName[en_GB]=Drop-down Terminal
|
GenericName[en_GB]=Drop-down Terminal
|
||||||
GenericName[es]=Terminal de menú desplegable
|
GenericName[es]=Terminal desplegable
|
||||||
GenericName[et]=Lahtikeriv terminal
|
GenericName[et]=Lahtikeriv terminal
|
||||||
GenericName[fr]=Terminal déroulant
|
GenericName[fr]=Terminal déroulant
|
||||||
GenericName[hr]=Spuštajući terminal
|
GenericName[hr]=Spuštajući terminal
|
||||||
@ -52,11 +54,13 @@ GenericName[zh_CN]=拉幕式终端
|
|||||||
GenericName[zh_TW]=下拉式終端機
|
GenericName[zh_TW]=下拉式終端機
|
||||||
|
|
||||||
Comment=A drop-down terminal emulator.
|
Comment=A drop-down terminal emulator.
|
||||||
|
Comment[ca]=Un emulador de terminal desplegable.
|
||||||
Comment[de]=Ein Ausklapp-Terminalemulator.
|
Comment[de]=Ein Ausklapp-Terminalemulator.
|
||||||
Comment[el]=Ένας αναπτυσσόμενος προσομοιωτής τερματικού.
|
Comment[el]=Ένας αναπτυσσόμενος προσομοιωτής τερματικού.
|
||||||
|
Comment[es]=Un emulador de terminal desplegable.
|
||||||
Comment[lt]=Išskleidžiamasis terminalo emuliatorius.
|
Comment[lt]=Išskleidžiamasis terminalo emuliatorius.
|
||||||
Comment[pt]=Um emulador de terminal suspenso.
|
Comment[pt]=Um emulador de terminal suspenso.
|
||||||
Comment[pt_BR]=Um emulador de terminal suspenso.
|
Comment[pt_BR]=Um emulador de terminal suspenso.
|
||||||
Comment[ru]=Вападающий эмулятор терминала.
|
Comment[ru]=Выпадающий эмулятор терминала.
|
||||||
Comment[ja]=ドロップダウン式 ターミナルエミュレータ
|
Comment[ja]=ドロップダウン式 ターミナルエミュレータ
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ public:
|
|||||||
QDir d;
|
QDir d;
|
||||||
|
|
||||||
// standard $HOME subdirs
|
// standard $HOME subdirs
|
||||||
foreach (QStandardPaths::StandardLocation i, locations)
|
for (const QStandardPaths::StandardLocation i : qAsConst(locations))
|
||||||
{
|
{
|
||||||
path = QStandardPaths::writableLocation(i);
|
path = QStandardPaths::writableLocation(i);
|
||||||
if (!d.exists(path))
|
if (!d.exists(path))
|
||||||
@ -140,7 +140,8 @@ public:
|
|||||||
|
|
||||||
// system env - include dirs in the tree
|
// system env - include dirs in the tree
|
||||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||||
foreach (const QString &i, env.keys())
|
const auto keys = env.keys();
|
||||||
|
for (const QString &i : keys)
|
||||||
{
|
{
|
||||||
path = env.value(i);
|
path = env.value(i);
|
||||||
if (!d.exists(path) || !QFileInfo(path).isDir())
|
if (!d.exists(path) || !QFileInfo(path).isDir())
|
||||||
@ -369,8 +370,8 @@ BookmarksWidget::BookmarksWidget(QWidget *parent)
|
|||||||
treeView->setModel(m_model);
|
treeView->setModel(m_model);
|
||||||
treeView->header()->hide();
|
treeView->header()->hide();
|
||||||
|
|
||||||
connect(treeView, SIGNAL(doubleClicked(QModelIndex)),
|
connect(treeView, &QTreeView::doubleClicked,
|
||||||
this, SLOT(handleCommand(QModelIndex)));
|
this, &BookmarksWidget::handleCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
BookmarksWidget::~BookmarksWidget()
|
BookmarksWidget::~BookmarksWidget()
|
||||||
|
@ -32,12 +32,12 @@ FontDialog::FontDialog(const QFont &f)
|
|||||||
|
|
||||||
sizeSpinBox->setValue(f.pointSize());
|
sizeSpinBox->setValue(f.pointSize());
|
||||||
|
|
||||||
setFontSample();
|
setFontSample(f);
|
||||||
|
|
||||||
connect(fontComboBox, SIGNAL(currentFontChanged(QFont)),
|
connect(fontComboBox, &QFontComboBox::currentFontChanged,
|
||||||
this, SLOT(setFontSample()));
|
this, &FontDialog::setFontSample);
|
||||||
connect(sizeSpinBox, SIGNAL(valueChanged(int)),
|
connect(sizeSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||||
this, SLOT(setFontSample()));
|
this, &FontDialog::setFontSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
QFont FontDialog::getFont()
|
QFont FontDialog::getFont()
|
||||||
@ -47,9 +47,16 @@ QFont FontDialog::getFont()
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FontDialog::setFontSample()
|
void FontDialog::setFontSample(const QFont &f)
|
||||||
{
|
{
|
||||||
QFont f = getFont();
|
previewLabel->setFont(f);
|
||||||
|
QString sample("%1 %2 pt");
|
||||||
|
previewLabel->setText(sample.arg(f.family()).arg(f.pointSize()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void FontDialog::setFontSize()
|
||||||
|
{
|
||||||
|
const QFont &f = getFont();
|
||||||
previewLabel->setFont(f);
|
previewLabel->setFont(f);
|
||||||
QString sample("%1 %2 pt");
|
QString sample("%1 %2 pt");
|
||||||
previewLabel->setText(sample.arg(f.family()).arg(f.pointSize()));
|
previewLabel->setText(sample.arg(f.family()).arg(f.pointSize()));
|
||||||
|
@ -32,7 +32,8 @@ public:
|
|||||||
QFont getFont();
|
QFont getFont();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setFontSample();
|
void setFontSample(const QFont &f);
|
||||||
|
void setFontSize();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>746</width>
|
<width>952</width>
|
||||||
<height>634</height>
|
<height>947</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -114,7 +114,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="16" column="0">
|
<item row="19" column="0">
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QLabel" name="label_9">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Start with preset:</string>
|
<string>Start with preset:</string>
|
||||||
@ -130,14 +130,14 @@
|
|||||||
<item row="5" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QComboBox" name="tabsPos_comboBox"/>
|
<widget class="QComboBox" name="tabsPos_comboBox"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="10" column="0">
|
||||||
<widget class="QCheckBox" name="highlightCurrentCheckBox">
|
<widget class="QCheckBox" name="highlightCurrentCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Show a border around the current terminal</string>
|
<string>Show a border around the current terminal</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="13" column="0">
|
<item row="17" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Terminal transparency</string>
|
<string>Terminal transparency</string>
|
||||||
@ -147,7 +147,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="0">
|
<item row="16" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Application transparency</string>
|
<string>Application transparency</string>
|
||||||
@ -157,7 +157,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="16" column="1">
|
<item row="19" column="1">
|
||||||
<widget class="QComboBox" name="terminalPresetComboBox">
|
<widget class="QComboBox" name="terminalPresetComboBox">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -181,7 +181,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="1">
|
<item row="16" column="1">
|
||||||
<widget class="QSpinBox" name="appTransparencyBox">
|
<widget class="QSpinBox" name="appTransparencyBox">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> %</string>
|
<string> %</string>
|
||||||
@ -274,7 +274,7 @@
|
|||||||
<item row="6" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QComboBox" name="keybCursorShape_comboBox"/>
|
<widget class="QComboBox" name="keybCursorShape_comboBox"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="13" column="1">
|
<item row="17" column="1">
|
||||||
<widget class="QSpinBox" name="termTransparencyBox">
|
<widget class="QSpinBox" name="termTransparencyBox">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> %</string>
|
<string> %</string>
|
||||||
@ -300,7 +300,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="17" column="0" colspan="2">
|
<item row="20" column="0" colspan="2">
|
||||||
<spacer name="verticalSpacer_3">
|
<spacer name="verticalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -330,28 +330,35 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0" colspan="2">
|
<item row="12" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="changeWindowTitleCheckBox">
|
<widget class="QCheckBox" name="changeWindowTitleCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Change window title based on current terminal</string>
|
<string>Change window title based on current terminal</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0" colspan="2">
|
<item row="13" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="changeWindowIconCheckBox">
|
<widget class="QCheckBox" name="changeWindowIconCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Change window icon based on current terminal</string>
|
<string>Change window icon based on current terminal</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="15" column="0">
|
<item row="15" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="enabledBidiSupportCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable bi-directional text support</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="18" column="0">
|
||||||
<widget class="QLabel" name="label_13">
|
<widget class="QLabel" name="label_13">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Background image:</string>
|
<string>Background image:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="15" column="1">
|
<item row="18" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="backgroundImageLineEdit"/>
|
<widget class="QLineEdit" name="backgroundImageLineEdit"/>
|
||||||
@ -365,6 +372,43 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="14" column="0">
|
||||||
|
<widget class="QCheckBox" name="showTerminalSizeHintCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show terminal size on resize</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<widget class="QCheckBox" name="limitTabWidthCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Limit tab width:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="1">
|
||||||
|
<widget class="QSpinBox" name="limitTabWidthSpinBox">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string>px</string>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>1000</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="11" column="0">
|
||||||
|
<widget class="QCheckBox" name="closeTabButtonCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show close button on each tab</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="behaviorPage">
|
<widget class="QWidget" name="behaviorPage">
|
||||||
@ -450,7 +494,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="1">
|
<item row="10" column="1">
|
||||||
<spacer name="verticalSpacer_4">
|
<spacer name="verticalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -508,6 +552,33 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<widget class="QLabel" name="label_14">
|
||||||
|
<property name="text">
|
||||||
|
<string>Default $TERM</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="2">
|
||||||
|
<widget class="QComboBox" name="termComboBox">
|
||||||
|
<property name="editable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>xterm</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>xterm-256color</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -727,6 +798,7 @@
|
|||||||
<tabstop>highlightCurrentCheckBox</tabstop>
|
<tabstop>highlightCurrentCheckBox</tabstop>
|
||||||
<tabstop>changeWindowTitleCheckBox</tabstop>
|
<tabstop>changeWindowTitleCheckBox</tabstop>
|
||||||
<tabstop>changeWindowIconCheckBox</tabstop>
|
<tabstop>changeWindowIconCheckBox</tabstop>
|
||||||
|
<tabstop>enabledBidiSupportCheckBox</tabstop>
|
||||||
<tabstop>appTransparencyBox</tabstop>
|
<tabstop>appTransparencyBox</tabstop>
|
||||||
<tabstop>termTransparencyBox</tabstop>
|
<tabstop>termTransparencyBox</tabstop>
|
||||||
<tabstop>backgroundImageLineEdit</tabstop>
|
<tabstop>backgroundImageLineEdit</tabstop>
|
||||||
@ -801,5 +873,21 @@
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>limitTabWidthCheckBox</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>limitTabWidthSpinBox</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>350</x>
|
||||||
|
<y>275</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>618</x>
|
||||||
|
<y>275</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>MainWindow</string>
|
<string>MainWindow</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="autoFillBackground">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
@ -57,9 +54,6 @@
|
|||||||
<height>26</height>
|
<height>26</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="autoFillBackground">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<widget class="QMenu" name="menu_File">
|
<widget class="QMenu" name="menu_File">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>&File</string>
|
<string>&File</string>
|
||||||
|
13
src/main.cpp
13
src/main.cpp
@ -60,8 +60,8 @@ void print_usage_and_exit(int code)
|
|||||||
puts(" -p, --profile Load qterminal with specific options");
|
puts(" -p, --profile Load qterminal with specific options");
|
||||||
puts(" -v, --version Prints application version and exits");
|
puts(" -v, --version Prints application version and exits");
|
||||||
puts(" -w, --workdir <dir> Start session with specified work directory");
|
puts(" -w, --workdir <dir> Start session with specified work directory");
|
||||||
puts("\nHomepage: <https://github.com/lxde/qterminal>");
|
puts("\nHomepage: <https://github.com/lxqt/qterminal>");
|
||||||
puts("Report bugs to <https://github.com/lxde/qterminal/issues>");
|
puts("Report bugs to <https://github.com/lxqt/qterminal/issues>");
|
||||||
exit(code);
|
exit(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,8 +111,6 @@ void parse_args(int argc, char* argv[], QString& workdir, QString & shell_comman
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
setenv("TERM", "xterm", 1); // TODO/FIXME: why?
|
|
||||||
|
|
||||||
QApplication::setApplicationName("qterminal");
|
QApplication::setApplicationName("qterminal");
|
||||||
QApplication::setApplicationVersion(STR_VERSION);
|
QApplication::setApplicationVersion(STR_VERSION);
|
||||||
QApplication::setOrganizationDomain("qterminal.org");
|
QApplication::setOrganizationDomain("qterminal.org");
|
||||||
@ -131,6 +129,11 @@ int main(int argc, char *argv[])
|
|||||||
bool dropMode;
|
bool dropMode;
|
||||||
parse_args(argc, argv, workdir, shell_command, dropMode);
|
parse_args(argc, argv, workdir, shell_command, dropMode);
|
||||||
|
|
||||||
|
Properties::Instance()->migrate_settings();
|
||||||
|
Properties::Instance()->loadSettings();
|
||||||
|
|
||||||
|
qputenv("TERM", Properties::Instance()->term.toLatin1());
|
||||||
|
|
||||||
if (workdir.isEmpty())
|
if (workdir.isEmpty())
|
||||||
workdir = QDir::currentPath();
|
workdir = QDir::currentPath();
|
||||||
app->setWorkingDirectory(workdir);
|
app->setWorkingDirectory(workdir);
|
||||||
@ -267,7 +270,7 @@ void QTerminalApp::registerOnDbus()
|
|||||||
QList<QDBusObjectPath> QTerminalApp::getWindows()
|
QList<QDBusObjectPath> QTerminalApp::getWindows()
|
||||||
{
|
{
|
||||||
QList<QDBusObjectPath> windows;
|
QList<QDBusObjectPath> windows;
|
||||||
foreach (MainWindow *wnd, m_windowList)
|
for (MainWindow *wnd : qAsConst(m_windowList))
|
||||||
{
|
{
|
||||||
windows.push_back(wnd->getDbusPath());
|
windows.push_back(wnd->getDbusPath());
|
||||||
}
|
}
|
||||||
|
@ -65,13 +65,16 @@ MainWindow::MainWindow(TerminalConfig &cfg,
|
|||||||
#ifdef HAVE_QDBUS
|
#ifdef HAVE_QDBUS
|
||||||
registerAdapter<WindowAdaptor, MainWindow>(this);
|
registerAdapter<WindowAdaptor, MainWindow>(this);
|
||||||
#endif
|
#endif
|
||||||
|
m_removeFinished = false;
|
||||||
QTerminalApp::Instance()->addWindow(this);
|
QTerminalApp::Instance()->addWindow(this);
|
||||||
|
// We want terminal translucency...
|
||||||
setAttribute(Qt::WA_TranslucentBackground);
|
setAttribute(Qt::WA_TranslucentBackground);
|
||||||
|
// ... but neither a fully transparent nor a flat menubar
|
||||||
|
// with styles that have translucency and/or gradient.
|
||||||
|
setAttribute(Qt::WA_NoSystemBackground, false);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
Properties::Instance()->migrate_settings();
|
|
||||||
Properties::Instance()->loadSettings();
|
|
||||||
|
|
||||||
m_bookmarksDock = new QDockWidget(tr("Bookmarks"), this);
|
m_bookmarksDock = new QDockWidget(tr("Bookmarks"), this);
|
||||||
m_bookmarksDock->setObjectName("BookmarksDockWidget");
|
m_bookmarksDock->setObjectName("BookmarksDockWidget");
|
||||||
@ -80,15 +83,15 @@ MainWindow::MainWindow(TerminalConfig &cfg,
|
|||||||
bookmarksWidget->setAutoFillBackground(true);
|
bookmarksWidget->setAutoFillBackground(true);
|
||||||
m_bookmarksDock->setWidget(bookmarksWidget);
|
m_bookmarksDock->setWidget(bookmarksWidget);
|
||||||
addDockWidget(Qt::LeftDockWidgetArea, m_bookmarksDock);
|
addDockWidget(Qt::LeftDockWidgetArea, m_bookmarksDock);
|
||||||
connect(bookmarksWidget, SIGNAL(callCommand(QString)),
|
connect(bookmarksWidget, &BookmarksWidget::callCommand,
|
||||||
this, SLOT(bookmarksWidget_callCommand(QString)));
|
this, &MainWindow::bookmarksWidget_callCommand);
|
||||||
|
|
||||||
connect(m_bookmarksDock, SIGNAL(visibilityChanged(bool)),
|
connect(m_bookmarksDock, &QDockWidget::visibilityChanged,
|
||||||
this, SLOT(bookmarksDock_visibilityChanged(bool)));
|
this, &MainWindow::bookmarksDock_visibilityChanged);
|
||||||
|
|
||||||
connect(actAbout, SIGNAL(triggered()), SLOT(actAbout_triggered()));
|
connect(actAbout, &QAction::triggered, this, &MainWindow::actAbout_triggered);
|
||||||
connect(actAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
|
connect(actAboutQt, &QAction::triggered, qApp, &QApplication::aboutQt);
|
||||||
connect(&m_dropShortcut, SIGNAL(activated()), SLOT(showHide()));
|
connect(&m_dropShortcut, &QxtGlobalShortcut::activated, this, &MainWindow::showHide);
|
||||||
|
|
||||||
setContentsMargins(0, 0, 0, 0);
|
setContentsMargins(0, 0, 0, 0);
|
||||||
if (m_dropMode) {
|
if (m_dropMode) {
|
||||||
@ -106,7 +109,7 @@ MainWindow::MainWindow(TerminalConfig &cfg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
consoleTabulator->setAutoFillBackground(true);
|
consoleTabulator->setAutoFillBackground(true);
|
||||||
connect(consoleTabulator, SIGNAL(closeTabNotification()), SLOT(close()));
|
connect(consoleTabulator, &TabWidget::closeTabNotification, this, &MainWindow::testClose);
|
||||||
consoleTabulator->setTabPosition((QTabWidget::TabPosition)Properties::Instance()->tabsPos);
|
consoleTabulator->setTabPosition((QTabWidget::TabPosition)Properties::Instance()->tabsPos);
|
||||||
//consoleTabulator->setShellProgram(command);
|
//consoleTabulator->setShellProgram(command);
|
||||||
|
|
||||||
@ -116,7 +119,7 @@ MainWindow::MainWindow(TerminalConfig &cfg,
|
|||||||
setupCustomDirs();
|
setupCustomDirs();
|
||||||
|
|
||||||
connect(consoleTabulator, &TabWidget::currentTitleChanged, this, &MainWindow::onCurrentTitleChanged);
|
connect(consoleTabulator, &TabWidget::currentTitleChanged, this, &MainWindow::onCurrentTitleChanged);
|
||||||
connect(menu_Actions, SIGNAL(aboutToShow()), this, SLOT(updateDisabledActions()));
|
connect(menu_Actions, &QMenu::aboutToShow, this, &MainWindow::updateDisabledActions);
|
||||||
|
|
||||||
/* The tab should be added after all changes are made to
|
/* The tab should be added after all changes are made to
|
||||||
the main window; otherwise, the initial prompt might
|
the main window; otherwise, the initial prompt might
|
||||||
@ -149,7 +152,7 @@ void MainWindow::enableDropMode()
|
|||||||
m_dropLockButton = new QToolButton(this);
|
m_dropLockButton = new QToolButton(this);
|
||||||
consoleTabulator->setCornerWidget(m_dropLockButton, Qt::BottomRightCorner);
|
consoleTabulator->setCornerWidget(m_dropLockButton, Qt::BottomRightCorner);
|
||||||
m_dropLockButton->setCheckable(true);
|
m_dropLockButton->setCheckable(true);
|
||||||
m_dropLockButton->connect(m_dropLockButton, SIGNAL(clicked(bool)), this, SLOT(setKeepOpen(bool)));
|
m_dropLockButton->connect(m_dropLockButton, &QToolButton::clicked, this, &MainWindow::setKeepOpen);
|
||||||
setKeepOpen(Properties::Instance()->dropKeepOpen);
|
setKeepOpen(Properties::Instance()->dropKeepOpen);
|
||||||
m_dropLockButton->setAutoRaise(true);
|
m_dropLockButton->setAutoRaise(true);
|
||||||
|
|
||||||
@ -178,7 +181,8 @@ void MainWindow::setup_Action(const char *name, QAction *action, const char *def
|
|||||||
QList<QKeySequence> shortcuts;
|
QList<QKeySequence> shortcuts;
|
||||||
|
|
||||||
actions[name] = action;
|
actions[name] = action;
|
||||||
foreach (const QString &sequenceString, settings.value(name, defaultShortcut).toString().split('|'))
|
const auto sequences = settings.value(name, defaultShortcut).toString().split('|');
|
||||||
|
for (const QString &sequenceString : sequences)
|
||||||
shortcuts.append(QKeySequence::fromString(sequenceString));
|
shortcuts.append(QKeySequence::fromString(sequenceString));
|
||||||
actions[name]->setShortcuts(shortcuts);
|
actions[name]->setShortcuts(shortcuts);
|
||||||
|
|
||||||
@ -391,8 +395,8 @@ void MainWindow::setup_ViewMenu_Actions()
|
|||||||
if( tabPosition->actions().count() > Properties::Instance()->tabsPos )
|
if( tabPosition->actions().count() > Properties::Instance()->tabsPos )
|
||||||
tabPosition->actions().at(Properties::Instance()->tabsPos)->setChecked(true);
|
tabPosition->actions().at(Properties::Instance()->tabsPos)->setChecked(true);
|
||||||
|
|
||||||
connect(tabPosition, SIGNAL(triggered(QAction *)),
|
connect(tabPosition, &QActionGroup::triggered,
|
||||||
consoleTabulator, SLOT(changeTabPosition(QAction *)) );
|
consoleTabulator, &TabWidget::changeTabPosition);
|
||||||
|
|
||||||
if (tabPosMenu == NULL) {
|
if (tabPosMenu == NULL) {
|
||||||
tabPosMenu = new QMenu(tr("&Tabs Layout"), menu_Window);
|
tabPosMenu = new QMenu(tr("&Tabs Layout"), menu_Window);
|
||||||
@ -402,8 +406,8 @@ void MainWindow::setup_ViewMenu_Actions()
|
|||||||
tabPosMenu->addAction(tabPosition->actions().at(i));
|
tabPosMenu->addAction(tabPosition->actions().at(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(menu_Window, SIGNAL(hovered(QAction *)),
|
connect(menu_Window, &QMenu::hovered,
|
||||||
this, SLOT(updateActionGroup(QAction *)));
|
this, &MainWindow::updateActionGroup);
|
||||||
}
|
}
|
||||||
menu_Window->addMenu(tabPosMenu);
|
menu_Window->addMenu(tabPosMenu);
|
||||||
/* */
|
/* */
|
||||||
@ -424,8 +428,8 @@ void MainWindow::setup_ViewMenu_Actions()
|
|||||||
|
|
||||||
if( Properties::Instance()->scrollBarPos < scrollBarPosition->actions().size() )
|
if( Properties::Instance()->scrollBarPos < scrollBarPosition->actions().size() )
|
||||||
scrollBarPosition->actions().at(Properties::Instance()->scrollBarPos)->setChecked(true);
|
scrollBarPosition->actions().at(Properties::Instance()->scrollBarPos)->setChecked(true);
|
||||||
connect(scrollBarPosition, SIGNAL(triggered(QAction *)),
|
connect(scrollBarPosition, &QActionGroup::triggered,
|
||||||
consoleTabulator, SLOT(changeScrollPosition(QAction *)) );
|
consoleTabulator, &TabWidget::changeScrollPosition);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (scrollPosMenu == NULL) {
|
if (scrollPosMenu == NULL) {
|
||||||
@ -456,8 +460,8 @@ void MainWindow::setup_ViewMenu_Actions()
|
|||||||
if( Properties::Instance()->keyboardCursorShape < keyboardCursorShape->actions().size() )
|
if( Properties::Instance()->keyboardCursorShape < keyboardCursorShape->actions().size() )
|
||||||
keyboardCursorShape->actions().at(Properties::Instance()->keyboardCursorShape)->setChecked(true);
|
keyboardCursorShape->actions().at(Properties::Instance()->keyboardCursorShape)->setChecked(true);
|
||||||
|
|
||||||
connect(keyboardCursorShape, SIGNAL(triggered(QAction *)),
|
connect(keyboardCursorShape, &QActionGroup::triggered,
|
||||||
consoleTabulator, SLOT(changeKeyboardCursorShape(QAction *)) );
|
consoleTabulator, &TabWidget::changeKeyboardCursorShape);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyboardCursorShapeMenu == NULL) {
|
if (keyboardCursorShapeMenu == NULL) {
|
||||||
@ -513,6 +517,12 @@ void MainWindow::showFullscreen(bool fullscreen)
|
|||||||
setWindowState(windowState() & ~Qt::WindowFullScreen);
|
setWindowState(windowState() & ~Qt::WindowFullScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::testClose(bool removeFinished)
|
||||||
|
{
|
||||||
|
|
||||||
|
m_removeFinished = removeFinished;
|
||||||
|
close();
|
||||||
|
}
|
||||||
void MainWindow::toggleBookmarks()
|
void MainWindow::toggleBookmarks()
|
||||||
{
|
{
|
||||||
m_bookmarksDock->toggleViewAction()->trigger();
|
m_bookmarksDock->toggleViewAction()->trigger();
|
||||||
@ -551,8 +561,8 @@ void MainWindow::closeEvent(QCloseEvent *ev)
|
|||||||
QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No, Qt::Horizontal, dia);
|
QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No, Qt::Horizontal, dia);
|
||||||
buttonBox->button(QDialogButtonBox::Yes)->setDefault(true);
|
buttonBox->button(QDialogButtonBox::Yes)->setDefault(true);
|
||||||
|
|
||||||
connect(buttonBox, SIGNAL(accepted()), dia, SLOT(accept()));
|
connect(buttonBox, &QDialogButtonBox::accepted, dia, &QDialog::accept);
|
||||||
connect(buttonBox, SIGNAL(rejected()), dia, SLOT(reject()));
|
connect(buttonBox, &QDialogButtonBox::rejected, dia, &QDialog::reject);
|
||||||
|
|
||||||
QVBoxLayout * lay = new QVBoxLayout();
|
QVBoxLayout * lay = new QVBoxLayout();
|
||||||
lay->addWidget(new QLabel(tr("Are you sure you want to exit?")));
|
lay->addWidget(new QLabel(tr("Are you sure you want to exit?")));
|
||||||
@ -571,6 +581,12 @@ void MainWindow::closeEvent(QCloseEvent *ev)
|
|||||||
}
|
}
|
||||||
ev->accept();
|
ev->accept();
|
||||||
} else {
|
} else {
|
||||||
|
if(m_removeFinished) {
|
||||||
|
QWidget *w = consoleTabulator->widget(consoleTabulator->count()-1);
|
||||||
|
consoleTabulator->removeTab(consoleTabulator->count()-1);
|
||||||
|
delete w; // delete the widget because the window isn't closed
|
||||||
|
m_removeFinished = false;
|
||||||
|
}
|
||||||
ev->ignore();
|
ev->ignore();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,7 +601,7 @@ void MainWindow::actAbout_triggered()
|
|||||||
void MainWindow::actProperties_triggered()
|
void MainWindow::actProperties_triggered()
|
||||||
{
|
{
|
||||||
PropertiesDialog *p = new PropertiesDialog(this);
|
PropertiesDialog *p = new PropertiesDialog(this);
|
||||||
connect(p, SIGNAL(propertiesChanged()), this, SLOT(propertiesChanged()));
|
connect(p, &PropertiesDialog::propertiesChanged, this, &MainWindow::propertiesChanged);
|
||||||
p->exec();
|
p->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ private:
|
|||||||
QWidget *settingOwner;
|
QWidget *settingOwner;
|
||||||
|
|
||||||
QMenu *presetsMenu;
|
QMenu *presetsMenu;
|
||||||
|
bool m_removeFinished;
|
||||||
TerminalConfig m_config;
|
TerminalConfig m_config;
|
||||||
|
|
||||||
QDockWidget *m_bookmarksDock;
|
QDockWidget *m_bookmarksDock;
|
||||||
@ -102,7 +102,7 @@ private slots:
|
|||||||
void actAbout_triggered();
|
void actAbout_triggered();
|
||||||
void actProperties_triggered();
|
void actProperties_triggered();
|
||||||
void updateActionGroup(QAction *);
|
void updateActionGroup(QAction *);
|
||||||
|
void testClose(bool removeFinished);
|
||||||
void toggleBookmarks();
|
void toggleBookmarks();
|
||||||
void toggleBorderless();
|
void toggleBorderless();
|
||||||
void toggleTabBar();
|
void toggleTabBar();
|
||||||
|
@ -69,6 +69,7 @@ void Properties::loadSettings()
|
|||||||
colorScheme = m_settings->value("colorScheme", "Linux").toString();
|
colorScheme = m_settings->value("colorScheme", "Linux").toString();
|
||||||
|
|
||||||
highlightCurrentTerminal = m_settings->value("highlightCurrentTerminal", true).toBool();
|
highlightCurrentTerminal = m_settings->value("highlightCurrentTerminal", true).toBool();
|
||||||
|
showTerminalSizeHint = m_settings->value("showTerminalSizeHint", true).toBool();
|
||||||
|
|
||||||
font = QFont(qvariant_cast<QString>(m_settings->value("fontFamily", defaultFont().family())),
|
font = QFont(qvariant_cast<QString>(m_settings->value("fontFamily", defaultFont().family())),
|
||||||
qvariant_cast<int>(m_settings->value("fontSize", defaultFont().pointSize())));
|
qvariant_cast<int>(m_settings->value("fontSize", defaultFont().pointSize())));
|
||||||
@ -109,6 +110,11 @@ void Properties::loadSettings()
|
|||||||
hideTabBarWithOneTab = m_settings->value("HideTabBarWithOneTab", false).toBool();
|
hideTabBarWithOneTab = m_settings->value("HideTabBarWithOneTab", false).toBool();
|
||||||
m_motionAfterPaste = m_settings->value("MotionAfterPaste", 0).toInt();
|
m_motionAfterPaste = m_settings->value("MotionAfterPaste", 0).toInt();
|
||||||
|
|
||||||
|
/* tab width limit */
|
||||||
|
limitTabWidth = m_settings->value("LimitTabWidth", true).toBool();
|
||||||
|
limitTabWidthValue = m_settings->value("LimitTabWidthValue", 500).toInt();
|
||||||
|
showCloseTabButton = m_settings->value("ShowCloseTabButton", true).toBool();
|
||||||
|
|
||||||
/* toggles */
|
/* toggles */
|
||||||
borderless = m_settings->value("Borderless", false).toBool();
|
borderless = m_settings->value("Borderless", false).toBool();
|
||||||
tabBarless = m_settings->value("TabBarless", false).toBool();
|
tabBarless = m_settings->value("TabBarless", false).toBool();
|
||||||
@ -117,6 +123,7 @@ void Properties::loadSettings()
|
|||||||
saveSizeOnExit = m_settings->value("SaveSizeOnExit", true).toBool();
|
saveSizeOnExit = m_settings->value("SaveSizeOnExit", true).toBool();
|
||||||
savePosOnExit = m_settings->value("SavePosOnExit", true).toBool();
|
savePosOnExit = m_settings->value("SavePosOnExit", true).toBool();
|
||||||
useCWD = m_settings->value("UseCWD", false).toBool();
|
useCWD = m_settings->value("UseCWD", false).toBool();
|
||||||
|
term = m_settings->value("Term", "xterm-256color").toString();
|
||||||
|
|
||||||
// bookmarks
|
// bookmarks
|
||||||
useBookmarks = m_settings->value("UseBookmarks", false).toBool();
|
useBookmarks = m_settings->value("UseBookmarks", false).toBool();
|
||||||
@ -136,6 +143,7 @@ void Properties::loadSettings()
|
|||||||
|
|
||||||
changeWindowTitle = m_settings->value("ChangeWindowTitle", true).toBool();
|
changeWindowTitle = m_settings->value("ChangeWindowTitle", true).toBool();
|
||||||
changeWindowIcon = m_settings->value("ChangeWindowIcon", true).toBool();
|
changeWindowIcon = m_settings->value("ChangeWindowIcon", true).toBool();
|
||||||
|
enabledBidiSupport = m_settings->value("enabledBidiSupport", true).toBool();
|
||||||
|
|
||||||
confirmMultilinePaste = m_settings->value("ConfirmMultilinePaste", false).toBool();
|
confirmMultilinePaste = m_settings->value("ConfirmMultilinePaste", false).toBool();
|
||||||
trimPastedTrailingNewlines = m_settings->value("TrimPastedTrailingNewlines", false).toBool();
|
trimPastedTrailingNewlines = m_settings->value("TrimPastedTrailingNewlines", false).toBool();
|
||||||
@ -146,6 +154,7 @@ void Properties::saveSettings()
|
|||||||
m_settings->setValue("guiStyle", guiStyle);
|
m_settings->setValue("guiStyle", guiStyle);
|
||||||
m_settings->setValue("colorScheme", colorScheme);
|
m_settings->setValue("colorScheme", colorScheme);
|
||||||
m_settings->setValue("highlightCurrentTerminal", highlightCurrentTerminal);
|
m_settings->setValue("highlightCurrentTerminal", highlightCurrentTerminal);
|
||||||
|
m_settings->setValue("showTerminalSizeHint", showTerminalSizeHint);
|
||||||
m_settings->setValue("fontFamily", font.family());
|
m_settings->setValue("fontFamily", font.family());
|
||||||
m_settings->setValue("fontSize", font.pointSize());
|
m_settings->setValue("fontSize", font.pointSize());
|
||||||
//Clobber legacy setting
|
//Clobber legacy setting
|
||||||
@ -160,7 +169,8 @@ void Properties::saveSettings()
|
|||||||
{
|
{
|
||||||
it.next();
|
it.next();
|
||||||
QStringList sequenceStrings;
|
QStringList sequenceStrings;
|
||||||
foreach (const QKeySequence &shortcut, it.value()->shortcuts())
|
const auto shortcuts = it.value()->shortcuts();
|
||||||
|
for (const QKeySequence &shortcut : shortcuts)
|
||||||
sequenceStrings.append(shortcut.toString());
|
sequenceStrings.append(shortcut.toString());
|
||||||
m_settings->setValue(it.key(), sequenceStrings.join('|'));
|
m_settings->setValue(it.key(), sequenceStrings.join('|'));
|
||||||
}
|
}
|
||||||
@ -197,6 +207,11 @@ void Properties::saveSettings()
|
|||||||
m_settings->setValue("KeyboardCursorShape", keyboardCursorShape);
|
m_settings->setValue("KeyboardCursorShape", keyboardCursorShape);
|
||||||
m_settings->setValue("HideTabBarWithOneTab", hideTabBarWithOneTab);
|
m_settings->setValue("HideTabBarWithOneTab", hideTabBarWithOneTab);
|
||||||
m_settings->setValue("MotionAfterPaste", m_motionAfterPaste);
|
m_settings->setValue("MotionAfterPaste", m_motionAfterPaste);
|
||||||
|
|
||||||
|
m_settings->setValue("LimitTabWidth", limitTabWidth);
|
||||||
|
m_settings->setValue("LimitTabWidthValue", limitTabWidthValue);
|
||||||
|
m_settings->setValue("ShowCloseTabButton", showCloseTabButton);
|
||||||
|
|
||||||
m_settings->setValue("Borderless", borderless);
|
m_settings->setValue("Borderless", borderless);
|
||||||
m_settings->setValue("TabBarless", tabBarless);
|
m_settings->setValue("TabBarless", tabBarless);
|
||||||
m_settings->setValue("MenuVisible", menuVisible);
|
m_settings->setValue("MenuVisible", menuVisible);
|
||||||
@ -204,6 +219,7 @@ void Properties::saveSettings()
|
|||||||
m_settings->setValue("SavePosOnExit", savePosOnExit);
|
m_settings->setValue("SavePosOnExit", savePosOnExit);
|
||||||
m_settings->setValue("SaveSizeOnExit", saveSizeOnExit);
|
m_settings->setValue("SaveSizeOnExit", saveSizeOnExit);
|
||||||
m_settings->setValue("UseCWD", useCWD);
|
m_settings->setValue("UseCWD", useCWD);
|
||||||
|
m_settings->setValue("Term", term);
|
||||||
|
|
||||||
// bookmarks
|
// bookmarks
|
||||||
m_settings->setValue("UseBookmarks", useBookmarks);
|
m_settings->setValue("UseBookmarks", useBookmarks);
|
||||||
@ -222,6 +238,7 @@ void Properties::saveSettings()
|
|||||||
|
|
||||||
m_settings->setValue("ChangeWindowTitle", changeWindowTitle);
|
m_settings->setValue("ChangeWindowTitle", changeWindowTitle);
|
||||||
m_settings->setValue("ChangeWindowIcon", changeWindowIcon);
|
m_settings->setValue("ChangeWindowIcon", changeWindowIcon);
|
||||||
|
m_settings->setValue("enabledBidiSupport", enabledBidiSupport);
|
||||||
|
|
||||||
|
|
||||||
m_settings->setValue("ConfirmMultilinePaste", confirmMultilinePaste);
|
m_settings->setValue("ConfirmMultilinePaste", confirmMultilinePaste);
|
||||||
|
@ -50,6 +50,7 @@ class Properties
|
|||||||
QString colorScheme;
|
QString colorScheme;
|
||||||
QString guiStyle;
|
QString guiStyle;
|
||||||
bool highlightCurrentTerminal;
|
bool highlightCurrentTerminal;
|
||||||
|
bool showTerminalSizeHint;
|
||||||
|
|
||||||
bool historyLimited;
|
bool historyLimited;
|
||||||
unsigned historyLimitedTo;
|
unsigned historyLimitedTo;
|
||||||
@ -68,6 +69,11 @@ class Properties
|
|||||||
bool hideTabBarWithOneTab;
|
bool hideTabBarWithOneTab;
|
||||||
int m_motionAfterPaste;
|
int m_motionAfterPaste;
|
||||||
|
|
||||||
|
bool limitTabWidth;
|
||||||
|
int limitTabWidthValue;
|
||||||
|
|
||||||
|
bool showCloseTabButton;
|
||||||
|
|
||||||
bool borderless;
|
bool borderless;
|
||||||
bool tabBarless;
|
bool tabBarless;
|
||||||
bool menuVisible;
|
bool menuVisible;
|
||||||
@ -79,6 +85,8 @@ class Properties
|
|||||||
|
|
||||||
bool useCWD;
|
bool useCWD;
|
||||||
|
|
||||||
|
QString term;
|
||||||
|
|
||||||
bool useBookmarks;
|
bool useBookmarks;
|
||||||
bool bookmarksVisible;
|
bool bookmarksVisible;
|
||||||
QString bookmarksFile;
|
QString bookmarksFile;
|
||||||
@ -93,6 +101,7 @@ class Properties
|
|||||||
|
|
||||||
bool changeWindowTitle;
|
bool changeWindowTitle;
|
||||||
bool changeWindowIcon;
|
bool changeWindowIcon;
|
||||||
|
bool enabledBidiSupport;
|
||||||
|
|
||||||
bool confirmMultilinePaste;
|
bool confirmMultilinePaste;
|
||||||
bool trimPastedTrailingNewlines;
|
bool trimPastedTrailingNewlines;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QKeySequenceEdit>
|
||||||
|
|
||||||
#include "propertiesdialog.h"
|
#include "propertiesdialog.h"
|
||||||
#include "properties.h"
|
#include "properties.h"
|
||||||
@ -28,21 +29,47 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "qterminalapp.h"
|
#include "qterminalapp.h"
|
||||||
|
|
||||||
|
Delegate::Delegate (QObject *parent)
|
||||||
|
: QStyledItemDelegate (parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget* Delegate::createEditor(QWidget *parent,
|
||||||
|
const QStyleOptionViewItem& /*option*/,
|
||||||
|
const QModelIndex& /*index*/) const
|
||||||
|
{
|
||||||
|
return new QKeySequenceEdit (parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Delegate::eventFilter(QObject *object, QEvent *event)
|
||||||
|
{
|
||||||
|
QWidget *editor = qobject_cast<QWidget*>(object);
|
||||||
|
if (editor && event->type() == QEvent::KeyPress) {
|
||||||
|
int k = static_cast<QKeyEvent *>(event)->key();
|
||||||
|
if (k == Qt::Key_Return || k == Qt::Key_Enter) {
|
||||||
|
emit QAbstractItemDelegate::commitData(editor);
|
||||||
|
emit QAbstractItemDelegate::closeEditor(editor);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QStyledItemDelegate::eventFilter (object, event);
|
||||||
|
}
|
||||||
|
|
||||||
PropertiesDialog::PropertiesDialog(QWidget *parent)
|
PropertiesDialog::PropertiesDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()),
|
connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked,
|
||||||
this, SLOT(apply()));
|
this, &PropertiesDialog::apply);
|
||||||
connect(changeFontButton, SIGNAL(clicked()),
|
connect(changeFontButton, &QPushButton::clicked,
|
||||||
this, SLOT(changeFontButton_clicked()));
|
this, &PropertiesDialog::changeFontButton_clicked);
|
||||||
connect(chooseBackgroundImageButton, &QPushButton::clicked,
|
connect(chooseBackgroundImageButton, &QPushButton::clicked,
|
||||||
this, &PropertiesDialog::chooseBackgroundImageButton_clicked);
|
this, &PropertiesDialog::chooseBackgroundImageButton_clicked);
|
||||||
|
|
||||||
QStringList emulations = QTermWidget::availableKeyBindings();
|
QStringList emulations = QTermWidget::availableKeyBindings();
|
||||||
QStringList colorSchemes = QTermWidget::availableColorSchemes();
|
QStringList colorSchemes = QTermWidget::availableColorSchemes();
|
||||||
|
colorSchemes.sort(Qt::CaseInsensitive);
|
||||||
|
|
||||||
listWidget->setCurrentRow(0);
|
listWidget->setCurrentRow(0);
|
||||||
listWidget->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow);
|
listWidget->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow);
|
||||||
@ -58,7 +85,10 @@ PropertiesDialog::PropertiesDialog(QWidget *parent)
|
|||||||
int eix = emulationComboBox->findText(Properties::Instance()->emulation);
|
int eix = emulationComboBox->findText(Properties::Instance()->emulation);
|
||||||
emulationComboBox->setCurrentIndex(eix != -1 ? eix : 0 );
|
emulationComboBox->setCurrentIndex(eix != -1 ? eix : 0 );
|
||||||
|
|
||||||
/* shortcuts */
|
/* set the delegate of shortcut widget as well as its contents */
|
||||||
|
Delegate *del = new Delegate(shortcutsWidget);
|
||||||
|
shortcutsWidget->setItemDelegate(del);
|
||||||
|
shortcutsWidget->sortByColumn(0, Qt::AscendingOrder);
|
||||||
setupShortcuts();
|
setupShortcuts();
|
||||||
|
|
||||||
/* scrollbar position */
|
/* scrollbar position */
|
||||||
@ -73,6 +103,11 @@ PropertiesDialog::PropertiesDialog(QWidget *parent)
|
|||||||
tabsPos_comboBox->addItems(tabsPosList);
|
tabsPos_comboBox->addItems(tabsPosList);
|
||||||
tabsPos_comboBox->setCurrentIndex(Properties::Instance()->tabsPos);
|
tabsPos_comboBox->setCurrentIndex(Properties::Instance()->tabsPos);
|
||||||
|
|
||||||
|
/* tab width */
|
||||||
|
limitTabWidthCheckBox->setChecked(Properties::Instance()->limitTabWidth);
|
||||||
|
limitTabWidthSpinBox->setValue(Properties::Instance()->limitTabWidthValue);
|
||||||
|
closeTabButtonCheckBox->setChecked(Properties::Instance()->showCloseTabButton);
|
||||||
|
|
||||||
/* keyboard cursor shape */
|
/* keyboard cursor shape */
|
||||||
QStringList keyboardCursorShapeList;
|
QStringList keyboardCursorShapeList;
|
||||||
keyboardCursorShapeList << tr("BlockCursor") << tr("UnderlineCursor") << tr("IBeamCursor");
|
keyboardCursorShapeList << tr("BlockCursor") << tr("UnderlineCursor") << tr("IBeamCursor");
|
||||||
@ -107,6 +142,8 @@ PropertiesDialog::PropertiesDialog(QWidget *parent)
|
|||||||
|
|
||||||
highlightCurrentCheckBox->setChecked(Properties::Instance()->highlightCurrentTerminal);
|
highlightCurrentCheckBox->setChecked(Properties::Instance()->highlightCurrentTerminal);
|
||||||
|
|
||||||
|
showTerminalSizeHintCheckBox->setChecked(Properties::Instance()->showTerminalSizeHint);
|
||||||
|
|
||||||
askOnExitCheckBox->setChecked(Properties::Instance()->askOnExit);
|
askOnExitCheckBox->setChecked(Properties::Instance()->askOnExit);
|
||||||
|
|
||||||
savePosOnExitCheckBox->setChecked(Properties::Instance()->savePosOnExit);
|
savePosOnExitCheckBox->setChecked(Properties::Instance()->savePosOnExit);
|
||||||
@ -114,6 +151,8 @@ PropertiesDialog::PropertiesDialog(QWidget *parent)
|
|||||||
|
|
||||||
useCwdCheckBox->setChecked(Properties::Instance()->useCWD);
|
useCwdCheckBox->setChecked(Properties::Instance()->useCWD);
|
||||||
|
|
||||||
|
termComboBox->setCurrentText(Properties::Instance()->term);
|
||||||
|
|
||||||
historyLimited->setChecked(Properties::Instance()->historyLimited);
|
historyLimited->setChecked(Properties::Instance()->historyLimited);
|
||||||
historyUnlimited->setChecked(!Properties::Instance()->historyLimited);
|
historyUnlimited->setChecked(!Properties::Instance()->historyLimited);
|
||||||
historyLimitedTo->setValue(Properties::Instance()->historyLimitedTo);
|
historyLimitedTo->setValue(Properties::Instance()->historyLimitedTo);
|
||||||
@ -130,17 +169,17 @@ PropertiesDialog::PropertiesDialog(QWidget *parent)
|
|||||||
useBookmarksCheckBox->setChecked(Properties::Instance()->useBookmarks);
|
useBookmarksCheckBox->setChecked(Properties::Instance()->useBookmarks);
|
||||||
bookmarksLineEdit->setText(Properties::Instance()->bookmarksFile);
|
bookmarksLineEdit->setText(Properties::Instance()->bookmarksFile);
|
||||||
openBookmarksFile(Properties::Instance()->bookmarksFile);
|
openBookmarksFile(Properties::Instance()->bookmarksFile);
|
||||||
connect(bookmarksButton, SIGNAL(clicked()),
|
connect(bookmarksButton, &QPushButton::clicked,
|
||||||
this, SLOT(bookmarksButton_clicked()));
|
this, &PropertiesDialog::bookmarksButton_clicked);
|
||||||
|
|
||||||
terminalPresetComboBox->setCurrentIndex(Properties::Instance()->terminalsPreset);
|
terminalPresetComboBox->setCurrentIndex(Properties::Instance()->terminalsPreset);
|
||||||
|
|
||||||
changeWindowTitleCheckBox->setChecked(Properties::Instance()->changeWindowTitle);
|
changeWindowTitleCheckBox->setChecked(Properties::Instance()->changeWindowTitle);
|
||||||
changeWindowIconCheckBox->setChecked(Properties::Instance()->changeWindowIcon);
|
changeWindowIconCheckBox->setChecked(Properties::Instance()->changeWindowIcon);
|
||||||
|
enabledBidiSupportCheckBox->setChecked(Properties::Instance()->enabledBidiSupport);
|
||||||
|
|
||||||
trimPastedTrailingNewlinesCheckBox->setChecked(Properties::Instance()->trimPastedTrailingNewlines);
|
trimPastedTrailingNewlinesCheckBox->setChecked(Properties::Instance()->trimPastedTrailingNewlines);
|
||||||
confirmMultilinePasteCheckBox->setChecked(Properties::Instance()->confirmMultilinePaste);
|
confirmMultilinePasteCheckBox->setChecked(Properties::Instance()->confirmMultilinePaste);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -171,6 +210,7 @@ void PropertiesDialog::apply()
|
|||||||
|
|
||||||
Properties::Instance()->termTransparency = termTransparencyBox->value();
|
Properties::Instance()->termTransparency = termTransparencyBox->value();
|
||||||
Properties::Instance()->highlightCurrentTerminal = highlightCurrentCheckBox->isChecked();
|
Properties::Instance()->highlightCurrentTerminal = highlightCurrentCheckBox->isChecked();
|
||||||
|
Properties::Instance()->showTerminalSizeHint = showTerminalSizeHintCheckBox->isChecked();
|
||||||
Properties::Instance()->backgroundImage = backgroundImageLineEdit->text();
|
Properties::Instance()->backgroundImage = backgroundImageLineEdit->text();
|
||||||
|
|
||||||
Properties::Instance()->askOnExit = askOnExitCheckBox->isChecked();
|
Properties::Instance()->askOnExit = askOnExitCheckBox->isChecked();
|
||||||
@ -180,9 +220,14 @@ void PropertiesDialog::apply()
|
|||||||
|
|
||||||
Properties::Instance()->useCWD = useCwdCheckBox->isChecked();
|
Properties::Instance()->useCWD = useCwdCheckBox->isChecked();
|
||||||
|
|
||||||
|
Properties::Instance()->term = termComboBox->currentText();
|
||||||
|
|
||||||
Properties::Instance()->scrollBarPos = scrollBarPos_comboBox->currentIndex();
|
Properties::Instance()->scrollBarPos = scrollBarPos_comboBox->currentIndex();
|
||||||
Properties::Instance()->tabsPos = tabsPos_comboBox->currentIndex();
|
Properties::Instance()->tabsPos = tabsPos_comboBox->currentIndex();
|
||||||
|
Properties::Instance()->limitTabWidth = limitTabWidthCheckBox->isChecked();
|
||||||
|
Properties::Instance()->limitTabWidthValue = limitTabWidthSpinBox->value();
|
||||||
Properties::Instance()->keyboardCursorShape = keybCursorShape_comboBox->currentIndex();
|
Properties::Instance()->keyboardCursorShape = keybCursorShape_comboBox->currentIndex();
|
||||||
|
Properties::Instance()->showCloseTabButton = closeTabButtonCheckBox->isChecked();
|
||||||
Properties::Instance()->hideTabBarWithOneTab = hideTabBarCheckBox->isChecked();
|
Properties::Instance()->hideTabBarWithOneTab = hideTabBarCheckBox->isChecked();
|
||||||
Properties::Instance()->menuVisible = showMenuCheckBox->isChecked();
|
Properties::Instance()->menuVisible = showMenuCheckBox->isChecked();
|
||||||
Properties::Instance()->m_motionAfterPaste = motionAfterPasting_comboBox->currentIndex();
|
Properties::Instance()->m_motionAfterPaste = motionAfterPasting_comboBox->currentIndex();
|
||||||
@ -207,6 +252,7 @@ void PropertiesDialog::apply()
|
|||||||
|
|
||||||
Properties::Instance()->changeWindowTitle = changeWindowTitleCheckBox->isChecked();
|
Properties::Instance()->changeWindowTitle = changeWindowTitleCheckBox->isChecked();
|
||||||
Properties::Instance()->changeWindowIcon = changeWindowIconCheckBox->isChecked();
|
Properties::Instance()->changeWindowIcon = changeWindowIconCheckBox->isChecked();
|
||||||
|
Properties::Instance()->enabledBidiSupport = enabledBidiSupportCheckBox->isChecked();
|
||||||
|
|
||||||
Properties::Instance()->trimPastedTrailingNewlines = trimPastedTrailingNewlinesCheckBox->isChecked();
|
Properties::Instance()->trimPastedTrailingNewlines = trimPastedTrailingNewlinesCheckBox->isChecked();
|
||||||
Properties::Instance()->confirmMultilinePaste = confirmMultilinePasteCheckBox->isChecked();
|
Properties::Instance()->confirmMultilinePaste = confirmMultilinePasteCheckBox->isChecked();
|
||||||
@ -258,7 +304,8 @@ void PropertiesDialog::saveShortcuts()
|
|||||||
QString sequenceString = sequence.toString();
|
QString sequenceString = sequence.toString();
|
||||||
|
|
||||||
QList<QKeySequence> shortcuts;
|
QList<QKeySequence> shortcuts;
|
||||||
foreach (sequenceString, item->text().split('|'))
|
const auto sequences = item->text().split('|');
|
||||||
|
for (const QKeySequence& sequenceString : sequences)
|
||||||
shortcuts.append(QKeySequence(sequenceString));
|
shortcuts.append(QKeySequence(sequenceString));
|
||||||
keyAction->setShortcuts(shortcuts);
|
keyAction->setShortcuts(shortcuts);
|
||||||
}
|
}
|
||||||
@ -279,41 +326,22 @@ void PropertiesDialog::setupShortcuts()
|
|||||||
QAction *keyAction = actions[keyValue];
|
QAction *keyAction = actions[keyValue];
|
||||||
QStringList sequenceStrings;
|
QStringList sequenceStrings;
|
||||||
|
|
||||||
foreach (const QKeySequence &shortcut, keyAction->shortcuts())
|
const auto shortcuts = keyAction->shortcuts();
|
||||||
|
for (const QKeySequence &shortcut : shortcuts)
|
||||||
sequenceStrings.append(shortcut.toString());
|
sequenceStrings.append(shortcut.toString());
|
||||||
|
|
||||||
QTableWidgetItem *itemName = new QTableWidgetItem( tr(keyValue.toStdString().c_str()) );
|
QTableWidgetItem *itemName = new QTableWidgetItem( tr(keyValue.toStdString().c_str()) );
|
||||||
QTableWidgetItem *itemShortcut = new QTableWidgetItem( sequenceStrings.join('|') );
|
QTableWidgetItem *itemShortcut = new QTableWidgetItem( sequenceStrings.join('|') );
|
||||||
|
|
||||||
itemName->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
|
itemName->setFlags( itemName->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable );
|
||||||
|
|
||||||
shortcutsWidget->setItem(x, 0, itemName);
|
shortcutsWidget->setItem(x, 0, itemName);
|
||||||
shortcutsWidget->setItem(x, 1, itemShortcut);
|
shortcutsWidget->setItem(x, 1, itemShortcut);
|
||||||
}
|
}
|
||||||
|
|
||||||
shortcutsWidget->resizeColumnsToContents();
|
shortcutsWidget->resizeColumnsToContents();
|
||||||
/*
|
|
||||||
connect(shortcutsWidget, SIGNAL(currentChanged(int, int)),
|
|
||||||
this, SLOT(recordAction(int, int)));
|
|
||||||
connect(shortcutsWidget, SIGNAL(valueChanged(int, int)),
|
|
||||||
this, SLOT(validateAction(int, int)));
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void PropertiesDialog::recordAction(int row, int column)
|
// No shortcut validation is needed with QKeySequenceEdit.
|
||||||
{
|
|
||||||
oldAccelText = shortcutsWidget->item(row, column)->text();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PropertiesDialog::validateAction(int row, int column)
|
|
||||||
{
|
|
||||||
QTableWidgetItem *item = shortcutsWidget->item(row, column);
|
|
||||||
QString accelText = QKeySequence(item->text()).toString();
|
|
||||||
|
|
||||||
if (accelText.isEmpty() && !item->text().isEmpty())
|
|
||||||
item->setText(oldAccelText);
|
|
||||||
else
|
|
||||||
item->setText(accelText);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertiesDialog::bookmarksButton_clicked()
|
void PropertiesDialog::bookmarksButton_clicked()
|
||||||
|
@ -19,8 +19,22 @@
|
|||||||
#ifndef PROPERTIESDIALOG_H
|
#ifndef PROPERTIESDIALOG_H
|
||||||
#define PROPERTIESDIALOG_H
|
#define PROPERTIESDIALOG_H
|
||||||
|
|
||||||
|
#include <QStyledItemDelegate>
|
||||||
#include "ui_propertiesdialog.h"
|
#include "ui_propertiesdialog.h"
|
||||||
|
|
||||||
|
class Delegate : public QStyledItemDelegate
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
Delegate (QObject *parent = 0);
|
||||||
|
|
||||||
|
virtual QWidget* createEditor(QWidget *parent,
|
||||||
|
const QStyleOptionViewItem&,
|
||||||
|
const QModelIndex&) const;
|
||||||
|
virtual bool eventFilter(QObject *object, QEvent *event);
|
||||||
|
};
|
||||||
|
|
||||||
class PropertiesDialog : public QDialog, Ui::PropertiesDialog
|
class PropertiesDialog : public QDialog, Ui::PropertiesDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -50,8 +64,6 @@ class PropertiesDialog : public QDialog, Ui::PropertiesDialog
|
|||||||
protected:
|
protected:
|
||||||
void setupShortcuts();
|
void setupShortcuts();
|
||||||
void saveShortcuts();
|
void saveShortcuts();
|
||||||
void recordAction(int row, int column);
|
|
||||||
void validateAction(int row, int column);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
68
src/tabbar.cpp
Normal file
68
src/tabbar.cpp
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2017 by Nathan Osman *
|
||||||
|
* nathan@quickmediasolutions.com *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program 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 General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "tabbar.h"
|
||||||
|
|
||||||
|
TabBar::TabBar(QWidget *parent)
|
||||||
|
: QTabBar(parent),
|
||||||
|
mLimitWidth(false),
|
||||||
|
mLimitWidthValue(0)
|
||||||
|
{
|
||||||
|
// To make the selected tab text bold, first give a bold font to the tabbar
|
||||||
|
// for QStyle::sizeFromContents(QStyle::CT_TabBarTab, ...) to make room
|
||||||
|
// for the bold text, and then, set the non-selected tab text to normal.
|
||||||
|
QFont f = font();
|
||||||
|
f.setBold(true);
|
||||||
|
setFont(f);
|
||||||
|
setStyleSheet("QTabBar::tab:!selected { font-weight: normal; }");
|
||||||
|
}
|
||||||
|
|
||||||
|
void TabBar::setLimitWidth(bool limitWidth)
|
||||||
|
{
|
||||||
|
mLimitWidth = limitWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TabBar::setLimitWidthValue(int value)
|
||||||
|
{
|
||||||
|
mLimitWidthValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TabBar::updateWidth()
|
||||||
|
{
|
||||||
|
// This seems to be the only way to trigger an update
|
||||||
|
setIconSize(iconSize());
|
||||||
|
setElideMode(Qt::ElideMiddle);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize TabBar::tabSizeHint(int index) const
|
||||||
|
{
|
||||||
|
QSize size = QTabBar::tabSizeHint(index);
|
||||||
|
|
||||||
|
// If the width is limited, use that for the width hint
|
||||||
|
if (mLimitWidth) {
|
||||||
|
if (shape() == QTabBar::RoundedEast || shape() == QTabBar::TriangularEast
|
||||||
|
|| shape() == QTabBar::RoundedWest || shape() == QTabBar::TriangularWest) {
|
||||||
|
size.setHeight(mLimitWidthValue);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
size.setWidth(mLimitWidthValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
47
src/tabbar.h
Normal file
47
src/tabbar.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2017 by Nathan Osman *
|
||||||
|
* nathan@quickmediasolutions.com *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program 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 General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef TABBAR_H
|
||||||
|
#define TABBAR_H
|
||||||
|
|
||||||
|
#include <QSize>
|
||||||
|
#include <QTabBar>
|
||||||
|
|
||||||
|
class TabBar : public QTabBar
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit TabBar(QWidget *parent);
|
||||||
|
|
||||||
|
void setLimitWidth(bool limitWidth);
|
||||||
|
void setLimitWidthValue(int value);
|
||||||
|
void updateWidth();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual QSize tabSizeHint(int index) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
bool mLimitWidth;
|
||||||
|
int mLimitWidthValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TABBAR_H
|
@ -18,11 +18,13 @@
|
|||||||
|
|
||||||
#include <QTabBar>
|
#include <QTabBar>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
|
#include <QColorDialog>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "termwidgetholder.h"
|
#include "termwidgetholder.h"
|
||||||
|
#include "tabbar.h"
|
||||||
#include "tabwidget.h"
|
#include "tabwidget.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "properties.h"
|
#include "properties.h"
|
||||||
@ -33,8 +35,11 @@
|
|||||||
#define TAB_CUSTOM_NAME_PROPERTY "custom_name"
|
#define TAB_CUSTOM_NAME_PROPERTY "custom_name"
|
||||||
|
|
||||||
|
|
||||||
TabWidget::TabWidget(QWidget* parent) : QTabWidget(parent), tabNumerator(0)
|
TabWidget::TabWidget(QWidget* parent) : QTabWidget(parent), tabNumerator(0), mTabBar(new TabBar(this))
|
||||||
{
|
{
|
||||||
|
// Insert our own tab bar which overrides tab width and eliding
|
||||||
|
setTabBar(mTabBar);
|
||||||
|
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
|
|
||||||
/* On Mac OS X this will look similar to
|
/* On Mac OS X this will look similar to
|
||||||
@ -45,15 +50,15 @@ TabWidget::TabWidget(QWidget* parent) : QTabWidget(parent), tabNumerator(0)
|
|||||||
|
|
||||||
tabBar()->setUsesScrollButtons(true);
|
tabBar()->setUsesScrollButtons(true);
|
||||||
|
|
||||||
setTabsClosable(true);
|
|
||||||
setMovable(true);
|
setMovable(true);
|
||||||
setUsesScrollButtons(true);
|
setUsesScrollButtons(true);
|
||||||
|
|
||||||
tabBar()->installEventFilter(this);
|
tabBar()->installEventFilter(this);
|
||||||
|
|
||||||
connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(removeTab(int)));
|
connect(this, &TabWidget::tabCloseRequested, this, &TabWidget::removeTab);
|
||||||
connect(tabBar(), SIGNAL(tabMoved(int,int)), this, SLOT(updateTabIndices()));
|
connect(tabBar(), &QTabBar::tabMoved, this, &TabWidget::updateTabIndices);
|
||||||
connect(this, SIGNAL(tabRenameRequested(int)), this, SLOT(renameSession(int)));
|
connect(this, &TabWidget::tabRenameRequested, this, &TabWidget::renameSession);
|
||||||
|
connect(this, &TabWidget::tabTitleColorChangeRequested, this, &TabWidget::setTitleColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
TermWidgetHolder * TabWidget::terminalHolder()
|
TermWidgetHolder * TabWidget::terminalHolder()
|
||||||
@ -73,8 +78,8 @@ int TabWidget::addNewTab(TerminalConfig config)
|
|||||||
|
|
||||||
TermWidgetHolder *console = new TermWidgetHolder(config, this);
|
TermWidgetHolder *console = new TermWidgetHolder(config, this);
|
||||||
console->setWindowTitle(label);
|
console->setWindowTitle(label);
|
||||||
connect(console, SIGNAL(finished()), SLOT(removeFinished()));
|
connect(console, &TermWidgetHolder::finished, this, &TabWidget::removeFinished);
|
||||||
connect(console, SIGNAL(lastTerminalClosed()), this, SLOT(removeFinished()));
|
connect(console, &TermWidgetHolder::lastTerminalClosed, this, &TabWidget::removeFinished);
|
||||||
connect(console, &TermWidgetHolder::termTitleChanged, this, &TabWidget::onTermTitleChanged);
|
connect(console, &TermWidgetHolder::termTitleChanged, this, &TabWidget::onTermTitleChanged);
|
||||||
connect(this, &QTabWidget::currentChanged, this, &TabWidget::currentTitleChanged);
|
connect(this, &QTabWidget::currentChanged, this, &TabWidget::currentTitleChanged);
|
||||||
|
|
||||||
@ -197,6 +202,15 @@ void TabWidget::renameCurrentSession()
|
|||||||
renameSession(currentIndex());
|
renameSession(currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabWidget::setTitleColor(int index)
|
||||||
|
{
|
||||||
|
QColor current = tabBar()->tabTextColor(index);
|
||||||
|
QColor color = QColorDialog::getColor(current, this, tr("Select new tab title color"));
|
||||||
|
|
||||||
|
if (color.isValid())
|
||||||
|
tabBar()->setTabTextColor(index, color);
|
||||||
|
}
|
||||||
|
|
||||||
void TabWidget::renameTabsAfterRemove()
|
void TabWidget::renameTabsAfterRemove()
|
||||||
{
|
{
|
||||||
// it breaks custom names - it replaces original/custom title with shell no #
|
// it breaks custom names - it replaces original/custom title with shell no #
|
||||||
@ -214,23 +228,36 @@ void TabWidget::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
|
|
||||||
QAction *close = menu.addAction(QIcon::fromTheme("document-close"), tr("Close session"));
|
QAction *close = menu.addAction(QIcon::fromTheme("document-close"), tr("Close session"));
|
||||||
QAction *rename = menu.addAction(actions[RENAME_SESSION]->text());
|
QAction *rename = menu.addAction(actions[RENAME_SESSION]->text());
|
||||||
|
QAction *changeColor = menu.addAction(QIcon::fromTheme("color-management"), tr("Change title color"));
|
||||||
rename->setShortcut(actions[RENAME_SESSION]->shortcut());
|
rename->setShortcut(actions[RENAME_SESSION]->shortcut());
|
||||||
rename->blockSignals(true);
|
rename->blockSignals(true);
|
||||||
|
|
||||||
int tabIndex = tabBar()->tabAt(event->pos());
|
int tabIndex = tabBar()->tabAt(tabBar()->mapFrom(this,event->pos()));
|
||||||
QAction *action = menu.exec(event->globalPos());
|
QAction *action = menu.exec(event->globalPos());
|
||||||
if (action == close) {
|
if (action == close) {
|
||||||
emit tabCloseRequested(tabIndex);
|
emit tabCloseRequested(tabIndex);
|
||||||
} else if (action == rename) {
|
} else if (action == rename) {
|
||||||
emit tabRenameRequested(tabIndex);
|
emit tabRenameRequested(tabIndex);
|
||||||
|
} else if (action == changeColor) {
|
||||||
|
emit tabTitleColorChangeRequested(tabIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TabWidget::eventFilter(QObject *obj, QEvent *event)
|
bool TabWidget::eventFilter(QObject *obj, QEvent *event)
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::MouseButtonDblClick)
|
QMouseEvent *e = reinterpret_cast<QMouseEvent*>(event);
|
||||||
|
if (e->button() == Qt::MidButton) {
|
||||||
|
if (event->type() == QEvent::MouseButtonRelease) {
|
||||||
|
// close the tab on middle clicking
|
||||||
|
int index = tabBar()->tabAt(e->pos());
|
||||||
|
if (index > -1){
|
||||||
|
removeTab(index);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event->type() == QEvent::MouseButtonDblClick)
|
||||||
{
|
{
|
||||||
QMouseEvent *e = reinterpret_cast<QMouseEvent*>(event);
|
|
||||||
// if user doubleclicks on tab button - rename it. If user
|
// if user doubleclicks on tab button - rename it. If user
|
||||||
// clicks on free space - open new tab
|
// clicks on free space - open new tab
|
||||||
int index = tabBar()->tabAt(e->pos());
|
int index = tabBar()->tabAt(e->pos());
|
||||||
@ -278,7 +305,7 @@ void TabWidget::removeTab(int index)
|
|||||||
// tabNumerator--;
|
// tabNumerator--;
|
||||||
setUpdatesEnabled(true);
|
setUpdatesEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
emit closeTabNotification();
|
emit closeTabNotification(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
renameTabsAfterRemove();
|
renameTabsAfterRemove();
|
||||||
@ -296,7 +323,7 @@ void TabWidget::removeCurrentTab()
|
|||||||
if (count() > 1) {
|
if (count() > 1) {
|
||||||
removeTab(currentIndex());
|
removeTab(currentIndex());
|
||||||
} else {
|
} else {
|
||||||
emit closeTabNotification();
|
emit closeTabNotification(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,6 +443,13 @@ void TabWidget::propertiesChanged()
|
|||||||
console->propertiesChanged();
|
console->propertiesChanged();
|
||||||
}
|
}
|
||||||
showHideTabBar();
|
showHideTabBar();
|
||||||
|
|
||||||
|
setTabsClosable(Properties::Instance()->showCloseTabButton);
|
||||||
|
|
||||||
|
// Update the tab widths
|
||||||
|
mTabBar->setLimitWidth(Properties::Instance()->limitTabWidth);
|
||||||
|
mTabBar->setLimitWidthValue(Properties::Instance()->limitTabWidthValue);
|
||||||
|
mTabBar->updateWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabWidget::clearActiveTerminal()
|
void TabWidget::clearActiveTerminal()
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "terminalconfig.h"
|
#include "terminalconfig.h"
|
||||||
#include "properties.h"
|
#include "properties.h"
|
||||||
|
|
||||||
|
class TabBar;
|
||||||
class TermWidgetHolder;
|
class TermWidgetHolder;
|
||||||
class QAction;
|
class QAction;
|
||||||
class QActionGroup;
|
class QActionGroup;
|
||||||
@ -57,6 +58,7 @@ public slots:
|
|||||||
void moveRight();
|
void moveRight();
|
||||||
void renameSession(int);
|
void renameSession(int);
|
||||||
void renameCurrentSession();
|
void renameCurrentSession();
|
||||||
|
void setTitleColor(int);
|
||||||
|
|
||||||
void switchLeftSubterminal();
|
void switchLeftSubterminal();
|
||||||
void switchRightSubterminal();
|
void switchRightSubterminal();
|
||||||
@ -89,8 +91,9 @@ public slots:
|
|||||||
void preset4Terminals();
|
void preset4Terminals();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void closeTabNotification();
|
void closeTabNotification(bool);
|
||||||
void tabRenameRequested(int);
|
void tabRenameRequested(int);
|
||||||
|
void tabTitleColorChangeRequested(int);
|
||||||
void currentTitleChanged(int);
|
void currentTitleChanged(int);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -111,6 +114,8 @@ private:
|
|||||||
int tabNumerator;
|
int tabNumerator;
|
||||||
/* re-order naming of the tabs then removeCurrentTab() */
|
/* re-order naming of the tabs then removeCurrentTab() */
|
||||||
void renameTabsAfterRemove();
|
void renameTabsAfterRemove();
|
||||||
|
|
||||||
|
TabBar *mTabBar;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -72,8 +72,8 @@ TermWidgetImpl::TermWidgetImpl(TerminalConfig &cfg, QWidget * parent)
|
|||||||
setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste);
|
setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste);
|
||||||
|
|
||||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)),
|
connect(this, &QWidget::customContextMenuRequested,
|
||||||
this, SLOT(customContextMenuCall(const QPoint &)));
|
this, &TermWidgetImpl::customContextMenuCall);
|
||||||
|
|
||||||
connect(this, &QTermWidget::urlActivated, this, &TermWidgetImpl::activateUrl);
|
connect(this, &QTermWidget::urlActivated, this, &TermWidgetImpl::activateUrl);
|
||||||
|
|
||||||
@ -85,6 +85,7 @@ void TermWidgetImpl::propertiesChanged()
|
|||||||
setColorScheme(Properties::Instance()->colorScheme);
|
setColorScheme(Properties::Instance()->colorScheme);
|
||||||
setTerminalFont(Properties::Instance()->font);
|
setTerminalFont(Properties::Instance()->font);
|
||||||
setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste);
|
setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste);
|
||||||
|
setTerminalSizeHint(Properties::Instance()->showTerminalSizeHint);
|
||||||
|
|
||||||
if (Properties::Instance()->historyLimited)
|
if (Properties::Instance()->historyLimited)
|
||||||
{
|
{
|
||||||
@ -99,6 +100,7 @@ void TermWidgetImpl::propertiesChanged()
|
|||||||
setKeyBindings(Properties::Instance()->emulation);
|
setKeyBindings(Properties::Instance()->emulation);
|
||||||
setTerminalOpacity(1.0 - Properties::Instance()->termTransparency/100.0);
|
setTerminalOpacity(1.0 - Properties::Instance()->termTransparency/100.0);
|
||||||
setTerminalBackgroundImage(Properties::Instance()->backgroundImage);
|
setTerminalBackgroundImage(Properties::Instance()->backgroundImage);
|
||||||
|
setBidiEnabled(Properties::Instance()->enabledBidiSupport);
|
||||||
|
|
||||||
/* be consequent with qtermwidget.h here */
|
/* be consequent with qtermwidget.h here */
|
||||||
switch(Properties::Instance()->scrollBarPos) {
|
switch(Properties::Instance()->scrollBarPos) {
|
||||||
@ -229,7 +231,8 @@ void TermWidgetImpl::paste(QClipboard::Mode mode)
|
|||||||
confirmation.setDetailedText(text);
|
confirmation.setDetailedText(text);
|
||||||
confirmation.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
confirmation.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||||
// Click "Show details..." to show those by default
|
// Click "Show details..." to show those by default
|
||||||
foreach( QAbstractButton * btn, confirmation.buttons() )
|
const auto buttons = confirmation.buttons();
|
||||||
|
for( QAbstractButton * btn : buttons )
|
||||||
{
|
{
|
||||||
if (confirmation.buttonRole(btn) == QMessageBox::ActionRole && btn->text() == QMessageBox::tr("Show Details..."))
|
if (confirmation.buttonRole(btn) == QMessageBox::ActionRole && btn->text() == QMessageBox::tr("Show Details..."))
|
||||||
{
|
{
|
||||||
@ -246,12 +249,7 @@ void TermWidgetImpl::paste(QClipboard::Mode mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: Support bracketedPasteMode
|
bracketText(text);
|
||||||
if (bracketedPasteMode())
|
|
||||||
{
|
|
||||||
text.prepend("\e[200~");
|
|
||||||
text.append("\e[201~");
|
|
||||||
}*/
|
|
||||||
sendText(text);
|
sendText(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -286,7 +284,8 @@ TermWidget::TermWidget(TerminalConfig &cfg, QWidget * parent)
|
|||||||
setLayout(m_layout);
|
setLayout(m_layout);
|
||||||
|
|
||||||
m_layout->addWidget(m_term);
|
m_layout->addWidget(m_term);
|
||||||
foreach (QObject *o, m_term->children())
|
const auto objs = m_term->children();
|
||||||
|
for (QObject *o : objs)
|
||||||
{
|
{
|
||||||
// Find TerminalDisplay
|
// Find TerminalDisplay
|
||||||
if (!o->isWidgetType() || qobject_cast<QWidget*>(o)->isHidden())
|
if (!o->isWidgetType() || qobject_cast<QWidget*>(o)->isHidden())
|
||||||
@ -297,9 +296,9 @@ TermWidget::TermWidget(TerminalConfig &cfg, QWidget * parent)
|
|||||||
|
|
||||||
propertiesChanged();
|
propertiesChanged();
|
||||||
|
|
||||||
connect(m_term, SIGNAL(finished()), this, SIGNAL(finished()));
|
connect(m_term, &QTermWidget::finished, this, &TermWidget::finished);
|
||||||
connect(m_term, SIGNAL(termGetFocus()), this, SLOT(term_termGetFocus()));
|
connect(m_term, &QTermWidget::termGetFocus, this, &TermWidget::term_termGetFocus);
|
||||||
connect(m_term, SIGNAL(termLostFocus()), this, SLOT(term_termLostFocus()));
|
connect(m_term, &QTermWidget::termLostFocus, this, &TermWidget::term_termLostFocus);
|
||||||
connect(m_term, &QTermWidget::titleChanged, this, [this] { emit termTitleChanged(m_term->title(), m_term->icon()); });
|
connect(m_term, &QTermWidget::titleChanged, this, [this] { emit termTitleChanged(m_term->title(), m_term->icon()); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,10 +118,12 @@ void TermWidgetHolder::saveSession(const QString & name)
|
|||||||
{
|
{
|
||||||
Session dump;
|
Session dump;
|
||||||
QString num("%1");
|
QString num("%1");
|
||||||
foreach(QSplitter *w, findChildren<QSplitter*>())
|
const auto ws = findChildren<QSplitter*>();
|
||||||
|
for(QSplitter *w : ws)
|
||||||
{
|
{
|
||||||
dump += '|' + num.arg(w->orientation());
|
dump += '|' + num.arg(w->orientation());
|
||||||
foreach (int i, w->sizes())
|
const auto sizes = w->sizes();
|
||||||
|
for (const int i : sizes)
|
||||||
dump += ',' + num.arg(i);
|
dump += ',' + num.arg(i);
|
||||||
}
|
}
|
||||||
Properties::Instance()->sessions[name] = dump;
|
Properties::Instance()->sessions[name] = dump;
|
||||||
@ -198,7 +200,7 @@ void TermWidgetHolder::directionalNavigation(NavigationDirection dir) {
|
|||||||
// Find an active widget
|
// Find an active widget
|
||||||
QList<TermWidget*> l = findChildren<TermWidget*>();
|
QList<TermWidget*> l = findChildren<TermWidget*>();
|
||||||
int ix = -1;
|
int ix = -1;
|
||||||
foreach (TermWidget * w, l)
|
for (TermWidget * w : qAsConst(l))
|
||||||
{
|
{
|
||||||
++ix;
|
++ix;
|
||||||
if (w->impl()->hasFocus())
|
if (w->impl()->hasFocus())
|
||||||
@ -230,7 +232,7 @@ void TermWidgetHolder::directionalNavigation(NavigationDirection dir) {
|
|||||||
int lowestX = INT_MAX;
|
int lowestX = INT_MAX;
|
||||||
int lowestMidpointDistance = INT_MAX;
|
int lowestMidpointDistance = INT_MAX;
|
||||||
TermWidget *fittest = NULL;
|
TermWidget *fittest = NULL;
|
||||||
foreach (TermWidget * w, l)
|
for (TermWidget * w : qAsConst(l))
|
||||||
{
|
{
|
||||||
NavigationData contenderDims = getNormalizedDimensions(w, dir);
|
NavigationData contenderDims = getNormalizedDimensions(w, dir);
|
||||||
int midpointDistance = std::min(
|
int midpointDistance = std::min(
|
||||||
@ -260,7 +262,8 @@ void TermWidgetHolder::clearActiveTerminal()
|
|||||||
|
|
||||||
void TermWidgetHolder::propertiesChanged()
|
void TermWidgetHolder::propertiesChanged()
|
||||||
{
|
{
|
||||||
foreach(TermWidget *w, findChildren<TermWidget*>())
|
const auto ws = findChildren<TermWidget*>();
|
||||||
|
for(TermWidget *w : ws)
|
||||||
w->propertiesChanged();
|
w->propertiesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,19 +360,17 @@ TermWidget *TermWidgetHolder::newTerm(TerminalConfig &cfg)
|
|||||||
{
|
{
|
||||||
TermWidget *w = new TermWidget(cfg, this);
|
TermWidget *w = new TermWidget(cfg, this);
|
||||||
// proxy signals
|
// proxy signals
|
||||||
connect(w, SIGNAL(renameSession()), this, SIGNAL(renameSession()));
|
connect(w, &TermWidget::renameSession, this, &TermWidgetHolder::renameSession);
|
||||||
connect(w, SIGNAL(removeCurrentSession()), this, SIGNAL(lastTerminalClosed()));
|
connect(w, &TermWidget::removeCurrentSession, this, &TermWidgetHolder::lastTerminalClosed);
|
||||||
connect(w, SIGNAL(finished()), this, SLOT(handle_finished()));
|
connect(w, &TermWidget::finished, this, &TermWidgetHolder::handle_finished);
|
||||||
// consume signals
|
// consume signals
|
||||||
|
|
||||||
connect(w, SIGNAL(splitHorizontal(TermWidget *)),
|
connect(w, static_cast<void (TermWidget::*)(TermWidget *self)>(&TermWidget::splitHorizontal),
|
||||||
this, SLOT(splitHorizontal(TermWidget *)));
|
this, &TermWidgetHolder::splitHorizontal);
|
||||||
connect(w, SIGNAL(splitVertical(TermWidget *)),
|
connect(w, static_cast<void (TermWidget::*)(TermWidget *self)>(&TermWidget::splitVertical),
|
||||||
this, SLOT(splitVertical(TermWidget *)));
|
this, &TermWidgetHolder::splitVertical);
|
||||||
connect(w, SIGNAL(splitCollapse(TermWidget *)),
|
connect(w, &TermWidget::splitCollapse, this, &TermWidgetHolder::splitCollapse);
|
||||||
this, SLOT(splitCollapse(TermWidget *)));
|
connect(w, &TermWidget::termGetFocus, this, &TermWidgetHolder::setCurrentTerminal);
|
||||||
connect(w, SIGNAL(termGetFocus(TermWidget *)),
|
|
||||||
this, SLOT(setCurrentTerminal(TermWidget *)));
|
|
||||||
connect(w, &TermWidget::termTitleChanged, this, &TermWidgetHolder::onTermTitleChanged);
|
connect(w, &TermWidget::termTitleChanged, this, &TermWidgetHolder::onTermTitleChanged);
|
||||||
|
|
||||||
return w;
|
return w;
|
||||||
@ -423,7 +424,8 @@ QDBusObjectPath TermWidgetHolder::getActiveTerminal()
|
|||||||
QList<QDBusObjectPath> TermWidgetHolder::getTerminals()
|
QList<QDBusObjectPath> TermWidgetHolder::getTerminals()
|
||||||
{
|
{
|
||||||
QList<QDBusObjectPath> terminals;
|
QList<QDBusObjectPath> terminals;
|
||||||
foreach (TermWidget* w, findChildren<TermWidget*>())
|
const auto ws = findChildren<TermWidget*>();
|
||||||
|
for (TermWidget* w : ws)
|
||||||
{
|
{
|
||||||
terminals.push_back(w->getDbusPath());
|
terminals.push_back(w->getDbusPath());
|
||||||
}
|
}
|
||||||
|
2
src/third-party/qxtglobalshortcut_x11.cpp
vendored
2
src/third-party/qxtglobalshortcut_x11.cpp
vendored
@ -134,7 +134,7 @@ public:
|
|||||||
{
|
{
|
||||||
QxtX11ErrorHandler errorHandler;
|
QxtX11ErrorHandler errorHandler;
|
||||||
|
|
||||||
foreach (quint32 maskMods, maskModifiers) {
|
for (const quint32& maskMods : qAsConst(maskModifiers)) {
|
||||||
XUngrabKey(display(), keycode, modifiers | maskMods, window);
|
XUngrabKey(display(), keycode, modifiers | maskMods, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user