Commit Graph

6920 Commits

Author SHA1 Message Date
Kurt Hindenburg
9c19368ce5 Remove leading/trailingWhitespace() - they were never used 2019-08-28 11:06:22 -04:00
Kurt Hindenburg
d0ae598348 Remove currentBookmarkList() - hasn't been used in years 2019-08-28 10:25:41 -04:00
Kurt Hindenburg
0995c1dc95 Remove supportsTabs() - hasn't been used in years 2019-08-28 10:07:43 -04:00
Kurt Hindenburg
ec1c08c4ed hotSpotsAtLine() has not been used in years 2019-08-28 09:50:28 -04:00
Kurt Hindenburg
2339f20cca config-konsole.h is not installed; krazy has been fixed 2019-08-28 08:48:07 -04:00
Kurt Hindenburg
8ce959ab6c Use QThread::sleep instead of sleep/usleep 2019-08-27 23:12:13 -04:00
Kurt Hindenburg
490f174c22 Correct parameter's names 2019-08-27 22:53:10 -04:00
Kurt Hindenburg
3b4f835ebb Initialize variable in constructor (coverity/cppcheck) 2019-08-27 21:58:11 -04:00
Kurt Hindenburg
f121ecd24a Use std::any_of instead of loop 2019-08-27 21:40:41 -04:00
Mariusz Glebocki
616f5554b1 Restore "Show 'new tab' button" option in Konsole Settings
BUG: 411158
FIXED-IN: 19.12

https://invent.kde.org/kde/konsole/merge_requests/24
2019-08-25 10:18:37 -04:00
Mariusz Glebocki
7e701cf4b2 Reactivate previously active window after flags change 2019-08-25 11:15:23 +02:00
Mariusz Glebocki
b88e677bfb Apply new window flags only when necessary
Applying settings in Configure Konsole dialog was causing every Konsole
window to be hidden and shown again. This was leading to information
related to window management (window state, desktop, position/display,
etc.) to be lost - windows were appearing on current display, current
desktop, at new positions.

The hide/show action is triggered by setting window flags. Only "remove
window titlebar and frame" option really changes the flags, so it is
pointless to set them again in other cases. Now, flags are not set when
they are the same as current ones.

Additionally, when "remove window titlebar and frame" option is changed
and new flags are different, windows' positions and displays are
restored. Other properties are still being lost.

Test cases
----------

* Open a few Konsole windows, put them on different desktops and
  at different positions.
* Open Configure Konsole dialog, change any option different than
  "remove window titlebar and frame".
* Apply

**Before**

Konsole windows have been moved to current display and current desktop.
Their positions have changed. The configuration window has been placed
under them.

**After**

The side effects mentioned above do not occur.

---

* Open a few Konsole windows, put them on different desktops and at
  different positions.
* Open Configure Konsole dialog, change "remove window titlebar and
  frame" option.
* Apply

**Before**

Konsole windows' titlebar and frame became visible/invisible.
The windows have been moved to current desktop. Both their positions
and display have changed. The configuration window has been placed
under them.

**After**

Like before, except windows' position and display - they are restored
now.
2019-08-25 11:15:23 +02:00
Kurt Hindenburg
1852b6bae7 Add note about duplicates in sub-folders 2019-08-24 15:13:57 -04:00
Martin T. H. Sandsmark
befaaa0255 Do not allow adding duplicates in bookmarks
This currently only catches bookmarks in top-level (ie not sub-folders)

Original code by Tomaz Canabrava <tcanabrava@kde.org>

BUG: 408939
FIXED-IN: 19.12

https://invent.kde.org/kde/konsole/merge_requests/8
2019-08-24 15:12:46 -04:00
Kurt Hindenburg
2304631056 Correct parameter documentation 2019-08-24 14:19:26 -04:00
Kurt Hindenburg
a7303156f2 use 'using' instead of 'typedef' 2019-08-24 14:03:00 -04:00
Kurt Hindenburg
a4818f0b8e avoid repeating the return type; use a braced initializer list instead 2019-08-24 14:00:32 -04:00
David Faure
f8d0b14f9a Port to non-deprecated KWindowSystem::unminimizeWindow
The bool is ignored since KF 5.0
2019-08-24 12:16:38 +02:00
Kurt Hindenburg
6943a31745 Explicitly add data type s/unsigned/unsigned int/ 2019-08-23 08:52:26 -04:00
Raphael Rosch
08931fbd33 Tweak tab title options: home and Bourne prompt sigils
Add the home sigil "~" for short cwd (it was only present for long cwd
for some reason), and the Bourne prompt sigils "$" (for regular user)
and "#" for superuser as the variable %B.

https://invent.kde.org/kde/konsole/merge_requests/19
2019-08-23 08:49:08 -04:00
Yuri Chornoivan
4d5d728163 Compile 2019-08-23 13:37:00 +03:00
Laurent Montel
ef1beaab86 Remove unused includes 2019-08-23 08:09:17 +02:00
Kurt Hindenburg
9a37e0b265 Correct include guard name 2019-08-22 10:45:26 -04:00
Kurt Hindenburg
eb57ab7cdb hsluv add copyright emails - taken from their github repos 2019-08-19 22:12:33 -04:00
Kurt Hindenburg
82bca348c2 Merge branch 'konstantink/konsole-small-cleanup' 2019-08-18 17:20:04 -04:00
Kurt Hindenburg
62a5f1d794 Fix crash on "Close Current Tab" handling
Summary:
_pluggedController disconnection happens  when session is closed
by closeInNormalWay or closeInForceWay and calling
disconnectController leads to Konsole crash.   Also a case when
closeInNormalWay is false was not considered.

BUG: 410607
FIXED-IN: 19.08.1

Test Plan:
1. Open Konsole
2. Open one more tab
3. Try to close Konsole
4. Pick option "Close Current Tab" (assuming you have not check
    'Do not ask again')

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D23246
2019-08-18 16:51:41 -04: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
74a0121422 Add note about depreciated width() 2019-08-17 11:03:10 -04:00
Kurt Hindenburg
9baecd7417 Merge branch 'arcpatch-D23144' 2019-08-17 10:33:28 -04:00
Frederik Gladhorn
6a06431962 Port from QFontMetrics::width() to boundingRect().width()
Summary:
In all the cases that were changed, the bounding rect is needed. A few
places were not ported, since they need more careful investigation.
This reduces deprecation warnings.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D23144
2019-08-17 10:25:20 -04:00
l10n daemon script
5de30edf19 GIT_SILENT made messages (after extraction) 2019-08-17 02:30:39 +02:00
Kurt Hindenburg
83ea331675 Merge branch 'arcpatch-D23143' 2019-08-16 12:08:32 -04:00
Frederik Gladhorn
6029f813f7 Use QCommandLineOption::HiddenFromHelp instead of deprecated API
Summary: setHidden has been deprecated since Qt 5.8.

Reviewers: #konsole

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D23143
2019-08-16 12:04:52 -04:00
Andrey Yashkin
276a6dca66 In confirm close dialog, remove 'close current tab' option
Summary:
When there is only one tab and a process is running, remove the
'close current tab' option when attempting to close Konsole.

Test Plan:
1. Open Konsole (assuming you have not check 'Do not ask again')
2. Start any process (ie top)
3.  Try to close Konsole

Should only be 2 options,  'Close window' and 'Cancel'

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, ngraham, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D23146
2019-08-16 11:48:39 -04:00
Laurent Montel
2da796b62a Ignore some files 2019-08-16 13:47:20 +02:00
Konstantin Kharlamov
d5d8496cd2 Use RAII to manage QApplication memory
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-08-13 13:58:26 +03:00
l10n daemon script
5f141c16ab GIT_SILENT made messages (after extraction) 2019-08-10 02:29:47 +02:00
Konstantin Kharlamov
0107e68e22 Fix focus getting stuck in menu when XDG_CURRENT_DESKTOP ≠ kde
When XDG_CURRENT_DESKTOP ≠ kde, perssing and immediately releasing Alt
key makes focus get stuck in menu. Fix this by overriding QProxyStyle.

This does not influence menu accelerators (e.g. Alt+f to access "File" in
menu), which continue working according to user settings.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>

BUG: 410641
FIXED-IN: 19.08
Differential Revision: https://phabricator.kde.org/D22980
2019-08-07 10:22:37 -04:00
Kurt Hindenburg
ac9ccc9483 Merge branch 'mglebocki/konsole-Mark-intended-int-division-in-double-context' 2019-08-05 22:18:20 -04:00
Kurt Hindenburg
a8d152f11e Merge branch 'mglebocki/konsole-Split-tab-bar-configuration-into-tabs' 2019-08-05 22:05:30 -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
841397f3b0 Remove accelerators from tabs when pressing ALT
Disable creating automatic mnemonic keys via QAbstractButton.

BUG: 410488
FIXED-IN: 19.08
2019-08-05 09:40:52 -04:00
Friedrich W. H. Kossebau
5332cca5b1 Remove explicit use of ECM_KDE_MODULE_DIR, is part of ECM_MODULE_PATH
GIT_SILENT
2019-08-02 23:57:28 +02:00
Mariusz Glebocki
c5ed6009ab Mark intended integer division in double context
Fixes a problem detected by Coverity Scan.

Coverity Scan log (relevant part)
---------------------------------

```
(...)

*** CID 241675: (UNINTENDED_INTEGER_DIVISION)
/zpool/projects/Devel/KDE/src/konsole/src/TerminalDisplay.cpp: 728
in Konsole::TerminalDisplay::drawCursor(QPainter &, const QRect &,
const QColor &, const QColor &, bool &)()

722 painter.setPen(cursorColor);
723 724 if (_cursorShape == Enum::BlockCursor) {
725 // draw the cursor outline, adjusting the area so that
726 // it is draw entirely inside 'rect'
727 int penWidth = qMax(1, painter.pen().width());

CID 241675: (UNINTENDED_INTEGER_DIVISION)
Dividing integer expressions "penWidth" and "2", and then converting
the integer quotient to type "double". Any remainder, or fractional
part of the quotient, is ignored.

728 painter.drawRect(cursorRect.adjusted(penWidth / 2 + 0.5,
729 penWidth / 2 + 0.5,
730 - penWidth / 2 - penWidth % 2 + 0.5,
731 - penWidth / 2 - penWidth % 2 + 0.5));
732 733 // draw the cursor body only when the widget has focus

/zpool/projects/Devel/KDE/src/konsole/src/TerminalDisplay.cpp: 729
in Konsole::TerminalDisplay::drawCursor(QPainter &, const QRect &,
const QColor &, const QColor &, bool &)()

723 724 if (_cursorShape == Enum::BlockCursor) {
725 // draw the cursor outline, adjusting the area so that
726 // it is draw entirely inside 'rect'
727 int penWidth = qMax(1, painter.pen().width());
728 painter.drawRect(cursorRect.adjusted(penWidth / 2 + 0.5,

CID 241675: (UNINTENDED_INTEGER_DIVISION)
Dividing integer expressions "penWidth" and "2", and then converting
the integer quotient to type "double". Any remainder, or fractional
part of the quotient, is ignored.

729 penWidth / 2 + 0.5,
730 - penWidth / 2 - penWidth % 2 + 0.5,
731 - penWidth / 2 - penWidth % 2 + 0.5));
732 733 // draw the cursor body only when the widget has focus
734 if (hasFocus()) {

(...)
```
2019-08-02 16:52:45 +02:00
Mariusz Glebocki
4793cafab6 Split tab bar configuration into two pages 2019-08-01 11:33:10 +02:00
Mariusz Glebocki
81636246ba Search for managed QButtonGroups recursively 2019-08-01 11:16:40 +02:00
l10n daemon script
18a528bc2a GIT_SILENT made messages (after extraction) 2019-07-26 02:25:48 +02:00
l10n daemon script
b41c7d2804 GIT_SILENT made messages (after extraction) 2019-07-25 02:22:17 +02:00
Mariusz Glebocki
efb621d091 Fix initial terminal size
How the initial terminal size is set:
* TerminalDisplay calculates size in pixels from requested columns/rows
  count, and uses it as the size hint.
* TabbedViewContainer, which wraps TerminalDisplay and QTabBar,
  and MainWindow, which wraps TabbedViewContainer, calculates their
  sizes from their children's size hints. It is assumed the size
  is equal to children's bounding rectangle size, eventually increased
  by visible margins.
* TerminalDisplay adjusts its size to fill the window. In this case,
  this should change nothing.

QTabWidget's (TabbedViewContainer base class) sizeHint() includes
some (*nonexistent*) margins added by widgets style (by default 2*2,
2*4 in Breeze). Those were propagated to the window size and were
increasing TerminalDisplay size.

Reimplemented TabbedViewContainer::sizeHint() returns the size of its
children's bounding rectangle.
2019-07-20 00:47:39 +02:00
Tomaz Canabrava
47d97aa0b3 Remove obsolete call 'rects', use begin / end iterators.
rects creates a temporary vector with all the rectangles and
returns the result, destructing in the end. we don't need that
if we are only interested in iterating thru the rects. QRegion
has begin / end so it's usable in Q_FOREACH and range based for.
2019-07-19 16:15:15 +02:00