Changeset 761148d


Ignore:
Timestamp:
05/09/14 14:03:15 (3 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.2
Children:
49942f24
Parents:
5619366 (diff), 92c8291 (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 github.com:pcbsd/pcbsd

Files:
7 added
15 edited

Legend:

Unmodified
Added
Removed
  • lumina/libLumina/LuminaX11.cpp

    rc47b1152 r0ccf75ef  
    147147  } 
    148148  return window;                 
     149} 
     150 
     151// ===== SetNumberOfDesktops() ===== 
     152void LX11::SetNumberOfDesktops(int number){ 
     153  Display *display = QX11Info::display(); 
     154  Window rootWindow = QX11Info::appRootWindow(); 
     155 
     156  Atom atom = XInternAtom(display, "_NET_NUMBER_OF_DESKTOPS", False); 
     157  XEvent xevent; 
     158  xevent.type                 = ClientMessage; 
     159  xevent.xclient.type         = ClientMessage;  
     160  xevent.xclient.display      = display; 
     161  xevent.xclient.window       = rootWindow; 
     162  xevent.xclient.message_type = atom; 
     163  xevent.xclient.format       = 32; 
     164  xevent.xclient.data.l[0]    = number; 
     165  xevent.xclient.data.l[1]    = CurrentTime; 
     166  xevent.xclient.data.l[2]    = 0; 
     167  xevent.xclient.data.l[3]    = 0; 
     168  xevent.xclient.data.l[4]    = 0; 
     169  XSendEvent(display, rootWindow, False, SubstructureNotifyMask | SubstructureRedirectMask, &xevent); 
     170 
     171  XFlush(display);       
     172} 
     173 
     174// ===== SetCurrentDesktop() ===== 
     175void LX11::SetCurrentDesktop(int number){ 
     176  Display *display = QX11Info::display(); 
     177  Window rootWindow = QX11Info::appRootWindow(); 
     178 
     179  Atom atom = XInternAtom(display, "_NET_CURRENT_DESKTOP", False); 
     180  XEvent xevent; 
     181  xevent.type                 = ClientMessage; 
     182  xevent.xclient.type         = ClientMessage;  
     183  xevent.xclient.display      = display; 
     184  xevent.xclient.window       = rootWindow; 
     185  xevent.xclient.message_type = atom; 
     186  xevent.xclient.format       = 32; 
     187  xevent.xclient.data.l[0]    = number; 
     188  xevent.xclient.data.l[1]    = CurrentTime; 
     189  xevent.xclient.data.l[2]    = 0; 
     190  xevent.xclient.data.l[3]    = 0; 
     191  xevent.xclient.data.l[4]    = 0; 
     192  XSendEvent(display, rootWindow, False, SubstructureNotifyMask | SubstructureRedirectMask, &xevent); 
     193 
     194  XFlush(display);       
     195} 
     196 
     197// ===== GetNumberOfDesktops() ===== 
     198int LX11::GetNumberOfDesktops(){ 
     199  int number = -1; 
     200  Atom a = XInternAtom(QX11Info::display(), "_NET_NUMBER_OF_DESKTOPS", true); 
     201  Atom realType; 
     202  int format; 
     203  unsigned long num, bytes; 
     204  unsigned char *data = 0; 
     205  int status = XGetWindowProperty(QX11Info::display(), QX11Info::appRootWindow(), a, 0L, (~0L), 
     206             false, AnyPropertyType, &realType, &format, &num, &bytes, &data); 
     207  if( (status >= Success) && (num > 0) ){ 
     208    number = *data; 
     209    XFree(data); 
     210  } 
     211  return number; 
     212} 
     213 
     214// ===== GetCurrentDesktop ===== 
     215int LX11::GetCurrentDesktop(){ 
     216  int number = -1; 
     217  Atom a = XInternAtom(QX11Info::display(), "_NET_CURRENT_DESKTOP", true); 
     218  Atom realType; 
     219  int format; 
     220  unsigned long num, bytes; 
     221  unsigned char *data = 0; 
     222  int status = XGetWindowProperty(QX11Info::display(), QX11Info::appRootWindow(), a, 0L, (~0L), 
     223             false, AnyPropertyType, &realType, &format, &num, &bytes, &data); 
     224  if( (status >= Success) && (num > 0) ){ 
     225    number = data[0]; 
     226    XFree(data); 
     227  } 
     228  return number;         
    149229} 
    150230 
  • lumina/libLumina/LuminaX11.h

    re02b72f9 r7e29143  
    5050        static WId ActiveWindow();                              //List the currently-active window 
    5151         
     52        //Window Manager Interaction 
     53        static void SetNumberOfDesktops(int);   // set number of virtual desktops 
     54        static void SetCurrentDesktop(int);             // set current virtual desktop 
     55        static int GetNumberOfDesktops();               // get number of virtual desktops 
     56        static int GetCurrentDesktop();                 // get current virtual desktop 
     57         
    5258        //Single Window Management 
    5359        static void CloseWindow(WId);                   // Close the Window 
  • lumina/lumina-desktop/AppMenu.cpp

    rc47b1152 r5f42f3f  
    5353      else if(cats[i] == "System"){ name = tr("System"); icon = "applications-system"; } 
    5454      else if(cats[i] == "Utility"){ name = tr("Utility"); icon = "applications-utilities"; } 
    55       else if(cats[i] == "Unsorted"){ name = tr("Unsorted"); icon = "applications-other"; } 
     55      else{ name = tr("Unsorted"); icon = "applications-other"; } 
     56       
    5657      QMenu *menu = new QMenu(name, this); 
    5758      menu->setIcon(LXDG::findIcon(icon,"")); 
  • lumina/lumina-desktop/Globals.h

    rf12e79a r17692af  
    77#ifndef _LUMINA_DESKTOP_GLOBALS_H 
    88#define _LUMINA_DESKTOP_GLOBALS_H 
     9 
     10#include <LuminaUtils.h> 
    911 
    1012#include <unistd.h> 
     
    4244        //Restart the system 
    4345        static void restart(){ system("(shutdown -r now) &"); } 
     46         
     47        //Determine if there is battery support 
     48        static bool hasBattery(){ 
     49          int val = LUtils::getCmdOutput("apm -l").join("").toInt(); 
     50          return (val >= 0 && val <= 100); 
     51        } 
     52         
     53        //Get the current battery charge percentage 
     54        static int batteryCharge(){ 
     55          int charge = LUtils::getCmdOutput("apm -l").join("").toInt(); 
     56          if(charge > 100){ charge = -1; } //invalid charge  
     57          return charge; 
     58        } 
     59         
     60        //Get the current battery charge percentage 
     61        static bool batteryIsCharging(){ 
     62          return (LUtils::getCmdOutput("apm -a").join("").simplified() == "1"); 
     63        } 
     64         
     65        //Get the amount of time remaining for the battery 
     66        static int batterySecondsLeft(){ 
     67          return LUtils::getCmdOutput("apm -t").join("").toInt(); 
     68        } 
    4469}; 
    4570 
  • lumina/lumina-desktop/LDesktop.cpp

    rf06effb r92c8291  
    1919  deskMenu = new QMenu(0); 
    2020  appmenu = new AppMenu(0); 
     21  workspacelabel = new QLabel(0); 
     22    workspacelabel->setAlignment(Qt::AlignCenter); 
     23  wkspaceact = new QWidgetAction(0); 
     24    wkspaceact->setDefaultWidget(workspacelabel); 
    2125  //Setup the internal variables 
    2226  settings = new QSettings(QSettings::UserScope, "LuminaDE","desktopsettings", this); 
     
    4953  delete appmenu; 
    5054  delete bgWindow; 
     55  delete workspacelabel; 
     56  delete wkspaceact; 
    5157} 
    5258 
     
    6571  qDebug() << " - Update Menu:" << desktopnumber; 
    6672  deskMenu->clear(); 
     73  //Put a label at the top  
     74  int num = LX11::GetCurrentDesktop(); 
     75  qDebug() << "Found desktop number:" << num; 
     76  if(num < 0){ workspacelabel->setText( "<b>"+tr("Lumina Desktop")+"</b>"); } 
     77  else{ workspacelabel->setText( "<b>"+QString(tr("Workspace %1")).arg(QString::number(num+1))+"</b>"); } 
     78  deskMenu->addAction(wkspaceact); 
     79  deskMenu->addSeparator(); 
    6780  //Add in the system applications menu 
    6881  deskMenu->addAction(LXDG::findIcon("utilities-terminal",""), tr("Terminal"), this, SLOT(SystemTerminal()) ); 
  • lumina/lumina-desktop/LDesktop.h

    r51ace02 r92c8291  
    1717#include <QTimer> 
    1818#include <QFileSystemWatcher> 
     19#include <QLabel> 
     20#include <QWidgetAction> 
    1921 
    2022 
     
    5153        QMenu *deskMenu; 
    5254        AppMenu *appmenu; 
     55        QLabel *workspacelabel; 
     56        QWidgetAction *wkspaceact; 
    5357        QList<LDPlugin*> PLUGINS; 
    5458        QFileSystemWatcher *watcher; 
     
    5963        void UpdateMenu(); 
    6064        void ShowMenu(){ 
     65          UpdateMenu(); 
    6166          deskMenu->popup(QCursor::pos()); 
    6267        } 
  • lumina/lumina-desktop/LPanel.cpp

    r59bd6842 r5f42f3f  
    7171  QStringList plugins = settings->value(PPREFIX+"pluginlist", QStringList()).toStringList(); 
    7272  if(defaultpanel && plugins.isEmpty()){ 
    73     plugins << "userbutton" << "desktopbar" << "spacer"  << "clock"; 
     73    plugins << "userbutton" << "desktopbar" << "desktopswitcher" << "spacer"  << "clock"; 
     74    if(SYSTEM::hasBattery()){ plugins << "battery"; } 
    7475  }else if(defaultpanel && !plugins.contains("userbutton") ){ 
    7576    plugins.prepend("userbutton"); //make sure we have this button since that lets the user logout 
  • lumina/lumina-desktop/fluxboxconf/fluxbox-init-rc

    r3ef1a66 r77631c2  
    1515session.screen0.toolbar.layer:  Dock 
    1616session.screen0.toolbar.height: 0 
    17 session.screen0.toolbar.tools:  prevworkspace, workspacename, nextworkspace, iconbar, systemtray 
     17session.screen0.toolbar.tools:  iconbar, systemtray 
    1818session.screen0.iconbar.iconWidth:      128 
    1919session.screen0.iconbar.alignment:      Left 
  • lumina/lumina-desktop/panel-plugins/battery/LBattery.cpp

    r8ec8faf r5f42f3f  
    1010  iconOld = -1; 
    1111  //Setup the widget 
    12   label = new LTBWidget(this); 
     12  label = new QLabel(this); 
     13    label->setScaledContents(true); 
    1314    //label->setAlignment(Qt::AlignCenter); 
    1415  this->layout()->addWidget(label); 
     
    2829void LBattery::updateBattery(){ 
    2930  // Get current state of charge 
    30   QStringList result = LUtils::getCmdOutput("/usr/sbin/apm", QStringList() << "-al"); 
    31   int charge = result.at(1).toInt(); 
     31  //QStringList result = LUtils::getCmdOutput("/usr/sbin/apm", QStringList() << "-al"); 
     32  int charge = SYSTEM::batteryCharge(); //result.at(1).toInt(); 
    3233//qDebug() << "1: " << result.at(0).toInt() << " 2: " << result.at(1).toInt(); 
    33   int icon = 0; 
    34   if (charge > 100) { icon = 5; } 
    35   else if (charge > 90) { icon = 4; } 
     34  int icon = -1; 
     35  if (charge > 90) { icon = 4; } 
    3636  else if (charge > 70) { icon = 3; } 
    3737  else if (charge > 50) { icon = 2; } 
    3838  else if (charge > 30) { icon = 1; } 
    39   icon = icon + result.at(0).toInt() * 10; 
     39  else if (charge > 0 ) { icon = 0; } 
     40  if(SYSTEM::batteryIsCharging()){ icon = icon+10; } 
     41  //icon = icon + result.at(0).toInt() * 10; 
    4042  if (icon != iconOld) { 
    4143    switch (icon) { 
    4244      case 0: 
    43         label->setIcon( LXDG::findIcon("battery-caution", ":/images/battery-caution.png") ); 
     45        label->setPixmap( LXDG::findIcon("battery-caution", "").pixmap(label->size()) ); 
    4446        break; 
    4547      case 1: 
    46         label->setIcon( LXDG::findIcon("battery-040", ":/images/battery-040.png") ); 
     48        label->setPixmap( LXDG::findIcon("battery-040", "").pixmap(label->size()) ); 
    4749        break; 
    4850      case 2: 
    49         label->setIcon( LXDG::findIcon("battery-060", ":/images/battery-060.png") ); 
     51        label->setPixmap( LXDG::findIcon("battery-060", "").pixmap(label->size()) ); 
    5052        break; 
    5153      case 3: 
    52         label->setIcon( LXDG::findIcon("battery-080", ":/images/battery-080.png") ); 
     54        label->setPixmap( LXDG::findIcon("battery-080", "").pixmap(label->size()) ); 
    5355        break; 
    5456      case 4: 
    55         label->setIcon( LXDG::findIcon("battery-100", ":/images/battery-100.png") ); 
     57        label->setPixmap( LXDG::findIcon("battery-100", "").pixmap(label->size()) ); 
    5658        break; 
    5759      case 10: 
    58         label->setIcon( LXDG::findIcon("battery-charging-caution", ":/images/battery-caution.png") ); 
     60        label->setPixmap( LXDG::findIcon("battery-charging-caution", "").pixmap(label->size()) ); 
    5961        break; 
    6062      case 11: 
    61         label->setIcon( LXDG::findIcon("battery-charging-040", ":/images/battery-040.png") ); 
     63        label->setPixmap( LXDG::findIcon("battery-charging-040", "").pixmap(label->size()) ); 
    6264        break; 
    6365      case 12: 
    64         label->setIcon( LXDG::findIcon("battery-charging-060", ":/images/battery-060.png") ); 
     66        label->setPixmap( LXDG::findIcon("battery-charging-060", "").pixmap(label->size()) ); 
    6567        break; 
    6668      case 13: 
    67         label->setIcon( LXDG::findIcon("battery-charging-080", ":/images/battery-080.png") ); 
     69        label->setPixmap( LXDG::findIcon("battery-charging-080", "").pixmap(label->size()) ); 
    6870        break; 
    6971      case 14: 
    70         label->setIcon( LXDG::findIcon("battery-charging", ":/images/battery-100.png") ); 
     72        label->setPixmap( LXDG::findIcon("battery-charging", "").pixmap(label->size()) ); 
    7173        break; 
    7274      default: 
    73         label->setIcon( LXDG::findIcon("battery-missing", ":/images/battery-missing.png") ); 
     75        label->setPixmap( LXDG::findIcon("battery-missing", "").pixmap(label->size()) ); 
    7476        break; 
    7577    } 
     
    7779  } 
    7880  //Now update the display 
    79   label->setToolTip(QString("%1 %").arg(charge).append(icon > 9 && icon < 15 ? " and charging" : "")); 
     81  QString tt; 
     82  //Make sure the tooltip can be properly translated as necessary (Ken Moore 5/9/14) 
     83  if(icon > 9 && icon < 15){ tt = QString(tr("%1 % (Charging)")).arg(QString::number(charge)); } 
     84  else{ tt = QString( tr("%1 % (%2 Remaining)") ).arg(QString::number(charge), getRemainingTime() ); } 
     85  label->setToolTip(tt); 
    8086} 
     87 
     88QString LBattery::getRemainingTime(){ 
     89  int secs = SYSTEM::batterySecondsLeft(); 
     90  if(secs < 0){ return "??"; } 
     91  QString rem; //remaining 
     92  if(secs > 3600){ 
     93    int hours = secs/3600; 
     94    rem.append( QString::number(hours)+"h "); 
     95    secs = secs - (hours*3600); 
     96  } 
     97  if(secs > 60){ 
     98    int min = secs/60; 
     99    rem.append( QString::number(min)+"m "); 
     100    secs = secs - (min*60); 
     101  } 
     102  if(secs > 0){ 
     103    rem.append(QString::number(secs)+"s"); 
     104  } 
     105  return rem; 
     106} 
  • lumina/lumina-desktop/panel-plugins/battery/LBattery.h

    r418d23a r5f42f3f  
    1111#include <QWidget> 
    1212#include <QString> 
     13#include <QLabel> 
    1314 
    1415#include <LuminaUtils.h> 
    1516#include <LuminaXDG.h> 
    1617 
    17 #include "../LTBWidget.h" 
     18#include "../../Globals.h" 
     19//#include "../LTBWidget.h" 
    1820#include "../LPPlugin.h" 
    1921 
     
    2628private: 
    2729        QTimer *timer; 
    28         QToolButton *label; 
     30        QLabel *label; 
    2931        int iconOld; 
    3032         
    3133private slots: 
    3234        void updateBattery(); 
     35        QString getRemainingTime(); 
    3336         
    3437}; 
  • lumina/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp

    r0b8acbb r92c8291  
    1212  //Setup the widget 
    1313  label = new LTBWidget(this); 
    14   label->setIcon( LXDG::findIcon("preferences-desktop-display-color", ":/images/preferences-desktop-display-color.png") ); 
     14  label->setIcon( LXDG::findIcon("preferences-desktop-display-color", "") ); 
    1515  label->setToolTip(QString("Workspace 1")); 
    1616  menu = new QMenu(this); 
     
    2222  // becasue the workspace could be switched via Keyboard-shortcuts ... 
    2323 
    24   createMenu(); 
     24  QTimer::singleShot(500, this, SLOT(createMenu()) ); //needs a delay to make sure it works right the first time 
    2525} 
    2626 
    2727LDesktopSwitcher::~LDesktopSwitcher(){ 
    2828} 
    29  
     29/*  MOVED THESE FUNCTIONS TO LIBLUMINA (LuminaX11.h) -- Ken Moore 5/9/14 
    3030void LDesktopSwitcher::setNumberOfDesktops(int number) { 
    3131  Display *display = QX11Info::display(); 
     
    102102  } 
    103103  return number; 
    104 } 
     104} */ 
    105105 
    106106QAction* LDesktopSwitcher::newAction(int what, QString name) { 
     
    111111 
    112112void LDesktopSwitcher::createMenu() { 
    113   qDebug() << "-- vor getCurrentDesktop SWITCH"; 
    114   qDebug() << getCurrentDesktop(); 
     113  int cur = LX11::GetCurrentDesktop(); //current desktop number 
     114  int tot = LX11::GetNumberOfDesktops(); //total number of desktops 
     115  //qDebug() << "-- vor getCurrentDesktop SWITCH"; 
     116  qDebug() << "Virtual Desktops:" << tot << cur; 
    115117  menu->clear(); 
    116   for (int i = 0; i < getNumberOfDesktops(); i++) { 
    117     menu->addAction(newAction(i, QString("Workspace %1").arg(i +1))); 
     118  for (int i = 0; i < tot; i++) { 
     119    QString name = QString(tr("Workspace %1")).arg( QString::number(i+1) ); 
     120    if(i == cur){ name.prepend("*"); name.append("*");} //identify which desktop this is currently 
     121    menu->addAction(newAction(i, name)); 
    118122  } 
    119123} 
    120124 
    121125void LDesktopSwitcher::menuActionTriggered(QAction* act) { 
    122   setCurrentDesktop(act->whatsThis().toInt()); 
    123   label->setToolTip(QString("Workspace %1").arg(act->whatsThis().toInt() +1)); 
     126  LX11::SetCurrentDesktop(act->whatsThis().toInt()); 
     127  label->setToolTip(QString(tr("Workspace %1")).arg(act->whatsThis().toInt() +1)); 
     128  QTimer::singleShot(500, this, SLOT(createMenu()) ); //make sure the menu gets updated 
    124129} 
  • lumina/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.h

    r7ae73d3 r5f42f3f  
    1111#include <QWidget> 
    1212#include <QString> 
    13 #include <QX11Info> 
     13//#include <QX11Info> 
    1414#include <QMenu> 
    1515 
    1616#include <LuminaUtils.h> 
    1717#include <LuminaXDG.h> 
     18#include <LuminaX11.h> 
    1819 
    1920#include "../LTBWidget.h" 
    2021#include "../LPPlugin.h" 
    2122 
    22 #include <X11/Xlib.h> 
    23 #include <X11/Xutil.h> 
    24 #include <X11/Xatom.h> 
     23//#include <X11/Xlib.h> 
     24//#include <X11/Xutil.h> 
     25//#include <X11/Xatom.h> 
    2526 
    2627class LDesktopSwitcher : public LPPlugin{ 
     
    3637        int iconOld; 
    3738 
    38         void setNumberOfDesktops(int); 
    39         void setCurrentDesktop(int); 
    40         int getNumberOfDesktops(); 
    41         int getCurrentDesktop(); 
     39        //void setNumberOfDesktops(int); 
     40        //void setCurrentDesktop(int); 
     41        //int getNumberOfDesktops(); 
     42        //int getCurrentDesktop(); 
    4243 
    43         void createMenu(); 
     44 
    4445        QAction* newAction(int, QString); 
    4546         
    4647private slots: 
     48        void createMenu(); 
    4749        void menuActionTriggered(QAction*); 
    4850}; 
  • src-qt4/pc-softwaremanager/main.cpp

    r7d1cdbb re7fce9d  
    1919    if( getuid() != 0){ 
    2020      qDebug() << "pc-softwaremanager must be started as root!"; 
     21      system("pc-su pc-softwaremanager &"); 
    2122      return 1; 
    2223    } 
  • src-qt4/pc-softwaremanager/pbiNgBackend.cpp

    raae0e0b re7fce9d  
    677677   }else if( PROCTYPE==0 && injail && RUNNINGJAILS.contains(PKGJAIL)){ 
    678678     //For installations, make sure the jail pkg config is synced with the current system pkg config 
     679     qDebug() << "Syncing pkg config in jail:" << PKGJAIL; 
     680     emit devMessage( "** Syncing pkg config in jail: " +PKGJAIL+" **" ); 
    679681     Extras::getCmdOutput("pc-updatemanager -j "+RUNNINGJAILS[PKGJAIL]+" syncconf"); 
    680682   } 
     
    693695  
    694696void PBIBackend::procMessage(QString msg){ 
    695   qDebug() << "MSG:" << msg; 
     697  //qDebug() << "MSG:" << msg; 
    696698  PROCLOG << msg;   //save full message to the log for later 
    697699  QString tmp; 
  • src-sh/port-files/Makefile

    r1d3e9af r5619366  
    1111COMMENT=        PC-BSD Command-Line Utilities 
    1212 
    13 RUN_DEPENDS=    pkg-static:${PORTSDIR}/ports-mgmt/pkg \ 
    14                 svn:${PORTSDIR}/devel/subversion \ 
    15                 mksquashfs:${PORTSDIR}/sysutils/squashfs-tools \ 
    16                 debootstrap:${PORTSDIR}/sysutils/debootstrap \ 
    17                 sipcalc:${PORTSDIR}/net-mgmt/sipcalc \ 
     13RUN_DEPENDS=    sipcalc:${PORTSDIR}/net-mgmt/sipcalc \ 
    1814                eject:${PORTSDIR}/sysutils/eject \ 
    1915                unzip:${PORTSDIR}/archivers/unzip \ 
Note: See TracChangeset for help on using the changeset viewer.