Changeset 51ace02


Ignore:
Timestamp:
04/17/14 06:57:58 (14 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
adfee31
Parents:
ce5c3d7
Message:

A few updates to Lumina-desktop
1) Disable the "taskmanager" and "systemtray" panel plugins for now - they are not stable enough for regular use
2) Make sure that panels are actively detroyed as well as created when the settings file changes (depending on what the user settings are)
3) Add a system window for allowing the user to select system shutdown/restart as well as just logout.

Location:
lumina/lumina-desktop
Files:
3 added
7 edited

Legend:

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

    rce5c3d7 r51ace02  
    2222  settings = new QSettings(QSettings::UserScope, "LuminaDE","desktopsettings", this); 
    2323  //qDebug() << " - Desktop Settings File:" << settings->fileName(); 
    24   if(!QFile::exists(settings->fileName())){ settings->setValue(DPREFIX+"background/filelist",QStringList()<<"default"<<"sample"); settings->sync(); } 
     24  if(!QFile::exists(settings->fileName())){ settings->setValue(DPREFIX+"background/filelist",QStringList()<<"default"); settings->sync(); } 
    2525  bgtimer = new QTimer(this); 
    2626    bgtimer->setSingleShot(true); 
     
    6060  QTimer::singleShot(1,this, SLOT(UpdateDesktop()) ); 
    6161  QTimer::singleShot(1,this, SLOT(UpdatePanels()) ); 
    62   //Now send the signal on to all the panels as needed 
    63   for(int i=0; i<PANELS.length(); i++){ 
    64     QTimer::singleShot(1,PANELS[i], SLOT(UpdatePanel()) ); 
    65   } 
    6662} 
    6763 
     
    123119  int panels = settings->value(DPREFIX+"panels", 0).toInt(); 
    124120  //if(panels==0 && defaultdesktop){ panels=1; } //need at least 1 panel on the primary desktop 
     121  //Remove all extra panels 
     122  for(int i=0; i<PANELS.length(); i++){ 
     123    if(panels <= PANELS[i]->number()){ 
     124      delete PANELS.takeAt(i); 
     125      i--; 
     126    } 
     127  } 
    125128  for(int i=0; i<panels; i++){ 
    126     if(i<PANELS.length()){ 
    127       qDebug() << " -- Update panel "<< i; 
    128       //panel already exists - just update it 
    129       QTimer::singleShot(1, PANELS[i], SLOT(UpdatePanel()) ); 
    130     }else{ 
     129    //Check for a panel with this number 
     130    bool found = false; 
     131    for(int p=0; p<PANELS.length(); p++){ 
     132      if(PANELS[p]->number() == i){ 
     133        found = true; 
     134        qDebug() << " -- Update panel "<< i; 
     135        //panel already exists - just update it 
     136        QTimer::singleShot(1, PANELS[i], SLOT(UpdatePanel()) );       
     137      } 
     138    } 
     139    if(!found){ 
    131140      qDebug() << " -- Create panel "<< i; 
    132141      //New panel 
     
    134143    } 
    135144  } 
     145   
    136146   
    137147} 
     
    166176  bgWindow->show(); 
    167177  //Now reset the timer for the next change (if appropriate) 
     178  if(bgtimer->isActive()){ bgtimer->stop(); } 
    168179  if(bgL.length() > 1){ 
    169180    //get the length of the timer (in minutes) 
    170181    int min = settings->value(DPREFIX+"background/minutesToChange",5).toInt(); 
    171     //reset the internal timer 
    172     if(bgtimer->isActive()){ bgtimer->stop(); } 
    173     bgtimer->start(min*60000); //convert from minutes to milliseconds 
     182    //restart the internal timer 
     183    if(min > 0){ 
     184      bgtimer->start(min*60000); //convert from minutes to milliseconds 
     185    } 
    174186  } 
    175187} 
  • lumina/lumina-desktop/LDesktop.h

    r405554c0 r51ace02  
    3434         
    3535public slots: 
    36         void SystemLogout(){ QCoreApplication::exit(0); } 
    37         void SystemRestart(){ SYSTEM::restart(); QCoreApplication::exit(0); } 
    38         void SystemShutdown(){ SYSTEM::shutdown(); QCoreApplication::exit(0); } 
     36        void SystemLogout(){ LSession::systemWindow(); } 
     37        //void SystemRestart(){ SYSTEM::restart(); QCoreApplication::exit(0); } 
     38        //void SystemShutdown(){ SYSTEM::shutdown(); QCoreApplication::exit(0); } 
    3939        void SystemTerminal(){ QProcess::startDetached("xterm"); } 
    4040         
  • lumina/lumina-desktop/LPanel.h

    r214f3d5 r51ace02  
    4040        ~LPanel(); 
    4141 
     42        int number(){ 
     43          return PPREFIX.section(".",-1).toInt(); 
     44        } 
     45 
    4246public slots: 
    4347        void UpdatePanel();  //Load the settings file and update the panel appropriately 
  • lumina/lumina-desktop/LSession.cpp

    r214f3d5 r51ace02  
    101101  return settingsmenu; 
    102102} 
     103 
     104void LSession::systemWindow(){ 
     105  SystemWindow win; 
     106  win.exec(); 
     107} 
  • lumina/lumina-desktop/LSession.h

    r214f3d5 r51ace02  
    1717#include "AppMenu.h" 
    1818#include "SettingsMenu.h" 
     19#include "SystemWindow.h" 
    1920 
    2021//LibLumina X11 class 
     
    4041        //System Access 
    4142        static AppMenu* applicationMenu(); 
    42         static void SystemWindow(); 
     43        static void systemWindow(); 
    4344        static SettingsMenu* settingsMenu(); 
    4445         
  • lumina/lumina-desktop/lumina-desktop.pro

    r214f3d5 r51ace02  
    1515        AppMenu.cpp \ 
    1616        SettingsMenu.cpp \ 
     17        SystemWindow.cpp \ 
    1718        panel-plugins/userbutton/LUserButton.cpp \ 
    1819        panel-plugins/desktopbar/LDeskBar.cpp \ 
     
    3334        AppMenu.h \ 
    3435        SettingsMenu.h \ 
     36        SystemWindow.h \ 
    3537        panel-plugins/LPPlugin.h \ 
    3638        panel-plugins/NewPP.h \ 
     
    4951        desktop-plugins/desktopview/DeskItem.h 
    5052 
    51 FORMS    +=  
     53FORMS    += SystemWindow.ui 
    5254 
    5355RESOURCES+= Lumina-DE.qrc 
  • lumina/lumina-desktop/panel-plugins/NewPP.h

    r214f3d5 r51ace02  
    1818#include "spacer/LSpacer.h" 
    1919#include "clock/LClock.h" 
    20 #include "taskmanager/LTaskManagerPlugin.h" 
    21 #include "systemtray/LSysTray.h" //must be last due to X11 compile issues 
     20//#include "taskmanager/LTaskManagerPlugin.h" 
     21//#include "systemtray/LSysTray.h" //must be last due to X11 compile issues 
    2222 
    2323class NewPP{ 
     
    3131          }else if(plugin=="spacer"){ 
    3232            plug = new LSpacerPlugin(parent); 
    33           }else if(plugin=="taskmanager"){ 
     33          /*}else if(plugin=="taskmanager"){ 
    3434            plug = new LTaskManagerPlugin(parent); 
    3535          }else if(plugin=="systemtray"){ 
    3636            plug = new LSysTray(parent); 
     37                  */ 
    3738          }else if(plugin=="clock"){ 
    3839            plug = new LClock(parent); 
Note: See TracChangeset for help on using the changeset viewer.