diff options
author | wi <william.os4y@gmail.com> | 2015-04-14 21:41:27 +0200 |
---|---|---|
committer | wi <william.os4y@gmail.com> | 2015-04-14 21:41:27 +0200 |
commit | 80cb880052d65dc854275218eda17c276f497111 (patch) | |
tree | 612a12581f982769efe4cc0b949305dcff7f58ba | |
parent | Merge remote-tracking branch 'upstream/master' into deskEditor (diff) | |
parent | Add the ability for lumina-open to be able to offer recommendations on web br... (diff) | |
download | lumina-80cb880052d65dc854275218eda17c276f497111.tar.gz lumina-80cb880052d65dc854275218eda17c276f497111.tar.bz2 lumina-80cb880052d65dc854275218eda17c276f497111.zip |
Merge remote-tracking branch 'upstream/master' into deskEditor
-rw-r--r-- | lumina-fm/lumina-fm.desktop | 2 | ||||
-rw-r--r-- | lumina-open/LFileDialog.cpp | 15 | ||||
-rw-r--r-- | lumina-open/LFileDialog.h | 2 |
3 files changed, 13 insertions, 6 deletions
diff --git a/lumina-fm/lumina-fm.desktop b/lumina-fm/lumina-fm.desktop index 2cce58cc..b6574184 100644 --- a/lumina-fm/lumina-fm.desktop +++ b/lumina-fm/lumina-fm.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Exec=lumina-fm %U +Exec=lumina-fm %F Icon=/usr/local/share/pixmaps/Insight-FileManager.png Terminal=false Type=Application diff --git a/lumina-open/LFileDialog.cpp b/lumina-open/LFileDialog.cpp index 361cd99f..4010dc74 100644 --- a/lumina-open/LFileDialog.cpp +++ b/lumina-open/LFileDialog.cpp @@ -34,12 +34,13 @@ LFileDialog::~LFileDialog(){ void LFileDialog::setFileInfo(QString filename, QString extension, bool isFile){ //Set the labels for the file ui->label_file->setText( this->fontMetrics().elidedText( filename, Qt::ElideMiddle, 300 ) ); + bool shownetwork = false; if(isFile){ ui->label_extension->setText( "("+extension+")"); } - else if(extension=="email"){ ui->label_extension->setText( QString(tr("(Email Link)")) ); } - else if(extension=="webbrowser"){ ui->label_extension->setText( QString(tr("(Internet URL)")) ); } + else if(extension=="email"){ ui->label_extension->setText( QString(tr("(Email Link)")) ); shownetwork = true; } + else if(extension=="webbrowser"){ ui->label_extension->setText( QString(tr("(Internet URL)")) ); shownetwork = true; } else{ui->label_extension->setText("("+extension+" link)"); } fileEXT = extension; //NOTE: this is the mime-type for the file now, not the extension - generateAppList(); + generateAppList(shownetwork); } //static functions @@ -160,7 +161,7 @@ void LFileDialog::updateUI(){ ui->tool_ok->setEnabled(good); } -void LFileDialog::generateAppList(){ +void LFileDialog::generateAppList(bool shownetwork){ //Now load the preferred applications PREFAPPS = getPreferredApplications(); ui->combo_rec->clear(); @@ -175,6 +176,12 @@ void LFileDialog::generateAppList(){ QList<XDGDesktop> app = hash[cat[c]]; QTreeWidgetItem *ci = new QTreeWidgetItem(ui->tree_apps, QStringList() << translateCat(cat[c])); for(int a=0; a<app.length(); a++){ + if(shownetwork && (cat[c].toLower()=="network" || cat[c].toLower()=="utility") ){ + //Need to show preferred internet applications - look for ones that handle URL's + if(app[a].exec.contains("%u") || app[a].exec.contains("%U")){ + PREFAPPS << app[a].filePath; + } + } QTreeWidgetItem *ti = new QTreeWidgetItem(ci, QStringList() << app[a].name); ti->setWhatsThis(0, app[a].filePath); ti->setIcon(0, LXDG::findIcon(app[a].icon, "application-x-desktop")); diff --git a/lumina-open/LFileDialog.h b/lumina-open/LFileDialog.h index eaed3625..96016cf2 100644 --- a/lumina-open/LFileDialog.h +++ b/lumina-open/LFileDialog.h @@ -61,7 +61,7 @@ private: private slots: void updateUI(); - void generateAppList(); + void generateAppList(bool shownetwork = false); //Internal UI slots void radioChanged(); //void on_group_binary_toggled(bool checked); |