aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-11-17 14:22:37 -0500
committerKen Moore <ken@pcbsd.org>2014-11-17 14:22:37 -0500
commit788f83e26c935b5faee5ef59b355ab9b3818684a (patch)
treed86084a57da7c4c386e129e8c5b9844808cf9a7a
parentUpdate the XDG categories that are supported, as well as the add a new "Wine"... (diff)
downloadlumina-788f83e26c935b5faee5ef59b355ab9b3818684a.tar.gz
lumina-788f83e26c935b5faee5ef59b355ab9b3818684a.tar.bz2
lumina-788f83e26c935b5faee5ef59b355ab9b3818684a.zip
Update the XDG MIME inplementation to support the draft standards for registering default application (Note: does not use the mime association routines, just defaults)
Lumina-config will now use this backend system for default app registrations, but lumina-open does not use it yet. Also, the defaults tab in lumina-config is still not completely updated yet (resulting in some breakage or unusable buttons). DO NOT BUILD FROM THIS REVISION - Will be fixed very soon but needed a git snapshot
-rw-r--r--libLumina/LuminaXDG.cpp161
-rw-r--r--libLumina/LuminaXDG.h9
-rw-r--r--lumina-config/mainUI.cpp176
-rw-r--r--lumina-config/mainUI.h11
-rw-r--r--lumina-config/mainUI.ui307
5 files changed, 536 insertions, 128 deletions
diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp
index e7678d1f..802722d4 100644
--- a/libLumina/LuminaXDG.cpp
+++ b/libLumina/LuminaXDG.cpp
@@ -387,6 +387,167 @@ QStringList LXDG::findFilesForMime(QString mime){
return out;
}
+QStringList LXDG::listFileMimeDefaults(){
+ //This will spit out a itemized list of all the mimetypes and relevant info
+ // Output format: <mimetype>::::<extension>::::<default>::::<localized comment>
+ QStringList mimes = LXDG::loadMimeFileGlobs2();
+ //Remove all the application files from the list (only a single app defines/uses this type in general)
+ /*QStringList apps = mimes.filter(":application/");
+ //qDebug() << "List Mime Defaults";
+ for(int i=0; i<apps.length(); i++){ mimes.removeAll(apps[i]); }*/
+ //Now start filling the output list
+ QStringList out;
+ for(int i=0; i<mimes.length(); i++){
+ QString mimetype = mimes[i].section(":",1,1);
+ QStringList tmp = mimes.filter(mimetype);
+ //Collect all the different extensions with this mimetype
+ QStringList extlist;
+ for(int j=0; j<tmp.length(); j++){
+ mimes.removeAll(tmp[j]);
+ extlist << tmp[j].section(":",2,2);
+ }
+ extlist.removeDuplicates(); //just in case
+ //Now look for a current default for this mimetype
+ QString dapp = LXDG::findDefaultAppForMime(mimetype); //default app;
+
+ //Create the output entry
+ //qDebug() << "Mime entry:" << i << mimetype << dapp;
+ out << mimetype+"::::"+extlist.join(", ")+"::::"+dapp+"::::"+LXDG::findMimeComment(mimetype);
+
+ i--; //go back one (continue until the list is empty)
+ }
+ return out;
+}
+
+QString LXDG::findMimeComment(QString mime){
+ QString comment;
+ QStringList dirs = LXDG::systemMimeDirs();
+ QString lang = QString(getenv("LANG")).section(".",0,0);
+ QString shortlang = lang.section("_",0,0);
+ for(int i=0; i<dirs.length(); i++){
+ if(QFile::exists(dirs[i]+"/"+mime+".xml")){
+ QStringList info = LUtils::readFile(dirs[i]+"/"+mime+".xml");
+ QStringList filter = info.filter("<comment xml:lang=\""+lang+"\">");
+ //First look for a full language match, then short language, then general comment
+ if(filter.isEmpty()){ filter = info.filter("<comment xml:lang=\""+shortlang+"\">"); }
+ if(filter.isEmpty()){ filter = info.filter("<comment>"); }
+ if(!filter.isEmpty()){
+ comment = filter.first().section(">",1,1).section("</",0,0);
+ break;
+ }
+ }
+ }
+ return comment;
+}
+
+QString LXDG::findDefaultAppForMime(QString mime){
+ //First get the priority-ordered list of default file locations
+ QStringList dirs;
+ dirs << QString(getenv("XDG_CONFIG_HOME"))+"/lumina-mimeapps.list" \
+ << QString(getenv("XDG_CONFIG_HOME"))+"/mimeapps.list";
+ QStringList tmp = QString(getenv("XDG_CONFIG_DIRS")).split(":");
+ for(int i=0; i<tmp.length(); i++){ dirs << tmp[i]+"/lumina-mimeapps.list"; }
+ for(int i=0; i<tmp.length(); i++){ dirs << tmp[i]+"/mimeapps.list"; }
+ dirs << QString(getenv("XDG_DATA_HOME"))+"/applications/lumina-mimeapps.list" \
+ << QString(getenv("XDG_DATA_HOME"))+"/applications/mimeapps.list";
+ tmp = QString(getenv("XDG_DATA_DIRS")).split(":");
+ for(int i=0; i<tmp.length(); i++){ dirs << tmp[i]+"/applications/lumina-mimeapps.list"; }
+ for(int i=0; i<tmp.length(); i++){ dirs << tmp[i]+"/applications/mimeapps.list"; }
+
+ //Now go through all the files in order of priority until a default is found
+ QString cdefault;
+ QStringList white; //lists to keep track of during the search (black unused at the moment)
+ for(int i=0; i<dirs.length() && cdefault.isEmpty(); i++){
+ if(!QFile::exists(dirs[i])){ continue; }
+ QStringList info = LUtils::readFile(dirs[i]);
+ if(info.isEmpty()){ continue; }
+ QString workdir = dirs[i].section("/",0,-1); //just the directory
+ int def = info.indexOf("[Default Applications]"); //find this line to start on
+ if(def>=0){
+ for(int d=def+1; d<info.length(); d++){
+ if(info[d].startsWith("[")){ break; } //starting a new section now - finished with defaults
+ if(info[d].contains(mime+"=")){
+ white << info[d].section("=",1,50).split(";");
+ break;
+ }
+ }
+ }
+ // Now check for any white-listed files in this work dir
+ // find the full path to the file (should run even if nothing in this file)
+ for(int w=0; w<white.length(); w++){
+ //First check for absolute paths to *.desktop file
+ if( white[w].startsWith("/") ){
+ if( QFile::exists(white[w]) ){ cdefault=white[w]; break; }
+ else{ white.removeAt(w); w--; } //invalid file path - remove it from the list
+ }
+ //Now check for relative paths to file (in current priority-ordered work dir)
+ else if( QFile::exists(workdir+"/"+white[w]) ){ cdefault=workdir+"/"+white[w]; break; }
+ }
+ /* WRITTEN BUT UNUSED CODE FOR MIMETYPE ASSOCIATIONS
+ //Skip using this because it is simply an alternate/unsupported standard that conflicts with
+ the current mimetype database standards. It is better/faster to parse 1 or 2 database glob files
+ rather than have to iterate through hundreds of *.desktop files *every* time you need to
+ find an application
+
+ if(addI<0 && remI<0){
+ //Simple Format: <mimetype>=<*.desktop file>;<*.desktop file>;.....
+ // (usually only one desktop file listed)
+ info = info.filter(mimetype+"=");
+ //Load the listed default(s)
+ for(int w=0; w<info.length(); w++){
+ white << info[w].section("=",1,50).split(";");
+ }
+ }else{
+ //Non-desktop specific mimetypes file: has a *very* convoluted/inefficient algorithm (required by spec)
+ if(addI<0){ addI = info.length(); } //no add section
+ if(remI<0){ remI = info.length(); } // no remove section:
+ //Whitelist items
+ for(int a=addI+1; a!=remI && a<info.length(); a++){
+ if(info[a].contains(mimetype+"=")){
+ QStringList tmp = info[a].section("=",1,50).split(";");
+ for(int t=0; t<tmp.length(); t++){
+ if(!black.contains(tmp[t])){ white << tmp[t]; } //make sure this item is not on the black list
+ }
+ break;
+ }
+ }
+ //Blacklist items
+ for(int a=remI+1; a!=addI && a<info.length(); a++){
+ if(info[a].contains(mimetype+"=")){ black << info[a].section("=",1,50).split(";"); break;}
+ }
+
+ //STEPS 3/4 not written yet
+
+ } //End of non-DE mimetypes file */
+
+ } //End loop over files
+
+ return cdefault;
+}
+
+void LXDG::setDefaultAppForMime(QString mime, QString app){
+ QString filepath = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-mimeapps.list";
+ QStringList cinfo = LUtils::readFile(filepath);
+ //If this is a new file, make sure to add the header appropriately
+ if(cinfo.isEmpty()){ cinfo << "#Automatically generated with lumina-config" << "# DO NOT CHANGE MANUALLY" << "[Default Applications]"; }
+ //Check for any current entry for this mime type
+ QStringList tmp = cinfo.filter(mime+"=");
+ int index = -1;
+ if(!tmp.isEmpty()){ index = cinfo.indexOf(tmp.first()); }
+ //Now add the new default entry (if necessary)
+ if(app.isEmpty()){
+ if(index>=0){ cinfo.removeAt(index); } //Remove entry
+ }else{
+ if(index<0){
+ cinfo << mime+"="+app+";"; //new entry
+ }else{
+ cinfo[index] = mime+"="+app+";"; //overwrite existing entry
+ }
+ }
+ LUtils::writeFile(filepath, cinfo, true);
+ return;
+}
+
QStringList LXDG::loadMimeFileGlobs2(){
//output format: <weight>:<mime type>:<file extension (*.something)>
if(mimeglobs.isEmpty() || (mimechecktime < (QDateTime::currentMSecsSinceEpoch()-30000)) ){
diff --git a/libLumina/LuminaXDG.h b/libLumina/LuminaXDG.h
index b4c358c2..079ccd3a 100644
--- a/libLumina/LuminaXDG.h
+++ b/libLumina/LuminaXDG.h
@@ -10,6 +10,7 @@
// Desktop File Version Compliance: 1.0 (except "DBusActivatable")
// Icon Theme Compliance: Built in to Qt (QIcon::fromTheme()) with "oxygen" theme default
// *.desktop Exec Compliance Updated: 9/9/2014
+// Mime Application Version Compliance: 1.0.1 (11/14/14) (Skips random *.desktop parsing: ~80% compliant)
//===========================================
@@ -84,6 +85,14 @@ public:
static QString findAppMimeForFile(QString extension);
//Find the file extension for a particular mime-type
static QStringList findFilesForMime(QString mime);
+ // Simplification function for finding all info regarding current mime defaults
+ static QStringList listFileMimeDefaults();
+ //Find the localized comment string for a particular mime-type
+ static QString findMimeComment(QString mime);
+ //Find the default application for a mime-type
+ static QString findDefaultAppForMime(QString mime);
+ //Set the default application for a mime-type
+ static void setDefaultAppForMime(QString mime, QString app);
//Load all the "globs2" mime database files
static QStringList loadMimeFileGlobs2();
};
diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp
index edd1483e..dea72814 100644
--- a/lumina-config/mainUI.cpp
+++ b/lumina-config/mainUI.cpp
@@ -108,10 +108,11 @@ void MainUI::setupIcons(){
ui->tool_shortcut_clear->setIcon( LXDG::findIcon("edit-clear","") );
//Defaults Page
- ui->tool_defaults_addextension->setIcon( LXDG::findIcon("list-add","") );
- ui->tool_defaults_addgroup->setIcon( LXDG::findIcon("list-add","") );
+ //ui->tool_defaults_addextension->setIcon( LXDG::findIcon("list-add","") );
+ //ui->tool_defaults_addgroup->setIcon( LXDG::findIcon("list-add","") );
ui->tool_defaults_clear->setIcon( LXDG::findIcon("edit-clear","") );
ui->tool_defaults_set->setIcon( LXDG::findIcon("system-run","") );
+ ui->tool_defaults_setbin->setIcon( LXDG::findIcon("application-x-executable","") );
//Session Page
ui->tool_session_rmapp->setIcon( LXDG::findIcon("list-remove","") );
@@ -183,10 +184,11 @@ void MainUI::setupConnections(){
connect(ui->tool_shortcut_set, SIGNAL(clicked()), this, SLOT(getKeyPress()) );
//Defaults Page
- connect(ui->tool_defaults_addextension, SIGNAL(clicked()), this, SLOT(adddefaultextension()) );
- connect(ui->tool_defaults_addgroup, SIGNAL(clicked()), this, SLOT(adddefaultgroup()) );
+ //connect(ui->tool_defaults_addextension, SIGNAL(clicked()), this, SLOT(adddefaultextension()) );
+ //connect(ui->tool_defaults_addgroup, SIGNAL(clicked()), this, SLOT(adddefaultgroup()) );
connect(ui->tool_defaults_clear, SIGNAL(clicked()), this, SLOT(cleardefaultitem()) );
connect(ui->tool_defaults_set, SIGNAL(clicked()), this, SLOT(setdefaultitem()) );
+ connect(ui->tool_defaults_setbin, SIGNAL(clicked()), this, SLOT(setdefaultbinary()) );
connect(ui->tree_defaults, SIGNAL(itemSelectionChanged()), this, SLOT(checkdefaulticons()) );
//Session Page
@@ -284,16 +286,6 @@ QString MainUI::getNewPanelPlugin(){
}
XDGDesktop MainUI::getSysApp(){
- //Prompt the user to select an application on the system
- /*QStringList apps;
- for(int i=0; i<sysApps.length(); i++){
- apps << sysApps[i].name;
- }
- bool ok = false;
- QString app = QInputDialog::getItem(this, tr("Select Application"), tr("App Name:"), apps, 0, false, &ok);
- int index = apps.indexOf(app);
- if(app.isEmpty() || index < 0 || !ok){ return XDGDesktop(); } //nothing selected
- else{ return sysApps[index]; }*/
AppDialog dlg(this, sysApps);
dlg.exec();
return dlg.appselected;
@@ -393,6 +385,9 @@ void MainUI::slotChangePage(bool enabled){
else if(ui->actionSession->isChecked()){ ui->stackedWidget->setCurrentWidget(ui->page_session); }
}
ui->group_screen->setVisible(showScreen && (ui->spin_screen->maximum()>1) );
+ //Hide the save button for particular pages
+ ui->push_save->setVisible(!ui->actionDefaults->isChecked()); //hide on the default page
+ //Special functions for particular pages
if(ui->page_panels->isVisible()){ checkpanels(); }
}
@@ -654,7 +649,7 @@ void MainUI::saveCurrentSettings(bool screenonly){
//Defaults page
if(moddef && !screenonly){
- saveDefaultSettings();
+ //saveDefaultSettings();
}
//Session Page
@@ -1162,14 +1157,86 @@ void MainUI::getKeyPress(){
//===========
// Defaults Page
//===========
+void MainUI::changeDefaultBrowser(){
+
+}
+
+void MainUI::changeDefaultEmail(){
+
+}
+
+void MainUI::changeDefaultFileManager(){
+
+}
+
+void MainUI::changeDefaultTerminal(){
+
+}
+
void MainUI::loadDefaultSettings(){
+ //First load the lumina-open specific defaults
+ QString tmp = appsettings->value("default/directory", "lumina-fm").toString();
+
+
+ //Now load the XDG mime defaults
ui->tree_defaults->clear();
+ QStringList defMimeList = LXDG::listFileMimeDefaults();
+ //qDebug() << "Mime List:\n" << defMimeList.join("\n");
+ defMimeList.sort(); //sort by group/mime
+ //Now fill the tree by group/mime
+ QTreeWidgetItem *group = new QTreeWidgetItem(0); //nothing at the moment
+ QString ccat;
+ for(int i=0; i<defMimeList.length(); i++){
+ //Get the info from this entry
+ QString mime = defMimeList[i].section("::::",0,0);
+ QString cat = mime.section("/",0,0);
+ QString extlist = defMimeList[i].section("::::",1,1);
+ QString def = defMimeList[i].section("::::",2,2);
+ QString comment = defMimeList[i].section("::::",3,50);
+ //Now check if this is a new category
+ if(ccat!=cat){
+ //New group
+ group = new QTreeWidgetItem(0);
+ group->setText(0, cat); //add translations for known/common groups later
+ ui->tree_defaults->addTopLevelItem(group);
+ ccat = cat;
+ }
+ //Now create the entry
+ QTreeWidgetItem *it = new QTreeWidgetItem();
+ it->setWhatsThis(0,mime); // full mimetype
+ it->setText(0, QString(tr("%1 (%2)")).arg(mime.section("/",-1), extlist) );
+ it->setText(2,comment);
+ it->setToolTip(0, comment); it->setToolTip(1,comment);
+ //Now load the default (if there is one)
+ it->setWhatsThis(1,def); //save for later
+ if(def.endsWith(".desktop")){
+ bool ok = false;
+ XDGDesktop file = LXDG::loadDesktopFile(def, ok);
+ if(!ok || file.filePath.isEmpty()){
+ //Might be a binary - just print out the raw "path"
+ it->setText(1,def.section("/",-1));
+ it->setIcon(1, LXDG::findIcon("application-x-executable","") );
+ }else{
+ it->setText(1, file.name);
+ it->setIcon(1, LXDG::findIcon(file.icon,"") );
+ }
+ }else if(!def.isEmpty()){
+ //Binary/Other default
+ it->setText(1, def.section("/",-1));
+ it->setIcon(1, LXDG::findIcon("application-x-executable","") );
+ }
+ group->addChild(it);
+ }
+
+ ui->tree_defaults->sortItems(0,Qt::AscendingOrder);
+
+ /*
QStringList keys = appsettings->allKeys();
QStringList groups = keys.filter("Groups/");
if(groups.isEmpty()){
//setup default groups
appsettings->setValue("Groups/Web", QStringList() << "http" << "https" << "ftp");
- appsettings->setValue("Groups/Email", QStringList() << "eml" << "msg");
+ appsettings->setValue("Groups/Email", QStringList() << "eml" << "msg" << "mailto");
appsettings->setValue("Groups/Development-C",QStringList() << "c" << "cpp" << "h" << "hpp");
appsettings->setValue("Groups/Development-Ruby",QStringList() << "rb" << "rbw");
appsettings->setValue("Groups/Development-Python",QStringList() << "py" << "pyw");
@@ -1198,7 +1265,8 @@ void MainUI::loadDefaultSettings(){
it->setWhatsThis(1,path);
if(!ok || file.filePath.isEmpty()){
//Might be a binary - just print out the raw "path"
- it->setText(1,path);
+ it->setText(1,path.section("/",-1));
+ it->setIcon(1, LXDG::findIcon("application-x-executable","") );
}else{
it->setText(1, file.name);
it->setIcon(1, LXDG::findIcon(file.icon,"") );
@@ -1219,7 +1287,8 @@ void MainUI::loadDefaultSettings(){
it->setWhatsThis(1,path);
if(!ok || file.filePath.isEmpty()){
//Might be a binary - just print out the raw "path"
- it->setText(1,path);
+ it->setText(1,path.section("/",-1));
+ it->setIcon(1, LXDG::findIcon("application-x-executable","") );
}else{
it->setText(1, file.name);
it->setIcon(1, LXDG::findIcon(file.icon,"") );
@@ -1229,10 +1298,11 @@ void MainUI::loadDefaultSettings(){
}
}
}
+ */
checkdefaulticons();
}
-void MainUI::saveDefaultSettings(){
+/*void MainUI::saveDefaultSettings(){
for(int i=0; i<ui->tree_defaults->topLevelItemCount(); i++){
//Groups
QTreeWidgetItem *group = ui->tree_defaults->topLevelItem(i);
@@ -1250,9 +1320,9 @@ void MainUI::saveDefaultSettings(){
appsettings->setValue("Groups/"+group->text(0), items);
}
}
-}
+}*/
-void MainUI::adddefaultgroup(){
+/*void MainUI::adddefaultgroup(){
//Prompt for the group name
bool ok = false;
QString name = QInputDialog::getText(this, tr("New Application Group"), tr("Name:"), QLineEdit::Normal, "", &ok);
@@ -1280,7 +1350,7 @@ void MainUI::adddefaultextension(){
it->addChild( new QTreeWidgetItem( QStringList() << name << "" ) );
ui->push_save->setEnabled(true);
moddef = true;
-}
+}*/
void MainUI::cleardefaultitem(){
QTreeWidgetItem *it = ui->tree_defaults->currentItem();
@@ -1292,12 +1362,15 @@ void MainUI::cleardefaultitem(){
if(list.isEmpty()){ list << it; } //just do the current item
//Now clear the items
for(int i=0; i<list.length(); i++){
+ //Clear it in the back end
+ LXDG::setDefaultAppForMime(list[i]->whatsThis(0), "");
+ //Now clear it in the UI
list[i]->setWhatsThis(1,""); //clear the app path
list[i]->setIcon(1,QIcon()); //clear the icon
list[i]->setText(1,""); //clear the name
}
- ui->push_save->setEnabled(true);
- moddef = true;
+ //ui->push_save->setEnabled(true);
+ //moddef = true;
}
void MainUI::setdefaultitem(){
@@ -1313,25 +1386,66 @@ void MainUI::setdefaultitem(){
if(desk.filePath.isEmpty()){ return; }//nothing selected
//Now set the items
for(int i=0; i<list.length(); i++){
+ //Set it in the back end
+ LXDG::setDefaultAppForMime(list[i]->whatsThis(0), desk.filePath);
+ //Set it in the UI
list[i]->setWhatsThis(1,desk.filePath); //app path
- list[i]->setIcon(1,LXDG::findIcon(desk.icon,"")); //clear the icon
- list[i]->setText(1,desk.name); //clear the name
+ list[i]->setIcon(1,LXDG::findIcon(desk.icon,"")); //reset the icon
+ list[i]->setText(1,desk.name); //reset the name
}
- ui->push_save->setEnabled(true);
- moddef = true;
+ //ui->push_save->setEnabled(true);
+ //moddef = true;
+}
+
+void MainUI::setdefaultbinary(){
+ QTreeWidgetItem *it = ui->tree_defaults->currentItem();
+ if(it==0){ return; } //no item selected
+ QList<QTreeWidgetItem*> list;
+ for(int i=0; i<it->childCount(); i++){
+ list << it->child(i);
+ }
+ if(list.isEmpty()){ list << it; } //just do the current item
+ //Prompt for which binary to use
+ QFileDialog dlg(this);
+ //dlg.setFilter(QDir::Executable | QDir::Files); //Does not work! Filters executable files as well as breaks browsing capabilities
+ dlg.setFileMode(QFileDialog::ExistingFile);
+ dlg.setDirectory( LOS::AppPrefix()+"bin" );
+ dlg.setWindowTitle(tr("Select Binary"));
+ if( !dlg.exec() || dlg.selectedFiles().isEmpty() ){
+ return; //cancelled
+ }
+ QString path = dlg.selectedFiles().first();
+ //Make sure it is executable
+ if( !QFileInfo(path).isExecutable()){
+ QMessageBox::warning(this, tr("Invalid Binary"), tr("The selected binary is not executable!"));
+ return;
+ }
+ //Now set the items
+ for(int i=0; i<list.length(); i++){
+ //Set it in the back end
+ LXDG::setDefaultAppForMime(list[i]->whatsThis(0), path);
+ //Set it in the UI
+ list[i]->setWhatsThis(1,path); //app path
+ list[i]->setIcon(1,LXDG::findIcon("application-x-executable","")); //clear the icon
+ list[i]->setText(1,path.section("/",-1)); //clear the name
+ }
+ //ui->push_save->setEnabled(true);
+ //moddef = true;
}
void MainUI::checkdefaulticons(){
QTreeWidgetItem *it = ui->tree_defaults->currentItem();
ui->tool_defaults_set->setEnabled(it!=0);
ui->tool_defaults_clear->setEnabled(it!=0);
- ui->tool_defaults_addextension->setEnabled( it!=0);
- if(it!=0){
+ //ui->tool_defaults_addextension->setEnabled( it!=0);
+ ui->tool_defaults_setbin->setEnabled(it!=0);
+ /*if(it!=0){
if(it->text(0)=="Uncategorized"){
ui->tool_defaults_set->setEnabled(false);
+ ui->tool_defaults_setbin->setEnabled(false);
ui->tool_defaults_clear->setEnabled(false);
}
- }
+ }*/
}
//===========
diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h
index 12df6fde..4662f763 100644
--- a/lumina-config/mainUI.h
+++ b/lumina-config/mainUI.h
@@ -137,12 +137,17 @@ private slots:
void getKeyPress();
//Defaults Page
+ void changeDefaultBrowser();
+ void changeDefaultEmail();
+ void changeDefaultFileManager();
+ void changeDefaultTerminal();
void loadDefaultSettings();
- void saveDefaultSettings();
- void adddefaultgroup();
- void adddefaultextension();
+ //void saveDefaultSettings();
+ //void adddefaultgroup();
+ //void adddefaultextension();
void cleardefaultitem();
void setdefaultitem();
+ void setdefaultbinary();
void checkdefaulticons();
//Session Page
diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui
index 5f8e3510..c3ed700a 100644
--- a/lumina-config/mainUI.ui
+++ b/lumina-config/mainUI.ui
@@ -97,7 +97,7 @@
<enum>QFrame::StyledPanel</enum>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>4</number>
</property>
<widget class="QWidget" name="page_desktop">
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -375,8 +375,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>265</width>
- <height>193</height>
+ <width>181</width>
+ <height>113</height>
</rect>
</property>
<attribute name="label">
@@ -602,8 +602,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>266</width>
- <height>193</height>
+ <width>181</width>
+ <height>113</height>
</rect>
</property>
<attribute name="label">
@@ -1020,100 +1020,219 @@
<widget class="QWidget" name="page_defaults">
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
- <widget class="QTreeWidget" name="tree_defaults">
- <property name="iconSize">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property name="indentation">
- <number>20</number>
- </property>
- <property name="sortingEnabled">
- <bool>true</bool>
- </property>
- <property name="animated">
- <bool>true</bool>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <layout class="QFormLayout" name="formLayout_6">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_19">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Web Browser:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QToolButton" name="tool_default_webbrowser">
+ <property name="text">
+ <string notr="true">...</string>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_20">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>E-Mail Client:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QToolButton" name="tool_default_email">
+ <property name="text">
+ <string notr="true">...</string>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <layout class="QFormLayout" name="formLayout_7">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_21">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>File Manager:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_22">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Virtual Terminal:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QToolButton" name="tool_default_filemanager">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QToolButton" name="tool_default_terminal">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="group_default_filetypes">
+ <property name="font">
+ <font>
+ <italic>false</italic>
+ </font>
</property>
- <property name="allColumnsShowFocus">
- <bool>true</bool>
+ <property name="title">
+ <string>Specific File Types</string>
</property>
- <attribute name="headerDefaultSectionSize">
- <number>250</number>
- </attribute>
- <attribute name="headerMinimumSectionSize">
- <number>150</number>
- </attribute>
- <column>
- <property name="text">
- <string>Group/Extension</string>
+ <layout class="QVBoxLayout" name="verticalLayout_15">
+ <property name="leftMargin">
+ <number>2</number>
</property>
- </column>
- <column>
- <property name="text">
- <string>Default Application</string>
+ <property name="rightMargin">
+ <number>2</number>
</property>
- </column>
+ <item>
+ <widget class="QTreeWidget" name="tree_defaults">
+ <property name="iconSize">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="indentation">
+ <number>20</number>
+ </property>
+ <property name="sortingEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="animated">
+ <bool>true</bool>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <attribute name="headerDefaultSectionSize">
+ <number>200</number>
+ </attribute>
+ <attribute name="headerMinimumSectionSize">
+ <number>150</number>
+ </attribute>
+ <column>
+ <property name="text">
+ <string>Group/Extension</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Default Application</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_16">
+ <item>
+ <widget class="QToolButton" name="tool_defaults_clear">
+ <property name="text">
+ <string>Clear</string>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_13">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="tool_defaults_set">
+ <property name="text">
+ <string>Set App</string>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="tool_defaults_setbin">
+ <property name="text">
+ <string>Set Binary</string>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ <zorder>tree_defaults</zorder>
+ <zorder>tree_defaults</zorder>
+ <zorder></zorder>
</widget>
</item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_16">
- <item>
- <widget class="QToolButton" name="tool_defaults_addgroup">
- <property name="text">
- <string>Group</string>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextBesideIcon</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="tool_defaults_addextension">
- <property name="text">
- <string>Extension</string>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextBesideIcon</enum>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_13">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QToolButton" name="tool_defaults_clear">
- <property name="text">
- <string>Clear</string>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextBesideIcon</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="tool_defaults_set">
- <property name="text">
- <string>Set App</string>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextBesideIcon</enum>
- </property>
- </widget>
- </item>
- </layout>
- </item>
</layout>
</widget>
<widget class="QWidget" name="page_session">
@@ -1412,7 +1531,7 @@
<x>0</x>
<y>0</y>
<width>118</width>
- <height>26</height>
+ <height>16</height>
</rect>
</property>
<property name="sizePolicy">
bgstack15