Changeset 64ba4c0


Ignore:
Timestamp:
06/25/14 05:33:11 (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
9df8b13
Parents:
1506c22
Message:

Quick update tot he desktop bar panel plugin:
1) Make sure it properly opens files that have spaces in the filename.
2) Add "Documents" filtering category (things like *.txt, *.doc, *.pdf, etc..)

Location:
lumina/lumina-desktop/panel-plugins/desktopbar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lumina/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp

    r307712c r64ba4c0  
    1616  videoFilter <<"*.3g2"<<"*.3gp"<<"*.asf"<<"*.asx"<<"*.avi"<<"*.flv"<<"*.m4v"<<"*.mov"<<"*.mp4"<<"*.mpg"<<"*.rm"<<"*.srt"<<"*.swf"<<"*.vob"<<"*.wmv"; 
    1717  pictureFilter <<"*.bmp"<<"*.dds"<<"*.gif"<<"*.jpg"<<"*.png"<<"*.psd"<<"*.thm"<<"*.tif"<<"*.tiff"<<"*.ai"<<"*.eps"<<"*.ps"<<"*.svg"<<"*.ico"; 
     18  docsFilter << "*.txt"<<"*.rtf"<<"*.doc"<<"*.docx"<<"*.odf"<<"*.pdf"; 
    1819  //initialize the desktop bar items 
    1920  initializeDesktop(); 
     
    7172    connect(otherM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) ); 
    7273    otherM->setIcon( LXDG::findIcon("unknown",":/images/default-file.png") ); 
     74  docM = new QMenu(tr("Documents"), this); 
     75    connect(docM,SIGNAL(triggered(QAction*)), this,SLOT(ActionTriggered(QAction*)) ); 
     76    docM->setIcon( LXDG::findIcon("x-office-document","") ); 
    7377  //All Files Button 
    7478  fileB = new LTBWidget(this); 
     
    104108void LDeskBarPlugin::ActionTriggered(QAction* act){ 
    105109 //Open up the file with the appropriate application 
    106  QString cmd = "lumina-open "+act->whatsThis(); 
     110 QString cmd = "lumina-open \""+act->whatsThis()+"\""; 
    107111 qDebug() << "Open File:" << cmd; 
    108112 QProcess::startDetached(cmd); 
     
    118122    updateMenu(videoM, dir.entryInfoList( videoFilter, QDir::Files, QDir::Name) ); 
    119123    updateMenu(pictureM, dir.entryInfoList( pictureFilter, QDir::Files, QDir::Name) ); 
     124    updateMenu(docM, dir.entryInfoList( docsFilter, QDir::Files, QDir::Name) ); 
    120125    //Now update the launchers 
    121126    QFileInfoList exe = dir.entryInfoList( QStringList() << "*.desktop", QDir::Files, QDir::Name ); 
     
    158163    fileM->clear(); 
    159164    if(!audioM->isEmpty()){ fileM->addMenu(audioM); } 
     165    if(!docM->isEmpty()){ fileM->addMenu(docM); } 
    160166    if(!pictureM->isEmpty()){ fileM->addMenu(pictureM); } 
    161167    if(!videoM->isEmpty()){ fileM->addMenu(videoM); } 
     
    166172      else if(!pictureM->isEmpty()){ fileB->setMenu(pictureM); } 
    167173      else if(!videoM->isEmpty()){ fileB->setMenu(videoM); } 
     174      else if(!docM->isEmpty()){ fileB->setMenu(docM); } 
    168175      else if(!otherM->isEmpty()){ fileB->setMenu(otherM); } 
    169176    }else{ 
  • lumina/lumina-desktop/panel-plugins/desktopbar/LDeskBar.h

    r307712c r64ba4c0  
    4343        //Special toolbuttons and menus 
    4444        LTBWidget *appB, *fileB, *dirB; 
    45         QMenu *appM, *dirM, *audioM, *videoM, *pictureM, *fileM, *otherM; 
    46         QStringList audioFilter, videoFilter, pictureFilter; 
     45        QMenu *appM, *dirM, *audioM, *videoM, *pictureM, *fileM, *otherM, *docM; 
     46        QStringList audioFilter, videoFilter, pictureFilter, docsFilter; 
    4747        QFileInfoList totals; 
    4848        QList<LTBWidget*> APPLIST; 
Note: See TracChangeset for help on using the changeset viewer.