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

List:       kde-commits
Subject:    playground/base/blazer [POSSIBLY UNSAFE]
From:       Ian Reinhart Geiser <geiseri () kde ! org>
Date:       2009-02-12 16:55:44
Message-ID: 1234457744.100705.4726.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 925176 by geiseri:

Added an attempt at a launcher bar, as well as more dualscreen fixes.  Need to be \
able to enable disable the control because its mainly for power users and not normal \
users.

 M  +1 -0      CMakeLists.txt  
 M  +3 -1      applicationmenu.cpp  
 M  +10 -8     blazer.pro  
 M  +5 -1      launcher.cpp  
 A             launcherbar.cpp   [POSSIBLY UNSAFE: KRun::runCommand] [License: GPL \
(v2+) (wrong address)]  A             launcherbar.h   [License: GPL (v2+) (wrong \
address)]  M  +4 -2      launcherbutton.cpp  
 M  +6 -0      styles.css  
 M  +11 -9     topbar.cpp  
 M  +2 -0      topbar.h  


--- trunk/playground/base/blazer/CMakeLists.txt #925175:925176
@@ -22,6 +22,7 @@
     mediabutton.cpp
     mediamenu.cpp
     pager.cpp
+    launcherbar.cpp
  )
 
 QT4_ADD_RESOURCES(blazer_SRCS blazer.qrc)
--- trunk/playground/base/blazer/applicationmenu.cpp #925175:925176
@@ -38,8 +38,9 @@
 {
   if (!group || !group->isValid()) return;
 
+  group->setShowEmptyMenu(false);
   // Iterate over all entries in the group
-  foreach( const KSharedPtr<KSycocaEntry> p, group->entries(true, true))
+  foreach( const KSharedPtr<KSycocaEntry> p, group->entries(true, true, false, \
true))  {
     if (p->isType(KST_KService))
     {
@@ -61,6 +62,7 @@
     else if (p->isType(KST_KServiceGroup))
     {
       KSharedPtr<KServiceGroup> g = KSharedPtr<KServiceGroup>::staticCast(p);
+      g->setShowEmptyMenu(false);
       if( g->entries(true,true).count() != 0 )
       {
           KMenu *menu = new KMenu(parentMenu);
--- trunk/playground/base/blazer/blazer.pro #925175:925176
@@ -2,7 +2,8 @@
 TARGET = blazer
 QT += dbus
 DEPENDPATH += .
-INCLUDEPATH += . $$system(kde-config --prefix)/include
+INCLUDEPATH += . \
+    $$system(kde-config --prefix)/include
 QMAKE_LIBDIR += $$system(kde-config --prefix)/lib
 LIBS += -lkdecore \
     -lkdeui \
@@ -24,7 +25,8 @@
     topbar.cpp \
     mediabutton.cpp \
     mediamenu.cpp \
-    pager.cpp
+    pager.cpp \
+    launcherbar.cpp
 CONFIG += rpath_libdirs
 HEADERS += taskmanagerwidget.h \
     taskitembutton.h \
@@ -37,18 +39,18 @@
     topbar.h \
     mediabutton.h \
     mediamenu.h \
-    pager.h
+    pager.h \
+    launcherbar.h
 FORMS += launcher.ui
 RESOURCES += blazer.qrc
 target.path += $$system(kde-config --prefix)/bin
-
 autostart.files = blazer.desktop
 autostart.path = $$system(kde-config --prefix)/share/autostart
-
 profile.files = default.profile
 profile.path = $$system(kde4-config --install data)/blazer/profiles
-
 stylesheet.files = styles.css
 stylesheet.path = $$system(kde4-config --install data)/blazer
-
-INSTALLS += target autostart profile stylesheet
+INSTALLS += target \
+    autostart \
+    profile \
+    stylesheet
--- trunk/playground/base/blazer/launcher.cpp #925175:925176
@@ -36,6 +36,7 @@
 #include <KDE/KPageWidgetItem>
 #include <KDE/KDirWatch>
 #include <KDE/KMimeType>
+#include <KDE/KApplication>
 
 #include <QDir>
 #include <QFileInfo>
@@ -162,13 +163,16 @@
 
 void Launcher::setupShortcuts()
 {
+
     configureButtonFromDesktopFile( m_ui->webSelection, QLatin1String("konqbrowser") \
                );
     configureButtonFromDesktopFile( m_ui->emailSelection, QLatin1String("Kontact") \
                );
     configureButtonFromDesktopFile( m_ui->imSelection, QLatin1String("kopete") );
     configureButtonFromDesktopFile( m_ui->settings, QLatin1String("systemsettings") \
);  
+    KConfigGroup paths = KGlobal::config()->group(QLatin1String("Paths"));
+    QString documentsDirectory = paths.readEntry( QLatin1String("Documents"), \
QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation) );  \
                m_ui->documents->setIcon( KIcon("folder.png") );
-    m_ui->documents->setDesktopStartUrl( \
QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation) ); +    \
                m_ui->documents->setDesktopStartUrl( documentsDirectory );
     connect( m_ui->documents, SIGNAL(activated(int)), this, SIGNAL(popupDone(int)));
 }
 
--- trunk/playground/base/blazer/launcherbutton.cpp #925175:925176
@@ -24,7 +24,10 @@
 #include <KDE/KPopupFrame>
 #include <KDE/KIcon>
 #include <KDE/KLocale>
+#include <KDE/KApplication>
 
+#include <QDesktopWidget>
+
 LauncherButton::LauncherButton( QWidget *parent ) : KPushButton(parent)
 {
     setIcon(KIcon("start-here-kde"));
@@ -50,7 +53,6 @@
 {
     m_launcher->adjustSize();
     m_launcherMenu->adjustSize();
-
-    m_launcherMenu->exec( x(), height() + y() );
+    m_launcherMenu->exec( QApplication::desktop()->screenGeometry(this).x() + x(), \
height() + y() );  }
 
--- trunk/playground/base/blazer/styles.css #925175:925176
@@ -21,3 +21,9 @@
     border-style: outset;
     border-color: palette(midlight);
 }
+
+#SystemTray {
+   margin-left: 5px;
+   margin-right: 5px;
+}
+
--- trunk/playground/base/blazer/topbar.cpp #925175:925176
@@ -25,6 +25,7 @@
 #include "mediabutton.h"
 #include "taskmanagerwidget.h"
 #include "pager.h"
+#include "launcherbar.h"
 
 #include <kdebug.h>
 
@@ -36,7 +37,7 @@
 
 #include <KDE/KWindowSystem>
 
-TopBar::TopBar( QWidget *parent ) : QFrame( parent)
+TopBar::TopBar( QWidget *parent ) : QFrame( parent, Qt::FramelessWindowHint)
 {
     setObjectName("TopPanel");
 
@@ -52,36 +53,37 @@
     m_media = new MediaButton(this);
     m_media->setObjectName("MediaButton");
 
-    QWidget *spacer = new QWidget(this);
+    m_launcher = new LauncherBar(this);
 
 
     QHBoxLayout *layout = new QHBoxLayout(this);
     layout->addWidget(m_button);
     layout->addWidget(m_media);
-    layout->addWidget(spacer, 1);
+    layout->addWidget(m_launcher, 1);
     layout->addWidget(m_tray);
     layout->addWidget(m_clock);
     layout->setSpacing(0);
     layout->setMargin(0);
 
-    KWindowSystem::setType( winId(), NET::Dock );
+    //FIXME: KWindowSystem::setType( winId(), NET::Dock ); <- why cant i get focus \
here +    KWindowSystem::setState( winId(), NET::Sticky | NET::KeepAbove | \
NET::SkipTaskbar| NET::SkipPager );  KWindowSystem::setOnAllDesktops( winId(), true \
);  }
 
 void TopBar::slotDesktopResized ( int screen, int panelSize )
 {
-    if( screen == 0 )
+    if( screen == QApplication::desktop()->primaryScreen() )
     {
         QRect screenGeometry = \
QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen());  \
                int screenWidth = screenGeometry.width();
-	setGeometry(screenGeometry.x(), screenGeometry.y(), screenWidth, panelSize );
-   
+
         setFixedSize( screenWidth, panelSize );
         // FIXME: make this work on dual head.
         KWindowSystem::setExtendedStrut( winId(), 0, 0, 0, 
                                                   0, 0, 0, 
                                                   panelSize, screenGeometry.x(), \
screenGeometry.x() + screenWidth - 1,  0, 0, 0);
+        setGeometry(screenGeometry.x(), screenGeometry.y(), screenWidth, panelSize \
);  }
 }
 
@@ -104,13 +106,13 @@
     layout->setMargin(1);
 
     KWindowSystem::setType( winId(), NET::Dock );
-    KWindowSystem::setState( winId(), NET::Sticky );
+    KWindowSystem::setState( winId(), NET::Sticky | NET::KeepAbove | NET::SkipPager \
| NET::SkipPager );  KWindowSystem::setOnAllDesktops( winId(), true );
 }
 
 void BottomBar::slotDesktopResized ( int screen, int panelSize )
 {
-    if( screen == 0 )
+    if( screen == QApplication::desktop()->primaryScreen() )
     {
         QRect screenGeometry = \
QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen());  \
                int screenWidth = screenGeometry.width();
--- trunk/playground/base/blazer/topbar.h #925175:925176
@@ -30,6 +30,7 @@
 class SystemButton;
 class TaskManagerWidget;
 class Pager;
+class LauncherBar;
 
 class TopBar : public QFrame
 {
@@ -48,6 +49,7 @@
         LauncherButton *m_button;
         MediaButton *m_media;
         SystemButton *m_system;
+        LauncherBar *m_launcher;
 };
 
 class BottomBar : public QFrame


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

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