aboutsummaryrefslogtreecommitdiff
path: root/lumina-config
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2014-10-08 09:16:10 -0400
committerKen Moore <moorekou@gmail.com>2014-10-08 09:16:10 -0400
commit4897f2a844a9901e6278665f83716b3974a5078b (patch)
treeefb98920ebd16cfa9342dd392601a25fa9f12916 /lumina-config
parentMerge pull request #15 from Nanolx/master (diff)
parentmake file-manager user-chooseable (diff)
downloadlumina-4897f2a844a9901e6278665f83716b3974a5078b.tar.gz
lumina-4897f2a844a9901e6278665f83716b3974a5078b.tar.bz2
lumina-4897f2a844a9901e6278665f83716b3974a5078b.zip
Merge pull request #16 from Nanolx/side-work
make file-manager user-chooseable
Diffstat (limited to 'lumina-config')
-rw-r--r--lumina-config/mainUI.cpp24
-rw-r--r--lumina-config/mainUI.h1
-rw-r--r--lumina-config/mainUI.ui62
3 files changed, 66 insertions, 21 deletions
diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp
index eb29ee8f..ada56df2 100644
--- a/lumina-config/mainUI.cpp
+++ b/lumina-config/mainUI.cpp
@@ -101,6 +101,7 @@ void MainUI::setupIcons(){
ui->tool_menu_up->setIcon( LXDG::findIcon("go-up","") );
ui->tool_menu_dn->setIcon( LXDG::findIcon("go-down","") );
ui->tool_menu_findterm->setIcon( LXDG::findIcon("system-search","") );
+ ui->tool_menu_findfm->setIcon( LXDG::findIcon("system-search","") );
//Shortcuts Page
ui->tool_shortcut_set->setIcon( LXDG::findIcon("input-keyboard","") );
@@ -168,8 +169,10 @@ void MainUI::setupConnections(){
connect(ui->tool_menu_up, SIGNAL(clicked()), this, SLOT(upmenuplugin()) );
connect(ui->tool_menu_dn, SIGNAL(clicked()), this, SLOT(downmenuplugin()) );
connect(ui->tool_menu_findterm, SIGNAL(clicked()), this, SLOT(findmenuterminal()) );
+ connect(ui->tool_menu_findfm, SIGNAL(clicked()), this, SLOT(findmenufilemanager()) );
connect(ui->list_menu, SIGNAL(currentRowChanged(int)), this, SLOT(checkmenuicons()) );
connect(ui->line_menu_term, SIGNAL(textChanged(QString)), this, SLOT(checkmenuicons()) );
+ connect(ui->line_menu_fm, SIGNAL(textChanged(QString)), this, SLOT(checkmenuicons()) );
//Shortcuts Page
connect(ui->tool_shortcut_clear, SIGNAL(clicked()), this, SLOT(clearKeyBinding()) );
@@ -503,8 +506,9 @@ void MainUI::loadCurrentSettings(bool screenonly){
if(!screenonly){
// Menu Page
- //Default terminal binary
+ //Default terminal and filemanager binary
ui->line_menu_term->setText( settings->value("default-terminal","xterm").toString() );
+ ui->line_menu_fm->setText( settings->value("default-filemanager","lumina-fm").toString() );
//Menu Items
QStringList items = settings->value("menu/itemlist", QStringList() ).toStringList();
if(items.isEmpty()){ items << "terminal" << "filemanager" << "applications" << "line" << "settings"; }
@@ -616,6 +620,7 @@ void MainUI::saveCurrentSettings(bool screenonly){
// Menu Page
if(modmenu && !screenonly){
settings->setValue("default-terminal", ui->line_menu_term->text() );
+ settings->setValue("default-filemanager", ui->line_menu_fm->text() );
QStringList items;
for(int i=0; i<ui->list_menu->count(); i++){
items << ui->list_menu->item(i)->whatsThis();
@@ -1005,11 +1010,26 @@ void MainUI::findmenuterminal(){
modmenu = true;
}
+void MainUI::findmenufilemanager(){
+ QString chkpath = LOS::AppPrefix() + "bin";
+ if(!QFile::exists(chkpath)){ chkpath = QDir::homePath(); }
+ QString bin = QFileDialog::getOpenFileName(this, tr("Set Default File MAnager"), chkpath, tr("Application Binaries (*)") );
+ if( bin.isEmpty() || !QFile::exists(bin) ){ return; } //cancelled
+ if( !QFileInfo(bin).isExecutable() ){
+ QMessageBox::warning(this, tr("Invalid Binary"), tr("The selected file is not executable!"));
+ return;
+ }
+ ui->line_menu_fm->setText(bin);
+ ui->push_save->setEnabled(true);
+ modmenu = true;
+}
+
void MainUI::checkmenuicons(){
ui->tool_menu_up->setEnabled( ui->list_menu->currentRow() > 0 );
ui->tool_menu_dn->setEnabled( ui->list_menu->currentRow() < (ui->list_menu->count()-1) );
ui->tool_menu_rm->setEnabled( ui->list_menu->currentRow() >=0 );
- if(settings->value("default-terminal","").toString()!=ui->line_menu_term->text()){
+ if( settings->value("default-terminal","").toString() != ui->line_menu_term->text() ||
+ settings->value("default-filemanager","").toString() != ui->line_menu_fm->text()){
ui->push_save->setEnabled(true);
modmenu = true;
}
diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h
index 565a3c61..d40438db 100644
--- a/lumina-config/mainUI.h
+++ b/lumina-config/mainUI.h
@@ -121,6 +121,7 @@ private slots:
void upmenuplugin();
void downmenuplugin();
void findmenuterminal();
+ void findmenufilemanager();
void checkmenuicons();
//Shortcuts Page
diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui
index f1fd2542..7dd97862 100644
--- a/lumina-config/mainUI.ui
+++ b/lumina-config/mainUI.ui
@@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>573</width>
- <height>385</height>
+ <width>579</width>
+ <height>392</height>
</rect>
</property>
<property name="windowTitle">
@@ -94,7 +94,7 @@
<enum>QFrame::StyledPanel</enum>
</property>
<property name="currentIndex">
- <number>5</number>
+ <number>2</number>
</property>
<widget class="QWidget" name="page_desktop">
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -372,8 +372,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>157</width>
- <height>90</height>
+ <width>166</width>
+ <height>92</height>
</rect>
</property>
<attribute name="label">
@@ -454,8 +454,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>177</width>
- <height>106</height>
+ <width>194</width>
+ <height>107</height>
</rect>
</property>
<attribute name="label">
@@ -592,8 +592,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>157</width>
- <height>90</height>
+ <width>166</width>
+ <height>92</height>
</rect>
</property>
<attribute name="label">
@@ -674,8 +674,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>177</width>
- <height>106</height>
+ <width>194</width>
+ <height>107</height>
</rect>
</property>
<attribute name="label">
@@ -782,7 +782,7 @@
</item>
</layout>
</item>
- <item row="1" column="0">
+ <item row="2" column="0">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -795,10 +795,10 @@
</property>
</spacer>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QListWidget" name="list_menu"/>
</item>
- <item row="1" column="2">
+ <item row="2" column="2">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -811,7 +811,7 @@
</property>
</spacer>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QToolButton" name="tool_menu_add">
@@ -856,6 +856,30 @@
</item>
</layout>
</item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_18">
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_15">
+ <property name="text">
+ <string>File Manager:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="line_menu_fm"/>
+ </item>
+ <item>
+ <widget class="QToolButton" name="tool_menu_findfm">
+ <property name="text">
+ <string>find</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="page_shortcuts">
@@ -1266,8 +1290,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>509</width>
- <height>71</height>
+ <width>491</width>
+ <height>59</height>
</rect>
</property>
<property name="sizePolicy">
@@ -1373,8 +1397,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>573</width>
- <height>20</height>
+ <width>579</width>
+ <height>19</height>
</rect>
</property>
</widget>
bgstack15