From dad03a43ceaf2a8788208ae0f127aaee4e2a69b3 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 21 Apr 2013 18:04:29 +0200 Subject: [PATCH 01/80] first draft of the platform status kded module --- src/CMakeLists.txt | 1 + src/platformstatus/CMakeLists.txt | 10 +++ .../kded-platformstatus.desktop | 9 +++ src/platformstatus/org.kde.platformstatus.xml | 19 +++++ src/platformstatus/platformstatus.cpp | 76 +++++++++++++++++++ src/platformstatus/platformstatus.h | 38 ++++++++++ 6 files changed, 153 insertions(+) create mode 100644 src/platformstatus/CMakeLists.txt create mode 100644 src/platformstatus/kded-platformstatus.desktop create mode 100644 src/platformstatus/org.kde.platformstatus.xml create mode 100644 src/platformstatus/platformstatus.cpp create mode 100644 src/platformstatus/platformstatus.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9e87656a5..281d146af 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,5 +2,6 @@ add_subdirectory(plasma) add_subdirectory(declarativeimports) #add_subdirectory(kpart) add_subdirectory(plasmapkg) +add_subdirectory(platformstatus) add_subdirectory(scriptengines) add_subdirectory(shell) diff --git a/src/platformstatus/CMakeLists.txt b/src/platformstatus/CMakeLists.txt new file mode 100644 index 000000000..30e46c614 --- /dev/null +++ b/src/platformstatus/CMakeLists.txt @@ -0,0 +1,10 @@ +set(kded_platformstatus_SRCS platformstatus.cpp ) + +kde4_add_plugin(kded_platformstatus ${kded_platformstatus_SRCS}) + +target_link_libraries(kded_platformstatus ${KDE4_KDECORE_LIBS} ${KCoreAddons_LIBRARIES} Qt5::DBus) + +install(TARGETS kded_platformstatus DESTINATION ${PLUGIN_INSTALL_DIR} ) +install( FILES kded-platformstatus.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded ) +install( FILES org.kde.platformstatus.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} ) + diff --git a/src/platformstatus/kded-platformstatus.desktop b/src/platformstatus/kded-platformstatus.desktop new file mode 100644 index 000000000..ea456977b --- /dev/null +++ b/src/platformstatus/kded-platformstatus.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Service +X-KDE-ServiceTypes=KDEDModule +X-KDE-Library=kded_platformstatus +X-KDE-DBus-ModuleName=plaformstatus +X-KDE-Kded-autoload=true +X-KDE-Kded-load-on-demand=false +Name=Platform Status +Comment=Tracks the current shell package and the platform definition strings. diff --git a/src/platformstatus/org.kde.platformstatus.xml b/src/platformstatus/org.kde.platformstatus.xml new file mode 100644 index 000000000..fc77a8e55 --- /dev/null +++ b/src/platformstatus/org.kde.platformstatus.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/platformstatus/platformstatus.cpp b/src/platformstatus/platformstatus.cpp new file mode 100644 index 000000000..31cc1f4db --- /dev/null +++ b/src/platformstatus/platformstatus.cpp @@ -0,0 +1,76 @@ +#include + +#include +#include + +#include +#include +#include + +const char *defaultPackage = "org.kde.desktop"; + +K_PLUGIN_FACTORY(PlatformStatusFactory, registerPlugin();) +K_EXPORT_PLUGIN(PlatformStatusFactory("platformstatus")) + +PlatformStatus::PlatformStatus(QObject *parent, const QVariantList &) + : KDEDModule(parent) +{ + QDBusConnection::sessionBus().registerObject("/PlatformStatus", this, + QDBusConnection::ExportAllProperties | + QDBusConnection::ExportAllSignals); + findShellPackage(false); + const QString globalrcPath = QStandardPaths::locate(QStandardPaths::ConfigLocation, "kdeglobals"); + connect(KDirWatch::self(), SIGNAL(dirty(QString)), this, SLOT(fileDirtied(QString))); + KDirWatch::self()->addFile(globalrcPath); +} + +void PlatformStatus::findShellPackage(bool sendSignal) +{ + KConfigGroup group(KSharedConfig::openConfig("kdeglobals"), "DesktopShell"); + const QString package = group.readEntry("shellPackage", defaultPackage); + + const QString path = QStandardPaths::locate(QStandardPaths::DataLocation, "plasma/shells/" + package + "/"); + if (path.isEmpty()) { + if (package != defaultPackage) { + group.deleteEntry("ShellPackage"); + findShellPackage(sendSignal); + } + + return; + } + + m_shellPackage = package; + + QString runtimePlatform = group.readEntry("runtimePlatform", QString()); + KConfig packageDefaults(path + "contents/defaults", KConfig::SimpleConfig); + group = KConfigGroup(&packageDefaults, "DesktopShell"); + runtimePlatform = group.readEntry("runtimePlatform", runtimePlatform); + const bool runtimeChanged = runtimePlatform != m_runtimePlatform.join(','); + if (runtimeChanged) { + m_runtimePlatform = runtimePlatform.split(','); + } + + if (sendSignal) { + emit shellPackageChanged(m_shellPackage); + emit runtimePlatformChanged(m_runtimePlatform); + } +} + +QString PlatformStatus::shellPackage() const +{ + return m_shellPackage; +} + +QStringList PlatformStatus::runtimePlatform() const +{ + return m_runtimePlatform; +} + +void PlatformStatus::fileDirtied(const QString &path) +{ + if (path.endsWith("kdeglobals")) { + findShellPackage(true); + } +} + +#include "platformstatus.moc" diff --git a/src/platformstatus/platformstatus.h b/src/platformstatus/platformstatus.h new file mode 100644 index 000000000..dd4804d4e --- /dev/null +++ b/src/platformstatus/platformstatus.h @@ -0,0 +1,38 @@ +#ifndef PLATFORMSTATUS_H +#define PLATFORMSTATUS_H + +#include + +#include + +class PlatformStatus : public KDEDModule +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.PlatformStatus") + Q_PROPERTY(QString shellPackage READ shellPackage NOTIFY shellPackageChanged) + Q_PROPERTY(QStringList runtimePlatform READ runtimePlatform NOTIFY runtimePlatformChanged) + +public: + PlatformStatus(QObject *parent, const QVariantList &); + +public Q_SLOTS: + QString shellPackage() const; + QStringList runtimePlatform() const; + +Q_SIGNALS: + void shellPackageChanged(const QString &package); + void runtimePlatformChanged(const QStringList &runtimePlatform); + +private: + void findShellPackage(bool sendSignal); + +private Q_SLOTS: + void fileDirtied(const QString &path); + +private: + QString m_shellPackage; + QStringList m_runtimePlatform; +}; + +#endif + From 114de64ed48dc97f0f16ee681b52b23c55d3ac49 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 21 Apr 2013 18:16:50 +0200 Subject: [PATCH 02/80] correct the .desktop file --- src/platformstatus/kded-platformstatus.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platformstatus/kded-platformstatus.desktop b/src/platformstatus/kded-platformstatus.desktop index ea456977b..5c9bc5d96 100644 --- a/src/platformstatus/kded-platformstatus.desktop +++ b/src/platformstatus/kded-platformstatus.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=Service X-KDE-ServiceTypes=KDEDModule -X-KDE-Library=kded_platformstatus +X-KDE-Library=platformstatus X-KDE-DBus-ModuleName=plaformstatus X-KDE-Kded-autoload=true X-KDE-Kded-load-on-demand=false From f1316f0ce2455d865d1771f75580ce8f3269777d Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 21 Apr 2013 18:35:52 +0200 Subject: [PATCH 03/80] add the runtime platform entry --- src/shell/qmlpackages/desktop/contents/defaults | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shell/qmlpackages/desktop/contents/defaults b/src/shell/qmlpackages/desktop/contents/defaults index 147d0ec4e..ada9419db 100644 --- a/src/shell/qmlpackages/desktop/contents/defaults +++ b/src/shell/qmlpackages/desktop/contents/defaults @@ -1,6 +1,8 @@ [Desktop] Containment=org.kde.desktop ToolBox=org.kde.toolbox +RuntimePlatform= + [Desktop][ContainmentActions] Ctrl;LeftButton=org.kde.standardmenu MiddleButton=org.kde.paste @@ -12,4 +14,4 @@ ToolBox=org.kde.toolbox Ctrl;LeftButton=org.kde.standardmenu [Theme] -Theme=default \ No newline at end of file +Theme=default From 5806fa8077082cc4dd01176c5278c1c355250658 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 21 Apr 2013 18:36:00 +0200 Subject: [PATCH 04/80] make it all work for reals --- src/platformstatus/platformstatus.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/platformstatus/platformstatus.cpp b/src/platformstatus/platformstatus.cpp index 31cc1f4db..fa466a781 100644 --- a/src/platformstatus/platformstatus.cpp +++ b/src/platformstatus/platformstatus.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -29,7 +30,9 @@ void PlatformStatus::findShellPackage(bool sendSignal) KConfigGroup group(KSharedConfig::openConfig("kdeglobals"), "DesktopShell"); const QString package = group.readEntry("shellPackage", defaultPackage); - const QString path = QStandardPaths::locate(QStandardPaths::DataLocation, "plasma/shells/" + package + "/"); + const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, + "plasma/shells/" + package + '/', + QStandardPaths::LocateDirectory); if (path.isEmpty()) { if (package != defaultPackage) { group.deleteEntry("ShellPackage"); @@ -41,10 +44,10 @@ void PlatformStatus::findShellPackage(bool sendSignal) m_shellPackage = package; - QString runtimePlatform = group.readEntry("runtimePlatform", QString()); + QString runtimePlatform = group.readEntry("RuntimePlatform", QString()); KConfig packageDefaults(path + "contents/defaults", KConfig::SimpleConfig); - group = KConfigGroup(&packageDefaults, "DesktopShell"); - runtimePlatform = group.readEntry("runtimePlatform", runtimePlatform); + group = KConfigGroup(&packageDefaults, "Desktop"); + runtimePlatform = group.readEntry("RuntimePlatform", runtimePlatform); const bool runtimeChanged = runtimePlatform != m_runtimePlatform.join(','); if (runtimeChanged) { m_runtimePlatform = runtimePlatform.split(','); From b6215f9340dac66e8d6828a2d236d2d5cb3a0803 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 3 May 2013 18:07:47 +0200 Subject: [PATCH 05/80] fix loading of the first config page --- src/shell/configview.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/shell/configview.cpp b/src/shell/configview.cpp index 2040fc5bb..f3562a080 100644 --- a/src/shell/configview.cpp +++ b/src/shell/configview.cpp @@ -168,7 +168,7 @@ QVariant ConfigModel::get(int row) const value["name"] = m_categories.at(row)->name(); value["icon"] = m_categories.at(row)->icon(); if (m_appletInterface) { - value["source"] = QUrl::fromLocalFile(m_appletInterface.data()->package().filePath("components", m_categories.at(row)->source())); + value["source"] = QUrl::fromLocalFile(m_appletInterface.data()->package().filePath("ui", m_categories.at(row)->source())); } else { value["source"] = m_categories.at(row)->source(); } @@ -281,19 +281,20 @@ ConfigView::ConfigView(Plasma::Applet *applet, QWindow *parent) //config model local of the applet QQmlComponent *component = new QQmlComponent(engine(), QUrl::fromLocalFile(m_applet->package().filePath("configmodel")), this); - QObject *object = component->create(engine()->rootContext()); + QObject *object = component->beginCreate(engine()->rootContext()); m_configModel = qobject_cast(object); if (m_configModel) { m_configModel->setApplet(m_applet); } else { delete object; } - delete component; Plasma::Containment *cont = qobject_cast(m_applet); engine()->rootContext()->setContextProperty("plasmoid", applet->property("graphicObject").value()); engine()->rootContext()->setContextProperty("configDialog", this); + component->completeCreate(); + delete component; } ConfigView::~ConfigView() From 051ed6c8edad46e9f86c712276a7569f13d4606b Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Sat, 4 May 2013 09:56:14 +0200 Subject: [PATCH 06/80] SVN_SILENT made messages (.desktop file) --- src/plasma/data/servicetypes/plasma-generic.desktop | 13 +++++++++++++ src/shell/qmlpackages/lookandfeel/metadata.desktop | 1 + 2 files changed, 14 insertions(+) diff --git a/src/plasma/data/servicetypes/plasma-generic.desktop b/src/plasma/data/servicetypes/plasma-generic.desktop index be90ac968..1ebb3a0ee 100644 --- a/src/plasma/data/servicetypes/plasma-generic.desktop +++ b/src/plasma/data/servicetypes/plasma-generic.desktop @@ -2,5 +2,18 @@ Type=ServiceType X-KDE-ServiceType=Plasma/Generic Name=Plasma Package +Name[cs]=Balíček Plasmy +Name[de]=Plasma-Paket +Name[nl]=Plasma-pakket +Name[pt]=Pacote do Plasma +Name[sv]=Plasma-paket +Name[uk]=Пакунок Плазми +Name[x-test]=xxPlasma Packagexx Comment=Generic Plasma Package +Comment[de]=Allgemeines Plasma-Paket +Comment[nl]=Algemeen plasma-pakket +Comment[pt]=Pacote Genérico do Plasma +Comment[sv]=Generellt Plasma-paket +Comment[uk]=Типовий пакунок Плазми +Comment[x-test]=xxGeneric Plasma Packagexx diff --git a/src/shell/qmlpackages/lookandfeel/metadata.desktop b/src/shell/qmlpackages/lookandfeel/metadata.desktop index f94818244..8bd9a1eea 100644 --- a/src/shell/qmlpackages/lookandfeel/metadata.desktop +++ b/src/shell/qmlpackages/lookandfeel/metadata.desktop @@ -17,6 +17,7 @@ Keywords[sv]=Skrivbord, Arbetsyta, Utseende, Utseende och känsla, Utloggning, L Keywords[uk]=стільниця;робочий;простір;вигляд;поведінка;вихід;блокування;призупинення;призупинка;присипляння;вимикання;Desktop;Workspace;Appearance;Look and Feel;Logout;Lock;Suspend;Shutdown;Hibernate; Keywords[x-test]=xxDesktop, Workspace, Appearance, Look and Feel, Logout, Lock, Suspend, Shutdown, Hibernate,xx Name=Look and Feel +Name[de]=Erscheinungsbild Name[nl]=Uiterlijk en gedrag Name[pt]=Aparência e Comportamento Name[pt_BR]=Aparência e comportamento From 27266d5582f4f0ad8890111778d79f2074b2eb19 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Sat, 4 May 2013 15:14:47 +0200 Subject: [PATCH 07/80] New frameworks appeared, update the list --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 267ea7890..2186e8ede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,8 @@ find_package(kdeqt5staging REQUIRED NO_MODULE) # Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs: find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver - KConfig KAuth kjs) + KConfig KAuth kjs + ki18n kguiaddons kservice kwidgets ItemViews KCompletion KNotifications KJobWidgets KConfigWidgets KIconThemes) #find_package(KF5Transitional REQUIRED) # those are not "done" yet: From 2160fa2c71f825afa825c82c088144953120aee6 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Mon, 6 May 2013 09:33:23 +0200 Subject: [PATCH 08/80] SVN_SILENT made messages (.desktop file) --- src/plasma/data/servicetypes/plasma-generic.desktop | 4 ++++ src/shell/qmlpackages/lookandfeel/metadata.desktop | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/plasma/data/servicetypes/plasma-generic.desktop b/src/plasma/data/servicetypes/plasma-generic.desktop index 1ebb3a0ee..89e93865d 100644 --- a/src/plasma/data/servicetypes/plasma-generic.desktop +++ b/src/plasma/data/servicetypes/plasma-generic.desktop @@ -6,6 +6,8 @@ Name[cs]=Balíček Plasmy Name[de]=Plasma-Paket Name[nl]=Plasma-pakket Name[pt]=Pacote do Plasma +Name[pt_BR]=Pacote do Plasma +Name[sk]=Plasma balík Name[sv]=Plasma-paket Name[uk]=Пакунок Плазми Name[x-test]=xxPlasma Packagexx @@ -13,6 +15,8 @@ Comment=Generic Plasma Package Comment[de]=Allgemeines Plasma-Paket Comment[nl]=Algemeen plasma-pakket Comment[pt]=Pacote Genérico do Plasma +Comment[pt_BR]=Pacote genérico do Plasma +Comment[sk]=Všeobecný Plasma balík Comment[sv]=Generellt Plasma-paket Comment[uk]=Типовий пакунок Плазми Comment[x-test]=xxGeneric Plasma Packagexx diff --git a/src/shell/qmlpackages/lookandfeel/metadata.desktop b/src/shell/qmlpackages/lookandfeel/metadata.desktop index 8bd9a1eea..c54023c0e 100644 --- a/src/shell/qmlpackages/lookandfeel/metadata.desktop +++ b/src/shell/qmlpackages/lookandfeel/metadata.desktop @@ -1,5 +1,6 @@ [Desktop Entry] Comment=Desktop Design Language +Comment[fr]=Langage de conception de bureau Comment[nl]=Ontwerptaal van het bureaublad Comment[pt]=Linguagem de Desenho do Ecrã Comment[pt_BR]=Linguagem de desenho da área de trabalho @@ -9,6 +10,7 @@ Comment[uk]=Мова розробки для стільниці Comment[x-test]=xxDesktop Design Languagexx Encoding=UTF-8 Keywords=Desktop, Workspace, Appearance, Look and Feel, Logout, Lock, Suspend, Shutdown, Hibernate, +Keywords[fr]=Bureau, environnement de travail, apparence, déconnexion, verrouillage, suspendre, déconnexion, veille Keywords[nl]=Bureaublad, werkruimte, uiterlijk, uiterlijk en gedrag, afmelden, vergrendelen, onderbreken, afsluiten, slapen, Keywords[pt]=Ecrã, Área de Trabalho, Aparência, Aparência e Comportamento, Encerrar, Bloquear, Suspender, Desligar, Hibernar, Keywords[pt_BR]=Área de trabalho, Espaço de trabalho, Aparência, Aparência e Comportamento, Encerrar sessão, Bloquear, Suspender, Desligar, Hibernar, @@ -18,6 +20,7 @@ Keywords[uk]=стільниця;робочий;простір;вигляд;по Keywords[x-test]=xxDesktop, Workspace, Appearance, Look and Feel, Logout, Lock, Suspend, Shutdown, Hibernate,xx Name=Look and Feel Name[de]=Erscheinungsbild +Name[fr]=Apparence Name[nl]=Uiterlijk en gedrag Name[pt]=Aparência e Comportamento Name[pt_BR]=Aparência e comportamento From 3d290decd24c745649dd5576ce3dbffc9fd5ed29 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 6 May 2013 18:01:21 +0200 Subject: [PATCH 09/80] Require XmlGui --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2186e8ede..c3261fff9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ find_package(kdeqt5staging REQUIRED NO_MODULE) # Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs: find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs - KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver + XmlGui KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver KConfig KAuth kjs ki18n kguiaddons kservice kwidgets ItemViews KCompletion KNotifications KJobWidgets KConfigWidgets KIconThemes) #find_package(KF5Transitional REQUIRED) From f9436999d96db5cc9111476a2da6bbef3a884c0f Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 7 May 2013 11:55:21 +0200 Subject: [PATCH 10/80] fix the wallpaper configuration still pretty hacky, makes a lot of assumptions about the scriptengine object hyerarchy and for some reason digging a ConfigPropertyMap out of a qvariant doesn't work properly --- .../qml/plasmoid/containmentinterface.cpp | 6 ++-- src/shell/containmentconfigview.cpp | 35 ++++++++++++------- src/shell/containmentconfigview.h | 3 ++ 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index 249b1092b..a761b1838 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -36,6 +36,7 @@ #include #include +#include "kdeclarative/configpropertymap.h" ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent) : AppletInterface(parent), @@ -167,9 +168,7 @@ void ContainmentInterface::appletRemovedForward(Plasma::Applet *applet) void ContainmentInterface::loadWallpaper() { if (m_appletScriptEngine->drawWallpaper()) { - if (m_wallpaperInterface || containment()->wallpaper().isEmpty()) { - return; - } + delete m_wallpaperInterface; m_wallpaperInterface = new WallpaperInterface(this); m_wallpaperInterface->setZ(-1000); @@ -181,6 +180,7 @@ void ContainmentInterface::loadWallpaper() QQmlProperty prop(m_wallpaperInterface, "anchors.fill"); prop.write(expr.evaluate()); + containment()->setProperty("wallpaperGraphicsObject", QVariant::fromValue(m_wallpaperInterface)); } else { if (m_wallpaperInterface) { m_wallpaperInterface->deleteLater(); diff --git a/src/shell/containmentconfigview.cpp b/src/shell/containmentconfigview.cpp index b26a70bfa..fd7af31fa 100644 --- a/src/shell/containmentconfigview.cpp +++ b/src/shell/containmentconfigview.cpp @@ -39,7 +39,8 @@ ContainmentConfigView::ContainmentConfigView(Plasma::Containment *cont, QWindow : ConfigView(cont, parent), m_containment(cont), m_wallpaperConfigModel(0), - m_currentWallpaperConfig(0) + m_currentWallpaperConfig(0), + m_ownWallpaperConfig(0) { engine()->rootContext()->setContextProperty("configDialog", this); setCurrentWallpaper(cont->containment()->wallpaper()); @@ -50,7 +51,8 @@ ContainmentConfigView::ContainmentConfigView(Plasma::Containment *cont, QWindow QFile file(pkg.filePath("config", "main.xml")); KConfigGroup cfg = m_containment->config(); cfg = KConfigGroup(&cfg, "Wallpaper"); - m_currentWallpaperConfig = m_ownWallpaperConfig = new ConfigPropertyMap(new Plasma::ConfigLoader(&cfg, &file), this); + + syncWallpaperObjects(); } ContainmentConfigView::~ContainmentConfigView() @@ -113,13 +115,12 @@ void ContainmentConfigView::setCurrentWallpaper(const QString &wallpaper) return; } + delete m_ownWallpaperConfig; + m_ownWallpaperConfig = 0; + if (m_containment->wallpaper() == wallpaper) { - delete m_currentWallpaperConfig; - m_currentWallpaperConfig = m_ownWallpaperConfig; + syncWallpaperObjects(); } else { - if (m_containment->wallpaper() != m_currentWallpaper) { - delete m_currentWallpaperConfig; - } //we have to construct an independent ConfigPropertyMap when we want to configure wallpapers that are not the current one Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic"); @@ -128,7 +129,7 @@ void ContainmentConfigView::setCurrentWallpaper(const QString &wallpaper) QFile file(pkg.filePath("config", "main.xml")); KConfigGroup cfg = m_containment->config(); cfg = KConfigGroup(&cfg, "Wallpaper"); - m_currentWallpaperConfig = new ConfigPropertyMap(new Plasma::ConfigLoader(&cfg, &file), this); + m_currentWallpaperConfig = m_ownWallpaperConfig = new ConfigPropertyMap(new Plasma::ConfigLoader(&cfg, &file), this); } m_currentWallpaper = wallpaper; @@ -140,12 +141,20 @@ void ContainmentConfigView::applyWallpaper() { m_containment->setWallpaper(m_currentWallpaper); - if (m_currentWallpaperConfig != m_ownWallpaperConfig) { - delete m_currentWallpaperConfig; - m_currentWallpaperConfig = m_ownWallpaperConfig; - emit wallpaperConfigurationChanged(); - } + delete m_ownWallpaperConfig; + m_ownWallpaperConfig = 0; + + syncWallpaperObjects(); + emit wallpaperConfigurationChanged(); } +void ContainmentConfigView::syncWallpaperObjects() +{ + QObject *wallpaperGraphicsObject = m_containment->property("wallpaperGraphicsObject").value(); + engine()->rootContext()->setContextProperty("wallpaper", wallpaperGraphicsObject); + + //FIXME: why m_wallpaperGraphicsObject->property("configuration").value() doesn't work? + m_currentWallpaperConfig = static_cast(wallpaperGraphicsObject->property("configuration").value()); +} #include "moc_containmentconfigview.cpp" diff --git a/src/shell/containmentconfigview.h b/src/shell/containmentconfigview.h index 19f719c4a..b753d418b 100644 --- a/src/shell/containmentconfigview.h +++ b/src/shell/containmentconfigview.h @@ -54,6 +54,9 @@ Q_SIGNALS: void currentWallpaperChanged(); void wallpaperConfigurationChanged(); +protected: + void syncWallpaperObjects(); + private: Plasma::Containment *m_containment; ConfigModel *m_wallpaperConfigModel; From 001d88a0a486334fdc125967a5cdfc50ecac4d07 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Tue, 7 May 2013 12:31:52 +0200 Subject: [PATCH 11/80] bump the v# --- src/plasma/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt index 61b09767e..48eae09c1 100644 --- a/src/plasma/CMakeLists.txt +++ b/src/plasma/CMakeLists.txt @@ -164,8 +164,8 @@ target_link_libraries(plasma LINK_INTERFACE_LIBRARIES ${KDE4_KDECORE_LIBS} Qt5:: #do NOT use GENERIC versioning -- the plasma team will take care of versioning set_target_properties(plasma PROPERTIES - VERSION 4.0.0 - SOVERSION 4 + VERSION 5.0.0 + SOVERSION 5 ) install(TARGETS plasma EXPORT kdelibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) From 5ce80b4af4b79fd01addcc0775750e594b285ef9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 7 May 2013 21:57:54 +0200 Subject: [PATCH 12/80] fix return --- src/shell/panelview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index c4e33da89..ee880807b 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -144,7 +144,7 @@ int PanelView::thickness() const void PanelView::setThickness(int value) { if (value == thickness()) { - value; + return; } if (formFactor() == Plasma::Vertical) { From 67c901db1a9c0100c0671c4cfbc56f282d53b208 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Wed, 8 May 2013 10:08:26 +0200 Subject: [PATCH 13/80] Turns out order still matters... --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3261fff9..333ea0343 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ find_package(kdeqt5staging REQUIRED NO_MODULE) find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs XmlGui KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver KConfig KAuth kjs - ki18n kguiaddons kservice kwidgets ItemViews KCompletion KNotifications KJobWidgets KConfigWidgets KIconThemes) + ki18n kguiaddons kservice kwidgets ItemViews KNotifications KCompletion KJobWidgets KConfigWidgets KIconThemes) #find_package(KF5Transitional REQUIRED) # those are not "done" yet: From 37cfe4a023854483d2a8fcb16e95213e0176edfe Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 11:16:38 +0200 Subject: [PATCH 14/80] crude controls for panel geometry --- src/shell/panelview.cpp | 60 ++++- src/shell/panelview.h | 12 +- .../configuration/PanelConfiguration.qml | 230 +++++++++++++----- 3 files changed, 221 insertions(+), 81 deletions(-) diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index ee880807b..1791571c3 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -47,9 +47,6 @@ PanelView::PanelView(Plasma::Corona *corona, QWindow *parent) //TODO: how to take the shape from the framesvg? KWindowEffects::enableBlurBehind(winId(), true); - connect(this, &View::containmentChanged, - this, &PanelView::manageNewContainment); - //Screen management connect(screen(), &QScreen::virtualGeometryChanged, this, &PanelView::positionPanel); @@ -155,21 +152,55 @@ void PanelView::setThickness(int value) config().writeEntry("thickness", value); emit thicknessChanged(); } - -void PanelView::manageNewContainment() +int PanelView::maximumLength() const { - connect(containment()->actions()->action("configure"), &QAction::triggered, - this, &PanelView::showPanelController); + return m_maxLength; } -void PanelView::showPanelController() +void PanelView::setMaximumLength(int length) { - if (!m_panelConfigView) { - m_panelConfigView = new PanelConfigView(containment(), this); - m_panelConfigView->init(); + if (length == m_maxLength) { + return; } - m_panelConfigView->show(); + + if (m_minLength > length) { + setMinimumLength(length); + } + + if (formFactor() == Plasma::Vertical) { + setMaximumHeight(length); + } else { + setMaximumWidth(length); + } + config().writeEntry("maxLength", length); + m_maxLength = length; + emit maximumLengthChanged(); +} + +int PanelView::minimumLength() const +{ + return m_minLength; +} + +void PanelView::setMinimumLength(int length) +{ + if (length == m_minLength) { + return; + } + + if (m_maxLength < length) { + setMaximumLength(length); + } + + if (formFactor() == Plasma::Vertical) { + setMinimumHeight(length); + } else { + setMinimumWidth(length); + } + config().writeEntry("minLength", length); + m_minLength = length; + emit minimumLengthChanged(); } void PanelView::positionPanel() @@ -286,8 +317,11 @@ void PanelView::restore() } resize(config().readEntry("length", screen()->size().width()), config().readEntry("thickness", 32)); - } + + emit maximumLengthChanged(); + emit minimumLengthChanged(); + emit offsetChanged(); } #include "moc_panelview.cpp" diff --git a/src/shell/panelview.h b/src/shell/panelview.h index 29898dcd1..b54e2f80f 100644 --- a/src/shell/panelview.h +++ b/src/shell/panelview.h @@ -31,6 +31,8 @@ class PanelView : public View Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) Q_PROPERTY(int offset READ offset WRITE setOffset NOTIFY offsetChanged) Q_PROPERTY(int thickness READ thickness WRITE setThickness NOTIFY thicknessChanged) + Q_PROPERTY(int maximumLength READ maximumLength WRITE setMaximumLength NOTIFY maximumLengthChanged) + Q_PROPERTY(int minimumLength READ minimumLength WRITE setMinimumLength NOTIFY minimumLengthChanged) public: explicit PanelView(Plasma::Corona *corona, QWindow *parent = 0); @@ -49,15 +51,21 @@ public: int thickness() const; void setThickness(int thickness); + int maximumLength() const; + void setMaximumLength(int length); + + int minimumLength() const; + void setMinimumLength(int length); + Q_SIGNALS: void alignmentChanged(); void offsetChanged(); void screenGeometryChanged(); void thicknessChanged(); + void maximumLengthChanged(); + void minimumLengthChanged(); private Q_SLOTS: - void manageNewContainment(); - void showPanelController(); void positionPanel(); void restore(); diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index 37a263a40..7a42583b4 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -34,6 +34,7 @@ Rectangle { //END properties //BEGIN UI components + // Offset Rectangle { width: 32 height: 32 @@ -52,92 +53,189 @@ Rectangle { } Component.onCompleted: { if (panel.location == 5 || panel.location == 6) { - panel.offset = parent.y + parent.y = panel.offset } else { - panel.offset = parent.x + parent.x = panel.offset } } } } + //Minimum length Rectangle { - width: 100 + width: 32 height: 32 + MouseArea { + drag { + target: parent + axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis + } + anchors.fill: parent + onPositionChanged: { + if (panel.location == 5 || panel.location == 6) { + panel.minimumLength = parent.y + } else { + panel.minimumLength = parent.x + } + } + Component.onCompleted: { + if (panel.location == 5 || panel.location == 6) { + parent.y = panel.minimumLength + } else { + parent.x = panel.minimumLength + } + } + } + } + + //Maximum length + Rectangle { + width: 32 + height: 32 + MouseArea { + drag { + target: parent + axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis + } + anchors.fill: parent + onPositionChanged: { + if (panel.location == 5 || panel.location == 6) { + panel.maximumLength = parent.y + } else { + panel.maximumLength = parent.x + } + } + Component.onCompleted: { + if (panel.location == 5 || panel.location == 6) { + parent.y = panel.maximumLength + } else { + parent.x = panel.maximumLength + } + } + } + } + + Row { anchors { centerIn: parent } - QtExtras.MouseEventListener { - anchors.fill: parent - property int lastX - property int lastY - property int startMouseX - property int startMouseY - onPressed: { - lastX = mouse.screenX - lastY = mouse.screenY - startMouseX = mouse.x - startMouseY = mouse.y - } - onPositionChanged: { - switch (panel.location) { - //TopEdge - case 3: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y - panel.y = configDialog.y - panel.height - break - //LeftEdge - case 5: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x - panel.x = configDialog.x - panel.width - break; - //RightEdge - case 6: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x - panel.x = configDialog.x + configDialog.width - break; - //BottomEdge - case 4: - default: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y - panel.y = configDialog.y + configDialog.height + Rectangle { + width: 100 + height: 32 + + QtExtras.MouseEventListener { + anchors.fill: parent + property int lastX + property int lastY + property int startMouseX + property int startMouseY + onPressed: { + lastX = mouse.screenX + lastY = mouse.screenY + startMouseX = mouse.x + startMouseY = mouse.y } - - lastX = mouse.screenX - lastY = mouse.screenY - - var screenAspect = panel.screenGeometry.height / panel.screenGeometry.width - var newLocation = panel.location - - if (mouse.screenY < panel.screenGeometry.y+(mouse.screenX-panel.screenGeometry.x)*screenAspect) { - if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) { - if (panel.location == 3) { - return; - } else { - newLocation = 3; //FIXME: Plasma::TopEdge; - } - } else if (panel.location == 6) { - return; - } else { - newLocation = 6; //FIXME: Plasma::RightEdge; + onPositionChanged: { + switch (panel.location) { + //TopEdge + case 3: + configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + panel.y = configDialog.y - panel.height + break + //LeftEdge + case 5: + configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + panel.x = configDialog.x - panel.width + break; + //RightEdge + case 6: + configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + panel.x = configDialog.x + configDialog.width + break; + //BottomEdge + case 4: + default: + configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + panel.y = configDialog.y + configDialog.height } - } else { - if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) { - if (panel.location == 5) { - return; + lastX = mouse.screenX + lastY = mouse.screenY + + var screenAspect = panel.screenGeometry.height / panel.screenGeometry.width + var newLocation = panel.location + + if (mouse.screenY < panel.screenGeometry.y+(mouse.screenX-panel.screenGeometry.x)*screenAspect) { + if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) { + if (panel.location == 3) { + return; + } else { + newLocation = 3; //FIXME: Plasma::TopEdge; + } + } else if (panel.location == 6) { + return; } else { - newLocation = 5; //FIXME: Plasma::LeftEdge; + newLocation = 6; //FIXME: Plasma::RightEdge; } - } else if(panel.location == 4) { - return; + } else { - newLocation = 4; //FIXME: Plasma::BottomEdge; + if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) { + if (panel.location == 5) { + return; + } else { + newLocation = 5; //FIXME: Plasma::LeftEdge; + } + } else if(panel.location == 4) { + return; + } else { + newLocation = 4; //FIXME: Plasma::BottomEdge; + } + } + panel.location = newLocation + print("New Location: " + newLocation); + } + onReleased: panelResetAnimation.running = true + PlasmaComponents.Label { + text: "Position" + } + } + } + Rectangle { + width: 100 + height: 32 + QtExtras.MouseEventListener { + anchors.fill: parent + property int startMouseX + property int startMouseY + onPressed: { + startMouseX = mouse.x + startMouseY = mouse.y + } + onPositionChanged: { + switch (panel.location) { + //TopEdge + case 3: + configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + panel.thickness = configDialog.y - panel.y + //LeftEdge + case 5: + configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + panel.thickness = configDialog.x - panel.x + //RightEdge + case 6: + configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + panel.thickness = (panel.x + panel.width) - (configDialog.x + configDialog.width) + //BottomEdge + case 4: + default: + configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + panel.thickness = (panel.y + panel.height) - (configDialog.y + configDialog.height) } } - panel.location = newLocation - print("New Location: " + newLocation); + PlasmaComponents.Label { + text: "Height" + } } - onReleased: panelResetAnimation.running = true } } ParallelAnimation { From c28b0676ac65edeca5bc2d8f859c7c2fefe078b2 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 11:20:06 +0200 Subject: [PATCH 15/80] working thickness settings --- .../desktop/contents/configuration/PanelConfiguration.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index 7a42583b4..0892325e7 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -217,14 +217,17 @@ Rectangle { case 3: configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y panel.thickness = configDialog.y - panel.y + break; //LeftEdge case 5: configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x panel.thickness = configDialog.x - panel.x + break; //RightEdge case 6: configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x panel.thickness = (panel.x + panel.width) - (configDialog.x + configDialog.width) + break; //BottomEdge case 4: default: From a6c82d8a5e25f0264be0051fd393ed79ac7070d9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 13:52:40 +0200 Subject: [PATCH 16/80] correctly save and restore to/from plasma-shellrc --- src/shell/desktopcorona.cpp | 30 +++++++++++++++++-- src/shell/desktopcorona.h | 12 ++++++++ src/shell/panelview.cpp | 27 ++++++++++------- src/shell/panelview.h | 4 ++- .../configuration/PanelConfiguration.qml | 28 +++++++++++++++++ 5 files changed, 88 insertions(+), 13 deletions(-) diff --git a/src/shell/desktopcorona.cpp b/src/shell/desktopcorona.cpp index fc04abd1d..f0599fd0e 100644 --- a/src/shell/desktopcorona.cpp +++ b/src/shell/desktopcorona.cpp @@ -45,6 +45,12 @@ DesktopCorona::DesktopCorona(QObject *parent) { m_desktopDefaultsConfig = KConfigGroup(KSharedConfig::openConfig(package().filePath("defaults")), "Desktop"); + m_appConfigSyncTimer = new QTimer(this); + m_appConfigSyncTimer->setSingleShot(true); + connect(m_appConfigSyncTimer, &QTimer::timeout, + this, &DesktopCorona::syncAppConfig); + + connect(m_desktopWidget, SIGNAL(resized(int)), this, SLOT(screenResized(int))); connect(m_desktopWidget, SIGNAL(screenCountChanged(int)), @@ -64,6 +70,20 @@ DesktopCorona::~DesktopCorona() { } +KSharedConfig::Ptr DesktopCorona::applicationConfig() +{ + return KSharedConfig::openConfig(); +} + +void DesktopCorona::requestApplicationConfigSync() +{ + // constant controlling how long between requesting a configuration sync + // and one happening should occur. currently 10 seconds + static const int CONFIG_SYNC_TIMEOUT = 10000; + + m_appConfigSyncTimer->start(CONFIG_SYNC_TIMEOUT); +} + void DesktopCorona::loadDefaultLayout() { WorkspaceScripting::DesktopScriptEngine scriptEngine(this, true); @@ -155,7 +175,7 @@ void DesktopCorona::checkDesktop(/*Activity *activity,*/ bool signalWhenExists, qWarning() << "Invalid screen"; } c->flushPendingConstraintsEvents(); - requestConfigSync(); + requestApplicationConfigSync(); if (signalWhenExists) { emit containmentAdded(c); @@ -292,6 +312,12 @@ void DesktopCorona::showWidgetExplorer() m_widgetExplorerView->show(); } +void DesktopCorona::syncAppConfig() +{ + qDebug() << "Syncing plasma-shellrc config"; + applicationConfig()->sync(); +} + void DesktopCorona::printScriptError(const QString &error) { qWarning() << error; @@ -302,5 +328,5 @@ void DesktopCorona::printScriptMessage(const QString &message) qDebug() << message; } -#include "desktopcorona.moc" +#include "moc_desktopcorona.cpp" diff --git a/src/shell/desktopcorona.h b/src/shell/desktopcorona.h index cbdc1a6e8..f53d32b46 100644 --- a/src/shell/desktopcorona.h +++ b/src/shell/desktopcorona.h @@ -45,6 +45,16 @@ public: explicit DesktopCorona(QObject * parent = 0); ~DesktopCorona(); + /** + * Where to save global configuration that doesn't have anything to do with the scene (e.g. views) + */ + KSharedConfig::Ptr applicationConfig(); + + /** + * Request saving applicationConfig on disk, it's event compressed, not immediate + */ + void requestApplicationConfigSync(); + /** * Loads the default (system wide) layout for this user **/ @@ -88,6 +98,7 @@ protected Q_SLOTS: private Q_SLOTS: void handleContainmentAdded(Plasma::Containment *c); void showWidgetExplorer(); + void syncAppConfig(); private: QDesktopWidget *m_desktopWidget; @@ -95,6 +106,7 @@ private: WidgetExplorerView *m_widgetExplorerView; QHash m_panelViews; KConfigGroup m_desktopDefaultsConfig; + QTimer *m_appConfigSyncTimer; }; #endif diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index 1791571c3..3072d320a 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -17,6 +17,7 @@ */ #include "panelview.h" +#include "desktopcorona.h" #include #include @@ -29,12 +30,13 @@ #include #include -PanelView::PanelView(Plasma::Corona *corona, QWindow *parent) +PanelView::PanelView(DesktopCorona *corona, QWindow *parent) : View(corona, parent), m_offset(0), m_maxLength(0), m_minLength(0), - m_alignment(Qt::AlignLeft) + m_alignment(Qt::AlignLeft), + m_corona(corona) { QSurfaceFormat format; format.setAlphaBufferSize(8); @@ -70,7 +72,8 @@ PanelView::~PanelView() config().writeEntry("thickness", size().height()); } config().writeEntry("alignment", (int)m_alignment); - containment()->corona()->requestConfigSync(); + m_corona->requestApplicationConfigSync(); + m_corona->requestApplicationConfigSync(); } } @@ -79,7 +82,7 @@ KConfigGroup PanelView::config() const if (!containment()) { return KConfigGroup(); } - KConfigGroup views(KSharedConfig::openConfig(), "PlasmaViews"); + KConfigGroup views(m_corona->applicationConfig(), "PlasmaViews"); views = KConfigGroup(&views, QString("Panel %1").arg(containment()->id())); if (containment()->formFactor() == Plasma::Vertical) { @@ -92,12 +95,12 @@ KConfigGroup PanelView::config() const void PanelView::init() { - if (!corona()->package().isValid()) { + if (!m_corona->package().isValid()) { qWarning() << "Invalid home screen package"; } setResizeMode(View::SizeRootObjectToView); - setSource(QUrl::fromLocalFile(corona()->package().filePath("views", "Panel.qml"))); + setSource(QUrl::fromLocalFile(m_corona->package().filePath("views", "Panel.qml"))); positionPanel(); } @@ -131,6 +134,7 @@ void PanelView::setOffset(int offset) config().writeEntry("offset", m_offset); positionPanel(); emit offsetChanged(); + m_corona->requestApplicationConfigSync(); } int PanelView::thickness() const @@ -145,12 +149,13 @@ void PanelView::setThickness(int value) } if (formFactor() == Plasma::Vertical) { - return setWidth(value); + setWidth(value); } else { - return setHeight(value); + setHeight(value); } config().writeEntry("thickness", value); emit thicknessChanged(); + m_corona->requestApplicationConfigSync(); } int PanelView::maximumLength() const @@ -176,6 +181,7 @@ void PanelView::setMaximumLength(int length) config().writeEntry("maxLength", length); m_maxLength = length; emit maximumLengthChanged(); + m_corona->requestApplicationConfigSync(); } int PanelView::minimumLength() const @@ -201,6 +207,7 @@ void PanelView::setMinimumLength(int length) config().writeEntry("minLength", length); m_minLength = length; emit minimumLengthChanged(); + m_corona->requestApplicationConfigSync(); } void PanelView::positionPanel() @@ -289,8 +296,8 @@ void PanelView::restore() } m_offset = config().readEntry("offset", 0); - m_maxLength = config().readEntry("max", -1); - m_minLength = config().readEntry("min", -1); + m_maxLength = config().readEntry("maxLength", -1); + m_minLength = config().readEntry("minLength", -1); m_alignment = (Qt::Alignment)config().readEntry("alignment", Qt::AlignLeft); setMinimumSize(QSize(-1, -1)); diff --git a/src/shell/panelview.h b/src/shell/panelview.h index b54e2f80f..29e168795 100644 --- a/src/shell/panelview.h +++ b/src/shell/panelview.h @@ -24,6 +24,7 @@ #include "panelconfigview.h" #include +class DesktopCorona; class PanelView : public View { @@ -35,7 +36,7 @@ class PanelView : public View Q_PROPERTY(int minimumLength READ minimumLength WRITE setMinimumLength NOTIFY minimumLengthChanged) public: - explicit PanelView(Plasma::Corona *corona, QWindow *parent = 0); + explicit PanelView(DesktopCorona *corona, QWindow *parent = 0); virtual ~PanelView(); virtual KConfigGroup config() const; @@ -75,6 +76,7 @@ private: int m_minLength; Qt::Alignment m_alignment; QPointer m_panelConfigView; + DesktopCorona *m_corona; }; #endif // PANELVIEW_H diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index 0892325e7..a0d99d576 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -33,11 +33,31 @@ Rectangle { height: 64 //END properties +//BEGIN Connections + Connections { + target: panel + onOffsetChanged: offsetHandle.value = panel.offset + onMinimumLengthChanged: minimumLengthHandle.value = panel.minimumLength + onMaximumLengthChanged: maximumLengthHandle.value = panel.maximumLength + } +//END Connections + //BEGIN UI components // Offset Rectangle { + id: offsetHandle width: 32 height: 32 + + property int value + onValueChanged: { + if (panel.location == 5 || panel.location == 6) { + parent.y = panel.offset + } else { + parent.x = panel.offset + } + } + MouseArea { drag { target: parent @@ -63,8 +83,12 @@ Rectangle { //Minimum length Rectangle { + id: minimumLengthHandle width: 32 height: 32 + + property int value + MouseArea { drag { target: parent @@ -90,8 +114,12 @@ Rectangle { //Maximum length Rectangle { + id: maximumLengthHandle width: 32 height: 32 + + property int value + MouseArea { drag { target: parent From 9f88d14d73107157e7ebafc4d0191efe17d89183 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 14:10:16 +0200 Subject: [PATCH 17/80] geometry controls quite reliable alignment still completely todo --- .../configuration/PanelConfiguration.qml | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index a0d99d576..f7690c008 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -52,9 +52,9 @@ Rectangle { property int value onValueChanged: { if (panel.location == 5 || panel.location == 6) { - parent.y = panel.offset + y = panel.offset } else { - parent.x = panel.offset + x = panel.offset } } @@ -79,6 +79,9 @@ Rectangle { } } } + PlasmaComponents.Label { + text: "Offset" + } } //Minimum length @@ -88,6 +91,13 @@ Rectangle { height: 32 property int value + onValueChanged: { + if (panel.location == 5 || panel.location == 6) { + y = panel.minimumLength + panel.offset + } else { + x = panel.minimumLength + panel.offset + } + } MouseArea { drag { @@ -97,19 +107,22 @@ Rectangle { anchors.fill: parent onPositionChanged: { if (panel.location == 5 || panel.location == 6) { - panel.minimumLength = parent.y + panel.minimumLength = parent.y - panel.offset } else { - panel.minimumLength = parent.x + panel.minimumLength = parent.x - panel.offset } } Component.onCompleted: { if (panel.location == 5 || panel.location == 6) { - parent.y = panel.minimumLength + parent.y = panel.minimumLength + panel.offset } else { - parent.x = panel.minimumLength + parent.x = panel.minimumLength + panel.offset } } } + PlasmaComponents.Label { + text: "Min" + } } //Maximum length @@ -119,6 +132,13 @@ Rectangle { height: 32 property int value + onValueChanged: { + if (panel.location == 5 || panel.location == 6) { + y = panel.maximumLength + panel.offset + } else { + x = panel.maximumLength + panel.offset + } + } MouseArea { drag { @@ -128,19 +148,22 @@ Rectangle { anchors.fill: parent onPositionChanged: { if (panel.location == 5 || panel.location == 6) { - panel.maximumLength = parent.y + panel.maximumLength = parent.y - panel.offset } else { - panel.maximumLength = parent.x + panel.maximumLength = parent.x - panel.offset } } Component.onCompleted: { if (panel.location == 5 || panel.location == 6) { - parent.y = panel.maximumLength + parent.y = panel.maximumLength + panel.offset } else { - parent.x = panel.maximumLength + parent.x = panel.maximumLength + panel.offset } } } + PlasmaComponents.Label { + text: "Max" + } } Row { From 8c07b27cb29ae24670045eb3b822489c1307b954 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 14:22:22 +0200 Subject: [PATCH 18/80] move the offset button in new file --- .../configuration/PanelConfiguration.qml | 41 ++---------- .../panelconfiguration/OffsetButton.qml | 65 +++++++++++++++++++ 2 files changed, 69 insertions(+), 37 deletions(-) create mode 100644 src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetButton.qml diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index f7690c008..bfa3aeb96 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -22,6 +22,8 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.configuration 2.0 import org.kde.qtextracomponents 2.0 as QtExtras +import "panelconfiguration" + //TODO: all of this will be done with desktop components Rectangle { @@ -42,46 +44,11 @@ Rectangle { } //END Connections + //BEGIN UI components // Offset - Rectangle { + OffsetButton { id: offsetHandle - width: 32 - height: 32 - - property int value - onValueChanged: { - if (panel.location == 5 || panel.location == 6) { - y = panel.offset - } else { - x = panel.offset - } - } - - MouseArea { - drag { - target: parent - axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis - } - anchors.fill: parent - onPositionChanged: { - if (panel.location == 5 || panel.location == 6) { - panel.offset = parent.y - } else { - panel.offset = parent.x - } - } - Component.onCompleted: { - if (panel.location == 5 || panel.location == 6) { - parent.y = panel.offset - } else { - parent.x = panel.offset - } - } - } - PlasmaComponents.Label { - text: "Offset" - } } //Minimum length diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetButton.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetButton.qml new file mode 100644 index 000000000..cba9373cc --- /dev/null +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetButton.qml @@ -0,0 +1,65 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. + */ + +import QtQuick 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.configuration 2.0 +import org.kde.qtextracomponents 2.0 as QtExtras + + +Rectangle { + id: offsetHandle + width: 32 + height: 32 + + property int value + onValueChanged: { + if (panel.location == 5 || panel.location == 6) { + y = panel.offset + } else { + x = panel.offset + } + } + + MouseArea { + drag { + target: parent + axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis + } + anchors.fill: parent + onPositionChanged: { + if (panel.location == 5 || panel.location == 6) { + panel.offset = parent.y + } else { + panel.offset = parent.x + } + } + Component.onCompleted: { + if (panel.location == 5 || panel.location == 6) { + parent.y = panel.offset + } else { + parent.x = panel.offset + } + } + } + PlasmaComponents.Label { + text: "Offset" + } +} From 8e14ed33a4e44e8816c877dbace079cdd523cd5e Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 19:32:23 +0200 Subject: [PATCH 19/80] e svg for the ruler --- .../configuration/PanelConfiguration.qml | 105 ++------- .../MaximumLengthHandle.qml | 95 ++++++++ .../MinimumLengthHandle.qml | 95 ++++++++ .../{OffsetButton.qml => OffsetHandle.qml} | 44 +++- .../panelconfiguration/Ruler.qml | 221 ++++++++++++++++++ 5 files changed, 468 insertions(+), 92 deletions(-) create mode 100644 src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MaximumLengthHandle.qml create mode 100644 src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MinimumLengthHandle.qml rename src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/{OffsetButton.qml => OffsetHandle.qml} (68%) create mode 100644 src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index bfa3aeb96..f163e7e81 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -38,99 +38,34 @@ Rectangle { //BEGIN Connections Connections { target: panel - onOffsetChanged: offsetHandle.value = panel.offset - onMinimumLengthChanged: minimumLengthHandle.value = panel.minimumLength - onMaximumLengthChanged: maximumLengthHandle.value = panel.maximumLength + onOffsetChanged: ruler.offset = panel.offset + onMinimumLengthChanged: ruler.minimumLength = panel.minimumLength + onMaximumLengthChanged: ruler.maximumLength = panel.maximumLength } //END Connections //BEGIN UI components - // Offset - OffsetButton { - id: offsetHandle - } - //Minimum length - Rectangle { - id: minimumLengthHandle - width: 32 - height: 32 - - property int value - onValueChanged: { - if (panel.location == 5 || panel.location == 6) { - y = panel.minimumLength + panel.offset - } else { - x = panel.minimumLength + panel.offset + Ruler { + id: ruler + state: { + switch (panel.location) { + //TopEdge + case 3: + return "TopEdge" + //LeftEdge + case 5: + return "LeftEdge" + //RightEdge + case 6: + return "RightEdge" + //BottomEdge + case 4: + default: + return "BottomEdge" } } - - MouseArea { - drag { - target: parent - axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis - } - anchors.fill: parent - onPositionChanged: { - if (panel.location == 5 || panel.location == 6) { - panel.minimumLength = parent.y - panel.offset - } else { - panel.minimumLength = parent.x - panel.offset - } - } - Component.onCompleted: { - if (panel.location == 5 || panel.location == 6) { - parent.y = panel.minimumLength + panel.offset - } else { - parent.x = panel.minimumLength + panel.offset - } - } - } - PlasmaComponents.Label { - text: "Min" - } - } - - //Maximum length - Rectangle { - id: maximumLengthHandle - width: 32 - height: 32 - - property int value - onValueChanged: { - if (panel.location == 5 || panel.location == 6) { - y = panel.maximumLength + panel.offset - } else { - x = panel.maximumLength + panel.offset - } - } - - MouseArea { - drag { - target: parent - axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis - } - anchors.fill: parent - onPositionChanged: { - if (panel.location == 5 || panel.location == 6) { - panel.maximumLength = parent.y - panel.offset - } else { - panel.maximumLength = parent.x - panel.offset - } - } - Component.onCompleted: { - if (panel.location == 5 || panel.location == 6) { - parent.y = panel.maximumLength + panel.offset - } else { - parent.x = panel.maximumLength + panel.offset - } - } - } - PlasmaComponents.Label { - text: "Max" - } } Row { diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MaximumLengthHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MaximumLengthHandle.qml new file mode 100644 index 000000000..22221148e --- /dev/null +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MaximumLengthHandle.qml @@ -0,0 +1,95 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. + */ + +import QtQuick 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.configuration 2.0 +import org.kde.qtextracomponents 2.0 as QtExtras + + +PlasmaCore.SvgItem { + id: root + svg: containmentControlsSvg + state: parent.state + width: naturalSize.width + height: naturalSize.height + + property int value + onValueChanged: { + if (panel.location == 5 || panel.location == 6) { + y = panel.maximumLength + panel.offset + } else { + x = panel.maximumLength + panel.offset + } + } + + MouseArea { + drag { + target: parent + axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis + } + anchors.fill: parent + onPositionChanged: { + if (panel.location == 5 || panel.location == 6) { + panel.maximumLength = parent.y - panel.offset + } else { + panel.maximumLength = parent.x - panel.offset + } + } + Component.onCompleted: { + if (panel.location == 5 || panel.location == 6) { + parent.y = panel.maximumLength + panel.offset + } else { + parent.x = panel.maximumLength + panel.offset + } + } + } + + states: [ + State { + name: "TopEdge" + PropertyChanges { + target: root + elementId: "north-maxslider" + } + }, + State { + name: "BottomEdge" + PropertyChanges { + target: root + elementId: "south-maxslider" + } + }, + State { + name: "LeftEdge" + PropertyChanges { + target: root + elementId: "west-maxslider" + } + }, + State { + name: "RightEdge" + PropertyChanges { + target: root + elementId: "east-maxslider" + } + } + ] +} diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MinimumLengthHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MinimumLengthHandle.qml new file mode 100644 index 000000000..8df27b339 --- /dev/null +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MinimumLengthHandle.qml @@ -0,0 +1,95 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. + */ + +import QtQuick 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.configuration 2.0 +import org.kde.qtextracomponents 2.0 as QtExtras + + +PlasmaCore.SvgItem { + id: root + svg: containmentControlsSvg + state: parent.state + width: naturalSize.width + height: naturalSize.height + + property int value + onValueChanged: { + if (panel.location == 5 || panel.location == 6) { + y = panel.minimumLength + panel.offset + } else { + x = panel.minimumLength + panel.offset + } + } + + MouseArea { + drag { + target: parent + axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis + } + anchors.fill: parent + onPositionChanged: { + if (panel.location == 5 || panel.location == 6) { + panel.minimumLength = parent.y - panel.offset + } else { + panel.minimumLength = parent.x - panel.offset + } + } + Component.onCompleted: { + if (panel.location == 5 || panel.location == 6) { + parent.y = panel.minimumLength + panel.offset + } else { + parent.x = panel.minimumLength + panel.offset + } + } + } + + states: [ + State { + name: "TopEdge" + PropertyChanges { + target: root + elementId: "north-minslider" + } + }, + State { + name: "BottomEdge" + PropertyChanges { + target: root + elementId: "south-minslider" + } + }, + State { + name: "LeftEdge" + PropertyChanges { + target: root + elementId: "west-minslider" + } + }, + State { + name: "RightEdge" + PropertyChanges { + target: root + elementId: "east-minslider" + } + } + ] +} diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetButton.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetHandle.qml similarity index 68% rename from src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetButton.qml rename to src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetHandle.qml index cba9373cc..e8fdbbc0c 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetButton.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetHandle.qml @@ -24,10 +24,12 @@ import org.kde.plasma.configuration 2.0 import org.kde.qtextracomponents 2.0 as QtExtras -Rectangle { - id: offsetHandle - width: 32 - height: 32 +PlasmaCore.SvgItem { + id: root + svg: containmentControlsSvg + state: parent.state + width: naturalSize.width + height: naturalSize.height property int value onValueChanged: { @@ -59,7 +61,35 @@ Rectangle { } } } - PlasmaComponents.Label { - text: "Offset" - } + + states: [ + State { + name: "TopEdge" + PropertyChanges { + target: root + elementId: "north-offsetslider" + } + }, + State { + name: "BottomEdge" + PropertyChanges { + target: root + elementId: "south-offsetslider" + } + }, + State { + name: "LeftEdge" + PropertyChanges { + target: root + elementId: "west-offsetslider" + } + }, + State { + name: "RightEdge" + PropertyChanges { + target: root + elementId: "east-offsetslider" + } + } + ] } diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml new file mode 100644 index 000000000..e7cf57d7d --- /dev/null +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -0,0 +1,221 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. + */ + +import QtQuick 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.configuration 2.0 +import org.kde.qtextracomponents 2.0 as QtExtras + + +PlasmaCore.FrameSvgItem { + id: root + imagePath: "widgets/containment-controls" + state: "BottomEdge" + implicitWidth: offsetButton.implicitwidth + minimumLengthHandle.implicitwidth + implicitHeight: 32//offsetButton.implicitheight + minimumLengthHandle.implicitheight + PlasmaCore.Svg { + id: containmentControlsSvg + imagePath: "widgets/containment-controls" + } + OffsetHandle { + id: offsetButton + } + MinimumLengthHandle { + id: minimumLengthHandle + } + MaximumLengthHandle { + id: maximumLengthHandle + } + + states: [ + State { + name: "TopEdge" + PropertyChanges { + target: root + prefix: "north" + } + AnchorChanges { + target: root + anchors { + top: root.parent.top + bottom: undefined + left: root.parent.left + right: root.parent.right + } + } + AnchorChanges { + target: offsetHandle + anchors { + top: undefined + bottom: root.bottom + left: undefined + right: undefined + } + } + AnchorChanges { + target: minimumLengthHandle + anchors { + top: root.top + bottom: undefined + left: undefined + right: undefined + } + } + AnchorChanges { + target: maximumLengthHandle + anchors { + top: undefined + bottom: root.bottom + left: undefined + right: undefined + } + } + }, + State { + name: "BottomEdge" + PropertyChanges { + target: root + prefix: "south" + } + AnchorChanges { + target: root + anchors { + top: undefined + bottom: root.parent.bottom + left: root.parent.left + right: root.parent.right + } + } + AnchorChanges { + target: offsetHandle + anchors { + top: root.top + bottom: undefined + left: undefined + right: undefined + } + } + AnchorChanges { + target: minimumLengthHandle + anchors { + top: undefined + bottom: root.bottom + left: undefined + right: undefined + } + } + AnchorChanges { + target: maximumLengthHandle + anchors { + top: root.top + bottom: undefined + left: undefined + right: undefined + } + } + }, + State { + name: "LeftEdge" + PropertyChanges { + target: root + prefix: "west" + } + AnchorChanges { + target: root + anchors { + top: root.parent.top + bottom: root.parent.bottom + left: root.parent.left + right: undefined + } + } + AnchorChanges { + target: offsetHandle + anchors { + top: undefined + bottom: undefined + left: undefined + right: root.right + } + } + AnchorChanges { + target: minimumLengthHandle + anchors { + top: undefined + bottom: undefined + left: root.left + right: undefined + } + } + AnchorChanges { + target: maximumLengthHandle + anchors { + top: undefined + bottom: undefined + left: undefined + right: root.right + } + } + }, + State { + name: "RightEdge" + PropertyChanges { + target: root + prefix: "east" + } + AnchorChanges { + target: root + anchors { + top: root.parent.top + bottom: root.parent.bottom + left: undefined + right: root.parent.right + } + } + AnchorChanges { + target: offsetHandle + anchors { + top: undefined + bottom: undefined + left: parent.left + right: undefined + } + } + AnchorChanges { + target: minimumLengthHandle + anchors { + top: undefined + bottom: undefined + left: undefined + right: parent.right + } + } + AnchorChanges { + target: maximumLengthHandle + anchors { + top: undefined + bottom: undefined + left: parent.left + right: undefined + } + } + } + ] +} From 07b1f67ec5622cc417f940de8264fb349d0d38cc Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 19:39:36 +0200 Subject: [PATCH 20/80] svg for controller background --- .../configuration/PanelConfiguration.qml | 74 ++++++++++++++----- .../panelconfiguration/Ruler.qml | 7 +- 2 files changed, 61 insertions(+), 20 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index f163e7e81..32afb0527 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -26,11 +26,30 @@ import "panelconfiguration" //TODO: all of this will be done with desktop components -Rectangle { +PlasmaCore.FrameSvgItem { id: root + imagePath: "dialogs/background" + + state: { + switch (panel.location) { + //TopEdge + case 3: + return "TopEdge" + //LeftEdge + case 5: + return "LeftEdge" + //RightEdge + case 6: + return "RightEdge" + //BottomEdge + case 4: + default: + return "BottomEdge" + } + } + //BEGIN properties - color: "lightgray" width: 640 height: 64 //END properties @@ -49,23 +68,7 @@ Rectangle { Ruler { id: ruler - state: { - switch (panel.location) { - //TopEdge - case 3: - return "TopEdge" - //LeftEdge - case 5: - return "LeftEdge" - //RightEdge - case 6: - return "RightEdge" - //BottomEdge - case 4: - default: - return "BottomEdge" - } - } + state: root.state } Row { @@ -249,4 +252,37 @@ Rectangle { } } //END UI components + +//BEGIN States +states: [ + State { + name: "TopEdge" + PropertyChanges { + target: root + enabledBorders: "TopBorder|BottomBorder" + } + }, + State { + name: "BottomEdge" + PropertyChanges { + target: root + enabledBorders: "TopBorder|BottomBorder" + } + }, + State { + name: "LeftEdge" + PropertyChanges { + target: root + enabledBorders: "LeftBorder|RightBorder" + } + }, + State { + name: "RightEdge" + PropertyChanges { + target: root + enabledBorders: "LeftBorder|RightBorder" + } + } + ] +//END States } diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml index e7cf57d7d..51db05202 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -26,6 +26,11 @@ import org.kde.qtextracomponents 2.0 as QtExtras PlasmaCore.FrameSvgItem { id: root + + property alias offset: offsetHandle.value + property alias minimumLength: minimumLengthHandle.value + property alias maximumLength: maximumLengthHandle.value + imagePath: "widgets/containment-controls" state: "BottomEdge" implicitWidth: offsetButton.implicitwidth + minimumLengthHandle.implicitwidth @@ -35,7 +40,7 @@ PlasmaCore.FrameSvgItem { imagePath: "widgets/containment-controls" } OffsetHandle { - id: offsetButton + id: offsetHandle } MinimumLengthHandle { id: minimumLengthHandle From b860d42cb11a9750d5646a312416814f21132cf1 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 21:51:34 +0200 Subject: [PATCH 21/80] duplication-- --- .../MaximumLengthHandle.qml | 95 ------------------- .../MinimumLengthHandle.qml | 95 ------------------- .../panelconfiguration/Ruler.qml | 26 +++-- .../{OffsetHandle.qml => SliderHandle.qml} | 25 ++--- 4 files changed, 30 insertions(+), 211 deletions(-) delete mode 100644 src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MaximumLengthHandle.qml delete mode 100644 src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MinimumLengthHandle.qml rename src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/{OffsetHandle.qml => SliderHandle.qml} (80%) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MaximumLengthHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MaximumLengthHandle.qml deleted file mode 100644 index 22221148e..000000000 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MaximumLengthHandle.qml +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2013 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. - */ - -import QtQuick 2.0 -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.configuration 2.0 -import org.kde.qtextracomponents 2.0 as QtExtras - - -PlasmaCore.SvgItem { - id: root - svg: containmentControlsSvg - state: parent.state - width: naturalSize.width - height: naturalSize.height - - property int value - onValueChanged: { - if (panel.location == 5 || panel.location == 6) { - y = panel.maximumLength + panel.offset - } else { - x = panel.maximumLength + panel.offset - } - } - - MouseArea { - drag { - target: parent - axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis - } - anchors.fill: parent - onPositionChanged: { - if (panel.location == 5 || panel.location == 6) { - panel.maximumLength = parent.y - panel.offset - } else { - panel.maximumLength = parent.x - panel.offset - } - } - Component.onCompleted: { - if (panel.location == 5 || panel.location == 6) { - parent.y = panel.maximumLength + panel.offset - } else { - parent.x = panel.maximumLength + panel.offset - } - } - } - - states: [ - State { - name: "TopEdge" - PropertyChanges { - target: root - elementId: "north-maxslider" - } - }, - State { - name: "BottomEdge" - PropertyChanges { - target: root - elementId: "south-maxslider" - } - }, - State { - name: "LeftEdge" - PropertyChanges { - target: root - elementId: "west-maxslider" - } - }, - State { - name: "RightEdge" - PropertyChanges { - target: root - elementId: "east-maxslider" - } - } - ] -} diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MinimumLengthHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MinimumLengthHandle.qml deleted file mode 100644 index 8df27b339..000000000 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/MinimumLengthHandle.qml +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2013 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. - */ - -import QtQuick 2.0 -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.configuration 2.0 -import org.kde.qtextracomponents 2.0 as QtExtras - - -PlasmaCore.SvgItem { - id: root - svg: containmentControlsSvg - state: parent.state - width: naturalSize.width - height: naturalSize.height - - property int value - onValueChanged: { - if (panel.location == 5 || panel.location == 6) { - y = panel.minimumLength + panel.offset - } else { - x = panel.minimumLength + panel.offset - } - } - - MouseArea { - drag { - target: parent - axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis - } - anchors.fill: parent - onPositionChanged: { - if (panel.location == 5 || panel.location == 6) { - panel.minimumLength = parent.y - panel.offset - } else { - panel.minimumLength = parent.x - panel.offset - } - } - Component.onCompleted: { - if (panel.location == 5 || panel.location == 6) { - parent.y = panel.minimumLength + panel.offset - } else { - parent.x = panel.minimumLength + panel.offset - } - } - } - - states: [ - State { - name: "TopEdge" - PropertyChanges { - target: root - elementId: "north-minslider" - } - }, - State { - name: "BottomEdge" - PropertyChanges { - target: root - elementId: "south-minslider" - } - }, - State { - name: "LeftEdge" - PropertyChanges { - target: root - elementId: "west-minslider" - } - }, - State { - name: "RightEdge" - PropertyChanges { - target: root - elementId: "east-minslider" - } - } - ] -} diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml index 51db05202..0d0d62bc5 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -26,29 +26,43 @@ import org.kde.qtextracomponents 2.0 as QtExtras PlasmaCore.FrameSvgItem { id: root - + property alias offset: offsetHandle.value property alias minimumLength: minimumLengthHandle.value property alias maximumLength: maximumLengthHandle.value - + imagePath: "widgets/containment-controls" state: "BottomEdge" implicitWidth: offsetButton.implicitwidth + minimumLengthHandle.implicitwidth implicitHeight: 32//offsetButton.implicitheight + minimumLengthHandle.implicitheight + + Component.onCompleted: { + offsetHandle.value = panel.offset + minimumLengthHandle.value = panel.minimumLength + maximumLengthHandle.value = panel.maximumLength + } + PlasmaCore.Svg { id: containmentControlsSvg imagePath: "widgets/containment-controls" } - OffsetHandle { + + SliderHandle { id: offsetHandle + graphicElementName: "offsetslider" + onValueChanged: panel.offset = value } - MinimumLengthHandle { + SliderHandle { id: minimumLengthHandle + graphicElementName: "minslider" + onValueChanged: panel.minimumLength = value } - MaximumLengthHandle { + SliderHandle { id: maximumLengthHandle + graphicElementName: "maxslider" + onValueChanged: panel.maximumLength = value } - + states: [ State { name: "TopEdge" diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml similarity index 80% rename from src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetHandle.qml rename to src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml index e8fdbbc0c..c7fd63ab6 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/OffsetHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml @@ -32,11 +32,13 @@ PlasmaCore.SvgItem { height: naturalSize.height property int value + property string graphicElementName + onValueChanged: { if (panel.location == 5 || panel.location == 6) { - y = panel.offset + y = value } else { - x = panel.offset + x = value } } @@ -48,16 +50,9 @@ PlasmaCore.SvgItem { anchors.fill: parent onPositionChanged: { if (panel.location == 5 || panel.location == 6) { - panel.offset = parent.y + root.value = parent.y } else { - panel.offset = parent.x - } - } - Component.onCompleted: { - if (panel.location == 5 || panel.location == 6) { - parent.y = panel.offset - } else { - parent.x = panel.offset + root.value = parent.x } } } @@ -67,28 +62,28 @@ PlasmaCore.SvgItem { name: "TopEdge" PropertyChanges { target: root - elementId: "north-offsetslider" + elementId: "north-" + graphicElementName } }, State { name: "BottomEdge" PropertyChanges { target: root - elementId: "south-offsetslider" + elementId: "south-" + graphicElementName } }, State { name: "LeftEdge" PropertyChanges { target: root - elementId: "west-offsetslider" + elementId: "west-" + graphicElementName } }, State { name: "RightEdge" PropertyChanges { target: root - elementId: "east-offsetslider" + elementId: "east-" + graphicElementName } } ] From 572163bae3c053da9f7aef6fbda6830d2f9e2583 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 21:58:07 +0200 Subject: [PATCH 22/80] better alignment --- .../configuration/panelconfiguration/Ruler.qml | 2 ++ .../panelconfiguration/SliderHandle.qml | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml index 0d0d62bc5..2f6460694 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -54,11 +54,13 @@ PlasmaCore.FrameSvgItem { } SliderHandle { id: minimumLengthHandle + offset: panel.offset graphicElementName: "minslider" onValueChanged: panel.minimumLength = value } SliderHandle { id: maximumLengthHandle + offset: panel.offset graphicElementName: "maxslider" onValueChanged: panel.maximumLength = value } diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml index c7fd63ab6..79e389d96 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml @@ -33,12 +33,21 @@ PlasmaCore.SvgItem { property int value property string graphicElementName + property int offset: 0 onValueChanged: { if (panel.location == 5 || panel.location == 6) { - y = value + y = value + offset - root.height/2 } else { - x = value + x = value + offset - root.width/2 + } + } + + onOffsetChanged: { + if (panel.location == 5 || panel.location == 6) { + y = value + offset - root.height/2 + } else { + x = value + offset - root.width/2 } } @@ -50,9 +59,9 @@ PlasmaCore.SvgItem { anchors.fill: parent onPositionChanged: { if (panel.location == 5 || panel.location == 6) { - root.value = parent.y + root.value = parent.y - offset + root.height/2 } else { - root.value = parent.x + root.value = parent.x - offset + root.width/2 } } } From 3bfb6a61a337b7f7301bf2dfeebad256b7288439 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 22:05:36 +0200 Subject: [PATCH 23/80] use toolbuttons --- .../configuration/PanelConfiguration.qml | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index 32afb0527..ee4aa27d1 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -71,13 +71,15 @@ PlasmaCore.FrameSvgItem { state: root.state } - Row { + PlasmaComponents.ButtonRow { + spacing: 0 + exclusive: false anchors { centerIn: parent } - Rectangle { - width: 100 - height: 32 + PlasmaComponents.ToolButton { + flat: false + text: "Screen edge" QtExtras.MouseEventListener { anchors.fill: parent @@ -151,14 +153,11 @@ PlasmaCore.FrameSvgItem { print("New Location: " + newLocation); } onReleased: panelResetAnimation.running = true - PlasmaComponents.Label { - text: "Position" - } } } - Rectangle { - width: 100 - height: 32 + PlasmaComponents.ToolButton { + flat: false + text: "Height" QtExtras.MouseEventListener { anchors.fill: parent property int startMouseX @@ -191,9 +190,6 @@ PlasmaCore.FrameSvgItem { panel.thickness = (panel.y + panel.height) - (configDialog.y + configDialog.height) } } - PlasmaComponents.Label { - text: "Height" - } } } } From efd78e230ed7b66ecdcd8666bc04c38b2eed73f1 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Thu, 9 May 2013 09:23:56 +0200 Subject: [PATCH 24/80] SVN_SILENT made messages (.desktop file) --- src/plasma/data/servicetypes/plasma-generic.desktop | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plasma/data/servicetypes/plasma-generic.desktop b/src/plasma/data/servicetypes/plasma-generic.desktop index 89e93865d..5b413c19d 100644 --- a/src/plasma/data/servicetypes/plasma-generic.desktop +++ b/src/plasma/data/servicetypes/plasma-generic.desktop @@ -4,6 +4,7 @@ X-KDE-ServiceType=Plasma/Generic Name=Plasma Package Name[cs]=Balíček Plasmy Name[de]=Plasma-Paket +Name[fr]=Paquet Plasma Name[nl]=Plasma-pakket Name[pt]=Pacote do Plasma Name[pt_BR]=Pacote do Plasma @@ -13,6 +14,7 @@ Name[uk]=Пакунок Плазми Name[x-test]=xxPlasma Packagexx Comment=Generic Plasma Package Comment[de]=Allgemeines Plasma-Paket +Comment[fr]=Paquet générique Plasma Comment[nl]=Algemeen plasma-pakket Comment[pt]=Pacote Genérico do Plasma Comment[pt_BR]=Pacote genérico do Plasma From 493a88dc82d4c7b3c5483c8aaa902c2be00b1cea Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 11:15:48 +0200 Subject: [PATCH 25/80] all handles in own files --- .../configuration/PanelConfiguration.qml | 117 +----------------- .../panelconfiguration/EdgeHandle.qml | 103 +++++++++++++++ .../panelconfiguration/SizeHandle.qml | 62 ++++++++++ 3 files changed, 167 insertions(+), 115 deletions(-) create mode 100644 src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml create mode 100644 src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SizeHandle.qml diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index ee4aa27d1..dd159e15a 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -77,121 +77,8 @@ PlasmaCore.FrameSvgItem { anchors { centerIn: parent } - PlasmaComponents.ToolButton { - flat: false - text: "Screen edge" - - QtExtras.MouseEventListener { - anchors.fill: parent - property int lastX - property int lastY - property int startMouseX - property int startMouseY - onPressed: { - lastX = mouse.screenX - lastY = mouse.screenY - startMouseX = mouse.x - startMouseY = mouse.y - } - onPositionChanged: { - switch (panel.location) { - //TopEdge - case 3: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y - panel.y = configDialog.y - panel.height - break - //LeftEdge - case 5: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x - panel.x = configDialog.x - panel.width - break; - //RightEdge - case 6: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x - panel.x = configDialog.x + configDialog.width - break; - //BottomEdge - case 4: - default: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y - panel.y = configDialog.y + configDialog.height - } - - lastX = mouse.screenX - lastY = mouse.screenY - - var screenAspect = panel.screenGeometry.height / panel.screenGeometry.width - var newLocation = panel.location - - if (mouse.screenY < panel.screenGeometry.y+(mouse.screenX-panel.screenGeometry.x)*screenAspect) { - if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) { - if (panel.location == 3) { - return; - } else { - newLocation = 3; //FIXME: Plasma::TopEdge; - } - } else if (panel.location == 6) { - return; - } else { - newLocation = 6; //FIXME: Plasma::RightEdge; - } - - } else { - if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) { - if (panel.location == 5) { - return; - } else { - newLocation = 5; //FIXME: Plasma::LeftEdge; - } - } else if(panel.location == 4) { - return; - } else { - newLocation = 4; //FIXME: Plasma::BottomEdge; - } - } - panel.location = newLocation - print("New Location: " + newLocation); - } - onReleased: panelResetAnimation.running = true - } - } - PlasmaComponents.ToolButton { - flat: false - text: "Height" - QtExtras.MouseEventListener { - anchors.fill: parent - property int startMouseX - property int startMouseY - onPressed: { - startMouseX = mouse.x - startMouseY = mouse.y - } - onPositionChanged: { - switch (panel.location) { - //TopEdge - case 3: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y - panel.thickness = configDialog.y - panel.y - break; - //LeftEdge - case 5: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x - panel.thickness = configDialog.x - panel.x - break; - //RightEdge - case 6: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x - panel.thickness = (panel.x + panel.width) - (configDialog.x + configDialog.width) - break; - //BottomEdge - case 4: - default: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y - panel.thickness = (panel.y + panel.height) - (configDialog.y + configDialog.height) - } - } - } - } + EdgeHandle {} + SizeHandle{} } ParallelAnimation { id: panelResetAnimation diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml new file mode 100644 index 000000000..cad50fc56 --- /dev/null +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml @@ -0,0 +1,103 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. + */ + +import QtQuick 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.configuration 2.0 +import org.kde.qtextracomponents 2.0 as QtExtras + +PlasmaComponents.ToolButton { + flat: false + text: "Screen edge" + + QtExtras.MouseEventListener { + anchors.fill: parent + property int lastX + property int lastY + property int startMouseX + property int startMouseY + onPressed: { + lastX = mouse.screenX + lastY = mouse.screenY + startMouseX = mouse.x + startMouseY = mouse.y + } + onPositionChanged: { + switch (panel.location) { + //TopEdge + case 3: + configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + panel.y = configDialog.y - panel.height + break + //LeftEdge + case 5: + configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + panel.x = configDialog.x - panel.width + break; + //RightEdge + case 6: + configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + panel.x = configDialog.x + configDialog.width + break; + //BottomEdge + case 4: + default: + configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + panel.y = configDialog.y + configDialog.height + } + + lastX = mouse.screenX + lastY = mouse.screenY + + var screenAspect = panel.screenGeometry.height / panel.screenGeometry.width + var newLocation = panel.location + + if (mouse.screenY < panel.screenGeometry.y+(mouse.screenX-panel.screenGeometry.x)*screenAspect) { + if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) { + if (panel.location == 3) { + return; + } else { + newLocation = 3; //FIXME: Plasma::TopEdge; + } + } else if (panel.location == 6) { + return; + } else { + newLocation = 6; //FIXME: Plasma::RightEdge; + } + + } else { + if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) { + if (panel.location == 5) { + return; + } else { + newLocation = 5; //FIXME: Plasma::LeftEdge; + } + } else if(panel.location == 4) { + return; + } else { + newLocation = 4; //FIXME: Plasma::BottomEdge; + } + } + panel.location = newLocation + print("New Location: " + newLocation); + } + onReleased: panelResetAnimation.running = true + } +} diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SizeHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SizeHandle.qml new file mode 100644 index 000000000..6d5e7a46b --- /dev/null +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SizeHandle.qml @@ -0,0 +1,62 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. + */ + +import QtQuick 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.configuration 2.0 +import org.kde.qtextracomponents 2.0 as QtExtras + +PlasmaComponents.ToolButton { + flat: false + text: "Height" + QtExtras.MouseEventListener { + anchors.fill: parent + property int startMouseX + property int startMouseY + onPressed: { + startMouseX = mouse.x + startMouseY = mouse.y + } + onPositionChanged: { + switch (panel.location) { + //TopEdge + case 3: + configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + panel.thickness = configDialog.y - panel.y + break; + //LeftEdge + case 5: + configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + panel.thickness = configDialog.x - panel.x + break; + //RightEdge + case 6: + configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + panel.thickness = (panel.x + panel.width) - (configDialog.x + configDialog.width) + break; + //BottomEdge + case 4: + default: + configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + panel.thickness = (panel.y + panel.height) - (configDialog.y + configDialog.height) + } + } + } +} From 3658a71935975d1c0fdad7fa88483811b93ddcd6 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 12:30:55 +0200 Subject: [PATCH 26/80] better size hints --- src/shell/panelconfigview.cpp | 12 +- .../configuration/PanelConfiguration.qml | 51 +++++--- .../panelconfiguration/EdgeHandle.qml | 8 +- .../panelconfiguration/Ruler.qml | 4 +- .../panelconfiguration/SizeHandle.qml | 8 +- .../panelconfiguration/ToolBar.qml | 115 ++++++++++++++++++ 6 files changed, 164 insertions(+), 34 deletions(-) create mode 100644 src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml diff --git a/src/shell/panelconfigview.cpp b/src/shell/panelconfigview.cpp index eebd11c7d..f3fd57404 100644 --- a/src/shell/panelconfigview.cpp +++ b/src/shell/panelconfigview.cpp @@ -66,21 +66,21 @@ void PanelConfigView::syncGeometry() } if (m_containment->formFactor() == Plasma::Vertical) { - resize(128, screen()->size().height()); + resize(rootObject()->implicitWidth(), screen()->size().height()); if (m_containment->location() == Plasma::LeftEdge) { - setPosition(screen()->geometry().left() + m_panelView->thickness(), 0); + setPosition(screen()->geometry().left() + m_panelView->thickness(), screen()->geometry().top()); } else if (m_containment->location() == Plasma::RightEdge) { - setPosition(screen()->geometry().right() - 128 - m_panelView->thickness(), 0); + setPosition(screen()->geometry().right() - width() - m_panelView->thickness(), screen()->geometry().top()); } } else { - resize(screen()->size().width(), 128); + resize(screen()->size().width(), rootObject()->implicitHeight()); if (m_containment->location() == Plasma::TopEdge) { - setPosition(0, screen()->geometry().top() + m_panelView->thickness()); + setPosition(screen()->geometry().left(), screen()->geometry().top() + m_panelView->thickness()); } else if (m_containment->location() == Plasma::BottomEdge) { - setPosition(0, screen()->geometry().bottom() - 128 - m_panelView->thickness()); + setPosition(screen()->geometry().left(), screen()->geometry().bottom() - height() - m_panelView->thickness()); } } } diff --git a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml index dd159e15a..edfc5c3dc 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/PanelConfiguration.qml @@ -27,8 +27,11 @@ import "panelconfiguration" //TODO: all of this will be done with desktop components PlasmaCore.FrameSvgItem { - id: root + id: dialogRoot +//BEGIN Properties + width: 640 + height: 64 imagePath: "dialogs/background" state: { @@ -49,9 +52,7 @@ PlasmaCore.FrameSvgItem { } } -//BEGIN properties - width: 640 - height: 64 + property bool vertical: (panel.location == 5 || panel.location == 6) //END properties //BEGIN Connections @@ -68,18 +69,16 @@ PlasmaCore.FrameSvgItem { Ruler { id: ruler - state: root.state + state: dialogRoot.state } - PlasmaComponents.ButtonRow { - spacing: 0 - exclusive: false - anchors { - centerIn: parent - } - EdgeHandle {} - SizeHandle{} + ToolBar { + id: toolBar } +//END UI components + +//BEGIN Animations + //when EdgeHandle is released animate to old panel position ParallelAnimation { id: panelResetAnimation NumberAnimation { @@ -134,37 +133,53 @@ PlasmaCore.FrameSvgItem { duration: 150 } } -//END UI components +//END Animations //BEGIN States states: [ State { name: "TopEdge" PropertyChanges { - target: root + target: dialogRoot enabledBorders: "TopBorder|BottomBorder" } + PropertyChanges { + target: dialogRoot + implicitHeight: ruler.implicitHeight + toolBar.implicitHeight + } }, State { name: "BottomEdge" PropertyChanges { - target: root + target: dialogRoot enabledBorders: "TopBorder|BottomBorder" } + PropertyChanges { + target: dialogRoot + implicitHeight: ruler.implicitHeight + toolBar.implicitHeight + } }, State { name: "LeftEdge" PropertyChanges { - target: root + target: dialogRoot enabledBorders: "LeftBorder|RightBorder" } + PropertyChanges { + target: dialogRoot + implicitWidth: ruler.implicitWidth + toolBar.implicitWidth + } }, State { name: "RightEdge" PropertyChanges { - target: root + target: dialogRoot enabledBorders: "LeftBorder|RightBorder" } + PropertyChanges { + target: dialogRoot + implicitWidth: ruler.implicitWidth + toolBar.implicitWidth + } } ] //END States diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml index cad50fc56..45fd40426 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml @@ -43,23 +43,23 @@ PlasmaComponents.ToolButton { switch (panel.location) { //TopEdge case 3: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y panel.y = configDialog.y - panel.height break //LeftEdge case 5: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x panel.x = configDialog.x - panel.width break; //RightEdge case 6: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x panel.x = configDialog.x + configDialog.width break; //BottomEdge case 4: default: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y panel.y = configDialog.y + configDialog.height } diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml index 2f6460694..d1d52702f 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -33,8 +33,8 @@ PlasmaCore.FrameSvgItem { imagePath: "widgets/containment-controls" state: "BottomEdge" - implicitWidth: offsetButton.implicitwidth + minimumLengthHandle.implicitwidth - implicitHeight: 32//offsetButton.implicitheight + minimumLengthHandle.implicitheight + implicitWidth: offsetHandle.width + minimumLengthHandle.width + implicitHeight: offsetHandle.height + minimumLengthHandle.height Component.onCompleted: { offsetHandle.value = panel.offset diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SizeHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SizeHandle.qml index 6d5e7a46b..e128681b0 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SizeHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SizeHandle.qml @@ -38,23 +38,23 @@ PlasmaComponents.ToolButton { switch (panel.location) { //TopEdge case 3: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y panel.thickness = configDialog.y - panel.y break; //LeftEdge case 5: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x panel.thickness = configDialog.x - panel.x break; //RightEdge case 6: - configDialog.x = mouse.screenX - mapToItem(root, startMouseX, 0).x + configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x panel.thickness = (panel.x + panel.width) - (configDialog.x + configDialog.width) break; //BottomEdge case 4: default: - configDialog.y = mouse.screenY - mapToItem(root, 0, startMouseY).y + configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y panel.thickness = (panel.y + panel.height) - (configDialog.y + configDialog.height) } } diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml new file mode 100644 index 000000000..eca32e5a9 --- /dev/null +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml @@ -0,0 +1,115 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. + */ + +import QtQuick 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.configuration 2.0 + +Item { + id: root + state: parent.state + implicitWidth: childrenRect.width + 20 + implicitHeight: childrenRect.height + 20 + PlasmaComponents.ButtonRow { + id: row + spacing: 0 + exclusive: false + visible: !dialogRoot.vertical + anchors { + centerIn: parent + } + EdgeHandle { + id: edgeHandle + } + SizeHandle { + id: sizeHandle + } + } + //FIXME: remove this duplication, use desktopcomponents linear layouts that can switch between horizontal and vertical + PlasmaComponents.ButtonColumn { + id: column + spacing: 0 + exclusive: false + visible: dialogRoot.vertical + anchors { + centerIn: parent + } + EdgeHandle { + width: 80 + } + SizeHandle { + width: 80 + } + } + + +//BEGIN States + states: [ + State { + name: "TopEdge" + AnchorChanges { + target: root + anchors { + top: undefined + bottom: root.parent.bottom + left: root.parent.left + right: root.parent.right + } + } + }, + State { + name: "BottomEdge" + AnchorChanges { + target: root + anchors { + top: root.parent.top + bottom: undefined + left: root.parent.left + right: root.parent.right + } + } + }, + State { + name: "LeftEdge" + AnchorChanges { + target: root + anchors { + top: root.parent.top + bottom: root.parent.bottom + left: undefined + right: root.parent.right + } + } + }, + State { + name: "RightEdge" + AnchorChanges { + target: root + anchors { + top: root.parent.top + bottom: root.parent.bottom + left: root.parent.left + right: undefined + } + } + } + ] +//END States +} From 1d6382d48c58916fd570fa84a3364d89378e1c91 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 13:52:51 +0200 Subject: [PATCH 27/80] slightly more reliable formfactor switching --- src/shell/panelview.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index 3072d320a..472fabc19 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -305,25 +305,28 @@ void PanelView::restore() setMaximumSize(QSize(10000, 10000)); if (containment()->formFactor() == Plasma::Vertical) { + resize(config().readEntry("thickness", 32), + config().readEntry("length", screen()->size().height())); + if (m_minLength > 0) { setMinimumHeight(m_minLength); } if (m_maxLength > 0) { setMaximumHeight(m_maxLength); } - resize(config().readEntry("thickness", 32), - config().readEntry("length", screen()->size().height())); //Horizontal } else { + resize(config().readEntry("length", screen()->size().width()), + config().readEntry("thickness", 32)); + if (m_minLength > 0) { setMinimumWidth(m_minLength); } + if (m_maxLength > 0) { setMaximumWidth(m_maxLength); } - resize(config().readEntry("length", screen()->size().width()), - config().readEntry("thickness", 32)); } emit maximumLengthChanged(); From 4c76e033a4157f791922e45de5821a9abf9b9803 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 14:08:43 +0200 Subject: [PATCH 28/80] set current sizes on state change --- .../configuration/panelconfiguration/Ruler.qml | 4 ++++ .../configuration/panelconfiguration/ToolBar.qml | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml index d1d52702f..dacb8f28a 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -71,6 +71,7 @@ PlasmaCore.FrameSvgItem { PropertyChanges { target: root prefix: "north" + height: root.implicitHeight } AnchorChanges { target: root @@ -114,6 +115,7 @@ PlasmaCore.FrameSvgItem { PropertyChanges { target: root prefix: "south" + height: root.implicitHeight } AnchorChanges { target: root @@ -157,6 +159,7 @@ PlasmaCore.FrameSvgItem { PropertyChanges { target: root prefix: "west" + width: root.implicitWidth } AnchorChanges { target: root @@ -200,6 +203,7 @@ PlasmaCore.FrameSvgItem { PropertyChanges { target: root prefix: "east" + width: root.implicitWidth } AnchorChanges { target: root diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml index eca32e5a9..ac3bb2ea6 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml @@ -64,6 +64,10 @@ Item { states: [ State { name: "TopEdge" + PropertyChanges { + target: root + height: root.implicitHeight + } AnchorChanges { target: root anchors { @@ -76,6 +80,10 @@ Item { }, State { name: "BottomEdge" + PropertyChanges { + target: root + height: root.implicitHeight + } AnchorChanges { target: root anchors { @@ -88,6 +96,10 @@ Item { }, State { name: "LeftEdge" + PropertyChanges { + target: root + width: root.implicitWidth + } AnchorChanges { target: root anchors { @@ -100,6 +112,10 @@ Item { }, State { name: "RightEdge" + PropertyChanges { + target: root + width: root.implicitWidth + } AnchorChanges { target: root anchors { From 57b38835420422ec3f1829d429a249923e42fb3f Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 14:16:58 +0200 Subject: [PATCH 29/80] take a central rect where no switch occurs --- .../configuration/panelconfiguration/EdgeHandle.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml index 45fd40426..868e62555 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/EdgeHandle.qml @@ -69,6 +69,15 @@ PlasmaComponents.ToolButton { var screenAspect = panel.screenGeometry.height / panel.screenGeometry.width var newLocation = panel.location + //If the mouse is in an internal rectangle, do nothing + if ((mouse.screenX > panel.screenGeometry.x + panel.screenGeometry.width/3 && + mouse.screenX < panel.screenGeometry.x + panel.screenGeometry.width/3*2) && + (mouse.screenY > panel.screenGeometry.y + panel.screenGeometry.height/3 && + mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height/3*2)) { + return; + } + + if (mouse.screenY < panel.screenGeometry.y+(mouse.screenX-panel.screenGeometry.x)*screenAspect) { if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) { if (panel.location == 3) { From c13a58cf11b543459dbc68c665c8417d7b6696ce Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 16:16:16 +0200 Subject: [PATCH 30/80] checkable and checked properties --- .../plasmacomponents/qmenuitem.cpp | 24 +++++++++++++++++++ .../plasmacomponents/qmenuitem.h | 10 ++++++++ 2 files changed, 34 insertions(+) diff --git a/src/declarativeimports/plasmacomponents/qmenuitem.cpp b/src/declarativeimports/plasmacomponents/qmenuitem.cpp index ab55cbcd8..6104c3340 100644 --- a/src/declarativeimports/plasmacomponents/qmenuitem.cpp +++ b/src/declarativeimports/plasmacomponents/qmenuitem.cpp @@ -38,9 +38,14 @@ QAction* QMenuItem::action() const void QMenuItem::setAction(QAction* a) { if (m_action != a) { + if (m_action) { + disconnect(m_action, 0, this, 0); + } m_action = a; connect(m_action, &QAction::changed, this, &QMenuItem::textChanged); connect(m_action, &QAction::changed, this, &QMenuItem::textChanged); + connect(m_action, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); + connect(m_action, SIGNAL(checkableChanged()), this, SIGNAL(checkableChanged())); emit actionChanged(); } } @@ -84,6 +89,25 @@ void QMenuItem::setText(const QString& t) } } +bool QMenuItem::checkable() const +{ + return m_action->isCheckable(); +} + +void QMenuItem::setCheckable(bool checkable) +{ + m_action->setCheckable(checkable); +} + +bool QMenuItem::checked() const +{ + return m_action->isChecked(); +} + +void QMenuItem::setChecked(bool checked) +{ + m_action->setChecked(checked); +} #include "qmenuitem.moc" diff --git a/src/declarativeimports/plasmacomponents/qmenuitem.h b/src/declarativeimports/plasmacomponents/qmenuitem.h index b793e748a..0bb7b09e1 100644 --- a/src/declarativeimports/plasmacomponents/qmenuitem.h +++ b/src/declarativeimports/plasmacomponents/qmenuitem.h @@ -40,6 +40,8 @@ class QMenuItem : public QQuickItem Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(QVariant icon READ icon WRITE setIcon NOTIFY iconChanged) Q_PROPERTY(QAction* action READ action WRITE setAction NOTIFY actionChanged) + Q_PROPERTY(bool checkable READ checkable WRITE setCheckable NOTIFY checkableChanged) + Q_PROPERTY(bool checked READ checked WRITE setChecked NOTIFY toggled) public: QMenuItem(QQuickItem *parent = 0); @@ -53,6 +55,12 @@ public: QString text() const; void setText(const QString &t); + bool checkable() const; + void setCheckable(bool checkable); + + bool checked() const; + void setChecked(bool checked); + Q_SIGNALS: void clicked(); @@ -60,6 +68,8 @@ Q_SIGNALS: void iconChanged(); void separatorChanged(); void textChanged(); + void toggled(bool checked); + void checkableChanged(); private: QAction* m_action; From bbb5e08d5899d0fc31f168c5c506e0afb70a97d1 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 16:16:28 +0200 Subject: [PATCH 31/80] working menu to switch between panel alignments --- src/shell/panelview.cpp | 64 ++++++++++- src/shell/panelview.h | 8 ++ .../panelconfiguration/ToolBar.qml | 101 ++++++++++++++++++ 3 files changed, 168 insertions(+), 5 deletions(-) diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index 472fabc19..116474f65 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -116,6 +116,7 @@ void PanelView::setAlignment(Qt::Alignment alignment) } m_alignment = alignment; + config().writeEntry("alignment", (int)m_alignment); positionPanel(); } @@ -158,6 +159,31 @@ void PanelView::setThickness(int value) m_corona->requestApplicationConfigSync(); } +int PanelView::length() const +{ + if (formFactor() == Plasma::Vertical) { + config().readEntry("length", screen()->size().height()); + } else { + config().readEntry("length", screen()->size().width()); + } +} + +void PanelView::setLength(int value) +{ + if (value == length()) { + return; + } + + if (formFactor() == Plasma::Vertical) { + setHeight(value); + } else { + setWidth(value); + } + config().writeEntry("length", value); + emit lengthChanged(); + m_corona->requestApplicationConfigSync(); +} + int PanelView::maximumLength() const { return m_maxLength; @@ -181,6 +207,7 @@ void PanelView::setMaximumLength(int length) config().writeEntry("maxLength", length); m_maxLength = length; emit maximumLengthChanged(); + positionPanel(); m_corona->requestApplicationConfigSync(); } @@ -206,6 +233,7 @@ void PanelView::setMinimumLength(int length) } config().writeEntry("minLength", length); m_minLength = length; + positionPanel(); emit minimumLengthChanged(); m_corona->requestApplicationConfigSync(); } @@ -218,17 +246,18 @@ void PanelView::positionPanel() QScreen *s = screen(); const int oldThickness = thickness(); - + switch (containment()->location()) { case Plasma::TopEdge: containment()->setFormFactor(Plasma::Horizontal); restore(); + switch (m_alignment) { case Qt::AlignCenter: setPosition(QPoint(s->virtualGeometry().center().x(), s->virtualGeometry().top()) + QPoint(m_offset - size().width()/2, 0)); break; case Qt::AlignRight: - setPosition(s->virtualGeometry().topRight() + QPoint(-m_offset - size().width(), 0)); + setPosition(s->virtualGeometry().topRight() - QPoint(m_offset + size().width(), 0)); break; case Qt::AlignLeft: default: @@ -244,7 +273,7 @@ void PanelView::positionPanel() setPosition(QPoint(s->virtualGeometry().left(), s->virtualGeometry().center().y()) + QPoint(0, m_offset)); break; case Qt::AlignRight: - setPosition(s->virtualGeometry().bottomLeft() + QPoint(0, -m_offset - size().height())); + setPosition(s->virtualGeometry().bottomLeft() - QPoint(0, m_offset + size().height())); break; case Qt::AlignLeft: default: @@ -260,7 +289,7 @@ void PanelView::positionPanel() setPosition(QPoint(s->virtualGeometry().right(), s->virtualGeometry().center().y()) - QPoint(width(), 0) + QPoint(0, m_offset - size().height()/2)); break; case Qt::AlignRight: - setPosition(s->virtualGeometry().bottomRight() - QPoint(width(), 0) + QPoint(0, -m_offset - size().height())); + setPosition(s->virtualGeometry().bottomRight() - QPoint(width(), 0) - QPoint(0, m_offset + size().height())); break; case Qt::AlignLeft: default: @@ -277,7 +306,7 @@ void PanelView::positionPanel() setPosition(QPoint(s->virtualGeometry().center().x(), s->virtualGeometry().bottom()) + QPoint(m_offset - size().width()/2, 0)); break; case Qt::AlignRight: - setPosition(s->virtualGeometry().bottomRight() - QPoint(0, height()) + QPoint(-m_offset - size().width(), 0)); + setPosition(s->virtualGeometry().bottomRight() - QPoint(0, height()) - QPoint(m_offset + size().width(), 0)); break; case Qt::AlignLeft: default: @@ -334,4 +363,29 @@ void PanelView::restore() emit offsetChanged(); } +void PanelView::resizeEvent(QResizeEvent *ev) +{ + if (containment()->formFactor() == Plasma::Vertical) { + config().writeEntry("length", ev->size().height()); + config().writeEntry("thickness", ev->size().width()); + if (ev->size().height() != ev->oldSize().height()) { + emit lengthChanged(); + } + if (ev->size().width() != ev->oldSize().width()) { + emit thicknessChanged(); + } + } else { + config().writeEntry("length", ev->size().width()); + config().writeEntry("thickness", ev->size().height()); + if (ev->size().width() != ev->oldSize().width()) { + emit lengthChanged(); + } + if (ev->size().height() != ev->oldSize().height()) { + emit thicknessChanged(); + } + } + + View::resizeEvent(ev); +} + #include "moc_panelview.cpp" diff --git a/src/shell/panelview.h b/src/shell/panelview.h index 29e168795..d8d86a798 100644 --- a/src/shell/panelview.h +++ b/src/shell/panelview.h @@ -32,6 +32,7 @@ class PanelView : public View Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) Q_PROPERTY(int offset READ offset WRITE setOffset NOTIFY offsetChanged) Q_PROPERTY(int thickness READ thickness WRITE setThickness NOTIFY thicknessChanged) + Q_PROPERTY(int length READ length WRITE setLength NOTIFY lengthChanged) Q_PROPERTY(int maximumLength READ maximumLength WRITE setMaximumLength NOTIFY maximumLengthChanged) Q_PROPERTY(int minimumLength READ minimumLength WRITE setMinimumLength NOTIFY minimumLengthChanged) @@ -52,17 +53,24 @@ public: int thickness() const; void setThickness(int thickness); + int length() const; + void setLength(int value); + int maximumLength() const; void setMaximumLength(int length); int minimumLength() const; void setMinimumLength(int length); +protected: + void resizeEvent(QResizeEvent *ev); + Q_SIGNALS: void alignmentChanged(); void offsetChanged(); void screenGeometryChanged(); void thicknessChanged(); + void lengthChanged(); void maximumLengthChanged(); void minimumLengthChanged(); diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml index ac3bb2ea6..18ddf50a6 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml @@ -59,6 +59,63 @@ Item { } } + PlasmaComponents.Button { + id: moreSettingsButton + property QtObject contextMenu + text: "More settings" + onClicked: { + if (!contextMenu) { + contextMenu = contextMenuComponent.createObject(moreSettingsButton) + } + contextMenu.open() + } + } + + Component { + id: contextMenuComponent + PlasmaComponents.ContextMenu { + visualParent: moreSettingsButton + PlasmaComponents.MenuItem { + id: leftToggle + text: "Left" + checkable: true + checked: panel.alignment == Qt.AlignLeft + onClicked: panel.alignment = Qt.AlignLeft + onToggled: { + if (checked) { + centerToggle.checked = false + rightToggle.checked = false + } + } + } + PlasmaComponents.MenuItem { + id: centerToggle + text: "Center" + checkable: true + checked: panel.alignment == Qt.AlignCenter + onClicked: panel.alignment = Qt.AlignCenter + onToggled: { + if (checked) { + leftToggle.checked = false + rightToggle.checked = false + } + } + } + PlasmaComponents.MenuItem { + id: rightToggle + text: "Right" + checkable: true + checked: panel.alignment == Qt.AlignRight + onClicked: panel.alignment = Qt.AlignRight + onToggled: { + if (checked) { + centerToggle.checked = false + leftToggle.checked = false + } + } + } + } + } //BEGIN States states: [ @@ -77,6 +134,17 @@ Item { right: root.parent.right } } + AnchorChanges { + target: moreSettingsButton + anchors { + verticalCenter: root.verticalCenter + horizontalCenter: undefined + top: undefined + bottom: undefined + left: undefined + right: root.right + } + } }, State { name: "BottomEdge" @@ -93,6 +161,17 @@ Item { right: root.parent.right } } + AnchorChanges { + target: moreSettingsButton + anchors { + verticalCenter: root.verticalCenter + horizontalCenter: undefined + top: undefined + bottom: undefined + left: undefined + right: root.right + } + } }, State { name: "LeftEdge" @@ -109,6 +188,17 @@ Item { right: root.parent.right } } + AnchorChanges { + target: moreSettingsButton + anchors { + verticalCenter: undefined + horizontalCenter: root.verticalCenter + top: undefined + bottom: root.bottom + left: undefined + right: undefined + } + } }, State { name: "RightEdge" @@ -125,6 +215,17 @@ Item { right: undefined } } + AnchorChanges { + target: moreSettingsButton + anchors { + verticalCenter: undefined + horizontalCenter: root.verticalCenter + top: undefined + bottom: root.bottom + left: undefined + right: undefined + } + } } ] //END States From c2640b28c636153ad9e00ff2c9ea9953416cd984 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 17:13:07 +0200 Subject: [PATCH 32/80] rulers work for left and right alignments --- src/shell/panelview.cpp | 38 +++++++++-------- .../panelconfiguration/Ruler.qml | 3 ++ .../panelconfiguration/SliderHandle.qml | 41 +++++++++++++------ 3 files changed, 52 insertions(+), 30 deletions(-) diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index 116474f65..b69cf36f4 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -117,6 +117,7 @@ void PanelView::setAlignment(Qt::Alignment alignment) m_alignment = alignment; config().writeEntry("alignment", (int)m_alignment); + emit alignmentChanged(); positionPanel(); } @@ -324,38 +325,39 @@ void PanelView::restore() return; } - m_offset = config().readEntry("offset", 0); + static const int MINSIZE = 10; + + m_offset = qMax(0, config().readEntry("offset", 0)); m_maxLength = config().readEntry("maxLength", -1); m_minLength = config().readEntry("minLength", -1); m_alignment = (Qt::Alignment)config().readEntry("alignment", Qt::AlignLeft); setMinimumSize(QSize(-1, -1)); //FIXME: an invalid size doesn't work with QWindows - setMaximumSize(QSize(10000, 10000)); + setMaximumSize(screen()->size()); if (containment()->formFactor() == Plasma::Vertical) { - resize(config().readEntry("thickness", 32), - config().readEntry("length", screen()->size().height())); + const int maxSize = screen()->size().height() - m_offset; + m_maxLength = qBound(MINSIZE, m_maxLength, maxSize); + m_minLength = qBound(MINSIZE, m_minLength, maxSize); - if (m_minLength > 0) { - setMinimumHeight(m_minLength); - } - if (m_maxLength > 0) { - setMaximumHeight(m_maxLength); - } + resize(config().readEntry("thickness", 32), + qBound(MINSIZE, config().readEntry("length", screen()->size().height()), maxSize)); + + setMinimumHeight(m_minLength); + setMaximumHeight(m_maxLength); //Horizontal } else { - resize(config().readEntry("length", screen()->size().width()), + const int maxSize = screen()->size().width() - m_offset; + m_maxLength = qBound(MINSIZE, m_maxLength, maxSize); + m_minLength = qBound(MINSIZE, m_minLength, maxSize); + + resize(qBound(MINSIZE, config().readEntry("length", screen()->size().height()), maxSize), config().readEntry("thickness", 32)); - if (m_minLength > 0) { - setMinimumWidth(m_minLength); - } - - if (m_maxLength > 0) { - setMaximumWidth(m_maxLength); - } + setMinimumWidth(m_minLength); + setMaximumWidth(m_maxLength); } emit maximumLengthChanged(); diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml index dacb8f28a..f13eb508f 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -49,17 +49,20 @@ PlasmaCore.FrameSvgItem { SliderHandle { id: offsetHandle + inverted: panel.alignment == Qt.AlignRight graphicElementName: "offsetslider" onValueChanged: panel.offset = value } SliderHandle { id: minimumLengthHandle + inverted: panel.alignment == Qt.AlignRight offset: panel.offset graphicElementName: "minslider" onValueChanged: panel.minimumLength = value } SliderHandle { id: maximumLengthHandle + inverted: panel.alignment == Qt.AlignRight offset: panel.offset graphicElementName: "maxslider" onValueChanged: panel.maximumLength = value diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml index 79e389d96..1a6d4bbb4 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml @@ -34,21 +34,30 @@ PlasmaCore.SvgItem { property int value property string graphicElementName property int offset: 0 + property bool inverted: false - onValueChanged: { + function syncPos() { if (panel.location == 5 || panel.location == 6) { - y = value + offset - root.height/2 + if (inverted) { + y = root.parent.height - (value + offset + root.height/2) + } else { + y = value + offset - root.height/2 + } } else { - x = value + offset - root.width/2 + if (inverted) { + x = root.parent.width - (value + offset + root.width/2) + } else { + x = value + offset - root.width/2 + } } } - - onOffsetChanged: { - if (panel.location == 5 || panel.location == 6) { - y = value + offset - root.height/2 - } else { - x = value + offset - root.width/2 - } + onValueChanged: syncPos() + onOffsetChanged: syncPos() + onInvertedChanged: syncPos() + Connections { + target: root.parent + onWidthChanged: syncPos() + onHeightChanged: syncPos() } MouseArea { @@ -59,9 +68,17 @@ PlasmaCore.SvgItem { anchors.fill: parent onPositionChanged: { if (panel.location == 5 || panel.location == 6) { - root.value = parent.y - offset + root.height/2 + if (root.inverted) { + root.value = root.parent.height - (parent.y + offset + root.height/2) + } else { + root.value = parent.y - offset + root.height/2 + } } else { - root.value = parent.x - offset + root.width/2 + if (root.inverted) { + root.value = root.parent.width - (parent.x + offset + root.width/2) + } else { + root.value = parent.x - offset + root.width/2 + } } } } From b57d9e02c0eefde834fa39aa4755558c7a75ac86 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 20:30:31 +0200 Subject: [PATCH 33/80] center align starts to work still not perfect --- src/shell/panelview.cpp | 6 +- .../panelconfiguration/Ruler.qml | 100 +++++++++++++++++- .../panelconfiguration/SliderHandle.qml | 49 +++++++-- 3 files changed, 141 insertions(+), 14 deletions(-) diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index b69cf36f4..d2d4b734a 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -327,7 +327,11 @@ void PanelView::restore() static const int MINSIZE = 10; - m_offset = qMax(0, config().readEntry("offset", 0)); + m_offset = config().readEntry("offset", 0); + if (m_alignment != Qt::AlignCenter) { + m_offset = qMax(0, m_offset); + } + m_maxLength = config().readEntry("maxLength", -1); m_minLength = config().readEntry("minLength", -1); m_alignment = (Qt::Alignment)config().readEntry("alignment", Qt::AlignLeft); diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml index f13eb508f..e4b66444e 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -36,10 +36,15 @@ PlasmaCore.FrameSvgItem { implicitWidth: offsetHandle.width + minimumLengthHandle.width implicitHeight: offsetHandle.height + minimumLengthHandle.height + onMinimumLengthChanged: leftMinimumLengthHandle.value = minimumLength + onMaximumLengthChanged: leftMaximumLengthHandle.value = maximumLength + Component.onCompleted: { offsetHandle.value = panel.offset minimumLengthHandle.value = panel.minimumLength maximumLengthHandle.value = panel.maximumLength + leftMinimumLengthHandle.value = panel.minimumLength + leftMaximumLengthHandle.value = panel.maximumLength } PlasmaCore.Svg { @@ -49,24 +54,41 @@ PlasmaCore.FrameSvgItem { SliderHandle { id: offsetHandle - inverted: panel.alignment == Qt.AlignRight graphicElementName: "offsetslider" onValueChanged: panel.offset = value } SliderHandle { id: minimumLengthHandle - inverted: panel.alignment == Qt.AlignRight + alignment: panel.alignment | Qt.AlignLeft + visible: panel.alignment != Qt.AlignRight offset: panel.offset graphicElementName: "minslider" onValueChanged: panel.minimumLength = value } SliderHandle { id: maximumLengthHandle - inverted: panel.alignment == Qt.AlignRight + alignment: panel.alignment | Qt.AlignLeft + visible: panel.alignment != Qt.AlignRight offset: panel.offset graphicElementName: "maxslider" onValueChanged: panel.maximumLength = value } + SliderHandle { + id: leftMinimumLengthHandle + alignment: panel.alignment | Qt.AlignRight + visible: panel.alignment != Qt.AlignLeft + offset: panel.offset + graphicElementName: "maxslider" + onValueChanged: panel.minimumLength = value + } + SliderHandle { + id: leftMaximumLengthHandle + alignment: panel.alignment | Qt.AlignRight + visible: panel.alignment != Qt.AlignLeft + offset: panel.offset + graphicElementName: "minslider" + onValueChanged: panel.maximumLength = value + } states: [ State { @@ -112,6 +134,24 @@ PlasmaCore.FrameSvgItem { right: undefined } } + AnchorChanges { + target: leftMinimumLengthHandle + anchors { + top: root.top + bottom: undefined + left: undefined + right: undefined + } + } + AnchorChanges { + target: leftMaximumLengthHandle + anchors { + top: undefined + bottom: root.bottom + left: undefined + right: undefined + } + } }, State { name: "BottomEdge" @@ -156,6 +196,24 @@ PlasmaCore.FrameSvgItem { right: undefined } } + AnchorChanges { + target: leftMinimumLengthHandle + anchors { + top: undefined + bottom: root.bottom + left: undefined + right: undefined + } + } + AnchorChanges { + target: leftMaximumLengthHandle + anchors { + top: root.top + bottom: undefined + left: undefined + right: undefined + } + } }, State { name: "LeftEdge" @@ -200,6 +258,24 @@ PlasmaCore.FrameSvgItem { right: root.right } } + AnchorChanges { + target: leftMinimumLengthHandle + anchors { + top: undefined + bottom: undefined + left: root.left + right: undefined + } + } + AnchorChanges { + target: leftMaximumLengthHandle + anchors { + top: undefined + bottom: undefined + left: undefined + right: root.right + } + } }, State { name: "RightEdge" @@ -244,6 +320,24 @@ PlasmaCore.FrameSvgItem { right: undefined } } + AnchorChanges { + target: leftMinimumLengthHandle + anchors { + top: undefined + bottom: undefined + left: undefined + right: parent.right + } + } + AnchorChanges { + target: leftMaximumLengthHandle + anchors { + top: undefined + bottom: undefined + left: parent.left + right: undefined + } + } } ] } diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml index 1a6d4bbb4..7fa1d992e 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml @@ -31,29 +31,49 @@ PlasmaCore.SvgItem { width: naturalSize.width height: naturalSize.height + //value expressed by this slider property int value + //name of the graphics to load property string graphicElementName + //where the point "0" is property int offset: 0 - property bool inverted: false + //handle type: behave in different ways based on the alignment + property int alignment: panel.alignment function syncPos() { if (panel.location == 5 || panel.location == 6) { - if (inverted) { + if (alignment == Qt.AlignRight) { y = root.parent.height - (value + offset + root.height/2) - } else { + } else if (alignment == Qt.AlignLeft) { y = value + offset - root.height/2 + } else { + if (root.alignment & Qt.AlignRight) { + y = root.parent.height/2 - value/2 - offset + root.height/2 + } else if (root.alignment & Qt.AlignLeft) { + y = root.parent.height/2 + value/2 + offset - root.height/2 + } else { + y = root.parent.height/2 + value + offset -root.height/2 + } } } else { - if (inverted) { + if (alignment == Qt.AlignRight) { x = root.parent.width - (value + offset + root.width/2) - } else { + } else if (alignment == Qt.AlignLeft) { x = value + offset - root.width/2 + } else { + if (root.alignment & Qt.AlignRight) { + x = root.parent.width/2 - value/2 + offset - root.width/2 + } else if (root.alignment & Qt.AlignLeft) { + x = root.parent.width/2 + value/2 + offset -root.width/2 + } else { + x = root.parent.width/2 + value + offset -root.width/2 + } } } } onValueChanged: syncPos() onOffsetChanged: syncPos() - onInvertedChanged: syncPos() + onAlignmentChanged: syncPos() Connections { target: root.parent onWidthChanged: syncPos() @@ -68,16 +88,25 @@ PlasmaCore.SvgItem { anchors.fill: parent onPositionChanged: { if (panel.location == 5 || panel.location == 6) { - if (root.inverted) { + if (root.alignment == Qt.AlignRight) { root.value = root.parent.height - (parent.y + offset + root.height/2) - } else { + } else if (alignment == Qt.AlignLeft) { root.value = parent.y - offset + root.height/2 } } else { - if (root.inverted) { + if (root.alignment == Qt.AlignRight) { root.value = root.parent.width - (parent.x + offset + root.width/2) - } else { + } else if (alignment == Qt.AlignLeft) { root.value = parent.x - offset + root.width/2 + //Center + } else { + if (root.alignment & Qt.AlignRight) { + root.value = (root.parent.width/2 - parent.x + offset)*2 + root.width/2 + } else if (root.alignment & Qt.AlignLeft) { + root.value = (parent.x - offset - root.parent.width/2)*2 + root.width/2 + } else { + root.value = parent.x - root.parent.width/2 - offset + root.width/2 + } } } } From da59b50ce76d1c64d029a903c8af89fd82f3a7e5 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 20:42:42 +0200 Subject: [PATCH 34/80] add the center indicator --- .../contents/configuration/panelconfiguration/Ruler.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml index e4b66444e..920aa7aa1 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -51,6 +51,15 @@ PlasmaCore.FrameSvgItem { id: containmentControlsSvg imagePath: "widgets/containment-controls" } + PlasmaCore.SvgItem { + id: centerMark + svg: containmentControlsSvg + elementId: dialogRoot.vertical ? "vertical-centerindicator" : "horizontal-centerindicator" + visible: panel.alignment == Qt.AlignCenter + width: dialogRoot.vertical ? parent.width : naturalSize.width + height: dialogRoot.vertical ? naturalSize.height : parent.height + anchors.centerIn: parent + } SliderHandle { id: offsetHandle From 8d4ddfe2a5ccdf76af9beefc6e608284931223dd Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 20:46:51 +0200 Subject: [PATCH 35/80] snap --- .../panelconfiguration/SliderHandle.qml | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml index 7fa1d992e..cdde8c755 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml @@ -92,6 +92,21 @@ PlasmaCore.SvgItem { root.value = root.parent.height - (parent.y + offset + root.height/2) } else if (alignment == Qt.AlignLeft) { root.value = parent.y - offset + root.height/2 + //Center + } else { + if (root.alignment & Qt.AlignRight) { + root.value = (root.parent.height/2 - parent.y + offset)*2 + root.height/2 + } else if (root.alignment & Qt.AlignLeft) { + root.value = (parent.y - offset - root.parent.height/2)*2 + root.height/2 + } else { + var value = parent.y - root.parent.height/2 - offset + root.height/2 + //Snap + if (Math.abs(value) < 5) { + root.value = 0 + } else { + root.value = value + } + } } } else { if (root.alignment == Qt.AlignRight) { @@ -105,7 +120,13 @@ PlasmaCore.SvgItem { } else if (root.alignment & Qt.AlignLeft) { root.value = (parent.x - offset - root.parent.width/2)*2 + root.width/2 } else { - root.value = parent.x - root.parent.width/2 - offset + root.width/2 + var value = parent.x - root.parent.width/2 - offset + root.width/2 + //Snap + if (Math.abs(value) < 5) { + root.value = 0 + } else { + root.value = value + } } } } From 13c5cf9380207530b0932bf037fdaec143a444fb Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 9 May 2013 20:48:36 +0200 Subject: [PATCH 36/80] use dialogRoot.vertical --- .../configuration/panelconfiguration/SliderHandle.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml index cdde8c755..e13cb9dce 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml @@ -41,7 +41,7 @@ PlasmaCore.SvgItem { property int alignment: panel.alignment function syncPos() { - if (panel.location == 5 || panel.location == 6) { + if (dialogRoot.vertical) { if (alignment == Qt.AlignRight) { y = root.parent.height - (value + offset + root.height/2) } else if (alignment == Qt.AlignLeft) { @@ -83,11 +83,11 @@ PlasmaCore.SvgItem { MouseArea { drag { target: parent - axis: (panel.location == 5 || panel.location == 6) ? Drag.YAxis : Drag.XAxis + axis: (dialogRoot.vertical) ? Drag.YAxis : Drag.XAxis } anchors.fill: parent onPositionChanged: { - if (panel.location == 5 || panel.location == 6) { + if (dialogRoot.vertical) { if (root.alignment == Qt.AlignRight) { root.value = root.parent.height - (parent.y + offset + root.height/2) } else if (alignment == Qt.AlignLeft) { From e07600a83ff63a1f7acb4d19cb00d6994cac5c34 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 10 May 2013 19:29:13 +0200 Subject: [PATCH 37/80] Put all Plasma emums in a Types class This makes possible to use them directly frmo QML as a minus, is not pretty and requires tons of search and replace in old c++ code --- src/declarativeimports/core/dialog.cpp | 42 ++++---- src/declarativeimports/core/framesvgitem.cpp | 20 ++-- src/plasma/applet.cpp | 36 +++---- src/plasma/applet.h | 2 +- src/plasma/containment.cpp | 36 +++---- src/plasma/corona.cpp | 44 ++++----- src/plasma/dataengine.h | 6 +- src/plasma/framesvg.cpp | 24 ++--- src/plasma/plasma.cpp | 52 +++++----- src/plasma/plasma.h | 48 +++++++--- src/plasma/private/applet_p.cpp | 16 ++-- src/plasma/private/containment_p.cpp | 30 +++--- src/plasma/private/containment_p.h | 6 +- src/plasma/private/datacontainer_p.cpp | 8 +- src/plasma/scripting/appletscript.cpp | 2 +- src/plasma/scripting/scriptengine.cpp | 26 ++--- src/plasma/scripting/scriptengine.h | 2 +- .../qml/plasmoid/appletinterface.cpp | 34 +++---- .../qml/plasmoid/appletinterface.h | 96 +++---------------- .../qml/plasmoid/containmentinterface.cpp | 8 +- .../qml/plasmoid/declarativeappletscript.cpp | 6 +- src/shell/desktopcorona.cpp | 8 +- src/shell/panelconfigview.cpp | 10 +- src/shell/panelview.cpp | 36 +++---- src/shell/scripting/appinterface.cpp | 4 +- src/shell/scripting/applet.cpp | 6 +- src/shell/scripting/containment.cpp | 10 +- src/shell/scripting/panel.cpp | 50 +++++----- src/shell/scripting/scriptengine.cpp | 10 +- src/shell/view.cpp | 8 +- src/shell/widgetexplorer/widgetexplorer.cpp | 12 +-- 31 files changed, 325 insertions(+), 373 deletions(-) diff --git a/src/declarativeimports/core/dialog.cpp b/src/declarativeimports/core/dialog.cpp index 692899e65..b9bda174d 100644 --- a/src/declarativeimports/core/dialog.cpp +++ b/src/declarativeimports/core/dialog.cpp @@ -40,20 +40,20 @@ // just for debugging purposes, FIXME: remove later QString locString(const Plasma::Location l) { QString o = "Unknown: " + l; - if (l == Plasma::Floating) { + if (l == Plasma::Types::Floating) { o = "Floating"; - } else if (l == Plasma::Desktop) { + } else if (l == Plasma::Types::Desktop) { o = "Desktop"; - } else if (l == Plasma::FullScreen) { + } else if (l == Plasma::Types::FullScreen) { o = "FullScreen"; - } else if (l == Plasma::TopEdge) { - o = "TopEdge"; - } else if (l == Plasma::BottomEdge) { - o = "BottomEdge"; - } else if (l == Plasma::LeftEdge) { - o = "LeftEdge"; - } else if (l == Plasma::RightEdge) { - o = "RightEdge"; + } else if (l == Plasma::Types::TopEdge) { + o = "Types::TopEdge"; + } else if (l == Plasma::Types::BottomEdge) { + o = "Types::BottomEdge"; + } else if (l == Plasma::Types::LeftEdge) { + o = "Types::LeftEdge"; + } else if (l == Plasma::Types::RightEdge) { + o = "Types::RightEdge"; } return o; } @@ -61,7 +61,7 @@ QString locString(const Plasma::Location l) { DialogProxy::DialogProxy(QQuickItem *parent) : QQuickWindow(), m_activeWindow(false), - m_location(Plasma::TopEdge) + m_location(Plasma::Types::TopEdge) { QSurfaceFormat format; format.setAlphaBufferSize(8); @@ -153,7 +153,7 @@ void DialogProxy::setVisible(const bool visible) syncToMainItemSize(); if (!m_visualParent.isNull() && m_visualParent.data()->window()) { avail = m_visualParent.data()->window()->screen()->availableGeometry(); - if (location() == Plasma::FullScreen) { + if (location() == Plasma::Types::FullScreen) { m_frameSvgItem->setEnabledBorders(Plasma::FrameSvg::NoBorder); setGeometry(avail); @@ -228,13 +228,13 @@ QPoint DialogProxy::popupPosition(QQuickItem *item, Qt::AlignmentFlag alignment) (item->boundingRect().height() - height())/2); QPoint offset(0, 0); - if (l == Plasma::BottomEdge) { + if (l == Plasma::Types::BottomEdge) { offset = bottomPoint; - } else if (l == Plasma::LeftEdge) { + } else if (l == Plasma::Types::LeftEdge) { offset = leftPoint; - } else if (l == Plasma::RightEdge) { + } else if (l == Plasma::Types::RightEdge) { offset = rightPoint; - } else { // TopEdge + } else { // Types::TopEdge offset = topPoint; } @@ -248,7 +248,7 @@ QPoint DialogProxy::popupPosition(QQuickItem *item, Qt::AlignmentFlag alignment) if (menuPos.x() < leftMargin) { // popup hits lhs - if (l == Plasma::TopEdge || l == Plasma::BottomEdge) { + if (l == Plasma::Types::TopEdge || l == Plasma::Types::BottomEdge) { // move it menuPos.setX(0-leftMargin); } else { @@ -258,7 +258,7 @@ QPoint DialogProxy::popupPosition(QQuickItem *item, Qt::AlignmentFlag alignment) } if (menuPos.x() + width() > avail.width() - rightMargin) { // popup hits rhs - if (l == Plasma::TopEdge || l == Plasma::BottomEdge) { + if (l == Plasma::Types::TopEdge || l == Plasma::Types::BottomEdge) { menuPos.setX(avail.width() - item->boundingRect().width() + rightMargin); } else { menuPos.setX(pos.x() + leftPoint.x()); @@ -266,7 +266,7 @@ QPoint DialogProxy::popupPosition(QQuickItem *item, Qt::AlignmentFlag alignment) } if (menuPos.y() < topMargin) { // hitting top - if (l == Plasma::LeftEdge || l == Plasma::RightEdge) { + if (l == Plasma::Types::LeftEdge || l == Plasma::Types::RightEdge) { menuPos.setY(0); } else { menuPos.setY(pos.y() + bottomPoint.y()); @@ -274,7 +274,7 @@ QPoint DialogProxy::popupPosition(QQuickItem *item, Qt::AlignmentFlag alignment) } if (menuPos.y() + height() > avail.height() - bottomMargin) { // hitting bottom - if (l == Plasma::TopEdge || l == Plasma::BottomEdge) { + if (l == Plasma::Types::TopEdge || l == Plasma::Types::BottomEdge) { menuPos.setY(pos.y() + topPoint.y()); } else { menuPos.setY(avail.height() - item->boundingRect().height() + bottomMargin); diff --git a/src/declarativeimports/core/framesvgitem.cpp b/src/declarativeimports/core/framesvgitem.cpp index f4b0eebf5..b17b3193c 100644 --- a/src/declarativeimports/core/framesvgitem.cpp +++ b/src/declarativeimports/core/framesvgitem.cpp @@ -37,22 +37,22 @@ FrameSvgItemMargins::FrameSvgItemMargins(Plasma::FrameSvg *frameSvg, QObject *pa qreal FrameSvgItemMargins::left() const { - return m_frameSvg->marginSize(LeftMargin); + return m_frameSvg->marginSize(Types::LeftMargin); } qreal FrameSvgItemMargins::top() const { - return m_frameSvg->marginSize(TopMargin); + return m_frameSvg->marginSize(Types::TopMargin); } qreal FrameSvgItemMargins::right() const { - return m_frameSvg->marginSize(RightMargin); + return m_frameSvg->marginSize(Types::RightMargin); } qreal FrameSvgItemMargins::bottom() const { - return m_frameSvg->marginSize(BottomMargin); + return m_frameSvg->marginSize(Types::BottomMargin); } void FrameSvgItemMargins::update() @@ -84,11 +84,11 @@ void FrameSvgItem::setImagePath(const QString &path) m_frameSvg->setElementPrefix(m_prefix); if (implicitWidth() <= 0) { - setImplicitWidth(m_frameSvg->marginSize(Plasma::LeftMargin) + m_frameSvg->marginSize(Plasma::RightMargin)); + setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin)); } if (implicitHeight() <= 0) { - setImplicitHeight(m_frameSvg->marginSize(Plasma::TopMargin) + m_frameSvg->marginSize(Plasma::BottomMargin)); + setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin)); } emit imagePathChanged(); @@ -114,11 +114,11 @@ void FrameSvgItem::setPrefix(const QString &prefix) m_prefix = prefix; if (implicitWidth() <= 0) { - setImplicitWidth(m_frameSvg->marginSize(Plasma::LeftMargin) + m_frameSvg->marginSize(Plasma::RightMargin)); + setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin)); } if (implicitHeight() <= 0) { - setImplicitHeight(m_frameSvg->marginSize(Plasma::TopMargin) + m_frameSvg->marginSize(Plasma::BottomMargin)); + setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin)); } emit prefixChanged(); @@ -167,11 +167,11 @@ void FrameSvgItem::geometryChanged(const QRectF &newGeometry, void FrameSvgItem::doUpdate() { if (implicitWidth() <= 0) { - setImplicitWidth(m_frameSvg->marginSize(Plasma::LeftMargin) + m_frameSvg->marginSize(Plasma::RightMargin)); + setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin)); } if (implicitHeight() <= 0) { - setImplicitHeight(m_frameSvg->marginSize(Plasma::TopMargin) + m_frameSvg->marginSize(Plasma::BottomMargin)); + setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin)); } update(); diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp index a96f42b70..659dd7baa 100644 --- a/src/plasma/applet.cpp +++ b/src/plasma/applet.cpp @@ -167,7 +167,7 @@ void Applet::save(KConfigGroup &g) const void Applet::restore(KConfigGroup &group) { - setImmutability((ImmutabilityType)group.readEntry("immutability", (int)Mutable)); + setImmutability((ImmutabilityType)group.readEntry("immutability", (int)Types::Mutable)); KConfigGroup shortcutConfig(&group, "Shortcuts"); QString shortcutText = shortcutConfig.readEntryUntranslated("global", QString()); @@ -257,7 +257,7 @@ KConfigGroup Applet::globalConfig() const void Applet::destroy() { - if (immutability() != Mutable || d->transient || !d->started) { + if (immutability() != Types::Mutable || d->transient || !d->started) { return; //don't double delete } @@ -350,18 +350,18 @@ ImmutabilityType Applet::immutability() const // restrictive setting possible and will override anything that might be happening above it // in the Corona->Containment->Applet hierarchy if (d->transient || (d->mainConfig && d->mainConfig->isImmutable())) { - return SystemImmutable; + return Types::SystemImmutable; } //Returning the more strict immutability between the applet immutability, Containment and Corona - ImmutabilityType upperImmutability = Mutable; + ImmutabilityType upperImmutability = Types::Mutable; Containment *cont = d->isContainment ? 0 : containment(); if (cont) { upperImmutability = cont->immutability(); } - if (upperImmutability != Mutable) { + if (upperImmutability != Types::Mutable) { // it's either system or user immutable, and we already check for local system immutability, // so upperImmutability is guaranteed to be as or more severe as this object's immutability return upperImmutability; @@ -372,7 +372,7 @@ ImmutabilityType Applet::immutability() const void Applet::setImmutability(const ImmutabilityType immutable) { - if (d->immutability == immutable || immutable == Plasma::SystemImmutable) { + if (d->immutability == immutable || immutable == Types::SystemImmutable) { // we do not store system immutability in d->immutability since that gets saved // out to the config file; instead, we check with // the config group itself for this information at all times. this differs from @@ -381,7 +381,7 @@ void Applet::setImmutability(const ImmutabilityType immutable) } d->immutability = immutable; - updateConstraints(ImmutableConstraint); + updateConstraints(Types::ImmutableConstraint); } QString Applet::launchErrorMessage() const @@ -422,7 +422,7 @@ void Applet::setStatus(const ItemStatus status) void Applet::flushPendingConstraintsEvents() { - if (d->pendingConstraints == NoConstraint) { + if (d->pendingConstraints == Types::NoConstraint) { return; } @@ -432,11 +432,11 @@ void Applet::flushPendingConstraintsEvents() //kDebug() << "fushing constraints: " << d->pendingConstraints << "!!!!!!!!!!!!!!!!!!!!!!!!!!!"; Plasma::Constraints c = d->pendingConstraints; - d->pendingConstraints = NoConstraint; + d->pendingConstraints = Types::NoConstraint; - if (c & Plasma::StartupCompletedConstraint) { + if (c & Plasma::Types::StartupCompletedConstraint) { //common actions - bool unlocked = immutability() == Mutable; + bool unlocked = immutability() == Types::Mutable; QAction *closeApplet = d->actions->action("remove"); if (closeApplet) { closeApplet->setEnabled(unlocked); @@ -467,8 +467,8 @@ void Applet::flushPendingConstraintsEvents() } } - if (c & Plasma::ImmutableConstraint) { - bool unlocked = immutability() == Mutable; + if (c & Plasma::Types::ImmutableConstraint) { + bool unlocked = immutability() == Types::Mutable; QAction *action = d->actions->action("remove"); if (action) { action->setVisible(unlocked); @@ -494,7 +494,7 @@ void Applet::flushPendingConstraintsEvents() // pass the constraint on to the actual subclass constraintsEvent(c); - if (c & StartupCompletedConstraint) { + if (c & Types::StartupCompletedConstraint) { // start up is done, we can now go do a mod timer if (d->modificationsTimer) { if (d->modificationsTimer->isActive()) { @@ -528,7 +528,7 @@ FormFactor Applet::formFactor() const parentApplet = qobject_cast(pw); } - return c ? c->d->formFactor : Plasma::Planar; + return c ? c->d->formFactor : Plasma::Types::Planar; } Containment *Applet::containment() const @@ -602,7 +602,7 @@ KShortcut Applet::globalShortcut() const Location Applet::location() const { Containment *c = containment(); - return c ? c->d->location : Plasma::Desktop; + return c ? c->d->location : Plasma::Types::Desktop; } bool Applet::hasConfigurationInterface() const @@ -620,7 +620,7 @@ void Applet::setHasConfigurationInterface(bool hasInterface) if (configAction) { bool enable = hasInterface; if (enable) { - const bool unlocked = immutability() == Mutable; + const bool unlocked = immutability() == Types::Mutable; enable = unlocked || KAuthorized::authorize("plasma/allow_configure_when_locked"); } configAction->setEnabled(enable); @@ -714,7 +714,7 @@ void Applet::timerEvent(QTimerEvent *event) // Don't flushPendingConstraints if we're just starting up // flushPendingConstraints will be called by Corona - if(!(d->pendingConstraints & Plasma::StartupCompletedConstraint)) { + if(!(d->pendingConstraints & Plasma::Types::StartupCompletedConstraint)) { flushPendingConstraintsEvents(); } } else if (d->modificationsTimer && event->timerId() == d->modificationsTimer->timerId()) { diff --git a/src/plasma/applet.h b/src/plasma/applet.h index ff1d10c03..168da3dce 100644 --- a/src/plasma/applet.h +++ b/src/plasma/applet.h @@ -225,7 +225,7 @@ class PLASMA_EXPORT Applet : public QObject * * @param constraints the type of constraints that were updated */ - void updateConstraints(Plasma::Constraints constraints = Plasma::AllConstraints); + void updateConstraints(Plasma::Constraints constraints = Plasma::Types::AllConstraints); //METADATA diff --git a/src/plasma/containment.cpp b/src/plasma/containment.cpp index 6f975700d..f7aeea575 100644 --- a/src/plasma/containment.cpp +++ b/src/plasma/containment.cpp @@ -67,7 +67,7 @@ Containment::Containment(QObject *parent, { // WARNING: do not access config() OR globalConfig() in this method! // that requires a scene, which is not available at this point - setContainmentType(CustomContainment); + setContainmentType(Types::CustomContainment); setHasConfigurationInterface(true); } @@ -104,26 +104,26 @@ void Containment::init() return; } - if (d->type == NoContainmentType) { - //setContainmentType(Plasma::DesktopContainment); + if (d->type == Types::NoContainmentType) { + //setContainmentType(Plasma::Types::DesktopContainment); //Try to determine the containment type. It must be done as soon as possible QString type = pluginInfo().property("X-Plasma-ContainmentType").toString(); if (type == "Panel") { - setContainmentType(Plasma::PanelContainment); + setContainmentType(Plasma::Types::PanelContainment); } else if (type == "Custom") { - setContainmentType(Plasma::CustomContainment); + setContainmentType(Plasma::Types::CustomContainment); } else if (type == "CustomPanel") { - setContainmentType(Plasma::CustomPanelContainment); + setContainmentType(Plasma::Types::CustomPanelContainment); //default to desktop } else { - setContainmentType(Plasma::DesktopContainment); + setContainmentType(Plasma::Types::DesktopContainment); } } //connect actions ContainmentPrivate::addDefaultActions(actions(), this); - bool unlocked = immutability() == Mutable; + bool unlocked = immutability() == Types::Mutable; //fix the text of the actions that need title() //btw, do we really want to use title() when it's a desktopcontainment? @@ -144,7 +144,7 @@ void Containment::init() connect(appletBrowserAction, SIGNAL(triggered()), this, SLOT(triggerShowAddWidgets())); } - if (immutability() != SystemImmutable && corona()) { + if (immutability() != Types::SystemImmutable && corona()) { QAction *lockDesktopAction = corona()->actions()->action("lock widgets"); //keep a pointer so nobody notices it moved to corona if (lockDesktopAction) { @@ -186,7 +186,7 @@ void Containment::restore(KConfigGroup &group) flushPendingConstraintsEvents(); restoreContents(group); - setImmutability((ImmutabilityType)group.readEntry("immutability", (int)Mutable)); + setImmutability((ImmutabilityType)group.readEntry("immutability", (int)Types::Mutable)); setWallpaper(group.readEntry("wallpaperplugin", ContainmentPrivate::defaultWallpaper)); @@ -202,9 +202,9 @@ void Containment::restore(KConfigGroup &group) } } else { //shell defaults KConfigGroup defaultActionsCfg; - if (d->type == Plasma::PanelContainment) { + if (d->type == Plasma::Types::PanelContainment) { defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->package().filePath("defaults")), "Panel"); - //Plasma::DesktopContainment + //Plasma::Types::DesktopContainment } else { defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->package().filePath("defaults")), "Desktop"); } @@ -319,7 +319,7 @@ void Containment::setFormFactor(FormFactor formFactor) //kDebug() << "switching FF to " << formFactor; d->formFactor = formFactor; - updateConstraints(Plasma::FormFactorConstraint); + updateConstraints(Plasma::Types::FormFactorConstraint); KConfigGroup c = config(); c.writeEntry("formfactor", (int)formFactor); @@ -336,10 +336,10 @@ void Containment::setLocation(Location location) d->location = location; foreach (Applet *applet, d->applets) { - applet->updateConstraints(Plasma::LocationConstraint); + applet->updateConstraints(Plasma::Types::LocationConstraint); } - updateConstraints(Plasma::LocationConstraint); + updateConstraints(Plasma::Types::LocationConstraint); KConfigGroup c = config(); c.writeEntry("location", (int)location); @@ -354,7 +354,7 @@ Applet *Containment::createApplet(const QString &name, const QVariantList &args) void Containment::addApplet(Applet *applet) { - if (!isContainment() || immutability() != Mutable) { + if (!isContainment() || immutability() != Types::Mutable) { return; } @@ -416,13 +416,13 @@ void Containment::addApplet(Applet *applet) //FIXME: an on-appear animation would be nice to have again } - applet->updateConstraints(Plasma::AllConstraints); + applet->updateConstraints(Plasma::Types::AllConstraints); applet->flushPendingConstraintsEvents(); emit appletAdded(applet); if (!currentContainment) { - applet->updateConstraints(Plasma::StartupCompletedConstraint); + applet->updateConstraints(Plasma::Types::StartupCompletedConstraint); applet->flushPendingConstraintsEvents(); } diff --git a/src/plasma/corona.cpp b/src/plasma/corona.cpp index 65d54656a..5013c76a6 100644 --- a/src/plasma/corona.cpp +++ b/src/plasma/corona.cpp @@ -93,7 +93,7 @@ void Corona::exportLayout(KConfigGroup &config, QList containments //temporarily unlock so that removal works ImmutabilityType oldImm = immutability(); - d->immutability = Mutable; + d->immutability = Types::Mutable; KConfigGroup dest(&config, "Containments"); KConfigGroup dummy; @@ -102,10 +102,10 @@ void Corona::exportLayout(KConfigGroup &config, QList containments c->config().reparent(&dest); //ensure the containment is unlocked - //this is done directly because we have to bypass any SystemImmutable checks - c->Applet::d->immutability = Mutable; + //this is done directly because we have to bypass any Types::SystemImmutable checks + c->Applet::d->immutability = Types::Mutable; foreach (Applet *a, c->applets()) { - a->d->immutability = Mutable; + a->d->immutability = Types::Mutable; } c->destroy(); @@ -161,8 +161,8 @@ Containment *Corona::containmentForScreen(int screen) const { foreach (Containment *containment, d->containments) { if (containment->screen() == screen && - (containment->containmentType() == Plasma::DesktopContainment || - containment->containmentType() == Plasma::CustomContainment)) { + (containment->containmentType() == Plasma::Types::DesktopContainment || + containment->containmentType() == Plasma::Types::CustomContainment)) { return containment; } } @@ -186,7 +186,7 @@ KSharedConfigPtr Corona::config() const Containment *Corona::createContainment(const QString &name, const QVariantList &args) { - if (d->immutability == Mutable) { + if (d->immutability == Types::Mutable) { return d->addContainment(name, args, 0); } @@ -220,7 +220,7 @@ ImmutabilityType Corona::immutability() const void Corona::setImmutability(const ImmutabilityType immutable) { - if (d->immutability == immutable || d->immutability == SystemImmutable) { + if (d->immutability == immutable || d->immutability == Types::SystemImmutable) { return; } @@ -235,11 +235,11 @@ void Corona::setImmutability(const ImmutabilityType immutable) //update our actions QAction *action = d->actions.action("lock widgets"); if (action) { - if (d->immutability == SystemImmutable) { + if (d->immutability == Types::SystemImmutable) { action->setEnabled(false); action->setVisible(false); } else { - bool unlocked = d->immutability == Mutable; + bool unlocked = d->immutability == Types::Mutable; action->setText(unlocked ? i18n("Lock Widgets") : i18n("Unlock Widgets")); action->setIcon(QIcon::fromTheme(unlocked ? "object-locked" : "object-unlocked")); action->setEnabled(true); @@ -247,7 +247,7 @@ void Corona::setImmutability(const ImmutabilityType immutable) } } - if (d->immutability != SystemImmutable) { + if (d->immutability != Types::SystemImmutable) { KConfigGroup cg(config(), "General"); // we call the dptr member directly for locked since isImmutable() @@ -260,8 +260,8 @@ void Corona::setImmutability(const ImmutabilityType immutable) QList Corona::freeEdges(int screen) const { QList freeEdges; - freeEdges << Plasma::TopEdge << Plasma::BottomEdge - << Plasma::LeftEdge << Plasma::RightEdge; + freeEdges << Plasma::Types::TopEdge << Plasma::Types::BottomEdge + << Plasma::Types::LeftEdge << Plasma::Types::RightEdge; foreach (Containment *containment, containments()) { if (containment->screen() == screen && @@ -280,7 +280,7 @@ KActionCollection *Corona::actions() const CoronaPrivate::CoronaPrivate(Corona *corona) : q(corona), - immutability(Mutable), + immutability(Types::Mutable), config(0), configSyncTimer(new QTimer(corona)), actions(corona) @@ -317,7 +317,7 @@ void CoronaPrivate::init() lockAction->setText(i18n("Lock Widgets")); lockAction->setAutoRepeat(true); lockAction->setIcon(QIcon::fromTheme("object-locked")); - lockAction->setData(Plasma::ControlAction); + lockAction->setData(Plasma::Types::ControlAction); lockAction->setShortcut(KShortcut("alt+d, l")); lockAction->setShortcutContext(Qt::ApplicationShortcut); @@ -328,10 +328,10 @@ void CoronaPrivate::init() void CoronaPrivate::toggleImmutability() { - if (immutability == Mutable) { - q->setImmutability(UserImmutable); + if (immutability == Types::Mutable) { + q->setImmutability(Types::UserImmutable); } else { - q->setImmutability(Mutable); + q->setImmutability(Types::Mutable); } } @@ -349,7 +349,7 @@ void CoronaPrivate::updateContainmentImmutability() { foreach (Containment *c, containments) { // we need to tell each containment that immutability has been altered - c->updateConstraints(ImmutableConstraint); + c->updateConstraints(Types::ImmutableConstraint); } } @@ -418,7 +418,7 @@ Containment *CoronaPrivate::addContainment(const QString &name, const QVariantLi } // we want to provide something and don't care about the failure to launch - containment->setFormFactor(Plasma::Planar); + containment->setFormFactor(Plasma::Types::Planar); } // if this is a new containment, we need to ensure that there are no stale @@ -443,7 +443,7 @@ Containment *CoronaPrivate::addContainment(const QString &name, const QVariantLi containment->init(); KConfigGroup cg = containment->config(); containment->restore(cg); - containment->updateConstraints(Plasma::StartupCompletedConstraint); + containment->updateConstraints(Plasma::Types::StartupCompletedConstraint); containment->save(cg); q->requestConfigSync(); containment->flushPendingConstraintsEvents(); @@ -507,7 +507,7 @@ QList CoronaPrivate::importLayout(const KConfigGroup &con } foreach (Containment *containment, newContainments) { - containment->updateConstraints(Plasma::StartupCompletedConstraint); + containment->updateConstraints(Plasma::Types::StartupCompletedConstraint); emit q->containmentAdded(containment); #ifndef NDEBUG // kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Containment" << containment->name(); diff --git a/src/plasma/dataengine.h b/src/plasma/dataengine.h index 13559a2e9..d3baad307 100644 --- a/src/plasma/dataengine.h +++ b/src/plasma/dataengine.h @@ -120,7 +120,7 @@ class PLASMA_EXPORT DataEngine : public QObject Q_INVOKABLE void connectSource( const QString &source, QObject *visualization, uint pollingInterval = 0, - Plasma::IntervalAlignment intervalAlignment = NoAlignment) const; + Plasma::Types::IntervalAlignment intervalAlignment = Types::NoAlignment) const; /** * Connects all currently existing sources to an object for data updates. @@ -150,8 +150,8 @@ class PLASMA_EXPORT DataEngine : public QObject * @param intervalAlignment the number of ms to align the interval to **/ Q_INVOKABLE void connectAllSources(QObject *visualization, uint pollingInterval = 0, - Plasma::IntervalAlignment intervalAlignment = -NoAlignment) const; + Plasma::Types::IntervalAlignment intervalAlignment = +Types::NoAlignment) const; /** * Disconnects a source from an object that was receiving data updates. diff --git a/src/plasma/framesvg.cpp b/src/plasma/framesvg.cpp index 862fa7bef..92d3486c0 100644 --- a/src/plasma/framesvg.cpp +++ b/src/plasma/framesvg.cpp @@ -183,16 +183,16 @@ FrameSvg::EnabledBorders FrameSvg::enabledBorders() const void FrameSvg::setElementPrefix(Plasma::Location location) { switch (location) { - case TopEdge: + case Types::TopEdge: setElementPrefix("north"); break; - case BottomEdge: + case Types::BottomEdge: setElementPrefix("south"); break; - case LeftEdge: + case Types::LeftEdge: setElementPrefix("west"); break; - case RightEdge: + case Types::RightEdge: setElementPrefix("east"); break; default: @@ -269,7 +269,7 @@ void FrameSvg::setElementPrefix(const QString &prefix) } } - d->location = Floating; + d->location = Types::Floating; } bool FrameSvg::hasElementPrefix(const QString & prefix) const @@ -286,16 +286,16 @@ bool FrameSvg::hasElementPrefix(const QString & prefix) const bool FrameSvg::hasElementPrefix(Plasma::Location location) const { switch (location) { - case TopEdge: + case Types::TopEdge: return hasElementPrefix("north"); break; - case BottomEdge: + case Types::BottomEdge: return hasElementPrefix("south"); break; - case LeftEdge: + case Types::LeftEdge: return hasElementPrefix("west"); break; - case RightEdge: + case Types::RightEdge: return hasElementPrefix("east"); break; default: @@ -393,15 +393,15 @@ qreal FrameSvg::marginSize(const Plasma::MarginEdge edge) const } switch (edge) { - case Plasma::TopMargin: + case Plasma::Types::TopMargin: return d->frames[d->prefix]->topMargin; break; - case Plasma::LeftMargin: + case Plasma::Types::LeftMargin: return d->frames[d->prefix]->leftMargin; break; - case Plasma::RightMargin: + case Plasma::Types::RightMargin: return d->frames[d->prefix]->rightMargin; break; diff --git a/src/plasma/plasma.cpp b/src/plasma/plasma.cpp index fdb813b4e..b37059b78 100644 --- a/src/plasma/plasma.cpp +++ b/src/plasma/plasma.cpp @@ -28,46 +28,46 @@ namespace Plasma { -Direction locationToDirection(Location location) +Types::Direction locationToDirection(Types::Location location) { switch (location) { - case Floating: - case Desktop: - case TopEdge: - case FullScreen: + case Types::Floating: + case Types::Desktop: + case Types::TopEdge: + case Types::FullScreen: //TODO: should we be smarter for floating and planer? // perhaps we should take a QRect and/or QPos as well? - return Down; - case BottomEdge: - return Up; - case LeftEdge: - return Right; - case RightEdge: - return Left; + return Types::Down; + case Types::BottomEdge: + return Types::Up; + case Types::LeftEdge: + return Types::Right; + case Types::RightEdge: + return Types::Left; } - return Down; + return Types::Down; } -Direction locationToInverseDirection(Location location) +Types::Direction locationToInverseDirection(Types::Location location) { switch (location) { - case Floating: - case Desktop: - case TopEdge: - case FullScreen: + case Types::Floating: + case Types::Desktop: + case Types::TopEdge: + case Types::FullScreen: //TODO: should we be smarter for floating and planer? // perhaps we should take a QRect and/or QPos as well? - return Up; - case BottomEdge: - return Down; - case LeftEdge: - return Left; - case RightEdge: - return Right; + return Types::Up; + case Types::BottomEdge: + return Types::Down; + case Types::LeftEdge: + return Types::Left; + case Types::RightEdge: + return Types::Right; } - return Up; + return Types::Up; } } // Plasma namespace diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 2c59a6ba1..a0fb4163c 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -34,6 +34,13 @@ class QAction; namespace Plasma { +class PLASMA_EXPORT Types : public QObject +{ + Q_OBJECT + Q_ENUMS(Constraint) + Q_ENUMS(FormFactor) + +public: /** * The Constraint enumeration lists the various constraints that Plasma * objects have managed for them and which they may wish to react to, @@ -246,12 +253,6 @@ enum ItemStatus { }; Q_ENUMS(ItemStatus) -enum AnnouncementMethod { - NoAnnouncement = 0, /**< No announcements **/ - ZeroconfAnnouncement = 1 /**< Announcements via ZeroConf **/ -}; -Q_DECLARE_FLAGS(AnnouncementMethods, AnnouncementMethod) - enum TrustLevel { UnverifiableTrust = 0, /**< The trust of the object can not be verified, usually because no trust information (e.g. a cryptographic signature) was provided */ @@ -276,6 +277,8 @@ enum BackgroundHints { }; Q_ENUMS(BackgroundHints) +}; + /** * Converts a location to a direction. Handy for figuring out which way to send a popup based on * location or to point arrows and other directional items. @@ -283,7 +286,7 @@ Q_ENUMS(BackgroundHints) * @param location the location of the container the element will appear in * @return the visual direction the element should be oriented in **/ -PLASMA_EXPORT Direction locationToDirection(Location location); +PLASMA_EXPORT Types::Direction locationToDirection(Types::Location location); /** * Converts a location to the direction facing it. Handy for figuring out which way to collapse @@ -292,13 +295,36 @@ PLASMA_EXPORT Direction locationToDirection(Location location); * @param location the location of the container the element will appear in * @return the visual direction the element should be oriented in **/ -PLASMA_EXPORT Direction locationToInverseDirection(Location location); +PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location location); + +//For porting +//TODO: remove +typedef Types::Constraint Constraint; +Q_DECLARE_FLAGS(Constraints, Constraint) +typedef Types::FormFactor FormFactor; +typedef Types::ContainmentType ContainmentType; +typedef Types::ActionType ActionType; +typedef Types::Direction Direction; +typedef Types::Location Location; +typedef Types::Position Position; +typedef Types::PopupPlacement PopupPlacement; +typedef Types::FlipDirection FlipDirection; +typedef Types::IntervalAlignment IntervalAlignment; +typedef Types::ImmutabilityType ImmutabilityType; +typedef Types::ComponentType ComponentType; +typedef Types::MarginEdge MarginEdge; +typedef Types::MessageButton MessageButton; +typedef Types::ItemStatus ItemStatus; +typedef Types::TrustLevel TrustLevel; +typedef Types::BackgroundHints BackgroundHints; } // Plasma namespace -Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Constraints) -Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip) + + +Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::Constraints) +/*Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip) Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::ComponentTypes) -Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::MessageButtons) +Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::MessageButtons)*/ #endif // multiple inclusion guard diff --git a/src/plasma/private/applet_p.cpp b/src/plasma/private/applet_p.cpp index 0092adbdb..b557fb978 100644 --- a/src/plasma/private/applet_p.cpp +++ b/src/plasma/private/applet_p.cpp @@ -50,16 +50,16 @@ namespace Plasma AppletPrivate::AppletPrivate(KService::Ptr service, const KPluginInfo *info, int uniqueID, Applet *applet) : appletId(uniqueID), q(applet), - immutability(Mutable), + immutability(Types::Mutable), appletDescription(info ? *info : KPluginInfo(service)), mainConfig(0), - pendingConstraints(NoConstraint), + pendingConstraints(Types::NoConstraint), script(0), package(0), configLoader(0), actions(AppletPrivate::defaultActions(applet)), activationAction(0), - itemStatus(UnknownStatus), + itemStatus(Types::UnknownStatus), modificationsTimer(0), hasConfigurationInterface(false), isContainment(false), @@ -202,14 +202,14 @@ KActionCollection* AppletPrivate::defaultActions(QObject *parent) configAction->setText(i18n("Widget Settings")); configAction->setIcon(QIcon::fromTheme("configure")); configAction->setShortcut(KShortcut("alt+d, s")); - configAction->setData(Plasma::ConfigureAction); + configAction->setData(Plasma::Types::ConfigureAction); KAction *closeApplet = actions->add("remove"); closeApplet->setAutoRepeat(false); closeApplet->setText(i18n("Remove this Widget")); closeApplet->setIcon(QIcon::fromTheme("edit-delete")); closeApplet->setShortcut(KShortcut("alt+d, r")); - closeApplet->setData(Plasma::DestructiveAction); + closeApplet->setData(Plasma::Types::DestructiveAction); KAction *runAssociatedApplication = actions->add("run associated application"); runAssociatedApplication->setAutoRepeat(false); @@ -218,7 +218,7 @@ KActionCollection* AppletPrivate::defaultActions(QObject *parent) runAssociatedApplication->setShortcut(KShortcut("alt+d, t")); runAssociatedApplication->setVisible(false); runAssociatedApplication->setEnabled(false); - runAssociatedApplication->setData(Plasma::ControlAction); + runAssociatedApplication->setData(Plasma::Types::ControlAction); return actions; } @@ -321,11 +321,11 @@ void AppletPrivate::scheduleConstraintsUpdate(Plasma::Constraints c) { // Don't start up a timer if we're just starting up // flushPendingConstraints will be called by Corona - if (started && !constraintsTimer.isActive() && !(c & Plasma::StartupCompletedConstraint)) { + if (started && !constraintsTimer.isActive() && !(c & Plasma::Types::StartupCompletedConstraint)) { constraintsTimer.start(0, q); } - if (c & Plasma::StartupCompletedConstraint) { + if (c & Plasma::Types::StartupCompletedConstraint) { started = true; } diff --git a/src/plasma/private/containment_p.cpp b/src/plasma/private/containment_p.cpp index 517766470..aeca2c37e 100644 --- a/src/plasma/private/containment_p.cpp +++ b/src/plasma/private/containment_p.cpp @@ -69,7 +69,7 @@ void ContainmentPrivate::addDefaultActions(KActionCollection *actions, Containme appletBrowserAction->setText(i18n("Add Widgets...")); appletBrowserAction->setIcon(QIcon::fromTheme("list-add")); appletBrowserAction->setShortcut(KShortcut("alt+d, a")); - appletBrowserAction->setData(Plasma::AddAction); + appletBrowserAction->setData(Plasma::Types::AddAction); } void ContainmentPrivate::setScreen(int newScreen) @@ -101,8 +101,8 @@ void ContainmentPrivate::setScreen(int newScreen) //kDebug() << activity() << "setting screen to " << newScreen << "and type is" << type; Containment *swapScreensWith(0); - const bool isDesktopContainment = type == Plasma::DesktopContainment || - type == Plasma::CustomContainment; + const bool isDesktopContainment = type == Plasma::Types::DesktopContainment || + type == Plasma::Types::CustomContainment; if (isDesktopContainment) { if (newScreen > -1) { // sanity check to make sure someone else doesn't have this screen already! @@ -123,7 +123,7 @@ void ContainmentPrivate::setScreen(int newScreen) int oldScreen = screen; screen = newScreen; - q->updateConstraints(Plasma::ScreenConstraint); + q->updateConstraints(Plasma::Types::ScreenConstraint); if (oldScreen != newScreen) { /* @@ -194,9 +194,9 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra } //kDebug() << "got containmentConstraintsEvent" << constraints; - if (constraints & Plasma::ImmutableConstraint) { + if (constraints & Plasma::Types::ImmutableConstraint) { //update actions - const bool unlocked = q->immutability() == Mutable; + const bool unlocked = q->immutability() == Types::Mutable; QAction *action = q->actions()->action("remove"); if (action) { @@ -213,21 +213,21 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra // tell the applets too foreach (Applet *a, applets) { a->setImmutability(q->immutability()); - a->updateConstraints(ImmutableConstraint); + a->updateConstraints(Types::ImmutableConstraint); } } // pass on the constraints that are relevant here - Constraints appletConstraints = NoConstraint; - if (constraints & FormFactorConstraint) { - appletConstraints |= FormFactorConstraint; + Constraints appletConstraints = Types::NoConstraint; + if (constraints & Types::FormFactorConstraint) { + appletConstraints |= Types::FormFactorConstraint; } - if (constraints & ScreenConstraint) { - appletConstraints |= ScreenConstraint; + if (constraints & Types::ScreenConstraint) { + appletConstraints |= Types::ScreenConstraint; } - if (appletConstraints != NoConstraint) { + if (appletConstraints != Types::NoConstraint) { foreach (Applet *applet, applets) { applet->updateConstraints(appletConstraints); } @@ -240,7 +240,7 @@ Applet *ContainmentPrivate::createApplet(const QString &name, const QVariantList return 0; } - if (q->immutability() != Mutable) { + if (q->immutability() != Types::Mutable) { #ifndef NDEBUG kDebug() << "addApplet for" << name << "requested, but we're currently immutable!"; #endif @@ -271,7 +271,7 @@ void ContainmentPrivate::appletDeleted(Plasma::Applet *applet) bool ContainmentPrivate::isPanelContainment() const { - return type == Plasma::PanelContainment || type == Plasma::CustomPanelContainment; + return type == Plasma::Types::PanelContainment || type == Plasma::Types::CustomPanelContainment; } } diff --git a/src/plasma/private/containment_p.h b/src/plasma/private/containment_p.h index 1b1c2b4e5..889388ce0 100644 --- a/src/plasma/private/containment_p.h +++ b/src/plasma/private/containment_p.h @@ -47,10 +47,10 @@ class ContainmentPrivate public: ContainmentPrivate(Containment *c) : q(c), - formFactor(Planar), - location(Floating), + formFactor(Types::Planar), + location(Types::Floating), screen(-1), // no screen - type(Plasma::NoContainmentType), + type(Plasma::Types::NoContainmentType), drawWallpaper(false) { } diff --git a/src/plasma/private/datacontainer_p.cpp b/src/plasma/private/datacontainer_p.cpp index 71ca7b2e7..133f27d9a 100644 --- a/src/plasma/private/datacontainer_p.cpp +++ b/src/plasma/private/datacontainer_p.cpp @@ -67,7 +67,7 @@ SignalRelay::SignalRelay(DataContainer *parent, DataContainerPrivate *data, uint { //kDebug() << "signal relay with time of" << m_timerId << "being set up"; m_timerId = startTimer(immediateUpdate ? 0 : m_interval); - if (m_align != Plasma::NoAlignment) { + if (m_align != Plasma::Types::NoAlignment) { checkAlignment(); } } @@ -87,12 +87,12 @@ void SignalRelay::checkAlignment() int newTime = 0; QTime t = QTime::currentTime(); - if (m_align == Plasma::AlignToMinute) { + if (m_align == Plasma::Types::AlignToMinute) { int seconds = t.second(); if (seconds > 2) { newTime = ((60 - seconds) * 1000) + 500; } - } else if (m_align == Plasma::AlignToHour) { + } else if (m_align == Plasma::Types::AlignToHour) { int minutes = t.minute(); int seconds = t.second(); if (minutes > 1 || seconds > 10) { @@ -147,7 +147,7 @@ void SignalRelay::timerEvent(QTimerEvent *event) m_resetTimer = false; } - if (m_align != Plasma::NoAlignment) { + if (m_align != Plasma::Types::NoAlignment) { checkAlignment(); } diff --git a/src/plasma/scripting/appletscript.cpp b/src/plasma/scripting/appletscript.cpp index 95b82a180..4702b05cf 100644 --- a/src/plasma/scripting/appletscript.cpp +++ b/src/plasma/scripting/appletscript.cpp @@ -153,7 +153,7 @@ Plasma::ContainmentType AppletScript::containmentType() const if (cont) { return cont->containmentType(); } else { - return Plasma::NoContainmentType; + return Plasma::Types::NoContainmentType; } } diff --git a/src/plasma/scripting/scriptengine.cpp b/src/plasma/scripting/scriptengine.cpp index 1970382a6..f0f6b3c7a 100644 --- a/src/plasma/scripting/scriptengine.cpp +++ b/src/plasma/scripting/scriptengine.cpp @@ -61,12 +61,12 @@ QString ScriptEngine::mainScript() const return QString(); } -QStringList knownLanguages(ComponentTypes types) +QStringList knownLanguages(Types::ComponentTypes types) { QString constraintTemplate = "'%1' in [X-Plasma-ComponentTypes]"; QString constraint; - if (types & AppletComponent) { + if (types & Types::AppletComponent) { // currently this if statement is not needed, but this future proofs // the code against someone initializing constraint to something // before we get here. @@ -77,7 +77,7 @@ QStringList knownLanguages(ComponentTypes types) constraint.append(constraintTemplate.arg("Applet")); } - if (types & DataEngineComponent) { + if (types & Types::DataEngineComponent) { if (!constraint.isEmpty()) { constraint.append(" or "); } @@ -85,7 +85,7 @@ QStringList knownLanguages(ComponentTypes types) constraint.append(constraintTemplate.arg("DataEngine")); } - if (types & RunnerComponent) { + if (types & Types::RunnerComponent) { if (!constraint.isEmpty()) { constraint.append(" or "); } @@ -124,13 +124,13 @@ KService::List engineOffers(const QString &language, ComponentType type) QString component; switch (type) { - case AppletComponent: + case Types::AppletComponent: component = "Applet"; break; - case DataEngineComponent: + case Types::DataEngineComponent: component = "DataEngine"; break; - case RunnerComponent: + case Types::RunnerComponent: component = "Runner"; break; default: @@ -162,13 +162,13 @@ ScriptEngine *loadEngine(const QString &language, ComponentType type, QObject *p ScriptEngine *engine = 0; foreach (const KService::Ptr &service, offers) { switch (type) { - case AppletComponent: + case Types::AppletComponent: engine = service->createInstance(parent, args, &error); break; - case DataEngineComponent: + case Types::DataEngineComponent: engine = service->createInstance(parent, args, &error); break; - case RunnerComponent: + case Types::RunnerComponent: engine = service->createInstance(parent, args, &error); break; default: @@ -195,7 +195,7 @@ ScriptEngine *loadEngine(const QString &language, ComponentType type, QObject *p AppletScript *loadScriptEngine(const QString &language, Applet *applet) { AppletScript *engine = - static_cast(loadEngine(language, AppletComponent, applet)); + static_cast(loadEngine(language, Types::AppletComponent, applet)); if (engine) { engine->setApplet(applet); @@ -207,7 +207,7 @@ AppletScript *loadScriptEngine(const QString &language, Applet *applet) DataEngineScript *loadScriptEngine(const QString &language, DataEngine *dataEngine) { DataEngineScript *engine = - static_cast(loadEngine(language, DataEngineComponent, dataEngine)); + static_cast(loadEngine(language, Types::DataEngineComponent, dataEngine)); if (engine) { engine->setDataEngine(dataEngine); @@ -218,7 +218,7 @@ DataEngineScript *loadScriptEngine(const QString &language, DataEngine *dataEngi RunnerScript *loadScriptEngine(const QString &language, AbstractRunner *runner) { - RunnerScript *engine = static_cast(loadEngine(language, RunnerComponent, runner)); + RunnerScript *engine = static_cast(loadEngine(language, Types::RunnerComponent, runner)); if (engine) { engine->setRunner(runner); diff --git a/src/plasma/scripting/scriptengine.h b/src/plasma/scripting/scriptengine.h index 443f5d4a7..2ed94a7bd 100644 --- a/src/plasma/scripting/scriptengine.h +++ b/src/plasma/scripting/scriptengine.h @@ -85,7 +85,7 @@ private: * language support for * @return a list of all supported languages for the given type(s). **/ -PLASMA_EXPORT QStringList knownLanguages(ComponentTypes types); +PLASMA_EXPORT QStringList knownLanguages(Types::ComponentTypes types); /** * Loads an Applet script engine for the given language. diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index fe9b0ae91..35f3997b7 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -56,7 +56,7 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, QQuickItem *pa : QQuickItem(parent), m_appletScriptEngine(script), m_actionSignals(0), - m_backgroundHints(Plasma::StandardBackground), + m_backgroundHints(Plasma::Types::StandardBackground), m_busy(false), m_expanded(false) { @@ -135,9 +135,9 @@ void AppletInterface::init() Plasma::Containment *pc = qobject_cast(applet()); if (pc && !qobject_cast(pc->parent())) { KConfigGroup defaults; - if (pc->containmentType() == Plasma::DesktopContainment) { + if (pc->containmentType() == Plasma::Types::DesktopContainment) { defaults = KConfigGroup(KSharedConfig::openConfig(pc->corona()->package().filePath("defaults")), "Desktop"); - } else if (pc->containmentType() == Plasma::PanelContainment) { + } else if (pc->containmentType() == Plasma::Types::PanelContainment) { defaults = KConfigGroup(KSharedConfig::openConfig(pc->corona()->package().filePath("defaults")), "Panel"); } @@ -179,14 +179,14 @@ void AppletInterface::init() emit busyChanged(); } -AppletInterface::FormFactor AppletInterface::formFactor() const +Plasma::Types::FormFactor AppletInterface::formFactor() const { - return static_cast(applet()->formFactor()); + return applet()->formFactor(); } -AppletInterface::Location AppletInterface::location() const +Plasma::Types::Location AppletInterface::location() const { - return static_cast(applet()->location()); + return applet()->location(); } QString AppletInterface::currentActivity() const @@ -256,18 +256,18 @@ void AppletInterface::setExpanded(bool expanded) emit expandedChanged(); } -AppletInterface::BackgroundHints AppletInterface::backgroundHints() const +Plasma::Types::BackgroundHints AppletInterface::backgroundHints() const { - return (BackgroundHints)m_backgroundHints; + return m_backgroundHints; } -void AppletInterface::setBackgroundHints(BackgroundHints hint) +void AppletInterface::setBackgroundHints(Plasma::Types::BackgroundHints hint) { - if (m_backgroundHints == (Plasma::BackgroundHints)hint) { + if (m_backgroundHints == hint) { return; } - m_backgroundHints = (Plasma::BackgroundHints)hint; + m_backgroundHints = hint; emit backgroundHintsChanged(); } @@ -447,7 +447,7 @@ QAction *AppletInterface::action(QString name) const bool AppletInterface::immutable() const { - return applet()->immutability() != Plasma::Mutable; + return applet()->immutability() != Plasma::Types::Mutable; } bool AppletInterface::userConfiguring() const @@ -482,14 +482,14 @@ QString AppletInterface::associatedApplication() const return applet()->associatedApplication(); } -void AppletInterface::setStatus(const AppletInterface::ItemStatus &status) +void AppletInterface::setStatus(const Plasma::Types::ItemStatus &status) { - applet()->setStatus((Plasma::ItemStatus)status); + applet()->setStatus(status); } -AppletInterface::ItemStatus AppletInterface::status() const +Plasma::Types::ItemStatus AppletInterface::status() const { - return (AppletInterface::ItemStatus)((int)(applet()->status())); + return applet()->status(); } QString AppletInterface::downloadPath(const QString &file) diff --git a/src/scriptengines/qml/plasmoid/appletinterface.h b/src/scriptengines/qml/plasmoid/appletinterface.h index 1de9bcd1b..58dfecf1d 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.h +++ b/src/scriptengines/qml/plasmoid/appletinterface.h @@ -49,30 +49,23 @@ namespace Plasma class AppletInterface : public QQuickItem { Q_OBJECT - Q_ENUMS(FormFactor) - Q_ENUMS(Location) - Q_ENUMS(BackgroundHints) - Q_ENUMS(AnimationDirection) - Q_ENUMS(IntervalAlignment) - Q_ENUMS(ThemeColors) - Q_ENUMS(ItemStatus) Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) //TODO: writable icon Q_PROPERTY(QString icon READ icon CONSTANT) Q_PROPERTY(uint id READ id CONSTANT) - Q_PROPERTY(FormFactor formFactor READ formFactor NOTIFY formFactorChanged) - Q_PROPERTY(Location location READ location NOTIFY locationChanged) + Q_PROPERTY(Plasma::Types::FormFactor formFactor READ formFactor NOTIFY formFactorChanged) + Q_PROPERTY(Plasma::Types::Location location READ location NOTIFY locationChanged) Q_PROPERTY(QString currentActivity READ currentActivity NOTIFY contextChanged) Q_PROPERTY(QObject* configuration READ configuration CONSTANT) Q_PROPERTY(QString activeConfig WRITE setActiveConfig READ activeConfig) Q_PROPERTY(bool busy WRITE setBusy READ isBusy NOTIFY busyChanged) Q_PROPERTY(bool expanded WRITE setExpanded READ isExpanded NOTIFY expandedChanged) - Q_PROPERTY(BackgroundHints backgroundHints WRITE setBackgroundHints READ backgroundHints NOTIFY backgroundHintsChanged) + Q_PROPERTY(Plasma::Types::BackgroundHints backgroundHints WRITE setBackgroundHints READ backgroundHints NOTIFY backgroundHintsChanged) Q_PROPERTY(bool immutable READ immutable NOTIFY immutableChanged) Q_PROPERTY(bool userConfiguring READ userConfiguring) // @since 4.5 Q_PROPERTY(int apiVersion READ apiVersion CONSTANT) - Q_PROPERTY(ItemStatus status READ status WRITE setStatus NOTIFY statusChanged) + Q_PROPERTY(Plasma::Types::ItemStatus status READ status WRITE setStatus NOTIFY statusChanged) Q_PROPERTY(QString associatedApplication WRITE setAssociatedApplication READ associatedApplication) public: @@ -82,73 +75,6 @@ public: //API not intended for the QML part QmlObject *qmlObject(); -//------------------------------------------------------------------ -//enums copy&pasted from plasma.h because qtscript is evil - - -//TODO: all of this should go from here -enum FormFactor { - Planar = 0, /**< The applet lives in a plane and has two - degrees of freedom to grow. Optimize for - desktop, laptop or tablet usage: a high - resolution screen 1-3 feet distant from the - viewer. */ - MediaCenter, /**< As with Planar, the applet lives in a plane - but the interface should be optimized for - medium-to-high resolution screens that are - 5-15 feet distant from the viewer. Sometimes - referred to as a "ten foot interface".*/ - Horizontal, /**< The applet is constrained vertically, but - can expand horizontally. */ - Vertical, /**< The applet is constrained horizontally, but - can expand vertically. */ - Application /**< The Applet lives in a plane and should be optimized to look as a full application, - for the desktop or the particular device. */ -}; - -enum Location { - Floating = 0, /**< Free floating. Neither geometry or z-ordering - is described precisely by this value. */ - Desktop, /**< On the planar desktop layer, extending across - the full screen from edge to edge */ - FullScreen, /**< Full screen */ - TopEdge, /**< Along the top of the screen*/ - BottomEdge, /**< Along the bottom of the screen*/ - LeftEdge, /**< Along the left side of the screen */ - RightEdge /**< Along the right side of the screen */ -}; - -enum ItemStatus { - UnknownStatus = 0, /**< The status is unknown **/ - PassiveStatus = 1, /**< The Item is passive **/ - ActiveStatus = 2, /**< The Item is active **/ - NeedsAttentionStatus = 3, /**< The Item needs attention **/ - AcceptingInputStatus = 4 /**< The Item is accepting input **/ -}; - -enum BackgroundHints { - NoBackground = Plasma::NoBackground, - StandardBackground = Plasma::StandardBackground, - TranslucentBackground = Plasma::TranslucentBackground, - DefaultBackground = Plasma::DefaultBackground -}; - -enum ThemeColors { - TextColor = Plasma::Theme::TextColor, - HighlightColor = Plasma::Theme::HighlightColor, - BackgroundColor = Plasma::Theme::BackgroundColor, - ButtonTextColor = Plasma::Theme::ButtonTextColor, - ButtonBackgroundColor = Plasma::Theme::ButtonBackgroundColor, - LinkColor = Plasma::Theme::LinkColor, - VisitedLinkColor = Plasma::Theme::VisitedLinkColor -}; - -enum IntervalAlignment { - NoAlignment = 0, - AlignToMinute, - AlignToHour -}; - //QML API------------------------------------------------------------------- Q_INVOKABLE void setConfigurationRequired(bool needsConfiguring, const QString &reason = QString()); @@ -186,9 +112,9 @@ enum IntervalAlignment { uint id() const; - FormFactor formFactor() const; + Plasma::Types::FormFactor formFactor() const; - Location location() const; + Plasma::Types::Location location() const; QString currentActivity() const; @@ -200,14 +126,14 @@ enum IntervalAlignment { bool isExpanded() const; void setExpanded(bool expanded); - BackgroundHints backgroundHints() const; - void setBackgroundHints(BackgroundHints hint); + Plasma::Types::BackgroundHints backgroundHints() const; + void setBackgroundHints(Plasma::Types::BackgroundHints hint); void setAssociatedApplication(const QString &string); QString associatedApplication() const; - void setStatus(const ItemStatus &status); - ItemStatus status() const; + void setStatus(const Plasma::Types::ItemStatus &status); + Plasma::Types::ItemStatus status() const; QString activeConfig() const; void setActiveConfig(const QString &name); @@ -253,7 +179,7 @@ private: QTimer *m_creationTimer; - Plasma::BackgroundHints m_backgroundHints; + Plasma::Types::BackgroundHints m_backgroundHints; bool m_busy : 1; bool m_expanded : 1; }; diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index a761b1838..143bf16af 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -282,7 +282,7 @@ void ContainmentInterface::addAppletActions(KMenu &desktopMenu, Plasma::Applet * } } - if (containment()->immutability() == Plasma::Mutable) { + if (containment()->immutability() == Plasma::Types::Mutable) { QAction *closeApplet = applet->actions()->action("remove"); //kDebug() << "checking for removal" << closeApplet; if (closeApplet) { @@ -298,7 +298,7 @@ void ContainmentInterface::addAppletActions(KMenu &desktopMenu, Plasma::Applet * void ContainmentInterface::addContainmentActions(KMenu &desktopMenu, QEvent *event) { - if (containment()->corona()->immutability() != Plasma::Mutable && + if (containment()->corona()->immutability() != Plasma::Types::Mutable && !KAuthorized::authorizeKAction("plasma/containment_actions")) { //kDebug() << "immutability"; return; @@ -329,8 +329,8 @@ void ContainmentInterface::addContainmentActions(KMenu &desktopMenu, QEvent *eve if (actions.isEmpty()) { //it probably didn't bother implementing the function. give the user a chance to set //a better plugin. note that if the user sets no-plugin this won't happen... - if ((containment()->containmentType() != Plasma::PanelContainment && - containment()->containmentType() != Plasma::CustomPanelContainment) && + if ((containment()->containmentType() != Plasma::Types::PanelContainment && + containment()->containmentType() != Plasma::Types::CustomPanelContainment) && containment()->actions()->action("configure")) { desktopMenu.addAction(containment()->actions()->action("configure")); } diff --git a/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp b/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp index e48e393d4..0a4335e54 100644 --- a/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp +++ b/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp @@ -131,15 +131,15 @@ QObject *DeclarativeAppletScript::loadui(const QString &filename) void DeclarativeAppletScript::constraintsEvent(Plasma::Constraints constraints) { - if (constraints & Plasma::FormFactorConstraint) { + if (constraints & Plasma::Types::FormFactorConstraint) { emit formFactorChanged(); } - if (constraints & Plasma::LocationConstraint) { + if (constraints & Plasma::Types::LocationConstraint) { emit locationChanged(); } - if (constraints & Plasma::ContextConstraint) { + if (constraints & Plasma::Types::ContextConstraint) { emit contextChanged(); } } diff --git a/src/shell/desktopcorona.cpp b/src/shell/desktopcorona.cpp index f0599fd0e..30976dee0 100644 --- a/src/shell/desktopcorona.cpp +++ b/src/shell/desktopcorona.cpp @@ -147,8 +147,8 @@ void DesktopCorona::checkScreen(int screen, bool signalWhenExists) } Plasma::ContainmentType t = c->containmentType(); - if (t == Plasma::PanelContainment || - t == Plasma::CustomPanelContainment) { + if (t == Plasma::Types::PanelContainment || + t == Plasma::Types::CustomPanelContainment) { emit containmentAdded(c); } } @@ -257,8 +257,8 @@ void DesktopCorona::updateScreenOwner(int wasScreen, int isScreen, Plasma::Conta { qDebug() << "Was screen" << wasScreen << "Is screen" << isScreen <<"Containment" << containment << containment->title(); - if (containment->formFactor() == Plasma::Horizontal || - containment->formFactor() == Plasma::Vertical) { + if (containment->formFactor() == Plasma::Types::Horizontal || + containment->formFactor() == Plasma::Types::Vertical) { if (isScreen >= 0) { m_panelViews[containment] = new PanelView(this); diff --git a/src/shell/panelconfigview.cpp b/src/shell/panelconfigview.cpp index f3fd57404..c019d87e3 100644 --- a/src/shell/panelconfigview.cpp +++ b/src/shell/panelconfigview.cpp @@ -65,21 +65,21 @@ void PanelConfigView::syncGeometry() return; } - if (m_containment->formFactor() == Plasma::Vertical) { + if (m_containment->formFactor() == Plasma::Types::Vertical) { resize(rootObject()->implicitWidth(), screen()->size().height()); - if (m_containment->location() == Plasma::LeftEdge) { + if (m_containment->location() == Plasma::Types::LeftEdge) { setPosition(screen()->geometry().left() + m_panelView->thickness(), screen()->geometry().top()); - } else if (m_containment->location() == Plasma::RightEdge) { + } else if (m_containment->location() == Plasma::Types::RightEdge) { setPosition(screen()->geometry().right() - width() - m_panelView->thickness(), screen()->geometry().top()); } } else { resize(screen()->size().width(), rootObject()->implicitHeight()); - if (m_containment->location() == Plasma::TopEdge) { + if (m_containment->location() == Plasma::Types::TopEdge) { setPosition(screen()->geometry().left(), screen()->geometry().top() + m_panelView->thickness()); - } else if (m_containment->location() == Plasma::BottomEdge) { + } else if (m_containment->location() == Plasma::Types::BottomEdge) { setPosition(screen()->geometry().left(), screen()->geometry().bottom() - height() - m_panelView->thickness()); } } diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index d2d4b734a..2d0dac636 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -64,7 +64,7 @@ PanelView::~PanelView() config().writeEntry("offset", m_offset); config().writeEntry("max", m_maxLength); config().writeEntry("min", m_minLength); - if (formFactor() == Plasma::Vertical) { + if (formFactor() == Plasma::Types::Vertical) { config().writeEntry("length", size().height()); config().writeEntry("thickness", size().width()); } else { @@ -85,8 +85,8 @@ KConfigGroup PanelView::config() const KConfigGroup views(m_corona->applicationConfig(), "PlasmaViews"); views = KConfigGroup(&views, QString("Panel %1").arg(containment()->id())); - if (containment()->formFactor() == Plasma::Vertical) { - return KConfigGroup(&views, "Vertical" + QString::number(screen()->size().height())); + if (containment()->formFactor() == Plasma::Types::Vertical) { + return KConfigGroup(&views, "Types::Vertical" + QString::number(screen()->size().height())); //treat everything else as horizontal } else { return KConfigGroup(&views, "Horizontal" + QString::number(screen()->size().width())); @@ -150,7 +150,7 @@ void PanelView::setThickness(int value) return; } - if (formFactor() == Plasma::Vertical) { + if (formFactor() == Plasma::Types::Vertical) { setWidth(value); } else { setHeight(value); @@ -162,7 +162,7 @@ void PanelView::setThickness(int value) int PanelView::length() const { - if (formFactor() == Plasma::Vertical) { + if (formFactor() == Plasma::Types::Vertical) { config().readEntry("length", screen()->size().height()); } else { config().readEntry("length", screen()->size().width()); @@ -175,7 +175,7 @@ void PanelView::setLength(int value) return; } - if (formFactor() == Plasma::Vertical) { + if (formFactor() == Plasma::Types::Vertical) { setHeight(value); } else { setWidth(value); @@ -200,7 +200,7 @@ void PanelView::setMaximumLength(int length) setMinimumLength(length); } - if (formFactor() == Plasma::Vertical) { + if (formFactor() == Plasma::Types::Vertical) { setMaximumHeight(length); } else { setMaximumWidth(length); @@ -227,7 +227,7 @@ void PanelView::setMinimumLength(int length) setMaximumLength(length); } - if (formFactor() == Plasma::Vertical) { + if (formFactor() == Plasma::Types::Vertical) { setMinimumHeight(length); } else { setMinimumWidth(length); @@ -249,8 +249,8 @@ void PanelView::positionPanel() const int oldThickness = thickness(); switch (containment()->location()) { - case Plasma::TopEdge: - containment()->setFormFactor(Plasma::Horizontal); + case Plasma::Types::TopEdge: + containment()->setFormFactor(Plasma::Types::Horizontal); restore(); switch (m_alignment) { @@ -266,8 +266,8 @@ void PanelView::positionPanel() } break; - case Plasma::LeftEdge: - containment()->setFormFactor(Plasma::Vertical); + case Plasma::Types::LeftEdge: + containment()->setFormFactor(Plasma::Types::Vertical); restore(); switch (m_alignment) { case Qt::AlignCenter: @@ -282,8 +282,8 @@ void PanelView::positionPanel() } break; - case Plasma::RightEdge: - containment()->setFormFactor(Plasma::Vertical); + case Plasma::Types::RightEdge: + containment()->setFormFactor(Plasma::Types::Vertical); restore(); switch (m_alignment) { case Qt::AlignCenter: @@ -298,9 +298,9 @@ void PanelView::positionPanel() } break; - case Plasma::BottomEdge: + case Plasma::Types::BottomEdge: default: - containment()->setFormFactor(Plasma::Horizontal); + containment()->setFormFactor(Plasma::Types::Horizontal); restore(); switch (m_alignment) { case Qt::AlignCenter: @@ -340,7 +340,7 @@ void PanelView::restore() //FIXME: an invalid size doesn't work with QWindows setMaximumSize(screen()->size()); - if (containment()->formFactor() == Plasma::Vertical) { + if (containment()->formFactor() == Plasma::Types::Vertical) { const int maxSize = screen()->size().height() - m_offset; m_maxLength = qBound(MINSIZE, m_maxLength, maxSize); m_minLength = qBound(MINSIZE, m_minLength, maxSize); @@ -371,7 +371,7 @@ void PanelView::restore() void PanelView::resizeEvent(QResizeEvent *ev) { - if (containment()->formFactor() == Plasma::Vertical) { + if (containment()->formFactor() == Plasma::Types::Vertical) { config().writeEntry("length", ev->size().height()); config().writeEntry("thickness", ev->size().width()); if (ev->size().height() != ev->oldSize().height()) { diff --git a/src/shell/scripting/appinterface.cpp b/src/shell/scripting/appinterface.cpp index a7e00313b..3519f121d 100644 --- a/src/shell/scripting/appinterface.cpp +++ b/src/shell/scripting/appinterface.cpp @@ -144,12 +144,12 @@ int AppInterface::multiheadScreen() const void AppInterface::lockCorona(bool locked) { - m_env->corona()->setImmutability(locked ? Plasma::UserImmutable : Plasma::Mutable); + m_env->corona()->setImmutability(locked ? Plasma::Types::UserImmutable : Plasma::Types::Mutable); } bool AppInterface::coronaLocked() const { - return m_env->corona()->immutability() != Plasma::Mutable; + return m_env->corona()->immutability() != Plasma::Types::Mutable; } void AppInterface::sleep(int ms) diff --git a/src/shell/scripting/applet.cpp b/src/shell/scripting/applet.cpp index 92c01b36d..670478604 100644 --- a/src/shell/scripting/applet.cpp +++ b/src/shell/scripting/applet.cpp @@ -232,7 +232,7 @@ void Applet::setLocked(bool locked) return; } - app->setImmutability(locked ? Plasma::UserImmutable : Plasma::Mutable); + app->setImmutability(locked ? Plasma::Types::UserImmutable : Plasma::Types::Mutable); KConfigGroup cg = app->config(); if (!app->isContainment()) { cg = cg.parent(); @@ -247,10 +247,10 @@ bool Applet::locked() const { Plasma::Applet *app = applet(); if (!app) { - return Plasma::Mutable; + return Plasma::Types::Mutable; } - return app->immutability() != Plasma::Mutable; + return app->immutability() != Plasma::Types::Mutable; } bool Applet::wallpaperConfigDirty() const diff --git a/src/shell/scripting/containment.cpp b/src/shell/scripting/containment.cpp index d20623771..75e4f062a 100644 --- a/src/shell/scripting/containment.cpp +++ b/src/shell/scripting/containment.cpp @@ -117,19 +117,19 @@ QString Containment::formFactor() const } switch (d->containment.data()->formFactor()) { - case Plasma::Planar: + case Plasma::Types::Planar: return "planar"; break; - case Plasma::MediaCenter: + case Plasma::Types::MediaCenter: return "mediacenter"; break; - case Plasma::Horizontal: + case Plasma::Types::Horizontal: return "horizontal"; break; - case Plasma::Vertical: + case Plasma::Types::Vertical: return "vertical"; break; - case Plasma::Application: + case Plasma::Types::Application: return "application"; break; } diff --git a/src/shell/scripting/panel.cpp b/src/shell/scripting/panel.cpp index 59182ce78..fc2936b8d 100644 --- a/src/shell/scripting/panel.cpp +++ b/src/shell/scripting/panel.cpp @@ -52,25 +52,25 @@ QString Panel::location() const } switch (c->location()) { - case Plasma::Floating: + case Plasma::Types::Floating: return "floating"; break; - case Plasma::Desktop: + case Plasma::Types::Desktop: return "desktop"; break; - case Plasma::FullScreen: + case Plasma::Types::FullScreen: return "fullscreen"; break; - case Plasma::TopEdge: + case Plasma::Types::TopEdge: return "top"; break; - case Plasma::BottomEdge: + case Plasma::Types::BottomEdge: return "bottom"; break; - case Plasma::LeftEdge: + case Plasma::Types::LeftEdge: return "left"; break; - case Plasma::RightEdge: + case Plasma::Types::RightEdge: return "right"; break; } @@ -86,24 +86,24 @@ void Panel::setLocation(const QString &locationString) } const QString lower = locationString.toLower(); - Plasma::Location loc = Plasma::Floating; - Plasma::FormFactor ff = Plasma::Planar; + Plasma::Location loc = Plasma::Types::Floating; + Plasma::FormFactor ff = Plasma::Types::Planar; if (lower == "desktop") { - loc = Plasma::Desktop; + loc = Plasma::Types::Desktop; } else if (lower == "fullscreen") { - loc = Plasma::FullScreen; + loc = Plasma::Types::FullScreen; } else if (lower == "top") { - loc = Plasma::TopEdge; - ff = Plasma::Horizontal; + loc = Plasma::Types::TopEdge; + ff = Plasma::Types::Horizontal; } else if (lower == "bottom") { - loc = Plasma::BottomEdge; - ff = Plasma::Horizontal; + loc = Plasma::Types::BottomEdge; + ff = Plasma::Types::Horizontal; } else if (lower == "left") { - loc = Plasma::LeftEdge; - ff = Plasma::Vertical; + loc = Plasma::Types::LeftEdge; + ff = Plasma::Types::Vertical; } else if (lower == "right") { - loc = Plasma::RightEdge; - ff = Plasma::Vertical; + loc = Plasma::Types::RightEdge; + ff = Plasma::Types::Vertical; } c->setLocation(loc); @@ -199,7 +199,7 @@ void Panel::setOffset(int pixels) QRectF screen = v->screen()->geometry(); QSizeF size(graphicObject->width(), graphicObject->height()); - if (c->formFactor() == Plasma::Vertical) { + if (c->formFactor() == Plasma::Types::Vertical) { if (pixels > screen.height()) { return; } @@ -234,7 +234,7 @@ int Panel::length() const return 0; } - if (c->formFactor() == Plasma::Vertical) { + if (c->formFactor() == Plasma::Types::Vertical) { return graphicObject->height(); } else { return graphicObject->width(); @@ -259,7 +259,7 @@ void Panel::setLength(int pixels) QRectF screen = v->screen()->geometry(); QSizeF s(graphicObject->width(), graphicObject->height()); - if (c->formFactor() == Plasma::Vertical) { + if (c->formFactor() == Plasma::Types::Vertical) { if (pixels > screen.height() - v->offset()) { return; } @@ -291,7 +291,7 @@ int Panel::height() const return 0; } - return c->formFactor() == Plasma::Vertical ? graphicObject->width() + return c->formFactor() == Plasma::Types::Vertical ? graphicObject->width() : graphicObject->height(); } @@ -312,10 +312,10 @@ void Panel::setHeight(int height) if (v) { QRect screen = v->screen()->geometry(); QSizeF size(graphicObject->width(), graphicObject->height()); - const int max = (c->formFactor() == Plasma::Vertical ? screen.width() : screen.height()) / 3; + const int max = (c->formFactor() == Plasma::Types::Vertical ? screen.width() : screen.height()) / 3; height = qBound(16, height, max); - if (c->formFactor() == Plasma::Vertical) { + if (c->formFactor() == Plasma::Types::Vertical) { size.setWidth(height); } else { size.setHeight(height); diff --git a/src/shell/scripting/scriptengine.cpp b/src/shell/scripting/scriptengine.cpp index e9bf365b9..e8ffd6015 100644 --- a/src/shell/scripting/scriptengine.cpp +++ b/src/shell/scripting/scriptengine.cpp @@ -141,11 +141,11 @@ QScriptValue ScriptEngine::createContainment(const QString &type, const QString if (c) { if (type == "Panel") { // some defaults - c->setFormFactor(Plasma::Horizontal); - c->setLocation(Plasma::TopEdge); + c->setFormFactor(Plasma::Types::Horizontal); + c->setLocation(Plasma::Types::TopEdge); c->setScreen(env->defaultPanelScreen()); } - c->updateConstraints(Plasma::AllConstraints | Plasma::StartupCompletedConstraint); + c->updateConstraints(Plasma::Types::AllConstraints | Plasma::Types::StartupCompletedConstraint); c->flushPendingConstraintsEvents(); } @@ -598,8 +598,8 @@ bool ScriptEngine::isPanel(const Plasma::Containment *c) return false; } - return c->containmentType() == Plasma::PanelContainment || - c->containmentType() == Plasma::CustomPanelContainment; + return c->containmentType() == Plasma::Types::PanelContainment || + c->containmentType() == Plasma::Types::CustomPanelContainment; } QScriptValue ScriptEngine::activities(QScriptContext *context, QScriptEngine *engine) diff --git a/src/shell/view.cpp b/src/shell/view.cpp index 2e48be3ba..3411078d4 100644 --- a/src/shell/view.cpp +++ b/src/shell/view.cpp @@ -116,8 +116,8 @@ void View::setContainment(Plasma::Containment *cont) //graphicObject->setProperty("visible", false); graphicObject->setProperty("drawWallpaper", - (cont->containmentType() == Plasma::DesktopContainment || - cont->containmentType() == Plasma::CustomContainment)); + (cont->containmentType() == Plasma::Types::DesktopContainment || + cont->containmentType() == Plasma::Types::CustomContainment)); graphicObject->setProperty("parent", QVariant::fromValue(rootObject())); rootObject()->setProperty("containment", QVariant::fromValue(graphicObject)); } else { @@ -140,7 +140,7 @@ void View::setLocation(int location) int View::location() const { if (!m_containment) { - return Plasma::Desktop; + return Plasma::Types::Desktop; } return m_containment.data()->location(); } @@ -148,7 +148,7 @@ int View::location() const Plasma::FormFactor View::formFactor() const { if (!m_containment) { - return Plasma::Planar; + return Plasma::Types::Planar; } return m_containment.data()->formFactor(); } diff --git a/src/shell/widgetexplorer/widgetexplorer.cpp b/src/shell/widgetexplorer/widgetexplorer.cpp index dd40076c1..2dd934bb3 100644 --- a/src/shell/widgetexplorer/widgetexplorer.cpp +++ b/src/shell/widgetexplorer/widgetexplorer.cpp @@ -152,7 +152,7 @@ void WidgetExplorerPrivate::init(Plasma::Location loc) //init widgets location = loc; - orientation = ((location == Plasma::LeftEdge || location == Plasma::RightEdge)?Qt::Vertical:Qt::Horizontal); + orientation = ((location == Plasma::Types::LeftEdge || location == Plasma::Types::RightEdge)?Qt::Vertical:Qt::Horizontal); // mainLayout = new QGraphicsLinearLayout(Qt::Vertical); // mainLayout->setContentsMargins(0, 0, 0, 0); // mainLayout->setSpacing(0); @@ -214,7 +214,7 @@ void WidgetExplorerPrivate::finished() void WidgetExplorerPrivate::setLocation(const Plasma::Location loc) { Qt::Orientation orient; - if (loc == Plasma::LeftEdge || loc == Plasma::RightEdge) { + if (loc == Plasma::Types::LeftEdge || loc == Plasma::Types::RightEdge) { orient = Qt::Vertical; } else { orient = Qt::Horizontal; @@ -375,7 +375,7 @@ WidgetExplorer::WidgetExplorer(QObject *parent) :QObject(parent), d(new WidgetExplorerPrivate(this)) { - d->init(Plasma::LeftEdge); + d->init(Plasma::Types::LeftEdge); } WidgetExplorer::~WidgetExplorer() @@ -472,7 +472,7 @@ void WidgetExplorer::addApplet(const QString &pluginName) void WidgetExplorer::immutabilityChanged(Plasma::ImmutabilityType type) { - if (type != Plasma::Mutable) { + if (type != Plasma::Types::Mutable) { emit closeClicked(); } } @@ -639,7 +639,7 @@ QPoint WidgetExplorer::tooltipPosition(QGraphicsObject *item, int tipWidth, int item->boundingRect().size().toSize()); QPoint pos; switch (d->location) { - case Plasma::LeftEdge: + case Plasma::Types::LeftEdge: pos.setX(itemRect.right()); pos.setY(itemRect.top() + (itemRect.height() - tipHeight) / 2); break; @@ -647,7 +647,7 @@ QPoint WidgetExplorer::tooltipPosition(QGraphicsObject *item, int tipWidth, int pos.setX(itemRect.left() + (itemRect.width() - tipWidth) / 2); pos.setY(itemRect.bottom()); break; - case Plasma::RightEdge: + case Plasma::Types::RightEdge: pos.setX(itemRect.left() - tipWidth); pos.setY(itemRect.top() + (itemRect.height() - tipHeight) / 2); break; From 355a95fe922e8910fc941835ab1eb0b92550f713 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sat, 11 May 2013 12:24:24 +0100 Subject: [PATCH 38/80] Fix debug build Fix a pointer-dereference of a non-pointer variable. --- src/plasma/service.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plasma/service.cpp b/src/plasma/service.cpp index 6d29159be..c1d0d25de 100644 --- a/src/plasma/service.cpp +++ b/src/plasma/service.cpp @@ -236,7 +236,7 @@ ServiceJob *Service::startOperationCall(const QVariantMap &description, QObject } } else { #ifndef NDEBUG - kDebug() << op << "is not a valid group; valid groups are:" << d->operationsMap->keys(); + kDebug() << op << "is not a valid group; valid groups are:" << d->operationsMap.keys(); #endif } From 33d41aea3dba1459de9db143a15dc20afea54f61 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sat, 11 May 2013 12:25:35 +0100 Subject: [PATCH 39/80] Add the "theme" directory to the plasmoid directory structure This adds an extra step to the lookup of SVG images created with the Svg() global function: after looking in images/ in the plasmoid and then in the desktop theme, it looks in theme/$DESKTOP_THEME_NAME and then theme/ in the plasmoid. This allows plasmoid authors to add images that they want to allow theme authors to override. Forward-port of review request 109857. --- src/plasma/autotests/packagestructuretest.cpp | 4 +++- src/plasma/private/packages.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plasma/autotests/packagestructuretest.cpp b/src/plasma/autotests/packagestructuretest.cpp index 5d2226fd7..4a4586bc5 100644 --- a/src/plasma/autotests/packagestructuretest.cpp +++ b/src/plasma/autotests/packagestructuretest.cpp @@ -83,7 +83,7 @@ void PackageStructureTest::multiplePaths() void PackageStructureTest::directories() { QList dirs; - dirs << "config" << "data" << "images" << "scripts" << "translations" << "ui"; + dirs << "config" << "data" << "images" << "theme" << "scripts" << "translations" << "ui"; QList psDirs = ps.directories(); @@ -156,6 +156,7 @@ void PackageStructureTest::requiredFiles() void PackageStructureTest::path() { QCOMPARE(ps.filePath("images"), QDir(m_packagePath + QString("/contents/images")).canonicalPath()); + QCOMPARE(ps.filePath("theme"), QDir(m_packagePath + QString("/contents/theme")).canonicalPath()); QCOMPARE(ps.filePath("mainscript"), QFileInfo(m_packagePath + QString("/contents/ui/main.qml")).canonicalFilePath()); } @@ -175,6 +176,7 @@ void PackageStructureTest::mimeTypes() QStringList mimeTypes; mimeTypes << "image/svg+xml" << "image/png" << "image/jpeg"; QCOMPARE(ps.mimeTypes("images"), mimeTypes); + QCOMPARE(ps.mimeTypes("theme"), mimeTypes); } QTEST_MAIN(PackageStructureTest) diff --git a/src/plasma/private/packages.cpp b/src/plasma/private/packages.cpp index 082a0e73b..2829c0594 100644 --- a/src/plasma/private/packages.cpp +++ b/src/plasma/private/packages.cpp @@ -82,9 +82,11 @@ void GenericPackage::initPackage(Package *package) package->setDefaultPackageRoot("plasma/packages/"); package->addDirectoryDefinition("images", "images", i18n("Images")); + package->addDirectoryDefinition("theme", "theme", i18n("Themed Images")); QStringList mimetypes; mimetypes << "image/svg+xml" << "image/png" << "image/jpeg"; package->setMimeTypes("images", mimetypes); + package->setMimeTypes("theme", mimetypes); package->addDirectoryDefinition("config", "config", i18n("Configuration Definitions")); mimetypes.clear(); From 9b56022d1290e35ce431f30153d9c36aab72f715 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 13 May 2013 11:20:42 +0200 Subject: [PATCH 40/80] close on focus out --- src/shell/panelconfigview.cpp | 5 +++++ src/shell/panelconfigview.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/shell/panelconfigview.cpp b/src/shell/panelconfigview.cpp index f3fd57404..73d8f1ea3 100644 --- a/src/shell/panelconfigview.cpp +++ b/src/shell/panelconfigview.cpp @@ -85,5 +85,10 @@ void PanelConfigView::syncGeometry() } } +void PanelConfigView::focusOutEvent(QFocusEvent *ev) +{ + Q_UNUSED(ev) + close(); +} #include "moc_panelconfigview.cpp" diff --git a/src/shell/panelconfigview.h b/src/shell/panelconfigview.h index ce7b56948..df6b797a7 100644 --- a/src/shell/panelconfigview.h +++ b/src/shell/panelconfigview.h @@ -48,6 +48,9 @@ public: void init(); +protected: + void focusOutEvent(QFocusEvent *ev); + protected Q_SLOTS: void syncGeometry(); From bc5d14ddb1ebf54ebc79cc169fbe6abb9dcd07d7 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 13 May 2013 14:25:57 +0200 Subject: [PATCH 41/80] fix startupcompleted constraints use the new panel toolbox --- src/plasma/corona.cpp | 1 - src/shell/qmlpackages/desktop/contents/defaults | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plasma/corona.cpp b/src/plasma/corona.cpp index 65d54656a..8d8256006 100644 --- a/src/plasma/corona.cpp +++ b/src/plasma/corona.cpp @@ -507,7 +507,6 @@ QList CoronaPrivate::importLayout(const KConfigGroup &con } foreach (Containment *containment, newContainments) { - containment->updateConstraints(Plasma::StartupCompletedConstraint); emit q->containmentAdded(containment); #ifndef NDEBUG // kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Containment" << containment->name(); diff --git a/src/shell/qmlpackages/desktop/contents/defaults b/src/shell/qmlpackages/desktop/contents/defaults index 147d0ec4e..b9a99dab4 100644 --- a/src/shell/qmlpackages/desktop/contents/defaults +++ b/src/shell/qmlpackages/desktop/contents/defaults @@ -7,7 +7,7 @@ MiddleButton=org.kde.paste [Panel] Containment=org.kde.panel -ToolBox=org.kde.toolbox +ToolBox=org.kde.paneltoolbox [Panel][ContainmentActions] Ctrl;LeftButton=org.kde.standardmenu From 042267f7a0851d2d5c0fed92225dfcb7ea306dc1 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 13 May 2013 17:40:58 +0200 Subject: [PATCH 42/80] blur behind in the panel controller --- src/shell/panelconfigview.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shell/panelconfigview.cpp b/src/shell/panelconfigview.cpp index 73d8f1ea3..6d32ca701 100644 --- a/src/shell/panelconfigview.cpp +++ b/src/shell/panelconfigview.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -43,6 +44,8 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa setFlags(Qt::FramelessWindowHint); + KWindowEffects::enableBlurBehind(winId(), true); + engine()->rootContext()->setContextProperty("panel", panelView); engine()->rootContext()->setContextProperty("configDialog", this); connect(containment, &Plasma::Containment::formFactorChanged, From ad2fe77745bd842801bfc1cb4cb52fc7c2e85482 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 18:08:58 +0200 Subject: [PATCH 43/80] get rid of Plasma::Constraint --- src/plasma/applet.cpp | 6 +++--- src/plasma/applet.h | 4 ++-- src/plasma/plasma.h | 4 ++-- src/plasma/private/applet_p.cpp | 2 +- src/plasma/private/applet_p.h | 4 ++-- src/plasma/private/containment_p.cpp | 4 ++-- src/plasma/private/containment_p.h | 2 +- src/plasma/scripting/appletscript.cpp | 2 +- src/plasma/scripting/appletscript.h | 2 +- src/scriptengines/qml/plasmoid/declarativeappletscript.cpp | 2 +- src/scriptengines/qml/plasmoid/declarativeappletscript.h | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp index 659dd7baa..c477497a4 100644 --- a/src/plasma/applet.cpp +++ b/src/plasma/applet.cpp @@ -293,12 +293,12 @@ Package Applet::package() const return d->package ? *d->package : Package(); } -void Applet::updateConstraints(Plasma::Constraints constraints) +void Applet::updateConstraints(Plasma::Types::Constraints constraints) { d->scheduleConstraintsUpdate(constraints); } -void Applet::constraintsEvent(Plasma::Constraints constraints) +void Applet::constraintsEvent(Plasma::Types::Constraints constraints) { //NOTE: do NOT put any code in here that reacts to constraints updates // as it will not get called for any applet that reimplements constraintsEvent @@ -431,7 +431,7 @@ void Applet::flushPendingConstraintsEvents() } //kDebug() << "fushing constraints: " << d->pendingConstraints << "!!!!!!!!!!!!!!!!!!!!!!!!!!!"; - Plasma::Constraints c = d->pendingConstraints; + Plasma::Types::Constraints c = d->pendingConstraints; d->pendingConstraints = Types::NoConstraint; if (c & Plasma::Types::StartupCompletedConstraint) { diff --git a/src/plasma/applet.h b/src/plasma/applet.h index 168da3dce..24d200e62 100644 --- a/src/plasma/applet.h +++ b/src/plasma/applet.h @@ -225,7 +225,7 @@ class PLASMA_EXPORT Applet : public QObject * * @param constraints the type of constraints that were updated */ - void updateConstraints(Plasma::Constraints constraints = Plasma::Types::AllConstraints); + void updateConstraints(Plasma::Types::Constraints constraints = Plasma::Types::AllConstraints); //METADATA @@ -546,7 +546,7 @@ class PLASMA_EXPORT Applet : public QObject * @param constraints the type of constraints that were updated * @property constraint */ - virtual void constraintsEvent(Plasma::Constraints constraints); + virtual void constraintsEvent(Plasma::Types::Constraints constraints); //TODO: timerEvent should go into AppletPrivate /** diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index a0fb4163c..f3613cc8e 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -299,8 +299,8 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //For porting //TODO: remove -typedef Types::Constraint Constraint; -Q_DECLARE_FLAGS(Constraints, Constraint) +//typedef Types::Constraint Constraint; +//Q_DECLARE_FLAGS(Constraints, Constraint) typedef Types::FormFactor FormFactor; typedef Types::ContainmentType ContainmentType; typedef Types::ActionType ActionType; diff --git a/src/plasma/private/applet_p.cpp b/src/plasma/private/applet_p.cpp index b557fb978..f7b982e7c 100644 --- a/src/plasma/private/applet_p.cpp +++ b/src/plasma/private/applet_p.cpp @@ -317,7 +317,7 @@ QString AppletPrivate::globalName() const return appletDescription.service()->library(); } -void AppletPrivate::scheduleConstraintsUpdate(Plasma::Constraints c) +void AppletPrivate::scheduleConstraintsUpdate(Plasma::Types::Constraints c) { // Don't start up a timer if we're just starting up // flushPendingConstraints will be called by Corona diff --git a/src/plasma/private/applet_p.h b/src/plasma/private/applet_p.h index af0a42791..0ffa80a6c 100644 --- a/src/plasma/private/applet_p.h +++ b/src/plasma/private/applet_p.h @@ -62,7 +62,7 @@ public: void setIsContainment(bool isContainment, bool forceUpdate = false); QString globalName() const; - void scheduleConstraintsUpdate(Plasma::Constraints c); + void scheduleConstraintsUpdate(Plasma::Types::Constraints c); void scheduleModificationNotification(); KConfigGroup *mainConfigGroup(); void resetConfigurationObject(); @@ -89,7 +89,7 @@ public: // bookkeeping KConfigGroup *mainConfig; - Plasma::Constraints pendingConstraints; + Plasma::Types::Constraints pendingConstraints; // sripting and package stuff AppletScript *script; diff --git a/src/plasma/private/containment_p.cpp b/src/plasma/private/containment_p.cpp index aeca2c37e..03e950d61 100644 --- a/src/plasma/private/containment_p.cpp +++ b/src/plasma/private/containment_p.cpp @@ -187,7 +187,7 @@ void ContainmentPrivate::triggerShowAddWidgets() emit q->showAddWidgetsInterface(QPointF()); } -void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constraints) +void ContainmentPrivate::containmentConstraintsEvent(Plasma::Types::Constraints constraints) { if (!q->isContainment()) { return; @@ -218,7 +218,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra } // pass on the constraints that are relevant here - Constraints appletConstraints = Types::NoConstraint; + Types::Constraints appletConstraints = Types::NoConstraint; if (constraints & Types::FormFactorConstraint) { appletConstraints |= Types::FormFactorConstraint; } diff --git a/src/plasma/private/containment_p.h b/src/plasma/private/containment_p.h index 889388ce0..7e681160d 100644 --- a/src/plasma/private/containment_p.h +++ b/src/plasma/private/containment_p.h @@ -73,7 +73,7 @@ public: * constraint services common to all containments. Containments should still * implement their own constraintsEvent method */ - void containmentConstraintsEvent(Plasma::Constraints constraints); + void containmentConstraintsEvent(Plasma::Types::Constraints constraints); bool isPanelContainment() const; void setLockToolText(); diff --git a/src/plasma/scripting/appletscript.cpp b/src/plasma/scripting/appletscript.cpp index 4702b05cf..675bd199f 100644 --- a/src/plasma/scripting/appletscript.cpp +++ b/src/plasma/scripting/appletscript.cpp @@ -66,7 +66,7 @@ void AppletScript::paintInterface(QPainter *painter, Q_UNUSED(contentsRect); } -void AppletScript::constraintsEvent(Plasma::Constraints constraints) +void AppletScript::constraintsEvent(Plasma::Types::Constraints constraints) { Q_UNUSED(constraints); } diff --git a/src/plasma/scripting/appletscript.h b/src/plasma/scripting/appletscript.h index 74559ac75..09d36c6ce 100644 --- a/src/plasma/scripting/appletscript.h +++ b/src/plasma/scripting/appletscript.h @@ -94,7 +94,7 @@ public: * * @param constraints the type of constraints that were updated */ - virtual void constraintsEvent(Plasma::Constraints constraints); + virtual void constraintsEvent(Plasma::Types::Constraints constraints); /** * Returns a list of context-related QAction instances. diff --git a/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp b/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp index 0a4335e54..2570833e1 100644 --- a/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp +++ b/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp @@ -129,7 +129,7 @@ QObject *DeclarativeAppletScript::loadui(const QString &filename) } -void DeclarativeAppletScript::constraintsEvent(Plasma::Constraints constraints) +void DeclarativeAppletScript::constraintsEvent(Plasma::Types::Constraints constraints) { if (constraints & Plasma::Types::FormFactorConstraint) { emit formFactorChanged(); diff --git a/src/scriptengines/qml/plasmoid/declarativeappletscript.h b/src/scriptengines/qml/plasmoid/declarativeappletscript.h index 3473ab889..b26a56d48 100644 --- a/src/scriptengines/qml/plasmoid/declarativeappletscript.h +++ b/src/scriptengines/qml/plasmoid/declarativeappletscript.h @@ -43,7 +43,7 @@ public: QList contextualActions(); - void constraintsEvent(Plasma::Constraints constraints); + void constraintsEvent(Plasma::Types::Constraints constraints); bool include(const QString &path); From 9b9fbf6eb9d2b92ef908860169c9755201e7595d Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 18:19:33 +0200 Subject: [PATCH 44/80] get rid of Plasma::FormFactor --- src/plasma/applet.cpp | 2 +- src/plasma/applet.h | 6 +++--- src/plasma/containment.cpp | 8 ++++---- src/plasma/containment.h | 4 ++-- src/plasma/plasma.h | 2 +- src/plasma/private/containment_p.h | 4 ++-- src/shell/scripting/panel.cpp | 4 ++-- src/shell/view.cpp | 10 +++++----- src/shell/view.h | 6 +++--- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp index c477497a4..950515052 100644 --- a/src/plasma/applet.cpp +++ b/src/plasma/applet.cpp @@ -517,7 +517,7 @@ KActionCollection *Applet::actions() const return d->actions; } -FormFactor Applet::formFactor() const +Types::FormFactor Applet::formFactor() const { Containment *c = containment(); QObject *pw = qobject_cast(parent()); diff --git a/src/plasma/applet.h b/src/plasma/applet.h index 24d200e62..51ebd2ea9 100644 --- a/src/plasma/applet.h +++ b/src/plasma/applet.h @@ -138,21 +138,21 @@ class PLASMA_EXPORT Applet : public QObject * @return the status of the applet * @since 4.4 */ - ItemStatus status() const; + Types::ItemStatus status() const; /** * Returns the current form factor the applet is being displayed in. * * @see Plasma::FormFactor */ - FormFactor formFactor() const; + Types::FormFactor formFactor() const; /** * Returns the location of the scene which is displaying applet. * * @see Plasma::Location */ - Location location() const; + Types::Location location() const; //CONFIGURATION /** diff --git a/src/plasma/containment.cpp b/src/plasma/containment.cpp index f7aeea575..39c8814cc 100644 --- a/src/plasma/containment.cpp +++ b/src/plasma/containment.cpp @@ -178,8 +178,8 @@ void Containment::restore(KConfigGroup &group) return; } - setLocation((Plasma::Location)group.readEntry("location", (int)d->location)); - setFormFactor((Plasma::FormFactor)group.readEntry("formfactor", (int)d->formFactor)); + setLocation((Plasma::Types::Location)group.readEntry("location", (int)d->location)); + setFormFactor((Plasma::Types::FormFactor)group.readEntry("formfactor", (int)d->formFactor)); //kDebug() << "setScreen from restore"; d->setScreen(group.readEntry("screen", d->screen)); d->activityId = group.readEntry("activityId", QString()); @@ -310,7 +310,7 @@ Corona *Containment::corona() const return qobject_cast(parent()); } -void Containment::setFormFactor(FormFactor formFactor) +void Containment::setFormFactor(Types::FormFactor formFactor) { if (d->formFactor == formFactor) { return; @@ -327,7 +327,7 @@ void Containment::setFormFactor(FormFactor formFactor) emit formFactorChanged(formFactor); } -void Containment::setLocation(Location location) +void Containment::setLocation(Types::Location location) { if (d->location == location) { return; diff --git a/src/plasma/containment.h b/src/plasma/containment.h index 007e7f6eb..79c4be5e6 100644 --- a/src/plasma/containment.h +++ b/src/plasma/containment.h @@ -260,7 +260,7 @@ Q_SIGNALS: * Emitted when the formFactor has changed * @since 5.0 */ - void formFactorChanged(Plasma::FormFactor formFactor); + void formFactorChanged(Plasma::Types::FormFactor formFactor); public Q_SLOTS: /** @@ -277,7 +277,7 @@ Q_SIGNALS: * the arrangement of Applets as well as the display choices of individual * Applets. */ - void setFormFactor(Plasma::FormFactor formFactor); + void setFormFactor(Plasma::Types::FormFactor formFactor); /** * Sets the type of this containment. diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index f3613cc8e..43d7144f4 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -301,7 +301,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //TODO: remove //typedef Types::Constraint Constraint; //Q_DECLARE_FLAGS(Constraints, Constraint) -typedef Types::FormFactor FormFactor; +//typedef Types::FormFactor FormFactor; typedef Types::ContainmentType ContainmentType; typedef Types::ActionType ActionType; typedef Types::Direction Direction; diff --git a/src/plasma/private/containment_p.h b/src/plasma/private/containment_p.h index 7e681160d..41d39ea7f 100644 --- a/src/plasma/private/containment_p.h +++ b/src/plasma/private/containment_p.h @@ -95,8 +95,8 @@ public: static void addDefaultActions(KActionCollection *actions, Containment *c = 0); Containment *q; - FormFactor formFactor; - Location location; + Types::FormFactor formFactor; + Types::Location location; QList applets; QString wallpaper; QHash localActionPlugins; diff --git a/src/shell/scripting/panel.cpp b/src/shell/scripting/panel.cpp index fc2936b8d..b1135c24f 100644 --- a/src/shell/scripting/panel.cpp +++ b/src/shell/scripting/panel.cpp @@ -86,8 +86,8 @@ void Panel::setLocation(const QString &locationString) } const QString lower = locationString.toLower(); - Plasma::Location loc = Plasma::Types::Floating; - Plasma::FormFactor ff = Plasma::Types::Planar; + Plasma::Types::Location loc = Plasma::Types::Floating; + Plasma::Types::FormFactor ff = Plasma::Types::Planar; if (lower == "desktop") { loc = Plasma::Types::Desktop; } else if (lower == "fullscreen") { diff --git a/src/shell/view.cpp b/src/shell/view.cpp index 3411078d4..710f5fd3f 100644 --- a/src/shell/view.cpp +++ b/src/shell/view.cpp @@ -75,8 +75,8 @@ void View::init() void View::setContainment(Plasma::Containment *cont) { - Plasma::Location oldLoc = (Plasma::Location)location(); - Plasma::FormFactor oldForm = formFactor(); + Plasma::Types::Location oldLoc = (Plasma::Types::Location)location(); + Plasma::Types::FormFactor oldForm = formFactor(); if (m_containment) { disconnect(m_containment.data(), 0, this, 0); @@ -90,7 +90,7 @@ void View::setContainment(Plasma::Containment *cont) m_containment = cont; if (oldLoc != location()) { - emit locationChanged((Plasma::Location)location()); + emit locationChanged((Plasma::Types::Location)location()); } if (oldForm != formFactor()) { emit formFactorChanged(formFactor()); @@ -133,7 +133,7 @@ Plasma::Containment *View::containment() const //FIXME: wrong types void View::setLocation(int location) { - m_containment.data()->setLocation((Plasma::Location)location); + m_containment.data()->setLocation((Plasma::Types::Location)location); } //FIXME: wrong types @@ -145,7 +145,7 @@ int View::location() const return m_containment.data()->location(); } -Plasma::FormFactor View::formFactor() const +Plasma::Types::FormFactor View::formFactor() const { if (!m_containment) { return Plasma::Types::Planar; diff --git a/src/shell/view.h b/src/shell/view.h index ff859ee89..1ae339454 100644 --- a/src/shell/view.h +++ b/src/shell/view.h @@ -51,7 +51,7 @@ public: int location() const; void setLocation(int location); - Plasma::FormFactor formFactor() const; + Plasma::Types::FormFactor formFactor() const; QRectF screenGeometry(); @@ -59,8 +59,8 @@ protected Q_SLOTS: void showConfigurationInterface(Plasma::Applet *applet); Q_SIGNALS: - void locationChanged(Plasma::Location location); - void formFactorChanged(Plasma::FormFactor formFactor); + void locationChanged(Plasma::Types::Location location); + void formFactorChanged(Plasma::Types::FormFactor formFactor); void containmentChanged(); void screenGeometryChanged(); From 812b9a06ab726c3ab76e0b3cbf79a7924b0e8214 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 18:27:27 +0200 Subject: [PATCH 45/80] get rid of Plasma::Location --- src/declarativeimports/core/dialog.cpp | 8 ++++---- src/declarativeimports/core/dialog.h | 2 +- src/plasma/applet.cpp | 2 +- src/plasma/applet.h | 2 +- src/plasma/containment.h | 4 ++-- src/plasma/corona.cpp | 4 ++-- src/plasma/corona.h | 2 +- src/plasma/framesvg.cpp | 4 ++-- src/plasma/framesvg.h | 4 ++-- src/plasma/plasma.h | 2 +- src/plasma/private/framesvg_p.h | 2 +- src/shell/view.h | 2 +- src/shell/widgetexplorer/widgetexplorer.cpp | 14 +++++++------- src/shell/widgetexplorer/widgetexplorer.h | 6 +++--- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/declarativeimports/core/dialog.cpp b/src/declarativeimports/core/dialog.cpp index b9bda174d..eaf3dced4 100644 --- a/src/declarativeimports/core/dialog.cpp +++ b/src/declarativeimports/core/dialog.cpp @@ -38,7 +38,7 @@ #include // just for debugging purposes, FIXME: remove later -QString locString(const Plasma::Location l) { +QString locString(const Plasma::Types::Location l) { QString o = "Unknown: " + l; if (l == Plasma::Types::Floating) { o = "Floating"; @@ -215,7 +215,7 @@ QPoint DialogProxy::popupPosition(QQuickItem *item, Qt::AlignmentFlag alignment) } } - Plasma::Location l = (Plasma::Location)location(); + Plasma::Types::Location l = (Plasma::Types::Location)location(); QPoint topPoint((item->boundingRect().width() - width())/2, -height()); @@ -316,7 +316,7 @@ void DialogProxy::setWindowFlags(const int flags) int DialogProxy::location() const { - return (Plasma::Location)m_location; + return (Plasma::Types::Location)m_location; } void DialogProxy::setLocation(int location) @@ -324,7 +324,7 @@ void DialogProxy::setLocation(int location) if (m_location == location) { return; } - m_location = (Plasma::Location)location; + m_location = (Plasma::Types::Location)location; emit locationChanged(); } diff --git a/src/declarativeimports/core/dialog.h b/src/declarativeimports/core/dialog.h index 5908ab6bb..7392b71c8 100644 --- a/src/declarativeimports/core/dialog.h +++ b/src/declarativeimports/core/dialog.h @@ -161,7 +161,7 @@ protected: void focusOutEvent(QFocusEvent *ev); QTimer *m_syncTimer; - Plasma::Location m_location; + Plasma::Types::Location m_location; Plasma::FrameSvgItem *m_frameSvgItem; QWeakPointer m_mainItem; QWeakPointer m_visualParent; diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp index 950515052..d95cb6cbf 100644 --- a/src/plasma/applet.cpp +++ b/src/plasma/applet.cpp @@ -599,7 +599,7 @@ KShortcut Applet::globalShortcut() const return KShortcut(); } -Location Applet::location() const +Types::Location Applet::location() const { Containment *c = containment(); return c ? c->d->location : Plasma::Types::Desktop; diff --git a/src/plasma/applet.h b/src/plasma/applet.h index 51ebd2ea9..6d6a603a9 100644 --- a/src/plasma/applet.h +++ b/src/plasma/applet.h @@ -150,7 +150,7 @@ class PLASMA_EXPORT Applet : public QObject /** * Returns the location of the scene which is displaying applet. * - * @see Plasma::Location + * @see Plasma::Types::Location */ Types::Location location() const; diff --git a/src/plasma/containment.h b/src/plasma/containment.h index 79c4be5e6..203b7fe7f 100644 --- a/src/plasma/containment.h +++ b/src/plasma/containment.h @@ -254,7 +254,7 @@ Q_SIGNALS: * Emitted when the location has changed * @since 5.0 */ - void locationChanged(Plasma::Location location); + void locationChanged(Plasma::Types::Location location); /** * Emitted when the formFactor has changed @@ -270,7 +270,7 @@ Q_SIGNALS: * * @param location the new location of this Corona */ - void setLocation(Plasma::Location location); + void setLocation(Plasma::Types::Location location); /** * Sets the form factor for this Containment. This may cause changes in both diff --git a/src/plasma/corona.cpp b/src/plasma/corona.cpp index 5013c76a6..38046470f 100644 --- a/src/plasma/corona.cpp +++ b/src/plasma/corona.cpp @@ -257,9 +257,9 @@ void Corona::setImmutability(const ImmutabilityType immutable) } } -QList Corona::freeEdges(int screen) const +QList Corona::freeEdges(int screen) const { - QList freeEdges; + QList freeEdges; freeEdges << Plasma::Types::TopEdge << Plasma::Types::BottomEdge << Plasma::Types::LeftEdge << Plasma::Types::RightEdge; diff --git a/src/plasma/corona.h b/src/plasma/corona.h index b0992f9d5..47daa2c76 100644 --- a/src/plasma/corona.h +++ b/src/plasma/corona.h @@ -127,7 +127,7 @@ public: * @param screen the id of the screen to look for free edges. * @returns a list of free edges not filled with panel type containments. */ - QList freeEdges(int screen) const; + QList freeEdges(int screen) const; /** * The actions assocated with this Corona diff --git a/src/plasma/framesvg.cpp b/src/plasma/framesvg.cpp index 92d3486c0..ae84e6d39 100644 --- a/src/plasma/framesvg.cpp +++ b/src/plasma/framesvg.cpp @@ -180,7 +180,7 @@ FrameSvg::EnabledBorders FrameSvg::enabledBorders() const } } -void FrameSvg::setElementPrefix(Plasma::Location location) +void FrameSvg::setElementPrefix(Plasma::Types::Location location) { switch (location) { case Types::TopEdge: @@ -283,7 +283,7 @@ bool FrameSvg::hasElementPrefix(const QString & prefix) const } } -bool FrameSvg::hasElementPrefix(Plasma::Location location) const +bool FrameSvg::hasElementPrefix(Plasma::Types::Location location) const { switch (location) { case Types::TopEdge: diff --git a/src/plasma/framesvg.h b/src/plasma/framesvg.h index 28a05e4b6..70572ed57 100644 --- a/src/plasma/framesvg.h +++ b/src/plasma/framesvg.h @@ -166,7 +166,7 @@ class PLASMA_EXPORT FrameSvg : public Svg * called successfully after setImagePath is called. * @param location location in the UI this frame will be drawn */ - Q_INVOKABLE void setElementPrefix(Plasma::Location location); + Q_INVOKABLE void setElementPrefix(Plasma::Types::Location location); /** * Sets the prefix for the SVG elements to be used for painting. For example, @@ -201,7 +201,7 @@ class PLASMA_EXPORT FrameSvg : public Svg * to draw a frame. * @param location the given prefix we want to check if drawable */ - Q_INVOKABLE bool hasElementPrefix(Plasma::Location location) const; + Q_INVOKABLE bool hasElementPrefix(Plasma::Types::Location location) const; /** * Returns the prefix for SVG elements of the FrameSvg diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 43d7144f4..ce4e3f7bd 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -305,7 +305,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati typedef Types::ContainmentType ContainmentType; typedef Types::ActionType ActionType; typedef Types::Direction Direction; -typedef Types::Location Location; +//typedef Types::Location Location; typedef Types::Position Position; typedef Types::PopupPlacement PopupPlacement; typedef Types::FlipDirection FlipDirection; diff --git a/src/plasma/private/framesvg_p.h b/src/plasma/private/framesvg_p.h index fdc84422a..07c0907a0 100644 --- a/src/plasma/private/framesvg_p.h +++ b/src/plasma/private/framesvg_p.h @@ -134,7 +134,7 @@ public: void updateAndSignalSizes(); QSizeF frameSize(FrameData *frame) const; - Location location; + Types::Location location; QString prefix; FrameSvg *q; diff --git a/src/shell/view.h b/src/shell/view.h index 1ae339454..e4daf6531 100644 --- a/src/shell/view.h +++ b/src/shell/view.h @@ -47,7 +47,7 @@ public: void setContainment(Plasma::Containment *cont); Plasma::Containment *containment() const; - //FIXME: Plasma::Location should be something qml can understand + //FIXME: Plasma::Types::Location should be something qml can understand int location() const; void setLocation(int location); diff --git a/src/shell/widgetexplorer/widgetexplorer.cpp b/src/shell/widgetexplorer/widgetexplorer.cpp index 2dd934bb3..391399c30 100644 --- a/src/shell/widgetexplorer/widgetexplorer.cpp +++ b/src/shell/widgetexplorer/widgetexplorer.cpp @@ -60,10 +60,10 @@ public: } void initFilters(); - void init(Plasma::Location loc); + void init(Plasma::Types::Location loc); void initRunningApplets(); void containmentDestroyed(); - void setLocation(Plasma::Location loc); + void setLocation(Plasma::Types::Location loc); void finished(); /** @@ -78,7 +78,7 @@ public: //this orientation is just for convenience, is the location that is important Qt::Orientation orientation; - Plasma::Location location; + Plasma::Types::Location location; WidgetExplorer *q; QString application; Plasma::Containment *containment; @@ -146,7 +146,7 @@ void WidgetExplorerPrivate::initFilters() } -void WidgetExplorerPrivate::init(Plasma::Location loc) +void WidgetExplorerPrivate::init(Plasma::Types::Location loc) { // q->setFocusPolicy(Qt::StrongFocus); @@ -211,7 +211,7 @@ void WidgetExplorerPrivate::finished() declarativeWidget->rootObject()->setProperty("extraActions", QVariant::fromValue(actionList));*/ } -void WidgetExplorerPrivate::setLocation(const Plasma::Location loc) +void WidgetExplorerPrivate::setLocation(const Plasma::Types::Location loc) { Qt::Orientation orient; if (loc == Plasma::Types::LeftEdge || loc == Plasma::Types::RightEdge) { @@ -364,7 +364,7 @@ void WidgetExplorerPrivate::appletRemoved(Plasma::Applet *applet) //WidgetExplorer -WidgetExplorer::WidgetExplorer(Plasma::Location loc, QObject *parent) +WidgetExplorer::WidgetExplorer(Plasma::Types::Location loc, QObject *parent) :QObject(parent), d(new WidgetExplorerPrivate(this)) { @@ -383,7 +383,7 @@ WidgetExplorer::~WidgetExplorer() delete d; } -void WidgetExplorer::setLocation(Plasma::Location loc) +void WidgetExplorer::setLocation(Plasma::Types::Location loc) { d->setLocation(loc); emit(locationChanged(loc)); diff --git a/src/shell/widgetexplorer/widgetexplorer.h b/src/shell/widgetexplorer/widgetexplorer.h index 5790e0eeb..7fff349c5 100644 --- a/src/shell/widgetexplorer/widgetexplorer.h +++ b/src/shell/widgetexplorer/widgetexplorer.h @@ -102,7 +102,7 @@ public: RightEdge /**< Along the right side of the screen */ }; - explicit WidgetExplorer(Plasma::Location loc, QObject *parent = 0); + explicit WidgetExplorer(Plasma::Types::Location loc, QObject *parent = 0); explicit WidgetExplorer(QObject *parent = 0); ~WidgetExplorer(); @@ -134,7 +134,7 @@ public: Plasma::Corona *corona() const; - void setLocation(const Plasma::Location loc); + void setLocation(const Plasma::Types::Location loc); //FIXME: it's asymmetric due to the problems of QML of exporting enums WidgetExplorer::Location location(); @@ -152,7 +152,7 @@ public: //Q_INVOKABLE QPoint tooltipPosition(QGraphicsObject *item, int tipWidth, int tipHeight); Q_SIGNALS: - void locationChanged(Plasma::Location loc); + void locationChanged(Plasma::Types::Location loc); void orientationChanged(); void closeClicked(); void widgetsMenuActionsChanged(); From c90e6d23cfbaf90b5dce420f5f35201e485f216d Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 18:34:40 +0200 Subject: [PATCH 46/80] rename Plasma::ContainmentType --- src/plasma/containment.cpp | 4 ++-- src/plasma/containment.h | 4 ++-- src/plasma/plasma.h | 2 +- src/plasma/private/containment_p.h | 2 +- src/plasma/scripting/appletscript.cpp | 4 ++-- src/plasma/scripting/appletscript.h | 4 ++-- src/scriptengines/qml/plasmoid/containmentinterface.cpp | 2 +- src/shell/desktopcorona.cpp | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plasma/containment.cpp b/src/plasma/containment.cpp index 39c8814cc..266cc509b 100644 --- a/src/plasma/containment.cpp +++ b/src/plasma/containment.cpp @@ -291,12 +291,12 @@ void Containment::restoreContents(KConfigGroup &group) } } -Plasma::ContainmentType Containment::containmentType() const +Plasma::Types::ContainmentType Containment::containmentType() const { return d->type; } -void Containment::setContainmentType(Plasma::ContainmentType type) +void Containment::setContainmentType(Plasma::Types::ContainmentType type) { if (d->type == type) { return; diff --git a/src/plasma/containment.h b/src/plasma/containment.h index 203b7fe7f..af309f918 100644 --- a/src/plasma/containment.h +++ b/src/plasma/containment.h @@ -100,7 +100,7 @@ class PLASMA_EXPORT Containment : public Applet /** * Returns the type of containment */ - Plasma::ContainmentType containmentType() const; + Plasma::Types::ContainmentType containmentType() const; /** * Returns the Corona (if any) that this Containment is hosted by @@ -282,7 +282,7 @@ Q_SIGNALS: /** * Sets the type of this containment. */ - void setContainmentType(Plasma::ContainmentType type); + void setContainmentType(Plasma::Types::ContainmentType type); /** * Sets whether wallpaper is painted or not. diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index ce4e3f7bd..04c2f6c3a 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -302,7 +302,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //typedef Types::Constraint Constraint; //Q_DECLARE_FLAGS(Constraints, Constraint) //typedef Types::FormFactor FormFactor; -typedef Types::ContainmentType ContainmentType; +//typedef Types::ContainmentType ContainmentType; typedef Types::ActionType ActionType; typedef Types::Direction Direction; //typedef Types::Location Location; diff --git a/src/plasma/private/containment_p.h b/src/plasma/private/containment_p.h index 41d39ea7f..628b7242a 100644 --- a/src/plasma/private/containment_p.h +++ b/src/plasma/private/containment_p.h @@ -102,7 +102,7 @@ public: QHash localActionPlugins; int screen; QString activityId; - ContainmentType type; + Types::ContainmentType type; bool drawWallpaper : 1; static const char defaultWallpaper[]; diff --git a/src/plasma/scripting/appletscript.cpp b/src/plasma/scripting/appletscript.cpp index 675bd199f..1106891c9 100644 --- a/src/plasma/scripting/appletscript.cpp +++ b/src/plasma/scripting/appletscript.cpp @@ -146,7 +146,7 @@ void AppletScript::setDrawWallpaper(bool drawWallpaper) } } -Plasma::ContainmentType AppletScript::containmentType() const +Plasma::Types::ContainmentType AppletScript::containmentType() const { Q_ASSERT(d->applet); Plasma::Containment *cont = qobject_cast(d->applet); @@ -157,7 +157,7 @@ Plasma::ContainmentType AppletScript::containmentType() const } } -void AppletScript::setContainmentType(Plasma::ContainmentType type) +void AppletScript::setContainmentType(Plasma::Types::ContainmentType type) { Q_ASSERT(d->applet); Plasma::Containment *cont = qobject_cast(d->applet); diff --git a/src/plasma/scripting/appletscript.h b/src/plasma/scripting/appletscript.h index 09d36c6ce..6c22166b7 100644 --- a/src/plasma/scripting/appletscript.h +++ b/src/plasma/scripting/appletscript.h @@ -143,13 +143,13 @@ public: * @see Containment * @since 4.7 */ - Plasma::ContainmentType containmentType() const; + Plasma::Types::ContainmentType containmentType() const; /** * @see Containment * @since 4.7 */ - void setContainmentType(Plasma::ContainmentType type); + void setContainmentType(Plasma::Types::ContainmentType type); Q_SIGNALS: /** diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index 143bf16af..d1f1644fb 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -97,7 +97,7 @@ ContainmentInterface::Type ContainmentInterface::containmentType() const void ContainmentInterface::setContainmentType(ContainmentInterface::Type type) { - m_appletScriptEngine->setContainmentType((Plasma::ContainmentType)type); + m_appletScriptEngine->setContainmentType((Plasma::Types::ContainmentType)type); } int ContainmentInterface::screen() const diff --git a/src/shell/desktopcorona.cpp b/src/shell/desktopcorona.cpp index 30976dee0..452a2b364 100644 --- a/src/shell/desktopcorona.cpp +++ b/src/shell/desktopcorona.cpp @@ -146,7 +146,7 @@ void DesktopCorona::checkScreen(int screen, bool signalWhenExists) continue; } - Plasma::ContainmentType t = c->containmentType(); + Plasma::Types::ContainmentType t = c->containmentType(); if (t == Plasma::Types::PanelContainment || t == Plasma::Types::CustomPanelContainment) { emit containmentAdded(c); From 52b42a247ec5f4be2fcf17a9a1b2617aa7c0d2f4 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 18:39:07 +0200 Subject: [PATCH 47/80] rename Plasma::ActionType --- src/plasma/plasma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 04c2f6c3a..a718281d3 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -303,7 +303,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //Q_DECLARE_FLAGS(Constraints, Constraint) //typedef Types::FormFactor FormFactor; //typedef Types::ContainmentType ContainmentType; -typedef Types::ActionType ActionType; +//typedef Types::ActionType ActionType; typedef Types::Direction Direction; //typedef Types::Location Location; typedef Types::Position Position; From 6b4d1f31d147a14081fe59d4ab77087635b6d662 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 18:44:12 +0200 Subject: [PATCH 48/80] rename Plasma::Direction --- src/plasma/plasma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index a718281d3..2c4e6c0e0 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -304,7 +304,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //typedef Types::FormFactor FormFactor; //typedef Types::ContainmentType ContainmentType; //typedef Types::ActionType ActionType; -typedef Types::Direction Direction; +//typedef Types::Direction Direction; //typedef Types::Location Location; typedef Types::Position Position; typedef Types::PopupPlacement PopupPlacement; From 7b3c29ee071c1f12fe104e3c37c0944dd8185d76 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 19:08:43 +0200 Subject: [PATCH 49/80] rename Plasma::Position --- src/plasma/plasma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 2c4e6c0e0..bb04e1c50 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -306,7 +306,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //typedef Types::ActionType ActionType; //typedef Types::Direction Direction; //typedef Types::Location Location; -typedef Types::Position Position; +//typedef Types::Position Position; typedef Types::PopupPlacement PopupPlacement; typedef Types::FlipDirection FlipDirection; typedef Types::IntervalAlignment IntervalAlignment; From aad4945cf8e12e415365a73c440615952ccfd7a3 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 19:16:37 +0200 Subject: [PATCH 50/80] rename PopupPlacement --- src/plasma/plasma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index bb04e1c50..b9c2a835a 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -307,7 +307,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //typedef Types::Direction Direction; //typedef Types::Location Location; //typedef Types::Position Position; -typedef Types::PopupPlacement PopupPlacement; +//typedef Types::PopupPlacement PopupPlacement; typedef Types::FlipDirection FlipDirection; typedef Types::IntervalAlignment IntervalAlignment; typedef Types::ImmutabilityType ImmutabilityType; From 7761a995f243ecd96b9bbc0467dba6a300f37370 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 20:27:32 +0200 Subject: [PATCH 51/80] rename ImmutabilityType --- src/kpart/plasmakpartview.h | 2 +- src/plasma/applet.cpp | 8 ++++---- src/plasma/applet.h | 6 +++--- src/plasma/containment.cpp | 2 +- src/plasma/corona.cpp | 6 +++--- src/plasma/corona.h | 6 +++--- src/plasma/datacontainer.cpp | 2 +- src/plasma/datacontainer.h | 2 +- src/plasma/dataengine.cpp | 6 +++--- src/plasma/plasma.h | 6 +++--- src/plasma/private/applet_p.h | 2 +- src/plasma/private/corona_p.h | 2 +- src/plasma/private/datacontainer_p.cpp | 4 ++-- src/plasma/private/datacontainer_p.h | 6 +++--- src/plasma/private/dataengine_p.h | 2 +- src/scriptengines/javascript/declarative/toolboxproxy.cpp | 6 +++--- src/scriptengines/javascript/declarative/toolboxproxy.h | 2 +- .../javascript/simplebindings/dataenginereceiver.cpp | 8 ++++---- src/scriptengines/qml/plasmoid/appletinterface.cpp | 2 +- src/shell/widgetexplorer/widgetexplorer.cpp | 4 ++-- src/shell/widgetexplorer/widgetexplorer.h | 2 +- 21 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/kpart/plasmakpartview.h b/src/kpart/plasmakpartview.h index b677a1400..04d5dfc26 100644 --- a/src/kpart/plasmakpartview.h +++ b/src/kpart/plasmakpartview.h @@ -34,7 +34,7 @@ class PlasmaKPartView : public Plasma::View { Q_OBJECT public: - typedef Plasma::ImmutabilityType ImmutabilityType; + typedef Plasma::Types::ImmutabilityType ImmutabilityType; PlasmaKPartView(Plasma::Containment *containment, int uid, QWidget *parent = 0); ~PlasmaKPartView(); diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp index d95cb6cbf..cd9e3b2a2 100644 --- a/src/plasma/applet.cpp +++ b/src/plasma/applet.cpp @@ -167,7 +167,7 @@ void Applet::save(KConfigGroup &g) const void Applet::restore(KConfigGroup &group) { - setImmutability((ImmutabilityType)group.readEntry("immutability", (int)Types::Mutable)); + setImmutability((Types::ImmutabilityType)group.readEntry("immutability", (int)Types::Mutable)); KConfigGroup shortcutConfig(&group, "Shortcuts"); QString shortcutText = shortcutConfig.readEntryUntranslated("global", QString()); @@ -344,7 +344,7 @@ KPluginInfo Applet::pluginInfo() const return d->appletDescription; } -ImmutabilityType Applet::immutability() const +Types::Types::ImmutabilityType Applet::immutability() const { // if this object is itself system immutable, then just return that; it's the most // restrictive setting possible and will override anything that might be happening above it @@ -354,7 +354,7 @@ ImmutabilityType Applet::immutability() const } //Returning the more strict immutability between the applet immutability, Containment and Corona - ImmutabilityType upperImmutability = Types::Mutable; + Types::ImmutabilityType upperImmutability = Types::Mutable; Containment *cont = d->isContainment ? 0 : containment(); if (cont) { @@ -370,7 +370,7 @@ ImmutabilityType Applet::immutability() const } } -void Applet::setImmutability(const ImmutabilityType immutable) +void Applet::setImmutability(const Types::Types::ImmutabilityType immutable) { if (d->immutability == immutable || immutable == Types::SystemImmutable) { // we do not store system immutability in d->immutability since that gets saved diff --git a/src/plasma/applet.h b/src/plasma/applet.h index 6d6a603a9..e9fd4a1ff 100644 --- a/src/plasma/applet.h +++ b/src/plasma/applet.h @@ -101,7 +101,7 @@ class PLASMA_EXPORT Applet : public QObject /** * @return The type of immutability of this applet */ - ImmutabilityType immutability() const; + Types::ImmutabilityType immutability() const; /** * If for some reason, the applet fails to get up on its feet (the @@ -357,7 +357,7 @@ class PLASMA_EXPORT Applet : public QObject * Emitted when the immutability changes * @since 4.4 */ - void immutabilityChanged(Plasma::ImmutabilityType immutable); + void immutabilityChanged(Plasma::Types::ImmutabilityType immutable); /** * Emitted when the applet status changes @@ -407,7 +407,7 @@ class PLASMA_EXPORT Applet : public QObject * user immutable or system immutable) * @param immutable the new immutability type of this applet */ - void setImmutability(const ImmutabilityType immutable); + void setImmutability(const Types::ImmutabilityType immutable); /** * Destroys the applet; it will be removed nicely and deleted. diff --git a/src/plasma/containment.cpp b/src/plasma/containment.cpp index 266cc509b..a50b8757f 100644 --- a/src/plasma/containment.cpp +++ b/src/plasma/containment.cpp @@ -186,7 +186,7 @@ void Containment::restore(KConfigGroup &group) flushPendingConstraintsEvents(); restoreContents(group); - setImmutability((ImmutabilityType)group.readEntry("immutability", (int)Types::Mutable)); + setImmutability((Types::ImmutabilityType)group.readEntry("immutability", (int)Types::Mutable)); setWallpaper(group.readEntry("wallpaperplugin", ContainmentPrivate::defaultWallpaper)); diff --git a/src/plasma/corona.cpp b/src/plasma/corona.cpp index 38046470f..adcdeb197 100644 --- a/src/plasma/corona.cpp +++ b/src/plasma/corona.cpp @@ -92,7 +92,7 @@ void Corona::exportLayout(KConfigGroup &config, QList containments } //temporarily unlock so that removal works - ImmutabilityType oldImm = immutability(); + Types::ImmutabilityType oldImm = immutability(); d->immutability = Types::Mutable; KConfigGroup dest(&config, "Containments"); @@ -213,12 +213,12 @@ void Corona::loadDefaultLayout() //Default implementation does nothing } -ImmutabilityType Corona::immutability() const +Types::ImmutabilityType Corona::immutability() const { return d->immutability; } -void Corona::setImmutability(const ImmutabilityType immutable) +void Corona::setImmutability(const Types::ImmutabilityType immutable) { if (d->immutability == immutable || d->immutability == Types::SystemImmutable) { return; diff --git a/src/plasma/corona.h b/src/plasma/corona.h index 47daa2c76..a1235e274 100644 --- a/src/plasma/corona.h +++ b/src/plasma/corona.h @@ -173,14 +173,14 @@ public Q_SLOTS: /** * @return The type of immutability of this Corona */ - ImmutabilityType immutability() const; + Types::ImmutabilityType immutability() const; /** * Sets the immutability type for this Corona (not immutable, * user immutable or system immutable) * @param immutable the new immutability type of this applet */ - void setImmutability(const ImmutabilityType immutable); + void setImmutability(const Types::ImmutabilityType immutable); /** * Schedules a flush-to-disk synchronization of the configuration state @@ -230,7 +230,7 @@ Q_SIGNALS: * it's NOT for containments or applets or any of the other stuff on the scene. * if your code's not in shells/ it probably shouldn't be using it. */ - void immutabilityChanged(Plasma::ImmutabilityType immutability); + void immutabilityChanged(Plasma::Types::ImmutabilityType immutability); protected: /** diff --git a/src/plasma/datacontainer.cpp b/src/plasma/datacontainer.cpp index 2b62be0a4..f56acd437 100644 --- a/src/plasma/datacontainer.cpp +++ b/src/plasma/datacontainer.cpp @@ -83,7 +83,7 @@ bool DataContainer::visualizationIsConnected(QObject *visualization) const } void DataContainer::connectVisualization(QObject *visualization, uint pollingInterval, - Plasma::IntervalAlignment alignment) + Plasma::Types::IntervalAlignment alignment) { //kDebug() << "connecting visualization" << visualization << "at interval of" // << pollingInterval << "to" << objectName(); diff --git a/src/plasma/datacontainer.h b/src/plasma/datacontainer.h index ef379f43a..f7a165980 100644 --- a/src/plasma/datacontainer.h +++ b/src/plasma/datacontainer.h @@ -122,7 +122,7 @@ class PLASMA_EXPORT DataContainer : public QObject * @param alignment the clock position to align updates to **/ void connectVisualization(QObject *visualization, uint pollingInterval, - Plasma::IntervalAlignment alignment); + Plasma::Types::IntervalAlignment alignment); /** * sets this data container to be automatically stored. diff --git a/src/plasma/dataengine.cpp b/src/plasma/dataengine.cpp index 8f2a4cdfd..a2c68cb53 100644 --- a/src/plasma/dataengine.cpp +++ b/src/plasma/dataengine.cpp @@ -96,7 +96,7 @@ KPluginInfo DataEngine::pluginInfo() const void DataEngine::connectSource(const QString &source, QObject *visualization, uint pollingInterval, - Plasma::IntervalAlignment intervalAlignment) const + Plasma::Types::IntervalAlignment intervalAlignment) const { //kDebug() << "connectSource" << source; bool newSource; @@ -117,7 +117,7 @@ void DataEngine::connectSource(const QString &source, QObject *visualization, } void DataEngine::connectAllSources(QObject *visualization, uint pollingInterval, - Plasma::IntervalAlignment intervalAlignment) const + Plasma::Types::IntervalAlignment intervalAlignment) const { foreach (DataContainer *s, d->sources) { d->connectSource(s, visualization, pollingInterval, intervalAlignment); @@ -486,7 +486,7 @@ DataContainer *DataEnginePrivate::source(const QString &sourceName, bool createW void DataEnginePrivate::connectSource(DataContainer *s, QObject *visualization, uint pollingInterval, - Plasma::IntervalAlignment align, + Plasma::Types::IntervalAlignment align, bool immediateCall) { //kDebug() << "connect source called" << s->objectName() << "with interval" << pollingInterval; diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index b9c2a835a..37248522c 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -308,9 +308,9 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //typedef Types::Location Location; //typedef Types::Position Position; //typedef Types::PopupPlacement PopupPlacement; -typedef Types::FlipDirection FlipDirection; -typedef Types::IntervalAlignment IntervalAlignment; -typedef Types::ImmutabilityType ImmutabilityType; +//typedef Types::FlipDirection FlipDirection; +//typedef Types::IntervalAlignment IntervalAlignment; +//typedef Types::ImmutabilityType ImmutabilityType; typedef Types::ComponentType ComponentType; typedef Types::MarginEdge MarginEdge; typedef Types::MessageButton MessageButton; diff --git a/src/plasma/private/applet_p.h b/src/plasma/private/applet_p.h index 0ffa80a6c..40ede0417 100644 --- a/src/plasma/private/applet_p.h +++ b/src/plasma/private/applet_p.h @@ -80,7 +80,7 @@ public: Applet *q; // applet attributes - ImmutabilityType immutability; + Types::ImmutabilityType immutability; QString launchErrorMessage; // applet info we keep around in case its needed diff --git a/src/plasma/private/corona_p.h b/src/plasma/private/corona_p.h index f511cf35f..de21808ea 100644 --- a/src/plasma/private/corona_p.h +++ b/src/plasma/private/corona_p.h @@ -51,7 +51,7 @@ public: Corona *q; Package package; KConfigGroup desktopDefaultsConfig; - ImmutabilityType immutability; + Types::ImmutabilityType immutability; QString configName; KSharedConfigPtr config; QTimer *configSyncTimer; diff --git a/src/plasma/private/datacontainer_p.cpp b/src/plasma/private/datacontainer_p.cpp index 133f27d9a..592c56d87 100644 --- a/src/plasma/private/datacontainer_p.cpp +++ b/src/plasma/private/datacontainer_p.cpp @@ -25,7 +25,7 @@ namespace Plasma SignalRelay *DataContainerPrivate::signalRelay(const DataContainer *dc, QObject *visualization, uint pollingInterval, - Plasma::IntervalAlignment align, + Plasma::Types::IntervalAlignment align, bool immediateUpdate) { QMap::const_iterator relayIt = relays.constFind(pollingInterval); @@ -56,7 +56,7 @@ bool DataContainerPrivate::hasUpdates() } SignalRelay::SignalRelay(DataContainer *parent, DataContainerPrivate *data, uint ival, - Plasma::IntervalAlignment align, bool immediateUpdate) + Plasma::Types::IntervalAlignment align, bool immediateUpdate) : QObject(parent), dc(parent), d(data), diff --git a/src/plasma/private/datacontainer_p.h b/src/plasma/private/datacontainer_p.h index 2ba8eca45..4d341663f 100644 --- a/src/plasma/private/datacontainer_p.h +++ b/src/plasma/private/datacontainer_p.h @@ -59,7 +59,7 @@ public: void checkUsage(); SignalRelay *signalRelay(const DataContainer *dc, QObject *visualization, - uint pollingInterval, Plasma::IntervalAlignment align, + uint pollingInterval, Plasma::Types::IntervalAlignment align, bool immediateUpdate); bool hasUpdates(); @@ -100,7 +100,7 @@ class SignalRelay : public QObject public: SignalRelay(DataContainer *parent, DataContainerPrivate *data, - uint ival, Plasma::IntervalAlignment align, bool immediateUpdate); + uint ival, Plasma::Types::IntervalAlignment align, bool immediateUpdate); int receiverCount() const; bool isUnused() const; @@ -112,7 +112,7 @@ public: DataContainer *dc; DataContainerPrivate *d; uint m_interval; - Plasma::IntervalAlignment m_align; + Plasma::Types::IntervalAlignment m_align; int m_timerId; bool m_resetTimer; bool m_queued; diff --git a/src/plasma/private/dataengine_p.h b/src/plasma/private/dataengine_p.h index b39d1479a..d8ade83af 100644 --- a/src/plasma/private/dataengine_p.h +++ b/src/plasma/private/dataengine_p.h @@ -38,7 +38,7 @@ class DataEnginePrivate ~DataEnginePrivate(); DataContainer *source(const QString &sourceName, bool createWhenMissing = true); void connectSource(DataContainer *s, QObject *visualization, uint pollingInterval, - Plasma::IntervalAlignment align, bool immediateCall = true); + Plasma::Types::IntervalAlignment align, bool immediateCall = true); DataContainer *requestSource(const QString &sourceName, bool *newSource = 0); void internalUpdateSource(DataContainer*); void setupScriptSupport(); diff --git a/src/scriptengines/javascript/declarative/toolboxproxy.cpp b/src/scriptengines/javascript/declarative/toolboxproxy.cpp index 2e9ab556e..93bf5aded 100644 --- a/src/scriptengines/javascript/declarative/toolboxproxy.cpp +++ b/src/scriptengines/javascript/declarative/toolboxproxy.cpp @@ -70,8 +70,8 @@ void ToolBoxProxy::init() d->configureAction = 0; if (d->containment) { - connect(d->containment, SIGNAL(immutabilityChanged(Plasma::ImmutabilityType)), - this, SLOT(immutabilityChanged(Plasma::ImmutabilityType))); + connect(d->containment, SIGNAL(immutabilityChanged(Plasma::Types::ImmutabilityType)), + this, SLOT(immutabilityChanged(Plasma::Types::ImmutabilityType))); connect(this, SIGNAL(configureRequested(Plasma::Containment*)), d->containment, SIGNAL(configureRequested(Plasma::Containment*))); connect(this, SIGNAL(showAddWidgetsInterface(const QPointF&)), @@ -171,7 +171,7 @@ void ToolBoxProxy::setShowing(const bool show) d->showing = show; } -void ToolBoxProxy::immutabilityChanged(Plasma::ImmutabilityType immutability) +void ToolBoxProxy::immutabilityChanged(Plasma::Types::ImmutabilityType immutability) { Q_UNUSED(immutability); loadActions(); diff --git a/src/scriptengines/javascript/declarative/toolboxproxy.h b/src/scriptengines/javascript/declarative/toolboxproxy.h index 4e4573669..e69cdbe44 100644 --- a/src/scriptengines/javascript/declarative/toolboxproxy.h +++ b/src/scriptengines/javascript/declarative/toolboxproxy.h @@ -60,7 +60,7 @@ Q_SIGNALS: private Q_SLOTS: void actionDestroyed(QObject *object); - void immutabilityChanged(Plasma::ImmutabilityType immutability); + void immutabilityChanged(Plasma::Types::ImmutabilityType immutability); private: void init(); diff --git a/src/scriptengines/javascript/simplebindings/dataenginereceiver.cpp b/src/scriptengines/javascript/simplebindings/dataenginereceiver.cpp index 9d01f9e7a..360142463 100644 --- a/src/scriptengines/javascript/simplebindings/dataenginereceiver.cpp +++ b/src/scriptengines/javascript/simplebindings/dataenginereceiver.cpp @@ -128,12 +128,12 @@ QScriptValue DataEngineReceiver::connectAllSources(QScriptContext *context, QScr } int pollingInterval = 0; - Plasma::IntervalAlignment intervalAlignment = Plasma::NoAlignment; + Plasma::Types::IntervalAlignment intervalAlignment = Plasma::NoAlignment; if (context->argumentCount() > 1) { pollingInterval = context->argument(2).toInt32(); if (context->argumentCount() > 2) { - intervalAlignment = static_cast(context->argument(4).toInt32()); + intervalAlignment = static_cast(context->argument(4).toInt32()); } } @@ -168,12 +168,12 @@ QScriptValue DataEngineReceiver::connectSource(QScriptContext *context, QScriptE } int pollingInterval = 0; - Plasma::IntervalAlignment intervalAlignment = Plasma::NoAlignment; + Plasma::Types::IntervalAlignment intervalAlignment = Plasma::NoAlignment; if (context->argumentCount() > 2) { pollingInterval = context->argument(2).toInt32(); if (context->argumentCount() > 3) { - intervalAlignment = static_cast(context->argument(4).toInt32()); + intervalAlignment = static_cast(context->argument(4).toInt32()); } } diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index 35f3997b7..3ff994a35 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -65,7 +65,7 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, QQuickItem *pa connect(this, SIGNAL(releaseVisualFocus()), applet(), SIGNAL(releaseVisualFocus())); connect(this, SIGNAL(configNeedsSaving()), applet(), SIGNAL(configNeedsSaving())); - connect(applet(), SIGNAL(immutabilityChanged(Plasma::ImmutabilityType)), this, SIGNAL(immutableChanged())); + connect(applet(), SIGNAL(immutabilityChanged(Plasma::Types::ImmutabilityType)), this, SIGNAL(immutableChanged())); connect(applet(), SIGNAL(statusChanged(Plasma::ItemStatus)), this, SIGNAL(statusChanged())); connect(m_appletScriptEngine, SIGNAL(formFactorChanged()), this, SIGNAL(formFactorChanged())); diff --git a/src/shell/widgetexplorer/widgetexplorer.cpp b/src/shell/widgetexplorer/widgetexplorer.cpp index 391399c30..93ca8b74d 100644 --- a/src/shell/widgetexplorer/widgetexplorer.cpp +++ b/src/shell/widgetexplorer/widgetexplorer.cpp @@ -425,7 +425,7 @@ void WidgetExplorer::setContainment(Plasma::Containment *containment) if (d->containment) { connect(d->containment, SIGNAL(destroyed(QObject*)), this, SLOT(containmentDestroyed())); - connect(d->containment, SIGNAL(immutabilityChanged(Plasma::ImmutabilityType)), this, SLOT(immutabilityChanged(Plasma::ImmutabilityType))); + connect(d->containment, SIGNAL(immutabilityChanged(Plasma::Types::ImmutabilityType)), this, SLOT(immutabilityChanged(Plasma::Types::ImmutabilityType))); setLocation(containment->location()); } @@ -470,7 +470,7 @@ void WidgetExplorer::addApplet(const QString &pluginName) } } -void WidgetExplorer::immutabilityChanged(Plasma::ImmutabilityType type) +void WidgetExplorer::immutabilityChanged(Plasma::Types::ImmutabilityType type) { if (type != Plasma::Types::Mutable) { emit closeClicked(); diff --git a/src/shell/widgetexplorer/widgetexplorer.h b/src/shell/widgetexplorer/widgetexplorer.h index 7fff349c5..04b6bf244 100644 --- a/src/shell/widgetexplorer/widgetexplorer.h +++ b/src/shell/widgetexplorer/widgetexplorer.h @@ -167,7 +167,7 @@ public Q_SLOTS: void downloadWidgets(const QString &type); protected Q_SLOTS: - void immutabilityChanged(Plasma::ImmutabilityType); + void immutabilityChanged(Plasma::Types::ImmutabilityType); protected: void keyPressEvent(QKeyEvent *e); From 8f2e5b237565d3249830954ca29394c13521c3ee Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 20:33:34 +0200 Subject: [PATCH 52/80] renamed ComponentType --- src/plasma/plasma.h | 4 ++-- src/plasma/scripting/scriptengine.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 37248522c..359922e9c 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -311,7 +311,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //typedef Types::FlipDirection FlipDirection; //typedef Types::IntervalAlignment IntervalAlignment; //typedef Types::ImmutabilityType ImmutabilityType; -typedef Types::ComponentType ComponentType; +//typedef Types::ComponentType ComponentType; typedef Types::MarginEdge MarginEdge; typedef Types::MessageButton MessageButton; typedef Types::ItemStatus ItemStatus; @@ -324,7 +324,7 @@ typedef Types::BackgroundHints BackgroundHints; Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::Constraints) /*Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip) -Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::ComponentTypes) +Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::ComponentTypes) Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::MessageButtons)*/ #endif // multiple inclusion guard diff --git a/src/plasma/scripting/scriptengine.cpp b/src/plasma/scripting/scriptengine.cpp index f0f6b3c7a..ad4391645 100644 --- a/src/plasma/scripting/scriptengine.cpp +++ b/src/plasma/scripting/scriptengine.cpp @@ -108,7 +108,7 @@ QStringList knownLanguages(Types::ComponentTypes types) return languages; } -KService::List engineOffers(const QString &language, ComponentType type) +KService::List engineOffers(const QString &language, Types::ComponentType type) { if (language.isEmpty()) { return KService::List(); @@ -152,7 +152,7 @@ KService::List engineOffers(const QString &language, ComponentType type) return offers; } -ScriptEngine *loadEngine(const QString &language, ComponentType type, QObject *parent) +ScriptEngine *loadEngine(const QString &language, Types::ComponentType type, QObject *parent) { KService::List offers = engineOffers(language, type); From 6e113e6176669876faa3cf7bd7402112299ce8f2 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 20:37:16 +0200 Subject: [PATCH 53/80] rename MarginEdge --- src/plasma/framesvg.cpp | 2 +- src/plasma/framesvg.h | 2 +- src/plasma/plasma.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plasma/framesvg.cpp b/src/plasma/framesvg.cpp index ae84e6d39..b96b24459 100644 --- a/src/plasma/framesvg.cpp +++ b/src/plasma/framesvg.cpp @@ -386,7 +386,7 @@ QSizeF FrameSvg::frameSize() const } } -qreal FrameSvg::marginSize(const Plasma::MarginEdge edge) const +qreal FrameSvg::marginSize(const Plasma::Types::MarginEdge edge) const { if (d->frames[d->prefix]->noBorderPadding) { return .0; diff --git a/src/plasma/framesvg.h b/src/plasma/framesvg.h index 70572ed57..482956de1 100644 --- a/src/plasma/framesvg.h +++ b/src/plasma/framesvg.h @@ -140,7 +140,7 @@ class PLASMA_EXPORT FrameSvg : public Svg * @param edge the margin edge we want, top, bottom, left or right * @return the margin size */ - Q_INVOKABLE qreal marginSize(const Plasma::MarginEdge edge) const; + Q_INVOKABLE qreal marginSize(const Plasma::Types::MarginEdge edge) const; /** * Convenience method that extracts the size of the four margins diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 359922e9c..96c9ec018 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -312,7 +312,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //typedef Types::IntervalAlignment IntervalAlignment; //typedef Types::ImmutabilityType ImmutabilityType; //typedef Types::ComponentType ComponentType; -typedef Types::MarginEdge MarginEdge; +//typedef Types::MarginEdge MarginEdge; typedef Types::MessageButton MessageButton; typedef Types::ItemStatus ItemStatus; typedef Types::TrustLevel TrustLevel; From 13045faffa4540e636f7f5f5c4b4c3fbf4b64197 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 20:49:50 +0200 Subject: [PATCH 54/80] rename ItemStatus --- src/plasma/applet.cpp | 4 ++-- src/plasma/applet.h | 4 ++-- src/plasma/containment.cpp | 2 +- src/plasma/containment.h | 2 +- src/plasma/plasma.h | 12 +----------- src/plasma/private/applet_p.h | 2 +- src/plasma/private/containment_p.cpp | 2 +- src/plasma/private/containment_p.h | 2 +- .../javascript/declarative/appletcontainer.cpp | 4 ++-- src/scriptengines/qml/plasmoid/appletinterface.cpp | 2 +- 10 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp index cd9e3b2a2..f880ad4bf 100644 --- a/src/plasma/applet.cpp +++ b/src/plasma/applet.cpp @@ -409,12 +409,12 @@ void Applet::setConfigurationRequired(bool needsConfig, const QString &reason) d->showConfigurationRequiredMessage(needsConfig, reason); } -ItemStatus Applet::status() const +Types::ItemStatus Applet::status() const { return d->itemStatus; } -void Applet::setStatus(const ItemStatus status) +void Applet::setStatus(const Types::ItemStatus status) { d->itemStatus = status; emit statusChanged(status); diff --git a/src/plasma/applet.h b/src/plasma/applet.h index e9fd4a1ff..6f10e09c5 100644 --- a/src/plasma/applet.h +++ b/src/plasma/applet.h @@ -363,7 +363,7 @@ class PLASMA_EXPORT Applet : public QObject * Emitted when the applet status changes * @since 4.4 */ - void statusChanged(Plasma::ItemStatus status); + void statusChanged(Plasma::Types::ItemStatus status); //CONFIGURATION /** @@ -420,7 +420,7 @@ class PLASMA_EXPORT Applet : public QObject * sets the status for this applet * @since 4.4 */ - void setStatus(const ItemStatus stat); + void setStatus(const Types::ItemStatus stat); //CONFIGURATION /** diff --git a/src/plasma/containment.cpp b/src/plasma/containment.cpp index a50b8757f..8f0e90d38 100644 --- a/src/plasma/containment.cpp +++ b/src/plasma/containment.cpp @@ -397,7 +397,7 @@ void Containment::addApplet(Applet *applet) connect(applet, SIGNAL(configNeedsSaving()), this, SIGNAL(configNeedsSaving())); connect(applet, SIGNAL(releaseVisualFocus()), this, SIGNAL(releaseVisualFocus())); connect(applet, SIGNAL(appletDeleted(Plasma::Applet*)), this, SLOT(appletDeleted(Plasma::Applet*))); - connect(applet, SIGNAL(statusChanged(Plasma::ItemStatus)), this, SLOT(checkStatus(Plasma::ItemStatus))); + connect(applet, SIGNAL(statusChanged(Plasma::Types::ItemStatus)), this, SLOT(checkStatus(Plasma::Types::ItemStatus))); connect(applet, SIGNAL(activate()), this, SIGNAL(activate())); if (!currentContainment) { diff --git a/src/plasma/containment.h b/src/plasma/containment.h index af309f918..d2cc7a0bc 100644 --- a/src/plasma/containment.h +++ b/src/plasma/containment.h @@ -319,7 +319,7 @@ Q_SIGNALS: Q_PRIVATE_SLOT(d, void appletDeleted(Plasma::Applet*)) Q_PRIVATE_SLOT(d, void triggerShowAddWidgets()) - Q_PRIVATE_SLOT(d, void checkStatus(Plasma::ItemStatus)) + Q_PRIVATE_SLOT(d, void checkStatus(Plasma::Types::ItemStatus)) friend class Applet; friend class AppletPrivate; diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 96c9ec018..39e928c1c 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -231,15 +231,6 @@ enum MarginEdge { RightMargin /**< The right margin **/ }; -enum MessageButton { - ButtonNone = 0, /**< None **/ - ButtonOk = 1, /**< OK Button **/ - ButtonYes = 2, /**< Yes Button **/ - ButtonNo = 4, /**< No Button **/ - ButtonCancel = 8 /**< Cancel Button **/ -}; -Q_DECLARE_FLAGS(MessageButtons, MessageButton) - /** * Status of an applet * @since 4.3 @@ -313,8 +304,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //typedef Types::ImmutabilityType ImmutabilityType; //typedef Types::ComponentType ComponentType; //typedef Types::MarginEdge MarginEdge; -typedef Types::MessageButton MessageButton; -typedef Types::ItemStatus ItemStatus; +//typedef Types::ItemStatus ItemStatus; typedef Types::TrustLevel TrustLevel; typedef Types::BackgroundHints BackgroundHints; diff --git a/src/plasma/private/applet_p.h b/src/plasma/private/applet_p.h index 40ede0417..455fc3493 100644 --- a/src/plasma/private/applet_p.h +++ b/src/plasma/private/applet_p.h @@ -100,7 +100,7 @@ public: KActionCollection *actions; KAction *activationAction; - ItemStatus itemStatus; + Types::ItemStatus itemStatus; // timerEvent bookkeeping QBasicTimer constraintsTimer; diff --git a/src/plasma/private/containment_p.cpp b/src/plasma/private/containment_p.cpp index 03e950d61..207782692 100644 --- a/src/plasma/private/containment_p.cpp +++ b/src/plasma/private/containment_p.cpp @@ -161,7 +161,7 @@ void ContainmentPrivate::configChanged() q->setWallpaper(group.readEntry("wallpaperplugin", defaultWallpaper)); } -void ContainmentPrivate::checkStatus(Plasma::ItemStatus appletStatus) +void ContainmentPrivate::checkStatus(Plasma::Types::ItemStatus appletStatus) { //kDebug() << "================== "<< appletStatus << q->status(); if (appletStatus == q->status()) { diff --git a/src/plasma/private/containment_p.h b/src/plasma/private/containment_p.h index 628b7242a..059c92091 100644 --- a/src/plasma/private/containment_p.h +++ b/src/plasma/private/containment_p.h @@ -65,7 +65,7 @@ public: } void triggerShowAddWidgets(); - void checkStatus(Plasma::ItemStatus status); + void checkStatus(Plasma::Types::ItemStatus status); void setScreen(int newScreen); /** diff --git a/src/scriptengines/javascript/declarative/appletcontainer.cpp b/src/scriptengines/javascript/declarative/appletcontainer.cpp index 2ed599eda..e2b10323e 100644 --- a/src/scriptengines/javascript/declarative/appletcontainer.cpp +++ b/src/scriptengines/javascript/declarative/appletcontainer.cpp @@ -59,7 +59,7 @@ void AppletContainer::setApplet(QGraphicsWidget *widget) m_applet = applet; connect(applet, SIGNAL(sizeHintChanged(Qt::SizeHint)), this, SLOT(sizeHintChanged(Qt::SizeHint))); - connect(applet, SIGNAL(statusChanged(Plasma::ItemStatus)), this, SIGNAL(statusChanged())); + connect(applet, SIGNAL(statusChanged(Plasma::Types::ItemStatus)), this, SIGNAL(statusChanged())); applet->setParentItem(this); applet->setGeometry(0, 0, qMax((qreal)16, width()), qMax((qreal)16, height())); @@ -151,7 +151,7 @@ void AppletContainer::setStatus(const AppletContainer::ItemStatus status) return; } - m_applet.data()->setStatus((Plasma::ItemStatus)status); + m_applet.data()->setStatus((Plasma::Types::ItemStatus)status); } AppletContainer::ItemStatus AppletContainer::status() const diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index 3ff994a35..20ebc473d 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -66,7 +66,7 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, QQuickItem *pa connect(this, SIGNAL(releaseVisualFocus()), applet(), SIGNAL(releaseVisualFocus())); connect(this, SIGNAL(configNeedsSaving()), applet(), SIGNAL(configNeedsSaving())); connect(applet(), SIGNAL(immutabilityChanged(Plasma::Types::ImmutabilityType)), this, SIGNAL(immutableChanged())); - connect(applet(), SIGNAL(statusChanged(Plasma::ItemStatus)), this, SIGNAL(statusChanged())); + connect(applet(), SIGNAL(statusChanged(Plasma::Types::ItemStatus)), this, SIGNAL(statusChanged())); connect(m_appletScriptEngine, SIGNAL(formFactorChanged()), this, SIGNAL(formFactorChanged())); connect(m_appletScriptEngine, SIGNAL(locationChanged()), From 40fd2f23ca1f93468d42b4af227b8d96c0c675ef Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 21:02:54 +0200 Subject: [PATCH 55/80] Rename BackgroundHints --- src/plasma/plasma.h | 20 -------------------- src/plasma/staging/signing.cpp | 4 ++-- src/plasma/staging/signing.h | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 39e928c1c..f5d715faf 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -288,26 +288,6 @@ PLASMA_EXPORT Types::Direction locationToDirection(Types::Location location); **/ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location location); -//For porting -//TODO: remove -//typedef Types::Constraint Constraint; -//Q_DECLARE_FLAGS(Constraints, Constraint) -//typedef Types::FormFactor FormFactor; -//typedef Types::ContainmentType ContainmentType; -//typedef Types::ActionType ActionType; -//typedef Types::Direction Direction; -//typedef Types::Location Location; -//typedef Types::Position Position; -//typedef Types::PopupPlacement PopupPlacement; -//typedef Types::FlipDirection FlipDirection; -//typedef Types::IntervalAlignment IntervalAlignment; -//typedef Types::ImmutabilityType ImmutabilityType; -//typedef Types::ComponentType ComponentType; -//typedef Types::MarginEdge MarginEdge; -//typedef Types::ItemStatus ItemStatus; -typedef Types::TrustLevel TrustLevel; -typedef Types::BackgroundHints BackgroundHints; - } // Plasma namespace diff --git a/src/plasma/staging/signing.cpp b/src/plasma/staging/signing.cpp index 1e208448a..facfaa895 100644 --- a/src/plasma/staging/signing.cpp +++ b/src/plasma/staging/signing.cpp @@ -590,10 +590,10 @@ TrustLevel Signing::trustLevelOf(const QString &keyID) const return Plasma::UnverifiableTrust; for (int i = (int)Plasma::UnverifiableTrust; i <= (int)Plasma::UltimatelyTrusted; ++i) { - QList< QByteArray > tmp = d->keys[(Plasma::TrustLevel)i]; + QList< QByteArray > tmp = d->keys[(Plasma::Types::TrustLevel)i]; foreach(QByteArray key, tmp) { if (key.contains(keyID.toAscii().data())) - return (Plasma::TrustLevel)i; + return (Plasma::Types::TrustLevel)i; } } diff --git a/src/plasma/staging/signing.h b/src/plasma/staging/signing.h index 6afacabb2..7c93f6096 100644 --- a/src/plasma/staging/signing.h +++ b/src/plasma/staging/signing.h @@ -70,7 +70,7 @@ class SigningPrivate; * QString signer = m_auth->signerOf(plasmoidPath); * * // If you need to know the authentication level associated with a specific signer, simply call: - * Plasma::TrustLevel level = m_auth->trustLevelOf(signer) + * Plasma::Types::TrustLevel level = m_auth->trustLevelOf(signer) * * // If you need more details about a key with a given keyID, you have to call: * QString info = m_auth->descriptiveString(keyID); From e07cbe99af9009d726e5f33c9c070b6c921223d7 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 15 May 2013 14:16:44 +0200 Subject: [PATCH 56/80] allow last column to be bigger last column wisth is regulated by the page's implicitWidth, but the final with will always be a multiple of columnWidth --- .../plasmaextracomponents/qml/PageRow.qml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml b/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml index 4e6420279..c0d691656 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/PageRow.qml @@ -98,7 +98,9 @@ Item { // See push() for details. function replace(page, properties, immediate) { - return Engine.push(page, properties, true, immediate); + var item = Engine.push(page, properties, true, immediate); + scrollToLevel(depth) + return item } // Clears the page stack. @@ -207,7 +209,7 @@ Item { Row { id: root spacing: -100 - width: columnWidth*depth + width: childrenRect.width - 100 height: parent.height Behavior on width { NumberAnimation { @@ -252,7 +254,8 @@ Item { Item { id: container - width: columnWidth + 100 + implicitWidth: actualContainer.width + 100 + width: implicitWidth height: parent ? parent.height : 0 x: 0 @@ -305,7 +308,7 @@ Item { right: parent.right rightMargin: 100 } - width: columnWidth + width: (container.pageDepth >= actualRoot.depth ? Math.min(actualRoot.width, Math.max(1, Math.round(page.implicitWidth/columnWidth))*columnWidth) : columnWidth) } Image { @@ -430,7 +433,7 @@ Item { State { name: "" PropertyChanges { target: container; visible: true; opacity: 1 } - PropertyChanges { target: container; width: columnWidth+100} + PropertyChanges { target: container; width: container.implicitWidth} }, // Start state for pop entry, end state for push exit. State { @@ -448,7 +451,7 @@ Item { State { name: "Hidden" PropertyChanges { target: container; visible: false } - PropertyChanges { target: container; width: columnWidth+100} + PropertyChanges { target: container; width: container.implicitWidth} } ] From 75cbf80f4790356d7328a233f2563689a9a25989 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 15 May 2013 17:57:13 +0200 Subject: [PATCH 57/80] add Units from Plasma1 --- .../plasmacomponents/CMakeLists.txt | 1 + .../plasmacomponents/units.cpp | 75 +++++++++++++++++++ .../plasmacomponents/units.h | 66 ++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 src/declarativeimports/plasmacomponents/units.cpp create mode 100644 src/declarativeimports/plasmacomponents/units.h diff --git a/src/declarativeimports/plasmacomponents/CMakeLists.txt b/src/declarativeimports/plasmacomponents/CMakeLists.txt index 4334ea732..a7bdeb358 100644 --- a/src/declarativeimports/plasmacomponents/CMakeLists.txt +++ b/src/declarativeimports/plasmacomponents/CMakeLists.txt @@ -10,6 +10,7 @@ set(plasmacomponents_SRCS enums.cpp qmenu.cpp qmenuitem.cpp + units.cpp #../core/declarativeitemcontainer.cpp ) diff --git a/src/declarativeimports/plasmacomponents/units.cpp b/src/declarativeimports/plasmacomponents/units.cpp new file mode 100644 index 000000000..0f641f6e9 --- /dev/null +++ b/src/declarativeimports/plasmacomponents/units.cpp @@ -0,0 +1,75 @@ +/*************************************************************************** + * Copyright 2013 Marco Martin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * + ***************************************************************************/ + +#include "units.h" + +#include +#include +#include +#include +#include + + +Units::Units (QObject *parent) + : QObject(parent), + m_gridUnit(-1) +{ + themeChanged(); + connect(&m_theme, SIGNAL(themeChanged()), + this, SLOT(themeChanged())); +} + +Units::~Units() +{ +} + +qreal Units::gridUnit() const +{ + return m_gridUnit; +} + +qreal Units::dp(qreal value) const +{ + //Usual "default" is 96 dpi + //that magic ratio follows the definition of "device independent pixel" by Microsoft + const qreal ratio = (qreal)QApplication::desktop()->physicalDpiX() / (qreal)96; + + if (value <= 2.0) { + return qRound(value * floor(ratio)); + } else { + return qRound(value * ratio); + } +} + +qreal Units::gu(qreal value) const +{ + return qRound(m_gridUnit * value); +} + +void Units::themeChanged() +{ + const int gridUnit = QFontMetrics(QApplication::font()).boundingRect("M").width(); + if (gridUnit != m_gridUnit) { + m_gridUnit = gridUnit; + emit gridUnitChanged(); + } +} + +#include "units.moc" + diff --git a/src/declarativeimports/plasmacomponents/units.h b/src/declarativeimports/plasmacomponents/units.h new file mode 100644 index 000000000..84c14e1bf --- /dev/null +++ b/src/declarativeimports/plasmacomponents/units.h @@ -0,0 +1,66 @@ +/*************************************************************************** + * Copyright 2013 Marco Martin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * + ***************************************************************************/ + +#ifndef UNITS_H +#define UNITS_H + +#include + +#include + +class Units : public QObject +{ + Q_OBJECT + + /** + * The fundamental unit of space that should be used for sizes, expressed in pixels. + * Given the screen has an accurate DPI settings, it corresponds to a millimeter + */ + Q_PROPERTY(qreal gridUnit READ gridUnit NOTIFY gridUnitChanged()) + +public: + Units(QObject *parent = 0); + ~Units(); + + qreal gridUnit() const; + + /** + * @returns the number of pixels value density independent pixels correspond to. + */ + Q_INVOKABLE qreal dp(qreal value) const; + + /** + * @returns the number of pixels value grid units correspond to. + */ + Q_INVOKABLE qreal gu(qreal value) const; + + +Q_SIGNALS: + void gridUnitChanged(); + +private Q_SLOTS: + void themeChanged(); + +private: + int m_gridUnit; + Plasma::Theme m_theme; +}; + +#endif //UNITS_H + From aa2c4a6595e38509f0cdaaf8ef7461e8e5ba1ef5 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 15 May 2013 19:48:44 +0200 Subject: [PATCH 58/80] add all Q_ENUMS in Plasma::Types --- src/plasma/plasma.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index f5d715faf..65fe1ff63 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -37,8 +37,6 @@ namespace Plasma class PLASMA_EXPORT Types : public QObject { Q_OBJECT - Q_ENUMS(Constraint) - Q_ENUMS(FormFactor) public: /** @@ -57,6 +55,7 @@ enum Constraint { AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint | ImmutableConstraint }; +Q_ENUMS(Constraint) Q_DECLARE_FLAGS(Constraints, Constraint) /** @@ -82,6 +81,7 @@ enum FormFactor { Application /**< The Applet lives in a plane and should be optimized to look as a full application, for the desktop or the particular device. */ }; +Q_ENUMS(FormFactor) /** * This enumeration describes the type of the Containment. @@ -123,6 +123,7 @@ enum Direction { Left, /**< Display to the left */ Right /**< Display to the right */ }; +Q_ENUMS(Direction) /** * The Location enumeration describes where on screen an element, such as an @@ -139,6 +140,7 @@ enum Location { LeftEdge, /**< Along the left side of the screen */ RightEdge /**< Along the right side of the screen */ }; +Q_ENUMS(Location) /** * The position enumeration @@ -151,12 +153,12 @@ enum Position { BottomPositioned, /**< Positioned bottom */ CenterPositioned /**< Positioned in the center */ }; +Q_ENUMS(Position) /** * The popup position enumeration relatively to his attached widget * **/ - enum PopupPlacement { FloatingPopup = 0, /**< Free floating, non attached popup */ TopPosedLeftAlignedPopup, /**< Popup positioned on the top, aligned @@ -176,6 +178,7 @@ enum PopupPlacement { RightPosedBottomAlignedPopup /**< Popup positioned on the right, aligned to the bottom of the widget */ }; +Q_ENUMS(PopupPlacement) /** * Flip enumeration @@ -185,6 +188,7 @@ enum FlipDirection { HorizontalFlip = 1, /**< Flip horizontally */ VerticalFlip = 2 /**< Flip vertically */ }; +Q_ENUMS(FlipDirection) Q_DECLARE_FLAGS(Flip, FlipDirection) /** @@ -195,6 +199,7 @@ enum IntervalAlignment { AlignToMinute, /**< Align to the minute **/ AlignToHour /**< Align to the hour **/ }; +Q_ENUMS(IntervalAlignment) /** * Defines the immutability of items like applets, corona and containments @@ -208,6 +213,7 @@ enum ImmutabilityType { SystemImmutable = 4 /**< the item is locked down by the system, the user can't unlock it **/ }; +Q_ENUMS(ImmutabilityType) /** * The ComonentType enumeration refers to the various types of components, @@ -222,6 +228,7 @@ enum ComponentType { WallpaperComponent = 32, /**< Plasma::Wallpaper based plugins **/ GenericComponent = 64 /** Generic repositories of files, usually they keep QML files and their assets **/ }; +Q_ENUMS(ComponentType) Q_DECLARE_FLAGS(ComponentTypes, ComponentType) enum MarginEdge { @@ -230,6 +237,7 @@ enum MarginEdge { LeftMargin, /**< The left margin **/ RightMargin /**< The right margin **/ }; +Q_ENUMS(MarginEdge) /** * Status of an applet @@ -293,8 +301,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::Constraints) -/*Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip) +Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::Flip) Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Types::ComponentTypes) -Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::MessageButtons)*/ #endif // multiple inclusion guard From 570d0bdc05abf43ce361edd1c005066a606a7a30 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 15 May 2013 19:51:05 +0200 Subject: [PATCH 59/80] export the Plasma::Types object --- src/declarativeimports/core/CMakeLists.txt | 1 - .../core/corebindingsplugin.cpp | 4 +- .../core/plasmanamespace.cpp | 32 ------------- src/declarativeimports/core/plasmanamespace.h | 46 ------------------- 4 files changed, 2 insertions(+), 81 deletions(-) delete mode 100644 src/declarativeimports/core/plasmanamespace.cpp delete mode 100644 src/declarativeimports/core/plasmanamespace.h diff --git a/src/declarativeimports/core/CMakeLists.txt b/src/declarativeimports/core/CMakeLists.txt index f25a0851c..e580171ba 100644 --- a/src/declarativeimports/core/CMakeLists.txt +++ b/src/declarativeimports/core/CMakeLists.txt @@ -23,7 +23,6 @@ set(corebindings_SRCS serviceoperationstatus.cpp dataenginebindings.cpp iconitem.cpp - plasmanamespace.cpp ) add_library(corebindingsplugin SHARED ${corebindings_SRCS}) diff --git a/src/declarativeimports/core/corebindingsplugin.cpp b/src/declarativeimports/core/corebindingsplugin.cpp index a7e51642c..ae4788e8a 100644 --- a/src/declarativeimports/core/corebindingsplugin.cpp +++ b/src/declarativeimports/core/corebindingsplugin.cpp @@ -45,7 +45,7 @@ #include "tooltip.h" // #include "dataenginebindings_p.h" -#include "plasmanamespace.h" + #include @@ -78,7 +78,7 @@ void CoreBindingsPlugin::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("org.kde.plasma.core")); - qmlRegisterUncreatableType(uri, 2, 0, "Plasma", ""); + qmlRegisterUncreatableType(uri, 2, 0, "Types", ""); qmlRegisterType(uri, 2, 0, "Svg"); qmlRegisterType(uri, 2, 0, "FrameSvg"); diff --git a/src/declarativeimports/core/plasmanamespace.cpp b/src/declarativeimports/core/plasmanamespace.cpp deleted file mode 100644 index f5f4c6a0e..000000000 --- a/src/declarativeimports/core/plasmanamespace.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright 2013 Sebastian Kügler * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -#include "plasmanamespace.h" - -PlasmaNamespace::PlasmaNamespace(QObject *parent) - : QObject(parent) -{ -} - -PlasmaNamespace::~PlasmaNamespace() -{ -} - -#include "plasmanamespace.moc" - diff --git a/src/declarativeimports/core/plasmanamespace.h b/src/declarativeimports/core/plasmanamespace.h deleted file mode 100644 index 0a06c64c5..000000000 --- a/src/declarativeimports/core/plasmanamespace.h +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************** - * Copyright 2013 Sebastian Kügler * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ -#ifndef PLASMA_NAMESPACE_CORE -#define PLASMA_NAMESPACE_CORE - -#include - -class PlasmaNamespace : public QObject -{ - Q_OBJECT - Q_ENUMS(Location) - -public: - enum Location { - Floating = 0, /**< Free floating. Neither geometry or z-ordering - is described precisely by this value. */ - Desktop, /**< On the planar desktop layer, extending across - the full screen from edge to edge */ - FullScreen, /**< Full screen */ - TopEdge, /**< Along the top of the screen*/ - BottomEdge, /**< Along the bottom of the screen*/ - LeftEdge, /**< Along the left side of the screen */ - RightEdge /**< Along the right side of the screen */ - }; - - PlasmaNamespace(QObject *parent = 0); - ~PlasmaNamespace(); -}; - -#endif From 749d8d900ca992836742118170fc9ff511f22620 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 15 May 2013 19:56:13 +0200 Subject: [PATCH 60/80] add private ctor --- src/plasma/plasma.cpp | 9 +++++++++ src/plasma/plasma.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/plasma/plasma.cpp b/src/plasma/plasma.cpp index b37059b78..57e3c7351 100644 --- a/src/plasma/plasma.cpp +++ b/src/plasma/plasma.cpp @@ -28,6 +28,15 @@ namespace Plasma { +Types::Types(QObject *parent) + : QObject(parent) +{ +} + +Types::~Types() +{ +} + Types::Direction locationToDirection(Types::Location location) { switch (location) { diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 65fe1ff63..6c2014564 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -39,6 +39,7 @@ class PLASMA_EXPORT Types : public QObject Q_OBJECT public: + ~Types(); /** * The Constraint enumeration lists the various constraints that Plasma * objects have managed for them and which they may wish to react to, @@ -276,6 +277,8 @@ enum BackgroundHints { }; Q_ENUMS(BackgroundHints) +private: + Types(QObject *parent = 0); }; /** From 436fdf1de6d661cb150fcefa88d9c9cd4f2ac0ff Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Thu, 16 May 2013 09:58:04 +0200 Subject: [PATCH 61/80] SVN_SILENT made messages (.desktop file) --- src/platformstatus/kded-platformstatus.desktop | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/platformstatus/kded-platformstatus.desktop b/src/platformstatus/kded-platformstatus.desktop index 5c9bc5d96..88d4e933f 100644 --- a/src/platformstatus/kded-platformstatus.desktop +++ b/src/platformstatus/kded-platformstatus.desktop @@ -6,4 +6,14 @@ X-KDE-DBus-ModuleName=plaformstatus X-KDE-Kded-autoload=true X-KDE-Kded-load-on-demand=false Name=Platform Status +Name[nl]=Status van platform +Name[pt]=Estado da Plataforma +Name[sv]=Plattformstatus +Name[uk]=Стан платформи +Name[x-test]=xxPlatform Statusxx Comment=Tracks the current shell package and the platform definition strings. +Comment[nl]=Volgt het huidige shell-pakket en de definitietekenreeksen van platform. +Comment[pt]=Segue o pacote da consola actual e a os textos de definição da plataforma. +Comment[sv]=Följer nuvarande skalpaket och plattformens definitionssträngar +Comment[uk]=Стежить за станом поточного пакунка оболонки та рядками визначення платформи. +Comment[x-test]=xxTracks the current shell package and the platform definition strings.xx From ba1a7d0d3504a5c8e238dec29dafa2187949b5d1 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sat, 11 May 2013 12:24:24 +0100 Subject: [PATCH 62/80] Fix debug build Fix a pointer-dereference of a non-pointer variable. --- src/plasma/service.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plasma/service.cpp b/src/plasma/service.cpp index 6d29159be..c1d0d25de 100644 --- a/src/plasma/service.cpp +++ b/src/plasma/service.cpp @@ -236,7 +236,7 @@ ServiceJob *Service::startOperationCall(const QVariantMap &description, QObject } } else { #ifndef NDEBUG - kDebug() << op << "is not a valid group; valid groups are:" << d->operationsMap->keys(); + kDebug() << op << "is not a valid group; valid groups are:" << d->operationsMap.keys(); #endif } From 98130b33fe4a33375919fb27c80ec39e80ecad22 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sat, 11 May 2013 12:25:35 +0100 Subject: [PATCH 63/80] Add the "theme" directory to the plasmoid directory structure This adds an extra step to the lookup of SVG images created with the Svg() global function: after looking in images/ in the plasmoid and then in the desktop theme, it looks in theme/$DESKTOP_THEME_NAME and then theme/ in the plasmoid. This allows plasmoid authors to add images that they want to allow theme authors to override. Forward-port of review request 109857. --- src/plasma/autotests/packagestructuretest.cpp | 4 +++- src/plasma/private/packages.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plasma/autotests/packagestructuretest.cpp b/src/plasma/autotests/packagestructuretest.cpp index 5d2226fd7..4a4586bc5 100644 --- a/src/plasma/autotests/packagestructuretest.cpp +++ b/src/plasma/autotests/packagestructuretest.cpp @@ -83,7 +83,7 @@ void PackageStructureTest::multiplePaths() void PackageStructureTest::directories() { QList dirs; - dirs << "config" << "data" << "images" << "scripts" << "translations" << "ui"; + dirs << "config" << "data" << "images" << "theme" << "scripts" << "translations" << "ui"; QList psDirs = ps.directories(); @@ -156,6 +156,7 @@ void PackageStructureTest::requiredFiles() void PackageStructureTest::path() { QCOMPARE(ps.filePath("images"), QDir(m_packagePath + QString("/contents/images")).canonicalPath()); + QCOMPARE(ps.filePath("theme"), QDir(m_packagePath + QString("/contents/theme")).canonicalPath()); QCOMPARE(ps.filePath("mainscript"), QFileInfo(m_packagePath + QString("/contents/ui/main.qml")).canonicalFilePath()); } @@ -175,6 +176,7 @@ void PackageStructureTest::mimeTypes() QStringList mimeTypes; mimeTypes << "image/svg+xml" << "image/png" << "image/jpeg"; QCOMPARE(ps.mimeTypes("images"), mimeTypes); + QCOMPARE(ps.mimeTypes("theme"), mimeTypes); } QTEST_MAIN(PackageStructureTest) diff --git a/src/plasma/private/packages.cpp b/src/plasma/private/packages.cpp index 082a0e73b..2829c0594 100644 --- a/src/plasma/private/packages.cpp +++ b/src/plasma/private/packages.cpp @@ -82,9 +82,11 @@ void GenericPackage::initPackage(Package *package) package->setDefaultPackageRoot("plasma/packages/"); package->addDirectoryDefinition("images", "images", i18n("Images")); + package->addDirectoryDefinition("theme", "theme", i18n("Themed Images")); QStringList mimetypes; mimetypes << "image/svg+xml" << "image/png" << "image/jpeg"; package->setMimeTypes("images", mimetypes); + package->setMimeTypes("theme", mimetypes); package->addDirectoryDefinition("config", "config", i18n("Configuration Definitions")); mimetypes.clear(); From 981ae1cdd6acb729986d3684e751e2517616c60b Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 13 May 2013 11:20:42 +0200 Subject: [PATCH 64/80] close on focus out --- src/shell/panelconfigview.cpp | 5 +++++ src/shell/panelconfigview.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/shell/panelconfigview.cpp b/src/shell/panelconfigview.cpp index c019d87e3..40f81f574 100644 --- a/src/shell/panelconfigview.cpp +++ b/src/shell/panelconfigview.cpp @@ -85,5 +85,10 @@ void PanelConfigView::syncGeometry() } } +void PanelConfigView::focusOutEvent(QFocusEvent *ev) +{ + Q_UNUSED(ev) + close(); +} #include "moc_panelconfigview.cpp" diff --git a/src/shell/panelconfigview.h b/src/shell/panelconfigview.h index ce7b56948..df6b797a7 100644 --- a/src/shell/panelconfigview.h +++ b/src/shell/panelconfigview.h @@ -48,6 +48,9 @@ public: void init(); +protected: + void focusOutEvent(QFocusEvent *ev); + protected Q_SLOTS: void syncGeometry(); From f22e4be172e3419b2600d20c1cb51079920b885a Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 13 May 2013 14:25:57 +0200 Subject: [PATCH 65/80] fix startupcompleted constraints use the new panel toolbox --- src/plasma/corona.cpp | 1 - src/shell/qmlpackages/desktop/contents/defaults | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plasma/corona.cpp b/src/plasma/corona.cpp index adcdeb197..47338730d 100644 --- a/src/plasma/corona.cpp +++ b/src/plasma/corona.cpp @@ -507,7 +507,6 @@ QList CoronaPrivate::importLayout(const KConfigGroup &con } foreach (Containment *containment, newContainments) { - containment->updateConstraints(Plasma::Types::StartupCompletedConstraint); emit q->containmentAdded(containment); #ifndef NDEBUG // kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Containment" << containment->name(); diff --git a/src/shell/qmlpackages/desktop/contents/defaults b/src/shell/qmlpackages/desktop/contents/defaults index 147d0ec4e..b9a99dab4 100644 --- a/src/shell/qmlpackages/desktop/contents/defaults +++ b/src/shell/qmlpackages/desktop/contents/defaults @@ -7,7 +7,7 @@ MiddleButton=org.kde.paste [Panel] Containment=org.kde.panel -ToolBox=org.kde.toolbox +ToolBox=org.kde.paneltoolbox [Panel][ContainmentActions] Ctrl;LeftButton=org.kde.standardmenu From 9930890ce31c4461e72711672a2662677f694b11 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 13 May 2013 17:40:58 +0200 Subject: [PATCH 66/80] blur behind in the panel controller --- src/shell/panelconfigview.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shell/panelconfigview.cpp b/src/shell/panelconfigview.cpp index 40f81f574..172ace801 100644 --- a/src/shell/panelconfigview.cpp +++ b/src/shell/panelconfigview.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -43,6 +44,8 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa setFlags(Qt::FramelessWindowHint); + KWindowEffects::enableBlurBehind(winId(), true); + engine()->rootContext()->setContextProperty("panel", panelView); engine()->rootContext()->setContextProperty("configDialog", this); connect(containment, &Plasma::Containment::formFactorChanged, From 669ed7a35c20e6ef3d3e4199679ecb6989e4f6e8 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 16 May 2013 13:39:30 +0200 Subject: [PATCH 67/80] register Units --- .../plasmacomponents/plasmacomponentsplugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp b/src/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp index ce52bc0d7..92c08b3e8 100644 --- a/src/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp +++ b/src/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp @@ -35,6 +35,7 @@ #include "qmenu.h" #include "qmenuitem.h" //#include "fullscreensheet.h" +#include "units.h" //Q_EXPORT_PLUGIN2(plasmacomponentsplugin, PlasmaComponentsPlugin) @@ -83,6 +84,10 @@ void PlasmaComponentsPlugin::initializeEngine(QQmlEngine *engine, const char *ur { QQmlExtensionPlugin::initializeEngine(engine, uri); EngineBookKeeping::self()->insertEngine(engine); + + QQmlContext *context = engine->rootContext(); + Units *units = new Units(context); + context->setContextProperty("units", units); } void PlasmaComponentsPlugin::registerTypes(const char *uri) @@ -103,6 +108,7 @@ void PlasmaComponentsPlugin::registerTypes(const char *uri) qmlRegisterUncreatableType(uri, 2, 0, "DialogStatus", ""); qmlRegisterUncreatableType(uri, 2, 0, "PageOrientation", ""); qmlRegisterUncreatableType(uri, 2, 0, "PageStatus", ""); + qmlRegisterUncreatableType(uri, 0, 1, "Units", ""); } From 34a379c706875c0d059c6dd4c0b5a00ecb72fdeb Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Fri, 17 May 2013 09:45:57 +0200 Subject: [PATCH 68/80] SVN_SILENT made messages (.desktop file) --- src/platformstatus/kded-platformstatus.desktop | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platformstatus/kded-platformstatus.desktop b/src/platformstatus/kded-platformstatus.desktop index 88d4e933f..8610c261d 100644 --- a/src/platformstatus/kded-platformstatus.desktop +++ b/src/platformstatus/kded-platformstatus.desktop @@ -8,12 +8,14 @@ X-KDE-Kded-load-on-demand=false Name=Platform Status Name[nl]=Status van platform Name[pt]=Estado da Plataforma +Name[pt_BR]=Status da plataforma Name[sv]=Plattformstatus Name[uk]=Стан платформи Name[x-test]=xxPlatform Statusxx Comment=Tracks the current shell package and the platform definition strings. Comment[nl]=Volgt het huidige shell-pakket en de definitietekenreeksen van platform. Comment[pt]=Segue o pacote da consola actual e a os textos de definição da plataforma. +Comment[pt_BR]=Segue o pacote do shell atual e as strings de definição da plataforma. Comment[sv]=Följer nuvarande skalpaket och plattformens definitionssträngar Comment[uk]=Стежить за станом поточного пакунка оболонки та рядками визначення платформи. Comment[x-test]=xxTracks the current shell package and the platform definition strings.xx From 8df122a0f68decb8a79d5a723140b8a416b4aa5c Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Mon, 20 May 2013 09:04:00 +0200 Subject: [PATCH 69/80] SVN_SILENT made messages (.desktop file) --- desktoptheme/air/metadata.desktop | 2 ++ desktoptheme/appdashboard/metadata.desktop | 2 ++ desktoptheme/oxygen/metadata.desktop | 2 ++ src/kpart/plasma-kpart.desktop | 1 + src/plasma/autotests/data/signedPackage/metadata.desktop | 1 + src/plasma/autotests/data/testpackage/metadata.desktop | 1 + src/plasma/autotests/packagemetadatatest.desktop | 1 + src/plasma/data/services/plasma.protocol | 1 + src/plasma/data/servicetypes/plasma-applet.desktop | 1 + src/plasma/data/servicetypes/plasma-dataengine.desktop | 1 + src/plasma/data/servicetypes/plasma-generic.desktop | 1 + src/plasma/data/servicetypes/plasma-lookandfeel.desktop | 1 + src/plasma/data/servicetypes/plasma-runner.desktop | 1 + src/plasma/data/servicetypes/plasma-toolbox.desktop | 1 + src/plasma/data/servicetypes/plasma-wallpaper.desktop | 2 ++ .../plasma-containmentactions-test.desktop | 1 + .../tests/testengine/plasma-dataengine-testengine.desktop | 1 + .../data/plasma-scriptengine-applet-declarative.desktop | 1 + .../data/plasma-scriptengine-applet-simple-javascript.desktop | 1 + .../data/plasma-scriptengine-runner-javascript.desktop | 2 ++ .../qml/data/plasma-scriptengine-applet-declarative.desktop | 1 + src/shell/applets/testapplet/metadata.desktop | 1 + src/shell/applets/testcomponentsapplet/metadata.desktop | 1 + src/shell/containments/testpanel/metadata.desktop | 1 + src/shell/qmlpackages/desktop/metadata.desktop | 1 + src/shell/qmlpackages/lookandfeel/metadata.desktop | 1 + src/shell/qmlpackages/wallpapers/autumn/metadata.desktop | 1 + 27 files changed, 32 insertions(+) diff --git a/desktoptheme/air/metadata.desktop b/desktoptheme/air/metadata.desktop index aacda1d92..7b3fddde5 100644 --- a/desktoptheme/air/metadata.desktop +++ b/desktoptheme/air/metadata.desktop @@ -3,6 +3,7 @@ Name=Air Name[cs]=Vzduch Name[de]=Air Name[es]=Aire +Name[fi]=Air Name[fr]=Air Name[mr]=एअर Name[nl]=Air @@ -16,6 +17,7 @@ Comment=A breath of fresh air Comment[cs]=Závan čerstvého vzduchu Comment[de]=Ein Atemzug frische Luft Comment[es]=Una bocanada de aire fresco +Comment[fi]=Raikkaan ilman leyhähdys Comment[fr]=Un souffle d'air frais Comment[mr]=शुद्ध हवेचा श्वास Comment[nl]=Een hap frisse lucht diff --git a/desktoptheme/appdashboard/metadata.desktop b/desktoptheme/appdashboard/metadata.desktop index 1855ac17a..078ddec9f 100644 --- a/desktoptheme/appdashboard/metadata.desktop +++ b/desktoptheme/appdashboard/metadata.desktop @@ -3,6 +3,7 @@ Name=Application dashboard Name[cs]=Pracovní plocha aplikace Name[de]=Anwendungsübersicht Name[es]=Tablero de mandos de la aplicación +Name[fi]=Sovelluskojelauta Name[fr]=Tableau de bord des applications Name[mr]=अनुप्रयोग प्रक्षेपक Name[nl]=Toepassingendashboard @@ -16,6 +17,7 @@ Comment=Intended as Application dashboard default Comment[cs]=Zamýšleno jako výchozí pracovní plocha aplikace Comment[de]=Als Voreinstellung für Anwendungsübersicht angedacht Comment[es]=Pensado como tablero de mandos por omisión de la aplicación +Comment[fi]=Tarkoitettu oletussovelluskojelaudaksi Comment[fr]=Prévu comme tableau de bord des applications par défaut Comment[mr]=अनुप्रयोग प्रक्षेपकास अभिप्रेत मूलभूत Comment[nl]=Bedoelt als standaard in het toepassingendashboard diff --git a/desktoptheme/oxygen/metadata.desktop b/desktoptheme/oxygen/metadata.desktop index f9fc13f09..d14ce6bf1 100644 --- a/desktoptheme/oxygen/metadata.desktop +++ b/desktoptheme/oxygen/metadata.desktop @@ -3,6 +3,7 @@ Name=Oxygen Name[cs]=Oxygen Name[de]=Oxygen Name[es]=Oxígeno +Name[fi]=Oxygen Name[fr]=Oxygen Name[mr]=ऑक्सीजन Name[nl]=Oxygen @@ -16,6 +17,7 @@ Comment=Theme done in the Oxygen style Comment[cs]=Motiv ve stylu Oxygen Comment[de]=Oberflächen-Design im Oxygen-Stil Comment[es]=Tema realizado al estilo de Oxígeno +Comment[fi]=Oxygen-tyylinen teema Comment[fr]=Thème réalisé dans le style de Oxygen Comment[mr]=ऑक्सीजन शैली मध्ये शैली तयार केली Comment[nl]=Thema in Oxygen-stijl diff --git a/src/kpart/plasma-kpart.desktop b/src/kpart/plasma-kpart.desktop index e1014111f..3ac1322f1 100644 --- a/src/kpart/plasma-kpart.desktop +++ b/src/kpart/plasma-kpart.desktop @@ -3,6 +3,7 @@ Name=plasma-kpart Name[cs]=plasma-kpart Name[de]=plasma-kpart Name[es]=plasma-kpart +Name[fi]=plasma-kpart Name[fr]=plasma-kpart Name[mr]=प्लाज्मा-kpart Name[nl]=plasma-kpart diff --git a/src/plasma/autotests/data/signedPackage/metadata.desktop b/src/plasma/autotests/data/signedPackage/metadata.desktop index 5ba97e6da..fef008728 100644 --- a/src/plasma/autotests/data/signedPackage/metadata.desktop +++ b/src/plasma/autotests/data/signedPackage/metadata.desktop @@ -3,6 +3,7 @@ Name=JavaScript File Operations Name[cs]=Operace souboru JavaScript Name[de]=JavaScript-Datei-Aktionen Name[es]=Operaciones de archivo JavaScript +Name[fi]=JavaScript-tiedostotoiminnot Name[fr]=Opérations sur les fichiers JavaScript Name[mr]=जावास्क्रिप्ट फाईलच्या क्रिया Name[nl]=Bestandsbewerkingen in JavaScript diff --git a/src/plasma/autotests/data/testpackage/metadata.desktop b/src/plasma/autotests/data/testpackage/metadata.desktop index d0e2c8acd..7a9e27bce 100644 --- a/src/plasma/autotests/data/testpackage/metadata.desktop +++ b/src/plasma/autotests/data/testpackage/metadata.desktop @@ -5,6 +5,7 @@ Name=Test Package Name[cs]=Testovací balíček Name[de]=Test-Paket Name[es]=Paquete de pruebas +Name[fi]=Testipaketti Name[fr]=Paquet de test Name[mr]=चाचणी पॅकेज Name[nl]=Testpakket diff --git a/src/plasma/autotests/packagemetadatatest.desktop b/src/plasma/autotests/packagemetadatatest.desktop index 89632cd76..7952aa238 100644 --- a/src/plasma/autotests/packagemetadatatest.desktop +++ b/src/plasma/autotests/packagemetadatatest.desktop @@ -3,6 +3,7 @@ Name=Package metadata test file Name[cs]=Testovací soubor metadat balíčku Name[de]=Testdatei für Paket-Metadaten Name[es]=Archivo de pruebas de metadatos de paquete +Name[fi]=Pakettimetatietojen testitiedosto Name[fr]=Fichier de test de métadonnées de paquets Name[mr]=पॅकेज मेटाडेटा चाचणी फाईल Name[nl]=Testbestand voor pakketmetadata diff --git a/src/plasma/data/services/plasma.protocol b/src/plasma/data/services/plasma.protocol index 69f6d74d7..264431806 100644 --- a/src/plasma/data/services/plasma.protocol +++ b/src/plasma/data/services/plasma.protocol @@ -10,6 +10,7 @@ Description=A protocol for Plasma services Description[cs]=Protokol pro služby Plasma Description[de]=Ein Protokoll für Plasma-Dienste Description[es]=Un protocolo para los servicios de Plasma +Description[fi]=Plasma-palvelujen yhteyskäytäntö Description[fr]=Un protocole pour les services de Plasma Description[mr]=प्लाज्मा सेवांसाठी शिष्टाचार Description[nl]=Een protocol voor Plasma-services diff --git a/src/plasma/data/servicetypes/plasma-applet.desktop b/src/plasma/data/servicetypes/plasma-applet.desktop index 76fa4bf33..6490d38b4 100644 --- a/src/plasma/data/servicetypes/plasma-applet.desktop +++ b/src/plasma/data/servicetypes/plasma-applet.desktop @@ -6,6 +6,7 @@ Comment=Plasma applet Comment[cs]=Aplet Plasma Comment[de]=Plasma-Miniprogramm Comment[es]=Miniaplicación para Plasma +Comment[fi]=Plasma-sovelma Comment[fr]=Applet Plasma Comment[mr]=प्लाज्मा एप्लेट Comment[nl]=Plasma-applet diff --git a/src/plasma/data/servicetypes/plasma-dataengine.desktop b/src/plasma/data/servicetypes/plasma-dataengine.desktop index 6b826795c..f4e5a7356 100644 --- a/src/plasma/data/servicetypes/plasma-dataengine.desktop +++ b/src/plasma/data/servicetypes/plasma-dataengine.desktop @@ -6,6 +6,7 @@ Comment=Plasma Data Engine Comment[cs]=Datový nástroj plasma Comment[de]=Plasma-Daten-Treiber Comment[es]=Motor de datos para Plasma +Comment[fi]=Plasma-tietomoottori Comment[fr]=Moteur de données de Plasma Comment[mr]=प्लाज्मा डेटा इंजिन Comment[nl]=Plasma-gegevensengine diff --git a/src/plasma/data/servicetypes/plasma-generic.desktop b/src/plasma/data/servicetypes/plasma-generic.desktop index 5b413c19d..258d220ff 100644 --- a/src/plasma/data/servicetypes/plasma-generic.desktop +++ b/src/plasma/data/servicetypes/plasma-generic.desktop @@ -4,6 +4,7 @@ X-KDE-ServiceType=Plasma/Generic Name=Plasma Package Name[cs]=Balíček Plasmy Name[de]=Plasma-Paket +Name[fi]=Plasma-paketti Name[fr]=Paquet Plasma Name[nl]=Plasma-pakket Name[pt]=Pacote do Plasma diff --git a/src/plasma/data/servicetypes/plasma-lookandfeel.desktop b/src/plasma/data/servicetypes/plasma-lookandfeel.desktop index 74d0e1a7c..e16ef1165 100644 --- a/src/plasma/data/servicetypes/plasma-lookandfeel.desktop +++ b/src/plasma/data/servicetypes/plasma-lookandfeel.desktop @@ -3,6 +3,7 @@ Type=ServiceType X-KDE-ServiceType=Plasma/LookAndFeel Name=Plasma Look and Feel Name[de]=Plasma-Erscheinungsbild +Name[fi]=Plasman ulkoasu ja tuntuma Name[fr]=Apparence de Plasma Name[nl]=Plasma Look-and-Feel Name[pt]=Aparência e Comportamento do Plasma diff --git a/src/plasma/data/servicetypes/plasma-runner.desktop b/src/plasma/data/servicetypes/plasma-runner.desktop index c5124995d..5f8569815 100644 --- a/src/plasma/data/servicetypes/plasma-runner.desktop +++ b/src/plasma/data/servicetypes/plasma-runner.desktop @@ -6,6 +6,7 @@ Comment=KRunner plugin Comment[cs]=Modul KRunneru Comment[de]=KRunner-Modul Comment[es]=Complemento para KRunner +Comment[fi]=KRunner-liitännäinen Comment[fr]=Module externe de KRunner Comment[mr]=KRunner प्लगइन Comment[nl]=KRunner-plugin diff --git a/src/plasma/data/servicetypes/plasma-toolbox.desktop b/src/plasma/data/servicetypes/plasma-toolbox.desktop index 91cdc325c..4f5fefc2e 100644 --- a/src/plasma/data/servicetypes/plasma-toolbox.desktop +++ b/src/plasma/data/servicetypes/plasma-toolbox.desktop @@ -6,6 +6,7 @@ Comment=Plasma toolbox Comment[cs]=Plasma toolbox Comment[de]=Plasma-Werkzeugkasten Comment[es]=Caja de herramientas de Plasma +Comment[fi]=Plasma-työkalupakki Comment[fr]=Boîte à outils de Plasma Comment[mr]=प्लाज्मा साधने Comment[nl]=Plasma-hulpmiddelen diff --git a/src/plasma/data/servicetypes/plasma-wallpaper.desktop b/src/plasma/data/servicetypes/plasma-wallpaper.desktop index bc7cad47a..23a45edcc 100644 --- a/src/plasma/data/servicetypes/plasma-wallpaper.desktop +++ b/src/plasma/data/servicetypes/plasma-wallpaper.desktop @@ -4,6 +4,7 @@ X-KDE-ServiceType=Plasma/Wallpaper Name=Plasma Wallpaper Name[cs]=Tapety Plasmy Name[de]=Plasma-Hintergrundbild +Name[fi]=Plasma-taustakuva Name[fr]=Papier peint de Plasma Name[nl]=Plasma-bureaubladachtergrond Name[pt]=Papel de Parede do Plasma @@ -14,6 +15,7 @@ Name[uk]=Тло стільниці Плазми Name[x-test]=xxPlasma Wallpaperxx Comment=QML Wallpaper Packages Comment[de]=QML-Hintergrundbild-Pakete +Comment[fi]=QML-taustakuvapaketit Comment[fr]=Paquets de papier peint pour QML Comment[nl]=QML-pakketten voor achtergrondafbeeldingen Comment[pt]=Pacotes de Papéis de Parede em QML diff --git a/src/plasma/tests/testcontainmentactionsplugin/plasma-containmentactions-test.desktop b/src/plasma/tests/testcontainmentactionsplugin/plasma-containmentactions-test.desktop index de81e8f17..804a75e1d 100644 --- a/src/plasma/tests/testcontainmentactionsplugin/plasma-containmentactions-test.desktop +++ b/src/plasma/tests/testcontainmentactionsplugin/plasma-containmentactions-test.desktop @@ -3,6 +3,7 @@ Name=Test Name[cs]=Test Name[de]=Test Name[es]=Prueba +Name[fi]=Testi Name[fr]=Test Name[mr]=चाचणी Name[nl]=Test diff --git a/src/plasma/tests/testengine/plasma-dataengine-testengine.desktop b/src/plasma/tests/testengine/plasma-dataengine-testengine.desktop index 582250f5b..4e2340867 100644 --- a/src/plasma/tests/testengine/plasma-dataengine-testengine.desktop +++ b/src/plasma/tests/testengine/plasma-dataengine-testengine.desktop @@ -3,6 +3,7 @@ Name=Test Data Engine Name[cs]=Testovací datový nástroj Name[de]=Test-Datentreiber Name[es]=Motor de datos de pruebas +Name[fi]=Testitietomoottori Name[fr]=Moteur de données pour faire des tests Name[mr]=चाचणी डेटा इंजिन Name[nl]=Testgegevensengine diff --git a/src/scriptengines/javascript/data/plasma-scriptengine-applet-declarative.desktop b/src/scriptengines/javascript/data/plasma-scriptengine-applet-declarative.desktop index 1d8201ca1..96e619a07 100644 --- a/src/scriptengines/javascript/data/plasma-scriptengine-applet-declarative.desktop +++ b/src/scriptengines/javascript/data/plasma-scriptengine-applet-declarative.desktop @@ -2,6 +2,7 @@ Name=Declarative widget Name[cs]=Deklarativní widget Name[de]=Deklaratives Bedienelement +Name[fi]=Deklaratiivinen sovelma Name[fr]=Composant graphique déclaratif Name[mr]=वर्णनात्मक विजेट Name[nl]=Widget voor declaratie diff --git a/src/scriptengines/javascript/data/plasma-scriptengine-applet-simple-javascript.desktop b/src/scriptengines/javascript/data/plasma-scriptengine-applet-simple-javascript.desktop index 3349aa5f7..e84d5f945 100644 --- a/src/scriptengines/javascript/data/plasma-scriptengine-applet-simple-javascript.desktop +++ b/src/scriptengines/javascript/data/plasma-scriptengine-applet-simple-javascript.desktop @@ -2,6 +2,7 @@ Name=JavaScript Widget Name[cs]=JavaScript Widget Name[de]=JavaScript-Programm +Name[fi]=JavaScript-sovelma Name[fr]=Composant graphique de JavaScript Name[mr]=जावास्क्रिप्ट विजेट Name[nl]=JavaScript-widget diff --git a/src/scriptengines/javascript/data/plasma-scriptengine-runner-javascript.desktop b/src/scriptengines/javascript/data/plasma-scriptengine-runner-javascript.desktop index 4c98f914a..b37b15e3e 100644 --- a/src/scriptengines/javascript/data/plasma-scriptengine-runner-javascript.desktop +++ b/src/scriptengines/javascript/data/plasma-scriptengine-runner-javascript.desktop @@ -3,6 +3,7 @@ Name=JavaScript Runner Name[cs]=Spouštěč JavaScriptu Name[de]=JavaScript-Ausführung Name[es]=Lanzador JavaScript +Name[fi]=JavaScript-suoritusohjelma Name[fr]=Lanceur de JavaScript Name[mr]=जावास्क्रिप्ट चालक Name[nl]=JavaScript-runner @@ -16,6 +17,7 @@ Comment=JavaScript Runner Comment[cs]=Spouštěč JavaScriptu Comment[de]=JavaScript-Ausführung Comment[es]=Lanzador JavaScript +Comment[fi]=JavaScript-suoritusohjelma Comment[fr]=Lanceur de JavaScript Comment[mr]=जावास्क्रिप्ट चालक Comment[nl]=JavaScript-runner diff --git a/src/scriptengines/qml/data/plasma-scriptengine-applet-declarative.desktop b/src/scriptengines/qml/data/plasma-scriptengine-applet-declarative.desktop index 1d8201ca1..96e619a07 100644 --- a/src/scriptengines/qml/data/plasma-scriptengine-applet-declarative.desktop +++ b/src/scriptengines/qml/data/plasma-scriptengine-applet-declarative.desktop @@ -2,6 +2,7 @@ Name=Declarative widget Name[cs]=Deklarativní widget Name[de]=Deklaratives Bedienelement +Name[fi]=Deklaratiivinen sovelma Name[fr]=Composant graphique déclaratif Name[mr]=वर्णनात्मक विजेट Name[nl]=Widget voor declaratie diff --git a/src/shell/applets/testapplet/metadata.desktop b/src/shell/applets/testapplet/metadata.desktop index ec6356b22..57d98bbe1 100644 --- a/src/shell/applets/testapplet/metadata.desktop +++ b/src/shell/applets/testapplet/metadata.desktop @@ -4,6 +4,7 @@ Keywords= Name=Applet Test Name[de]=Miniprogrammtest Name[es]=Prueba de miniaplicación +Name[fi]=Sovelmatesti Name[fr]=Applet test Name[mr]=एप्लेट चाचणी Name[nl]=Test van applet diff --git a/src/shell/applets/testcomponentsapplet/metadata.desktop b/src/shell/applets/testcomponentsapplet/metadata.desktop index 80d4645c8..eab7da0d6 100644 --- a/src/shell/applets/testcomponentsapplet/metadata.desktop +++ b/src/shell/applets/testcomponentsapplet/metadata.desktop @@ -4,6 +4,7 @@ Keywords= Name=Components Test Name[de]=Komponententest Name[es]=Prueba de componentes +Name[fi]=Komponenttitesti Name[fr]=Test des composants Name[mr]=घटक चाचणी Name[nl]=Test van componenten diff --git a/src/shell/containments/testpanel/metadata.desktop b/src/shell/containments/testpanel/metadata.desktop index 13a3f775e..a1fcd9bac 100644 --- a/src/shell/containments/testpanel/metadata.desktop +++ b/src/shell/containments/testpanel/metadata.desktop @@ -4,6 +4,7 @@ Keywords= Name=Panel Test Name[de]=Kontrollleistentest Name[es]=Prueba de panel +Name[fi]=Paneelitesti Name[fr]=Test du panneau Name[mr]=पटल चाचणी Name[nl]=Test van paneel diff --git a/src/shell/qmlpackages/desktop/metadata.desktop b/src/shell/qmlpackages/desktop/metadata.desktop index 8b142da45..06c5d0d23 100644 --- a/src/shell/qmlpackages/desktop/metadata.desktop +++ b/src/shell/qmlpackages/desktop/metadata.desktop @@ -15,6 +15,7 @@ Name=Desktop Name[cs]=Pracovní plocha Name[de]=Arbeitsfläche Name[es]=Escritorio +Name[fi]=Työpöytä Name[fr]=Bureau Name[mr]=डेस्कटॉप Name[nl]=Bureaublad diff --git a/src/shell/qmlpackages/lookandfeel/metadata.desktop b/src/shell/qmlpackages/lookandfeel/metadata.desktop index c54023c0e..acc3d2110 100644 --- a/src/shell/qmlpackages/lookandfeel/metadata.desktop +++ b/src/shell/qmlpackages/lookandfeel/metadata.desktop @@ -20,6 +20,7 @@ Keywords[uk]=стільниця;робочий;простір;вигляд;по Keywords[x-test]=xxDesktop, Workspace, Appearance, Look and Feel, Logout, Lock, Suspend, Shutdown, Hibernate,xx Name=Look and Feel Name[de]=Erscheinungsbild +Name[fi]=Ulkoasu ja tuntuma Name[fr]=Apparence Name[nl]=Uiterlijk en gedrag Name[pt]=Aparência e Comportamento diff --git a/src/shell/qmlpackages/wallpapers/autumn/metadata.desktop b/src/shell/qmlpackages/wallpapers/autumn/metadata.desktop index 831f94d4e..86febdf97 100644 --- a/src/shell/qmlpackages/wallpapers/autumn/metadata.desktop +++ b/src/shell/qmlpackages/wallpapers/autumn/metadata.desktop @@ -5,6 +5,7 @@ Name=Autumn Name[cs]=Podzim Name[de]=Herbst Name[es]=Otoño +Name[fi]=Syksy Name[fr]=Automne Name[mr]=शरद ऋतु Name[nl]=Herfst From e258111e68c7546ba1593c0b5a983558af3f3d71 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 21 May 2013 12:02:42 +0200 Subject: [PATCH 70/80] remove some services of deleted stuff such as wallpapers and toolboxes --- src/plasma/data/services/plasma.protocol | 25 ------------------ .../data/servicetypes/plasma-toolbox.desktop | 18 ------------- .../servicetypes/plasma-wallpaper.desktop | 26 ------------------- 3 files changed, 69 deletions(-) delete mode 100644 src/plasma/data/services/plasma.protocol delete mode 100644 src/plasma/data/servicetypes/plasma-toolbox.desktop delete mode 100644 src/plasma/data/servicetypes/plasma-wallpaper.desktop diff --git a/src/plasma/data/services/plasma.protocol b/src/plasma/data/services/plasma.protocol deleted file mode 100644 index 264431806..000000000 --- a/src/plasma/data/services/plasma.protocol +++ /dev/null @@ -1,25 +0,0 @@ -[Protocol] -protocol=plasma - -exec=plasma-remote-helper %u -input=none -output=none - -Icon=plasma -Description=A protocol for Plasma services -Description[cs]=Protokol pro služby Plasma -Description[de]=Ein Protokoll für Plasma-Dienste -Description[es]=Un protocolo para los servicios de Plasma -Description[fi]=Plasma-palvelujen yhteyskäytäntö -Description[fr]=Un protocole pour les services de Plasma -Description[mr]=प्लाज्मा सेवांसाठी शिष्टाचार -Description[nl]=Een protocol voor Plasma-services -Description[pt]=Um protocolo para os serviços do Plasma -Description[pt_BR]=Protocolo para os serviços do Plasma -Description[sk]=Protokol pre Plasma služby -Description[sv]=Ett protokoll för Plasma-tjänster -Description[uk]=Протокол для служб Плазми -Description[x-test]=xxA protocol for Plasma servicesxx - -helper=true -Class=:internet diff --git a/src/plasma/data/servicetypes/plasma-toolbox.desktop b/src/plasma/data/servicetypes/plasma-toolbox.desktop deleted file mode 100644 index 4f5fefc2e..000000000 --- a/src/plasma/data/servicetypes/plasma-toolbox.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-KDE-ServiceType=Plasma/ToolBox - -Comment=Plasma toolbox -Comment[cs]=Plasma toolbox -Comment[de]=Plasma-Werkzeugkasten -Comment[es]=Caja de herramientas de Plasma -Comment[fi]=Plasma-työkalupakki -Comment[fr]=Boîte à outils de Plasma -Comment[mr]=प्लाज्मा साधने -Comment[nl]=Plasma-hulpmiddelen -Comment[pt]=Barra de ferramentas do Plasma -Comment[pt_BR]=Barra de ferramentas do Plasma -Comment[sk]=Nástroje Plasma -Comment[sv]=Plasma verktygslåda -Comment[uk]=Набір інструментів Плазми -Comment[x-test]=xxPlasma toolboxxx diff --git a/src/plasma/data/servicetypes/plasma-wallpaper.desktop b/src/plasma/data/servicetypes/plasma-wallpaper.desktop deleted file mode 100644 index 23a45edcc..000000000 --- a/src/plasma/data/servicetypes/plasma-wallpaper.desktop +++ /dev/null @@ -1,26 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-KDE-ServiceType=Plasma/Wallpaper -Name=Plasma Wallpaper -Name[cs]=Tapety Plasmy -Name[de]=Plasma-Hintergrundbild -Name[fi]=Plasma-taustakuva -Name[fr]=Papier peint de Plasma -Name[nl]=Plasma-bureaubladachtergrond -Name[pt]=Papel de Parede do Plasma -Name[pt_BR]=Papel de parede do Plasma -Name[sk]=Tapeta Plasma -Name[sv]=Plasma skrivbordsunderlägg -Name[uk]=Тло стільниці Плазми -Name[x-test]=xxPlasma Wallpaperxx -Comment=QML Wallpaper Packages -Comment[de]=QML-Hintergrundbild-Pakete -Comment[fi]=QML-taustakuvapaketit -Comment[fr]=Paquets de papier peint pour QML -Comment[nl]=QML-pakketten voor achtergrondafbeeldingen -Comment[pt]=Pacotes de Papéis de Parede em QML -Comment[pt_BR]=Pacotes de papéis de parede em QML -Comment[sk]=Balíky tapiet QML -Comment[sv]=Paket med QML-skrivbordsunderlägg -Comment[uk]=Пакунки зображень тла QML -Comment[x-test]=xxQML Wallpaper Packagesxx From 9d93cb7ccc500101c540aa1182d38e216e93230a Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Wed, 22 May 2013 11:06:21 +0200 Subject: [PATCH 71/80] Those files are gone, don't try to install them --- src/plasma/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt index 48eae09c1..036e184ed 100644 --- a/src/plasma/CMakeLists.txt +++ b/src/plasma/CMakeLists.txt @@ -227,13 +227,8 @@ install(FILES data/servicetypes/plasma-service.desktop data/servicetypes/plasma-shell.desktop data/servicetypes/plasma-lookandfeel.desktop - data/servicetypes/plasma-wallpaper.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) -install(FILES - data/services/plasma.protocol - DESTINATION ${SERVICES_INSTALL_DIR}) - install(FILES data/operations/dataengineservice.operations DESTINATION ${DATA_INSTALL_DIR}/plasma/services) install(FILES data/operations/plasmoidservice.operations DESTINATION ${DATA_INSTALL_DIR}/plasma/services) install(FILES data/operations/storage.operations DESTINATION ${DATA_INSTALL_DIR}/plasma/services) From 3355360444aae43ec1d4e79c44dc0621dc991b4f Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 24 May 2013 02:04:08 +0200 Subject: [PATCH 72/80] Ported to QCommandLineParser (mostly because linking to kde4support doesn't actually work...) --- src/plasmapkg/CMakeLists.txt | 2 +- src/plasmapkg/main.cpp | 49 +++++++++++-------------- src/plasmapkg/plasmapkg.cpp | 70 ++++++++++++++++++------------------ src/plasmapkg/plasmapkg.h | 3 +- 4 files changed, 58 insertions(+), 66 deletions(-) diff --git a/src/plasmapkg/CMakeLists.txt b/src/plasmapkg/CMakeLists.txt index 67a53b3cd..d2f242701 100644 --- a/src/plasmapkg/CMakeLists.txt +++ b/src/plasmapkg/CMakeLists.txt @@ -5,7 +5,7 @@ add_executable(plasmapkg plasmapkg.cpp ) -target_link_libraries(plasmapkg ${KDE4_KDECORE_LIBS} plasma) +target_link_libraries(plasmapkg kdeqt5staging plasma) message("INSTALL_TARGETS_DEFAULT_ARGS ${INSTALL_TARGETS_DEFAULT_ARGS}") diff --git a/src/plasmapkg/main.cpp b/src/plasmapkg/main.cpp index 38a447422..4fcc18a8f 100644 --- a/src/plasmapkg/main.cpp +++ b/src/plasmapkg/main.cpp @@ -18,48 +18,39 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include +#include +#include #include "plasmapkg.h" int main(int argc, char **argv) { - KLocalizedString description = ki18n("Plasma Package Manager"); + QCommandLineParser *parser = new QCommandLineParser; + Plasma::PlasmaPkg app(argc, argv, parser); + const QString description = i18n("Plasma Package Manager"); const char version[] = "2.0"; - KCmdLineArgs::init(argc, argv, "plasmapkg", "plasmapkg", ki18n("Plasma Package Manager"), version, description); - - KCmdLineOptions options; - options.add("h"); - options.add("hash ", ki18nc("Do not translate ", "Generate a SHA1 hash for the package at ")); - options.add("g"); - options.add("global", ki18n("For install or remove, operates on packages installed for all users.")); - options.add("t"); - options.add("type ", - ki18nc("theme, wallpaper, etc. are keywords, but they may be translated, as both versions " + app.setApplicationVersion(version); + parser->addVersionOption(); + parser->addHelpOption(description); + parser->addOption(QCommandLineOption(QStringList() << "h" << "hash", i18nc("Do not translate ", "Generate a SHA1 hash for the package at "), "path")); + parser->addOption(QCommandLineOption(QStringList() << "g" << "global", i18n("For install or remove, operates on packages installed for all users."))); + parser->addOption(QCommandLineOption(QStringList() << "type", + i18nc("theme, wallpaper, etc. are keywords, but they may be translated, as both versions " "are recognized by the application " "(if translated, should be same as messages with 'package type' context below)", "The type of package, e.g. theme, wallpaper, plasmoid, dataengine, runner, layout-template, etc."), - "plasmoid"); - //options.add("s"); - options.add("i"); - options.add("install ", ki18nc("Do not translate ", "Install the package at ")); - options.add("s"); - options.add("show ", ki18nc("Do not translate ", "Show information of package ")); - options.add("u"); - options.add("upgrade ", ki18nc("Do not translate ", "Upgrade the package at ")); - options.add("l"); - options.add("list", ki18n("List installed packages")); - options.add("list-types", ki18n("lists all known Package types that can be installed")); - options.add("r"); - options.add("remove ", ki18nc("Do not translate ", "Remove the package named ")); - options.add("p"); - options.add("packageroot ", ki18n("Absolute path to the package root. If not supplied, then the standard data directories for this KDE session will be searched instead.")); - KCmdLineArgs::addCmdLineOptions( options ); + "type", false, QStringList() << "plasmoid")); + parser->addOption(QCommandLineOption(QStringList() << "i" << "install", i18nc("Do not translate ", "Install the package at "), "path")); + parser->addOption(QCommandLineOption(QStringList() << "s" << "show", i18nc("Do not translate ", "Show information of package "), "name")); + parser->addOption(QCommandLineOption(QStringList() << "u" << "upgrade", i18nc("Do not translate ", "Upgrade the package at "), "path")); + parser->addOption(QCommandLineOption(QStringList() << "l" << "list", i18n("List installed packages"))); + parser->addOption(QCommandLineOption(QStringList() << "list-types", i18n("lists all known Package types that can be installed"))); + parser->addOption(QCommandLineOption(QStringList() << "r" << "remove", i18nc("Do not translate ", "Remove the package named "), "name")); + parser->addOption(QCommandLineOption(QStringList() << "p" << "packageroot", i18n("Absolute path to the package root. If not supplied, then the standard data directories for this KDE session will be searched instead."), "path")); - Plasma::PlasmaPkg app(argc, argv); return app.exec(); } diff --git a/src/plasmapkg/plasmapkg.cpp b/src/plasmapkg/plasmapkg.cpp index 460d4aefa..2aca95e00 100644 --- a/src/plasmapkg/plasmapkg.cpp +++ b/src/plasmapkg/plasmapkg.cpp @@ -20,7 +20,6 @@ #include "plasmapkg.h" -#include #include #include #include @@ -35,6 +34,7 @@ #include #include +#include #include #include #include @@ -66,14 +66,15 @@ public: void renderTypeTable(const QMap &plugins); void listTypes(); void coutput(const QString &msg); - KCmdLineArgs *args; + QCommandLineParser *parser; }; -PlasmaPkg::PlasmaPkg(int& argc, char** argv) : +PlasmaPkg::PlasmaPkg(int& argc, char** argv, QCommandLineParser *parser) : QCoreApplication(argc, argv) { d = new PlasmaPkgPrivate; + d->parser = parser; QTimer::singleShot(0, this, SLOT(runMain())); } @@ -84,11 +85,9 @@ PlasmaPkg::~PlasmaPkg() void PlasmaPkg::runMain() { - d->args = KCmdLineArgs::parsedArgs(); - Plasma::PackageStructure* structure = new Plasma::PackageStructure; - if (d->args->isSet("hash")) { - const QString path = d->args->getOption("hash"); + if (d->parser->isSet("hash")) { + const QString path = d->parser->argument("hash"); Plasma::Package package(structure); package.setPath(path); const QString hash = package.contentsHash(); @@ -102,44 +101,44 @@ void PlasmaPkg::runMain() return; } - if (d->args->isSet("list-types")) { + if (d->parser->isSet("list-types")) { d->listTypes(); exit(0); return; } - QString type = d->args->getOption("type"); + QString type = d->parser->argument("type"); QString packageRoot = type; d->pluginTypes.clear(); d->installer = 0; - if (d->args->isSet("remove")) { - d->package = d->args->getOption("remove"); - } else if (d->args->isSet("upgrade")) { - d->package = d->args->getOption("upgrade"); - } else if (d->args->isSet("install")) { - d->package = d->args->getOption("install"); - } else if (d->args->isSet("show")) { - d->package = d->args->getOption("show"); + if (d->parser->isSet("remove")) { + d->package = d->parser->argument("remove"); + } else if (d->parser->isSet("upgrade")) { + d->package = d->parser->argument("upgrade"); + } else if (d->parser->isSet("install")) { + d->package = d->parser->argument("install"); + } else if (d->parser->isSet("show")) { + d->package = d->parser->argument("show"); } if (!QDir::isAbsolutePath(d->package)) { d->packageFile = QDir(QDir::currentPath() + '/' + d->package).absolutePath(); d->packageFile = QFileInfo(d->packageFile).canonicalFilePath(); - if (d->args->isSet("upgrade")) { + if (d->parser->isSet("upgrade")) { d->package = d->packageFile; } } else { d->packageFile = d->package; } - if (!d->packageFile.isEmpty() && (!d->args->isSet("type") || + if (!d->packageFile.isEmpty() && (!d->parser->isSet("type") || type.compare(i18nc("package type", "wallpaper"), Qt::CaseInsensitive) == 0 || type.compare("wallpaper", Qt::CaseInsensitive) == 0)) { // Check type for common plasma packages Plasma::Package package(structure); QString serviceType; - if (d->args->isSet("remove")) { + if (d->parser->isSet("remove")) { package.setPath(d->package); } else { package.setPath(d->packageFile); @@ -270,21 +269,21 @@ void PlasmaPkg::runMain() if (!d->installer) { d->coutput(i18n("Could not load installer for package of type %1. Error reported was: %2", - d->args->getOption("type"), error)); + d->parser->argument("type"), error)); return; } //d->packageRoot = d->installer->defaultPackageRoot(); //pluginTypes << d->installer->type(); } - if (d->args->isSet("show")) { + if (d->parser->isSet("show")) { const QString pluginName = d->package; showPackageInfo(pluginName); exit(0); return; } - if (d->args->isSet("list")) { + if (d->parser->isSet("list")) { d->coutput(i18n("Listing service types: %1", d->pluginTypes.join(", "))); listPackages(d->pluginTypes); exit(0); @@ -298,7 +297,7 @@ void PlasmaPkg::runMain() d->packageRoot = findPackageRoot(d->package, d->packageRoot); - if (d->args->isSet("remove") || d->args->isSet("upgrade")) { + if (d->parser->isSet("remove") || d->parser->isSet("upgrade")) { QString pkgPath; foreach (const QString &t, d->pluginTypes) { Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage(t); @@ -315,7 +314,7 @@ void PlasmaPkg::runMain() pkgPath = d->package; } - if (d->args->isSet("upgrade")) { + if (d->parser->isSet("upgrade")) { d->installer->setPath(d->package); } QString _p = d->packageRoot; @@ -349,13 +348,13 @@ void PlasmaPkg::runMain() exit(1); } } - if (d->args->isSet("install")) { + if (d->parser->isSet("install")) { KJob *installJob = d->installer->install(d->packageFile, d->packageRoot); connect(installJob, SIGNAL(result(KJob*)), SLOT(packageInstalled(KJob*))); return; } if (d->package.isEmpty()) { - KCmdLineArgs::usageError(i18nc("No option was given, this is the error message telling the user he needs at least one, do not translate install, remove, upgrade nor list", "One of install, remove, upgrade or list is required.")); + qWarning() << i18nc("No option was given, this is the error message telling the user he needs at least one, do not translate install, remove, upgrade nor list", "One of install, remove, upgrade or list is required."); exit(1); } else { d->runKbuildsycoca(); @@ -439,16 +438,17 @@ void PlasmaPkg::showPackageInfo(const QString& pluginName) QString PlasmaPkg::findPackageRoot(const QString& pluginName, const QString& prefix) { QString packageRoot; - if (d->args->isSet("packageroot") && d->args->isSet("global")) { - KCmdLineArgs::usageError(i18nc("The user entered conflicting options packageroot and global, this is the error message telling the user he can use only one", "The packageroot and global options conflict each other, please select only one.")); - } else if (d->args->isSet("packageroot")) { - packageRoot = d->args->getOption("packageroot"); + if (d->parser->isSet("packageroot") && d->parser->isSet("global")) { + qWarning() << i18nc("The user entered conflicting options packageroot and global, this is the error message telling the user he can use only one", "The packageroot and global options conflict each other, please select only one."); + ::exit(1); + } else if (d->parser->isSet("packageroot")) { + packageRoot = d->parser->argument("packageroot"); //qDebug() << "(set via arg) d->packageRoot is: " << d->packageRoot; - } else if (d->args->isSet("global")) { + } else if (d->parser->isSet("global")) { packageRoot = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, d->packageRoot, QStandardPaths::LocateDirectory).last(); //qDebug() << "(set via locateAll) d->packageRoot is: " << d->packageRoot; } else { - packageRoot = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + d->packageRoot; + packageRoot = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + d->packageRoot; //qDebug() << "(set via locateLocal) d->packageRoot is: " << d->packageRoot; } return packageRoot; @@ -584,7 +584,7 @@ void PlasmaPkg::packageInstalled(KJob *job) bool success = (job->error() == KJob::NoError); int exitcode = 0; if (success) { - if (d->args->isSet("upgrade")) { + if (d->parser->isSet("upgrade")) { d->coutput(i18n("Successfully upgraded %1", d->packageFile)); } else { d->coutput(i18n("Successfully installed %1", d->packageFile)); @@ -601,7 +601,7 @@ void PlasmaPkg::packageUninstalled(KJob *job) bool success = (job->error() == KJob::NoError); int exitcode = 0; if (success) { - if (d->args->isSet("upgrade")) { + if (d->parser->isSet("upgrade")) { d->coutput(i18n("Upgrading package from file: %1", d->packageFile)); KJob *installJob = d->installer->install(d->packageFile, d->packageRoot); connect(installJob, SIGNAL(result(KJob*)), SLOT(packageInstalled(KJob*))); diff --git a/src/plasmapkg/plasmapkg.h b/src/plasmapkg/plasmapkg.h index 85c679ed5..d4411dff1 100644 --- a/src/plasmapkg/plasmapkg.h +++ b/src/plasmapkg/plasmapkg.h @@ -23,6 +23,7 @@ #include +class QCommandLineParser; class KJob; namespace Plasma @@ -35,7 +36,7 @@ class PlasmaPkg : public QCoreApplication Q_OBJECT public: - PlasmaPkg(int& argc, char** argv); + PlasmaPkg(int& argc, char** argv, QCommandLineParser *parser); virtual ~PlasmaPkg(); void listPackages(const QStringList &types); From 7a7914126ed19cba62e196c86043aeac82f7c631 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 25 May 2013 12:49:39 +0200 Subject: [PATCH 73/80] Switch is a CheckBox on desktop the sliding Switch is touch specific --- .../plasmacomponents/CMakeLists.txt | 1 - .../platformcomponents/touch/Switch.qml | 85 +++++++++++++++++++ .../plasmacomponents/qml/Switch.qml | 77 +++++++---------- 3 files changed, 114 insertions(+), 49 deletions(-) create mode 100644 src/declarativeimports/plasmacomponents/platformcomponents/touch/Switch.qml diff --git a/src/declarativeimports/plasmacomponents/CMakeLists.txt b/src/declarativeimports/plasmacomponents/CMakeLists.txt index a7bdeb358..bd83573f7 100644 --- a/src/declarativeimports/plasmacomponents/CMakeLists.txt +++ b/src/declarativeimports/plasmacomponents/CMakeLists.txt @@ -61,7 +61,6 @@ install(FILES qml/QueryDialog.qml DESTINATION ${PLUGIN_INSTALL_DIR}/platformimpo install(FILES qml/RadioButton.qml DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) install(FILES qml/SelectionDialog.qml DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) install(FILES qml/Slider.qml DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) -install(FILES qml/Switch.qml DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) install(FILES qml/TabBar.qml DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) install(FILES qml/TabButton.qml DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) install(FILES qml/TabGroup.qml DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) diff --git a/src/declarativeimports/plasmacomponents/platformcomponents/touch/Switch.qml b/src/declarativeimports/plasmacomponents/platformcomponents/touch/Switch.qml new file mode 100644 index 000000000..d61a63d76 --- /dev/null +++ b/src/declarativeimports/plasmacomponents/platformcomponents/touch/Switch.qml @@ -0,0 +1,85 @@ +/* +* Copyright (C) 2011 by Daker Fernandes Pinheiro +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU Library General Public License as +* published by the Free Software Foundation; either version 2, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details +* +* You should have received a copy of the GNU Library General Public +* License along with this program; if not, write to the +* Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. +*/ + +import QtQuick 2.0 +import org.kde.plasma.core 2.0 as PlasmaCore +import "private" as Private + +/** + * A boolean toggle button with the visual representation of a "realistic" + * switch with a movable toggle showing the state of the Switch. Generally + * easier to use on touch devices than a CheckBox due to the larger surface + * space and more evident state visualization. + * + * You can bind the Switch component, for example, to a feature that the + * application has to enable or disable depending on the user's input. + * + * All elements of this component are defined in DualStateButton, its base component. + */ +Private.DualStateButton { + id: switchItem + + view: PlasmaCore.FrameSvgItem { + imagePath: "widgets/slider" + prefix: "groove" + width: height * 2 + height: Math.max(theme.mSize(theme.defaultFont).height + margins.top + margins.bottom, + button.margins.top + button.margins.bottom) + + PlasmaCore.FrameSvgItem { + id: highlight + imagePath: "widgets/slider" + prefix: "groove-highlight" + anchors.fill: parent + + opacity: checked ? 1 : 0 + Behavior on opacity { + PropertyAnimation { duration: 100 } + } + } + + PlasmaCore.FrameSvgItem { + imagePath: "widgets/button" + prefix: "shadow" + anchors { + fill: button + leftMargin: -margins.left + topMargin: -margins.top + rightMargin: -margins.right + bottomMargin: -margins.bottom + } + } + + PlasmaCore.FrameSvgItem { + id: button + imagePath: "widgets/button" + prefix: "normal" + anchors { + top: parent.top + bottom: parent.bottom + } + width: height + x: checked ? width : 0 + Behavior on x { + PropertyAnimation { duration: 100 } + } + } + } +} + diff --git a/src/declarativeimports/plasmacomponents/qml/Switch.qml b/src/declarativeimports/plasmacomponents/qml/Switch.qml index d61a63d76..af3455d0c 100644 --- a/src/declarativeimports/plasmacomponents/qml/Switch.qml +++ b/src/declarativeimports/plasmacomponents/qml/Switch.qml @@ -22,64 +22,45 @@ import org.kde.plasma.core 2.0 as PlasmaCore import "private" as Private /** - * A boolean toggle button with the visual representation of a "realistic" - * switch with a movable toggle showing the state of the Switch. Generally - * easier to use on touch devices than a CheckBox due to the larger surface - * space and more evident state visualization. + * A check box is a component that can be switched on (checked) or off + * (unchecked). Check boxes are typically used to represent features in an + * application that can be enabled or disabled without affecting others, but + * different types of behavior can be implemented. When a check box is checked + * or unchecked it sends a clicked signal for the application to handle. * - * You can bind the Switch component, for example, to a feature that the - * application has to enable or disable depending on the user's input. + * When a check box has the focus, its state can be toggled using the + * Qt.Key_Select, Qt.Key_Return, and Qt.Key_Enter hardware keys that send the + * clicked signal. * * All elements of this component are defined in DualStateButton, its base component. */ Private.DualStateButton { - id: switchItem - + id: checkBox view: PlasmaCore.FrameSvgItem { - imagePath: "widgets/slider" - prefix: "groove" - width: height * 2 - height: Math.max(theme.mSize(theme.defaultFont).height + margins.top + margins.bottom, - button.margins.top + button.margins.bottom) - - PlasmaCore.FrameSvgItem { - id: highlight - imagePath: "widgets/slider" - prefix: "groove-highlight" - anchors.fill: parent + imagePath: "widgets/button" + prefix: "normal" + width: theme.mSize(theme.defaultFont).height + margins.left + height: theme.mSize(theme.defaultFont).height + margins.top + PlasmaCore.SvgItem { + svg: PlasmaCore.Svg { + id: checkmarkSvg + imagePath: "widgets/checkmarks" + } + elementId: "checkbox" opacity: checked ? 1 : 0 + anchors { + fill: parent + margins: parent.margins.left/2 + } Behavior on opacity { - PropertyAnimation { duration: 100 } - } - } - - PlasmaCore.FrameSvgItem { - imagePath: "widgets/button" - prefix: "shadow" - anchors { - fill: button - leftMargin: -margins.left - topMargin: -margins.top - rightMargin: -margins.right - bottomMargin: -margins.bottom - } - } - - PlasmaCore.FrameSvgItem { - id: button - imagePath: "widgets/button" - prefix: "normal" - anchors { - top: parent.top - bottom: parent.bottom - } - width: height - x: checked ? width : 0 - Behavior on x { - PropertyAnimation { duration: 100 } + NumberAnimation { + duration: 250 + easing.type: Easing.InOutQuad + } } } } -} + shadow: Private.ButtonShadow {} +} From a1fec8dba87db76880ce80999e24fe3703465b5f Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 5 Jun 2013 14:57:41 +0200 Subject: [PATCH 74/80] add ConfigGroup here as well --- src/shell/CMakeLists.txt | 1 + src/shell/scripting/configgroup.cpp | 187 +++++++++++++++++++++++++++ src/shell/scripting/configgroup.h | 69 ++++++++++ src/shell/scripting/scriptengine.cpp | 28 ++++ src/shell/scripting/scriptengine.h | 3 +- 5 files changed, 287 insertions(+), 1 deletion(-) create mode 100644 src/shell/scripting/configgroup.cpp create mode 100644 src/shell/scripting/configgroup.h diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt index c4529baac..4c24ec3b7 100644 --- a/src/shell/CMakeLists.txt +++ b/src/shell/CMakeLists.txt @@ -38,6 +38,7 @@ set(scripting_SRC scripting/appinterface.cpp scripting/applet.cpp scripting/containment.cpp + scripting/configgroup.cpp scripting/desktopscriptengine.cpp scripting/i18n.cpp scripting/layouttemplatepackagestructure.cpp diff --git a/src/shell/scripting/configgroup.cpp b/src/shell/scripting/configgroup.cpp new file mode 100644 index 000000000..8a81a8658 --- /dev/null +++ b/src/shell/scripting/configgroup.cpp @@ -0,0 +1,187 @@ +/* + * Copyright 2011-2012 by Sebastian Kügler + * Copyright 2013 by Aaron Seigo + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "configgroup.h" +#include +#include +#include +#include + +class ConfigGroupPrivate { + +public: + ConfigGroupPrivate(ConfigGroup *q) + : q(q), + config(0), + configGroup(0) + {} + + ~ConfigGroupPrivate() + { + delete configGroup; + } + + ConfigGroup* q; + KSharedConfigPtr config; + KConfigGroup *configGroup; + QString file; + QTimer *synchTimer; + QString group; +}; + + +ConfigGroup::ConfigGroup(QObject *parent) + : QObject(parent), + d(new ConfigGroupPrivate(this)) +{ + // Delay and compress everything within 5 seconds into one sync + d->synchTimer = new QTimer(this); + d->synchTimer->setSingleShot(true); + d->synchTimer->setInterval(1500); + connect(d->synchTimer, SIGNAL(timeout()), SLOT(sync())); +} + +ConfigGroup::~ConfigGroup() +{ + if (d->synchTimer->isActive()) { + //kDebug() << "SYNC......"; + d->synchTimer->stop(); + d->configGroup->sync(); + } + + delete d; +} + +KConfigGroup* ConfigGroup::configGroup() +{ + return d->configGroup; +} + +QString ConfigGroup::file() const +{ + return d->file; +} + +void ConfigGroup::setFile(const QString& filename) +{ + if (d->file == filename) { + return; + } + d->file = filename; + readConfigFile(); + emit fileChanged(); +} + +QString ConfigGroup::group() const +{ + return d->group; +} + +void ConfigGroup::setGroup(const QString& groupname) +{ + if (d->group == groupname) { + return; + } + d->group = groupname; + readConfigFile(); + emit groupChanged(); + emit keyListChanged(); +} + +QStringList ConfigGroup::keyList() const +{ + if (!d->configGroup) { + return QStringList(); + } + return d->configGroup->keyList(); +} + +QStringList ConfigGroup::groupList() const +{ + return d->configGroup->groupList(); +} + +bool ConfigGroup::readConfigFile() +{ + // Find parent ConfigGroup + ConfigGroup* parentGroup = 0; + QObject* current = parent(); + while (current) { + parentGroup = qobject_cast(current); + if (parentGroup) { + break; + } + current = current->parent(); + } + + delete d->configGroup; + d->configGroup = 0; + + if (parentGroup) { + d->configGroup = new KConfigGroup(parentGroup->configGroup(), d->group); + return true; + } else { + if (d->file.isEmpty()) { + kWarning() << "Could not find KConfig Parent: specify a file or parent to another ConfigGroup"; + return false; + } + d->config = KSharedConfig::openConfig(d->file); + d->configGroup = new KConfigGroup(d->config, d->group); + return true; + } +} + +// Bound methods and slots + +bool ConfigGroup::writeEntry(const QString& key, const QVariant& value) +{ + if (!d->configGroup) { + return false; + } + + d->configGroup->writeEntry(key, value); + d->synchTimer->start(); + return true; +} + +QVariant ConfigGroup::readEntry(const QString& key) +{ + if (!d->configGroup) { + return QVariant(); + } + const QVariant value = d->configGroup->readEntry(key, QVariant("")); + //kDebug() << " reading setting: " << key << value; + return value; +} + +void ConfigGroup::deleteEntry(const QString& key) +{ + d->configGroup->deleteEntry(key); +} + +void ConfigGroup::sync() +{ + if (d->configGroup) { + //kDebug() << "synching config..."; + d->configGroup->sync(); + } +} + +#include "configgroup.moc" diff --git a/src/shell/scripting/configgroup.h b/src/shell/scripting/configgroup.h new file mode 100644 index 000000000..0b910ddc2 --- /dev/null +++ b/src/shell/scripting/configgroup.h @@ -0,0 +1,69 @@ +/* + * Copyright 2011-2012 by Sebastian Kügler + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef CONFIGGROUP_H +#define CONFIGGROUP_H + +#include +#include + +class KConfigGroup; +class ConfigGroupPrivate; + +class ConfigGroup : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString file READ file WRITE setFile NOTIFY fileChanged) + Q_PROPERTY(QString group READ group WRITE setGroup NOTIFY groupChanged) + Q_PROPERTY(QStringList keyList READ keyList NOTIFY keyListChanged) + Q_PROPERTY(QStringList groupList READ groupList NOTIFY groupListChanged) + +public: + ConfigGroup(QObject* parent=0); + ~ConfigGroup(); + + KConfigGroup* configGroup(); + + QString file() const; + void setFile(const QString &filename); + QString group() const; + void setGroup(const QString &groupname); + QStringList keyList() const; + QStringList groupList() const; + + Q_INVOKABLE QVariant readEntry(const QString &key); + Q_INVOKABLE bool writeEntry(const QString &key, const QVariant &value); + Q_INVOKABLE void deleteEntry(const QString& key); + +Q_SIGNALS: + void fileChanged(); + void groupChanged(); + void keyListChanged(); + void groupListChanged(); + +private: + ConfigGroupPrivate* d; + + bool readConfigFile(); + +private Q_SLOTS: + void sync(); +}; + +#endif diff --git a/src/shell/scripting/scriptengine.cpp b/src/shell/scripting/scriptengine.cpp index e9bf365b9..a87fba29c 100644 --- a/src/shell/scripting/scriptengine.cpp +++ b/src/shell/scripting/scriptengine.cpp @@ -49,6 +49,7 @@ #include "appinterface.h" #include "containment.h" +#include "configgroup.h" #include "i18n.h" #include "layouttemplatepackagestructure.h" #include "widget.h" @@ -561,6 +562,32 @@ QScriptValue ScriptEngine::knownWallpaperPlugins(QScriptContext *context, QScrip return rv; } +QScriptValue ScriptEngine::configFile(QScriptContext *context, QScriptEngine *engine) +{ + ConfigGroup *file = 0; + + if (context->argumentCount() > 0) { + if (context->argument(0).isString()) { + file = new ConfigGroup; + file->setFile(context->argument(0).toString()); + if (context->argumentCount() > 1) { + file->setGroup(context->argument(1).toString()); + } + } else if (ConfigGroup *parent= qobject_cast(context->argument(0).toQObject())) { + file = new ConfigGroup(parent); + } + } else { + file = new ConfigGroup; + } + + QScriptValue v = engine->newQObject(file, + QScriptEngine::ScriptOwnership, + QScriptEngine::ExcludeSuperClassProperties | + QScriptEngine::ExcludeSuperClassMethods); + return v; + +} + void ScriptEngine::setupEngine() { QScriptValue v = globalObject(); @@ -588,6 +615,7 @@ void ScriptEngine::setupEngine() m_scriptSelf.setProperty("userDataPath", newFunction(ScriptEngine::userDataPath)); m_scriptSelf.setProperty("applicationPath", newFunction(ScriptEngine::applicationPath)); m_scriptSelf.setProperty("knownWallpaperPlugins", newFunction(ScriptEngine::knownWallpaperPlugins)); + m_scriptSelf.setProperty("ConfigFile", newFunction(ScriptEngine::configFile)); setGlobalObject(m_scriptSelf); } diff --git a/src/shell/scripting/scriptengine.h b/src/shell/scripting/scriptengine.h index 151e78558..ca9df28fe 100644 --- a/src/shell/scripting/scriptengine.h +++ b/src/shell/scripting/scriptengine.h @@ -79,6 +79,7 @@ private: static QScriptValue applicationPath(QScriptContext *context, QScriptEngine *engine); static QScriptValue userDataPath(QScriptContext *context, QScriptEngine *engine); static QScriptValue knownWallpaperPlugins(QScriptContext *context, QScriptEngine *engine); + static QScriptValue configFile(QScriptContext *context, QScriptEngine *engine); // helpers static QScriptValue createContainment(const QString &type, const QString &defautPlugin, @@ -92,7 +93,7 @@ private: QScriptValue m_scriptSelf; }; -static const int PLASMA_DESKTOP_SCRIPTING_VERSION = 6; +static const int PLASMA_DESKTOP_SCRIPTING_VERSION = 20; } #endif From 57fc52b3851fef6682705101f187808a13d69824 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 5 Jun 2013 15:58:51 +0200 Subject: [PATCH 75/80] forward port the cache file versioning so it drops properly in all cases --- src/plasma/private/theme_p.cpp | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index 77e7e0c66..4b8566400 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -124,16 +124,36 @@ bool ThemePrivate::useCache() ThemeConfig config; cacheSize = config.themeCacheKb(); } - pixmapCache = new KImageCache("plasma_theme_" + themeName, cacheSize * 1024); - if (themeName != systemColorsTheme) { - //check for expired cache + const bool isRegularTheme = themeName != systemColorsTheme; + QString cacheFile = "plasma_theme_" + themeName; + + if (isRegularTheme) { + const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "desktoptheme/" + themeName + "/metadata.desktop"); + const KPluginInfo pluginInfo(path); + + // now we check for, and remove if necessary, old caches + QString cacheFileBase = cacheFile + "*.kcache"; + cacheFile += "_v" + pluginInfo.version(); + const QString currentCacheFileName = cacheFile + ".kcache"; + foreach (const QString &file, QStandardPaths::locateAll(QStandardPaths::CacheLocation, cacheFileBase)) { + if (!file.endsWith(currentCacheFileName)) { + QFile::remove(file); + } + } + + } + + pixmapCache = new KImageCache(cacheFile, cacheSize * 1024); + // now we do a sanity check: if the metadata.desktop file is newer than the cache, drop + // the cache + if (isRegularTheme) { // FIXME: when using the system colors, if they change while the application is not running // the cache should be dropped; we need a way to detect system color change when the // application is not running. - QFile f(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "desktoptheme/" + themeName + "/metadata.desktop")); - QFileInfo info(f); - if (info.lastModified().toTime_t() > uint(pixmapCache->lastModifiedTime())) { - pixmapCache->clear(); + const QFile f(cacheFile); + const QFileInfo fileInfo(f); + if (fileInfo.lastModified().toTime_t() > uint(pixmapCache->lastModifiedTime())) { + discardCache(PixmapCache | SvgElementsCache); } } } From 3074728198d9d9375c61dd811450634068246790 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 5 Jun 2013 16:03:54 +0200 Subject: [PATCH 76/80] missing const --- src/plasma/private/theme_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index 4b8566400..50f5577ee 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -132,7 +132,7 @@ bool ThemePrivate::useCache() const KPluginInfo pluginInfo(path); // now we check for, and remove if necessary, old caches - QString cacheFileBase = cacheFile + "*.kcache"; + const QString cacheFileBase = cacheFile + "*.kcache"; cacheFile += "_v" + pluginInfo.version(); const QString currentCacheFileName = cacheFile + ".kcache"; foreach (const QString &file, QStandardPaths::locateAll(QStandardPaths::CacheLocation, cacheFileBase)) { From ad6f58a16ce6c3990d36e68f2e07298ac1f365eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20T=C3=A4tzner?= Date: Wed, 5 Jun 2013 19:41:58 +0200 Subject: [PATCH 77/80] Fix build error: convert qdatetime to uint --- README | 3 +-- src/plasma/private/theme_p.cpp | 2 +- src/plasma/theme.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README b/README index 139597f9c..e5b62ddbc 100644 --- a/README +++ b/README @@ -1,2 +1 @@ - - +See also: http://community.kde.org/Plasma#Plasma_Workspaces_2 \ No newline at end of file diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index 50f5577ee..f1a242bb8 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -152,7 +152,7 @@ bool ThemePrivate::useCache() // application is not running. const QFile f(cacheFile); const QFileInfo fileInfo(f); - if (fileInfo.lastModified().toTime_t() > uint(pixmapCache->lastModifiedTime())) { + if (fileInfo.lastModified().toTime_t() > uint(pixmapCache->lastModifiedTime().toTime_t())) { discardCache(PixmapCache | SvgElementsCache); } } diff --git a/src/plasma/theme.cpp b/src/plasma/theme.cpp index 60a1dec2d..cc643a499 100644 --- a/src/plasma/theme.cpp +++ b/src/plasma/theme.cpp @@ -296,7 +296,7 @@ bool Theme::useGlobalSettings() const bool Theme::findInCache(const QString &key, QPixmap &pix, unsigned int lastModified) { - if (lastModified != 0 && d->useCache() && lastModified > uint(d->pixmapCache->lastModifiedTime())) { + if (lastModified != 0 && d->useCache() && lastModified > uint(d->pixmapCache->lastModifiedTime().toTime_t())) { return false; } From 881ad505a1536a68d76b99876054fc3673cb895e Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Fri, 7 Jun 2013 03:42:19 +0000 Subject: [PATCH 78/80] SVN_SILENT made messages (.desktop file) --- desktoptheme/air/metadata.desktop | 1 + src/platformstatus/kded-platformstatus.desktop | 2 ++ 2 files changed, 3 insertions(+) diff --git a/desktoptheme/air/metadata.desktop b/desktoptheme/air/metadata.desktop index 7b3fddde5..f36aa0350 100644 --- a/desktoptheme/air/metadata.desktop +++ b/desktoptheme/air/metadata.desktop @@ -5,6 +5,7 @@ Name[de]=Air Name[es]=Aire Name[fi]=Air Name[fr]=Air +Name[gl]=Air Name[mr]=एअर Name[nl]=Air Name[pt]=Air diff --git a/src/platformstatus/kded-platformstatus.desktop b/src/platformstatus/kded-platformstatus.desktop index 8610c261d..fc90c9d66 100644 --- a/src/platformstatus/kded-platformstatus.desktop +++ b/src/platformstatus/kded-platformstatus.desktop @@ -9,6 +9,7 @@ Name=Platform Status Name[nl]=Status van platform Name[pt]=Estado da Plataforma Name[pt_BR]=Status da plataforma +Name[sk]=Stav platformy Name[sv]=Plattformstatus Name[uk]=Стан платформи Name[x-test]=xxPlatform Statusxx @@ -16,6 +17,7 @@ Comment=Tracks the current shell package and the platform definition strings. Comment[nl]=Volgt het huidige shell-pakket en de definitietekenreeksen van platform. Comment[pt]=Segue o pacote da consola actual e a os textos de definição da plataforma. Comment[pt_BR]=Segue o pacote do shell atual e as strings de definição da plataforma. +Comment[sk]=Sleduje aktuálny balík shellu a reťazce definície platformy. Comment[sv]=Följer nuvarande skalpaket och plattformens definitionssträngar Comment[uk]=Стежить за станом поточного пакунка оболонки та рядками визначення платформи. Comment[x-test]=xxTracks the current shell package and the platform definition strings.xx From 6b185d2ba426331a553f09c5cac76098c838f24a Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Sat, 8 Jun 2013 03:48:30 +0000 Subject: [PATCH 79/80] SVN_SILENT made messages (.desktop file) --- src/plasma/data/servicetypes/plasma-generic.desktop | 2 -- src/shell/qmlpackages/lookandfeel/metadata.desktop | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plasma/data/servicetypes/plasma-generic.desktop b/src/plasma/data/servicetypes/plasma-generic.desktop index 258d220ff..0db3357c7 100644 --- a/src/plasma/data/servicetypes/plasma-generic.desktop +++ b/src/plasma/data/servicetypes/plasma-generic.desktop @@ -5,7 +5,6 @@ Name=Plasma Package Name[cs]=Balíček Plasmy Name[de]=Plasma-Paket Name[fi]=Plasma-paketti -Name[fr]=Paquet Plasma Name[nl]=Plasma-pakket Name[pt]=Pacote do Plasma Name[pt_BR]=Pacote do Plasma @@ -15,7 +14,6 @@ Name[uk]=Пакунок Плазми Name[x-test]=xxPlasma Packagexx Comment=Generic Plasma Package Comment[de]=Allgemeines Plasma-Paket -Comment[fr]=Paquet générique Plasma Comment[nl]=Algemeen plasma-pakket Comment[pt]=Pacote Genérico do Plasma Comment[pt_BR]=Pacote genérico do Plasma diff --git a/src/shell/qmlpackages/lookandfeel/metadata.desktop b/src/shell/qmlpackages/lookandfeel/metadata.desktop index acc3d2110..7e3dbec0a 100644 --- a/src/shell/qmlpackages/lookandfeel/metadata.desktop +++ b/src/shell/qmlpackages/lookandfeel/metadata.desktop @@ -10,7 +10,7 @@ Comment[uk]=Мова розробки для стільниці Comment[x-test]=xxDesktop Design Languagexx Encoding=UTF-8 Keywords=Desktop, Workspace, Appearance, Look and Feel, Logout, Lock, Suspend, Shutdown, Hibernate, -Keywords[fr]=Bureau, environnement de travail, apparence, déconnexion, verrouillage, suspendre, déconnexion, veille +Keywords[fr]=Bureau,Espace de travail,Apparence,Déconnexion,Verouillage,Mise en veille,Extinction,Hibernation. Keywords[nl]=Bureaublad, werkruimte, uiterlijk, uiterlijk en gedrag, afmelden, vergrendelen, onderbreken, afsluiten, slapen, Keywords[pt]=Ecrã, Área de Trabalho, Aparência, Aparência e Comportamento, Encerrar, Bloquear, Suspender, Desligar, Hibernar, Keywords[pt_BR]=Área de trabalho, Espaço de trabalho, Aparência, Aparência e Comportamento, Encerrar sessão, Bloquear, Suspender, Desligar, Hibernar, From 9900faefa06380271a6331c1bab29903cacc2051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Tue, 11 Jun 2013 02:10:06 +0200 Subject: [PATCH 80/80] Disable all TextAreas Initializing a TextArea crashes the shell, there's a Qt bug https://bugreports.qt-project.org/browse/QTBUG-30925 filed about this. Since we now can't even build against an old-enough Qt, which doesn't suffer from this crasher, disable the textareas in our code until it's fixed. --- .../contents/ui/ButtonsPage.qml | 8 ++-- .../contents/ui/DialogContent.qml | 10 ++-- .../contents/ui/EditorPage.qml | 46 +++++++++---------- .../contents/ui/testshaderapplet.qml | 8 ++-- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/shell/applets/testcomponentsapplet/contents/ui/ButtonsPage.qml b/src/shell/applets/testcomponentsapplet/contents/ui/ButtonsPage.qml index 353c8589f..8d36b5ae7 100644 --- a/src/shell/applets/testcomponentsapplet/contents/ui/ButtonsPage.qml +++ b/src/shell/applets/testcomponentsapplet/contents/ui/ButtonsPage.qml @@ -67,10 +67,10 @@ PlasmaComponents.Page { clearButtonShown: true } } - PlasmaComponents.TextArea { - width: parent.width - height: _h*2 - } +// PlasmaComponents.TextArea { +// width: parent.width +// height: _h*2 +// } } } diff --git a/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml b/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml index 9fed86d33..e99ca467f 100644 --- a/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml +++ b/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml @@ -48,11 +48,11 @@ Item { id: localeItem anchors { left: parent.left; right: parent.right; top: tx.bottom; } } - PlasmaComponents.TextArea { - anchors { left: parent.left; right: parent.right; top: localeItem.bottom; } - width: parent.width - height: 80 - } +// PlasmaComponents.TextArea { +// anchors { left: parent.left; right: parent.right; top: localeItem.bottom; } +// width: parent.width +// height: 80 +// } PlasmaComponents.Button { id: thanks anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 24; } diff --git a/src/shell/applets/testshaderapplet/contents/ui/EditorPage.qml b/src/shell/applets/testshaderapplet/contents/ui/EditorPage.qml index f6cd29165..6a5603e97 100644 --- a/src/shell/applets/testshaderapplet/contents/ui/EditorPage.qml +++ b/src/shell/applets/testshaderapplet/contents/ui/EditorPage.qml @@ -99,30 +99,30 @@ PlasmaComponents.Page { } } - PlasmaComponents.TextArea { - id: editor - anchors { - top: heading.bottom; - topMargin: _s - left: parent.left - right: parent.right - bottom: applyButton.top - bottomMargin: _s - - } -// text: { "void main(void) {\ -// gl_FragColor = vec4(1.0, 0.0, 0.0, 0.3);\ -// }" +// PlasmaComponents.TextArea { +// id: editor +// anchors { +// top: heading.bottom; +// topMargin: _s +// left: parent.left +// right: parent.right +// bottom: applyButton.top +// bottomMargin: _s +// // } - text:" - void main(void) { - gl_FragColor = vec4(0.2, 0.8, 0.6, 0.3); - } - " - -// width: parent.width -// parent.height-height: _h*2 - } +// // text: { "void main(void) {\ +// // gl_FragColor = vec4(1.0, 0.0, 0.0, 0.3);\ +// // }" +// // } +// text:" +// void main(void) { +// gl_FragColor = vec4(0.2, 0.8, 0.6, 0.3); +// } +// " +// +// // width: parent.width +// // parent.height-height: _h*2 +// } PlasmaComponents.Button { id: applyButton diff --git a/src/shell/applets/testshaderapplet/contents/ui/testshaderapplet.qml b/src/shell/applets/testshaderapplet/contents/ui/testshaderapplet.qml index 9ab272f07..4648e0a39 100644 --- a/src/shell/applets/testshaderapplet/contents/ui/testshaderapplet.qml +++ b/src/shell/applets/testshaderapplet/contents/ui/testshaderapplet.qml @@ -50,7 +50,7 @@ Item { PlasmaComponents.TabButton { tab: wobbleExample; text: tab.pageName; } PlasmaComponents.TabButton { tab: shadowExample; text: tab.pageName; } PlasmaComponents.TabButton { tab: simpleExample; text: tab.pageName; } - PlasmaComponents.TabButton { tab: vertexPage; iconSource: vertexPage.icon; } + //PlasmaComponents.TabButton { tab: vertexPage; iconSource: vertexPage.icon; } } PlasmaComponents.TabGroup { @@ -77,9 +77,9 @@ Item { SimpleExample { id: simpleExample } - EditorPage { - id: vertexPage - } +// EditorPage { +// id: vertexPage +// } } }