Changeset d386893


Ignore:
Timestamp:
Apr 17, 2013 11:43:30 AM (12 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.1-release, 9.2-release, releng/10.0, releng/10.0.1
Children:
92b4ba0
Parents:
7639577
Message:

Get the mount-tray menu all cleaned up, and add the option to open up a settings window (settings dialog not implemented yet)

Location:
src-qt4/pc-mounttray
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-mounttray/mountTray.cpp

    rbb6089a rd386893  
    2424  trayIcon = new QSystemTrayIcon(this); 
    2525  trayIconMenu = new QMenu(); 
    26          
     26  //Generate the system menu options (these don't change) 
     27  sysMenu = new QMenu( tr("More Options") ); 
     28    sysMenu->setIcon( QIcon(":icons/config.png") ); 
     29    //Add the additional options 
     30    sysMenu->addAction( QIcon(":icons/folder.png"), tr("Open Media Directory"), this, SLOT(slotOpenMediaDir()) ); 
     31    sysMenu->addAction( QIcon(":icons/harddrive.png"), tr("View Disk Usage"),this,SLOT(slotOpenFSDialog()) ); 
     32    sysMenu->addAction( QIcon(":icons/refresh.png"),tr("Rescan Devices"), this, SLOT(slotRescan()) ); 
     33    //Add the setting dialog option seperately 
     34    sysMenu->addSeparator(); 
     35    sysMenu->addAction( QIcon(":icons/config.png"), tr("Settings"), this, SLOT(slotOpenSettings()) ); 
     36    //Add the Close button seperately 
     37    sysMenu->addSeparator(); 
     38    sysMenu->addAction( QIcon(":icons/application-exit.png"), tr("Close Tray"), this, SLOT(closeTray()) ); 
     39   
    2740  // Tie the left-click signal to open the context menu 
    2841  connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(slotTrayActivated(QSystemTrayIcon::ActivationReason)) ); 
     
    7689  //Separate the extra options at the end 
    7790  trayIconMenu->addSeparator(); 
    78   //Add the "open media" entry to the list 
    79   trayIconMenu->addAction( QIcon(":icons/folder.png"), tr("Open Media Directory"), this, SLOT(slotOpenMediaDir()) ); 
    80   trayIconMenu->addSeparator(); 
    81   trayIconMenu->addAction( QIcon(":icons/folder.png"), tr("Current Disk Usage"),this,SLOT(slotOpenFSDialog()) ); 
    82   trayIconMenu->addAction( QIcon(":icons/refresh.png"),tr("Rescan Devices"), this, SLOT(slotRescan()) ); 
    83   //Add the "close tray" entry to the list 
    84   trayIconMenu->addAction( QIcon(":icons/application-exit.png"), tr("Close Tray"), this, SLOT(closeTray()) ); 
    85    
     91  trayIconMenu->addMenu(sysMenu); 
    8692  //Apply the menu to the Tray 
    8793  trayIcon->setContextMenu(trayIconMenu); 
     
    337343 
    338344void MountTray::slotOpenFSDialog(){ 
    339   //Open up the Filsystem disk space monitoring dialog 
     345  //Open up the Filesystem disk space monitoring dialog 
    340346  diskDisplay = new FSDialog(); 
    341347  diskDisplay->show(); 
     348} 
     349 
     350void MountTray::slotOpenSettings(){ 
     351  //Open up the settings window and apply changes as necessary 
     352  qDebug() << "Settings window not implemented yet"; 
    342353} 
    343354 
  • src-qt4/pc-mounttray/mountTray.h

    rbb6089a rd386893  
    4848  void slotRescan(); 
    4949  void slotOpenFSDialog(); 
     50  void slotOpenSettings(); 
    5051   
    5152private: 
     
    5657  int numMount, numAvail; 
    5758  QSystemTrayIcon* trayIcon; 
    58   QMenu* trayIconMenu; 
     59  QMenu *trayIconMenu, *sysMenu; 
    5960  QList<MenuItem*> deviceList; 
    6061  QStringList oldsysdev; 
  • src-qt4/pc-mounttray/pc-mounttray.qrc

    r1620346 rd386893  
    1313    <file>icons/harddrive.png</file> 
    1414    <file>icons/refresh.png</file> 
     15    <file>icons/config.png</file> 
    1516  </qresource> 
    1617</RCC> 
Note: See TracChangeset for help on using the changeset viewer.