Changeset bdc1dbf


Ignore:
Timestamp:
08/25/14 10:38:16 (4 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.3, releng/10.1
Children:
1b48eab
Parents:
9ba02b00
Message:

Add another option to the LuminaOS definitions: launch/detect audio mixer utility. Also use this option in the systemdashboard panel plugin (if possible).

Location:
lumina
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • lumina/libLumina/LuminaOS-FreeBSD.cpp

    rd423fcd9 rbdc1dbf  
    112112} 
    113113 
     114//Check if a graphical audio mixer is installed 
     115bool LOS::hasMixerUtility(){ 
     116  return QFile::exists("/usr/local/bin/pc-mixer"); 
     117} 
     118 
     119//Launch the graphical audio mixer utility 
     120void LOS::startMixerUtility(){ 
     121  QProcess::startDetached("pc-mixer -notray"); 
     122} 
     123 
    114124//System Shutdown 
    115125void LOS::systemShutdown(){ //start poweroff sequence 
  • lumina/libLumina/LuminaOS-Linux.cpp

    r733da14 rbdc1dbf  
    4444} 
    4545 
     46//Check if a graphical audio mixer is installed 
     47bool LOS::hasMixerUtility(){ 
     48  return false; //not implemented yet for Linux  
     49} 
     50 
     51//Launch the graphical audio mixer utility 
     52void LOS::startMixerUtility(){ 
     53  //not implemented yet for Linux        
     54} 
     55 
    4656//System Shutdown 
    4757void LOS::systemShutdown(){ //start poweroff sequence 
  • lumina/libLumina/LuminaOS.h

    r733da14 rbdc1dbf  
    3737        static void changeAudioVolume(int percentdiff); 
    3838 
     39        //Check if a graphical audio mixer is installed 
     40        static bool hasMixerUtility(); 
     41        //Launch the graphical audio mixer utility 
     42        static void startMixerUtility(); 
     43 
    3944        //System Shutdown 
    4045        static void systemShutdown(); //start poweroff sequence 
  • lumina/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp

    r63b403f rbdc1dbf  
    99 
    1010#include "../../LSession.h" 
     11#include <LuminaX11.h> 
    1112 
    1213LSysMenuQuick::LSysMenuQuick(QWidget *parent) : QWidget(parent), ui(new Ui::LSysMenuQuick){ 
     
    2223  connect(ui->tool_wk_next, SIGNAL(clicked()), this, SLOT(nextWorkspace()) ); 
    2324  connect(ui->tool_logout, SIGNAL(clicked()), this, SLOT(startLogout()) ); 
     25  connect(ui->tool_vol_mixer, SIGNAL(clicked()), this, SLOT(startMixer()) ); 
    2426  //And setup the default icons 
    2527  ui->label_bright_icon->setPixmap( LXDG::findIcon("preferences-system-power-management","").pixmap(ui->label_bright_icon->maximumSize()) ); 
     
    3638  //Audio Volume 
    3739  int val = LOS::audioVolume();  
    38   if(val > 66){ ui->label_vol_icon->setPixmap( LXDG::findIcon("audio-volume-high","").pixmap(ui->label_vol_icon->maximumSize()) ); } 
    39   else if(val > 33){ ui->label_vol_icon->setPixmap( LXDG::findIcon("audio-volume-medium","").pixmap(ui->label_vol_icon->maximumSize()) ); } 
    40   else if(val > 0){ ui->label_vol_icon->setPixmap( LXDG::findIcon("audio-volume-low","").pixmap(ui->label_vol_icon->maximumSize()) ); } 
    41   else{ ui->label_vol_icon->setPixmap( LXDG::findIcon("audio-volume-muted","").pixmap(ui->label_vol_icon->maximumSize()) ); } 
     40  QIcon ico; 
     41  if(val > 66){ ico= LXDG::findIcon("audio-volume-high",""); } 
     42  else if(val > 33){ ico= LXDG::findIcon("audio-volume-medium",""); } 
     43  else if(val > 0){ ico= LXDG::findIcon("audio-volume-low",""); } 
     44  else{ ico= LXDG::findIcon("audio-volume-muted",""); } 
     45  bool hasMixer = LOS::hasMixerUtility(); 
     46  ui->label_vol_icon->setVisible(!hasMixer); 
     47  ui->tool_vol_mixer->setVisible(hasMixer); 
     48  if(!hasMixer){ ui->label_vol_icon->setPixmap( ico.pixmap(ui->label_vol_icon->maximumSize()) ); } 
     49  else{ ui->tool_vol_mixer->setIcon(ico); } 
    4250  QString txt = QString::number(val)+"%"; 
    4351  if(val<100){ txt.prepend(" "); } //make sure no widget resizing 
     
    95103} 
    96104 
     105void LSysMenuQuick::startMixer(){ 
     106  emit CloseMenu(); 
     107  LOS::startMixerUtility(); 
     108} 
     109 
    97110void LSysMenuQuick::brightSliderChanged(){ 
    98111  int val = ui->slider_brightness->value(); 
  • lumina/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h

    r63b403f rbdc1dbf  
    1717#include <LuminaOS.h> 
    1818#include <LuminaXDG.h> 
    19 #include <LuminaX11.h> 
    2019 
    2120namespace Ui{ 
     
    4039        void volSliderChanged(); 
    4140        void brightSliderChanged(); 
     41        void startMixer(); 
    4242        void nextWorkspace(); 
    4343        void prevWorkspace(); 
    4444        void startLogout(); 
     45 
    4546 
    4647signals: 
  • lumina/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.ui

    r63b403f rbdc1dbf  
    88    <y>0</y> 
    99    <width>169</width> 
    10     <height>236</height> 
     10    <height>240</height> 
    1111   </rect> 
    1212  </property> 
     
    4545     </property> 
    4646     <layout class="QHBoxLayout" name="horizontalLayout"> 
     47      <property name="spacing"> 
     48       <number>2</number> 
     49      </property> 
     50      <property name="margin"> 
     51       <number>2</number> 
     52      </property> 
    4753      <item> 
    4854       <widget class="QLabel" name="label_vol_icon"> 
     
    7177      </item> 
    7278      <item> 
     79       <widget class="QToolButton" name="tool_vol_mixer"> 
     80        <property name="minimumSize"> 
     81         <size> 
     82          <width>30</width> 
     83          <height>30</height> 
     84         </size> 
     85        </property> 
     86        <property name="maximumSize"> 
     87         <size> 
     88          <width>32</width> 
     89          <height>32</height> 
     90         </size> 
     91        </property> 
     92        <property name="toolTip"> 
     93         <string>Launch Audio Mixer</string> 
     94        </property> 
     95        <property name="text"> 
     96         <string/> 
     97        </property> 
     98        <property name="iconSize"> 
     99         <size> 
     100          <width>30</width> 
     101          <height>30</height> 
     102         </size> 
     103        </property> 
     104        <property name="autoRaise"> 
     105         <bool>true</bool> 
     106        </property> 
     107       </widget> 
     108      </item> 
     109      <item> 
    73110       <widget class="QSlider" name="slider_volume"> 
    74111        <property name="maximum"> 
     
    102139     </property> 
    103140     <layout class="QHBoxLayout" name="horizontalLayout_2"> 
     141      <property name="spacing"> 
     142       <number>2</number> 
     143      </property> 
     144      <property name="margin"> 
     145       <number>2</number> 
     146      </property> 
    104147      <item> 
    105148       <widget class="QLabel" name="label_bright_icon"> 
     
    159202     </property> 
    160203     <layout class="QHBoxLayout" name="horizontalLayout_3"> 
     204      <property name="spacing"> 
     205       <number>2</number> 
     206      </property> 
     207      <property name="margin"> 
     208       <number>2</number> 
     209      </property> 
    161210      <item> 
    162211       <widget class="QLabel" name="label_bat_icon"> 
     
    209258     </property> 
    210259     <layout class="QHBoxLayout" name="horizontalLayout_4"> 
     260      <property name="spacing"> 
     261       <number>2</number> 
     262      </property> 
     263      <property name="margin"> 
     264       <number>2</number> 
     265      </property> 
    211266      <item> 
    212267       <widget class="QToolButton" name="tool_wk_prev"> 
     
    252307      </property> 
    253308      <property name="topMargin"> 
    254        <number>3</number> 
     309       <number>2</number> 
    255310      </property> 
    256311      <property name="rightMargin"> 
     
    258313      </property> 
    259314      <property name="bottomMargin"> 
    260        <number>3</number> 
     315       <number>2</number> 
    261316      </property> 
    262317      <item> 
Note: See TracChangeset for help on using the changeset viewer.