Commit Graph

380 Commits

Author SHA1 Message Date
Lucas Biaggi
29e86ddeb7 Add ability to load/save session layouts(split views) and add default layouts
Add three layouts to the toolbar; add --layout <file> to the command line.
The 3 defaults layouts are 2x2, 2x1, 1x2

GUI:
2021-04-24 21:30:11 +00:00
Carlos Alves
34f85cecea Fix Bookmark all tabs as a folder crash
The list of active sessions needs to be refreshed when a session is
destroyed. It was being refreshed only on creation.

BUG: 432327
FIXED-IN: 21.04
2021-03-07 20:50:10 +00:00
Jonathan Marten
a3c318dcc9 Fix view splitter actions not being updated when a view is closed
This happens because in ViewManager::sessionFinished(),
the 'view' is delayed deleted which means that it is not removed
from its containing splitter until the next event.  However,
toggleActionsBasedOnState() is called immediately which makes its
decisions based on the current splitter state with the view still
present.

In order to avoid any possible object lifetime issues caused by
changing the way the view is deleted, or trying to remove it from the
view immediately, the call of toggleActionsBasedOnState() is instead
delayed until the view has been destroyed (and therefore removed from
its splitter).
2021-02-21 18:58:24 +00:00
Ahmad Samir
d06ea23903 Use Q_EMIT instead of emit
In C++20 there are new classes that have member functions named emit().
c.f.:
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
https://en.cppreference.com/w/cpp/io/basic_osyncstream/emit

A similar change was done in the Frameworks:
https://invent.kde.org/frameworks/kio/-/merge_requests/315
2021-02-15 23:52:07 +00:00
Tomaz Canabrava
050ca17b54 Remove unused signal 2021-01-25 09:21:21 +00:00
Christian Schärf
c695c9b206 Move connecting and disconnecting TerminalDisplays into separate function to avoid code duplication. 2021-01-02 14:26:41 +00:00
Tomaz Canabrava
dcb23b6174 Revert "Remove RandomSeed on TerminalDisplay."
This reverts commit fa4bd94d84.

Crashes PartTest
2020-12-14 14:44:51 +00:00
Gustavo Carneiro
fa4bd94d84 Remove RandomSeed on TerminalDisplay. 2020-12-14 14:26:07 +00:00
Edwin Pujols
5729e67120 ViewManager: Fix warnings about mixing operators. 2020-12-10 18:22:10 -04:00
Laurent Montel
8242763fb3 operator+/- is disabled for QFlags in qt6 2020-12-09 07:57:05 +01:00
Tomaz Canabrava
44fd6c0be1 Revert "Uses SessionDisplayConnection to connect sessions and displays."
This reverts commit 6971d53186.
2020-11-13 17:10:30 +00:00
Kurt Hindenburg
78a0092522 Convert src to use SPDX license/copyright
https://community.kde.org/Policies/Licensing_Policy#SPDX_Statements
https://community.kde.org/Guidelines_and_HOWTOs/Licensing
2020-11-12 22:17:06 -05:00
Carlos Alves
358697bea4 Fix dbus sessionList
Order the list by tab order.

ISSUE: #13
FIXED-IN: 20.12
2020-11-10 14:17:52 -03:00
Carlos Alves
5f006d89af Fix dbus setCurrentSession focus
It was only giving focus to terminal but not the tab.

BUG: 422262
FIXED-IN: 20.12
2020-11-10 14:17:37 -03:00
Gustavo Carneiro
6971d53186 Uses SessionDisplayConnection to connect sessions and displays. 2020-10-11 20:43:56 +00:00
Gustavo Carneiro
5c9c22fab3 Move TerminalDisplay to terminalDisplay folder. 2020-10-07 03:12:43 +00:00
Tomaz Canabrava
fbe5742365 Add new static lib: konsolecolorscheme 2020-07-29 16:21:36 +02:00
Tomaz Canabrava
0478529c6f Move Profile related classes to it's own folder
This also allowed me to remove a few includes of Profile.h
around the codebase, that used Profile::Ptr. now the compilation
is a bit faster and also does not recompile things as often.
2020-07-27 19:14:53 +02:00
Gustavo Carneiro
9b2e9731e0 move Session files to a new folder. 2020-07-15 09:30:42 +00:00
Gustavo Carneiro
b5fbbd81c7 Move widgets to a new folder. 2020-07-12 12:33:39 +00:00
Axel Navarro
57c942d91b Add default shortcut to switch-to-tab-9 action
Add the missing Alt+0 shortcut to the 10th tab to complete the range
from Alt+1 to Alt+0 in the keyboard
2020-06-15 17:02:21 +00:00
Axel Navarro
020f565572 Fix shortcuts for Yakuake grow-terminal actions
Add the move-tab-to-right and move-tab-to-left actions in
ViewManager to the _multiTabOnlyActions collection to allow
override them in Yakuake with grow-terminal-right and
grow-terminal-left

BUG: 415164
2020-06-13 20:01:41 -03:00
Axel Navarro
0c3240a1be Fix override switch-to-tab action in Yakuake
Add the switch-to-tab-%i actions in ViewManager to the
_multiTabOnlyActions collection to allow override them in Yakuake

BUG: 420503
(cherry picked from commit 13697e07d9)
2020-06-02 09:11:35 -04:00
Kurt Hindenburg
9a80c74bff Fix some implicit-bool-conversions 2020-05-10 15:12:27 -04:00
Luca Weiss
eaef61e1c4 Add DBus call setDefaultProfile() to ViewManager
This allows the user to set the default Konsole profile via D-Bus.

Differential Revision: https://phabricator.kde.org/D29236
2020-04-30 10:27:10 -04:00
Gaston Haro
7cfbb8bb16 Better accesibility to maximize view
Summary:
- Added handlig of mouse double click on view header bar to toggle
  maximize.
- Added menu entry under View -> Split view, Toogle maximize view

Test plan:
A.1. Open Konsole and create split views
A.2. Double clicking a view header should toggle maximize/restore the view
B.1. Open Konsole and create split views
B.2. Go to menu View -> Split view -> Toggle maximize view
2020-04-13 13:47:50 +00:00
Mariusz Glebocki
9ee21b9c62 Report TerminalDisplay focus when any of its children is focused
Focused TerminalDisplay is used as a source of tab and window name,
for activity monitoring, splits headers highlighting, etc.
With this change TerminalDisplay is considered focused even when actual
focus is e.g. in its search box or popup menu.
2020-04-10 13:51:07 -04:00
Kurt Hindenburg
a889f6aa4b Remove shortcut for detach tab
Currently the shortcut is Ctrl+Shift+L which is close too
Ctrl+Shift+K.  Ideally we want detach tab to not be a shortcut that can
be accidently pressed.

See https://invent.kde.org/kde/konsole/-/issues/6
2020-03-31 12:46:30 -04:00
Kurt Hindenburg
ab0636de8a Q_UNUSED() does not need semi-colon at end 2020-03-28 14:06:25 -04:00
João Eudes Lima
f476e936ea Remove un-needed includes 2020-03-28 13:38:44 -04:00
Andrew Hou
8f25012b42 Implements default keyboard shortcuts for tab navigation (alt+n)
BUG: 416362
2020-02-29 03:04:35 -06:00
Mariusz Glebocki
52d2720007 Revert "GIT_SILENT: minor qstring optimization"
This reverts commit f96deb39aa.

This was anti-optimization.
QStringLiteral is a QString created at build time. Initialization of
QString with it has no overhead.
QLatin1String is 8 bit C string wrapper which needs run-time conversion
to 16 bit encoding used in QString.
2019-12-17 21:04:14 -05:00
Ahmad Samir
5f60bc5a6f Replace foreach (deprecated) with range-for
The code compiles and konsole seems to work as bofore.
2019-12-03 11:29:31 +02:00
Kurt Hindenburg
30f64c8a21 Fix loop anaylysis issue
warning: loop variable 'widgetJsonValue' is always a copy because the
range of type 'QJsonArray' does not return a reference
2019-11-24 19:58:59 -05:00
Alex Miranda
bbdf27cc9f Add missing setFocusProxy() call in ViewManager
Summary:
This should fix the terminal not gaining focus when using konsolepart.

BUG: 411181
FIXED-IN: 19.12.0

Test Plan:
- The terminal panels in Dolphin and Kate now always gain focus
properly, not just the first time you open them

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D25001
2019-11-02 11:17:30 -04:00
Mariusz Glebocki
51bcb2ebd4 Reduce code duplication in session creating code 2019-10-27 02:38:12 +01:00
Mariusz Glebocki
a16a6189ef Start new splits in same directory as current session
Works only when feature's option in profile settings is enabled.

BUG: 411332
2019-10-27 02:35:47 +01:00
Mariusz Glebocki
d7313b1083 Simplify setCurrentSession() 2019-10-27 02:35:47 +01:00
Mariusz Glebocki
2cda4fb1f3 Fix currentSession() 2019-10-27 02:35:27 +01:00
Jiří Paleček
2de43394c9 Allow loading of pre 19.08 session files
The format of the Konsole session file changed with 19.08. This was
overlooked and pre 19.08 files caused crashes.  That crash was fixed
in 19.08.1 to just start the default profile.
This patch will allow pre 19.08 session files to be loaded correctly.

BUG: 412173
FIXED-IN: 19.08.2
2019-10-06 10:31:43 -04:00
Laurent Montel
f96deb39aa GIT_SILENT: minor qstring optimization 2019-09-07 13:33:09 +02:00
Jiří Paleček
656f6804ea Fix the fallback code used when restoring session fails
Summary:
 When restoring session in Konsole fails, the fallback code should
 create a default view and session instead. However, the code omitted
 adding this view to the container, which makes

 - the window black (or grey in my case), see
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935031

 - konsole crash later, when you add a new tab and close it, because
   code in ViewManager expects TerminalDisplays to be children of
   ViewSplitter, which is not the case

 This fix adds the view to activeController(), just like every other
 code that creates TerminalDisplay.

Test Plan:
 1. find a session in your $HOME/.config/session/ from konsole before 19.08
 2. konsole -session xxxx (where xxxx are the numbers in the session file)
    -> there should be a konsole window with usable terminal
 3. add a new tab with C-S-T and close it
    ->there should be no crash

Reviewers: hindenburg, #konsole

Reviewed By: hindenburg, #konsole

Subscribers: tcanabrava, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D23601
2019-09-01 18:45:54 -04:00
Kurt Hindenburg
2339f20cca config-konsole.h is not installed; krazy has been fixed 2019-08-28 08:48:07 -04:00
Laurent Montel
ef1beaab86 Remove unused includes 2019-08-23 08:09:17 +02:00
Mariusz Glebocki
dc29be39a6 Keep perceived contrast in random background color
Summary:
Randomize colors using HSLuv color space instead of HSL. It has
perceptually uniform lightness, which means every color with the same
lightness value is perceived as equally bright by humans. Displays
quality and lack of calibration in most monitors lowers this uniformity,
but even on worst color display it should be better than standard HSL.

More information about HSLuv: http://www.hsluv.org/

Minor changes:

* Random seed takes PID into account to prevent repeated colors in
  separate Konsole processes
* Key names in a config were changed
* Adapted "Black on random light" color scheme

Breeze with random ranges on default bg and fg: hue=360° saturation=100:
{F6754773}

To be done in future:

* Automatically convert color schemes which use old randomization
  method.

Reviewers: #konsole, #vdg

Subscribers: hindenburg, #vdg, #konsole

Tags: #konsole, #vdg

Differential Revision: https://phabricator.kde.org/D20263
2019-08-17 16:00:45 -04:00
Kurt Hindenburg
3824de3e4f Fix dbus newSession() three methods to work
CCBUG: 410469
FIXED-IN: 19.08
2019-08-05 10:12:15 -04:00
Kurt Hindenburg
26fa796074 Use empty() instead of size() for emptiness 2019-07-17 11:07:24 -04:00
Kurt Hindenburg
2043b03e51 Use auto to avoid duplicating the type name 2019-07-17 09:32:16 -04:00
Kurt Hindenburg
ccc4c2eee6 Fix readability-implicit-bool-conversion issues 2019-07-16 20:58:53 -04:00
Kurt Hindenburg
103ba229f8 Use Q_UNUSED() 2019-07-11 21:50:04 -04:00