LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File plasma-branding-defaults.diff of Package kdebase4-workspace (Project DISCONTINUED:openSUSE:11.2)

--- plasma/applets/kickoff/applet/applet.cpp
+++ plasma/applets/kickoff/applet/applet.cpp
@@ -28,6 +28,7 @@
 #include <QtGui/QVBoxLayout>
 #include <QtGui/QLabel>
 #include <QtGui/QGraphicsLinearLayout>
+#include <QFile>
 
 // KDE
 #include <KIcon>
@@ -106,7 +107,10 @@
 void LauncherApplet::init()
 {
     KConfigGroup cg = config();
-    setPopupIcon(cg.readEntry("icon", "start-here-kde"));
+    if (QFile::exists("/usr/share/icons/oxygen/scalable/places/start-here-branding.svg"))
+      setPopupIcon(cg.readEntry("icon", "start-here-branding"));
+    else
+      setPopupIcon(cg.readEntry("icon", "start-here-kde"));
 
     if (KService::serviceByStorageId("kde4-kmenuedit.desktop")) {
         QAction* menueditor = new QAction(i18n("Menu Editor"), this);
--- plasma/applets/kickoff/core/favoritesmodel.cpp
+++ plasma/applets/kickoff/core/favoritesmodel.cpp
@@ -167,6 +167,11 @@
 
 void FavoritesModel::add(const QString& url)
 {
+    KService::Ptr service = KService::serviceByStorageId(url);
+    if (!service) {
+        return;
+    }
+
     Private::globalFavoriteList << url;
     Private::globalFavoriteSet << url;
 
--- plasma/applets/kickoff/core/models.cpp
+++ plasma/applets/kickoff/core/models.cpp
@@ -165,7 +165,19 @@
 {
     KConfigGroup appsGroup = componentData().config()->group("SystemApplications");
     QStringList apps;
-    apps << "systemsettings";
+
+    if (QFile::exists("/usr/share/applications/YaST.desktop"))
+        apps << "YaST.desktop";
+
+    if (QFile::exists("/usr/share/applications/package-manager.desktop"))
+        apps << "package-manager.desktop";
+
+    if (KService::serviceByStorageId("YaST2/live-installer.desktop"))
+        apps << "YaST2/live-installer.desktop";
+
+    if (QFile::exists("/usr/share/kde4/services/sysinfo.protocol"))
+        apps << "/usr/share/kde4/services/sysinfo.protocol";
+
     apps = appsGroup.readEntry("DesktopFiles", apps);
     return apps;
 }
--- plasma/applets/kickoff/core/systemmodel.cpp
+++ plasma/applets/kickoff/core/systemmodel.cpp
@@ -85,7 +85,7 @@
         connect(placesModel, SIGNAL(rowsRemoved(QModelIndex, int, int)),
                 q, SLOT(sourceRowsRemoved(QModelIndex, int, int)));
 
-        topLevelSections << i18n("Applications")
+        topLevelSections << i18n("Administration")
         << i18n("Places")
         << i18n("Removable Storage")
         << i18n("Storage");
@@ -259,18 +259,33 @@
 
         KService::Ptr service = d->appsList[index.row()];
 
-        switch (role) {
-        case Qt::DisplayRole:
-            return service->name();
-        case Qt::DecorationRole:
-            return KIcon(service->icon());
-        case SubTitleRole:
-            return service->genericName();
-        case UrlRole:
-            return service->entryPath();
-        default:
-            return QVariant();
-        }
+        if (service->name()=="sysinfo") {
+           switch(role) {
+           case Qt::DisplayRole:
+               return i18n("System Information");
+           case Qt::DecorationRole:
+               return KIcon("hwinfo");
+           case SubTitleRole:
+               return "sysinfo:/";
+           case UrlRole:
+               return "sysinfo:/";
+           default:
+               return QVariant();
+           }
+        } else {
+           switch(role) {
+           case Qt::DisplayRole:
+               return service->name();
+           case Qt::DecorationRole:
+               return KIcon(service->icon());
+           case SubTitleRole:
+               return service->genericName();
+           case UrlRole:
+               return service->entryPath();
+           default:
+                return QVariant();
+           }
+       }
     }
 
     if (role == UrlRole && !d->placesModel->isHidden(mapToSource(index))) {
--- plasma/applets/kickoff/simpleapplet/simpleapplet.cpp
+++ plasma/applets/kickoff/simpleapplet/simpleapplet.cpp
@@ -37,6 +37,7 @@
 #include <QtGui/QSpacerItem>
 #include <QtGui/QListWidget>
 #include <QtGui/QListWidgetItem>
+#include <QFile>
 
 // KDE
 #include <KIcon>
@@ -284,7 +285,11 @@
 void MenuLauncherApplet::init()
 {
     KConfigGroup cg = config();
-    QString iconname = "start-here-kde";
+    QString iconname;
+    if (QFile::exists("/usr/share/icons/oxygen/scalable/places/start-here-branding.svg"))
+        iconname = "start-here-branding";
+    else
+        iconname = "start-here-kde";
 
     QStringList viewtypes = cg.readEntry("views", QStringList());
     if(viewtypes.isEmpty()) { // backward-compatibility to <KDE4.3
--- plasma/applets/kickoff/ui/brandingbutton.cpp
+++ plasma/applets/kickoff/ui/brandingbutton.cpp
@@ -68,8 +68,10 @@
 
 void BrandingButton::openHomepage()
 {
-    //FIXME: 4.3 .. add a brandingConfig to Theme
-    KUrl home("http://www.kde.org");
+    KConfig config("kickoffrc");
+    KConfigGroup group = config.group("Branding");
+    KUrl home(group.readEntry("Homepage", "http://www.kde.org/"));
+
     QString themePath = KStandardDirs::locate("data", "desktoptheme/" +
                                               Plasma::Theme::defaultTheme()->themeName() +
                                               "/metadata.desktop");
--- plasma/shells/desktop/desktopcorona.cpp
+++ plasma/shells/desktop/desktopcorona.cpp
@@ -23,6 +23,7 @@
 #include <QDir>
 #include <QGraphicsLayout>
 #include <QTimer>
+#include <QFile>
 
 #include <KDebug>
 #include <KDialog>
@@ -121,7 +122,9 @@
     if (!c) {
         // first try for "desktop", if it doesn't exist then we try for any 
         // desktopy containment
-        c = addContainment("desktop");
+        KSharedConfigPtr defaultconfig = KSharedConfig::openConfig("plasma-desktoprc");
+        KConfigGroup group = KConfigGroup(defaultconfig, "Defaults");
+        c = addContainment(group.readEntry("containment", "desktop"));
 
         if (!c) {
             KPluginInfo::List desktopPlugins = Plasma::Containment::listContainmentsOfType("desktop");
@@ -254,6 +257,25 @@
         applet->setGlobalShortcut(KShortcut("Alt+F1"));
     }
 
+    if (QFile::exists("/usr/share/kde4/services/plasma-applet-showdashboard.desktop"))
+        loadDefaultApplet("showdashboard", panel);
+
+    QVariantList args;
+    if (QFile::exists("/usr/share/applications/MozillaFirefox.desktop")) {
+        args << "/usr/share/applications/MozillaFirefox.desktop";
+        panel->addApplet("icon", args);
+    }
+    else if (QFile::exists("/usr/share/applications/kde4/konqbrowser.desktop")) {
+        args << "/usr/share/applications/kde4/konqbrowser.desktop";
+        panel->addApplet("icon", args);
+    }
+
+    args.clear();
+    if (QFile::exists("/usr/share/applications/kde4/dolphin.desktop")) {
+        args << "/usr/share/applications/kde4/dolphin.desktop";
+        panel->addApplet("icon", args);
+    }
+
     loadDefaultApplet("notifier", panel);
     loadDefaultApplet("pager", panel);
     loadDefaultApplet("tasks", panel);
@@ -269,7 +291,13 @@
     }
     engines->unloadEngine("powermanagement");
 
+    if (QFile::exists("/usr/share/kde4/services/plasma-applet-networkmanagement.desktop")) {
+       loadDefaultApplet("networkmanagement", panel);
+    }
+
     loadDefaultApplet("digital-clock", panel);
+    loadDefaultApplet("lockout", panel);
+
     emit containmentAdded(panel);
 
     QTimer::singleShot(1000, this, SLOT(saveDefaultSetup()));