Commit Graph

3547 Commits

Author SHA1 Message Date
David Edmundson
a968892ba9 Guard failed testItem creation
Summary: createObjectFromSource can return a null on error. This needs guarding.

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D7532
2017-08-25 10:26:15 +01:00
Kai Uwe Broulik
2236c19584 [Service] Restore /dev/null usage
Accidentally removed it for testing but since I don't know why this is for,
better restore it :)
2017-08-25 11:25:20 +02:00
Kai Uwe Broulik
5137a988b1 [Service] Use KConfig::SimpleConfig
I don't get the comment on why it is /dev/null instead of QString() but using SimpleConfig at least saves 0.3ms per call for me.

Differential Revision: https://phabricator.kde.org/D7510
2017-08-25 11:24:03 +02:00
Kai Uwe Broulik
b4c1c9cdfa Drop remains of "locolor" themes
It's not being set to anything anymore and people typically don't have 256 color displays these days.

Differential Revision: https://phabricator.kde.org/D7516
2017-08-25 10:37:35 +02:00
Kai Uwe Broulik
1419135a5d Get rid of QSignalMapper
Use lambdas instead.

Differential Revision: https://phabricator.kde.org/D7361
2017-08-18 11:53:10 +02:00
Kai Uwe Broulik
cf8ae465e4 [Theme] Use KConfig SimpleConfig
We're passing it an absolute path to a file in our install directory anyway,
so we probably don't want inheritance.

Differential Revision: https://phabricator.kde.org/D7362
2017-08-17 12:17:15 +02:00
Fabian Vogt
883a0488f1 Avoid some unnecessary theme content lookups
Summary:
imagePath can be an absolute path into an iconTheme
-> Do not try to find it in the Plasma theme

imagePath can be empty
-> Do not try to look it up at all

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: #frameworks

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D7250
2017-08-11 14:35:52 +02:00
l10n daemon script
24193527bf SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-08-11 04:56:36 +02:00
Marco Martin
47a9cd23b3 fix check 2017-08-07 17:18:45 +02:00
Marco Martin
0c27df529d ignore spurious resize events to empty sizes
Summary:
on multiscreen systems, the notification dialog gets resized to 0x0
right after componentcomplete by someone else (either kwin, notification
 applet  or Qt code) causing 382340, resizing a window to a null size is not correct anyways
and should never happen.
with this, all other resize events are correct and notifications are ok on multiscreen
systems

BUG:382340

Test Plan:
system with primary monitor and panel in the external monitor
at the right of a panel, notifications are fine

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, broulik, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D7127
2017-08-07 16:06:04 +02:00
Volker Krause
0a8d1f9cd4 Fix compilation on Yocto
Summary:
By default, Qt is built without accessibility there, which is what
would indirectly include the needed QColor with a "normal" Qt build
here.

Reviewers: #frameworks, broulik

Reviewed By: broulik

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D7117
2017-08-03 22:19:29 +02:00
Kai Uwe Broulik
7e0b719f1e [Containment Interface] always emit contextualActionsAboutToShow for containment
The applet context menu contains containment actions which might be outdated if we don't call this.

Differential Revision: https://phabricator.kde.org/D6894
2017-08-02 11:02:12 +02:00
Marco Martin
dcf08486fe add some @deprecated in the documentation 2017-07-28 11:49:23 +02:00
Marco Martin
162431d793 remove resourceinstance
resourceinstance wasn't compiled anymore, never ported to kf5
so is safe to just remove it
2017-07-28 11:37:28 +02:00
Fabian Vogt
48a8245db4 Treat Button/ToolButton labels as plaintext
Summary:
The label text gets treated as RichText/StyledText, which is required
to display mnemonics underlined. Therefore it is necessary to manually
HTML escape the label text, which unfortunately breaks mnemonics as
escaped HTML contains ampersands.
This commit fixes that by introducing a custom function to stylize
mnemonics in HTML escaped text.

Test Plan:
Ran a modified knotificationdbustest with "<h1>&&a&ction</h1>" and
"actio&n2" as actions. Result: http://i.imgur.com/xHifDBu.png

Reviewers: #plasma, broulik

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6679
2017-07-25 16:05:20 +02:00
l10n daemon script
7b394146e5 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-07-25 04:47:04 +02:00
David Edmundson
a0e5bb3ea7 Don't perform wayland specific fixes when on X
Summary:
fd2e850156 introduces some behaviour
changes that affect X even though they should be only Wayland related.

BUG: 381130

Reviewers: #plasma

Subscribers: graesslin, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6776
2017-07-19 15:22:18 +01:00
Kai Uwe Broulik
d8f1d44a49 Declare AppManager.js as pragma library
It doesn't store any state but contains only functions.

Differential Revision: https://phabricator.kde.org/D6676
2017-07-13 14:27:59 +02:00
Kai Uwe Broulik
1d0a0b5cdf [PlasmaComponents] Remove Config.js
It got redundant and since it wasn't declared as "pragma library" an instance
of this script was created for every ListItem, causing quite some memory consumption.

Reviewed-By: notmart
2017-07-13 14:04:05 +02:00
Marco Martin
f5a217cf04 default to plain text for labels
as this control is new, we can change the default.
for sanity purposes, default to plain text
if the user really needs rich text, it can still
be explicitly setted

reviewed-by:kbroulik
2017-07-12 16:49:37 +02:00
David Edmundson
3a0f61b559 Load translations from KPackage files if bundled
Test Plan:
Installed battery monitor locally with kpackagetool5 -i
moved x-test .po file from being installed systemwide to only being
inside the bundle
still get xx everywhere

BUG: 374825

Reviewers: #plasma, mart

Reviewed By: mart

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D5209
2017-07-11 13:19:10 +01:00
Kai Uwe Broulik
21f954d94d [PlasmaComponents Menu] Don't crash on null action
You can assign a QAction as "action", this way you can just pass it e.g. plasmoid.action("configure").
However, when assigning a null action as can happen with kiosk restrictions, it would crash
as it assigns m_action the nullptr but never checks for that.

This patch ensures we always have a QAction, creating a new empty one, if neccessary.
Also deletes our own action if an external one is assigned

Differential Revision: https://phabricator.kde.org/D6608
2017-07-11 12:23:39 +02:00
Kai Uwe Broulik
c00069c43d Use new connect syntax in more places
Especially in frequently created items. Shoves off a couple of milliseconds of startup time.

Differential Revision: https://phabricator.kde.org/D6614
2017-07-10 22:24:50 +02:00
Kai Uwe Broulik
a19701c252 [Plasma Dialog] Fix flag conditions
The code wants to check whether we're not a tooltip. This wasn't done properly and didn't work
when other flags were present.

Differential Revision: https://phabricator.kde.org/D6554
2017-07-10 11:55:27 +02:00
andreas kainz
8e24c87d8f update akregator system tray icon
BUG: 379861
2017-07-09 17:14:33 +02:00
Kai Uwe Broulik
f3dcff28b8 [Containment Interface] Keep containment in RequiresAttentionStatus while context menu is open
This ensures the panel does not auto-hide then.
It also forces a re-evaluation of auto-hide status when the menu closes,
so even if we mess up with mouse grabbing, it should more reliably auto-hide afterwards.

BUG: 344205
CCBUG: 351823

Differential Revision: https://phabricator.kde.org/D6527
2017-07-07 13:26:48 +02:00
Luca Beltrame
cf79873de6 Revert "Don't list KF5::WindowSystem in public libraries"
PlasmaQuick::Dialog::WindowType uses KWindowSystem's API, so removing
it from the list of the public libraries causes compilation issues in
projects that depend on plasma-framework (such as plasma-desktop) which
no longer find KWindowSystem's includes.

This reverts commit f8de13c674.

CCMAIL: kde@davidedmundson.co.uk
2017-07-05 09:18:49 +02:00
David Edmundson
f8de13c674 Don't list KF5::WindowSystem in public libraries
Summary: We don't use it in public API

Reviewers: #plasma

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6495
2017-07-04 07:57:08 +01:00
Friedrich W. H. Kossebau
0e1219d03b API dox: use @param for normal parameter listing, not @arg 2017-07-03 16:24:20 +02:00
Marco Martin
f0cc90e45d fix apidocs 2017-07-03 16:20:46 +02:00
David Edmundson
06410e779b Fix tab bar layout key handling in RTL
Summary:
Current code will, when mirrored, treat all keys like they're the left
key.

BUG: 379894

Test Plan: Ran plasma in RTL

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6480
2017-07-03 11:31:46 +01:00
Bhushan Shah
f43938f4c2 Use #if instead of #ifdef
Fixes previous attempt to unbreak the build on Windows
2017-06-25 10:39:53 +05:30
Bhushan Shah
e3ffa8d8fe Fix the build without wayland/kwayland
This fixes the build of plasma-framework on KDE CI. Without this it will
error out as,

dialog.cpp(309): error C2065: 'shellSurface': undeclared identifier
dialog.cpp(310): error C2065: 'shellSurface': undeclared identifier
dialog.cpp(310): error C2227: left of '->setPosition' must point to
class/struct/union/generic type

Signed-off-by: Bhushan Shah <bhush94@gmail.com>
2017-06-25 10:29:28 +05:30
Marco Martin
eab4aa9909 Make sure size is final after showEvent
Summary:
* make sure after a showevent the size is final and the
dialog can be safely repositioned.
* set mainItem visible in :setVisible() so that is executed before showEvent:
   resizing windows in their show event is definitely not enough, causes events to arrive to
   reset to the old geometry in race with the setgeometry done there, don't know yet
   if it's the qpa, qwindow, or the windowmanager
* make synctomaintem and updatelayoutparameters working even if
the dialog is not visible as we need to resize beforehand
* move the plasmasurface window also in the show event as if there was no moveevent
  after an hide/show, its position would be resetted to 0,0

Test Plan:
current dialog users behave the same (like pre-D6216 notifications applet), tests still pass
notifications applet reworked to use this works as expected

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: sebas, hein, davidedmundson, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6215
2017-06-21 13:29:26 +02:00
Kai Uwe Broulik
87d5449480 Fix vlc tray icon margins
I broke this in 5bfc730 when I fixed the stylesheet
2017-06-14 11:24:46 +02:00
Kai Uwe Broulik
5bfc730ce7 Fix vlc tray icon color scheme
Make sure to use style sheets and fill:currentColor or else it won't adapt
to the Plasma theme at runtime (e.g. white icon for dark themes etc)

CCMAIL: guoyunhebrave@gmail.com
2017-06-13 10:14:57 +02:00
David Edmundson
4a525f68bd Revert "Make every applet its own focus scope"
Even though this change is probably technically correct, it breaks
things in workspace which aren't really setting focus properly.

Better to revert now and merge again later when things work.

This reverts commit e65d7b98be.
2017-06-12 21:43:52 +01:00
David Edmundson
b0e8ea29fa Set Containments to have focus within the view
Summary:
Now that applets are their own focus scope (which makes sense) we've
also made containments their own focus scope.

We therefore need to also say the containment FocusScope has the focus
within the view.

BUG: 381124

Test Plan:
Renamed something in folderview
Used cursor nav

Reviewers: #plasma

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6192
2017-06-12 15:22:36 +01:00
l10n daemon script
2544d1c9c7 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-06-12 05:14:10 +02:00
l10n daemon script
2d4548e4d0 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-06-11 04:33:38 +02:00
Marco Martin
6ffe068b80 generate the old key before updating enabledborders
Summary:
sometimes a frame changed enabled borders causing a dangling
pointer in s_sharedFrames, since oldkey was generated
with the new enabled borders, it generated a key not present
in the hash, tryed to remove it and left the one associated
with the old key in the hash.
if the need to reuse a frame with that key ever arised again,
we had a crash
BUG:378508

Test Plan:
couldn't reproduce the crash neither with or without patch,
with the patch, if i put debug in every place a framedata is removed,
searching if the key is in the hash before removing it, now
it's always true, before sometimes it was false

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6162
2017-06-09 16:16:16 +02:00
Marco Martin
1aea7bbd5e show show password button also if empty text
like happened in KPasswordWidget, show the show password
button also when there is no text, otherwise is impossible
to know what will be typed, a dot or the actual letter
BUG: 378277
2017-06-09 13:15:46 +02:00
David Edmundson
e65d7b98be Make every applet its own focus scope
Summary:
Like Loaders an applet should be a focus scope. It allows an applet to
set an item to have focus which will then have activeFocus when that
applet gets focus.

Also makes it easy to test if any item within the plasmoid has
activeFocus.

Test Plan:
Keyboard nav in kicker/klipper still work
Added opacity: Plasmoid.activeFocus ? 1 : 0 in an applet and it worked
as expected

Reviewers: #plasma

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6152
2017-06-08 11:27:52 +01:00
David Edmundson
8fdbfa6980 Emit usedPrefixChanged when prefix is empty
As found by Fabian Vogt
2017-06-07 19:46:19 +01:00
Marco Martin
bf1d1cc6b2 don't switch colors on new themes
new themes as breeze aren't supposed to just use the button graphics
on top, that also mean, don't switch palette on top if the new prefix
is there
2017-06-07 18:24:33 +02:00
Aleix Pol
563011436d Port a bunch of classes away from Plasma::Package
Summary: Ported away some classes, removes many unneeded casts that happen when starting.

Test Plan: Tests still pass, plasma starts properly

Reviewers: #frameworks, #plasma, mart

Reviewed By: #plasma, mart

Subscribers: davidedmundson, mart, plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6041
2017-06-06 15:11:25 +02:00
Allen Winter
6c03c15c08 src/plasmaquick/dialog.cpp - fix build without kwayland 2017-06-05 10:02:44 -04:00
Friedrich W. H. Kossebau
0fb9732866 [FEATURE] Option to build & install QCH file with the public API dox
Using the new extra-cmake-modules module ECMAddQch (since 5.36.0)
this adds the option to automatically build and install a file
in QCH format with the docs about the public API, which then can be
used e.g. in Qt Assistant, Qt Creator or KDevelop.

Additionally the installed cmake config files will be extended
with a target KF5Plasma_QCH containing information about how to "link"
into the generated QCH file, which then can be used in the cmake build
system of other libraries building on this library, by
simply listing this target in "LINK_QCHS" of their ecm_add_qch() usage.
And a respective doxygen tag file with all the metadata about the
generated QCH file and used for the "linking" will be created and
installed.

Pass -DBUILD_QCH=ON to cmake to enable this.
2017-06-05 04:25:55 +02:00
Guo Yunhe
6ee8ffd79a Add VLC tray icon 2017-06-03 13:06:38 +03:00
Aleix Pol
3b303d7363 Small improvements in IconItem
Summary:
Don't construct a QUrl for every source strings. Check it's a file url
first (which is the only kind of url we support at the moment)
When extracting the path, use toLocalFile, so it works on platforms where
path!=toLocalPath (e.g. windows)
Don't split a string and get a chunk, but just extract the chunk we need
with section. Reduces allocations that are automatically discarded.
Narrow iconPath scope

Test Plan: Tests still pass, plasmashell still works

Reviewers: #frameworks, #plasma, mart

Reviewed By: #plasma, mart

Subscribers: plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6014
2017-05-29 19:10:37 +02:00