aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libLumina/LuminaOS-FreeBSD.cpp8
-rw-r--r--lumina-config/mainUI.cpp21
2 files changed, 21 insertions, 8 deletions
diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp
index 73637048..430a31fc 100644
--- a/libLumina/LuminaOS-FreeBSD.cpp
+++ b/libLumina/LuminaOS-FreeBSD.cpp
@@ -8,6 +8,7 @@
#include "LuminaOS.h"
#include <unistd.h>
+#include <QDebug>
//can't read xbrightness settings - assume invalid until set
static int screenbrightness = -1;
@@ -71,17 +72,18 @@ void LOS::setScreenBrightness(int percent){
//ensure bounds
if(percent<0){percent=0;}
else if(percent>100){ percent=100; }
- float pf = percent/100.0; //convert to a decimel
//Run the command(s)
bool success = false;
// - try hardware setting first (PC-BSD only)
if(QFile::exists("/usr/local/bin/pc-sysconfig")){
- QString ret = LUtils::getCmdOutput("pc-sysconfig \"setscreenbrightness "+QString::number(percent)+"\"").join("");
- success = (ret.simplified() == "[SUCCESS]");
+ QString ret = LUtils::getCmdOutput("pc-sysconfig", QStringList() <<"setscreenbrightness "+QString::number(percent)).join("");
+ success = ret.toLower().contains("success");
+ qDebug() << "Set hardware brightness:" << percent << success;
}
// - if hardware brightness does not work, use software brightness
if(!success){
QString cmd = "xbrightness %1";
+ float pf = percent/100.0; //convert to a decimel
cmd = cmd.arg( QString::number( int(65535*pf) ) );
success = (0 == LUtils::runCmd(cmd) );
}
diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp
index 744d4bdf..987324f3 100644
--- a/lumina-config/mainUI.cpp
+++ b/lumina-config/mainUI.cpp
@@ -440,7 +440,7 @@ void MainUI::slotChangePage(bool enabled){
}
ui->group_screen->setVisible(showScreen && (ui->spin_screen->maximum()>1) );
//Hide the save button for particular pages
- ui->push_save->setVisible(!ui->actionDefaults->isChecked()); //hide on the default page
+ ui->push_save->setVisible(!ui->actionDefaults->isChecked() || moddesk || modpan || modmenu || modshort || moddef || modses); //hide on the default page if nothing waiting to be saved
//Special functions for particular pages
if(ui->page_panels->isVisible()){ checkpanels(); }
@@ -557,11 +557,21 @@ void MainUI::loadCurrentSettings(bool screenonly){
ui->list_panel2_plugins->clear();
for(int i=0; i<plugs.length(); i++){
QString pid = plugs[i].section("---",0,0);
- LPI info = PINFO->panelPluginInfo(pid);
- if(!info.ID.isEmpty()){
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name );
+ 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);
+ ui->list_panel2_plugins->addItem(it);
+ }
}
}
QString color = settings->value(PPrefix+"color","rgba(255,255,255,160)").toString();
@@ -730,6 +740,7 @@ void MainUI::saveCurrentSettings(bool screenonly){
moddesk = modpan = false;
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);
}
bgstack15