Changeset 0c784d0


Ignore:
Timestamp:
03/07/14 09:24:09 (5 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2
Children:
92e8b9b
Parents:
86c3cc9
Message:

Finish up the new pc-mixer utility. The main Mixer GUI is done now, and it all works great!

Location:
src-qt4/pc-mixer
Files:
8 added
6 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-mixer/MixerGUI.cpp

    rcaf88c8 r0c784d0  
    1818  //Load the list of available devices 
    1919  QStringList devList = Mixer::getDevices(); 
    20   devList.sort(); 
     20  //devList.sort(); 
    2121  //Clear the UI 
    2222  ui->combo_default->disconnect(); 
    2323  ui->combo_default->clear(); 
    24    
     24  delete ui->scrollArea->widget(); //delete the widget and all children 
     25  ui->scrollArea->setWidget( new QWidget() ); //create a new widget in the scroll area 
     26  ui->scrollArea->widget()->setContentsMargins(0,0,0,0); 
     27  QHBoxLayout *layout = new QHBoxLayout; 
    2528  //Now Fill the UI with the devices 
    2629  QString cdefault = settings->value("tray-device", "vol").toString(); 
     
    3134    int Rval = devList[i].section(":",2,2).toInt(); 
    3235    //Now create the device widget 
    33            
     36    DeviceWidget *device = new DeviceWidget(this); 
     37      device->setupDevice(dev, Lval, Rval); 
     38      layout->addWidget(device); 
     39      connect(device, SIGNAL(deviceChanged(QString)), this, SLOT(itemChanged(QString)) ); 
    3440    //Now add the device to the default List 
    3541    ui->combo_default->addItem(dev); 
     
    3844    } 
    3945  } 
     46  layout->addStretch(); //add spacer to the end 
     47  layout->setContentsMargins(2,2,2,2); 
     48  layout->setSpacing(4); 
     49  ui->scrollArea->widget()->setLayout(layout); 
     50  ui->scrollArea->setMinimumHeight(ui->scrollArea->widget()->minimumSizeHint().height()+ui->scrollArea->horizontalScrollBar()->height()); 
    4051  //re-connect combobox signal 
    4152  connect(ui->combo_default, SIGNAL(currentIndexChanged(QString)), this, SLOT(changeDefaultTrayDevice(QString)) ); 
  • src-qt4/pc-mixer/MixerGUI.h

    rcaf88c8 r0c784d0  
    66#include <QCloseEvent> 
    77#include <QCoreApplication> 
     8#include <QHBoxLayout> 
     9#include <QScrollBar> 
    810 
     11#include "DeviceWidget.h" 
    912#include "MixerBackend.h" 
    1013 
  • src-qt4/pc-mixer/MixerGUI.ui

    rcaf88c8 r0c784d0  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>396</width> 
    10     <height>238</height> 
     9    <width>399</width> 
     10    <height>294</height> 
    1111   </rect> 
    1212  </property> 
     
    4646         <x>0</x> 
    4747         <y>0</y> 
    48          <width>380</width> 
    49          <height>153</height> 
     48         <width>383</width> 
     49         <height>209</height> 
    5050        </rect> 
    5151       </property> 
     
    6060     <x>0</x> 
    6161     <y>0</y> 
    62      <width>396</width> 
     62     <width>399</width> 
    6363     <height>20</height> 
    6464    </rect> 
     
    7676  <widget class="QStatusBar" name="statusbar"/> 
    7777  <action name="actionClose_Mixer_and_Tray"> 
     78   <property name="icon"> 
     79    <iconset resource="pc-mixer.qrc"> 
     80     <normaloff>:/icons/application-exit.png</normaloff>:/icons/application-exit.png</iconset> 
     81   </property> 
    7882   <property name="text"> 
    7983    <string>Close Mixer and Tray</string> 
     
    8185  </action> 
    8286  <action name="actionClose_Mixer"> 
     87   <property name="icon"> 
     88    <iconset resource="pc-mixer.qrc"> 
     89     <normaloff>:/icons/window-close.png</normaloff>:/icons/window-close.png</iconset> 
     90   </property> 
    8391   <property name="text"> 
    8492    <string>Hide Mixer</string> 
     
    8694  </action> 
    8795 </widget> 
    88  <resources/> 
     96 <resources> 
     97  <include location="pc-mixer.qrc"/> 
     98 </resources> 
    8999 <connections/> 
    90100</ui> 
  • src-qt4/pc-mixer/MixerTray.cpp

    rcaf88c8 r0c784d0  
    1717  mixer = new QToolButton(0); 
    1818        mixer->setText(tr("Mixer")); 
     19        mixer->setIcon(QIcon(":icons/configure.png")); 
     20        mixer->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); 
    1921  mixerA = new QWidgetAction(0); 
    2022        mixerA->setDefaultWidget(mixer); 
  • src-qt4/pc-mixer/pc-mixer.pro

    rcaf88c8 r0c784d0  
    77HEADERS += MixerBackend.h \ 
    88                MixerTray.h  \ 
    9                 MixerGUI.h 
     9                MixerGUI.h \ 
     10                DeviceWidget.h 
    1011                 
    1112SOURCES += main.cpp \ 
    1213                MixerTray.cpp  \ 
    13                 MixerGUI.cpp 
     14                MixerGUI.cpp \ 
     15                DeviceWidget.cpp 
    1416 
    1517RESOURCES += pc-mixer.qrc 
    1618 
    17 FORMS   =  MixerGUI.ui 
     19FORMS   =  MixerGUI.ui \ 
     20                DeviceWidget.ui 
    1821 
    1922TARGET=pc-mixer 
  • src-qt4/pc-mixer/pc-mixer.qrc

    rcaf88c8 r0c784d0  
    11<RCC> 
    22  <qresource> 
     3    <file>icons/window-close.png</file> 
     4    <file>icons/application-exit.png</file> 
     5    <file>icons/configure.png</file> 
     6    <file>icons/link_break.png</file> 
     7    <file>icons/link.png</file> 
    38    <file>icons/audio-volume-high.png</file> 
    49    <file>icons/audio-volume-medium.png</file> 
Note: See TracChangeset for help on using the changeset viewer.