aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp6
-rw-r--r--src-qt5/core/libLumina/LuminaUtils.cpp66
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp1
-rw-r--r--src-qt5/core/lumina-desktop/LDesktop.cpp6
-rw-r--r--src-qt5/core/lumina-desktop/LDesktopBackground.cpp3
-rw-r--r--src-qt5/core/lumina-desktop/LDesktopPluginSpace.h3
-rw-r--r--src-qt5/core/lumina-desktop/LPanel.cpp5
-rw-r--r--src-qt5/core/lumina-desktop/LSession.cpp8
-rw-r--r--src-qt5/core/lumina-desktop/LXcbEventFilter.cpp2
-rw-r--r--src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp8
-rw-r--r--src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h1
-rw-r--r--src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp1
-rw-r--r--src-qt5/core/lumina-info/MainUI.ui4
-rw-r--r--src-qt5/core/lumina-info/main.cpp2
-rw-r--r--src-qt5/core/lumina-session/main.cpp6
-rw-r--r--src-qt5/core/lumina-session/session.cpp13
16 files changed, 75 insertions, 60 deletions
diff --git a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
index 5cdf18bc..2bffb5a1 100644
--- a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
+++ b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
@@ -292,8 +292,10 @@ QString LOS::FileSystemCapacity(QString dir) { //Return: percentage capacity as
QStringList LOS::CPUTemperatures(){ //Returns: List containing the temperature of any CPU's ("50C" for example)
static QStringList vars = QStringList();
QStringList temps;
- if(vars.isEmpty()){ temps = LUtils::getCmdOutput("sysctl -i hw.").filter(".temperature:"); }
- else{ temps = LUtils::getCmdOutput("sysctl "+vars.join(" ")); vars.clear(); }
+ if(vars.isEmpty()){
+ temps = LUtils::getCmdOutput("sysctl -i dev.cpu").filter(".temperature:"); //try direct readings first
+ if(temps.isEmpty()){ temps = LUtils::getCmdOutput("sysctl -i hw.acpi").filter(".temperature:"); } // then try acpi values
+ }else{ temps = LUtils::getCmdOutput("sysctl "+vars.join(" ")); vars.clear(); }
temps.sort();
for(int i=0; i<temps.length(); i++){
diff --git a/src-qt5/core/libLumina/LuminaUtils.cpp b/src-qt5/core/libLumina/LuminaUtils.cpp
index db165cf2..9fc4e6b0 100644
--- a/src-qt5/core/libLumina/LuminaUtils.cpp
+++ b/src-qt5/core/libLumina/LuminaUtils.cpp
@@ -17,6 +17,7 @@
#include <QRegExp>
#include <QFuture>
#include <QtConcurrent>
+#include <QScreen>
#include <LuminaOS.h>
#include <LuminaThemes.h>
@@ -897,50 +898,31 @@ bool LUtils::checkUserFiles(QString lastversion){
if(newversion || newrelease){
LUtils::upgradeFavorites(oldversion);
}
- //Convert any "userbutton" and "appmenu" panel plugins to the new "systemstart" plugin (0.8.7)
- /*if(oldversion <= 8007 && (newversion || newrelease) && nversion < 8008){
- QSettings dset(QSettings::UserScope, "LuminaDE","desktopsettings");
- QStringList plugKeys = dset.allKeys().filter("panel").filter("/pluginlist");
- for(int i=0; i<plugKeys.length(); i++){
- QStringList plugs = dset.value(plugKeys[i],QStringList()).toStringList();
- //Do the appmenu/userbutton -> systemstart conversion
- plugs = plugs.join(";;;;").replace("userbutton","systemstart").replace("appmenu","systemstart").split(";;;;");
- //Remove any system dashboard plugins
- plugs.removeAll("systemdashboard");
- //Now save that back to the file
- dset.setValue(plugKeys[i], plugs);
- }
- //Also remove any "desktopview" desktop plugin and enable the automatic desktop icons instead
- plugKeys = dset.allKeys().filter("desktop-").filter("/pluginlist");
- for(int i=0; i<plugKeys.length(); i++){
- QStringList plugs = dset.value(plugKeys[i], QStringList()).toStringList();
- QStringList old = plugs.filter("desktopview");
- bool found = !old.isEmpty();
- for(int j=0; j<old.length(); j++){ plugs.removeAll(old[j]); }
- if(found){
- dset.setValue(plugKeys[i],plugs); //save the modified plugin list
- //Also set the auto-generate flag on this desktop
- dset.setValue(plugKeys[i].section("/",0,0)+"/generateDesktopIcons", true);
+ //Convert from the old desktop numbering system to the new one (change occured with 1.0.1)
+ if(oldversion<=1000001){
+ QStringList DS = LUtils::readFile(dset);
+ QList<QScreen*> screens = QApplication::screens();
+ for(int i=0; i<DS.length(); i++){
+ if(!DS[i].startsWith("[")){ continue; }
+ if(DS[i].startsWith("[desktop-")){
+ bool ok = false;
+ int num = DS[i].section("desktop-",-1).section("]",0,0).toInt(&ok);
+ if(num>=0 && ok && num< screens.length()){
+ //This one needs to be converted
+ DS[i] = "[desktop-"+screens[num]->name()+"]";
+ }
+ }else if(DS[i].startsWith("[panel")){
+ bool ok = false;
+ int num = DS[i].section("panel",-1).section(".",0,0).toInt(&ok);
+ if(num>=0 && ok && num< screens.length()){
+ //This one needs to be converted
+ QString rest = DS[i].section(".",1,-1); //everything after the desktop number in the current setting
+ DS[i] = "[panel_"+screens[num]->name()+"."+rest;
+ }
}
}
- dset.sync();
- //Due to the grid size change for desktop plugins, need to remove any old plugin geometries
- if(QFile::exists(QDir::homePath()+"/.lumina/pluginsettings/desktopsettings.conf")){
- QFile::remove(QDir::homePath()+"/.lumina/pluginsettings/desktopsettings.conf");
- }
- }*/
-
- //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");
- for(int i=0; i<cmds.length(); i++){
- cmds[i] = cmds[i].remove("lumina-open").simplified(); //remove the file opener
- if(cmds[i].startsWith("#") || cmds[i].isEmpty()){ continue; } //invalid line
-
- LXDG::setAutoStarted(true, cmds[i]);
- }
- QFile::remove(QDir::homePath()+"/.lumina/startapps"); //delete the old file
- }*/
+ LUtils::writeFile(dset, DS, true);
+ }
//Check the fluxbox configuration files
dset = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/";
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp
index dbb70e43..8ae77ea6 100644
--- a/src-qt5/core/libLumina/LuminaXDG.cpp
+++ b/src-qt5/core/libLumina/LuminaXDG.cpp
@@ -568,6 +568,7 @@ QString LFileInfo::iconfile(){
// -- Check if this is an XDG desktop file
bool LFileInfo::isDesktopFile(){
+ if(desk==0){ return false; }
return (!desk->filePath.isEmpty());
}
diff --git a/src-qt5/core/lumina-desktop/LDesktop.cpp b/src-qt5/core/lumina-desktop/LDesktop.cpp
index 980b3e5e..8258dbb6 100644
--- a/src-qt5/core/lumina-desktop/LDesktop.cpp
+++ b/src-qt5/core/lumina-desktop/LDesktop.cpp
@@ -12,11 +12,13 @@
#include "LWinInfo.h"
#include "JsonMenu.h"
+#include <QScreen>
+
#define DEBUG 0
LDesktop::LDesktop(int deskNum, bool setdefault) : QObject(){
-
- DPREFIX = "desktop-"+QString::number(deskNum)+"/";
+ QString screenID = QApplication::screens().at(deskNum)->name();
+ DPREFIX = "desktop-"+screenID+"/";
desktopnumber = deskNum;
desktop = QApplication::desktop();
defaultdesktop = setdefault; //(desktop->screenGeometry(desktopnumber).x()==0);
diff --git a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp
index dadbd848..3d33db71 100644
--- a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp
+++ b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp
@@ -38,7 +38,8 @@ void LDesktopBackground::setBackground(const QString& bgFile, const QString& for
} else {
mode = Qt::KeepAspectRatio;
}
- bgImage = bgImage.scaled(size(), mode);
+ if(bgImage.height() != this->height() && bgImage.width() != this->width() ){ bgImage = bgImage.scaled(size(), mode); }
+ //bgImage = bgImage.scaled(size(), mode);
}
// Calculate the offset
diff --git a/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h b/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h
index 92226680..44765029 100644
--- a/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h
+++ b/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h
@@ -183,6 +183,9 @@ private slots:
}
protected:
+ void paintEvent(QPaintEvent*){
+ //do nothing here - the main plugin area should *always* be invisible
+ }
//Need Drag and Drop functionality (internal movement)
void dragEnterEvent(QDragEnterEvent *ev){
if(ev->mimeData()->hasFormat(MIMETYPE) ){
diff --git a/src-qt5/core/lumina-desktop/LPanel.cpp b/src-qt5/core/lumina-desktop/LPanel.cpp
index bf063a31..b0abf498 100644
--- a/src-qt5/core/lumina-desktop/LPanel.cpp
+++ b/src-qt5/core/lumina-desktop/LPanel.cpp
@@ -6,6 +6,8 @@
//===========================================
#include "LPanel.h"
#include "LSession.h"
+#include <QScreen>
+
#include "panel-plugins/systemtray/LSysTray.h"
#define DEBUG 0
@@ -26,7 +28,8 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){
screennum = scr;
panelnum = num; //save for later
screen = LSession::desktop();
- PPREFIX = "panel"+QString::number(screennum)+"."+QString::number(num)+"/";
+ QString screenID = QApplication::screens().at(screennum)->name();
+ PPREFIX = "panel_"+screenID+"."+QString::number(num)+"/";
defaultpanel = (LSession::handle()->screenGeom(screennum).x()==0 && num==0);
horizontal=true; //use this by default initially
hidden = false; //use this by default
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp
index 434bfd2d..9a985b3f 100644
--- a/src-qt5/core/lumina-desktop/LSession.cpp
+++ b/src-qt5/core/lumina-desktop/LSession.cpp
@@ -70,11 +70,11 @@ LSession::~LSession(){
if(this->isPrimaryProcess()){
//WM->stopWM();
for(int i=0; i<DESKTOPS.length(); i++){
- delete DESKTOPS[i];
+ DESKTOPS[i]->deleteLater();
}
//delete WM;
- delete settingsmenu;
- delete appmenu;
+ settingsmenu->deleteLater();
+ appmenu->deleteLater();
delete currTranslator;
if(mediaObj!=0){delete mediaObj;}
}
@@ -207,7 +207,7 @@ void LSession::CleanupSession(){
}
evFilter->StopEventHandling();
//Stop the window manager
- qDebug() << " - Stopping the window manager";
+ //qDebug() << " - Stopping the window manager";
//WM->stopWM();
//Now close down the desktop
qDebug() << " - Closing down the desktop elements";
diff --git a/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp b/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp
index 3c92c050..ca7fb38d 100644
--- a/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp
+++ b/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp
@@ -48,7 +48,7 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag
session->RootSizeChange();
}else if( ((xcb_property_notify_event_t*)ev)->window == QX11Info::appRootWindow() \
&& ( ( ((xcb_property_notify_event_t*)ev)->atom == session->XCB->EWMH._NET_CURRENT_DESKTOP) )){
- qDebug() << "Got Workspace Change";
+ //qDebug() << "Got Workspace Change";
session->emit WorkspaceChanged();
}else if( SysNotifyAtoms.contains( ((xcb_property_notify_event_t*)ev)->atom ) ){
//Update the status/list of all running windows
diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp
index 69505705..545ba430 100644
--- a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp
+++ b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp
@@ -33,6 +33,12 @@ LDPlugin::LDPlugin(QWidget *parent, QString id) : QFrame(parent){
void LDPlugin::setupMenu(){
menu->clear();
+ //SPECIAL CONTEXT MENU OPTIONS FOR PARTICULAR PLUGIN TYPES
+ if(PLUGID.startsWith("applauncher::")){
+ menu->addAction( LXDG::findIcon("quickopen",""), tr("Launch Item"), this, SIGNAL(PluginActivated()) );
+ menu->addSeparator();
+ }
+ //General Options
menu->addAction( LXDG::findIcon("transform-move",""), tr("Start Moving Item"), this, SLOT(slotStartMove()) );
menu->addAction( LXDG::findIcon("transform-scale",""), tr("Start Resizing Item"), this, SLOT(slotStartResize()) );
menu->addSeparator();
@@ -54,4 +60,4 @@ void LDPlugin::setupMenu(){
}
//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());
-}*/ \ No newline at end of file
+}*/
diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h
index 27fcaa24..820880ed 100644
--- a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h
+++ b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h
@@ -106,6 +106,7 @@ signals:
void OpenDesktopMenu();
void CloseDesktopMenu();
void PluginResized();
+ void PluginActivated();
//Signals for communication with the desktop layout system (not generally used by hand)
void StartMoving(QString); //ID of plugin
diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
index b74bbcb3..e9ef78cb 100644
--- a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
+++ b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
@@ -19,6 +19,7 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par
watcher = new QFileSystemWatcher(this);
connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT( loadButton()) );
+ connect(this, SIGNAL(PluginActivated()), this, SLOT(buttonClicked()) ); //in case they use the context menu to launch it.
QTimer::singleShot(200,this, SLOT(loadButton()) );
}
diff --git a/src-qt5/core/lumina-info/MainUI.ui b/src-qt5/core/lumina-info/MainUI.ui
index e1feab0a..ecb562b8 100644
--- a/src-qt5/core/lumina-info/MainUI.ui
+++ b/src-qt5/core/lumina-info/MainUI.ui
@@ -146,7 +146,7 @@
</sizepolicy>
</property>
<property name="whatsThis">
- <string notr="true">https://bugs.pcbsd.org/projects/pcbsd</string>
+ <string notr="true">https://github.com/trueos/lumina/issues</string>
</property>
<property name="text">
<string>Bug Reports</string>
@@ -270,7 +270,7 @@
</sizepolicy>
</property>
<property name="whatsThis">
- <string notr="true">https://webchat.freenode.net/?channels=%23lumina-desktop</string>
+ <string notr="true">https://gitter.im/trueos/lumina?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge</string>
</property>
<property name="text">
<string>Ask the Community</string>
diff --git a/src-qt5/core/lumina-info/main.cpp b/src-qt5/core/lumina-info/main.cpp
index b8eb0dce..8fe6a183 100644
--- a/src-qt5/core/lumina-info/main.cpp
+++ b/src-qt5/core/lumina-info/main.cpp
@@ -16,7 +16,7 @@ int main(int argc, char ** argv)
LSingleApplication a(argc, argv, "lumina-info"); //loads translations inside constructor
if( !a.isPrimaryProcess()){ return 0; }
//qDebug() << "Set Application Name";
- a.setApplicationName("About Lumina-DE");
+ a.setApplicationName("About Lumina");
//qDebug() << "Load Theme Engine";
LuminaThemeEngine themes(&a);
//qDebug() << "Start the UI";
diff --git a/src-qt5/core/lumina-session/main.cpp b/src-qt5/core/lumina-session/main.cpp
index 464302a7..77e553d4 100644
--- a/src-qt5/core/lumina-session/main.cpp
+++ b/src-qt5/core/lumina-session/main.cpp
@@ -33,8 +33,10 @@ int main(int argc, char ** argv)
QString disp = QString(getenv("DISPLAY")).simplified();
if(disp.isEmpty()){
//No X session found. Go ahead and re-init this binary within an xinit call
- QStringList args; args << QCoreApplication::applicationFilePath();
- if(LUtils::isValidBinary("x11vnc")){ args << "--" << "-listen" << "tcp"; } //need to be able to VNC into this session
+ QString prog = QString(argv[0]).section("/",-1);
+ LUtils::isValidBinary(prog); //will adjust the path to be absolute
+ QStringList args; args << prog;
+ //if(LUtils::isValidBinary("x11vnc")){ args << "--" << "-listen" << "tcp"; } //need to be able to VNC into this session
return QProcess::execute("xinit", args);
}
//Setup any initialization values
diff --git a/src-qt5/core/lumina-session/session.cpp b/src-qt5/core/lumina-session/session.cpp
index 937f05d0..2647e58d 100644
--- a/src-qt5/core/lumina-session/session.cpp
+++ b/src-qt5/core/lumina-session/session.cpp
@@ -11,6 +11,8 @@
#include <QProcessEnvironment>
#include <QDebug>
#include <QSettings>
+#include <QDir>
+
#include <LuminaUtils.h>
#include <LuminaOS.h>
@@ -34,7 +36,8 @@ void LSession::procFinished(){
stopped++;
if(!stopping){
//See if this process is the main desktop binary
- if(PROCS[i]->program().section("/",-1) == "lumina-desktop"){ stopall(); } //start closing down everything
+ if(PROCS[i]->objectName()=="runtime"){ stopall(); }
+ //if(PROCS[i]->program().section("/",-1) == "lumina-desktop"){ stopall(); } //start closing down everything
//else{ PROCS[i]->start(QIODevice::ReadOnly); } //restart the process
break;
}
@@ -56,6 +59,14 @@ void LSession::startProcess(QString ID, QString command, QStringList watchfiles)
proc->setProcessChannelMode(QProcess::MergedChannels);
proc->setProcessEnvironment( QProcessEnvironment::systemEnvironment() );
proc->setStandardOutputFile(logfile);
+ proc->setObjectName(ID);
+ if(ID=="runtime"){
+ //Bypass for a hidden dbus requirement for Qt itself (Qt 5.5.1)
+ QDir tmp = QDir::temp();
+ if( tmp.entryList(QStringList() << "dbus-*").isEmpty() && LUtils::isValidBinary("dbus-launch")){
+ command.prepend("dbus-launch --exit-with-session ");
+ }
+ }
proc->start(command, QIODevice::ReadOnly);
connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(procFinished()) );
PROCS << proc;
bgstack15