[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/containments/screensaver
From:       Chani Armitage <chanika () gmail ! com>
Date:       2009-03-06 3:05:40
Message-ID: 1236308740.433347.31862.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 935737 by chani:

screensaver containment isn't pretending to be a desktop any more


 M  +25 -22    desktop.cpp  
 M  +3 -0      desktop.h  


--- trunk/KDE/kdebase/workspace/plasma/containments/screensaver/desktop.cpp \
#935736:935737 @@ -38,6 +38,8 @@
       m_lockDesktopAction(0),
       m_appletBrowserAction(0)
 {
+        setContainmentType(CustomContainment);
+        connect(this, SIGNAL(appletAdded(Plasma::Applet *, const QPointF &)), \
SLOT(newApplet(Plasma::Applet *, const QPointF &)));  }
 
 SaverDesktop::~SaverDesktop()
@@ -49,46 +51,40 @@
     Containment::init();
 
     bool unlocked = immutability() == Mutable;
-    //re-wire the lock action so we can check for a password
-    QAction *lock = action("lock widgets");
-    if (lock) {
-        lock->disconnect(this);
-        connect(lock, SIGNAL(triggered(bool)), this, SLOT(toggleLock()));
-        lock->setText(unlocked ? i18n("Lock") : i18n("Unlock"));
-    }
 
     //remove the desktop actions
-    //FIXME do we really need to removeToolBoxAction?
     QAction *unwanted = action("zoom in");
-    removeToolBoxAction(unwanted);
     delete unwanted;
     unwanted = action("zoom out");
-    removeToolBoxAction(unwanted);
     delete unwanted;
     unwanted = action("add sibling containment");
-    removeToolBoxAction(unwanted);
     delete unwanted;
 
-    lock = new QAction(unlocked ? i18n("Quit") : i18n("Unlock and Quit"), this);
-    lock->setIcon(KIcon("system-lock-screen"));
-    //TODO kbd shortcut
-    lock->setShortcutContext(Qt::WidgetShortcut);
-    lock->setShortcut(QKeySequence("esc"));
-    connect(lock, SIGNAL(triggered(bool)), this, SLOT(unlockDesktop()));
-    addAction("unlock desktop", lock);
-    addToolBoxAction(lock);
+    //the most important action ;)
+    QAction *leave = new QAction(unlocked ? i18n("Quit") : i18n("Unlock and Quit"), \
this); +    leave->setIcon(KIcon("system-lock-screen"));
+    leave->setShortcut(QKeySequence("esc"));
+    connect(leave, SIGNAL(triggered(bool)), this, SLOT(unlockDesktop()));
+    addAction("unlock desktop", leave);
+    addToolBoxAction(leave);
 
+    //re-wire the lock action so we can check for a password
+    QAction *lock = action("lock widgets");
+    if (lock) {
+        lock->disconnect(this);
+        connect(lock, SIGNAL(triggered(bool)), this, SLOT(toggleLock()));
+        lock->setText(unlocked ? i18n("Lock") : i18n("Unlock"));
+        addToolBoxAction(lock);
+    }
+
     QAction *a = action("configure");
     if (a) {
         a->setText(i18n("Settings"));
-        removeToolBoxAction(a);
         addToolBoxAction(a);
     }
 
-    //rearrange the toolboxtools
     a = action("add widgets");
     if (a) {
-        removeToolBoxAction(a);
         addToolBoxAction(a);
     }
 }
@@ -189,6 +185,13 @@
     }
 }
 
+
+void SaverDesktop::newApplet(Plasma::Applet *applet, const QPointF &pos)
+{
+    Q_UNUSED(pos);
+    applet->installSceneEventFilter(this);
+}
+
 K_EXPORT_PLASMA_APPLET(saverdesktop, SaverDesktop)
 
 #include "desktop.moc"
--- trunk/KDE/kdebase/workspace/plasma/containments/screensaver/desktop.h \
#935736:935737 @@ -57,6 +57,9 @@
     void dbusError(QDBusError error);
     void unlockDesktop();
 
+private slots:
+    void newApplet(Plasma::Applet *applet, const QPointF &pos);
+
 private:
     QAction *m_lockDesktopAction;
     QAction *m_appletBrowserAction;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic