aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libLumina/LuminaUtils.cpp34
-rw-r--r--libLumina/LuminaUtils.h2
-rw-r--r--libLumina/quickplugins/quick-sample.qml12
-rw-r--r--libLumina/quickplugins/sample.qml7
-rw-r--r--lumina-config/AppDialog.h6
-rw-r--r--lumina-config/KeyCatch.h2
-rw-r--r--lumina-config/LPlugins.cpp14
-rw-r--r--lumina-config/PanelWidget.ui56
-rw-r--r--lumina-config/mainUI.cpp584
-rw-r--r--lumina-config/mainUI.h25
-rw-r--r--lumina-config/mainUI.ui191
-rw-r--r--lumina-desktop/LDesktop.cpp79
-rw-r--r--lumina-desktop/LDesktop.h3
-rw-r--r--lumina-desktop/LPanel.cpp4
-rw-r--r--lumina-desktop/LSession.cpp9
-rw-r--r--lumina-desktop/desktop-plugins/LDPlugin.cpp5
-rw-r--r--lumina-desktop/desktop-plugins/LDPluginContainer.h35
-rw-r--r--lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp10
-rw-r--r--lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.cpp2
-rw-r--r--lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h1
-rw-r--r--lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp2
-rw-r--r--lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp5
-rw-r--r--lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h1
-rw-r--r--lumina-desktop/desktop-plugins/systemmonitor/MonitorWidget.cpp2
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp19
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserWidget.cpp80
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserWidget.h1
-rw-r--r--port-files/pkg-plist2
28 files changed, 449 insertions, 744 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index 540598cf..42f36962 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -189,15 +189,43 @@ bool LUtils::validQuickPlugin(QString ID){
}
QString LUtils::findQuickPluginFile(QString ID){
- if(ID.startsWith("quick-")){ ID = ID.section("-",1,50); }
+ if(ID.startsWith("quick-")){ ID = ID.section("-",1,50); } //just in case
//Give preference to any user-supplied plugins (overwrites for system plugins)
- QString path = QDir::homePath()+"/.lumina/quickplugins/"+ID+".qml";
+ QString path = QDir::homePath()+"/.lumina/quickplugins/quick-"+ID+".qml";
if( QFile::exists(path) ){return path; }
- path = LOS::LuminaShare()+"quickplugins/"+ID+".qml";
+ path = LOS::LuminaShare()+"quickplugins/quick-"+ID+".qml";
if( QFile::exists(path) ){return path; }
return ""; //could not be found
}
+QStringList LUtils::listQuickPlugins(){
+ QDir dir(QDir::homePath()+"/.lumina/quickplugins");
+ QStringList files = dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
+ dir.cd(LOS::LuminaShare()+"quickplugins");
+ files << files = dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
+ for(int i=0; i<files.length(); i++){
+ files[i] = files[i].section("quick-",1,100).section(".qml",0,0); //just grab the ID out of the middle of the filename
+ }
+ files.removeDuplicates();
+ return files;
+}
+
+QStringList LUtils::infoQuickPlugin(QString ID){ //Returns: [Name, Description, Icon]
+ QString path = findQuickPluginFile(ID);
+ if(path.isEmpty()){ return QStringList(); } //invalid ID
+ QStringList contents = LUtils::readFile(path).filter("//").filter("=").filter("Plugin");
+ if(contents.isEmpty()){ return QStringList(); } //invalid file (unreadable)
+ QStringList info; info << "" << "" << "";
+ for(int i=0; i<contents.length(); i++){
+ if(contents[i].contains("Plugin-Name=")){ info[0] = contents[i].section("Plugin-Name=",1,1).simplified(); }
+ else if(contents[i].contains("Plugin-Description=")){ info[1] = contents[i].section("Plugin-Description=",1,1).simplified(); }
+ else if(contents[i].contains("Plugin-Icon=")){ info[2] = contents[i].section("Plugin-Icon=",1,1).simplified(); }
+ }
+ if(info[0].isEmpty()){ info[0]=ID; }
+ if(info[2].isEmpty()){ info[2]="preferences-plugin"; }
+ return info;
+}
+
QStringList LUtils::listFavorites(){
static QDateTime lastRead;
QDateTime cur = QDateTime::currentDateTime();
diff --git a/libLumina/LuminaUtils.h b/libLumina/LuminaUtils.h
index 605f2653..188563dc 100644
--- a/libLumina/LuminaUtils.h
+++ b/libLumina/LuminaUtils.h
@@ -56,6 +56,8 @@ public:
//Various function for finding valid QtQuick plugins on the system
static bool validQuickPlugin(QString ID);
static QString findQuickPluginFile(QString ID);
+ static QStringList listQuickPlugins(); //List of valid ID's
+ static QStringList infoQuickPlugin(QString ID); //Returns: [Name, Description, Icon]
//Various functions for the favorites sub-system
// Formatting Note: "<name>::::[dir/app/<mimetype>]::::<path>"
diff --git a/libLumina/quickplugins/quick-sample.qml b/libLumina/quickplugins/quick-sample.qml
new file mode 100644
index 00000000..18b10d77
--- /dev/null
+++ b/libLumina/quickplugins/quick-sample.qml
@@ -0,0 +1,12 @@
+// Plugin-Name=Sample
+// Plugin-Description=A simple example for QtQuick/QML plugins
+// Plugin-Icon=preferences-plugin
+// Created: Ken Moore (ken@pcbsd.org) May 2015
+
+import QtQuick.Controls 1.3
+
+Label {
+ text: "Sample"
+ color: "blue"
+ font.bold: true
+} \ No newline at end of file
diff --git a/libLumina/quickplugins/sample.qml b/libLumina/quickplugins/sample.qml
deleted file mode 100644
index b12702ba..00000000
--- a/libLumina/quickplugins/sample.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-import QtQuick.Controls 1.3
-
-Label {
- text: "Sample"
- color: "blue"
- font.bold: true
-} \ No newline at end of file
diff --git a/lumina-config/AppDialog.h b/lumina-config/AppDialog.h
index acc6c73e..8c35d9b7 100644
--- a/lumina-config/AppDialog.h
+++ b/lumina-config/AppDialog.h
@@ -39,8 +39,10 @@ public:
ui->comboBox->addItem( LXDG::findIcon(APPS[i].icon,"application-x-executable"), APPS[i].name );
}
this->setWindowIcon( LXDG::findIcon("system-search","") );
- QPoint center = QApplication::desktop()->screenGeometry(QCursor::pos()).center();
- this->move(center.x()-(this->width()/2), center.y()-(this->height()/2) );
+ if(parent!=0){
+ QPoint center = parent->geometry().center();
+ this->move(center.x()-(this->width()/2), center.y()-(this->height()/2) );
+ }
}
~AppDialog(){}
diff --git a/lumina-config/KeyCatch.h b/lumina-config/KeyCatch.h
index 78b34ac2..03193972 100644
--- a/lumina-config/KeyCatch.h
+++ b/lumina-config/KeyCatch.h
@@ -76,12 +76,14 @@ protected:
//Now get the main key
qkeys.replace("+"," ");
if(event->key()==0){
+ if(qkeys.isEmpty()){ qkeys="None "; } //For Fluxbox, need "None <X Key number>"
qkeys.append( QString::number(event->nativeVirtualKey()) );
}else{
qkeys.append( QKeySequence(event->key()).toString() ); //also save the text version (for display)
}
//Remove the modifier if it is only "shift", and the main key is not a symbol
xkeys = qkeys;
+ qkeys.remove("None "); //The display/Qt keycode does not need to show this
if(!xkeys.section(" ",-1).isEmpty() && xkeys.contains("Shift ")){
if(!xkeys.section(" ",-1).at(0).isLetter()){
xkeys.remove("Shift "); //The symbol/keycode is already different
diff --git a/lumina-config/LPlugins.cpp b/lumina-config/LPlugins.cpp
index 31b189bb..16725259 100644
--- a/lumina-config/LPlugins.cpp
+++ b/lumina-config/LPlugins.cpp
@@ -6,6 +6,8 @@
//===========================================
#include "LPlugins.h"
+#include <LuminaUtils.h>
+
LPlugins::LPlugins(){
LoadPanelPlugins();
LoadDesktopPlugins();
@@ -195,6 +197,18 @@ void LPlugins::LoadDesktopPlugins(){
info.ID = "systemmonitor";
info.icon = "cpu";
DESKTOP.insert(info.ID, info);
+ //Available QtQuick scripts
+ QStringList quickID = LUtils::listQuickPlugins();
+ for(int i=0; i<quickID.length(); i++){
+ QStringList quickinfo = LUtils::infoQuickPlugin(quickID[i]); //Returns: [name, description, icon]
+ if(quickinfo.length() < 3){ continue; } //invalid file (unreadable/other)
+ info = LPI();
+ info.name = quickinfo[0];
+ info.description = quickinfo[1];
+ info.ID = "quick-"+quickID[i]; //the "quick-" prefix is required for the desktop plugin syntax
+ info.icon = quickinfo[2];
+ DESKTOP.insert(info.ID, info);
+ }
}
void LPlugins::LoadMenuPlugins(){
diff --git a/lumina-config/PanelWidget.ui b/lumina-config/PanelWidget.ui
index 9cf4ffdb..b078a15e 100644
--- a/lumina-config/PanelWidget.ui
+++ b/lumina-config/PanelWidget.ui
@@ -6,25 +6,25 @@
<rect>
<x>0</x>
<y>0</y>
- <width>245</width>
- <height>246</height>
+ <width>250</width>
+ <height>239</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>245</width>
+ <width>250</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
- <width>245</width>
+ <width>400</width>
<height>16777215</height>
</size>
</property>
@@ -87,8 +87,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>241</width>
- <height>133</height>
+ <width>246</width>
+ <height>125</height>
</rect>
</property>
<attribute name="label">
@@ -113,12 +113,19 @@
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
- <string>Screen Edge:</string>
+ <string>Edge:</string>
</property>
</widget>
</item>
<item row="0" column="1">
- <widget class="QComboBox" name="combo_edge"/>
+ <widget class="QComboBox" name="combo_edge">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
@@ -177,7 +184,14 @@
</widget>
</item>
<item row="1" column="1">
- <widget class="QComboBox" name="combo_align"/>
+ <widget class="QComboBox" name="combo_align">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</item>
</layout>
</widget>
@@ -186,8 +200,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>241</width>
- <height>133</height>
+ <width>246</width>
+ <height>125</height>
</rect>
</property>
<attribute name="label">
@@ -274,8 +288,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>241</width>
- <height>133</height>
+ <width>260</width>
+ <height>112</height>
</rect>
</property>
<attribute name="label">
@@ -295,7 +309,14 @@
<number>2</number>
</property>
<item>
- <widget class="QListWidget" name="list_plugins"/>
+ <widget class="QListWidget" name="list_plugins">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
@@ -318,9 +339,12 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
<property name="sizeHint" stdset="0">
<size>
- <width>40</width>
+ <width>10</width>
<height>20</height>
</size>
</property>
diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp
index 2a98545a..4c1bd4a4 100644
--- a/lumina-config/mainUI.cpp
+++ b/lumina-config/mainUI.cpp
@@ -1,6 +1,6 @@
//===========================================
// Lumina-DE source code
-// Copyright (c) 2014, Ken Moore
+// Copyright (c) 2014-2015, Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
@@ -12,6 +12,9 @@
#include <QTime>
#include <QDate>
#include <QTimeZone>
+#include <QScrollBar>
+
+#include <unistd.h>
MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){
ui->setupUi(this); //load the designer file
@@ -83,33 +86,13 @@ void MainUI::setupIcons(){
ui->tool_desk_addbg->setIcon( LXDG::findIcon("list-add","") );
ui->tool_desk_addbgcolor->setIcon( LXDG::findIcon("format-fill-color","") );
ui->tool_desk_rmbg->setIcon( LXDG::findIcon("list-remove","") );
- ui->push_addDesktopPlugin->setIcon( LXDG::findIcon("list-add","") );
ui->tabWidget_desktop->setTabIcon( ui->tabWidget_desktop->indexOf(ui->tab_wallpaper), LXDG::findIcon("preferences-desktop-wallpaper","") );
ui->tabWidget_desktop->setTabIcon( ui->tabWidget_desktop->indexOf(ui->tab_themes), LXDG::findIcon("preferences-desktop-theme","") );
-
+ ui->tool_desktop_addplugin->setIcon( LXDG::findIcon("list-add","") );
+ ui->tool_desktop_rmplugin->setIcon( LXDG::findIcon("list-remove","") );
+
//Panels Page
ui->tool_panels_add->setIcon( LXDG::findIcon("list-add","") );
- /*ui->tool_panel1_add->setIcon( LXDG::findIcon("list-add","") );
- ui->tool_panel1_rm->setIcon( LXDG::findIcon("list-remove","") );
- ui->tool_panel1_addplugin->setIcon( LXDG::findIcon("list-add","") );
- ui->tool_panel1_rmplugin->setIcon( LXDG::findIcon("list-remove","") );
- ui->tool_panel1_upplug->setIcon( LXDG::findIcon("go-up","") );
- ui->tool_panel1_dnplug->setIcon( LXDG::findIcon("go-down","") );
- ui->tool_panel1_getcolor->setIcon( LXDG::findIcon("preferences-desktop-color","") );
- ui->toolBox_panel1->setItemIcon(0,LXDG::findIcon("preferences-desktop-display",""));
- ui->toolBox_panel1->setItemIcon(1,LXDG::findIcon("preferences-plugin",""));
- ui->tool_panel2_add->setIcon( LXDG::findIcon("list-add","") );
- ui->tool_panel2_rm->setIcon( LXDG::findIcon("list-remove","") );
- ui->tool_panel2_addplugin->setIcon( LXDG::findIcon("list-add","") );
- ui->tool_panel2_rmplugin->setIcon( LXDG::findIcon("list-remove","") );
- ui->tool_panel2_upplug->setIcon( LXDG::findIcon("go-up","") );
- ui->tool_panel2_dnplug->setIcon( LXDG::findIcon("go-down","") );
- ui->tool_panel2_getcolor->setIcon( LXDG::findIcon("preferences-desktop-color","") );
- ui->toolBox_panel2->setItemIcon(0,LXDG::findIcon("preferences-desktop-display",""));
- ui->toolBox_panel2->setItemIcon(1,LXDG::findIcon("preferences-plugin",""));
- ui->tabWidget_panels->setTabIcon( ui->tabWidget_panels->indexOf(ui->tab_panels), LXDG::findIcon("configure-toolbars","") );
- ui->tabWidget_panels->setTabIcon( ui->tabWidget_panels->indexOf(ui->tab_desktopInterface), LXDG::findIcon("preferences-plugin","") );
- */
//Menu Page
ui->tool_menu_add->setIcon( LXDG::findIcon("list-add","") );
@@ -158,44 +141,17 @@ void MainUI::setupConnections(){
//connect(ui->combo_desk_plugs, SIGNAL(currentIndexChanged(int)), this, SLOT(deskplugchanged()) );
connect(ui->combo_desk_bg, SIGNAL(currentIndexChanged(int)), this, SLOT(deskbgchanged()) );
connect(ui->radio_desk_multi, SIGNAL(toggled(bool)), this, SLOT(desktimechanged()) );
- connect(ui->push_addDesktopPlugin, SIGNAL(clicked()), this, SLOT(deskplugadded()) );
+ connect(ui->tool_desktop_addplugin, SIGNAL(clicked()), this, SLOT(deskplugadded()) );
+ connect(ui->tool_desktop_rmplugin, SIGNAL(clicked()), this, SLOT(deskplugremoved()) );
connect(ui->tool_desk_addbg, SIGNAL(clicked()), this, SLOT(deskbgadded()) );
connect(ui->tool_desk_addbgcolor, SIGNAL(clicked()), this, SLOT(deskbgcoloradded()) );
connect(ui->tool_desk_rmbg, SIGNAL(clicked()), this, SLOT(deskbgremoved()) );
connect(ui->spin_desk_min, SIGNAL(valueChanged(int)), this, SLOT(desktimechanged()) );
connect(ui->check_desktop_autolaunchers, SIGNAL(clicked()), this, SLOT(desktimechanged()) ); //just need to poke the save routines
-
+
//Panels Page
connect(ui->tool_panels_add, SIGNAL(clicked()), this, SLOT(newPanel()) );
- /*connect(ui->tool_panel1_add,SIGNAL(clicked()), this, SLOT(addpanel1()) );
- connect(ui->tool_panel2_add,SIGNAL(clicked()), this, SLOT(addpanel2()) );
- connect(ui->tool_panel1_rm,SIGNAL(clicked()), this, SLOT(rmpanel1()) );
- connect(ui->tool_panel2_rm,SIGNAL(clicked()), this, SLOT(rmpanel2()) );
- connect(ui->tool_panel1_getcolor,SIGNAL(clicked()), this, SLOT(getpanel1color()) );
- connect(ui->tool_panel2_getcolor,SIGNAL(clicked()), this, SLOT(getpanel2color()) );
- connect(ui->toolBox_panel1, SIGNAL(currentChanged(int)), this, SLOT(adjustpanel2()) );
- connect(ui->toolBox_panel2, SIGNAL(currentChanged(int)), this, SLOT(adjustpanel1()) );
- connect(ui->combo_panel1_loc, SIGNAL(currentIndexChanged(int)), this, SLOT(panelValChanged()) );
- connect(ui->combo_panel2_loc, SIGNAL(currentIndexChanged(int)), this, SLOT(panelValChanged()) );
- connect(ui->combo_panel1_align, SIGNAL(currentIndexChanged(int)), this, SLOT(panelValChanged()) );
- connect(ui->combo_panel2_align, SIGNAL(currentIndexChanged(int)), this, SLOT(panelValChanged()) );
- connect(ui->spin_panel1_size, SIGNAL(valueChanged(int)), this, SLOT(panelValChanged()) );
- connect(ui->spin_panel2_size, SIGNAL(valueChanged(int)), this, SLOT(panelValChanged()) );
- connect(ui->spin_panel1_length, SIGNAL(valueChanged(int)), this, SLOT(panelValChanged()) );
- connect(ui->spin_panel2_length, SIGNAL(valueChanged(int)), this, SLOT(panelValChanged()) );
- connect(ui->check_panel1_hidepanel, SIGNAL(clicked()), this, SLOT(panelValChanged()) );
- connect(ui->check_panel2_hidepanel, SIGNAL(clicked()), this, SLOT(panelValChanged()) );
- connect(ui->check_panel1_usetheme, SIGNAL(clicked()), this, SLOT(panelValChanged()) );
- connect(ui->check_panel2_usetheme, SIGNAL(clicked()), this, SLOT(panelValChanged()) );
- connect(ui->tool_panel1_addplugin, SIGNAL(clicked()), this, SLOT(addpanel1plugin()) );
- connect(ui->tool_panel1_rmplugin, SIGNAL(clicked()), this, SLOT(rmpanel1plugin()) );
- connect(ui->tool_panel1_upplug, SIGNAL(clicked()), this, SLOT(uppanel1plugin()) );
- connect(ui->tool_panel1_dnplug, SIGNAL(clicked()), this, SLOT(dnpanel1plugin()) );
- connect(ui->tool_panel2_addplugin, SIGNAL(clicked()), this, SLOT(addpanel2plugin()) );
- connect(ui->tool_panel2_rmplugin, SIGNAL(clicked()), this, SLOT(rmpanel2plugin()) );
- connect(ui->tool_panel2_upplug, SIGNAL(clicked()), this, SLOT(uppanel2plugin()) );
- connect(ui->tool_panel2_dnplug, SIGNAL(clicked()), this, SLOT(dnpanel2plugin()) );
- */
+
//Menu Page
connect(ui->tool_menu_add, SIGNAL(clicked()), this, SLOT(addmenuplugin()) );
connect(ui->tool_menu_rm, SIGNAL(clicked()), this, SLOT(rmmenuplugin()) );
@@ -208,8 +164,6 @@ 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_default_filemanager, SIGNAL(clicked()), this, SLOT(changeDefaultFileManager()) );
connect(ui->tool_default_terminal, SIGNAL(clicked()), this, SLOT(changeDefaultTerminal()) );
connect(ui->tool_default_webbrowser, SIGNAL(clicked()), this, SLOT(changeDefaultBrowser()) );
@@ -223,7 +177,6 @@ void MainUI::setupConnections(){
connect(ui->tool_session_addapp, SIGNAL(clicked()), this, SLOT(addsessionstartapp()) );
connect(ui->tool_session_addbin, SIGNAL(clicked()), this, SLOT(addsessionstartbin()) );
connect(ui->tool_session_addfile, SIGNAL(clicked()), this, SLOT(addsessionstartfile()) );
- //connect(ui->tool_session_rmapp, SIGNAL(clicked()), this, SLOT(rmsessionstartitem()) );
connect(ui->combo_session_wfocus, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) );
connect(ui->combo_session_wloc, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) );
connect(ui->combo_session_wtheme, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionthemechanged()) );
@@ -252,28 +205,6 @@ void MainUI::setupConnections(){
}
void MainUI::setupMenus(){
- //Desktop Plugin Menu
- /*ui->combo_desk_plugs->clear();
- QStringList plugs = PINFO->desktopPlugins();
- for(int i=0; i<plugs.length(); i++){
- LPI info = PINFO->desktopPluginInfo(plugs[i]);
- ui->combo_desk_plugs->addItem( LXDG::findIcon(info.icon,""), info.name, plugs[i]);
- }
- ui->tool_desk_addplug->setEnabled(!plugs.isEmpty());
- deskplugchanged(); //make sure it loads the right info
- */
-
- //Panel locations
- /*ui->combo_panel1_loc->clear();
- ui->combo_panel2_loc->clear();
- QStringList loc; loc << tr("Top") << tr("Bottom") << tr("Left") << tr("Right");
- ui->combo_panel1_loc->addItems(loc);
- ui->combo_panel2_loc->addItems(loc);
- ui->combo_panel1_align->clear(); ui->combo_panel2_align->clear();
- ui->combo_panel1_align->addItem(tr("Center"),"center"); ui->combo_panel2_align->addItem(tr("Center"),"center");
- ui->combo_panel1_align->addItem(tr("Top/Left"),"left"); ui->combo_panel2_align->addItem(tr("Top/Left"),"left");
- ui->combo_panel1_align->addItem(tr("Bottom/Right"),"right"); ui->combo_panel2_align->addItem(tr("Bottom/Right"),"right");
- */
//Session window manager settings
ui->combo_session_wfocus->clear();
@@ -347,22 +278,6 @@ QString MainUI::getColorStyle(QString current, bool allowTransparency){
return out;
}
-/*QString MainUI::getNewPanelPlugin(){
- QString out;
- //Now let the user select a new panel plugin
- QStringList plugs = PINFO->panelPlugins();
- QStringList names;
- for(int i=0; i<plugs.length(); i++){
- names << PINFO->panelPluginInfo(plugs[i]).name;
- }
- bool ok = false;
- QString sel = QInputDialog::getItem(this, tr("New Panel Plugin"), tr("Add Plugin:"), names, 0, false, &ok);
- if(ok && !sel.isEmpty()){
- out = plugs[ names.indexOf(sel) ];
- }
- return out;
-}*/
-
XDGDesktop MainUI::getSysApp(bool allowreset){
AppDialog dlg(this, sysApps);
dlg.allowReset(allowreset);
@@ -522,121 +437,43 @@ void MainUI::loadCurrentSettings(bool screenonly){
desktimechanged(); //ensure the display gets updated (in case the radio selection did not change);
ui->label_desk_res->setText( tr("Screen Resolution:")+"\n"+QString::number(desktop->screenGeometry(cdesk).width())+"x"+QString::number(desktop->screenGeometry(cdesk).height()) );
+ QStringList dplugs = settings->value(DPrefix+"pluginlist",QStringList()).toStringList();
+ ui->list_desktop_plugins->clear();
+ for(int i=0; i<dplugs.length(); i++){
+ QListWidgetItem* it = new QListWidgetItem();
+ it->setWhatsThis(dplugs[i]); //save the full thing instantly
+ //Now load the rest of the info about the plugin
+ QString num;
+ if(dplugs[i].contains("---")){
+ num = dplugs[i].section("---",1,1).section(".",1,1).simplified(); //Skip the screen number
+ if(num=="1"){ num.clear(); } //don't bother showing the number
+ dplugs[i] = dplugs[i].section("---",0,0);
+ }
+ if(dplugs[i].startsWith("applauncher::")){
+ bool ok = false;
+ XDGDesktop app = LXDG::loadDesktopFile(dplugs[i].section("::",1,50), ok);
+ if(!ok){ continue; } //invalid for some reason
+ //Now fill the item with the necessary info
+ it->setText(app.name);
+ it->setIcon(LXDG::findIcon(app.icon,"") );
+ it->setToolTip(app.comment);
+ }else{
+ //Load the info for this plugin
+ LPI info = PINFO->desktopPluginInfo(dplugs[i]);
+ if( info.ID.isEmpty() ){ continue; } //invalid plugin for some reason
+ it->setText(info.name);
+ it->setToolTip(info.description);
+ it->setIcon( LXDG::findIcon(info.icon,"") );
+ }
+ if(!num.isEmpty()){ it->setText( it->text()+" ("+num+")"); } //append the number
+ ui->list_desktop_plugins->addItem(it);
+ }
+
//Panels Page
int panels = settings->value(DPrefix+"panels",-1).toInt();
if(panels==-1 && primary){ panels=1; }
panelnumber = panels;
loadPanels();
- /*if(panels >= 1){
- //Load the panel 1 information
- QString PPrefix = "panel"+QString::number(cdesk)+".0/";
- ui->toolBox_panel1->setVisible(true);
- ui->spin_panel1_size->setValue( settings->value( PPrefix+"height",30).toInt() );
- ui->spin_panel1_length->setValue( settings->value( PPrefix+"lengthPercent",100).toInt() );
- ui->check_panel1_hidepanel->setChecked( settings->value(PPrefix+"hidepanel", false).toBool() );
- ui->check_panel1_usetheme->setChecked( !settings->value(PPrefix+"customcolor",false).toBool() );
- QString loc = settings->value(PPrefix+"location","top").toString().toLower();
- if(loc=="top"){ ui->combo_panel1_loc->setCurrentIndex(0); }
- else if(loc=="bottom"){ ui->combo_panel1_loc->setCurrentIndex(1); }
- else if(loc=="left"){ ui->combo_panel1_loc->setCurrentIndex(2); }
- else{ ui->combo_panel1_loc->setCurrentIndex(3); } //right
- int aindex = ui->combo_panel1_align->findData(settings->value(PPrefix+"pinLocation","center").toString().toLower());
- if(aindex>=0){ ui->combo_panel1_align->setCurrentIndex(aindex); }
- QStringList plugs = settings->value(PPrefix+"pluginlist", QStringList()).toStringList();
- if(plugs.isEmpty() && primary){ plugs << "userbutton" << "taskmanager" << "systemtray" << "clock" << "systemdashboard"; }
- ui->list_panel1_plugins->clear();
- for(int i=0; i<plugs.length(); i++){
- QString pid = plugs[i].section("---",0,0);
- if(pid.startsWith("applauncher")){
- bool ok = false;
- XDGDesktop desk = LXDG::loadDesktopFile(pid.section("::",1,1),ok);
- if(ok){
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(desk.icon,""), desk.name );
- it->setWhatsThis(plugs[i]); //make sure to preserve the entire plugin ID (is the unique version)
- ui->list_panel1_plugins->addItem(it);
- }
- }else{
- LPI info = PINFO->panelPluginInfo(pid);
- if(!info.ID.isEmpty()){
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name );
- it->setWhatsThis(plugs[i]); //make sure to preserve the entire plugin ID (is the unique version)
- ui->list_panel1_plugins->addItem(it);
- }
- }
- }
- QString color = settings->value(PPrefix+"color","rgba(255,255,255,160)").toString();
- ui->label_panel1_sample->setWhatsThis(color);
- ui->label_panel1_sample->setStyleSheet("background: "+color);
- //panelnumber++;
- }else{
- //Panel 1 defaults
- ui->toolBox_panel1->setVisible(false); //not initially visible
- ui->spin_panel1_size->setValue(30);
- ui->spin_panel1_length->setValue(100);
- ui->check_panel1_hidepanel->setChecked( false );
- ui->check_panel1_usetheme->setChecked( true );
- ui->combo_panel1_loc->setCurrentIndex(0); //Top
- ui->combo_panel1_align->setCurrentIndex(0); //Center
- ui->list_panel1_plugins->clear();
- ui->label_panel1_sample->setWhatsThis("rgba(255,255,255,160)");
- ui->label_panel1_sample->setStyleSheet("background: rgba(255,255,255,160)");
- }
- if(panels >= 2){
- //Load the panel 2 information
- ui->toolBox_panel2->setVisible(true);
- QString PPrefix = "panel"+QString::number(cdesk)+".1/";
- ui->spin_panel2_size->setValue( settings->value( PPrefix+"height",30).toInt() );
- ui->spin_panel2_length->setValue( settings->value( PPrefix+"lengthPercent",100).toInt() );
- ui->check_panel2_hidepanel->setChecked( settings->value(PPrefix+"hidepanel", false).toBool() );
- ui->check_panel2_usetheme->setChecked( !settings->value(PPrefix+"customcolor",false).toBool() );
- QString loc = settings->value(PPrefix+"location","top").toString().toLower();
- if(loc=="top"){ ui->combo_panel2_loc->setCurrentIndex(0); }
- else if(loc=="bottom"){ ui->combo_panel2_loc->setCurrentIndex(1); }
- else if(loc=="left"){ ui->combo_panel2_loc->setCurrentIndex(2); }
- else{ ui->combo_panel2_loc->setCurrentIndex(3); } //right
- int aindex = ui->combo_panel2_align->findData(settings->value(PPrefix+"pinLocation","center").toString().toLower());
- if(aindex>=0){ ui->combo_panel2_align->setCurrentIndex(aindex); }
- QStringList plugs = settings->value(PPrefix+"pluginlist", QStringList()).toStringList();
- ui->list_panel2_plugins->clear();
- for(int i=0; i<plugs.length(); i++){
- QString pid = plugs[i].section("---",0,0);
- if(pid.startsWith("applauncher")){
- bool ok = false;
- XDGDesktop desk = LXDG::loadDesktopFile(pid.section("::",1,1),ok);
- if(ok){
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(desk.icon,""), desk.name );
- it->setWhatsThis(plugs[i]); //make sure to preserve the entire plugin ID (is the unique version)
- ui->list_panel2_plugins->addItem(it);
- }
- }else{
- LPI info = PINFO->panelPluginInfo(pid);
- if(!info.ID.isEmpty()){
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name );
- it->setWhatsThis(plugs[i]); //make sure to preserve the entire plugin ID (is the unique version)
- ui->list_panel2_plugins->addItem(it);
- }
- }
- }
- QString color = settings->value(PPrefix+"color","rgba(255,255,255,160)").toString();
- ui->label_panel2_sample->setWhatsThis(color);
- ui->label_panel2_sample->setStyleSheet("background: "+color);
- //panelnumber++;
- }else{
- //Panel 2 defaults
- ui->toolBox_panel2->setVisible(false); //not initially visible
- ui->spin_panel2_size->setValue(30);
- ui->spin_panel2_length->setValue(100);
- ui->check_panel2_hidepanel->setChecked( false );
- ui->check_panel2_usetheme->setChecked( true );
- ui->combo_panel2_loc->setCurrentIndex(1); //Bottom
- ui->combo_panel2_align->setCurrentIndex(0); //Center
- ui->list_panel2_plugins->clear();
- ui->label_panel2_sample->setWhatsThis("rgba(255,255,255,160)");
- ui->label_panel2_sample->setStyleSheet("background: rgba(255,255,255,160)");
- }
- checkpanels(); //make sure buttons are updated
- */
-
if(!screenonly){
// Menu Page
@@ -691,7 +528,7 @@ void MainUI::loadCurrentSettings(bool screenonly){
void MainUI::saveCurrentSettings(bool screenonly){
QString DPrefix = "desktop-"+QString::number(currentDesktop())+"/";
-
+ bool needreload = false;
// Desktop Page
if(moddesk){
QStringList bgs; //get the list of backgrounds to use
@@ -707,6 +544,14 @@ void MainUI::saveCurrentSettings(bool screenonly){
settings->setValue(DPrefix+"background/filelist", bgs);
settings->setValue(DPrefix+"background/minutesToChange", ui->spin_desk_min->value());
settings->setValue(DPrefix+"generateDesktopIcons", ui->check_desktop_autolaunchers->isChecked());
+ QStringList plugs;
+ for(int i=0; i<ui->list_desktop_plugins->count(); i++){
+ plugs << ui->list_desktop_plugins->item(i)->whatsThis();
+ }
+ if(settings->value(DPrefix+"pluginlist",QStringList()).toStringList() != plugs){
+ settings->setValue(DPrefix+"pluginlist", plugs);
+ needreload = true;
+ }
}
// Panels Page
@@ -714,55 +559,6 @@ void MainUI::saveCurrentSettings(bool screenonly){
settings->setValue(DPrefix+"panels", PANELS.length());
savePanels();
}
- /*settings->setValue(DPrefix+"panels", panelnumber);
- if(panelnumber>=1){
- QString PPrefix = "panel"+QString::number(currentDesktop())+".0/";
- settings->setValue(PPrefix+"color", ui->label_panel1_sample->whatsThis());
- settings->setValue(PPrefix+"height", ui->spin_panel1_size->value());
- settings->setValue(PPrefix+"lengthPercent", ui->spin_panel1_length->value());
- settings->setValue(PPrefix+"hidepanel", ui->check_panel1_hidepanel->isChecked());
- settings->setValue(PPrefix+"customcolor", !ui->check_panel1_usetheme->isChecked());
- int loc = ui->combo_panel1_loc->currentIndex();
- if(loc==0){ settings->setValue(PPrefix+"location", "top"); }
- else if(loc==1){ settings->setValue(PPrefix+"location", "bottom"); }
- else if(loc==2){ settings->setValue(PPrefix+"location", "left"); }
- else{ settings->setValue(PPrefix+"location", "right"); }
- settings->setValue(PPrefix+"pinLocation", ui->combo_panel1_align->currentData().toString());
- QStringList plugs;
- for(int i=0; i<ui->list_panel1_plugins->count(); i++){
- plugs << ui->list_panel1_plugins->item(i)->whatsThis();
- }
- settings->setValue(PPrefix+"pluginlist",plugs);
-
- }else{
- //Clear that panel's saved settings
- QStringList keys = settings->allKeys().filter("panel"+QString::number(currentDesktop())+".0/");
- for(int i=0; i<keys.length(); i++){ settings->remove(keys[i]); }
- }
- if(panelnumber>=2){
- QString PPrefix = "panel"+QString::number(currentDesktop())+".1/";
- settings->setValue(PPrefix+"color", ui->label_panel2_sample->whatsThis());
- settings->setValue(PPrefix+"height", ui->spin_panel2_size->value());
- settings->setValue(PPrefix+"lengthPercent", ui->spin_panel2_length->value());
- settings->setValue(PPrefix+"hidepanel", ui->check_panel2_hidepanel->isChecked());
- settings->setValue(PPrefix+"customcolor", !ui->check_panel2_usetheme->isChecked());
- int loc = ui->combo_panel2_loc->currentIndex();
- if(loc==0){ settings->setValue(PPrefix+"location", "top"); }
- else if(loc==1){ settings->setValue(PPrefix+"location", "bottom"); }
- else if(loc==2){ settings->setValue(PPrefix+"location", "left"); }
- else{ settings->setValue(PPrefix+"location", "right"); }
- settings->setValue(PPrefix+"pinLocation", ui->combo_panel2_align->currentData().toString());
- QStringList plugs;
- for(int i=0; i<ui->list_panel2_plugins->count(); i++){
- plugs << ui->list_panel2_plugins->item(i)->whatsThis();
- }
- settings->setValue(PPrefix+"pluginlist",plugs);
- }else{
- //Clear that panel's saved settings
- QStringList keys = settings->allKeys().filter("panel"+QString::number(currentDesktop())+".1/");
- for(int i=0; i<keys.length(); i++){ settings->remove(keys[i]); }
- }
- }*/
// Menu Page
if(modmenu && !screenonly){
@@ -795,25 +591,17 @@ void MainUI::saveCurrentSettings(bool screenonly){
if(!screenonly){ modmenu = modshort = moddef = modses = false; }
ui->push_save->setEnabled(modmenu || modshort || moddef || modses); //wait for new changes
//ui->push_save->setVisible(!ui->actionDefaults->isChecked() || modmenu || modshort || moddef || modses);
+ if(needreload){
+ //Wait 1 second
+ for(int i=0; i<10; i++){ QApplication::processEvents(); usleep(100000); }
+ loadCurrentSettings(screenonly);
+ }
}
//===============
// DESKTOP PAGE
//===============
-/*void MainUI::deskplugchanged(){
- //NOTE: This is not a major change and will not enable the save button
- if(ui->combo_desk_plugs->count()==0){
- //No plugins available
- ui->label_desk_pluginfo->setText("");
- return;
- }
- //Load the new plugin summary
- QString plug = ui->combo_desk_plugs->itemData( ui->combo_desk_plugs->currentIndex() ).toString();
- LPI info = PINFO->desktopPluginInfo(plug);
- ui->label_desk_pluginfo->setText( info.description );
-}*/
-
void MainUI::deskbgchanged(){
//Load the new image preview
if(ui->combo_desk_bg->count()==0){
@@ -906,28 +694,55 @@ void MainUI::deskplugadded(){
dlg.exec();
if( !dlg.selected ){ return; } //cancelled
QString newplug = dlg.plugID;
- //QString newplug = ui->combo_desk_plugs->itemData( ui->combo_desk_plugs->currentIndex() ).toString();
+ QListWidgetItem *it = new QListWidgetItem();
if(newplug=="applauncher"){
//Prompt for the application to add
XDGDesktop app = getSysApp();
if(app.filePath.isEmpty()){ return; } //cancelled
newplug.append("::"+app.filePath);
- }
- settings->sync(); //make sure we have the newly-modified list from the desktop (unique IDs for new plugins)
+ //Now fill the item with the necessary info
+ it->setWhatsThis(newplug);
+ it->setText(app.name);
+ it->setIcon(LXDG::findIcon(app.icon,"") );
+ it->setToolTip(app.comment);
+ }else{
+ //Load the info for this plugin
+ LPI info = PINFO->desktopPluginInfo(newplug);
+ if( info.ID.isEmpty() ){ return; } //invalid plugin for some reason (should never happen)
+ it->setWhatsThis(newplug);
+ it->setText(info.name);
+ it->setToolTip(info.description);
+ it->setIcon( LXDG::findIcon(info.icon,"") );
+ }
+ ui->list_desktop_plugins->addItem(it);
+ ui->list_desktop_plugins->scrollToItem(it);
+ ui->push_save->setEnabled(true);
+ moddesk = true;
+ /*settings->sync(); //make sure we have the newly-modified list from the desktop (unique IDs for new plugins)
QString DPrefix = "desktop-"+QString::number(currentDesktop())+"/";
QStringList plugins = settings->value(DPrefix+"pluginlist").toStringList();
//qDebug() << "Current Plugins:" << plugins;
plugins << newplug;
//qDebug() << "New Plugins:" << plugins;
settings->setValue(DPrefix+"pluginlist", plugins);
- settings->sync();
+ settings->sync();*/
}
+void MainUI::deskplugremoved(){
+ QList<QListWidgetItem*> sel = ui->list_desktop_plugins->selectedItems();
+ if(sel.isEmpty()){ return; } //nothing to do
+ for(int i=0; i<sel.length(); i++){
+ delete sel[i];
+ }
+ ui->push_save->setEnabled(true);
+ moddesk = true;
+}
//=============
// PANELS PAGE
//=============
void MainUI::panelValChanged(){
+ ui->tool_panels_add->setEnabled(panelnumber < 12);
if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
}
@@ -939,7 +754,13 @@ void MainUI::newPanel(){
PANELS << tmp;
connect(tmp, SIGNAL(PanelChanged()), this, SLOT(panelValChanged()) );
connect(tmp, SIGNAL(PanelRemoved(int)), this, SLOT(removePanel(int)) );
- ui->scroll_panels->widget()->layout()->addWidget(tmp);
+ static_cast<QBoxLayout*>(ui->scroll_panels->widget()->layout())->insertWidget(PANELS.length()-1, tmp);
+ //update the widget first (2 necessary for scroll below to work)
+ ui->scroll_panels->update();
+ QApplication::processEvents();
+ QApplication::processEvents();
+ ui->scroll_panels->ensureWidgetVisible(tmp);
+ panelValChanged();
}
void MainUI::removePanel(int pan){
@@ -967,6 +788,7 @@ void MainUI::loadPanels(){
//Now create new panels
int dnum = currentDesktop();
if(ui->scroll_panels->widget()->layout()==0){ ui->scroll_panels->widget()->setLayout( new QHBoxLayout() ); }
+ ui->scroll_panels->widget()->layout()->setAlignment(Qt::AlignLeft);
for(int i=0; i<panelnumber; i++){
PanelWidget *tmp = new PanelWidget(ui->scroll_panels->widget(), this, PINFO);
tmp->LoadSettings(settings, dnum, i);
@@ -975,6 +797,7 @@ void MainUI::loadPanels(){
connect(tmp, SIGNAL(PanelRemoved(int)), this, SLOT(removePanel(int)) );
ui->scroll_panels->widget()->layout()->addWidget(tmp);
}
+ static_cast<QHBoxLayout*>(ui->scroll_panels->widget()->layout())->addStretch();
}
void MainUI::savePanels(){
@@ -983,216 +806,6 @@ void MainUI::savePanels(){
}
}
-/*void MainUI::addpanel1(){
- ui->toolBox_panel1->setVisible(true);
- panelnumber = 1;
- checkpanels();
- ui->push_save->setEnabled(true);
- modpan = true;
-}
-
-void MainUI::addpanel2(){
- ui->toolBox_panel2->setVisible(true);
- panelnumber = 2;
- checkpanels();
- ui->push_save->setEnabled(true);
- modpan = true;
-}
-
-void MainUI::rmpanel1(){
- ui->toolBox_panel1->setVisible(false);
- panelnumber = 0;
- checkpanels();
- ui->push_save->setEnabled(true);
- modpan = true;
-}
-
-void MainUI::rmpanel2(){
- ui->toolBox_panel2->setVisible(false);
- panelnumber = 1;
- checkpanels();
- ui->push_save->setEnabled(true);
- modpan = true;
-}
-
-void MainUI::checkpanels(){
- //This checks the primary panel buttons/visibility
- //panel 1
- ui->tool_panel1_add->setVisible(panelnumber < 1);
- ui->tool_panel1_rm->setVisible(panelnumber == 1);
- ui->toolBox_panel1->setVisible(panelnumber>0);
- //panel1 label is always visible
- //panel 2
- ui->tool_panel2_add->setVisible(panelnumber==1);
- ui->tool_panel2_rm->setVisible(panelnumber>1);
- ui->toolBox_panel2->setVisible(panelnumber>1);
- ui->label_panel2->setVisible(panelnumber>0);
-
- //Sizing/layout fix for side-by-side vertical layouts
- if(panelnumber<1){
- ui->gridLayout_panels->setColumnStretch(2,1);
- }else{
- ui->gridLayout_panels->setColumnStretch(2,0);
- }
-
-}
-
-void MainUI::adjustpanel1(){
- //Adjust panel 1 to complement a panel 2 change
- if(loading || panadjust){ return; }
- panadjust = true;
- qDebug() << "Adjust Panel 1:";
- //bool valchanged = ui->toolBox_panel1->currentIndex()==ui->toolBox_panel2->currentIndex();
- //if(!valchanged){
- //Just a toolbox page change - switch to match and exit
- ui->toolBox_panel1->setCurrentIndex( ui->toolBox_panel2->currentIndex() );
- panadjust = false;
- return;
- //}
- //panadjust = false;
- //if(!loading && valchanged){ ui->push_save->setEnabled(true); modpan = true; }
-}
-
-void MainUI::adjustpanel2(){
- if(loading || panadjust){ return; }
- panadjust = true;
- //Adjust panel 2 to complement a panel 1 change
- qDebug() << "Adjust Panel 2:";
- //bool valchanged = ui->toolBox_panel1->currentIndex()==ui->toolBox_panel2->currentIndex();
- //if(!valchanged){
- //Just a toolbox page change - switch to match and exit
- ui->toolBox_panel2->setCurrentIndex( ui->toolBox_panel1->currentIndex() );
- panadjust = false;
- return;
- //}
- //panadjust = false;
- //if(!loading && valchanged){ ui->push_save->setEnabled(true); modpan = true; }
-}
-
-
-void MainUI::getpanel1color(){
- QString color = getColorStyle(ui->label_panel1_sample->whatsThis());
- if(color.isEmpty()){ return; } //nothing selected
- ui->label_panel1_sample->setStyleSheet("background: "+color);
- ui->label_panel1_sample->setWhatsThis(color);
- ui->push_save->setEnabled(true);
- modpan = true;
-}
-
-void MainUI::getpanel2color(){
- QString color = getColorStyle(ui->label_panel2_sample->whatsThis());
- if(color.isEmpty()){ return; } //nothing selected
- ui->label_panel2_sample->setStyleSheet("background: "+color);
- ui->label_panel2_sample->setWhatsThis(color);
- ui->push_save->setEnabled(true);
- modpan = true;
-}
-
-void MainUI::addpanel1plugin(){
- GetPluginDialog dlg(this);
- dlg.LoadPlugins("panel", PINFO);
- dlg.exec();
- if(!dlg.selected){ return; } //cancelled
- QString pan = dlg.plugID; //getNewPanelPlugin();
- if(pan == "applauncher"){
- //Prompt for the application to add
- XDGDesktop app = getSysApp();
- if(app.filePath.isEmpty()){ return; } //cancelled
- pan.append("::"+app.filePath);
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(app.icon,""), app.name);
- it->setWhatsThis(pan);
- ui->list_panel1_plugins->addItem(it);
- ui->list_panel1_plugins->setCurrentItem(it);
- ui->list_panel1_plugins->scrollToItem(it);
- }else{
- if(pan.isEmpty()){ return; } //nothing selected
- //Add the new plugin to the list
- LPI info = PINFO->panelPluginInfo(pan);
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name);
- it->setWhatsThis(info.ID);
- ui->list_panel1_plugins->addItem(it);
- ui->list_panel1_plugins->setCurrentItem(it);
- ui->list_panel1_plugins->scrollToItem(it);
- }
- checkpanels(); //update buttons
- if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
-}
-
-void MainUI::addpanel2plugin(){
- GetPluginDialog dlg(this);
- dlg.LoadPlugins("panel", PINFO);
- dlg.exec();
- if(!dlg.selected){ return; } //cancelled
- QString pan = dlg.plugID; //getNewPanelPlugin();
- if(pan == "applauncher"){
- //Prompt for the application to add
- XDGDesktop app = getSysApp();
- if(app.filePath.isEmpty()){ return; } //cancelled
- pan.append("::"+app.filePath);
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(app.icon,""), app.name);
- it->setWhatsThis(pan);
- ui->list_panel2_plugins->addItem(it);
- ui->list_panel2_plugins->setCurrentItem(it);
- ui->list_panel2_plugins->scrollToItem(it);
- }else{
- if(pan.isEmpty()){ return; } //nothing selected
- //Add the new plugin to the list
- LPI info = PINFO->panelPluginInfo(pan);
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name);
- it->setWhatsThis(info.ID);
- ui->list_panel2_plugins->addItem(it);
- ui->list_panel2_plugins->setCurrentItem(it);
- ui->list_panel2_plugins->scrollToItem(it);
- }
- checkpanels(); //update buttons
- if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
-}
-
-void MainUI::rmpanel1plugin(){
- if(ui->list_panel1_plugins->currentRow() < 0){ return; }
- delete ui->list_panel1_plugins->takeItem( ui->list_panel1_plugins->currentRow() );
- if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
-}
-
-void MainUI::rmpanel2plugin(){
- if(ui->list_panel2_plugins->currentRow() < 0){ return; }
- delete ui->list_panel2_plugins->takeItem( ui->list_panel2_plugins->currentRow() );
- if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
-}
-
-void MainUI::uppanel1plugin(){
- int row = ui->list_panel1_plugins->currentRow();
- if( row <= 0){ return; }
- ui->list_panel1_plugins->insertItem(row-1, ui->list_panel1_plugins->takeItem(row));
- ui->list_panel1_plugins->setCurrentRow(row-1);
- if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
-}
-
-void MainUI::uppanel2plugin(){
- int row = ui->list_panel2_plugins->currentRow();
- if( row <= 0){ return; }
- ui->list_panel2_plugins->insertItem(row-1, ui->list_panel2_plugins->takeItem(row));
- ui->list_panel2_plugins->setCurrentRow(row-1);
- if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
-}
-
-void MainUI::dnpanel1plugin(){
- int row = ui->list_panel1_plugins->currentRow();
- if( row < 0 || row >= (ui->list_panel1_plugins->count()-1) ){ return; }
- ui->list_panel1_plugins->insertItem(row+1, ui->list_panel1_plugins->takeItem(row));
- ui->list_panel1_plugins->setCurrentRow(row+1);
- if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
-}
-
-void MainUI::dnpanel2plugin(){
- int row = ui->list_panel2_plugins->currentRow();
- if( row < 0 || row >= (ui->list_panel2_plugins->count()-1) ){ return; }
- ui->list_panel2_plugins->insertItem(row+1, ui->list_panel2_plugins->takeItem(row));
- ui->list_panel2_plugins->setCurrentRow(row+1);
- if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
-}*/
-
-
//============
// MENU PAGE
//============
@@ -1276,7 +889,8 @@ void MainUI::loadKeyboardShortcuts(){
<< "Exec lumina-open -volumedown::::"+tr("Audio Volume Down") \
<< "Exec lumina-open -brightnessup::::"+tr("Screen Brightness Up") \
<< "Exec lumina-open -brightnessdown::::"+tr("Screen Brightness Down") \
- << "Exec lumina-screenshot::::"+tr("Take Screenshot");
+ << "Exec lumina-screenshot::::"+tr("Take Screenshot") \
+ << "Exec xscreensaver-command -lock::::"+tr("Lock Screen");
for(int i=0; i<special.length(); i++){
QString spec = info.filter(":"+special[i].section("::::",0,0)).join("").simplified();
QTreeWidgetItem *it = new QTreeWidgetItem();
diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h
index 04c6253c..ee5b5feb 100644
--- a/lumina-config/mainUI.h
+++ b/lumina-config/mainUI.h
@@ -1,6 +1,6 @@
//===========================================
// Lumina-DE source code
-// Copyright (c) 2014, Ken Moore
+// Copyright (c) 2014-2015, Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
@@ -107,6 +107,7 @@ private slots:
void deskbgadded();
void deskbgcoloradded();
void deskplugadded();
+ void deskplugremoved();
//Panels Page
@@ -115,26 +116,6 @@ private slots:
void removePanel(int); //connected to a signal from the panel widget
void loadPanels();
void savePanels();
-
- /*void addpanel1();
- void addpanel2();
- void rmpanel1();
- void rmpanel2();
-
- void checkpanels();
- void adjustpanel1();
- void adjustpanel2();
-
- void getpanel1color();
- void getpanel2color();
- void addpanel1plugin();
- void addpanel2plugin();
- void rmpanel1plugin();
- void rmpanel2plugin();
- void uppanel1plugin();
- void uppanel2plugin();
- void dnpanel1plugin();
- void dnpanel2plugin();*/
//Menu Page/Tab
void addmenuplugin();
@@ -156,8 +137,6 @@ private slots:
void changeDefaultTerminal();
void loadDefaultSettings();
//void saveDefaultSettings();
- //void adddefaultgroup();
- //void adddefaultextension();
void cleardefaultitem();
void setdefaultitem();
void setdefaultbinary();
diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui
index 6a05726d..db944804 100644
--- a/lumina-config/mainUI.ui
+++ b/lumina-config/mainUI.ui
@@ -36,7 +36,7 @@
<item>
<widget class="QFrame" name="group_screen">
<property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
+ <enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
@@ -381,13 +381,65 @@
<item>
<widget class="QTabWidget" name="tabWidget_panels">
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="tab_desktopInterface">
<attribute name="title">
<string>Desktop</string>
</attribute>
- <layout class="QGridLayout" name="gridLayout_4">
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Quick-Access Menu</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" rowspan="3">
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="label_15">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Embedded Utilities</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QListWidget" name="list_menu"/>
+ </item>
+ <item row="1" column="2">
+ <widget class="QListWidget" name="list_desktop_plugins">
+ <property name="selectionMode">
+ <enum>QAbstractItemView::ExtendedSelection</enum>
+ </property>
+ <property name="sortingEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
@@ -433,112 +485,39 @@
</item>
</layout>
</item>
- <item row="1" column="0">
- <widget class="QListWidget" name="list_menu"/>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="label_10">
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Quick-Access Menu</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="label_15">
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Embedded Utilities</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="1" rowspan="2">
- <layout class="QVBoxLayout" name="verticalLayout_18">
+ <item row="2" column="2">
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <spacer name="horizontalSpacer_7">
- <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="QPushButton" name="push_addDesktopPlugin">
- <property name="text">
- <string>Add Utility to Screen</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_8">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QCheckBox" name="check_desktop_autolaunchers">
+ <widget class="QToolButton" name="tool_desktop_addplugin">
<property name="text">
- <string>Auto-Create Desktop Shortcuts</string>
+ <string notr="true">add</string>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="label_23">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
+ <widget class="QToolButton" name="tool_desktop_rmplugin">
<property name="text">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Note:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Modifying or removing embedded utilities is performed from the desktop itself. Each screen may be individually unlocked (allowing modifications) from the quick-access menu.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <property name="scaledContents">
- <bool>true</bool>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ <string notr="true">rem</string>
</property>
- <property name="wordWrap">
- <bool>true</bool>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="margin">
- <number>0</number>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>20</height>
+ </size>
</property>
- <property name="indent">
- <number>10</number>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="check_desktop_autolaunchers">
+ <property name="text">
+ <string>Generate Desktop Links</string>
</property>
</widget>
</item>
@@ -592,7 +571,7 @@
<x>0</x>
<y>0</y>
<width>498</width>
- <height>270</height>
+ <height>292</height>
</rect>
</property>
</widget>
@@ -1385,7 +1364,7 @@
<x>0</x>
<y>0</y>
<width>117</width>
- <height>28</height>
+ <height>17</height>
</rect>
</property>
<property name="sizePolicy">
@@ -1498,16 +1477,6 @@
</item>
</layout>
</widget>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>596</width>
- <height>20</height>
- </rect>
- </property>
- </widget>
<widget class="QToolBar" name="toolBar">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp
index e244e4b1..ec56b7b0 100644
--- a/lumina-desktop/LDesktop.cpp
+++ b/lumina-desktop/LDesktop.cpp
@@ -186,19 +186,31 @@ LDPluginContainer* LDesktop::CreateDesktopPluginContainer(LDPlugin *plug){
}
//Create a new plugin container
LDPluginContainer *win = new LDPluginContainer(plug, desktoplocked);
+ win->loadInitialSize(); //Sizing should be done before adding the window to the area
if(desktoplocked){
- bgDesktop->addSubWindow(win, Qt::Tool | Qt::FramelessWindowHint);
- }else{ bgDesktop->addSubWindow(win, Qt::Tool | Qt::FramelessWindowHint | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); }
- win->loadInitialPosition();
+ bgDesktop->addSubWindow(win, Qt::Tool | Qt::FramelessWindowHint);
+ }else{
+ bgDesktop->addSubWindow(win, Qt::Tool | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
+ }
+ if( !win->hasFixedPosition() ){
+ //NOTE: This section *only* runs for new plugins - it does not run for re-creations of old plugins
+ //Need to determine the location of the plugin (leave size alone)
+ if(DEBUG){ qDebug() << " --- Floating Plugin - find a spot for it"; }
+ QPoint pt = findNewPluginLocation(availDPArea, win->size());
+ if(pt.x()>=0 && pt.y()>=0){
+ win->saveNewPosition(pt);
+ win->move(pt);
+ if(DEBUG){ qDebug() << " --- Moving to point:" << pt; }
+ }
+ //Make sure to remove this plugin from the availability region
+ availDPArea = availDPArea.subtracted( QRegion(win->geometry()) );
+ }
+ QApplication::processEvents();
+ QTimer::singleShot(300+(5*PLUGINS.length()), win, SLOT(loadInitialPosition()) ); //Now load the position (if one is saved)
if(DEBUG){
qDebug() << "Initial DP Geom:" << plug->geometry();
qDebug() << " - Container Geom:" << win->geometry();
}
- win->show();
- plug->update();
- win->update();
- QApplication::processEvents();
- bgDesktop->update();
QApplication::processEvents();
connect(win, SIGNAL(PluginRemoved(QString)), this, SLOT(DesktopPluginRemoved(QString)) );
@@ -208,28 +220,30 @@ LDPluginContainer* LDesktop::CreateDesktopPluginContainer(LDPlugin *plug){
QPoint LDesktop::findNewPluginLocation(QRegion avail, QSize winsize){
//This just searches through the region of available space until it find the first location where it
// will fit without overlapping anything else (scanning left->right, top->bottom)
+ //return QPoint(-1,-1); //just for testing
QRect bounds = avail.boundingRect();
- if(bounds.width()<winsize.width() || bounds.height()<winsize.height()){ return QPoint(-1,-1); }
//qDebug() << "Bounds:" << bounds;
+ if(bounds.width()<winsize.width() || bounds.height()<winsize.height()){ return QPoint(-1,-1); }
QPoint pt = bounds.topLeft(); //start in upper-left corner
bool found = false;
- //qDebug() << "Check Availability:" << bounds << winsize;
+ if(DEBUG){ qDebug() << "Check Availability:" << bounds << winsize; }
while(pt.y()+winsize.height() < bounds.bottom() && !found){
int dy = winsize.height()/2;
while(pt.x()+winsize.width() < bounds.right() && !found){
- //qDebug() << "Check X:" << pt << winsize;
//Check the horizontal position (incrementing as necessary)
- QRect inter = avail.intersected(QRect(pt, winsize)).boundingRect();
- //qDebug() << " - Inter:" << inter;
- if(inter.size() == winsize && avail.contains(inter) ){ found = true; } //use this point
+ QRegion intersect = avail.intersected(QRect(pt, winsize)); // full intersection
+ if(DEBUG){ qDebug() << "Check X:" << pt << " - Inter:" << intersect.boundingRect(); }
+ if(intersect.boundingRect().size()==winsize && intersect.rects().length()==1 ){ found = true; } //use this point
else{
+ QRect inter = avail.intersected(QRect(pt, QSize(winsize.width(),1))).boundingRect(); //1D intersection in X-dir
int dx = winsize.width() - inter.width();
if(dx>0 && inter.left() > pt.x()){ pt.setX( inter.left() ); }
else if(inter.width()==0){ pt.setX( pt.x()+winsize.width() ); }
else{ pt.setX( pt.x()+inter.width() ); }
//Also adjust the dy value to the smallest amount
- int ddy = inter.height() - winsize.height();
+ inter = avail.intersected(QRect(pt, QSize(1,winsize.height()))).boundingRect(); //1D intersection in X-dir
+ int ddy = inter.y()-pt.y();
if(ddy < dy && ddy>0){ dy = ddy; }
}
@@ -238,7 +252,7 @@ QPoint LDesktop::findNewPluginLocation(QRegion avail, QSize winsize){
//Nothing in the horizontal direction - increment the vertical dimension
pt.setX( bounds.left() ); //reset back to the left-most edge
pt.setY( pt.y()+dy );
- //qDebug() << "Check Y:" << pt << dy;
+ if(DEBUG){ qDebug() << "Check Y:" << pt << dy; }
}
}
//qDebug() << "Found Point:" << found << pt;
@@ -404,7 +418,6 @@ void LDesktop::UpdateDesktop(){
}
}
//Go through the plugins and remove any existing ones that do not show up on the current list
-
for(int i=0; i<PLUGINS.length(); i++){
if(!plugins.contains(PLUGINS[i]->ID())){
//Remove this plugin (with settings) - is not currently listed
@@ -412,15 +425,18 @@ void LDesktop::UpdateDesktop(){
i--;
}
}
- //Now get an accounting of all the available/used space
- QRegion avail(this->availableScreenGeom());
- if(avail.isEmpty()){ avail = QRegion( QRect(QPoint(0,0),desktop->screenGeometry(desktopnumber).size()) ); }
+ //Now get an accounting of all the available/used space (overwriting the private variable)
+ QSize ssize = desktop->screenGeometry(desktopnumber).size();
+ //qDebug() << "Screen Size:" << ssize << desktopnumber;
+ if(bgDesktop->isVisible() && ( (bgDesktop->size().height() <= ssize.height()) && (bgDesktop->size().width() <= ssize.width()) )){ ssize = bgDesktop->size(); qDebug() << " - Adjusted:" << ssize; }
+ availDPArea = QRegion(QRect(QPoint(0,0), ssize)); //Note that this is child-geometry space
+ //Remove all the space currently occupied
//qDebug() << "Available Screen Geom:" << avail.boundingRect();
QList<QMdiSubWindow*> wins = bgDesktop->subWindowList();
- for(int i=0; i<wins.length(); i++){
- if(avail.contains(wins[i]->geometry())){ avail = avail.subtracted( QRegion(wins[i]->geometry()) ); }
+ for(int i=0; i<wins.length(); i++){
+ qDebug() << "Subtracting Geom:" << wins[i]->geometry();
+ availDPArea = availDPArea.subtracted( QRegion(wins[i]->geometry()) );
}
- //qDebug() << " - after removals:" << avail.boundingRect();
//Now add/update plugins
for(int i=0; i<plugins.length(); i++){
//See if this plugin is already there
@@ -443,22 +459,9 @@ void LDesktop::UpdateDesktop(){
PLUGINS << plug;
QApplication::processEvents(); //need a moment between plugin/container creation
LDPluginContainer *cont = CreateDesktopPluginContainer(plug);
- cont->show();
- QApplication::processEvents();
- if(!cont->hasFixedPosition()){
- //Need to arrange the location of the plugin (leave size alone)
- if(DEBUG){ qDebug() << " --- Floating Plugin - find a spot for it"; }
- QPoint pt = findNewPluginLocation(avail, cont->size());
- if(pt.x()>=0 && pt.y()>=0){
- cont->saveNewPosition(pt);
- QTimer::singleShot(1000, cont, SLOT(loadInitialPosition()) ); //re-load geometry in a moment
- if(DEBUG){ qDebug() << " --- Moving to point:" << pt; }
- }
- }
//Done with this plugin - removed it's area from the available space
if(DEBUG){ qDebug() << " --- Done Creating Plugin Container" << cont->geometry(); }
- avail = avail.subtracted( QRegion(cont->geometry()) );
-
+ //avail = avail.subtracted( QRegion(cont->geometry()) ); //remove this space from the available region as well
}
}
QApplication::processEvents(); //need to process events between loading of plugins
@@ -576,7 +579,7 @@ void LDesktop::DesktopPluginRemoved(QString ID, bool internal){
void LDesktop::UpdatePanels(){
if(DEBUG){ qDebug() << " - Update Panels For Screen:" << desktopnumber; }
int panels = settings->value(DPREFIX+"panels", -1).toInt();
- if(panels==-1 && defaultdesktop){ panels=1; } //need at least 1 panel on the primary desktop
+ //if(panels==-1 && defaultdesktop){ panels=1; } //need at least 1 panel on the primary desktop
//Remove all extra panels
for(int i=0; i<PANELS.length(); i++){
if(panels <= PANELS[i]->number()){
diff --git a/lumina-desktop/LDesktop.h b/lumina-desktop/LDesktop.h
index 482f1401..e454d03b 100644
--- a/lumina-desktop/LDesktop.h
+++ b/lumina-desktop/LDesktop.h
@@ -20,6 +20,7 @@
#include <QWidgetAction>
#include <QMdiArea>
#include <QMdiSubWindow>
+#include <QRegion>
#include <LuminaXDG.h>
@@ -59,7 +60,7 @@ private:
QDesktopWidget *desktop;
QString DPREFIX;
int desktopnumber;
- //int xoffset;
+ QRegion availDPArea;
bool defaultdesktop, desktoplocked, issyncing, usewinmenu, bgupdating;
QStringList oldBGL;
QList<LPanel*> PANELS;
diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp
index 7531d53e..11a5a988 100644
--- a/lumina-desktop/LPanel.cpp
+++ b/lumina-desktop/LPanel.cpp
@@ -207,9 +207,9 @@ void LPanel::UpdatePanel(){
//Then go through the plugins and create them as necessary
QStringList plugins = settings->value(PPREFIX+"pluginlist", QStringList()).toStringList();
- if(defaultpanel && plugins.isEmpty()){
+ /*if(defaultpanel && plugins.isEmpty()){
plugins << "userbutton" << "taskmanager" << "spacer" << "systemtray" << "clock" << "systemdashboard";
- }
+ }*/
if(DEBUG){ qDebug() << " - Initialize Plugins: " << plugins; }
for(int i=0; i<plugins.length(); i++){
//Ensure this plugin has a unique ID (NOTE: this numbering does not persist between sessions)
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp
index 0d7e3808..aa1c1e0c 100644
--- a/lumina-desktop/LSession.cpp
+++ b/lumina-desktop/LSession.cpp
@@ -145,8 +145,10 @@ void LSession::setupSession(){
connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(watcherChange(QString)) );
connect(this, SIGNAL(aboutToQuit()), this, SLOT(SessionEnding()) );
if(DEBUG){ qDebug() << " - Init Finished:" << timer->elapsed(); delete timer;}
- QTimer::singleShot(3000, this, SLOT(launchStartupApps()) ); //startup these processes in 3 seconds
+ //QTimer::singleShot(3000, this, SLOT(launchStartupApps()) ); //startup these processes in 3 seconds
splash.close();
+ QApplication::processEvents();
+ launchStartupApps();
}
void LSession::CleanupSession(){
@@ -338,6 +340,9 @@ void LSession::checkUserFiles(){
if(newversion || newrelease){
LUtils::upgradeFavorites(oldversion);
}
+ //Remove/convert any old desktop plugin files (Change occured with 0.8.5)
+ // - TO-DO
+
//Convert to the XDG autostart spec as necessary (Change occured with 0.8.5)
if(QFile::exists(QDir::homePath()+"/.lumina/startapps") ){
QStringList cmds = LUtils::readFile(QDir::homePath()+"/.lumina/startapps");
@@ -479,7 +484,7 @@ void LSession::adjustWindowGeom(WId win, bool maximize){
if(geom.x() < desk.x()){ geom.moveLeft(desk.x()); } //move right to the edge (left panel)
//Adjust size for bottom margins (within reason, since window titles are on top normally)
// if(geom.right() > desk.right() && (geom.width() > 100)){ geom.setRight(desk.right()); }
- if(geom.bottom() > desk.bottom() && geom.height() > 100){
+ if(geom.bottom() > desk.bottom() && geom.height() > 10){
//Also adjust the sizing for the frame (the moveResize fuction is for the base window only)
geom.setBottom(desk.bottom()-frame[0]-frame[1]);
}
diff --git a/lumina-desktop/desktop-plugins/LDPlugin.cpp b/lumina-desktop/desktop-plugins/LDPlugin.cpp
index 5db20232..ebed6d90 100644
--- a/lumina-desktop/desktop-plugins/LDPlugin.cpp
+++ b/lumina-desktop/desktop-plugins/LDPlugin.cpp
@@ -22,16 +22,19 @@ void LDPlugin::setInitialSize(int width, int height){
// if the plugin is completely new (first time used), it will be this size
if(settings->allKeys().filter(prefix+"location").isEmpty()){
//Brand new plugin: set initial size
- qDebug() << "Setting Initial Size:" << PLUGID << width << height;
+ //qDebug() << "Setting Initial Size:" << PLUGID << width << height;
settings->setValue(prefix+"location/width",width);
settings->setValue(prefix+"location/height",height);
settings->sync();
}
+ //Now make sure the plugin is the saved size right away
+ this->resize( settings->value(prefix+"location/width").toInt(), settings->value(prefix+"location/height").toInt());
}
void LDPlugin::adjustSize(int width, int height){
settings->setValue(prefix+"location/width",width);
settings->setValue(prefix+"location/height",height);
settings->sync();
+ this->resize(width,height);
emit PluginResized();
} \ No newline at end of file
diff --git a/lumina-desktop/desktop-plugins/LDPluginContainer.h b/lumina-desktop/desktop-plugins/LDPluginContainer.h
index da8ead6e..e7388a80 100644
--- a/lumina-desktop/desktop-plugins/LDPluginContainer.h
+++ b/lumina-desktop/desktop-plugins/LDPluginContainer.h
@@ -35,12 +35,12 @@ private:
private slots:
void saveGeometry(){
if(PLUG==0){ return; }
- if(!locked && !setup){
+ //if(!locked && !setup){
PLUG->saveSetting("location/x", this->pos().x());
PLUG->saveSetting("location/y", this->pos().y());
- PLUG->saveSetting("location/width", this->size().width());
- PLUG->saveSetting("location/height", this->size().height());
- }
+ PLUG->saveSetting("location/width", this->width()-4);
+ PLUG->saveSetting("location/height", this->height()-4);
+ //}
}
public:
@@ -84,25 +84,27 @@ public:
}
public slots:
+ void loadInitialSize(){
+ if(PLUG==0){ return; }
+ QSize sz(PLUG->readSetting("location/width",100).toInt(), PLUG->readSetting("location/height",100).toInt());
+ this->resize(sz);
+ }
+
void loadInitialPosition(){
QRect set(PLUG->readSetting("location/x",-12345).toInt(), PLUG->readSetting("location/y",-12345).toInt(), PLUG->readSetting("location/width",PLUG->size().width()).toInt() +4, PLUG->readSetting("location/height",PLUG->size().height()).toInt()+4);
- qDebug() << "Initial Plugin Location:" << set.x() << set.y() << set.width() << set.height();
+ //qDebug() << "Initial Plugin Location:" << set.x() << set.y() << set.width() << set.height();
if(set.height() < 10){ set.setHeight(10); } //to prevent foot-shooting
if(set.width() < 10){ set.setWidth(10); } //to prevent foot-shooting
- /*if(!locked){
- //adjust the size to account for the container borders/frame
-
- }*/
if(set.x()!=-12345 && set.y()!=-12345){
- //custom location specified
- //qDebug() << " - Found Geom:" << set;
- this->setGeometry(set);
//this->move(set.x(), set.y());
- //PLUG->resize(set.width(), set.height());
+ this->setGeometry(set);
}else{
- //qDebug() << " - Found Size:" << set;
+ qDebug() << " - Found Size:" << set;
this->resize(set.width(), set.height());
+ qDebug() << " - Assigning location:" << this->pos();
+ saveNewPosition(this->pos());
}
+ this->show();
QApplication::processEvents();
setup=false; //done with setup
}
@@ -113,8 +115,9 @@ signals:
protected:
void moveEvent(QMoveEvent *event){
+ //qDebug() << "Move Event: " << PLUG->ID() << setup;
//Save this location to the settings
- if(!locked && !setup){
+ if( !setup ){
if(syncTimer->isActive()){ syncTimer->stop(); }
syncTimer->start();
//qDebug() << "DP Move:" << event->pos().x() << event->pos().y();
@@ -124,7 +127,7 @@ protected:
void resizeEvent(QResizeEvent *event){
//Save this size info to the settings
- if(!locked && !setup){
+ if(!setup){
//qDebug() << "DP Resize:" << event->size().width() << event->size().height();
if(syncTimer->isActive()){ syncTimer->stop(); }
syncTimer->start();
diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
index 52c82556..ea42f151 100644
--- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
+++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
@@ -8,7 +8,7 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par
button = new QToolButton(this);
button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
button->setAutoRaise(true);
- button->setText("..."); //Need to set something here so that initial sizing works properly
+ button->setText("...\n..."); //Need to set something here so that initial sizing works properly
lay->addWidget(button, 0, Qt::AlignCenter);
connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()) );
@@ -27,8 +27,9 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par
//qDebug() << "Button Size:" << button->size();
//qDebug() << "Calculated:" << icosize+4 << icosize+8+qRound(2.15*button->fontMetrics().height());
//qDebug() << "Preferred Size:" << button->sizeHint();
- this->setInitialSize(qRound(1.1*icosize)+4, icosize+8+qRound(2.5*button->fontMetrics().height()));
-
+ QSize sz(qRound(1.1*icosize), icosize+qRound(2.7*button->fontMetrics().height()) );
+ button->setFixedSize(sz); //make sure to adjust the button on first show.
+ this->setInitialSize(this->sizeHint().width()+2, this->sizeHint().height()+2); //give the container a bit of a buffer
QTimer::singleShot(100,this, SLOT(loadButton()) );
}
@@ -76,7 +77,7 @@ void AppLauncherPlugin::loadButton(bool onchange){
button->setToolTip(txt);
int icosize = this->readSetting("iconsize",64).toInt();
int bwid = qRound(1.1*icosize);
- button->setFixedSize(bwid, icosize+qRound(2.5*button->fontMetrics().height()) ); //make sure to adjust the button on first show.
+ this->setFixedSize(bwid, icosize+qRound(2.5*button->fontMetrics().height()) ); //make sure to adjust the button on first show.
if(onchange){ this->adjustSize( bwid+4, icosize+8+qRound(2.5*button->fontMetrics().height())); }
//qDebug() << "Initial Button Text:" << txt << icosize;
if(button->fontMetrics().width(txt) > (bwid-2) ){
@@ -97,6 +98,7 @@ void AppLauncherPlugin::loadButton(bool onchange){
txt.insert( (txt.count()/2), "\n");
}
}
+ if(!txt.contains("\n")){ txt.append("\n "); } //always use two lines
//qDebug() << " - Setting Button Text:" << txt;
button->setText(txt);
//Now setup the menu again
diff --git a/lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.cpp b/lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.cpp
index cc1136f1..459e4610 100644
--- a/lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.cpp
+++ b/lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.cpp
@@ -262,7 +262,7 @@ AudioPlayerPlugin::AudioPlayerPlugin(QWidget *parent, QString ID) : LDPlugin(par
this->layout()->setContentsMargins(0,0,0,0);
this->layout()->addWidget(player);
- this->setInitialSize(300,75);
+ this->setInitialSize(this->sizeHint().width(), this->sizeHint().height());
}
AudioPlayerPlugin::~AudioPlayerPlugin(){
diff --git a/lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h b/lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h
index e861052e..796bc42d 100644
--- a/lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h
+++ b/lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h
@@ -21,6 +21,7 @@ public:
this->layout()->setContentsMargins(0,0,0,0);
cal = new QCalendarWidget(this);
this->layout()->addWidget(cal);
+ this->setInitialSize( cal->sizeHint().width(), cal->sizeHint().height() );
}
~CalendarPlugin(){}
diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp
index 5fdd1ba0..c3d2cc8b 100644
--- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp
+++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp
@@ -40,7 +40,7 @@ DesktopViewPlugin::DesktopViewPlugin(QWidget* parent, QString ID) : LDPlugin(par
menu->addAction( LXDG::findIcon("system-search",""), tr("Properties"), this, SLOT(displayProperties()) );
}
this->layout()->addWidget(list);
- this->setInitialSize(600,600);
+ this->setInitialSize(300,300);
connect(QApplication::instance(), SIGNAL(DesktopFilesChanged()), this, SLOT(updateContents()) );
connect(list, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(runItems()) );
diff --git a/lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp b/lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp
index 7d9076c7..f66cb53e 100644
--- a/lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp
+++ b/lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp
@@ -59,11 +59,12 @@ NotePadPlugin::NotePadPlugin(QWidget* parent, QString ID) : LDPlugin(parent, ID)
//qDebug() << "Saving a new setting";
this->saveSetting("customFile",""); //always clear this when the plugin is initialized (only maintained per-session)
//qDebug() << "Loading Notes Dir";
- notesDirChanged();
+ QTimer::singleShot(2000, this, SLOT(notesDirChanged()));
//qDebug() << "Set Sizing";
//Now setup the initial values for the plugin
- this->setInitialSize(200,300);
+ qDebug() << "New Notepad:" << this->sizeHint() << this->size();
+ this->setInitialSize(this->sizeHint().width(),this->sizeHint().height());
//qDebug() << "Connect Signals/slots";
//Setup the button connections
connect(open, SIGNAL(clicked()), this, SLOT(openNote()) );
diff --git a/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h b/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h
index 2bde5d54..3a14b26c 100644
--- a/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h
+++ b/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h
@@ -25,6 +25,7 @@ public:
container->setResizeMode(QQuickWidget::SizeRootObjectToView);
this->layout()->addWidget(container);
container->setSource(QUrl::fromLocalFile( LUtils::findQuickPluginFile(ID.section("---",0,0)) ));
+ this->setInitialSize(container->initialSize().width(), container->initialSize().height());
}
~QuickDPlugin(){}
diff --git a/lumina-desktop/desktop-plugins/systemmonitor/MonitorWidget.cpp b/lumina-desktop/desktop-plugins/systemmonitor/MonitorWidget.cpp
index 981e411d..6a300b6c 100644
--- a/lumina-desktop/desktop-plugins/systemmonitor/MonitorWidget.cpp
+++ b/lumina-desktop/desktop-plugins/systemmonitor/MonitorWidget.cpp
@@ -55,7 +55,7 @@ SysMonitorPlugin::SysMonitorPlugin(QWidget *parent, QString ID) : LDPlugin(paren
this->layout()->setContentsMargins(0,0,0,0);
this->layout()->addWidget(monitor);
- this->setInitialSize(monitor->width(),monitor->height());
+ this->setInitialSize(monitor->sizeHint().width(),monitor->sizeHint().height());
}
SysMonitorPlugin::~SysMonitorPlugin(){
diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
index 689bd8eb..ff77121e 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
@@ -7,6 +7,7 @@
#include "UserItemWidget.h"
#include <LuminaUtils.h>
+#define TEXTCUTOFF 165
UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, QString type, bool goback) : QFrame(parent){
createWidget();
//Now fill it appropriately
@@ -17,10 +18,10 @@ UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, QString type,
XDGDesktop item = LXDG::loadDesktopFile(itemPath, ok);
if(ok){
icon->setPixmap( LXDG::findIcon(item.icon, "preferences-system-windows-actions").pixmap(32,32) );
- name->setText( this->fontMetrics().elidedText(item.name, Qt::ElideRight, 180) );
+ name->setText( this->fontMetrics().elidedText(item.name, Qt::ElideRight, TEXTCUTOFF) );
}else{
icon->setPixmap( LXDG::findIcon("unknown","").pixmap(32,32) );
- name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) );
+ name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) );
}
}else if(type=="dir"){
if(itemPath.endsWith("/")){ itemPath.chop(1); }
@@ -29,18 +30,22 @@ UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, QString type,
name->setText( tr("Go Back") );
}else{
icon->setPixmap( LXDG::findIcon("folder","").pixmap(32,32) );
- name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) );
+ name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) );
}
}else{
if(itemPath.endsWith("/")){ itemPath.chop(1); }
- if(LUtils::imageExtensions().contains(itemPath.section("/",-1).section(".",-1).toLower()) ){
+ if(QFileInfo(itemPath).isDir()){
+ type = "dir";
+ icon->setPixmap( LXDG::findIcon("folder","").pixmap(32,32) );
+ }else if(LUtils::imageExtensions().contains(itemPath.section("/",-1).section(".",-1).toLower()) ){
icon->setPixmap( QIcon(itemPath).pixmap(32,32) );
}else{
icon->setPixmap( LXDG::findMimeIcon(type).pixmap(32,32) );
}
- name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) );
+ name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) );
}
icon->setWhatsThis(itemPath);
+ if(!goback){ this->setWhatsThis(name->text()); }
isDirectory = (type=="dir"); //save this for later
if(LUtils::isFavorite(itemPath)){
linkPath = itemPath;
@@ -67,7 +72,8 @@ UserItemWidget::UserItemWidget(QWidget *parent, XDGDesktop item) : QFrame(parent
}
//Now fill it appropriately
icon->setPixmap( LXDG::findIcon(item.icon,"preferences-system-windows-actions").pixmap(32,32) );
- name->setText( this->fontMetrics().elidedText(item.name, Qt::ElideRight, 180) );
+ name->setText( this->fontMetrics().elidedText(item.name, Qt::ElideRight, TEXTCUTOFF) );
+ this->setWhatsThis(name->text());
icon->setWhatsThis(item.filePath);
//Now setup the button appropriately
setupButton();
@@ -154,5 +160,4 @@ void UserItemWidget::buttonClicked(){
void UserItemWidget::ItemClicked(){
if(!linkPath.isEmpty()){ emit RunItem(linkPath); }
else{ emit RunItem(icon->whatsThis()); }
-
}
diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
index 2c85caab..1ea1a864 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp
@@ -108,9 +108,37 @@ void UserWidget::ClearScrollArea(QScrollArea *area){
layout->setSpacing(2);
layout->setContentsMargins(3,1,3,1);
layout->setDirection(QBoxLayout::TopToBottom);
+ layout->setAlignment(Qt::AlignTop);
area->widget()->setLayout(layout);
}
+void UserWidget::SortScrollArea(QScrollArea *area){
+ //qDebug() << "Sorting Scroll Area:";
+ //Sort all the items in the scroll area alphabetically
+ QLayout *lay = area->widget()->layout();
+ QStringList items;
+ for(int i=0; i<lay->count(); i++){
+ items << lay->itemAt(i)->widget()->whatsThis();
+ }
+
+ items.sort();
+ //qDebug() << " - Sorted Items:" << items;
+ for(int i=0; i<items.length(); i++){
+ if(items[i].isEmpty()){ continue; }
+ //QLayouts are weird in that they can only add items to the end - need to re-insert almost every item
+ for(int j=0; j<lay->count(); j++){
+ //Find this item
+ if(lay->itemAt(j)->widget()->whatsThis()==items[i]){
+ //Found it - now move it if necessary
+ //qDebug() << "Found Item:" << items[i] << i << j;
+ lay->addItem( lay->takeAt(j) );
+ break;
+ }
+ }
+ }
+
+}
+
QIcon UserWidget::rotateIcon(QIcon ico){
//Rotate the given icon to appear vertical in the tab widget
QPixmap pix = ico.pixmap(32,32);
@@ -131,11 +159,18 @@ void UserWidget::UpdateMenu(){
ui->tool_fav_files->setChecked(false);
cfav = 0; //favorite apps
updateFavItems();
- ui->label_home_dir->setWhatsThis(QDir::homePath());
- updateHome();
+ QString cdir = ui->label_home_dir->whatsThis();
+ if(cdir.isEmpty() || !QFile::exists(cdir) ){
+ //Directory deleted or nothing loaded yet
+ ui->label_home_dir->setWhatsThis(QDir::homePath());
+ QTimer::singleShot(0,this, SLOT(updateHome()) );
+ }else if( lastUpdate < QFileInfo(cdir).lastModified() ){
+ //Directory contents changed - reload it
+ QTimer::singleShot(0,this, SLOT(updateHome()) );
+ }
if(lastUpdate < LSession::handle()->applicationMenu()->lastHashUpdate || lastUpdate.isNull()){
updateAppCategories();
- updateApps();
+ QTimer::singleShot(0,this, SLOT(updateApps()) );
}
lastUpdate = QDateTime::currentDateTime();
}
@@ -214,16 +249,17 @@ void UserWidget::updateFavItems(bool newfilter){
}
ClearScrollArea(ui->scroll_fav);
//qDebug() << " - Sorting Items";
- favitems.sort(); //sort them alphabetically
- //qDebug() << " - Creating Items:" << favitems;
- for(int i=0; i<favitems.length(); i++){
- UserItemWidget *it = new UserItemWidget(ui->scroll_fav->widget(), favitems[i].section("::::",2,50), favitems[i].section("::::",1,1) );
- ui->scroll_fav->widget()->layout()->addWidget(it);
- connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
- connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
- connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
- }
- static_cast<QBoxLayout*>(ui->scroll_fav->widget()->layout())->addStretch();
+ favitems.sort(); //sort them alphabetically
+ //qDebug() << " - Creating Items:" << favitems;
+ for(int i=0; i<favitems.length(); i++){
+ UserItemWidget *it = new UserItemWidget(ui->scroll_fav->widget(), favitems[i].section("::::",2,50), favitems[i].section("::::",1,1) );
+ ui->scroll_fav->widget()->layout()->addWidget(it);
+ connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
+ connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
+ connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
+ QApplication::processEvents(); //keep the UI snappy - might be a number of these
+ }
+ SortScrollArea(ui->scroll_fav);
//qDebug() << " - Done";
}
@@ -263,8 +299,8 @@ void UserWidget::updateApps(){
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
+ QApplication::processEvents(); //keep the UI snappy - might be a number of these
}
- static_cast<QBoxLayout*>(ui->scroll_apps->widget()->layout())->addStretch();
}
//Home Tab
@@ -285,25 +321,29 @@ void UserWidget::updateHome(){
items << dir;
}
ui->label_home_dir->setToolTip(ui->label_home_dir->whatsThis());
- items << homedir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
- QString type = "dir";
+ items << homedir.entryList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDir::Name | QDir::DirsFirst);
+ QString type = "";
if(homedir.absolutePath() == QDir::homePath()+"/Desktop"){ type.append("-home"); }//internal code
for(int i=0; i<items.length(); i++){
//qDebug() << "New Home subdir:" << homedir.absoluteFilePath(items[i]);
UserItemWidget *it;
- if(items[i].startsWith("/")){ it = new UserItemWidget(ui->scroll_home->widget(), items[i], type, true); }
+ if(items[i].startsWith("/")){ it = new UserItemWidget(ui->scroll_home->widget(), items[i], "dir", true); } //go-back button
else{ it = new UserItemWidget(ui->scroll_home->widget(), homedir.absoluteFilePath(items[i]), type, false); }
ui->scroll_home->widget()->layout()->addWidget(it);
connect(it, SIGNAL(RunItem(QString)), this, SLOT(slotGoToDir(QString)) );
connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
+ QApplication::processEvents(); //keep the UI snappy - may be a lot of these to load
}
- static_cast<QBoxLayout*>(ui->scroll_home->widget()->layout())->addStretch();
}
void UserWidget::slotGoToDir(QString dir){
- ui->label_home_dir->setWhatsThis(dir);
- updateHome();
+ if(!QFileInfo(dir).isDir()){
+ LaunchItem(dir);
+ }else{
+ ui->label_home_dir->setWhatsThis(dir);
+ updateHome();
+ }
}
void UserWidget::slotGoHome(){
diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.h b/lumina-desktop/panel-plugins/userbutton/UserWidget.h
index 2dce25b4..c2df10bf 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserWidget.h
+++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.h
@@ -47,6 +47,7 @@ private:
QFileInfoList homefiles;
int cfav; //current favorite category
void ClearScrollArea(QScrollArea *area);
+ void SortScrollArea(QScrollArea *area);
QIcon rotateIcon(QIcon);
private slots:
diff --git a/port-files/pkg-plist b/port-files/pkg-plist
index 5972c518..ca840ac7 100644
--- a/port-files/pkg-plist
+++ b/port-files/pkg-plist
@@ -40,7 +40,7 @@ share/Lumina-DE/colors/Lumina-Glass.qss.colors
share/Lumina-DE/colors/PCBSD10-Default.qss.colors
share/Lumina-DE/themes/Lumina-default.qss.template
share/Lumina-DE/themes/None.qss.template
-share/Lumina-DE/quickplugins/sample.qml
+share/Lumina-DE/quickplugins/quick-sample.qml
share/wallpapers/Lumina-DE/Lumina_Wispy_gold_1920x1080.jpg
share/wallpapers/Lumina-DE/Lumina_Wispy_green_1920x1080.jpg
share/wallpapers/Lumina-DE/Lumina_Wispy_purple_1920x1080.jpg
bgstack15