Changeset cf7372a


Ignore:
Timestamp:
05/06/14 10:12:35 (11 months ago)
Author:
susannej <susanne_j@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
418d23a
Parents:
ead9cc7 (diff), 5a510ec (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://github.com/susannej/pcbsd

Conflicts:

lumina/lumina-desktop/panel-plugins/battery/NOTES

Location:
lumina/lumina-desktop/panel-plugins/battery
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lumina/lumina-desktop/panel-plugins/battery/LBattery.cpp

    r9e3517a r495c69b  
    88 
    99LBattery::LBattery(QWidget *parent) : LPPlugin(parent, "battery"){ 
     10  iconOld = -1; 
    1011  //Setup the widget 
    1112  label = new QLabel(this); 
     
    2627 
    2728void LBattery::updateBattery(){ 
     29  // Get current state of charge 
     30  QStringList result = LUtils::getCmdOutput("/usr/sbin/apm", QStringList() << "-l"); 
     31  int charge = result.at(0).toInt(); 
     32  int icon = 0; 
     33  if (charge > 100) { icon = 5; } 
     34  else if (charge > 90) { icon = 4; } 
     35  else if (charge > 70) { icon = 3; } 
     36  else if (charge > 50) { icon = 2; } 
     37  else if (charge > 30) { icon = 1; } 
     38  if (icon != iconOld) { 
     39    switch (icon) { 
     40      case 0: 
     41        label->setIcon( LXDG::findIcon("battery-caution", ":/images/battery-caution.png") ); 
     42        break; 
     43      case 1: 
     44        label->setIcon( LXDG::findIcon("battery-040", ":/images/battery-040.png") ); 
     45        break; 
     46      case 2: 
     47        label->setIcon( LXDG::findIcon("battery-060", ":/images/battery-060.png") ); 
     48        break; 
     49      case 3: 
     50        label->setIcon( LXDG::findIcon("battery-080", ":/images/battery-080.png") ); 
     51        break; 
     52      case 4: 
     53        label->setIcon( LXDG::findIcon("battery-100", ":/images/battery-100.png") ); 
     54        break; 
     55      case 5: 
     56        label->setIcon( LXDG::findIcon("battery-missing", ":/images/battery-missing.png") ); 
     57        break; 
     58    } 
     59    iconOld = icon; 
     60  } 
    2861  //Now update the display 
    29   label->setText("19%"); 
    30   label->setToolTip("High: 19% ~23 Minuten"); 
     62  label->setToolTip(QString("%1 %%").arg(charge)); 
    3163} 
  • lumina/lumina-desktop/panel-plugins/battery/LBattery.h

    r9e3517a r11d5b93  
    2424        QTimer *timer; 
    2525        QLabel *label; 
     26        int iconOld; 
    2627         
    2728private slots: 
  • lumina/lumina-desktop/panel-plugins/battery/NOTES

    read9cc7 rcf7372a  
     1Eventuell mit einem MenÃŒ implementieren, mit EintrÀgen fÃŒr: 
     2Anzeige des kompletten Status und Infos 
     3Herunterfahren des Systems etc. 
     4 
     5apm -a 
     6        Zeigt den AC line status an 
     7        0 = off-line 
     8        1 = on-line 
     9        2 = backup-power 
     10 
    111apm -b 
    212        Zeigt  
Note: See TracChangeset for help on using the changeset viewer.