Commit Graph

895 Commits

Author SHA1 Message Date
Marco Martin
f3c05034d9 Selected state for Plasma::Svg and IconItem
Like KIconloader, support a Selected state, in IconItem,
as in all generic svgs/framesvg
it replaces the text color with HighlightedText and the
background color with HighlightColor

Change-Id: Id97a527405d2c3feed75a172f05547defdbf440c
REVIEW:127975
2016-05-31 11:10:47 +02:00
Anthony Fieroni
2275db4b39 [dataengine]If the DataEngine constructor is called with an invalid KPluginInfo object, make sure valid is set to false.
+ test case

REVIEW: 127795

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2016-05-19 22:45:29 +03:00
Marco Martin
3bffad8c42 relicense few files
license to LGPL2+ as in frameworks licensing policy
The old license in the files was actually wrong, because:
servicejob_p.h : splitted from servicejob.cpp (already 2+)
in 89b71cd9f195da51993533f7fc2329ddc08a7de4

package_p.h: splitted from package.cpp (already 2+)
in 9cb9cfe65e

packagestructure_p.h: created by me in a629fe4d8f
(by copy/paste of the header)
2016-05-19 17:44:43 +02:00
Marco Martin
f98cae5dd0 Use SAX for Plasma::Svg stylesheet replacement
following KIconLoader, use QXmlStreamReader/Writer
here too to replace the svg stylesheet to color
the svg with system colors.
it should be hopefully slightly more efficient

REVIEW:127937
2016-05-17 14:45:54 +02:00
Marco Martin
2b7543c343 reload selected color scheme on colors changed 2016-05-10 17:18:48 +02:00
Marco Martin
f0c119696d highlight/highlightedText from proper color group
lately the highlight color of plasma became a very
washed-out blue, (since it switched to use the
global system colors) that was because it actually
taken the highlight color (and highlightedText)
from the wrong source.
there is a correct color group in kcolorscheme for
that, that is Selection, take those two colors
from that (also means highlight and highlightedtext
always be the same in all plasma::theme::colorgroups
but that's not a problem)

update test to reflect that

REVIEW:127842
2016-05-05 12:22:44 +02:00
Wolfgang Bauer
d884119f5a Always write the theme name to plasmarc, also if the default theme is chosen
Currently, the "name" key is deleted from plasmarc when you select the
default theme (breeze) in the desktop theme KCM.
This leads to unexpected behaviour: If you set e.g. oxygen as look&feel,
and then set breeze as desktop theme, Plasma actually uses Air (the
default desktop theme in the oxygen l&f) on next login instead of
breeze. In other words, it is impossible to configure breeze as desktop
theme when using a different look&feel as breeze.

This fixes the problem by removing the check whether the default theme
is selected and always writes the "name" config key to plasmarc.

REVIEW: 127698
2016-04-22 19:23:35 +02:00
Marco Martin
1cf145861b add Positive, Neutral, Negative text colors
add named colors for positive (usually green)
neutral(usually yellow) negative(usually red)
foreground objects, such as text or parts of
svg icons/themes

REVIEW:127696
Change-Id: I646306339f1684cdc062da3d3af1489af6092372
2016-04-20 18:25:50 +02:00
Marco Martin
553a9bfe53 bind highlightedText color in Plasma::Theme
we have a color in the Plasma theme "highlight" that is basically
an accent color used around.. but one of the uses is to use it as
a background, such as highlighted text. in that case we don't know
what color would be safe for contrasting on top of it for things
like the highlighted text color (plasma style used the background
color for that, which is incorrect)

REVIEW:127637
2016-04-13 12:28:53 +02:00
Friedrich W. H. Kossebau
9f48b41507 Fix unsetting associated application/urls for Plasma::Applets
Summary:
Avoids a crash and a bogus menu entry.

Current code does not properly handle any resetting, which results
in Applet::hasValidAssociatedApplication() still returning true
when urls have been set to an empty list and the application name
to an empty string.
Also are connections to the "destroyed" signal collected on
repeated set calls.
This patch fixes that.

This fixes "Run the Associated Application" menu entry showing up with widgets.

It also prevents the crash in associatedapplicationmanager.cpp:76, which assumes
url lists to be non-empty:
const QString mimeType = mimeDb.mimeTypeForUrl(i.value().first()).name();

Not happy yet with the signal/slot connection management,
improvement proposals welcome.

Reviewers: mart

Reviewed By: mart

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1372
2016-04-12 01:09:44 +02:00
Friedrich W. H. Kossebau
d2fdde4002 Don't expose symbols of private class DataEngineManager
Internal class since first release of plasma-frameworks
2016-04-11 14:19:57 +02:00
Martin Gräßlin
035e061e13 Add nullptr-check for iconTheme
KIconLoader::global()->theme() might return null. Thus we need to
guard for this case (happens e.g. on build.kde.org).

This results in iconThemeMetadataPath not being set, which is fine
as that condition is handled later on.

CCMAIL: notmart@gmail.com
Reviewed-By: Bhushan Shah
2016-04-05 10:06:27 +02:00
Ivan Čukić
cdeb168c53 Fixed the logic problem of testing whether the job was valid 2016-04-05 09:33:52 +02:00
Marco Martin
944c7e60dc cache svg icons from icon theme
cache as well svg icons from the icon theme
(invalidating as well when the icon theme is updated)

REVIEW:127260
2016-04-04 17:47:30 +02:00
David Edmundson
ca98250d0c add missing const on private member
REVIEW: 127549
2016-04-03 23:01:23 +01:00
Ivan Čukić
8bd9e56572 Fixing the force-creation of applets when plasma is immutable
REVIEW:127442
2016-03-20 22:48:57 +01:00
Kai Uwe Broulik
bd354ecf70 [Svg] Don't reparse configuration in response to Theme::applicationPaletteChanged
Plasma::Theme emits the applicationPaletteChanged signal after it has fetched the
colors from KColorScheme and scheduled the caches to be nuked. There's no need to do
the same exact thing from every single Svg out there.

This speeds up Plasma picking up color scheme changes significantly and is now
on a par with other opened applications.

REVIEW: 127426
2016-03-20 11:30:58 +01:00
Marco Martin
2661cd701c reintroduce busy property in Applet
both the comic and weather applet have to pick out the
_plasma_graphicsObject to access the AppletInterface
object just to set the busy property on it.
this reintroduces the busy proeprty in Applet too,
both setting it to Applet or AppletInterface
will keep them in sync

REVIEW:127411
2016-03-17 18:27:06 +01:00
Aleix Pol
309c64f5e9 Don't import an nonexistent layout
It should have a containment at least

REVIEW: 127345
2016-03-16 12:33:10 +01:00
Aleix Pol
c23f2415bb Make it possible for an applet to offer a test object
Makes it possible for plasmoids to test themselves in the different shells
by providing API to extract the object that will test the plasmoid
instance.

REVIEW: 127345
2016-03-16 12:32:25 +01:00
Marco Martin
917b2768a8 org.kde.plasma:force-create in Containment
so much for removing sytray-related hacks.. :/
when the widgets are locked, must be possible to add/remove
widgets in the sytemtray anyways, as their creation/destruction
can depend from dbus activation (or the first time you launch
plasma with the new systray and it must be populated)

Change-Id: I8095ebf831ae57e1306a4d623b253c2a10ef219f
REVIEW:127373
2016-03-15 16:35:13 +01:00
David Rosca
974a2b5071 FrameSvg: Fix dangling pointers in sharedFrames when theme changes
Store theme pointer in FrameData and set it when adding to sharedFrames.

REVIEW: 127344
2016-03-12 13:02:34 +01:00
Kai Uwe Broulik
3decfdd869 [Applet] Don't overwrite "Persistent" flag of Undo notification
The setFlags(SkipGrouping) all overwrites the Persistent flag set in the constructor

Reviewed-By: drosca
2016-03-09 18:39:02 +01:00
Marco Martin
e55eb59dbd add two missing categories 2016-03-09 12:44:47 +01:00
Ivan Čukić
63f14f1ddf Allowing to override plasma mutability setting on containment creation
This adds a 'Sledge Hammer'-like flag (trust me I know what I'm doing)
for creating the containment even if the plasma is not set on
'mutable'.
2016-03-09 11:51:38 +01:00
Marco Martin
6973dac801 add icon/titleChanged
make it possible to set icon and title from
the Applet subclass, making appletInterface (so plasmoid obj)
notice about the change and relay the notify signal
2016-03-09 11:34:21 +01:00
Marco Martin
5b0ec83c36 Revert "mechanism for coronas to load plasmoids from custom folders"
This reverts commit 2751b72835.
2016-03-08 15:39:50 +01:00
Marco Martin
12ea79b341 Merge branch 'mart/customShell'
Conflicts:
	examples/CMakeLists.txt
	src/plasma/pluginloader.cpp
2016-03-08 15:38:31 +01:00
Anthony Fieroni
6bb02c88eb [Applet] Don't crash on remove panel
REVIEW: 127240
CCBUG: 345723

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2016-03-04 21:06:30 +02:00
David Rosca
60af310cfc Theme: Discard pixmap cache when changing theme
Changing theme also changes color scheme making the pixmap cache
invalid for monochrome icons.

CCBUG: 359924
REVIEW: 127226
2016-03-01 00:06:15 +01:00
Marco Martin
40b99a9122 if path is passed, pick the tail
PluginLoader::loadApplet works both by passing a simple plugin
name and a full path of a plasmoid package.

However, when loading the optional C++ plugin, we have to look
in the standard plasmoid plugin path, so only consider the
tail of the path name, as is guaranteed that part is equal to
the plugin name.

BUG:359902
Change-Id: Ic7300b7c12d7693bcb5590e29de780109a8ff81c
2016-02-29 17:31:38 +01:00
Marco Martin
f55e20cc5f properties configurationRequired and reason
unbreak api of Applet::SetConfigurationRequired + add bindings to
appletInterface as properties.
new properties configurationRequired and configurationRequiredReason

Change-Id: I18ff01df94c1a0c5fac79ff801bfa76714c9f986
REVIEW:127218
2016-02-29 14:26:52 +01:00
David Edmundson
88ec6de113 Move contextualActionsAboutToShow to Applet
Applet contains the menu actions, therefore reloading the menu should
happen in Applet not AppletInterface. With AppletInterface being a dumb
wrapper.

This exposes functionality to anyone who overrides Applet, but also will
also allows system tray to emit this signal without having to use
private API.

Change-Id: I95e65de315744a78a82ebba2a954e4f3ae1bd7b2
REVIEW: 127217
2016-02-29 12:10:28 +00:00
Aleix Pol
06c7b9c050 Remove some warnings
Unused variables
Unused code
Unused arguments
Unnecessarily complex code
Initialization order
Duplicated properties

REVIEW: 127214
2016-02-29 00:59:44 +01:00
Aleix Pol
9f62532674 Fix most of Clazy warnings in plasma-framework
REVIEW: 126672
2016-02-29 00:13:41 +01:00
David Rosca
172847fc3b DataContainer: Fix slot checks before connect/disconnect
Use indexOfSlot instead of indexOfMethod and check for index >= 0.
Also added missing checks for all dataUpdated connects.

REVIEW: 127133
2016-02-23 19:08:48 +01:00
David Rosca
4eeed04f0f Revert "Reparse svgElementsCache instead of deleting it in discardCache"
This reverts commit a8e54e15e1.
2016-02-21 15:05:13 +01:00
David Rosca
f4e541ad87 Fix crash from previous commit - nullptr check 2016-02-19 13:39:55 +01:00
David Rosca
a8e54e15e1 Reparse svgElementsCache instead of deleting it in discardCache
svgElementsCache may be created on render thread and deleted
on main thread, which will make KSharedConfig crash because
it uses per-thread storage.

BUG: 359539
REVIEW: 127112
2016-02-19 13:25:26 +01:00
l10n daemon script
13dc03991d 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"
2016-02-06 09:49:14 +00:00
l10n daemon script
087c10cd43 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"
2016-02-05 09:18:18 +00:00
l10n daemon script
3dac19023c 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"
2016-02-02 10:51:53 +00:00
Marco Martin
8e71d6590b use complementaryColorScheme from KColorScheme
kill many lines of code
2016-01-26 11:47:00 +01:00
l10n daemon script
bd10d78e1e 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"
2016-01-22 09:52:02 +00:00
Marco Martin
427419ba2e more docs
Change-Id: I821c7f38a1880754a12bbcbb997b03d8813e6903
2016-01-12 13:32:17 +01:00
Marco Martin
6841956ea6 deprecate Applet::loadPlasmoid()
Deprecated: use Containment::createApplet instead,
you are not supposed to have applets without containments

Change-Id: I5e73335523687969918a71e56eaa3124d779ee74
2016-01-12 13:28:00 +01:00
l10n daemon script
345fba11bf 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"
2015-12-30 09:28:22 +00:00
Martin Klapetek
f639996bec Use the SkipGrouping flag for the "widget deleted" notification
https://git.reviewboard.kde.org/r/126459/ introduced new
flag that allows to skip the grouping of notifications.

This should fix all bugs caused by checking for appName
being "plasma_workspace" which are all default notifications
from any plasmoid.

CCBUG: 356653
REVIEW: 126461

(this also needs to raise the KF5 dep to 5.18 which is
normally done at release time, but in order to use this
now, it needs to be bumped now, otherwise build failures
will ensue)
2015-12-29 15:12:05 -05:00
David Edmundson
ab135f4e8e Don't always load the timetracker
It has a timer that wakes up every 2 seconds and drains my battery just
simply because I have debug builds. This make it on demand.

Don't track containments twice.
Containments inherit from Applets which also have the same line

Change-Id: Ia9a9b58a0b1197083d692c58e4ce75838c311db4
REVIEW: 126472
2015-12-27 19:37:35 +00:00
Leslie Zhai
97ef641566 Add HiddenStatus for plasmoid self-hiding
Self-hiding plasmoid is useful https://forum.kde.org/viewtopic.php?f=83&t=39501
for example, bluetooth plasmoid can be totally hided when there is NO bluetooth
adpater available.

PassiveStatus is NOT enough, because plasma-workspace's systemtray applet ONLY
hide the passive status plasmoid into ExpandedRepresentation. when click the
expanding triangle, the 'hidden' plasmoid is still visible.

So I added HiddenStatus and implemented it in the plasma-workspace systemtray
applet.

REVIEW: 126297
2015-12-23 22:17:20 +08:00