aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-01-21 15:53:51 -0500
committerKen Moore <ken@pcbsd.org>2015-01-21 15:53:51 -0500
commita059c1fdb254fc5e2dca743597fe96c0a8a09aa3 (patch)
tree126af0492cd60a8c7e71721510f03296aa52531a
parentClean up a couple other session options: (diff)
downloadlumina-a059c1fdb254fc5e2dca743597fe96c0a8a09aa3.tar.gz
lumina-a059c1fdb254fc5e2dca743597fe96c0a8a09aa3.tar.bz2
lumina-a059c1fdb254fc5e2dca743597fe96c0a8a09aa3.zip
Add a completely new background method for a distributor to set per-system defaults for the Lumina desktop. Also fix a bug this exposed in how the Lumina panel removes plugins.
-rw-r--r--lumina-desktop/LDesktop.cpp22
-rw-r--r--lumina-desktop/LPanel.cpp12
-rw-r--r--lumina-desktop/LSession.cpp18
-rw-r--r--lumina-desktop/LXcbEventFilter.cpp6
-rw-r--r--lumina-desktop/defaults/luminaDesktop.conf42
-rw-r--r--lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp2
-rw-r--r--lumina-desktop/lumina-desktop.pro7
-rw-r--r--lumina-desktop/main.cpp1
8 files changed, 83 insertions, 27 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp
index 54d4ba11..c99e3472 100644
--- a/lumina-desktop/LDesktop.cpp
+++ b/lumina-desktop/LDesktop.cpp
@@ -243,10 +243,22 @@ void LDesktop::UpdateDesktop(){
//plugins << "sample" << "sample" << "sample";
}
bool changed=false; //in case the plugin list needs to be changed
+ //First make sure all the plugin names are unique
+ for(int i=0; i<plugins.length(); i++){
+ if(!plugins[i].contains("---") ){
+ int num=1;
+ while( plugins.contains(plugins[i]+"---"+QString::number(desktopnumber)+"."+QString::number(num)) ){
+ num++;
+ }
+ plugins[i] = plugins[i]+"---"+QString::number(desktopnumber)+"."+QString::number(num);
+ changed=true;
+ }
+ }
//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
+
DesktopPluginRemoved(PLUGINS[i]->ID());
i--;
}
@@ -265,16 +277,6 @@ void LDesktop::UpdateDesktop(){
}
if(plug==0){
//New Plugin
- //Make sure the plugin ID is unique
- if(!plugins[i].contains("---") ){
- int num=1;
- while( plugins.contains(plugins[i]+"---"+QString::number(desktopnumber)+"."+QString::number(num)) ){
- num++;
- }
- plugins[i] = plugins[i]+"---"+QString::number(desktopnumber)+"."+QString::number(num);
- changed=true;
- }
- //Now create the plugin (will load existing settings if possible)
qDebug() << " -- New Plugin:" << plugins[i];
plug = NewDP::createPlugin(plugins[i], bgDesktop);
if(plug != 0){
diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp
index 8416faaf..dc635300 100644
--- a/lumina-desktop/LPanel.cpp
+++ b/lumina-desktop/LPanel.cpp
@@ -165,7 +165,9 @@ void LPanel::UpdatePanel(){
while( plugins.contains(plugins[i]+"---"+QString::number(screennum)+"."+QString::number(this->number())+"."+QString::number(num)) ){
num++;
}
+
plugins[i] = plugins[i]+"---"+QString::number(screennum)+"."+QString::number(this->number())+"."+QString::number(num);
+ //qDebug() << "Adjust Plugin ID:" << plugins[i];
}
//See if this plugin is already there or in a different spot
bool found = false;
@@ -187,7 +189,7 @@ void LPanel::UpdatePanel(){
}
if(!found){
//New Plugin
- qDebug() << " -- New Plugin:" << plugins[i];
+ qDebug() << " -- New Plugin:" << plugins[i] << i;
LPPlugin *plug = NewPP::createPlugin(plugins[i], panelArea, horizontal);
if(plug != 0){
PLUGINS.insert(i, plug);
@@ -201,8 +203,11 @@ void LPanel::UpdatePanel(){
LSession::processEvents();
}
//Now remove any extra plugins from the end
- for(int i=plugins.length(); i<PLUGINS.length(); i++){
- qDebug() << " -- Remove Plugin: " << i;
+ //qDebug() << "plugins:" << plugins;
+ //qDebug() << "PLUGINS length:" << PLUGINS.length();
+ for(int i=0; i<PLUGINS.length(); i++){
+ if(plugins.contains(PLUGINS[i]->type())){ continue; } //good plugin - skip it
+ qDebug() << " -- Remove Plugin: " << PLUGINS[i]->type();
//If this is the system tray - stop it first
if( PLUGINS[i]->type().startsWith("systemtray---") ){
static_cast<LSysTray*>(PLUGINS[i])->stop();
@@ -210,6 +215,7 @@ void LPanel::UpdatePanel(){
layout->takeAt(i); //remove from the layout
delete PLUGINS.takeAt(i); //delete the actual widget
LSession::processEvents();
+ i--; //need to back up one space to not miss another plugin
}
this->update();
this->show(); //make sure the panel is visible now
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp
index bdf2b53a..d66ddcb4 100644
--- a/lumina-desktop/LSession.cpp
+++ b/lumina-desktop/LSession.cpp
@@ -12,6 +12,7 @@
//LibLumina X11 class
#include <LuminaX11.h>
+#include <LuminaUtils.h>
//X includes (these need to be last due to Qt compile issues)
#include <X11/Xlib.h>
@@ -28,14 +29,14 @@ XCBEventFilter *evFilter = 0;
LSession::LSession(int &argc, char ** argv) : QApplication(argc, argv){
this->setApplicationName("Lumina Desktop Environment");
- this->setApplicationVersion("0.8.0");
+ this->setApplicationVersion( LUtils::LuminaDesktopVersion() );
this->setOrganizationName("LuminaDesktopEnvironment");
this->setQuitOnLastWindowClosed(false); //since the LDesktop's are not necessarily "window"s
//Enabled a few of the simple effects by default
this->setEffectEnabled( Qt::UI_AnimateMenu, true);
this->setEffectEnabled( Qt::UI_AnimateCombo, true);
this->setEffectEnabled( Qt::UI_AnimateTooltip, true);
- this->setAttribute(Qt::AA_UseHighDpiPixmaps); //allow pixmaps to be scaled up as well as down
+ //this->setAttribute(Qt::AA_UseHighDpiPixmaps); //allow pixmaps to be scaled up as well as down
//this->setStyle( new MenuProxyStyle); //QMenu icon size override
SystemTrayID = 0; VisualTrayID = 0;
TrayDmgEvent = 0;
@@ -179,20 +180,21 @@ void LSession::watcherChange(QString changed){
void LSession::checkUserFiles(){
//version conversion examples: [1.0.0 -> 100], [1.2.0 -> 120], [0.6.0 -> 60]
- int oldversion = sessionsettings->value("DesktopVersion",0).toString().remove(".").toInt();
+ int oldversion = sessionsettings->value("DesktopVersion","0").toString().remove(".").toInt();
bool newversion = ( oldversion < this->applicationVersion().remove(".").toInt() );
-
+
//Check for the desktop settings file
QString dset = QDir::homePath()+"/.lumina/LuminaDE/desktopsettings.conf";
bool firstrun = false;
if(!QFile::exists(dset) || oldversion < 50){
if( oldversion < 50 ){ QFile::remove(dset); qDebug() << "Current desktop settings obsolete: Re-implementing defaults"; }
else{ firstrun = true; }
- if(QFile::exists(LOS::LuminaShare()+"desktopsettings.conf")){
+ /*if(QFile::exists(LOS::LuminaShare()+"desktopsettings.conf")){
if( QFile::copy(LOS::LuminaShare()+"desktopsettings.conf", dset) ){
QFile::setPermissions(dset, QFile::ReadUser | QFile::WriteUser | QFile::ReadOwner | QFile::WriteOwner);
}
- }
+ }*/
+ LUtils::LoadSystemDefaults();
}
//Check for the default applications file for lumina-open
dset = QDir::homePath()+"/.lumina/LuminaDE/lumina-open.conf";
@@ -393,10 +395,10 @@ void LSession::WindowPropertyEvent(){
void LSession::WindowPropertyEvent(WId win){
//Emit the single-app signal if the window in question is one used by the task manager
- //if(RunningApps.contains(win)){
+ if(RunningApps.contains(win)){
if(DEBUG){ qDebug() << "Single-window property event"; }
emit WindowListEvent();
- //}
+ }
}
void LSession::SysTrayDockRequest(WId win){
diff --git a/lumina-desktop/LXcbEventFilter.cpp b/lumina-desktop/LXcbEventFilter.cpp
index 84948084..fe79d6d5 100644
--- a/lumina-desktop/LXcbEventFilter.cpp
+++ b/lumina-desktop/LXcbEventFilter.cpp
@@ -46,7 +46,8 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag
//window-specific property change
}else if( WinNotifyAtoms.contains( ((xcb_property_notify_event_t*)ev)->atom ) ){
//Ping only that window
- session->WindowPropertyEvent( ((xcb_property_notify_event_t*)ev)->window );
+ //session->WindowPropertyEvent( ((xcb_property_notify_event_t*)ev)->window );
+ session->WindowPropertyEvent();
}
break;
//==============================
@@ -70,7 +71,8 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag
session->WindowPropertyEvent( ((xcb_client_message_event_t*)ev)->window );*/
}else if( WinNotifyAtoms.contains( ((xcb_client_message_event_t*)ev)->type ) ){
//Ping only that window
- session->WindowPropertyEvent( ((xcb_client_message_event_t*)ev)->window );
+ //session->WindowPropertyEvent( ((xcb_client_message_event_t*)ev)->window );
+ session->WindowPropertyEvent();
}
break;
//==============================
diff --git a/lumina-desktop/defaults/luminaDesktop.conf b/lumina-desktop/defaults/luminaDesktop.conf
new file mode 100644
index 00000000..f35f0654
--- /dev/null
+++ b/lumina-desktop/defaults/luminaDesktop.conf
@@ -0,0 +1,42 @@
+#This is the configuration file that generates all the default settings files for the Lumina desktop
+# For any setting that can take a list of values, each vale needs to be seperated by a comma and a space (", ")
+# Example: some.setting=item1, item2, item3
+
+#NOTE: To pre-setup default applications for particular mime-types, you need to provide
+# an additional file which contains all the registrations: "<Lumina Share>/defaultapps.conf"
+
+# Possible Desktop Plugins (Lumina version 0.8.1):
+# calendar, applauncher[::absolute path to *.desktop file], desktopview, notepad, audioplayer
+# Possible Panel Plugins (Lumina version 0.8.1):
+# userbutton, desktopbar, spacer, desktopswitcher, battery, clock, systemdashboard
+# taskmanager[-nogroups], systemtray, homebutton, appmenu
+# Possible Menu Plugins (Lumina version 0.8.1):
+# terminal, filemanager, applications, line, settings, windowlist, app::<absolute path to *.desktop file>
+
+#GENERAL SESSION SETTINGS
+session.enablenumlock=true #[true/false] Enable numlock on login using "numlockx"
+session.playloginaudio=true #[true/false] Play the audio chimes on log in
+session.playlogoutaudio=true #[true/false] Play the audio chimes on log out
+
+#THEME SETTINGS
+#theme.themefile=<file path> #Absolute path to the theme template file to use (disable for Lumina-Default)
+#theme.colorfile=<file path> #Absolute path to the color spec file to use for theming
+theme.iconset=oxygen #Name of the icon theme to use
+theme.font=Arial #Name of the font family to use
+theme.fontsize=10pt #Default size of the fonts to use on the desktop
+
+#DESKTOP SETTINGS (used for the left-most screen in multi-screen setups)
+desktop.visiblepanels=1 #[0/1/2] The number of panels visible by default
+#desktop.backgroundfiles= #list of absolute file paths for image files (disable for Lumina default)
+desktop.backgroundrotateminutes=5 #[positive integer] number of minutes between background rotations (if multiple files)
+desktop.plugins=desktopview #list of plugins to be shown on the desktop by default
+
+#PANEL SETTINGS (preface with panel1.<setting> or panel2.<setting>, depending on the number of panels you have visible by default)
+#NOTE: If two panels, they need to be on opposite screen edges (top/bottom or left/right)
+panel1.location=top #[top/bottom/left/right] Screen edge the panel should be on
+panel1.pixelsize=30 #number of pixels wide/high the panel should be
+panel1.autohide=false #[true/false] Have the panel become visible on mouse-over
+panel1.plugins=userbutton, taskmanager, spacer, systemtray, clock, systemdashboard #list of plugins for the panel
+
+#MENU SETTINGS (right-click menu)
+menu.plugins=terminal, filemanager, applications, line, settings #list of menu plugins to show \ No newline at end of file
diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp
index a96358e7..ce20c563 100644
--- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp
+++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp
@@ -22,7 +22,7 @@ DesktopViewPlugin::DesktopViewPlugin(QWidget* parent, QString ID) : LDPlugin(par
list->setIconSize(QSize(64,64));
list->setUniformItemSizes(true);
this->layout()->addWidget(list);
- this->setInitialSize(200,300);
+ this->setInitialSize(600,600);
watcher = new QFileSystemWatcher(this);
watcher->addPath(QDir::homePath()+"/Desktop");
connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(updateContents()) );
diff --git a/lumina-desktop/lumina-desktop.pro b/lumina-desktop/lumina-desktop.pro
index e71ffa65..feb49f60 100644
--- a/lumina-desktop/lumina-desktop.pro
+++ b/lumina-desktop/lumina-desktop.pro
@@ -130,11 +130,14 @@ fluxconf.path = $$PREFIX/share/Lumina-DE/
defaults.files = defaults/desktop-background.jpg \
defaults/defaultapps.conf \
- defaults/desktopsettings.conf \
+ defaults/luminaDesktop.conf \
audiofiles/Logout.ogg \
audiofiles/Login.ogg
defaults.path = $$PREFIX/share/Lumina-DE/
+conf.path = $$PREFIX/etc
+conf.extra = cp defaults/luminaDesktop.conf $(INSTALL_ROOT)$$PREFIX/etc/luminaDesktop.conf.dist
+
TRANSLATIONS = i18n/lumina-desktop_af.ts \
i18n/lumina-desktop_ar.ts \
i18n/lumina-desktop_az.ts \
@@ -201,4 +204,4 @@ TRANSLATIONS = i18n/lumina-desktop_af.ts \
dotrans.path=$$PREFIX/share/Lumina-DE/i18n/
dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$$PREFIX/share/Lumina-DE/i18n/
-INSTALLS += target desktop icons wallpapers defaults fluxconf dotrans
+INSTALLS += target desktop icons wallpapers defaults conf fluxconf dotrans
diff --git a/lumina-desktop/main.cpp b/lumina-desktop/main.cpp
index 4e447b98..bd26e8f4 100644
--- a/lumina-desktop/main.cpp
+++ b/lumina-desktop/main.cpp
@@ -59,7 +59,6 @@ int main(int argc, char ** argv)
LXDG::setEnvironmentVars();
setenv("DESKTOP_SESSION","LUMINA",1);
setenv("XDG_CURRENT_DESKTOP","LUMINA",1);
- //LSession::setGraphicsSystem("native"); //make sure to use X11 graphics system
//Setup the log file
qDebug() << "Lumina Log File:" << logfile.fileName();
if(QFile::exists(logfile.fileName()+".old")){ QFile::remove(logfile.fileName()+".old"); }
bgstack15