Changes in / [41926d1:6385128]


Ignore:
Location:
lumina
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • lumina/DEPENDENCIES

    rdcf64bc r1891777  
    77oxygen icon theme (x11-themes/kde4-icons-oxygen) 
    88xscreensaver & xscreensaver-demo  (x11/xscreensaver) 
    9 apm (/usr/sbin/apm on FreeBSD - built in) (Advanced Power Management utility) 
     9 
     10  == FreeBSD (libLumina/LuminaOS-FreeBSD.cpp) == 
     11  shutdown (/sbin/shutdown - built in) (System restart/poweroff) 
     12  mount (/sbin/mount - built in) (Device Availability) 
     13  apm (/usr/sbin/apm - built in) (Advanced Power Management utility) 
     14  mixer (/usr/sbin/mixer - built in) (Audio System Mixer) 
     15  xbrightness (x11/xbrightness) (Screen Brightness Control) 
     16   
     17  == Linux == 
     18  <To be filled in by a Linux dev> 
    1019 
    1120=== BUILD & RUN === 
  • lumina/libLumina/LuminaOS-FreeBSD.cpp

    rd0a927f r733da14  
    11//=========================================== 
    22//  Lumina-DE source code 
    3 //  Copyright (c) 2013, Ken Moore 
     3//  Copyright (c) 2014, Ken Moore 
    44//  Available under the 3-clause BSD license 
    55//  See the LICENSE file for full details 
    66//=========================================== 
    77#include "LuminaOS.h" 
     8#include <unistd.h> 
     9 
    810static int screenbrightness = -1; 
    911 
     
    101103  }      
    102104} 
     105 
     106//System Shutdown 
     107void LOS::systemShutdown(){ //start poweroff sequence 
     108  QProcess::startDetached("shutdown -p now"); 
     109} 
     110 
     111//System Restart 
     112void LOS::systemRestart(){ //start reboot sequence 
     113  QProcess::startDetached("shutdown -r now"); 
     114} 
     115 
     116//Battery Availability 
     117bool LOS::hasBattery(){ 
     118  int val = LUtils::getCmdOutput("apm -l").join("").toInt(); 
     119  return (val >= 0 && val <= 100); 
     120} 
     121 
     122//Battery Charge Level 
     123int LOS::batteryCharge(){ //Returns: percent charge (0-100), anything outside that range is counted as an error 
     124  int charge = LUtils::getCmdOutput("apm -l").join("").toInt(); 
     125  if(charge > 100){ charge = -1; } //invalid charge  
     126  return charge;         
     127} 
     128 
     129//Battery Charging State 
     130bool LOS::batteryIsCharging(){ 
     131  return (LUtils::getCmdOutput("apm -a").join("").simplified() == "1"); 
     132} 
     133 
     134//Battery Time Remaining 
     135int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining 
     136  return LUtils::getCmdOutput("apm -t").join("").toInt(); 
     137} 
  • lumina/libLumina/LuminaOS.h

    rd0a927f r733da14  
    55//  See the LICENSE file for full details 
    66//=========================================== 
     7//  This is the main interface for any OS-specific system calls 
     8//    To port Lumina to a different operating system, just create a file  
     9//    called "LuminaOS-<Operating System>.cpp", and use that file in  
     10//    the project (libLumina.pro) instead of LuminaOS-FreeBSD.cpp 
     11//=========================================== 
    712#ifndef _LUMINA_LIBRARY_OS_H 
    813#define _LUMINA_LIBRARY_OS_H 
     
    1015#include <QString> 
    1116#include <QStringList> 
     17#include <QProcess> 
    1218 
    1319#include "LuminaUtils.h" 
     
    3036        //Modify the current volume by a set amount (+ or -) 
    3137        static void changeAudioVolume(int percentdiff); 
     38 
     39        //System Shutdown 
     40        static void systemShutdown(); //start poweroff sequence 
     41        //System Restart 
     42        static void systemRestart(); //start reboot sequence 
     43 
     44        //Battery Availability 
     45        static bool hasBattery(); 
     46        //Battery Charge Level 
     47        static int batteryCharge(); //Returns: percent charge (0-100), anything outside that range is counted as an error 
     48        //Battery Charging State 
     49        static bool batteryIsCharging(); 
     50        //Battery Time Remaining 
     51        static int batterySecondsLeft(); //Returns: estimated number of seconds remaining 
    3252}; 
    3353 
  • lumina/libLumina/libLumina.pro

    r1506c22 r733da14  
    2020        LuminaX11.cpp \  
    2121        LuminaOS-FreeBSD.cpp 
     22#       LuminaOS-Linux.cpp 
    2223 
    2324INCLUDEPATH += /usr/local/include 
  • lumina/lumina-desktop/Globals.h

    rf71b232 r9d0ec76  
    1111 
    1212#include <unistd.h> 
     13#include <stdio.h> 
    1314 
    14 #ifdef __linux 
     15/*#ifdef __linux 
    1516  // Needed for BUFSIZ 
    1617  #include <stdio.h> 
    17 #endif // #ifdef __linux 
     18#endif // #ifdef __linux*/ 
    1819 
    1920class Lumina{ 
     
    3839          return QString::fromLocal8Bit(name,count); 
    3940        } 
    40         //Shutdown the system 
     41        /*//Shutdown the system 
    4142#ifdef __linux 
    4243        static void shutdown(){ system("(shutdown -h now) &"); } 
     
    6869        static int batterySecondsLeft(){ 
    6970          return LUtils::getCmdOutput("apm -t").join("").toInt(); 
    70         } 
     71        }*/ 
    7172}; 
    7273 
  • lumina/lumina-desktop/LPanel.cpp

    r4d19595 r9d0ec76  
    7070  } 
    7171  int ht = settings->value(PPREFIX+"height", 22).toInt(); //this is technically the distance into the screen from the edge 
    72   /*int xoffset=0; 
    73   for(int i=0; i<screennum; i++){ 
    74     xoffset = xoffset + screen->screenGeometry(i).width(); 
    75   }*/ 
    7672  qDebug() << " - set Geometry"; 
    7773  int xwid = screen->screenGeometry(screennum).width(); 
     
    115111  if(defaultpanel && plugins.isEmpty()){ 
    116112    plugins << "userbutton" << "desktopbar" << "desktopswitcher" << "taskmanager" << "spacer" << "systemtray" << "clock"; 
    117     if(SYSTEM::hasBattery()){ plugins << "battery"; } 
     113    if(LOS::hasBattery()){ plugins << "battery"; } 
    118114  }else if(defaultpanel && !plugins.contains("userbutton") ){ 
    119115    plugins.prepend("userbutton"); //make sure we have this button since that lets the user logout 
  • lumina/lumina-desktop/LPanel.h

    ra584991 r9d0ec76  
    2626 
    2727#include <LuminaX11.h> 
     28#include <LuminaOS.h> 
    2829 
    2930class LPanel : public QWidget{ 
  • lumina/lumina-desktop/SystemWindow.h

    r4565b4c r9d0ec76  
    1212#include <LuminaXDG.h> 
    1313#include <LuminaX11.h> 
     14#include <LuminaOS.h> 
    1415 
    1516 
     
    4344        void sysRestart(){ 
    4445          closeAllWindows(); 
    45           SYSTEM::restart(); 
     46          LOS::systemRestart(); 
    4647          QCoreApplication::exit(0);             
    4748        } 
     
    4950        void sysShutdown(){ 
    5051          closeAllWindows(); 
    51           SYSTEM::shutdown(); 
     52          LOS::systemShutdown(); 
    5253          QCoreApplication::exit(0); 
    5354        } 
  • lumina/lumina-desktop/panel-plugins/battery/LBattery.cpp

    r0e77750 r9d0ec76  
    3030  // Get current state of charge 
    3131  //QStringList result = LUtils::getCmdOutput("/usr/sbin/apm", QStringList() << "-al"); 
    32   int charge = SYSTEM::batteryCharge(); //result.at(1).toInt(); 
     32  int charge = LOS::batteryCharge(); //result.at(1).toInt(); 
    3333//qDebug() << "1: " << result.at(0).toInt() << " 2: " << result.at(1).toInt(); 
    3434  int icon = -1; 
     
    3838  else if (charge > 30) { icon = 1; } 
    3939  else if (charge > 0 ) { icon = 0; } 
    40   if(SYSTEM::batteryIsCharging()){ icon = icon+10; } 
     40  if(LOS::batteryIsCharging()){ icon = icon+10; } 
    4141  //icon = icon + result.at(0).toInt() * 10; 
    4242  if (icon != iconOld || force) { 
     
    8787 
    8888QString LBattery::getRemainingTime(){ 
    89   int secs = SYSTEM::batterySecondsLeft(); 
     89  int secs = LOS::batterySecondsLeft(); 
    9090  if(secs < 0){ return "??"; } 
    9191  QString rem; //remaining 
  • lumina/lumina-desktop/panel-plugins/battery/LBattery.h

    r0e77750 r9d0ec76  
    1515#include <LuminaUtils.h> 
    1616#include <LuminaXDG.h> 
     17#include <LuminaOS.h> 
    1718 
    1819#include "../../Globals.h" 
  • lumina/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp

    rc78ef7c r9d0ec76  
    1010  frame = new QFrame(this); 
    1111  frame->setContentsMargins(0,0,0,0); 
    12   frame->setStyleSheet("QFrame{ background: black; border: 1px solid grey; border-radius: 5px; }"); 
     12  frame->setStyleSheet("QFrame{ background: black; border: 1px solid transparent; border-radius: 5px; }"); 
    1313  LI = new QBoxLayout( this->layout()->direction(), this); 
    1414    frame->setLayout(LI); 
     
    6464    //qDebug() << " - New Icon"; 
    6565    TrayIcon *cont = new TrayIcon(this); 
     66      QCoreApplication::processEvents(); 
    6667      connect(cont, SIGNAL(AppClosed()), this, SLOT(trayAppClosed()) ); 
    6768      connect(cont, SIGNAL(AppAttached()), this, SLOT(updateStatus()) ); 
     
    7576        this->setMaximumSize(10000, trayIcons.length()*this->width()); 
    7677      } 
     78      QCoreApplication::processEvents(); 
    7779      cont->attachApp(win); 
    78     //this->layout()->update(); //make sure there is no blank space 
     80    LI->update(); //make sure there is no blank space 
    7981  } 
    8082} 
     
    8284void LSysTray::updateStatus(){ 
    8385  qDebug() << "System Tray: Client Attached"; 
    84   this->layout()->update(); //make sure there is no blank space 
     86  LI->update(); //make sure there is no blank space 
    8587  //qDebug() << " - Items:" << trayIcons.length(); 
    8688} 
     
    9395      LI->removeWidget(cont); 
    9496      delete cont; 
     97      QCoreApplication::processEvents(); 
    9598    } 
    9699  } 
  • lumina/lumina-desktop/panel-plugins/systemtray/LSysTray.h

    r0e77750 r9d0ec76  
    1414#include <QX11Info> 
    1515#include <QX11EmbedContainer> 
     16#include <QCoreApplication> 
    1617 
    1718//Local includes 
Note: See TracChangeset for help on using the changeset viewer.