Changeset 307712c


Ignore:
Timestamp:
04/19/14 06:09:18 (5 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.2, releng/10.0.3
Children:
779b7c0, 6c9f62c
Parents:
3879a03
Message:

Enable a default Lumina panel on the top of the screen, including a userbutton, desktopbar, spacer, and clock.
Also disable the clock on the fluxbox bar at the bottom by default (unless the user has run lumina previously, and also disable the desktopview desktop plugin by default.

Location:
lumina/lumina-desktop
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • lumina/lumina-desktop/LDesktop.cpp

    r3245f24 r307712c  
    7878  qDebug() << " - Update Desktop:" << desktopnumber; 
    7979  QStringList plugins = settings->value(DPREFIX+"pluginlist", QStringList()).toStringList(); 
    80   if(defaultdesktop && plugins.isEmpty()){ 
     80  /*if(defaultdesktop && plugins.isEmpty()){ 
    8181    plugins << "desktopview"; 
    82   } 
     82  }*/ 
    8383  for(int i=0; i<plugins.length(); i++){ 
    8484    //See if this plugin is already there 
     
    117117void LDesktop::UpdatePanels(){ 
    118118  qDebug() << " - Update Panels:" << desktopnumber; 
    119   int panels = settings->value(DPREFIX+"panels", 0).toInt(); 
    120   //if(panels==0 && defaultdesktop){ panels=1; } //need at least 1 panel on the primary desktop 
     119  int panels = settings->value(DPREFIX+"panels", -1).toInt(); 
     120  if(panels==-1 && defaultdesktop){ panels=1; } //need at least 1 panel on the primary desktop 
    121121  //Remove all extra panels 
    122122  for(int i=0; i<PANELS.length(); i++){ 
  • lumina/lumina-desktop/LPanel.cpp

    rce5c3d7 r307712c  
    5050  if(loc.isEmpty() && defaultpanel){ loc="top"; } 
    5151  int ht = settings->value(PPREFIX+"height", 22).toInt(); 
     52  int xoffset=0; 
     53  for(int i=0; i<screennum; i++){ 
     54    xoffset = xoffset + screen->screenGeometry(i).width(); 
     55  } 
    5256  qDebug() << " - set Geometry"; 
    5357  if(loc=="top"){ 
    54     this->setGeometry(0,0,screen->screenGeometry(screennum).width(), ht ); 
    55     LX11::ReservePanelLocation(this->winId(), 0, 0, this->width(), ht); 
     58    this->setGeometry(xoffset,0,screen->screenGeometry(screennum).width(), ht ); 
     59    LX11::ReservePanelLocation(this->winId(), xoffset, 0, this->width(), ht+2); 
    5660  }else{ 
    57     this->setGeometry(0,screen->screenGeometry(screennum).height()-ht,screen->screenGeometry(screennum).width(), ht ); 
    58     LX11::ReservePanelLocation(this->winId(), 0, screen->screenGeometry(screennum).height()-ht, this->width(), ht); 
     61    this->setGeometry(xoffset,screen->screenGeometry(screennum).height()-ht,screen->screenGeometry(screennum).width(), ht ); 
     62    LX11::ReservePanelLocation(this->winId(), xoffset, screen->screenGeometry(screennum).height()-ht, this->width(), ht+2); 
    5963  } 
    6064  //Then go through the plugins and create them as necessary 
    6165  QStringList plugins = settings->value(PPREFIX+"pluginlist", QStringList()).toStringList(); 
    6266  if(defaultpanel && plugins.isEmpty()){ 
    63     plugins << "userbutton" << "desktopbar" << "taskmanager" << "spacer"  << "systemtray" << "clock"; 
     67    plugins << "userbutton" << "desktopbar" << "spacer" << "clock"; 
    6468  }else if(defaultpanel && !plugins.contains("userbutton") ){ 
    6569    plugins.prepend("userbutton"); //make sure we have this button since that lets the user logout 
  • lumina/lumina-desktop/LPanel.h

    r51ace02 r307712c  
    5050 
    5151protected: 
    52         void moveEvent(QMoveEvent *event){ 
     52        /*void moveEvent(QMoveEvent *event){ 
    5353          QPoint pt; 
    5454          if(settings->value(PPREFIX+"location","top").toString()=="top"){ pt = QPoint(0,0); } 
     
    5757            this->move(pt.x(), pt.y()); //In case the WM does not keep it in the proper place 
    5858          } 
    59         } 
     59        }*/ 
    6060}; 
    6161 
  • lumina/lumina-desktop/fluxboxconf/fluxbox-init-rc

    r214f3d5 r307712c  
    1515session.screen0.toolbar.layer:  Dock 
    1616session.screen0.toolbar.height: 0 
    17 session.screen0.toolbar.tools:  prevworkspace, workspacename, nextworkspace, iconbar, systemtray, clock 
     17session.screen0.toolbar.tools:  prevworkspace, workspacename, nextworkspace, iconbar, systemtray 
    1818session.screen0.iconbar.iconWidth:      128 
    1919session.screen0.iconbar.alignment:      Left 
  • lumina/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp

    r214f3d5 r307712c  
    4141// ======================= 
    4242void LDeskBarPlugin::initializeDesktop(){ 
    43   /*layout = new QHBoxLayout(); 
    44     layout->setContentsMargins(0,0,0,0); 
    45     layout->setSpacing(2); 
    46     layout->setAlignment(Qt::AlignCenter); 
    47   this->setLayout(layout);*/ 
    4843  //Applications on the desktop 
    4944  appB = new LTBWidget(this); 
    50     //connect(appB, SIGNAL(clicked()), appB, SLOT(showMenu()) ); 
    51     //connect(appB, SIGNAL(longClicked()), appB, SLOT(showMenu()) ) ; 
    5245    appB->setIcon( LXDG::findIcon("favorites", ":/images/default-favorite.png") ); 
    5346  appM = new QMenu(this); 
     
    5750  //Directories on the desktop 
    5851  dirB = new LTBWidget(this); 
    59     //connect(dirB, SIGNAL(clicked()), dirB, SLOT(showMenu()) ); 
    60     //connect(dirB, SIGNAL(longClicked()), dirB, SLOT(showMenu()) ); 
    6152    dirB->setIcon( LXDG::findIcon("folder", ":/images/default-dir.png") ); 
    6253  dirM = new QMenu(this); 
     
    8273  //All Files Button 
    8374  fileB = new LTBWidget(this); 
    84     //connect(fileB, SIGNAL(clicked()), fileB, SLOT(showMenu()) ); 
    85     //connect(fileB, SIGNAL(longClicked()), fileB, SLOT(showMenu()) ); 
    8675    fileB->setIcon( LXDG::findIcon("user-desktop", ":/images/default-file.png") ); 
    8776  fileM = new QMenu(this); 
     
    144133      // - Now re-create the menu with the apps 
    145134      appM->clear(); 
     135      bool listApps = true; //turn this off for the moment (make dynamic later) 
     136      if(!listApps){ 
     137        //go through the current items and remove them all 
     138        while( APPLIST.length() > 0){ 
     139          delete this->layout()->takeAt(3); //always after the 3 main menu buttons 
     140        } 
     141      } 
    146142      for(int i=0; i<exeList.length(); i++){ 
    147         appM->addAction( newAction(exeList[i].filePath, exeList[i].name, LXDG::findIcon(exeList[i].icon, ":/images/default-application.png")) ); 
     143        if(listApps){ appM->addAction( newAction(exeList[i].filePath, exeList[i].name, LXDG::findIcon(exeList[i].icon, ":/images/default-application.png")) ); } 
     144        else{ 
     145          //Create a new LTBWidget for this app 
     146          LTBWidget *it = new LTBWidget(this); 
     147                it->setWhatsThis(exeList[i].filePath); 
     148                it->setToolTip(exeList[i].name); 
     149                it->setIcon( LXDG::findIcon(exeList[i].icon, ":/images/default-application.png") ); 
     150                connect(it, SIGNAL(triggered(QAction*)), this , SLOT(ActionTriggered(QAction*)) ); 
     151          APPLIST << it; 
     152          this->layout()->addWidget(it); 
     153        } 
    148154      } 
    149155    //Now update the other menu with everything else that is left 
  • lumina/lumina-desktop/panel-plugins/desktopbar/LDeskBar.h

    r214f3d5 r307712c  
    4646        QStringList audioFilter, videoFilter, pictureFilter; 
    4747        QFileInfoList totals; 
    48         //QList<QToolButton*> exeList; 
     48        QList<LTBWidget*> APPLIST; 
    4949         
    5050        void initializeDesktop(); 
     
    5353        QAction* newAction(QString filepath, QString name, QString iconpath); 
    5454        QAction* newAction(QString filepath, QString name, QIcon icon); 
    55         //QToolButton* newLauncher(QString filepath, QString name, QString iconpath); 
     55 
    5656        void updateMenu(QMenu* menu, QFileInfoList files, bool trim = true); 
    57         //bool searchForExe(QString filename); 
     57 
    5858         
    5959private slots: 
  • lumina/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp

    r214f3d5 r307712c  
    99LUserButton::LUserButton(QWidget *parent) : LTBWidget(parent){ 
    1010  //Initialize the submenu's 
    11   appMenu = LSession::applicationMenu(); 
    12   closeMenu = new QMenu(this); 
    1311  //Initialize the main menu 
    1412  mainMenu = new QMenu(this); 
     
    1816        homedir->setSorting(QDir::Name | QDir::LocaleAware); 
    1917  //Initialize the settings 
    20   settings = new QSettings("Lumina-DE", "UserButton"); 
     18  settings = new QSettings("LuminaDE", "UserButton"); 
    2119 
    2220  //Setup the button icon/text 
     
    4240  mainMenu->clear(); 
    4341    //add the app menu 
    44     mainMenu->addMenu(appMenu); 
     42    mainMenu->addMenu( LSession::applicationMenu() ); 
    4543    mainMenu->addSeparator(); 
    4644    //Now add the home directory 
     
    7573      mainMenu->addAction(act); 
    7674    } 
     75     
     76    //Now add the settings menu 
    7777    mainMenu->addSeparator(); 
    78     //Now add the settings menu 
    7978    mainMenu->addMenu(LSession::settingsMenu()); 
    8079     
    8180    //Now add the close menu 
    8281    // -- rebuild it in case the icon theme has changed 
    83     closeMenu->clear(); 
     82    mainMenu->addSeparator(); 
     83    mainMenu->addAction( LXDG::findIcon("system-log-out",":/images/user-logout.png"), tr("Logout"), this, SLOT(Logout()) ); 
     84    /*closeMenu->clear(); 
    8485      closeMenu->setIcon( LXDG::findIcon("system-run", ":/images/default-shutdown.png") ); 
    8586      closeMenu->setTitle( tr("System") ); 
     
    8788      closeMenu->addAction( LXDG::findIcon("system-reboot",":/images/system-restart.png"), tr("Restart"), this, SLOT(Restart()) ); 
    8889      closeMenu->addAction( LXDG::findIcon("system-shutdown",":/images/system-shutdown.png"), tr("Shutdown"), this, SLOT(Shutdown()) ); 
    89     mainMenu->addMenu(closeMenu); 
     90    mainMenu->addMenu(closeMenu);*/ 
    9091} 
    9192 
     
    9899// =============== 
    99100void LUserButton::Logout(){ 
    100   QCoreApplication::exit(0); 
     101  //QCoreApplication::exit(0); 
     102  LSession::systemWindow(); 
    101103} 
    102104 
    103 void LUserButton::Restart(){ 
     105/*void LUserButton::Restart(){ 
    104106  SYSTEM::restart(); 
    105107  QCoreApplication::exit(0); 
     
    109111  SYSTEM::shutdown(); 
    110112  QCoreApplication::exit(0); 
    111 } 
     113}*/ 
  • lumina/lumina-desktop/panel-plugins/userbutton/LUserButton.h

    r214f3d5 r307712c  
    3636 
    3737private: 
    38         AppMenu *appMenu; //System Applications submenu 
    3938        QDir *homedir; 
    40         QMenu *closeMenu; //Lumina Close Submenu 
    4139        QMenu *mainMenu;  
    4240        QSettings *settings; 
     
    5856         
    5957        void Logout(); 
    60         void Restart(); 
    61         void Shutdown(); 
     58        //void Restart(); 
     59        //void Shutdown(); 
    6260}; 
    6361 
Note: See TracChangeset for help on using the changeset viewer.