make deployment easier; like katepart or okularpart the ideal
is that just the .so is enough to work
This is just the start, will need to bundle more parts.
At the moment even many keys don't work if you just bundle the part.
Like Kate, one should not try to use DBus on platform that not
support it. At the moment we have hacks in the Craft blueprints
to avoid the worst, but not using it is much nicer.
If the user wants to compile it, we have a USE_DBUS CMake option.
Methods implmented allow for:
1. retrieval of layout information encoded in a string
2. getting size proportions of a splitter's direct child widgets
3. setting the size proportions of a splitter's direct child widgets
4. simple splitting of a view horizontally or vertically
5. using existing widgets to create a splitter at a specified position under a splitter
6. moving an existing view to a specified position under a splitter
7. moving an existing splitter to a specified position under a splitter
8. switching focus to an existing view
See documentation in source files for more details.
BUG: 465448
This aims to duplicate the feature "scaled_zoom" of Terminator. This way
of expanding the current terminal is only useful for split views that
have both horizontal and vertical splits, i.e. where the individual
terminal view is smaller than the window in both directions.
The default shortcut is Ctrl+Shift+Z. It is usually bound to Redo, but
since there's no Undo or Redo in terminals, this doesn't actually clash
here.
The magic constant 0.97 comes from Terminator, although in Terminator
the scale factor is calculated using the new number of columns/lines
after resizing, while this commit bases the font size on the sizes in
pixels. In the commit message that introduced the magic value in
Terminator, it is explained as "just more natural", and it seems to work
here too, unlike the vertical magical constant of 1.05. This is all
mostly guesswork, though, as font sizes aren't an exact science - not
even the aspect ratio is guaranteerd to remain the same between font
sizes, just like the aspect ratio before and after maximizing could be
different in the terminal.
* speeds up incremental builds as changes to a header will not always
need the full mocs_compilation.cpp for all the target's headers rebuild,
while having a moc file sourced into a source file only adds minor
extra costs, due to small own code and the used headers usually
already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
resulting in those quickly processed, while the minor extra cost of the
sourced moc files does not outweigh that in summary.
Measured times actually improved by some percent points.
(ideally CMake would just skip empty mocs_compilation.cpp & its object
file one day)
* enables compiler to see all methods of a class in same compilation unit
to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
moc code being sourced into the cpp file there definitions can be ensured
and often are already for the needs of the normal class methods
Split horizontal/vertical/auto from next tab acts like the usual split view
but takes the first session of the next tab, instead of creating a new
session. This allows for merging two separate tabs into a single tab.
Adds a "Show session" button to notifications, which, when clicked, will
focus the originating session.
Original patch by Kasper Laudrup at bug 305162, then updated by Martin
T. H. Sandsmark.
Now updated and extended to silence/activity/process termination
notifications, adding support for focusing a TerminalDisplay inside a
hierarchy of ViewSplitters inside a TabbedViewContainer, and using
KWindowSystem::forceActiveWindow() instead of ::activateWindow().
BUG: 305162
BUG: 344208
The split-view actions define a shortcut using `Konsole::ACCEL`, which
since !609 expands to `Qt::CTRL | Qt::SHIFT` on systems that aren't
macOS. This breaks the shortcut for the split-view actions however as
`Qt::Key_ParenLeft` and `Qt::Key_ParenRight` do not work with the
`Qt::SHIFT` modifier.
Using `Qt::CTRL` (Cmd on macOS, Ctrl everywhere else) as the base
accelerator for these two actions makes splitting views work again as
expected.
This change removes some application attributes that are not necessary anymore (like disabling the global menu bar) or make Konsole behave slightly different when used from a KPart (e.g. inside Kate), and changes some keyboard shortcuts around (mainly using Command instead of Ctrl+Shift now.)
Unfortunately this does not resolve the requirement for the special keytab file for macOS; it looks like Qt does something funny with the QKeyEvents here: on Linux these have a `text` attribute set to e.g. `\u0003` for `^C`, that attribute is empty on macOS.
Note this could impact shortcut changes on non-macOS systems.
This got broken in 3b58e4a9ac when
multiple shortcut sequences were added to a single QKeySequence object,
rather than having a list with multiple QKeySequences in it. As a
result, the single QKeySequence object discarded all sequences after
the first, so the Ctrl+PageUp/PageDown shortcuts got discarded.
- Port QStringRef to QStringView (using Q5StringRef::toInt() because
Q5StringView::toInt() uses toString() internally to get a QString
which defeats the point of using a view)
- Fix creating a QKeySequence from OR'ing Qt::Key and Qt::Modifiers by
explicitly constructing a QKeySequence; IIUC, this is due to the two
values coming from two different enums:
"cannot convert ‘QIncompatibleFlag’ to ‘const QKeySequence&’"
- Implicit cast from int to QChar is gone in Qt6
- Implicit cast of QString to QFileInfo is gone in Qt6
- Create a QByteArray to make QStringBuilder work
- QHash::const_iterator can't be used in place of a
QMultiHash::const_iterator
Here how it looks like: https://imgur.com/a/uaMQvT6
Before, it was impossible to resize the splits
with the same size in case they were manually resized.
I have added a new button menu for doing so:
in View -> Split View -> Equal size to all views.
First I wanted to make this as a plugin,
but since I thought it could make splits a bit more useful,
I decided to merge it not as a plugin but internally.
GUI: Menu -> View -> Split View -> Equal size to all views
CHANGELOG: Added equal size to all split views.
When closing an inactive tab with splits, focusAnotherTerminal() was not
transferring focus to any TerminalDisplay, resulting in having no active
session on ViewManager, which would then crash when splitting the view.
BUG: 446830
Adds a missing signal/slot connection for when a split-view is drag-and-
dropped to a new window. Use an existing method to handle it the same
way as drag-and-dropping or detaching a tab.
BUG: 442238
Maximized views must be un-maximized before certain actions:
- detach view
- split view
- move to new tab
- close
This commit fixes the toggle state getting out of sync after those
actions, adds the un-maximize step for splitting a maximized view,
and reduces code duplication by adding ViewSplitter::clearMaximized(),
For now, clearMaximized() does need to be called manually: we want the
display restored before the removal, but ViewSplitter handles removals
after the fact with QEvent::ChildRemoved.
Other signals are received too early when closing tabs.
ViewContainer::viewRemoved is received after the tab count has been
updated.
Protect against the "detach-tab" action when only one left.
Fixes the following behavior:
- Create two tabs
- Close one tab
- Detach the remaining tab through menu or shortcut
- The original window is blank - no terminal display. Adding a tab
to it crashes
Also uses weak pointers in the cache in ViewManager, to avoid having
them loaded for longer than necessary.
It takes less than a millisecond to load them, and it is nice to pick up
new changes from disk. But we don't want to do it for those currently
used by code elsewhere, so we still cache them with a weak_ptr that will
expire once all other code is done with it.
The buttons have very long labels, which made the window too wide
or caused the toolbar to display a disclosure button to show all the
options.
This moves those buttons into a "Split View" toolbar button, which
fixes those issues and looks much nicer.
BUG: 437555
TabbedNavigation is when we have a MainWindow, i.e. the typical use case;
whereas NoNavigation is when using Konsole Part. The code in Part calls
setNavigationMethod(NoNavigation), so things should work as before.
I made a wrong assumption that TabbedNavigation was already the default.
CCBUG: 432077
empty() is emitted so that MainWindow calls close() and we get rid of the
colours-flashing bug when closing the last session/tab in a window, see
commit bbec72250d. However all that isn't relevant when we are in
konsole Part mode, where there are no tabs or MainWindows.
This fixes a crash in Dolphin when closing its window while the embedded
Konsole Part is open. The crash would happen as calling
ViewContainer::currentTabViewCount() would end up in the ViewSplitter code
path, which is no-op in Konsole Part.
To test:
- Open dolphin, make sure the terminal panel isn't open to begin with
- open the terminal panel
- close the dolphin window while the terminal panel is open
BUG: 441206
FIXED-IN: 21.08.1
When closing a session, we check if that is the last tab, and make the code
close the whole window, but we also need to make sure it's the last view,
i.e. no split views.
CCBUG: 440976
FIXED-IN: 21.12
There are two scenarios when closing a window:
A) clicking the close button on the title bar (or Ctrl+Shift+Q):
~MainWindow()
~ViewManager()
~TabbedViewContainer()
~TerminalDisplay()
~Session()
B) closing the last session/tab in a window:
SessionController::sessionFinished()
~Session()
~TerminalDisplay()
~TabbedViewContainer()
~MainWindow()
~ViewManager()
the issue with the second case is that the TerminalDisplay is torn down
first, which exposes the TabbedViewContainer widget, the latter has the same
Qt::Window colour as the system colour scheme window background colour, if
you're using a dark terminal colour scheme and a light-coloured system colour
scheme, you could see some "flashing" when you close the last session with
e.g. Ctrl+D.
To fix this, in sessionFinished() check if TabbedViewContainer::count() is
1 (i.e. closing last tab/session), and emit the empty() signal in that case,
which is connected to MainwWindow::close(), then the order of tear down
becomes:
SessionController::sessionFinished()
~Session()
~MainWindow()
~ViewManager()
~TabbedViewContainer()
~TerminalDisplay()
BUG: 432077
FIXED-IN: 21.12
Looking at the crash backtraces from the bug reports, it seems this is what
happens, when you have two tabs open, then click the close button on the
non-current tab:
- QTabBar::currentChanged() is emitted, the TerminalDisplay pointer is
still not null at this point (the code checks for that)
- TabbedViewContainer::currentTabChanged()
- TabbedViewContainer::activeViewChanged()
- ViewManager::activateView(), at this point the TerminalDisplay pointer
could be null, which then crashes when we call Widget::setFocus()
BUG: 411962
FIXED-IN: 21.12
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).