diff options
Diffstat (limited to 'kmix')
77 files changed, 1050 insertions, 945 deletions
diff --git a/kmix/CMakeLists.txt b/kmix/CMakeLists.txt index f719a084..c9e03ba9 100644 --- a/kmix/CMakeLists.txt +++ b/kmix/CMakeLists.txt @@ -55,6 +55,13 @@ tde_create_translated_desktop( PO_DIR kmix-desktops ) +##### experimental/unmaintained features ######## + +unset( SOURCES_EXPERIMENTAL ) +if( WITH_KMIX_EXPERIMENTAL ) + set( SOURCES_EXPERIMENTAL experimental.ui viewsurround.cpp ) +endif( WITH_KMIX_EXPERIMENTAL ) + ##### kmix_panelapplet (module) ################# @@ -65,7 +72,7 @@ tde_add_kpart( kmix_panelapplet AUTOMOC mixer_backend.cpp ksmallslider.cpp volume.cpp kledbutton.cpp verticaltext.cpp mixerIface.skel colorwidget.ui dialogviewconfiguration.cpp kmixtoolbox.cpp mixertoolbox.cpp - dialogselectmaster.cpp + dialogselectmaster.cpp kmixsettings.kcfgc LINK tdeui-shared ${ALSA_LIBRARIES} DESTINATION ${PLUGIN_INSTALL_DIR} ) @@ -75,15 +82,16 @@ tde_add_kpart( kmix_panelapplet AUTOMOC tde_add_tdeinit_executable( kmix AUTOMOC SOURCES - main.cpp kmix.cpp kmixdockwidget.cpp kmixprefdlg.cpp + main.cpp kmix.cpp kmixdockwidget.cpp viewbase.cpp viewoutput.cpp viewinput.cpp viewswitches.cpp - viewsurround.cpp viewdockareapopup.cpp viewsliders.cpp - viewgrid.cpp mixdevicewidget.cpp mdwslider.cpp + viewdockareapopup.cpp viewsliders.cpp mixdevicewidget.cpp mdwslider.cpp mdwswitch.cpp mdwenum.cpp kmixerwidget.cpp mixer.cpp mixset.cpp mixdevice.cpp mixer_backend.cpp ksmallslider.cpp volume.cpp kledbutton.cpp verticaltext.cpp mixerIface.skel kmixtoolbox.cpp mixertoolbox.cpp dialogviewconfiguration.cpp - KMixApp.cpp dialogselectmaster.cpp kmixIface.skel + KMixApp.cpp dialogselectmaster.cpp kmixIface.skel kmixsettings.kcfgc + appearanceconfig.ui behaviorconfig.ui + ${SOURCES_EXPERIMENTAL} LINK tdeui-shared ${ALSA_LIBRARIES} ) @@ -94,6 +102,6 @@ tde_add_tdeinit_executable( kmixctrl AUTOMOC SOURCES kmixctrl.cpp mixer.cpp mixset.cpp mixdevice.cpp volume.cpp mixerIface.skel mixertoolbox.cpp - mixer_backend.cpp + mixer_backend.cpp kmixsettings.kcfgc LINK tdecore-shared ${ALSA_LIBRARIES} ) diff --git a/kmix/KMixApp.cpp b/kmix/KMixApp.cpp index 40bf6cfb..407fc1aa 100644 --- a/kmix/KMixApp.cpp +++ b/kmix/KMixApp.cpp @@ -26,7 +26,7 @@ KMixApp::KMixApp() - : KUniqueApplication(), m_kmix( 0 ) + : TDEUniqueApplication(), m_kmix( 0 ) { // We handle autostart via standard autostart-enabled .desktop file instead of the session manager disableSessionManagement(); @@ -49,10 +49,10 @@ KMixApp::newInstance() else { m_kmix = new KMixWindow; - connect(this, TQT_SIGNAL(stopUpdatesOnVisibility()), m_kmix, TQT_SLOT(stopVisibilityUpdates())); + connect(this, TQ_SIGNAL(stopUpdatesOnVisibility()), m_kmix, TQ_SLOT(stopVisibilityUpdates())); if ( isRestored() && TDEMainWindow::canBeRestored(0) ) { - m_kmix->restore(0, FALSE); + m_kmix->restore(0, false); } } diff --git a/kmix/KMixApp.h b/kmix/KMixApp.h index 7630e1f8..a34c3978 100644 --- a/kmix/KMixApp.h +++ b/kmix/KMixApp.h @@ -1,13 +1,13 @@ #ifndef KMixApp_h #define KMixApp_h -#include <kuniqueapplication.h> +#include <tdeuniqueapplication.h> class KMixWindow; -class KMixApp : public KUniqueApplication +class KMixApp : public TDEUniqueApplication { -Q_OBJECT +TQ_OBJECT public: KMixApp(); diff --git a/kmix/appearanceconfig.ui b/kmix/appearanceconfig.ui new file mode 100644 index 00000000..294b00fb --- /dev/null +++ b/kmix/appearanceconfig.ui @@ -0,0 +1,178 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KMixAppearanceConfig</class> +<widget class="TQWidget"> + <property name="name"> + <cstring>KMixAppearanceConfig</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>487</width> + <height>278</height> + </rect> + </property> + <property name="caption"> + <string>Appearance</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>kcfg_Menubar</cstring> + </property> + <property name="text"> + <string>Show &menu bar</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="TQLabel" row="2" column="0"> + <property name="name"> + <cstring>lblValueStyle</cstring> + </property> + <property name="text"> + <string>Volume values:</string> + </property> + </widget> + <widget class="TQCheckBox" row="5" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>kcfg_Labels</cstring> + </property> + <property name="text"> + <string>Show &labels</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="TQCheckBox" row="4" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>kcfg_Tickmarks</cstring> + </property> + <property name="text"> + <string>Show &tickmarks</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="TQComboBox" row="2" column="1"> + <item> + <property name="text"> + <string>None</string> + </property> + </item> + <item> + <property name="text"> + <string>Absolute</string> + </property> + </item> + <item> + <property name="text"> + <string>Relative</string> + </property> + </item> + <property name="name"> + <cstring>kcfg_ValueStyle</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>3</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + <spacer row="6" column="1"> + <property name="name"> + <cstring>spacer5</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>111</height> + </size> + </property> + </spacer> + <widget class="TQLabel" row="1" column="0"> + <property name="name"> + <cstring>lblOrientation</cstring> + </property> + <property name="text"> + <string>Sliders orientation:</string> + </property> + </widget> + <widget class="TQComboBox" row="1" column="1"> + <item> + <property name="text"> + <string>Horizontal</string> + </property> + </item> + <item> + <property name="text"> + <string>Vertical</string> + </property> + </item> + <property name="name"> + <cstring>kcfg_Orientation</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>3</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>lblOrientation_2</cstring> + </property> + <property name="text"> + <string>Icon theme:</string> + </property> + </widget> + <widget class="TQComboBox" row="0" column="1"> + <item> + <property name="text"> + <string>Crystal</string> + </property> + </item> + <item> + <property name="text"> + <string>Classic (Old Crystal)</string> + </property> + </item> + <item> + <property name="text"> + <string>System</string> + </property> + </item> + <property name="name"> + <cstring>kcfg_IconTheme</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>3</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmix/behaviorconfig.ui b/kmix/behaviorconfig.ui new file mode 100644 index 00000000..c448735f --- /dev/null +++ b/kmix/behaviorconfig.ui @@ -0,0 +1,157 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KMixBehaviorConfig</class> +<widget class="TQWidget"> + <property name="name"> + <cstring>KMixBehaviorConfig</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>659</width> + <height>345</height> + </rect> + </property> + <property name="caption"> + <string>Behavior</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>kcfg_starttdeRestore</cstring> + </property> + <property name="text"> + <string>Automatically start mixer when you &login</string> + </property> + <property name="tristate"> + <bool>true</bool> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>kcfg_AllowDocking</cstring> + </property> + <property name="text"> + <string>Enable system &tray icon</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="TQGroupBox"> + <property name="name"> + <cstring>grpSystray</cstring> + </property> + <property name="title"> + <string>System Tray</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <spacer row="1" column="0"> + <property name="name"> + <cstring>spacer1_2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Fixed</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>kcfg_TrayVolumeControl</cstring> + </property> + <property name="text"> + <string>Enable system tray volume &slider</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="TQLayoutWidget" row="1" column="1"> + <property name="name"> + <cstring>layout1</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>kcfg_DockIconMuting</cstring> + </property> + <property name="text"> + <string>&Middle click on system tray icon toggles muting</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>kcfg_Visible</cstring> + </property> + <property name="text"> + <string>Show mixer window when starting KMix</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </vbox> + </widget> + </grid> + </widget> + <spacer> + <property name="name"> + <cstring>spacer3</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>161</height> + </size> + </property> + </spacer> + </vbox> +</widget> +<connections> + <connection> + <sender>kcfg_TrayVolumeControl</sender> + <signal>toggled(bool)</signal> + <receiver>kcfg_DockIconMuting</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>kcfg_TrayVolumeControl</sender> + <signal>toggled(bool)</signal> + <receiver>kcfg_Visible</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>kcfg_AllowDocking</sender> + <signal>toggled(bool)</signal> + <receiver>grpSystray</receiver> + <slot>setEnabled(bool)</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmix/dialogselectmaster.cpp b/kmix/dialogselectmaster.cpp index 9b568f80..1d1f2d61 100644 --- a/kmix/dialogselectmaster.cpp +++ b/kmix/dialogselectmaster.cpp @@ -61,8 +61,8 @@ void DialogSelectMaster::createWidgets(Mixer *ptr_mixer) _layout = new TQVBoxLayout(m_mainFrame,0,-1, "_layout" ); // Default or user selected - TQButtonGroup *bgMasterSelection = new TQButtonGroup(1, Qt::Vertical, i18n("KMix master channel selection"), m_mainFrame); - connect(bgMasterSelection, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(masterSelectionChanged(int))); + TQButtonGroup *bgMasterSelection = new TQButtonGroup(1, TQt::Vertical, i18n("KMix master channel selection"), m_mainFrame); + connect(bgMasterSelection, TQ_SIGNAL(clicked(int)), this, TQ_SLOT(masterSelectionChanged(int))); _layout->add(bgMasterSelection); m_defaultMaster = new TQRadioButton(i18n("Default"), bgMasterSelection); m_userMaster = new TQRadioButton(i18n("Custom"), bgMasterSelection); @@ -79,10 +79,10 @@ void DialogSelectMaster::createWidgets(Mixer *ptr_mixer) TQLabel *qlbl = new TQLabel( i18n("Current Mixer"), hboxMixerName ); qlbl->setFixedHeight(qlbl->sizeHint().height()); - m_cMixer = new KComboBox( FALSE, hboxMixerName, "mixerCombo" ); + m_cMixer = new KComboBox( false, hboxMixerName, "mixerCombo" ); m_cMixer->setFixedHeight(m_cMixer->sizeHint().height()); TQToolTip::add(m_cMixer, i18n("Current mixer")); - connect(m_cMixer, TQT_SIGNAL(activated(int)), this, TQT_SLOT(createPageByID(int))); + connect(m_cMixer, TQ_SIGNAL(activated(int)), this, TQ_SLOT(createPageByID(int))); for ( Mixer *mixer = Mixer::mixers().first(); mixer !=0; mixer = Mixer::mixers().next() ) { m_cMixer->insertItem(mixer->mixerName()); @@ -97,13 +97,13 @@ void DialogSelectMaster::createWidgets(Mixer *ptr_mixer) m_buttonGroupForScrollView = new TQButtonGroup(this); // invisible TQButtonGroup m_buttonGroupForScrollView->hide(); - connect( this, TQT_SIGNAL(okClicked()) , this, TQT_SLOT(apply()) ); + connect( this, TQ_SIGNAL(okClicked()) , this, TQ_SLOT(apply()) ); } void DialogSelectMaster::show(Mixer *curr_mixer) { - kapp->config()->setGroup(0); - bool useDefaultMaster = kapp->config()->readBoolEntry("UseDefaultMaster", true); + tdeApp->config()->setGroup(0); + bool useDefaultMaster = tdeApp->config()->readBoolEntry("UseDefaultMaster", true); if (useDefaultMaster) { m_defaultMaster->setChecked(true); diff --git a/kmix/dialogselectmaster.h b/kmix/dialogselectmaster.h index ea26798a..53f83419 100644 --- a/kmix/dialogselectmaster.h +++ b/kmix/dialogselectmaster.h @@ -15,7 +15,7 @@ class Mixer; class DialogSelectMaster : public KDialogBase { - Q_OBJECT + TQ_OBJECT public: DialogSelectMaster(Mixer *mixer); diff --git a/kmix/dialogviewconfiguration.cpp b/kmix/dialogviewconfiguration.cpp index d6deb523..81a411fe 100644 --- a/kmix/dialogviewconfiguration.cpp +++ b/kmix/dialogviewconfiguration.cpp @@ -59,7 +59,7 @@ DialogViewConfiguration::DialogViewConfiguration( TQWidget*, ViewBase& view) } _layout->activate(); resize(_layout->sizeHint() ); - connect( this, TQT_SIGNAL(okClicked()) , this, TQT_SLOT(apply()) ); + connect( this, TQ_SIGNAL(okClicked()) , this, TQ_SLOT(apply()) ); } DialogViewConfiguration::~DialogViewConfiguration() diff --git a/kmix/dialogviewconfiguration.h b/kmix/dialogviewconfiguration.h index ce228f52..0ad6d319 100644 --- a/kmix/dialogviewconfiguration.h +++ b/kmix/dialogviewconfiguration.h @@ -12,7 +12,7 @@ class TQVBoxLayout; class DialogViewConfiguration : public KDialogBase { - Q_OBJECT + TQ_OBJECT public: DialogViewConfiguration(TQWidget* parent, ViewBase& view); diff --git a/kmix/experimental.ui b/kmix/experimental.ui new file mode 100644 index 00000000..32338bed --- /dev/null +++ b/kmix/experimental.ui @@ -0,0 +1,87 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KMixExperimental</class> +<widget class="TQWidget"> + <property name="name"> + <cstring>KMixExperimental</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>637</width> + <height>310</height> + </rect> + </property> + <property name="caption"> + <string>Experimental features</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel"> + <property name="name"> + <cstring>lblWarning</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>4</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + <property name="text"> + <string><p align="center"><b>WARNING!</b><br> +These are features which are experimental and/or untested.<br> +Please avoid using them in production.</p> +<p align="center">The settings here will be applied after a restart.</p></string> + </property> + </widget> + <widget class="TQGroupBox"> + <property name="name"> + <cstring>grpBox</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Experimental features</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>kcfg_MultiDriver</cstring> + </property> + <property name="text"> + <string>Enable multi-driver mode</string> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>kcfg_Experimental_ViewSurround</cstring> + </property> + <property name="text"> + <string>Enable Surround View (EXPERIMENTAL)</string> + </property> + </widget> + </vbox> + </widget> + </vbox> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmix/kledbutton.cpp b/kmix/kledbutton.cpp index 3ad3ba75..09c8c3c9 100644 --- a/kmix/kledbutton.cpp +++ b/kmix/kledbutton.cpp @@ -44,7 +44,7 @@ KLedButton::~KLedButton() void KLedButton::mousePressEvent( TQMouseEvent *e ) { - if (e->button() == Qt::LeftButton) + if (e->button() == TQt::LeftButton) { toggle(); emit stateChanged( state() ); diff --git a/kmix/kledbutton.h b/kmix/kledbutton.h index 0be42783..a2bafdec 100644 --- a/kmix/kledbutton.h +++ b/kmix/kledbutton.h @@ -31,7 +31,7 @@ */ class KLedButton : public KLed { - Q_OBJECT + TQ_OBJECT public: KLedButton(const TQColor &col=TQt::green, TQWidget *parent=0, const char *name=0); diff --git a/kmix/kmix.cpp b/kmix/kmix.cpp index 1ac09d85..3ce9940d 100644 --- a/kmix/kmix.cpp +++ b/kmix/kmix.cpp @@ -19,11 +19,16 @@ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + // include files for QT #include <tqmap.h> #include <tqhbox.h> #include <tqcheckbox.h> #include <tqradiobutton.h> +#include <tqpushbutton.h> #include <tqwidgetstack.h> #include <tqlayout.h> #include <tqtooltip.h> @@ -44,55 +49,55 @@ #include <khelpmenu.h> #include <kdebug.h> #include <tdeaccel.h> -#include <kglobalaccel.h> +#include <tdeglobalaccel.h> #include <kkeydialog.h> +#include <tdeconfigdialog.h> // application specific includes #include "mixertoolbox.h" #include "kmix.h" #include "kmixerwidget.h" -#include "kmixprefdlg.h" #include "kmixdockwidget.h" #include "kmixtoolbox.h" +#include "kmixsettings.h" +#include "behaviorconfig.h" +#include "appearanceconfig.h" + +#ifdef WITH_KMIX_EXPERIMENTAL +#include "experimental.h" +#endif /** * Constructs a mixer window (KMix main window) */ KMixWindow::KMixWindow() - : DCOPObject("kmix"), TDEMainWindow(0, 0, 0, 0), m_showTicks( true ), - m_dockWidget( 0L ) + : DCOPObject("kmix"), TDEMainWindow(0, 0, 0, 0), m_dockWidget( 0L ) { m_visibilityUpdateAllowed = true; - m_multiDriverMode = false; // -<- I never-ever want the multi-drivermode to be activated by accident - m_surroundView = false; // -<- Also the experimental surround View (3D) - m_gridView = false; // -<- Also the experimental Grid View - // As long as we do not know better, we assume to start hidden. We need - // to initialize this variable here, as we don't trigger a hideEvent(). - m_isVisible = false; m_mixerWidgets.setAutoDelete(true); - loadConfig(); // Need to load config before initMixer(), due to "MultiDriver" keyword - MixerToolBox::initMixer(Mixer::mixers(), m_multiDriverMode, m_hwInfoString); + +#ifdef WITH_KMIX_EXPERIMENTAL + MixerToolBox::initMixer(Mixer::mixers(), KMixSettings::multiDriver(), m_hwInfoString); +#else + MixerToolBox::initMixer(Mixer::mixers(), false, m_hwInfoString); +#endif + + loadConfig(); initActions(); initWidgets(); initMixerWidgets(); - - initPrefDlg(); updateDocking(); - if ( m_startVisible ) + if ( KMixSettings::visible() ) { - /* Started visible: We should do probably do: - * m_isVisible = true; - * But as a showEvent() is triggered by show() we don't need it. - */ - show(); + show(); } else { - hide(); + hide(); } - connect( kapp, TQT_SIGNAL( aboutToQuit()), TQT_SLOT( saveSettings()) ); + connect( tdeApp, TQ_SIGNAL( aboutToQuit()), TQ_SLOT( saveSettings()) ); } @@ -106,41 +111,31 @@ void KMixWindow::initActions() { // file menu - KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT(quit()), actionCollection()); + KStdAction::quit( this, TQ_SLOT(quit()), actionCollection()); // settings menu - KStdAction::showMenubar( TQT_TQOBJECT(this), TQT_SLOT(toggleMenuBar()), actionCollection()); - KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection()); - new TDEAction( i18n( "Configure &Global Shortcuts..." ), "configure_shortcuts", 0, TQT_TQOBJECT(this), - TQT_SLOT( configureGlobalShortcuts() ), actionCollection(), "settings_global" ); - KStdAction::keyBindings( guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); + KStdAction::showMenubar( this, TQ_SLOT(toggleMenuBar()), actionCollection()); + KStdAction::preferences( this, TQ_SLOT(showSettings()), actionCollection()); + new TDEAction( i18n( "Configure &Global Shortcuts..." ), "configure_shortcuts", 0, this, + TQ_SLOT( configureGlobalShortcuts() ), actionCollection(), "settings_global" ); + KStdAction::keyBindings( guiFactory(), TQ_SLOT(configureShortcuts()), actionCollection()); - (void) new TDEAction( i18n( "Hardware &Information" ), 0, TQT_TQOBJECT(this), TQT_SLOT( slotHWInfo() ), actionCollection(), "hwinfo" ); - (void) new TDEAction( i18n( "Hide Mixer Window" ), Key_Escape, TQT_TQOBJECT(this), TQT_SLOT(hide()), actionCollection(), "hide_kmixwindow" ); + (void) new TDEAction( i18n( "Hardware &Information" ), 0, this, TQ_SLOT( slotHWInfo() ), actionCollection(), "hwinfo" ); + (void) new TDEAction( i18n( "Hide Mixer Window" ), Key_Escape, this, TQ_SLOT(hide()), actionCollection(), "hide_kmixwindow" ); m_globalAccel = new TDEGlobalAccel(this, "KMix"); m_globalAccel->insert( "Increase volume", i18n( "Increase Volume of Master Channel"), TQString(), - TDEShortcut(), TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotIncreaseVolume() ) ); + TDEShortcut(), TDEShortcut(), this, TQ_SLOT( slotIncreaseVolume() ) ); m_globalAccel->insert( "Decrease volume", i18n( "Decrease Volume of Master Channel"), TQString(), - TDEShortcut(), TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotDecreaseVolume() ) ); + TDEShortcut(), TDEShortcut(), this, TQ_SLOT( slotDecreaseVolume() ) ); m_globalAccel->insert( "Toggle mute", i18n( "Toggle Mute of Master Channel"), TQString(), - TDEShortcut(), TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotToggleMuted() ) ); + TDEShortcut(), TDEShortcut(), this, TQ_SLOT( slotToggleMuted() ) ); m_globalAccel->readSettings(); m_globalAccel->updateConnections(); createGUI( "kmixui.rc" ); } - -void -KMixWindow::initPrefDlg() -{ - m_prefDlg = new KMixPrefDlg( this ); - connect( m_prefDlg, TQT_SIGNAL(signalApplied(KMixPrefDlg *)), - this, TQT_SLOT(applyPrefs(KMixPrefDlg *)) ); -} - - void KMixWindow::initWidgets() { @@ -160,9 +155,9 @@ KMixWindow::initWidgets() mixerNameLayout->setSpacing(KDialog::spacingHint()); TQLabel *qlbl = new TQLabel( i18n("Current mixer:"), mixerNameLayout ); qlbl->setFixedHeight(qlbl->sizeHint().height()); - m_cMixer = new KComboBox( FALSE, mixerNameLayout, "mixerCombo" ); + m_cMixer = new KComboBox( false, mixerNameLayout, "mixerCombo" ); m_cMixer->setFixedHeight(m_cMixer->sizeHint().height()); - connect( m_cMixer, TQT_SIGNAL( activated( int ) ), TQT_TQOBJECT(this), TQT_SLOT( showSelectedMixer( int ) ) ); + connect( m_cMixer, TQ_SIGNAL( activated( int ) ), this, TQ_SLOT( showSelectedMixer( int ) ) ); TQToolTip::add( m_cMixer, i18n("Current mixer" ) ); // Add first layout to widgets @@ -172,7 +167,7 @@ KMixWindow::initWidgets() widgetsLayout->setStretchFactor( m_wsMixers, 10 ); widgetsLayout->addWidget( m_wsMixers ); - if ( m_showMenubar ) + if ( KMixSettings::menubar() ) menuBar()->show(); else menuBar()->hide(); @@ -191,10 +186,10 @@ KMixWindow::updateDocking() m_dockWidget = 0L; } - if (m_showDockWidget) + if ( KMixSettings::allowDocking() ) { // create dock widget - m_dockWidget = new KMixDockWidget( Mixer::mixers().first(), this, "mainDockWidget", m_volumeWidget, m_dockIconMuting ); + m_dockWidget = new KMixDockWidget( Mixer::mixers().first(), this, "mainDockWidget", KMixSettings::trayVolumeControl(), KMixSettings::dockIconMuting() ); m_dockWidget->show(); } } @@ -209,49 +204,28 @@ KMixWindow::saveSettings() void KMixWindow::saveConfig() { - TDEConfig *config = kapp->config(); - config->setGroup(0); - - // make sure we don't start without any UI - // can happen e.g. when not docked and kmix closed via 'X' button - bool startVisible = m_isVisible; - if ( !m_showDockWidget ) + // make sure we don't start without any UI (in case the tray icon is disabled) + bool startVisible = KMixSettings::visible(); + if ( !KMixSettings::allowDocking() ) + { startVisible = true; + } + + KMixSettings::setSize(size()); + KMixSettings::setPosition(pos()); + KMixSettings::setVisible(startVisible); - config->writeEntry( "Size", size() ); - config->writeEntry( "Position", pos() ); - // Cannot use isVisible() here, as in the "aboutToQuit()" case this widget is already hidden. - // (Please note that the problem was only there when quitting via Systray - esken). - config->writeEntry( "Visible", startVisible ); - config->writeEntry( "Menubar", m_showMenubar ); - config->writeEntry( "AllowDocking", m_showDockWidget ); - config->writeEntry( "TrayVolumeControl", m_volumeWidget ); - config->writeEntry( "Tickmarks", m_showTicks ); - config->writeEntry( "Labels", m_showLabels ); - config->writeEntry( "starttdeRestore", m_onLogin ); - config->writeEntry( "DockIconMuting", m_dockIconMuting ); Mixer* mixerMasterCard = Mixer::masterCard(); - if ( mixerMasterCard != 0 ) { - config->writeEntry( "MasterMixer", mixerMasterCard->id() ); + if ( mixerMasterCard != 0 ) + { + KMixSettings::setMasterMixer(mixerMasterCard->id()); } MixDevice* mdMaster = Mixer::masterCardDevice(); - if ( mdMaster != 0 ) { - config->writeEntry( "MasterMixerDevice", mdMaster->getPK() ); + if ( mdMaster != 0 ) + { + KMixSettings::setMasterMixerDevice(mdMaster->getPK()); } - if ( m_valueStyle == MixDeviceWidget::NABSOLUTE ) - config->writeEntry( "ValueStyle", "Absolute"); - else if ( m_valueStyle == MixDeviceWidget::NRELATIVE ) - config->writeEntry( "ValueStyle", "Relative"); - else - config->writeEntry( "ValueStyle", "None" ); - - if ( m_toplevelOrientation == Qt::Vertical ) - config->writeEntry( "Orientation","Vertical" ); - else - config->writeEntry( "Orientation","Horizontal" ); - config->writeEntry( "Autostart", m_autoStart ); - // save mixer widgets for ( KMixerWidget *mw = m_mixerWidgets.first(); mw != 0; mw = m_mixerWidgets.next() ) { @@ -259,72 +233,37 @@ KMixWindow::saveConfig() { // protect from unplugged devices (better do *not* save them) TQString grp; grp.sprintf( "%i", mw->id() ); - mw->saveConfig( config, grp ); + mw->saveConfig( TDESharedConfig::openConfig("kmixrc"), grp ); } } - config->setGroup(0); + KMixSettings::writeConfig(); } void KMixWindow::loadConfig() { - TDEConfig *config = kapp->config(); - config->setGroup(0); - - m_showDockWidget = config->readBoolEntry("AllowDocking", true); - m_volumeWidget = config->readBoolEntry("TrayVolumeControl", true); - //hide on close has to stay true for usability. KMixPrefDlg option commented out. nolden - m_hideOnClose = config->readBoolEntry("HideOnClose", true); - m_showTicks = config->readBoolEntry("Tickmarks", true); - m_showLabels = config->readBoolEntry("Labels", true); - const TQString& valueStyleString = config->readEntry("ValueStyle", "None"); - m_onLogin = config->readBoolEntry("starttdeRestore", true ); - m_dockIconMuting = config->readBoolEntry( "DockIconMuting", false); - m_startVisible = config->readBoolEntry("Visible", false); - m_multiDriverMode = config->readBoolEntry("MultiDriver", false); - m_surroundView = config->readBoolEntry("Experimental-ViewSurround", false ); - m_gridView = config->readBoolEntry("Experimental-ViewGrid", false ); - const TQString& orientationString = config->readEntry("Orientation", "Horizontal"); - bool useDefaultMaster = config->readBoolEntry( "UseDefaultMaster", true ); - if (!useDefaultMaster) + if (!KMixSettings::useDefaultMaster()) { - TQString mixerMasterCard = config->readEntry( "MasterMixer", "" ); - Mixer::setMasterCard(mixerMasterCard); - TQString masterDev = config->readEntry( "MasterMixerDevice", "" ); - Mixer::setMasterCardDevice(masterDev); + Mixer::setMasterCard(KMixSettings::masterMixer()); + Mixer::setMasterCardDevice(KMixSettings::masterMixerDevice()); } - if ( valueStyleString == "Absolute" ) - m_valueStyle = MixDeviceWidget::NABSOLUTE; - else if ( valueStyleString == "Relative" ) - m_valueStyle = MixDeviceWidget::NRELATIVE; - else - m_valueStyle = MixDeviceWidget::NNONE; - - if ( orientationString == "Vertical" ) - m_toplevelOrientation = Qt::Vertical; - else - m_toplevelOrientation = Qt::Horizontal; - m_autoStart = config->readBoolEntry("Autostart", true); - - // show/hide menu bar - m_showMenubar = config->readBoolEntry("Menubar", true); + m_toplevelOrientation = static_cast<TQt::Orientation>(KMixSettings::orientation()); TDEToggleAction *a = static_cast<TDEToggleAction*>(actionCollection()->action("options_show_menubar")); - if (a) a->setChecked( m_showMenubar ); + if (a) a->setChecked( KMixSettings::menubar() ); // restore window size and position - if ( !kapp->isRestored() ) // done by the session manager otherwise + if ( !tdeApp->isRestored() ) // done by the session manager otherwise { - TQSize defSize( minimumWidth(), height() ); - TQSize size = config->readSizeEntry("Size", &defSize ); - if(!size.isEmpty()) resize(size); - - TQPoint defPos = pos(); - TQPoint pos = config->readPointEntry("Position", &defPos); - move(pos); - } + TQSize size = KMixSettings::size(); + if(!size.isEmpty()) + { + resize(size); + } + move(KMixSettings::position()); + } } @@ -342,19 +281,23 @@ KMixWindow::initMixerWidgets() { //kdDebug(67100) << "Mixer number: " << id << " Name: " << mixer->mixerName() << endl ; ViewBase::ViewFlags vflags = ViewBase::HasMenuBar; - if ( m_showMenubar ) { + if (KMixSettings::menubar()) { vflags |= ViewBase::MenuBarVisible; } - if ( m_surroundView ) { + +#ifdef WITH_KMIX_EXPERIMENTAL + if (KMixSettings::experimental_ViewSurround()) { vflags |= ViewBase::Experimental_SurroundView; } - if ( m_gridView ) { + if (KMixSettings::experimental_ViewGrid()) { vflags |= ViewBase::Experimental_GridView; } - if ( m_toplevelOrientation == Qt::Vertical ) { +#endif + + if ( m_toplevelOrientation == TQt::Vertical ) { vflags |= ViewBase::Vertical; } - else { + else { vflags |= ViewBase::Horizontal; } @@ -369,11 +312,11 @@ KMixWindow::initMixerWidgets() TQString grp; grp.sprintf( "%i", mw->id() ); - mw->loadConfig( kapp->config(), grp ); + mw->loadConfig( TDESharedConfig::openConfig("kmixrc"), grp ); - mw->setTicks( m_showTicks ); - mw->setLabels( m_showLabels ); - mw->setValueStyle ( m_valueStyle ); + mw->setTicks(KMixSettings::tickmarks()); + mw->setLabels(KMixSettings::labels()); + mw->setValueStyle(KMixSettings::valueStyle()); // !! I am still not sure whether this works 100% reliably - chris mw->show(); } @@ -390,7 +333,7 @@ KMixWindow::initMixerWidgets() bool KMixWindow::queryClose ( ) { - if ( m_showDockWidget && !kapp->sessionSaving() ) + if ( KMixSettings::allowDocking() && !tdeApp->sessionSaving() ) { hide(); return false; @@ -402,32 +345,35 @@ KMixWindow::queryClose ( ) void KMixWindow::quit() { - kapp->quit(); + tdeApp->quit(); } void KMixWindow::showSettings() { - if (!m_prefDlg->isVisible()) + if (TDEConfigDialog::showDialog("KMixConfigDialog")) { - m_prefDlg->m_dockingChk->setChecked( m_showDockWidget ); - m_prefDlg->m_volumeChk->setChecked(m_volumeWidget); - m_prefDlg->m_showTicks->setChecked( m_showTicks ); - m_prefDlg->m_showLabels->setChecked( m_showLabels ); - m_prefDlg->m_onLogin->setChecked( m_onLogin ); - m_prefDlg->m_dockIconMuting->setChecked( m_dockIconMuting ); - m_prefDlg->_rbVertical ->setChecked( m_toplevelOrientation == Qt::Vertical ); - m_prefDlg->_rbHorizontal->setChecked( m_toplevelOrientation == Qt::Horizontal ); - m_prefDlg->_rbNone->setChecked( m_valueStyle == MixDeviceWidget::NNONE ); - m_prefDlg->_rbAbsolute->setChecked( m_valueStyle == MixDeviceWidget::NABSOLUTE ); - m_prefDlg->_rbRelative->setChecked( m_valueStyle == MixDeviceWidget::NRELATIVE ); - m_prefDlg->m_autoStartChk->setChecked( m_autoStart ); - - m_prefDlg->show(); + return; } -} + TDEConfigDialog *cfg = new TDEConfigDialog(this, "KMixConfigDialog", KMixSettings::self()); + + KMixBehaviorConfig *cfgb = new KMixBehaviorConfig(0, "Behavior"); + cfg->addPage(cfgb, i18n("Behavior"), "configure"); + + KMixAppearanceConfig *cfga = new KMixAppearanceConfig(0, "Appearance"); + cfg->addPage(cfga, i18n("Appearance"), "kmix"); + +#ifdef WITH_KMIX_EXPERIMENTAL + KMixExperimental *cfgx = new KMixExperimental(0, "Experimental"); + cfg->addPage(cfgx, i18n("Experimental"), "bug"); +#endif + + connect(cfg, TQ_SIGNAL(settingsChanged()), this, TQ_SLOT(applyPrefs())); + + cfg->show(); +} void KMixWindow::showHelp() @@ -480,62 +426,30 @@ KMixWindow::saveVolumes() void -KMixWindow::applyPrefs( KMixPrefDlg *prefDlg ) -{ - m_showDockWidget = prefDlg->m_dockingChk->isChecked(); - m_volumeWidget = prefDlg->m_volumeChk->isChecked(); - m_showTicks = prefDlg->m_showTicks->isChecked(); - m_showLabels = prefDlg->m_showLabels->isChecked(); - m_onLogin = prefDlg->m_onLogin->isChecked(); - m_dockIconMuting = prefDlg->m_dockIconMuting->isChecked(); - - if ( prefDlg->_rbNone->isChecked() ) { - m_valueStyle = MixDeviceWidget::NNONE; - } else if ( prefDlg->_rbAbsolute->isChecked() ) { - m_valueStyle = MixDeviceWidget::NABSOLUTE; - } else if ( prefDlg->_rbRelative->isChecked() ) { - m_valueStyle = MixDeviceWidget::NRELATIVE; - } - - bool toplevelOrientationHasChanged = - ( prefDlg->_rbVertical->isChecked() && m_toplevelOrientation == Qt::Horizontal ) - || ( prefDlg->_rbHorizontal->isChecked() && m_toplevelOrientation == Qt::Vertical ); - if ( toplevelOrientationHasChanged ) { +KMixWindow::applyPrefs() +{ + auto old = static_cast<TQt::Orientation>(KMixSettings::orientation()); + if (m_toplevelOrientation != old) + { TQString msg = i18n("The change of orientation will be adopted on the next start of KMix."); - KMessageBox::information(0,msg); - } - if ( prefDlg->_rbVertical->isChecked() ) { - //kdDebug(67100) << "KMix should change to Vertical layout\n"; - m_toplevelOrientation = Qt::Vertical; + KMessageBox::information(0, msg); } - else if ( prefDlg->_rbHorizontal->isChecked() ) { - //kdDebug(67100) << "KMix should change to Horizontal layout\n"; - m_toplevelOrientation = Qt::Horizontal; - } - m_autoStart = prefDlg->m_autoStartChk->isChecked(); - this->setUpdatesEnabled(false); updateDocking(); for (KMixerWidget *mw=m_mixerWidgets.first(); mw!=0; mw=m_mixerWidgets.next()) { - mw->setTicks( m_showTicks ); - mw->setLabels( m_showLabels ); - mw->setValueStyle ( m_valueStyle ); + mw->setTicks( KMixSettings::tickmarks() ); + mw->setLabels( KMixSettings::labels() ); + mw->setValueStyle( KMixSettings::valueStyle() ); mw->mixer()->readSetFromHWforceUpdate(); // needed, as updateDocking() has reconstructed the DockWidget } this->setUpdatesEnabled(true); - // avoid invisible and unaccessible main window - if( !m_showDockWidget && !isVisible() ) - { - show(); - } - this->repaint(); // make KMix look fast (saveConfig() often uses several seconds) - kapp->processEvents(); + tdeApp->processEvents(); saveConfig(); } @@ -543,14 +457,13 @@ KMixWindow::applyPrefs( KMixPrefDlg *prefDlg ) void KMixWindow::toggleMenuBar() { - m_showMenubar = !m_showMenubar; - if( m_showMenubar ) + if( menuBar()->isShown() ) { - menuBar()->show(); + menuBar()->hide(); } else { - menuBar()->hide(); + menuBar()->show(); } } diff --git a/kmix/kmix.h b/kmix/kmix.h index c41beb65..602102b5 100644 --- a/kmix/kmix.h +++ b/kmix/kmix.h @@ -41,8 +41,6 @@ class TDEAccel; class TDEGlobalAccel; class KComboBox; class KMixerWidget; -class KMixerPrefWidget; -class KMixPrefDlg; class KMixDockWidget; class KMixWindow; class Mixer; @@ -55,7 +53,7 @@ class Mixer; class KMixWindow : public TDEMainWindow, virtual public KMixIface { - Q_OBJECT + TQ_OBJECT public: KMixWindow(); @@ -88,7 +86,6 @@ KMixWindow : public TDEMainWindow, virtual public KMixIface void saveConfig(); void loadConfig(); - void initPrefDlg(); void initActions(); void initWidgets(); void initMixerWidgets(); @@ -107,7 +104,7 @@ KMixWindow : public TDEMainWindow, virtual public KMixIface void toggleMenuBar(); //void loadVolumes(); void saveVolumes(); - virtual void applyPrefs( KMixPrefDlg *prefDlg ); + virtual void applyPrefs(); void stopVisibilityUpdates(); private: @@ -117,30 +114,17 @@ KMixWindow : public TDEMainWindow, virtual public KMixIface TQPopupMenu *m_viewMenu; TQPopupMenu *m_helpMenu; - bool m_autoStart; - bool m_showDockWidget; bool m_volumeWidget; - bool m_hideOnClose; - bool m_showTicks; - bool m_dockIconMuting; - bool m_showLabels; - MixDeviceWidget::ValueStyle m_valueStyle; // No numbers by default bool m_onLogin; - bool m_startVisible; - bool m_showMenubar; bool m_isVisible; bool m_visibilityUpdateAllowed; - bool m_multiDriverMode; // Not officially supported. - bool m_surroundView; // Experimental. Off by defualt - bool m_gridView; // Experimental. Off by default - Qt::Orientation m_toplevelOrientation; + TQt::Orientation m_toplevelOrientation; TQPtrList<KMixerWidget> m_mixerWidgets; TQHBox* mixerNameLayout; KComboBox *m_cMixer; TQWidgetStack *m_wsMixers; - KMixPrefDlg *m_prefDlg; KMixDockWidget *m_dockWidget; TQString m_hwInfoString; TQVBoxLayout *widgetsLayout; diff --git a/kmix/kmix.kcfg b/kmix/kmix.kcfg new file mode 100644 index 00000000..d4ca0956 --- /dev/null +++ b/kmix/kmix.kcfg @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd"> +<kcfg> + <kcfgfile name="kmixrc"/> + <group name="General"> + <entry key="AllowDocking" type="Bool"> + <default>true</default> + <label>Enable system tray icon</label> + <whatsthis>Docks the mixer into the TDE panel</whatsthis> + </entry> + <entry key="TrayVolumeControl" type="Bool"> + <default>true</default> + <label>Enable system tray volume slider</label> + <whatsthis>If enabled, clicking on the system tray icon pops up a volume indicator, otherwise it opens the mixer.</whatsthis> + </entry> + <entry key="Tickmarks" type="Bool"> + <default>true</default> + <label>Show tickmarks</label> + <whatsthis>Enable/disable tickmark scales on the sliders</whatsthis> + </entry> + <entry name="Labels" type="Bool"> + <default>true</default> + <label>Show labels</label> + <whatsthis>Enables/disables description labels above the sliders</whatsthis> + </entry> + <entry key="ValueStyle" type="Enum"> + <choices> + <choice name="None"> + <label>None</label> + </choice> + <choice name="Absolute"> + <label>Absolute</label> + </choice> + <choice name="Relative"> + <label>Relative</label> + </choice> + </choices> + <default>None</default> + <label>Volume Values</label> + <whatsthis>How volume values are displayed</whatsthis> + </entry> + <entry key="starttdeRestore" type="Bool"> + <default>true</default> + <label>Autostart</label> + <whatsthis>Automatically start mixer when you login</whatsthis> + </entry> + <entry key="DockIconMuting" type="Bool"> + <default>false</default> + <label>Middle click on system tray icon toggles muting</label> + </entry> + <entry key="Visible" type="Bool"> + <default>false</default> + <label>Show mixer window when starting KMix</label> + <whatsthis>Check this to make KMix open the mixer window on startup by default. By default this is unchecked, causing only the system tray icon to be shown on startup. Note that if both system tray icon and this option are disabled then this option is assumed to be checked (to avoid starting KMix with no GUI at all).</whatsthis> + </entry> + <entry key="Menubar" type="Bool"> + <default>true</default> + <label>Show menubar</label> + <whatsthis>Show the menu bar in the mixer window.</whatsthis> + </entry> + <entry key="MultiDriver" type="Bool"> + <default>false</default> + <label>Enable multi-driver mode</label> + <whatsthis>Try scanning all backends. By default this is unchecked, which results in the first found backend being used.</whatsthis> + </entry> + <entry key="Experimental_ViewSurround" type="Bool"> + <default>false</default> + <label>Enable Surround View (EXPERIMENTAL)</label> + </entry> + <entry key="Experimental_ViewGrid" type="Bool"> + <default>false</default> + <label>Enable Grid View (EXPERIMENTAL)</label> + </entry> + <entry key="Orientation" type="Enum"> + <choices> + <choice name="Horizontal"> + <label>Horizontal</label> + </choice> + <choice name="Vertical"> + <label>Vertical</label> + </choice> + </choices> + <default>Vertical</default> + <label>Slider Orientation</label> + </entry> + <entry key="UseDefaultMaster" type="Bool"> + <default>true</default> + </entry> + <entry key="MasterMixer" type="String"> + <default></default> + </entry> + <entry key="MasterMixerDevice" type="String"> + <default></default> + </entry> + <entry key="Size" type="Size"> + <default></default> + </entry> + <entry key="Position" type="Point"> + <default></default> + </entry> + </group> + <group name="Appearance"> + <entry key="IconTheme" type="Enum"> + <choices> + <choice name="Crystal"> + <label>Crystal</label> + </choice> + <choice name="OldCrystal"> + <label>Classic (Old Crystal)</label> + </choice> + <choice name="System"> + <label>System theme</label> + </choice> + </choices> + <default>Crystal</default> + <label>Icon Theme</label> + </entry> + </group> +</kcfg>
\ No newline at end of file diff --git a/kmix/kmixapplet.cpp b/kmix/kmixapplet.cpp index 0bcdd3f2..b65458c8 100644 --- a/kmix/kmixapplet.cpp +++ b/kmix/kmixapplet.cpp @@ -44,13 +44,13 @@ #include <tdeconfig.h> #include <kdebug.h> #include <tdeglobal.h> -#include <kglobalaccel.h> +#include <tdeglobalaccel.h> #include <tdeglobalsettings.h> #include <kiconloader.h> #include <kinputdialog.h> #include <tdelocale.h> #include <tdemessagebox.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> // // KMix #include "colorwidget.h" @@ -66,7 +66,7 @@ extern "C" { - KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile) + TDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile) { TDEGlobal::locale()->insertCatalogue("kmix"); return new KMixApplet(configFile, KPanelApplet::Normal, @@ -165,7 +165,7 @@ KMixApplet::KMixApplet( const TQString& configFile, Type t, // init static vars if ( s_instCount == 0) { - Mixer::mixers().setAutoDelete( TRUE ); + Mixer::mixers().setAutoDelete( true ); TQString dummyStringHwinfo; MixerToolBox::initMixer(Mixer::mixers(), false, dummyStringHwinfo); } @@ -208,7 +208,7 @@ KMixApplet::KMixApplet( const TQString& configFile, Type t, m_errorLabel->setGeometry(0, 0, m_errorLabel->sizeHint().width(), m_errorLabel->sizeHint().height() ); TQToolTip::add(m_errorLabel, "Select one of the available mixers"); resize( m_errorLabel->sizeHint() ); - connect( m_errorLabel, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectMixer()) ); + connect( m_errorLabel, TQ_SIGNAL(clicked()), this, TQ_SLOT(selectMixer()) ); } else { // We know which mixer to use: Call positionChange(), which does all the creating @@ -288,7 +288,7 @@ void KMixApplet::loadConfig( TDEConfig *config, const TQString &grp ) if ( m_mixerWidget ) { //config->setGroup( grp ); KMixToolBox::loadConfig(m_mixerWidget->_mdws, config, grp, "PanelApplet" ); - connect(m_mixerWidget, TQT_SIGNAL(selectMixer()), this, TQT_SLOT(selectMixer())); + connect(m_mixerWidget, TQ_SIGNAL(selectMixer()), this, TQ_SLOT(selectMixer())); } } @@ -321,10 +321,10 @@ void KMixApplet::selectMixer() n++; } - bool ok = FALSE; + bool ok = false; TQString res = KInputDialog::getItem( i18n("Mixers"), i18n("Available mixers:"), - lst, 0, FALSE, &ok, this ); + lst, 0, false, &ok, this ); if ( ok ) { Mixer *mixer = Mixer::mixers().at( lst.findIndex( res ) ); @@ -369,7 +369,7 @@ void KMixApplet::positionChange(Position pos) { delete m_mixerWidget; } m_mixerWidget = new ViewApplet( this, _mixer->name(), _mixer, 0, pos ); - connect ( m_mixerWidget, TQT_SIGNAL(appletContentChanged()), this, TQT_SLOT(updateGeometrySlot()) ); + connect ( m_mixerWidget, TQ_SIGNAL(appletContentChanged()), this, TQ_SLOT(updateGeometrySlot()) ); m_mixerWidget->createDeviceWidgets(); _layout->add(m_mixerWidget); _layout->activate(); @@ -383,7 +383,7 @@ void KMixApplet::positionChange(Position pos) { //setFixedSize(panelAppletConstrainedSize.width(), panelAppletConstrainedSize.height() ); //kdDebug(67100) << "KMixApplet::positionChange(). New MDW is at " << panelAppletConstrainedSize << endl; m_mixerWidget->show(); - //connect( _mixer, TQT_SIGNAL(newVolumeLevels()), m_mixerWidget, TQT_SLOT(refreshVolumeLevels()) ); + //connect( _mixer, TQ_SIGNAL(newVolumeLevels()), m_mixerWidget, TQ_SLOT(refreshVolumeLevels()) ); } } @@ -452,7 +452,7 @@ int KMixApplet::heightForWidth(int) const { TQSizePolicy KMixApplet::sizePolicy() const { // return TQSizePolicy(TQSizePolicy::Preferred,TQSizePolicy::Preferred); - if ( orientation() == Qt::Vertical ) { + if ( orientation() == TQt::Vertical ) { //kdDebug(67100) << "KMixApplet::sizePolicy=(Ignored,Fixed)\n"; return TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); } @@ -479,8 +479,8 @@ void KMixApplet::preferences() if ( !m_pref ) { m_pref = new AppletConfigDialog( this ); - connect(m_pref, TQT_SIGNAL(finished()), TQT_SLOT(preferencesDone())); - connect( m_pref, TQT_SIGNAL(applied()), TQT_SLOT(applyPreferences()) ); + connect(m_pref, TQ_SIGNAL(finished()), TQ_SLOT(preferencesDone())); + connect( m_pref, TQ_SIGNAL(applied()), TQ_SLOT(applyPreferences()) ); m_pref->setActiveColors(_colors.high , _colors.low , _colors.back); m_pref->setMutedColors (_colors.mutedHigh, _colors.mutedLow, _colors.mutedBack); diff --git a/kmix/kmixapplet.h b/kmix/kmixapplet.h index fea63cf7..e2f6c207 100644 --- a/kmix/kmixapplet.h +++ b/kmix/kmixapplet.h @@ -42,7 +42,7 @@ class KMixApplet; class AppletConfigDialog : public KDialogBase { - Q_OBJECT + TQ_OBJECT public: AppletConfigDialog( TQWidget * parent=0, const char * name=0 ); @@ -70,7 +70,7 @@ class AppletConfigDialog : public KDialogBase class KMixApplet : public KPanelApplet { - Q_OBJECT + TQ_OBJECT public: diff --git a/kmix/kmixctrl.cpp b/kmix/kmixctrl.cpp index 9f6188c7..40472212 100644 --- a/kmix/kmixctrl.cpp +++ b/kmix/kmixctrl.cpp @@ -24,7 +24,7 @@ #include <tdeaboutdata.h> #include <tdelocale.h> #include <tdeglobal.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> #include <tdeconfig.h> #include <kdebug.h> #include <tqptrlist.h> @@ -46,7 +46,7 @@ static TDECmdLineOptions options[] = // INSERT YOUR COMMANDLINE OPTIONS HERE }; -extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) +extern "C" TDE_EXPORT int kdemain(int argc, char *argv[]) { TDELocale::setMainCatalogue("kmix"); TDEAboutData aboutData( "kmixctrl", I18N_NOOP("KMixCtrl"), diff --git a/kmix/kmixdockwidget.cpp b/kmix/kmixdockwidget.cpp index 7e08f71e..6baf4666 100644 --- a/kmix/kmixdockwidget.cpp +++ b/kmix/kmixdockwidget.cpp @@ -34,6 +34,8 @@ #include <tdelocale.h> #include <tdepopupmenu.h> #include <tdeglobalsettings.h> +#include <tdestandarddirs.h> +#include <tdemainwindow.h> #include <tqapplication.h> #include <tqcursor.h> @@ -46,6 +48,7 @@ #include "mixer.h" #include "mixdevicewidget.h" #include "kmixdockwidget.h" +#include "kmixsettings.h" #include "viewdockareapopup.h" KMixDockWidget::KMixDockWidget( Mixer *mixer, TQWidget *parent, const char *name, bool volumePopup, bool dockIconMuting ) @@ -70,7 +73,10 @@ KMixDockWidget::KMixDockWidget( Mixer *mixer, TQWidget *parent, const char *name } createActions(); createMasterVolWidget(); - connect(this, TQT_SIGNAL(quitSelected()), kapp, TQT_SLOT(quitExtended())); + connect(this, TQ_SIGNAL(quitSelected()), tdeApp, TQ_SLOT(quitExtended())); + + TDEGlobal::dirs()->addResourceDir("icons_crystal", locate("appdata", "pics/crystal/")); + TDEGlobal::dirs()->addResourceDir("icons_oldcrystal", locate("appdata", "pics/oldcrystal/")); } KMixDockWidget::~KMixDockWidget() @@ -88,7 +94,7 @@ void KMixDockWidget::createActions() TDEPopupMenu *popupMenu = contextMenu(); // Put "Mute" selector in context menu - (void)new TDEToggleAction(i18n("M&ute"), 0, TQT_TQOBJECT(this), TQT_SLOT(dockMute()), + (void)new TDEToggleAction(i18n("M&ute"), 0, this, TQ_SLOT(dockMute()), actionCollection(), "dock_mute"); TDEAction *a = actionCollection()->action("dock_mute"); if (a) @@ -99,7 +105,7 @@ void KMixDockWidget::createActions() // Put "Select Master Channel" dialog in context menu if (m_mixer) { - (void)new TDEAction(i18n("Select Master Channel..."), 0, TQT_TQOBJECT(this), TQT_SLOT(selectMaster()), + (void)new TDEAction(i18n("Select Master Channel..."), 0, this, TQ_SLOT(selectMaster()), actionCollection(), "select_master"); a = actionCollection()->action("select_master"); if (a) @@ -114,8 +120,18 @@ void KMixDockWidget::createActions() a->plug(popupMenu); } - // Help and quit popupMenu->insertSeparator(); + + // KMix Options + TDEMainWindow *toplevel = static_cast<TDEMainWindow*>(parent()); + a = toplevel->actionCollection()->action(KStdAction::name(KStdAction::Preferences)); + + if (a) + { + a->plug(popupMenu); + } + + // Help and quit popupMenu->insertItem(SmallIcon("help"), KStdGuiItem::help().text(), (new KHelpMenu(this, TDEGlobal::instance()->aboutData(), false))->menu(), false); popupMenu->insertSeparator(); a = actionCollection()->action(KStdAction::name(KStdAction::Quit)); @@ -167,8 +183,8 @@ void KMixDockWidget::createMasterVolWidget() * Refreshing the Icon * */ - connect(m_mixer, TQT_SIGNAL(newVolumeLevels()), TQT_TQOBJECT(this), TQT_SLOT(setVolumeTip())); - connect(m_mixer, TQT_SIGNAL(newVolumeLevels()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdatePixmap())); + connect(m_mixer, TQ_SIGNAL(newVolumeLevels()), this, TQ_SLOT(setVolumeTip())); + connect(m_mixer, TQ_SIGNAL(newVolumeLevels()), this, TQ_SLOT(slotUpdatePixmap())); } void KMixDockWidget::deleteMasterVolWidget() @@ -180,8 +196,8 @@ void KMixDockWidget::deleteMasterVolWidget() } if (m_mixer) { - disconnect(m_mixer, TQT_SIGNAL(newVolumeLevels()), TQT_TQOBJECT(this), TQT_SLOT(setVolumeTip())); - disconnect(m_mixer, TQT_SIGNAL(newVolumeLevels()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdatePixmap())); + disconnect(m_mixer, TQ_SIGNAL(newVolumeLevels()), this, TQ_SLOT(setVolumeTip())); + disconnect(m_mixer, TQ_SIGNAL(newVolumeLevels()), this, TQ_SLOT(slotUpdatePixmap())); } } @@ -195,7 +211,7 @@ void KMixDockWidget::selectMaster() if (!_dsm) { _dsm = new DialogSelectMaster(m_mixer); - connect(_dsm, TQT_SIGNAL(newMasterSelected(bool, int, const TQString&)), TQT_SLOT( handleNewMaster(bool, int, const TQString&))); + connect(_dsm, TQ_SIGNAL(newMasterSelected(bool, int, const TQString&)), TQ_SLOT( handleNewMaster(bool, int, const TQString&))); } _dsm->show(m_mixer); } @@ -204,8 +220,8 @@ void KMixDockWidget::selectMaster() void KMixDockWidget::handleNewMaster(bool defaultMaster, int soundcard_id, const TQString &channel_id) { //kdDebug(67100) << "KMixDockWidget::handleNewMaster() default master=" << defaultMaster << ", soundcard_id=" << soundcard_id << ", channel_id=" << channel_id << endl; - kapp->config()->setGroup(0); - kapp->config()->writeEntry("UseDefaultMaster", defaultMaster); + tdeApp->config()->setGroup(0); + tdeApp->config()->writeEntry("UseDefaultMaster", defaultMaster); Mixer *mixer; TQString channel = TQString::null; if (defaultMaster) @@ -243,6 +259,20 @@ void KMixDockWidget::handleNewMaster(bool defaultMaster, int soundcard_id, const } +long +KMixDockWidget::getAvgVolume() +{ + MixDevice *md = 0; + if ( _dockAreaPopup != 0 ) { + md = _dockAreaPopup->dockDevice(); + } + + if ( md == 0 || md->maxVolume() == 0 ) + return -1; + + return (md->getVolume().getAvgVolume(Volume::MMAIN)*100 )/( md->maxVolume() ); +} + void KMixDockWidget::setVolumeTip() { @@ -250,6 +280,7 @@ KMixDockWidget::setVolumeTip() if ( _dockAreaPopup != 0 ) { md = _dockAreaPopup->dockDevice(); } + TQString tip = ""; int newToolTipValue = 0; @@ -260,10 +291,7 @@ KMixDockWidget::setVolumeTip() } else { - long val = -1; - if ( md->maxVolume() != 0 ) { - val = (md->getVolume().getAvgVolume(Volume::MMAIN)*100 )/( md->maxVolume() ); - } + long val = getAvgVolume(); newToolTipValue = val + 10000*md->isMuted(); if ( _oldToolTipValue != newToolTipValue ) { tip = i18n( "Volume at %1%" ).arg( val ); @@ -305,7 +333,13 @@ KMixDockWidget::updatePixmap(bool force) } else { - newPixmapType = 'd'; + long avgVol = getAvgVolume(); + if ( avgVol <= 33 ) + newPixmapType = 'L'; + else if ( avgVol <= 67 ) + newPixmapType = 'M'; + else + newPixmapType = 'H'; } if (( newPixmapType != _oldPixmapType ) || (force == true)) { @@ -314,12 +348,23 @@ KMixDockWidget::updatePixmap(bool force) TQPixmap origpixmap; TQPixmap scaledpixmap; TQImage newIcon; + + TQStringList fallback; switch ( newPixmapType ) { - case 'e': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_error", width() ) : loadIcon( "kmixdocked_error"); break; - case 'm': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_mute" , width() ) : loadIcon( "kmixdocked_mute"); break; - case 'd': origpixmap = isShown() ? loadSizedIcon( "kmixdocked" , width() ) : loadIcon( "kmixdocked "); break; + case 'm': fallback << "audio-volume-muted" << "kmixdocked_mute"; break; + case 'L': fallback << "audio-volume-low" << "kmixdocked"; break; + case 'M': fallback << "audio-volume-medium" << "kmixdocked"; break; + case 'H': fallback << "audio-volume-high" << "kmixdocked"; break; } - newIcon = origpixmap; + + TQString icon = getIconPath(fallback); + if (icon.isNull()) + { + icon = getIconPath("audio-volume-error"); + } + + origpixmap = isShown() ? loadSizedIcon(icon, width()) : loadIcon(icon); + newIcon = origpixmap; if (isShown()) { newIcon = newIcon.smoothScale(width(), height()); } @@ -330,6 +375,51 @@ KMixDockWidget::updatePixmap(bool force) } } +TQString KMixDockWidget::getIconPath(TQStringList fallback) +{ + auto iconTheme = KMixSettings::iconTheme(); + + TQCString iconThemeName; + if (iconTheme != KMixSettings::EnumIconTheme::System) + { + switch (iconTheme) + { + case KMixSettings::EnumIconTheme::OldCrystal: + iconThemeName = "oldcrystal"; + break; + + default: + case KMixSettings::EnumIconTheme::Crystal: + iconThemeName = "crystal"; + break; + } + } + + for (TQStringList::iterator it = fallback.begin(); it != fallback.end(); ++it) + { + if (iconTheme == KMixSettings::EnumIconTheme::System) + { + TQString iconPath = tdeApp->iconLoader()->iconPath((*it), TDEIcon::Panel, true); + if (!iconPath.isNull()) + { + return iconPath; + } + } + + else + { + TQCString type = "icons_" + iconThemeName; + + TQString iconPath = TDEGlobal::dirs()->findResource(type, TQString("%1.png").arg(*it)); + if (!iconPath.isNull()) return iconPath; + + iconPath = TDEGlobal::dirs()->findResource(type, TQString("%1.svg").arg(*it)); + if (!iconPath.isNull()) return iconPath; + } + } + return TQString::null; +} + void KMixDockWidget::resizeEvent ( TQResizeEvent * ) { updatePixmap(true); @@ -349,7 +439,7 @@ KMixDockWidget::mousePressEvent(TQMouseEvent *me) // esken: Due to overwhelming request, LeftButton shows the ViewDockAreaPopup, if configured // to do so. Otherwise the main window will be shown. - if ( me->button() == Qt::LeftButton ) + if ( me->button() == TQt::LeftButton ) { if ( ! _volumePopup ) { // Case 1: User wants to show main window => This is the KSystemTray default action @@ -393,7 +483,7 @@ KMixDockWidget::mousePressEvent(TQMouseEvent *me) TQWidget::mousePressEvent(me); // KSystemTray's shouldn't do the default action for this return; } // LeftMouseButton pressed - else if ( me->button() == Qt::MidButton ) { + else if ( me->button() == TQt::MidButton ) { if ( ! _dockIconMuting ) { toggleActive(); } else { @@ -443,7 +533,7 @@ KMixDockWidget::wheelEvent(TQWheelEvent *e) // Mhhh, it doesn't work. TQt does not show it again. setVolumeTip(); // Simulate a mouse move to make TQt show the tooltip again - TQApplication::postEvent( this, new TQMouseEvent( TQEvent::MouseMove, TQCursor::pos(), Qt::NoButton, Qt::NoButton ) ); + TQApplication::postEvent( this, new TQMouseEvent( TQEvent::MouseMove, TQCursor::pos(), TQt::NoButton, TQt::NoButton ) ); } } diff --git a/kmix/kmixdockwidget.h b/kmix/kmixdockwidget.h index 19c60ff3..8f119ace 100644 --- a/kmix/kmixdockwidget.h +++ b/kmix/kmixdockwidget.h @@ -38,7 +38,7 @@ class ViewDockAreaPopup; class Volume; class KMixDockWidget : public KSystemTray { - Q_OBJECT + TQ_OBJECT friend class KMixWindow; @@ -70,6 +70,8 @@ class KMixDockWidget : public KSystemTray { void toggleMinimizeRestore(); void resizeEvent(TQResizeEvent *); void showEvent(TQShowEvent *); + long getAvgVolume(); + TQString getIconPath(TQStringList fallback); private: bool _playBeepOnVolumeChange; diff --git a/kmix/kmixerwidget.cpp b/kmix/kmixerwidget.cpp index 94965122..cc12c7dd 100644 --- a/kmix/kmixerwidget.cpp +++ b/kmix/kmixerwidget.cpp @@ -18,6 +18,7 @@ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "../config.h" // TQt #include <tqlabel.h> @@ -42,9 +43,10 @@ #include "viewinput.h" #include "viewoutput.h" #include "viewswitches.h" -// KMix experimental -#include "viewgrid.h" + +#ifdef WITH_KMIX_EXPERIMENTAL #include "viewsurround.h" +#endif /** @@ -119,21 +121,22 @@ void KMixerWidget::createLayout(ViewBase::ViewFlags vflags) * 2c) Add Views to Tab ********************************************************************/ //KMixGUIProfile* prof = MixerToolbox::selectProfile(_mixer); - - + + possiblyAddView(new ViewOutput ( m_ioTab, "output", i18n("Output"), _mixer, vflags ) ); - possiblyAddView(new ViewInput( m_ioTab, "input", i18n("Input"), _mixer, vflags ) ); + possiblyAddView(new ViewInput ( m_ioTab, "input", i18n("Input"), _mixer, vflags ) ); possiblyAddView(new ViewSwitches( m_ioTab, "switches", i18n("Switches"), _mixer, vflags ) ); + +#ifdef WITH_KMIX_EXPERIMENTAL if ( vflags & ViewBase::Experimental_SurroundView ) possiblyAddView( new ViewSurround( m_ioTab, "surround", i18n("Surround"), _mixer, vflags ) ); - if ( vflags & ViewBase::Experimental_GridView ) - possiblyAddView( new ViewGrid( m_ioTab, "grid", i18n("Grid"), _mixer, vflags ) ); +#endif // *** Lower part: Slider and Mixer Name ************************************************ TQHBoxLayout *balanceAndDetail = new TQHBoxLayout( m_topLayout, 8, "balanceAndDetail"); // Create the left-right-slider - m_balanceSlider = new TQSlider( -100, 100, 25, 0, Qt::Horizontal, this, "RightLeft" ); + m_balanceSlider = new TQSlider( -100, 100, 25, 0, TQt::Horizontal, this, "RightLeft" ); m_balanceSlider->setTickmarks( TQSlider::Below ); m_balanceSlider->setTickInterval( 25 ); m_balanceSlider->setMinimumSize( m_balanceSlider->sizeHint() ); @@ -148,7 +151,7 @@ void KMixerWidget::createLayout(ViewBase::ViewFlags vflags) balanceAndDetail->addWidget( mixerName ); balanceAndDetail->addSpacing( 10 ); - connect( m_balanceSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(balanceChanged(int)) ); + connect( m_balanceSlider, TQ_SIGNAL(valueChanged(int)), this, TQ_SLOT(balanceChanged(int)) ); TQToolTip::add( m_balanceSlider, i18n("Left/Right balancing") ); // --- "MenuBar" toggling from the various View's --- @@ -167,7 +170,7 @@ void KMixerWidget::possiblyAddView(ViewBase* vbase) _views.push_back(vbase); vbase ->createDeviceWidgets(); m_ioTab->addTab( vbase , vbase->caption() ); - connect( vbase, TQT_SIGNAL(toggleMenuBar()), parentWidget(), TQT_SLOT(toggleMenuBar()) ); + connect( vbase, TQ_SIGNAL(toggleMenuBar()), parentWidget(), TQ_SLOT(toggleMenuBar()) ); } } diff --git a/kmix/kmixerwidget.h b/kmix/kmixerwidget.h index e07808b6..073a6a88 100644 --- a/kmix/kmixerwidget.h +++ b/kmix/kmixerwidget.h @@ -58,7 +58,7 @@ class ViewSurround; class KMixerWidget : public TQWidget { - Q_OBJECT + TQ_OBJECT public: diff --git a/kmix/kmixprefdlg.cpp b/kmix/kmixprefdlg.cpp deleted file mode 100644 index 5489eea2..00000000 --- a/kmix/kmixprefdlg.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - * KMix -- KDE's full featured mini mixer - * - * - * Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de> - * Copyright (C) 2001 Preston Brown <pbrown@kde.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include <tqbuttongroup.h> -#include <tqlayout.h> -#include <tqwhatsthis.h> -#include <tqcheckbox.h> -#include <tqlabel.h> -#include <tqradiobutton.h> - -#include <tdelocale.h> -// For "kapp" -#include <tdeapplication.h> - -#include "kmix.h" -#include "kmixprefdlg.h" -#include "kmixerwidget.h" - - -KMixPrefDlg::KMixPrefDlg( TQWidget *parent ) - : KDialogBase( Plain, i18n( "Configure" ), - Ok|Cancel|Apply, Ok, parent ) -{ - // general buttons - m_generalTab = plainPage( /* i18n("&General") */ ); - - TQBoxLayout *layout = new TQVBoxLayout( m_generalTab ); - layout->setSpacing( KDialog::spacingHint() ); - - m_dockingChk = new TQCheckBox( i18n("&Dock into panel"), m_generalTab ); - layout->addWidget( m_dockingChk ); - TQWhatsThis::add(m_dockingChk, i18n("Docks the mixer into the TDE panel")); - - m_volumeChk = new TQCheckBox(i18n("Enable system tray &volume control"), - m_generalTab); - layout->addWidget(m_volumeChk); - - m_showTicks = new TQCheckBox( i18n("Show &tickmarks"), m_generalTab ); - layout->addWidget( m_showTicks ); - TQWhatsThis::add(m_showTicks, - i18n("Enable/disable tickmark scales on the sliders")); - - m_showLabels = new TQCheckBox( i18n("Show &labels"), m_generalTab ); - layout->addWidget( m_showLabels ); - TQWhatsThis::add(m_showLabels, - i18n("Enables/disables description labels above the sliders")); - - - m_onLogin = new TQCheckBox( i18n("Restore volumes on login"), m_generalTab ); - layout->addWidget( m_onLogin ); - - m_dockIconMuting = new TQCheckBox( - i18n("Middle click on system tray icon toggles muting"), m_generalTab ); - layout->addWidget( m_dockIconMuting ); - - TQBoxLayout *numbersLayout = new TQHBoxLayout( layout ); - TQButtonGroup *numbersGroup = new TQButtonGroup( 3, Qt::Horizontal, i18n("Numbers"), m_generalTab ); - numbersGroup->setRadioButtonExclusive(true); - TQLabel* qlbl = new TQLabel( i18n("Volume Values: "), m_generalTab ); - _rbNone = new TQRadioButton( i18n("&None"), m_generalTab ); - _rbAbsolute = new TQRadioButton( i18n("A&bsolute"), m_generalTab ); - _rbRelative = new TQRadioButton( i18n("&Relative"), m_generalTab ); - numbersGroup->insert(_rbNone); - numbersGroup->insert(_rbAbsolute); - numbersGroup->insert(_rbRelative); - numbersGroup->hide(); - - numbersLayout->add(qlbl); - numbersLayout->add(_rbNone); - numbersLayout->add(_rbAbsolute); - numbersLayout->add(_rbRelative); - numbersLayout->addStretch(); - - m_autoStartChk = new TQCheckBox( i18n("&Autostart"), m_generalTab ); - layout->addWidget( m_autoStartChk ); - TQWhatsThis::add(m_autoStartChk, i18n("Automatically start mixer when you login")); - - TQBoxLayout *orientationLayout = new TQHBoxLayout( layout ); - TQButtonGroup* orientationGroup = new TQButtonGroup( 2, Qt::Horizontal, i18n("Orientation"), m_generalTab ); - //orientationLayout->add(orientationGroup); - orientationGroup->setRadioButtonExclusive(true); - TQLabel* qlb = new TQLabel( i18n("Slider Orientation: "), m_generalTab ); - _rbHorizontal = new TQRadioButton(i18n("&Horizontal"), m_generalTab ); - _rbVertical = new TQRadioButton(i18n("&Vertical" ), m_generalTab ); - orientationGroup->insert(_rbHorizontal); - orientationGroup->insert(_rbVertical); - orientationGroup->hide(); - //orientationLayout->add(qlb); - //orientationLayout->add(orientationGroup); - - orientationLayout->add(qlb); - orientationLayout->add(_rbHorizontal); - orientationLayout->add(_rbVertical); - - orientationLayout->addStretch(); - layout->addStretch(); - enableButtonSeparator(true); - - connect( this, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(apply()) ); - connect( this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(apply()) ); -} - -KMixPrefDlg::~KMixPrefDlg() -{ -} - -void KMixPrefDlg::apply() -{ - // disabling buttons => users sees that we are working - enableButtonOK(false); - enableButtonCancel(false); - enableButtonApply(false); - kapp->processEvents(); - emit signalApplied( this ); - // re-enable (in case of "Apply") - enableButtonOK(true); - enableButtonCancel(true); - enableButtonApply(true); -} - -#include "kmixprefdlg.moc" diff --git a/kmix/kmixprefdlg.h b/kmix/kmixprefdlg.h deleted file mode 100644 index 1df314aa..00000000 --- a/kmix/kmixprefdlg.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * KMix -- KDE's full featured mini mixer - * - * - * Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef KPREFDLG_H -#define KPREFDLG_H - -#include <kdialogbase.h> - -class KMixPrefWidget; -class KMixApp; -class TQCheckBox; -class TQRadioButton; - -class -KMixPrefDlg : public KDialogBase -{ - Q_OBJECT - - - friend class KMixWindow; - - public: - KMixPrefDlg( TQWidget *parent ); - ~KMixPrefDlg(); - - signals: - void signalApplied( KMixPrefDlg *prefDlg ); - - private slots: - void apply(); - - private: - TQFrame *m_generalTab; - KMixApp *m_mixApp; - KMixPrefWidget *m_mixPrefTab; - - TQCheckBox *m_autoStartChk; - TQCheckBox *m_dockingChk; - TQCheckBox *m_volumeChk; - TQCheckBox *m_hideOnCloseChk; - TQCheckBox *m_showTicks; - TQCheckBox *m_showLabels; - TQCheckBox *m_onLogin; - TQCheckBox *m_dockIconMuting; - TQRadioButton *_rbVertical; - TQRadioButton *_rbHorizontal; - TQRadioButton *_rbNone; - TQRadioButton *_rbAbsolute; - TQRadioButton *_rbRelative; -}; - -#endif diff --git a/kmix/kmixsettings.kcfgc b/kmix/kmixsettings.kcfgc new file mode 100644 index 00000000..0ef6cff2 --- /dev/null +++ b/kmix/kmixsettings.kcfgc @@ -0,0 +1,6 @@ +File=kmix.kcfg +Singleton=true +ClassName=KMixSettings +Mutators=true +Visibility=TDE_EXPORT +SetUserTexts=true
\ No newline at end of file diff --git a/kmix/kmixtoolbox.cpp b/kmix/kmixtoolbox.cpp index 7e0d57c4..9376a69d 100644 --- a/kmix/kmixtoolbox.cpp +++ b/kmix/kmixtoolbox.cpp @@ -25,7 +25,7 @@ #include "tqstring.h" //#include <kdebug.h> -#include <kglobalaccel.h> +#include <tdeglobalaccel.h> #include <tdelocale.h> #include "mdwslider.h" diff --git a/kmix/ksmallslider.cpp b/kmix/ksmallslider.cpp index 5a67a8b6..533b4646 100644 --- a/kmix/ksmallslider.cpp +++ b/kmix/ksmallslider.cpp @@ -37,19 +37,19 @@ static const TQColor backColor2 = "#000000"; */ KSmallSlider::KSmallSlider( TQWidget *parent, const char *name ) - : TQWidget( parent, name ), _orientation( Qt::Vertical ) + : TQWidget( parent, name ), _orientation( TQt::Vertical ) { init(); } -KSmallSlider::KSmallSlider( Qt::Orientation orientation, TQWidget *parent, const char *name ) +KSmallSlider::KSmallSlider( TQt::Orientation orientation, TQWidget *parent, const char *name ) : TQWidget( parent, name ), _orientation( orientation ) { init(); } KSmallSlider::KSmallSlider( int minValue, int maxValue, int pageStep, - int value, Qt::Orientation orientation, + int value, TQt::Orientation orientation, TQWidget *parent, const char *name ) : TQWidget( parent, name ), TQRangeControl( minValue, maxValue, 1, pageStep, value ), _orientation( orientation) @@ -65,10 +65,10 @@ void KSmallSlider::init() // no signals or to do no initial paint. // sliderPos = -1; // state = Idle; - //track = TRUE; + //track = true; //setMouseTracking(true); grayed = false; - setFocusPolicy( TQ_TabFocus ); + setFocusPolicy( TQWidget::TabFocus ); colHigh = TQColor(0,255,0); colLow = TQColor(255,0,0); @@ -91,7 +91,7 @@ int KSmallSlider::positionFromValue( int v ) const int KSmallSlider::valueFromPosition( int p ) const { - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { // Coordiante System starts at TopLeft, but the slider values increase from Bottom to Top // Thus "revert" the position int avail = available(); @@ -140,7 +140,7 @@ void KSmallSlider::resizeEvent( TQResizeEvent * ) int KSmallSlider::available() const { int available = 0; - if ( _orientation == Qt::Vertical) { + if ( _orientation == TQt::Vertical) { available = height(); } else { @@ -225,13 +225,13 @@ void KSmallSlider::paintEvent( TQPaintEvent * ) int sliderPos = positionFromValue( TQRangeControl::value() ); // ------------------------ draw 3d border --------------------------------------------- - style().tqdrawPrimitive ( TQStyle::PE_Panel, &p, TQRect( 0, 0, width(), height() ), colorGroup(), TRUE ); + style().drawPrimitive ( TQStyle::PE_Panel, &p, TQRect( 0, 0, width(), height() ), colorGroup(), true ); // ------------------------ draw lower/left part ---------------------------------------- if ( width()>2 && height()>2 ) { - if ( _orientation == Qt::Horizontal ) { + if ( _orientation == TQt::Horizontal ) { TQRect outer = TQRect( 1, 1, sliderPos, height() - 2 ); // kdDebug(67100) << "KSmallSlider::paintEvent: outer = " << outer << endl; @@ -264,7 +264,7 @@ void KSmallSlider::paintEvent( TQPaintEvent * ) // -------- draw upper/right part -------------------------------------------------- TQRect inner; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { inner = TQRect( 1, 1, width() - 2, height() - 2 -sliderPos ); } else { @@ -286,7 +286,7 @@ void KSmallSlider::mousePressEvent( TQMouseEvent *e ) { //resetState(); - if ( e->button() == Qt::RightButton ) { + if ( e->button() == TQt::RightButton ) { return; } @@ -387,7 +387,7 @@ void KSmallSlider::subtractStep() int KSmallSlider::goodPart( const TQPoint &p ) const { - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { return p.y() - 1; } else { @@ -402,7 +402,7 @@ TQSize KSmallSlider::sizeHint() const const int length = 25; const int thick = 10; - if ( _orientation == Qt::Vertical ) + if ( _orientation == TQt::Vertical ) return TQSize( thick, length ); else return TQSize( length, thick ); @@ -419,7 +419,7 @@ TQSize KSmallSlider::minimumSizeHint() const TQSizePolicy KSmallSlider::sizePolicy() const { - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { //kdDebug(67100) << "KSmallSlider::sizePolicy() vertical value=(Fixed,MinimumExpanding)\n"; return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding ); } diff --git a/kmix/ksmallslider.h b/kmix/ksmallslider.h index 16b11b70..2729cf15 100644 --- a/kmix/ksmallslider.h +++ b/kmix/ksmallslider.h @@ -1,4 +1,3 @@ -//-*-C++-*- /* * KMix -- KDE's full featured mini mixer * @@ -31,14 +30,14 @@ class KSmallSlider : public TQWidget, public TQRangeControl { - Q_OBJECT + TQ_OBJECT public: KSmallSlider( TQWidget *parent, const char *name=0 ); - KSmallSlider( Qt::Orientation, TQWidget *parent, const char *name=0 ); + KSmallSlider( TQt::Orientation, TQWidget *parent, const char *name=0 ); KSmallSlider( int minValue, int maxValue, int pageStep, int value, - Qt::Orientation, TQWidget *parent, const char *name=0 ); + TQt::Orientation, TQWidget *parent, const char *name=0 ); //virtual void setTracking( bool enable ); //bool tracking() const; @@ -105,7 +104,7 @@ public slots: //State state; //bool track; bool grayed; - Qt::Orientation _orientation; + TQt::Orientation _orientation; TQColor colHigh, colLow, colBack; TQColor grayHigh, grayLow, grayBack; diff --git a/kmix/main.cpp b/kmix/main.cpp index 16074aee..9a8ba9f4 100644 --- a/kmix/main.cpp +++ b/kmix/main.cpp @@ -23,7 +23,7 @@ #include <tdeaboutdata.h> #include <tdelocale.h> #include <tdeglobal.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> #include "KMixApp.h" #include "version.h" @@ -37,14 +37,14 @@ static TDECmdLineOptions options[] = // INSERT YOUR COMMANDLINE OPTIONS HERE }; -extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) +extern "C" TDE_EXPORT int kdemain(int argc, char *argv[]) { TDEAboutData aboutData( "kmix", I18N_NOOP("KMix"), APP_VERSION, description, TDEAboutData::License_GPL, - I18N_NOOP("(c) 1996-2000 Christian Esken\n(c) 2000-2003 Christian Esken, Stefan Schimanski\n(c) 2002-2005 Christian Esken, Helio Chissini de Castro")); + I18N_NOOP("(c) 1996-2000 Christian Esken\n(c) 2000-2003 Christian Esken, Stefan Schimanski\n(c) 2002-2005 Christian Esken, Helio Chissini de Castro\n(c) 2010-2022 The Trinity Desktop project")); - aboutData.addAuthor("Christian Esken", "Current maintainer", "esken@kde.org"); - aboutData.addAuthor("Helio Chissini de Castro", I18N_NOOP("Current redesign and co-maintainer, Alsa 0.9x port"), "helio@kde.org" ); + aboutData.addAuthor("Christian Esken", "Previous maintainer", "esken@kde.org"); + aboutData.addAuthor("Helio Chissini de Castro", I18N_NOOP("Redesign and previous co-maintainer, Alsa 0.9x port"), "helio@kde.org" ); aboutData.addAuthor("Stefan Schimanski", 0, "schimmi@kde.org"); aboutData.addAuthor("Sven Leiber", 0, "s.leiber@web.de"); aboutData.addAuthor("Brian Hanson", I18N_NOOP("Solaris port"), "bhanson@hotmail.com"); diff --git a/kmix/mdwenum.cpp b/kmix/mdwenum.cpp index 708000f2..8449818c 100644 --- a/kmix/mdwenum.cpp +++ b/kmix/mdwenum.cpp @@ -31,7 +31,7 @@ #include <tdeaction.h> #include <tdepopupmenu.h> -#include <kglobalaccel.h> +#include <tdeglobalaccel.h> #include <kkeydialog.h> #include <kdebug.h> @@ -45,7 +45,7 @@ * The orientation (horizontal, vertical) is ignored */ MDWEnum::MDWEnum(Mixer *mixer, MixDevice* md, - Qt::Orientation orientation, + TQt::Orientation orientation, TQWidget* parent, ViewBase* mw, const char* name) : MixDeviceWidget(mixer,md,false,orientation,parent,mw,name), _label(0), _enumCombo(0), _layout(0) @@ -53,15 +53,15 @@ MDWEnum::MDWEnum(Mixer *mixer, MixDevice* md, // create actions (on _mdwActions, see MixDeviceWidget) // KStdAction::showMenubar() is in MixDeviceWidget now - new TDEToggleAction( i18n("&Hide"), 0, TQT_TQOBJECT(this), TQT_SLOT(setDisabled()), _mdwActions, "hide" ); - new TDEAction( i18n("C&onfigure Shortcuts..."), 0, TQT_TQOBJECT(this), TQT_SLOT(defineKeys()), _mdwActions, "keys" ); + new TDEToggleAction( i18n("&Hide"), 0, this, TQ_SLOT(setDisabled()), _mdwActions, "hide" ); + new TDEAction( i18n("C&onfigure Shortcuts..."), 0, this, TQ_SLOT(defineKeys()), _mdwActions, "keys" ); // create widgets createWidgets(); /* !!! remove this for production version */ m_keys->insert( "Next Value", i18n( "Next Value" ), TQString(), - TDEShortcut(), TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT( nextEnumId() ) ); + TDEShortcut(), TDEShortcut(), this, TQ_SLOT( nextEnumId() ) ); installEventFilter( this ); // filter for popup } @@ -73,7 +73,7 @@ MDWEnum::~MDWEnum() void MDWEnum::createWidgets() { - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { _layout = new TQVBoxLayout( this ); _layout->setAlignment(TQt::AlignHCenter); } @@ -90,7 +90,7 @@ void MDWEnum::createWidgets() _label = new TQLabel( m_mixdevice->name(), this); _layout->addWidget(_label); _label->setFixedHeight(_label->sizeHint().height()); - _enumCombo = new KComboBox( FALSE, this, "mixerCombo" ); + _enumCombo = new KComboBox( false, this, "mixerCombo" ); // ------------ fill ComboBox start ------------ int maxEnumId= m_mixdevice->enumValues().count(); for (int i=0; i<maxEnumId; i++ ) { @@ -99,7 +99,7 @@ void MDWEnum::createWidgets() // ------------ fill ComboBox end -------------- _layout->addWidget(_enumCombo); _enumCombo->setFixedHeight(_enumCombo->sizeHint().height()); - connect( _enumCombo, TQT_SIGNAL( activated( int ) ), TQT_TQOBJECT(this), TQT_SLOT( setEnumId( int ) ) ); + connect( _enumCombo, TQ_SIGNAL( activated( int ) ), this, TQ_SLOT( setEnumId( int ) ) ); TQToolTip::add( _enumCombo, m_mixdevice->name() ); //_layout->addSpacing( 4 ); @@ -194,8 +194,8 @@ void MDWEnum::setDisabled( bool value ) { bool MDWEnum::eventFilter( TQObject* obj, TQEvent* e ) { if (e->type() == TQEvent::MouseButtonPress) { - TQMouseEvent *qme = TQT_TQMOUSEEVENT(e); - if (qme->button() == Qt::RightButton) { + TQMouseEvent *qme = static_cast<TQMouseEvent*>(e); + if (qme->button() == TQt::RightButton) { showContextMenu(); return true; } diff --git a/kmix/mdwenum.h b/kmix/mdwenum.h index 30e3b1a4..8a1c972b 100644 --- a/kmix/mdwenum.h +++ b/kmix/mdwenum.h @@ -1,4 +1,3 @@ -//-*-C++-*- /* * KMix -- KDE's full featured mini mixer * @@ -41,12 +40,12 @@ class ViewBase; class MDWEnum : public MixDeviceWidget { - Q_OBJECT + TQ_OBJECT public: MDWEnum( Mixer *mixer, MixDevice* md, - Qt::Orientation orientation, + TQt::Orientation orientation, TQWidget* parent = 0, ViewBase* mw = 0, const char* name = 0); ~MDWEnum(); diff --git a/kmix/mdwslider.cpp b/kmix/mdwslider.cpp index 6b4c3f51..acdcb2b6 100644 --- a/kmix/mdwslider.cpp +++ b/kmix/mdwslider.cpp @@ -25,7 +25,7 @@ #include <tdeconfig.h> #include <tdeaction.h> #include <tdepopupmenu.h> -#include <kglobalaccel.h> +#include <tdeglobalaccel.h> #include <kkeydialog.h> #include <kdebug.h> @@ -57,36 +57,36 @@ */ MDWSlider::MDWSlider(Mixer *mixer, MixDevice* md, bool showMuteLED, bool showRecordLED, - bool small, Qt::Orientation orientation, + bool small, TQt::Orientation orientation, TQWidget* parent, ViewBase* mw, const char* name) : MixDeviceWidget(mixer,md,small,orientation,parent,mw,name), m_linked(true), m_valueStyle( NNONE), m_iconLabel( 0 ), m_muteLED( 0 ), m_recordLED( 0 ), m_label( 0 ), _layout(0) { // create actions (on _mdwActions, see MixDeviceWidget) - new TDEToggleAction( i18n("&Split Channels"), 0, TQT_TQOBJECT(this), TQT_SLOT(toggleStereoLinked()), + new TDEToggleAction( i18n("&Split Channels"), 0, this, TQ_SLOT(toggleStereoLinked()), _mdwActions, "stereo" ); - new TDEToggleAction( i18n("&Hide"), 0, TQT_TQOBJECT(this), TQT_SLOT(setDisabled()), _mdwActions, "hide" ); + new TDEToggleAction( i18n("&Hide"), 0, this, TQ_SLOT(setDisabled()), _mdwActions, "hide" ); TDEToggleAction *a = new TDEToggleAction(i18n("&Muted"), 0, 0, 0, _mdwActions, "mute" ); - connect( a, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggleMuted()) ); + connect( a, TQ_SIGNAL(toggled(bool)), TQ_SLOT(toggleMuted()) ); if( m_mixdevice->isRecordable() ) { a = new TDEToggleAction( i18n("Set &Record Source"), 0, 0, 0, _mdwActions, "recsrc" ); - connect( a, TQT_SIGNAL(toggled(bool)), TQT_SLOT( toggleRecsrc()) ); + connect( a, TQ_SIGNAL(toggled(bool)), TQ_SLOT( toggleRecsrc()) ); } - new TDEAction( i18n("C&onfigure Global Shortcuts..."), 0, TQT_TQOBJECT(this), TQT_SLOT(defineKeys()), _mdwActions, "keys" ); + new TDEAction( i18n("C&onfigure Global Shortcuts..."), 0, this, TQ_SLOT(defineKeys()), _mdwActions, "keys" ); // create widgets createWidgets( showMuteLED, showRecordLED ); m_keys->insert( "Increase volume", i18n( "Increase Volume of '%1'" ).arg(m_mixdevice->name().utf8().data()), TQString(), - TDEShortcut(), TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT( increaseVolume() ) ); + TDEShortcut(), TDEShortcut(), this, TQ_SLOT( increaseVolume() ) ); m_keys->insert( "Decrease volume", i18n( "Decrease Volume of '%1'" ).arg(m_mixdevice->name().utf8().data()), TQString(), - TDEShortcut(), TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT( decreaseVolume() ) ); + TDEShortcut(), TDEShortcut(), this, TQ_SLOT( decreaseVolume() ) ); m_keys->insert( "Toggle mute", i18n( "Toggle Mute of '%1'" ).arg(m_mixdevice->name().utf8().data()), TQString(), - TDEShortcut(), TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT( toggleMuted() ) ); + TDEShortcut(), TDEShortcut(), this, TQ_SLOT( toggleMuted() ) ); installEventFilter( this ); // filter for popup @@ -96,7 +96,7 @@ MDWSlider::MDWSlider(Mixer *mixer, MixDevice* md, TQSizePolicy MDWSlider::sizePolicy() const { - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding ); } else { @@ -113,18 +113,17 @@ TQSizePolicy MDWSlider::sizePolicy() const */ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) { - if ( _orientation == Qt::Vertical ) { - _layout = new TQVBoxLayout( this ); - _layout->setAlignment(TQt::AlignCenter); + if ( _orientation == TQt::Vertical ) { + _layout = new TQVBoxLayout( this ); } else { - _layout = new TQHBoxLayout( this ); - _layout->setAlignment(TQt::AlignCenter); + _layout = new TQHBoxLayout( this ); } + _layout->setAlignment(TQt::AlignCenter); // -- MAIN SLIDERS LAYOUT --- TQBoxLayout *slidersLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { slidersLayout = new TQHBoxLayout( _layout ); slidersLayout->setAlignment(TQt::AlignVCenter); } @@ -136,14 +135,14 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) /* cesken: This is inconsistent. Why should vertical and horizontal layout differ? * Also it eats too much space - especially when you don't show sliders at all. * Even more on the vertical panel applet (see Bug #97667) - if ( _orientation == Qt::Horizontal ) + if ( _orientation == TQt::Horizontal ) slidersLayout->addSpacing( 10 ); */ // -- LABEL LAYOUT TO POSITION TQBoxLayout *labelLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { labelLayout = new TQVBoxLayout( slidersLayout ); labelLayout->setAlignment(TQt::AlignHCenter); } @@ -151,7 +150,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) labelLayout = new TQHBoxLayout( slidersLayout ); labelLayout->setAlignment(TQt::AlignVCenter); } - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { m_label = new VerticalText( this, m_mixdevice->name().utf8().data() ); TQToolTip::add( m_label, m_mixdevice->name() ); @@ -166,7 +165,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) /* This addSpacing() looks VERY bizarre => removing it (cesken, 21.2.2006). Also horizontal and vertical spacing differs. This doesn't look sensible. - if ( _orientation == Qt::Horizontal ) + if ( _orientation == TQt::Horizontal ) labelLayout->addSpacing( 36 ); */ labelLayout->addWidget( m_label ); @@ -174,14 +173,14 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) /* This addSpacing() looks VERY bizarre => removing it (cesken, 21.2.2006) Also horizontal and vertical spacing differs. This doesn't look sensible. - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { labelLayout->addSpacing( 18 ); } */ // -- SLIDERS, LEDS AND ICON TQBoxLayout *sliLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { sliLayout = new TQVBoxLayout( slidersLayout ); sliLayout->setAlignment(TQt::AlignHCenter); } @@ -192,7 +191,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) // --- ICON ---------------------------- TQBoxLayout *iconLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { iconLayout = new TQHBoxLayout( sliLayout ); iconLayout->setAlignment(TQt::AlignVCenter); } @@ -214,7 +213,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) // --- MUTE LED if ( showMuteLED ) { TQBoxLayout *ledlayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { ledlayout = new TQHBoxLayout( sliLayout ); ledlayout->setAlignment(TQt::AlignVCenter); } @@ -233,7 +232,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) m_muteLED->resize( TQSize(16, 16) ); ledlayout->addWidget( m_muteLED ); TQToolTip::add( m_muteLED, i18n( "Mute" ) ); - connect( m_muteLED, TQT_SIGNAL(stateChanged(bool)), this, TQT_SLOT(toggleMuted()) ); + connect( m_muteLED, TQ_SIGNAL(stateChanged(bool)), this, TQ_SLOT(toggleMuted()) ); m_muteLED->installEventFilter( this ); ledlayout->addStretch(); } // has Mute LED @@ -251,7 +250,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) // --- SLIDERS --------------------------- TQBoxLayout *volLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { volLayout = new TQHBoxLayout( sliLayout ); volLayout->setAlignment(TQt::AlignVCenter); } @@ -271,7 +270,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) int maxvol = m_mixdevice->getVolume().maxVolume(); int minvol = m_mixdevice->getVolume().minVolume(); - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { slinumLayout = new TQVBoxLayout( volLayout ); slinumLayout->setAlignment(TQt::AlignHCenter); } @@ -317,7 +316,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) slinumLayout->addWidget( slider ); // add to layout m_sliders.append ( slider ); // add to list _slidersChids.append(chid); // Remember slider-chid association - connect( slider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(volumeChange(int)) ); + connect( slider, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(volumeChange(int)) ); } // for all channels of this device @@ -328,7 +327,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) // --- LED LAYOUT TO CENTER --- TQBoxLayout *reclayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { reclayout = new TQHBoxLayout( sliLayout ); reclayout->setAlignment(TQt::AlignVCenter); } @@ -344,7 +343,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) KLed::Sunken, KLed::Circular, this, "RecordLED" ); m_recordLED->setFixedSize( TQSize(16, 16) ); reclayout->addWidget( m_recordLED ); - connect(m_recordLED, TQT_SIGNAL(stateChanged(bool)), this, TQT_SLOT(setRecsrc(bool))); + connect(m_recordLED, TQ_SIGNAL(stateChanged(bool)), this, TQ_SLOT(setRecsrc(bool))); m_recordLED->installEventFilter( this ); TQToolTip::add( m_recordLED, i18n( "Record" ) ); reclayout->addStretch(); @@ -471,7 +470,7 @@ MDWSlider::setStereoLinked(bool value) ***********************************************************/ int firstSliderValue = 0; bool firstSliderValueValid = false; - if (slider->isA(TQSLIDER_OBJECT_NAME_STRING) ) { + if (slider->isA("TQSlider") ) { TQSlider *sld = static_cast<TQSlider*>(slider); firstSliderValue = sld->value(); firstSliderValueValid = true; @@ -494,7 +493,7 @@ MDWSlider::setStereoLinked(bool value) if ( firstSliderValueValid ) { // Remark: firstSlider== 0 could happen, if the static_cast<TQRangeControl*> above fails. // It's a safety measure, if we got other Slider types in the future. - if (slider->isA(TQSLIDER_OBJECT_NAME_STRING) ) { + if (slider->isA("TQSlider") ) { TQSlider *sld = static_cast<TQSlider*>(slider); sld->setValue( firstSliderValue ); } @@ -539,7 +538,7 @@ MDWSlider::setTicks( bool ticks ) slider = m_sliders.first(); - if ( slider->inherits( TQSLIDER_OBJECT_NAME_STRING ) ) + if ( slider->inherits( "TQSlider" ) ) { if( ticks ) if( isStereoLinked() ) @@ -651,7 +650,7 @@ void MDWSlider::volumeChange( int ) else { TQSlider *slider = dynamic_cast<TQSlider *>(m_sliders.first()); if (slider) { - if ( _orientation == Qt::Vertical ) + if ( _orientation == TQt::Vertical ) sliderValue= slider->maxValue() - slider->value(); else sliderValue= slider->value(); @@ -691,7 +690,7 @@ void MDWSlider::volumeChange( int ) { TQSlider *bigSlider = dynamic_cast<TQSlider *>(slider); if (bigSlider) - if ( _orientation == Qt::Vertical ) + if ( _orientation == TQt::Vertical ) vol.setVolume( chid, bigSlider->maxValue() - bigSlider->value() ); else vol.setVolume( chid, bigSlider->value() ); @@ -808,7 +807,7 @@ void MDWSlider::update() // show the top of both volumes, and not strangely low down // the main volume by half - if ( _orientation == Qt::Vertical ) + if ( _orientation == TQt::Vertical ) bigSlider->setValue( vol.maxVolume() - vol.getTopStereoVolume( Volume::MMAIN ) ); else bigSlider->setValue( vol.getTopStereoVolume( Volume::MMAIN ) ); @@ -844,7 +843,7 @@ void MDWSlider::update() { TQSlider *bigSlider = dynamic_cast<TQSlider *>(slider); if (bigSlider) - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { bigSlider->setValue( vol.maxVolume() - vol[i] ); } else { @@ -909,7 +908,7 @@ void MDWSlider::showContextMenu() a = _mdwActions->action( "keys" ); if ( a && m_keys ) { - TDEActionSeparator sep( TQT_TQOBJECT(this) ); + TDEActionSeparator sep( this ); sep.plug( menu ); a->plug( menu ); } @@ -935,15 +934,15 @@ TQSize MDWSlider::sizeHint() const { bool MDWSlider::eventFilter( TQObject* obj, TQEvent* e ) { if (e->type() == TQEvent::MouseButtonPress) { - TQMouseEvent *qme = TQT_TQMOUSEEVENT(e); - if (qme->button() == Qt::RightButton) { + TQMouseEvent *qme = static_cast<TQMouseEvent*>(e); + if (qme->button() == TQt::RightButton) { showContextMenu(); return true; } } // Attention: We don't filter WheelEvents for KSmallSlider, because it handles WheelEvents itself else if ( (e->type() == TQEvent::Wheel) && !obj->isA("KSmallSlider") ) { - TQWheelEvent *qwe = TQT_TQWHEELEVENT(e); + TQWheelEvent *qwe = static_cast<TQWheelEvent*>(e); if (qwe->delta() > 0) { increaseVolume(); } diff --git a/kmix/mdwslider.h b/kmix/mdwslider.h index 72b9546c..fcd3636b 100644 --- a/kmix/mdwslider.h +++ b/kmix/mdwslider.h @@ -1,4 +1,3 @@ -//-*-C++-*- /* * KMix -- KDE's full featured mini mixer * @@ -55,13 +54,13 @@ class ViewBase; class MDWSlider : public MixDeviceWidget { - Q_OBJECT + TQ_OBJECT public: MDWSlider( Mixer *mixer, MixDevice* md, bool showMuteLED, bool showRecordLED, - bool small, Qt::Orientation, + bool small, TQt::Orientation, TQWidget* parent = 0, ViewBase* mw = 0, const char* name = 0); ~MDWSlider() {} diff --git a/kmix/mdwswitch.cpp b/kmix/mdwswitch.cpp index 94acf747..8b62e6c1 100644 --- a/kmix/mdwswitch.cpp +++ b/kmix/mdwswitch.cpp @@ -30,7 +30,7 @@ #include <tdeconfig.h> #include <tdeaction.h> #include <tdepopupmenu.h> -#include <kglobalaccel.h> +#include <tdeglobalaccel.h> #include <kkeydialog.h> #include <kdebug.h> @@ -46,7 +46,7 @@ * be "small" (uses KSmallSlider instead of TQSlider then). */ MDWSwitch::MDWSwitch(Mixer *mixer, MixDevice* md, - bool small, Qt::Orientation orientation, + bool small, TQt::Orientation orientation, TQWidget* parent, ViewBase* mw, const char* name) : MixDeviceWidget(mixer,md,small,orientation,parent,mw,name), _label(0) , _labelV(0) , _switchLED(0), _layout(0) @@ -54,14 +54,14 @@ MDWSwitch::MDWSwitch(Mixer *mixer, MixDevice* md, // create actions (on _mdwActions, see MixDeviceWidget) // KStdAction::showMenubar() is in MixDeviceWidget now - new TDEToggleAction( i18n("&Hide"), 0, TQT_TQOBJECT(this), TQT_SLOT(setDisabled()), _mdwActions, "hide" ); - new TDEAction( i18n("C&onfigure Shortcuts..."), 0, TQT_TQOBJECT(this), TQT_SLOT(defineKeys()), _mdwActions, "keys" ); + new TDEToggleAction( i18n("&Hide"), 0, this, TQ_SLOT(setDisabled()), _mdwActions, "hide" ); + new TDEAction( i18n("C&onfigure Shortcuts..."), 0, this, TQ_SLOT(defineKeys()), _mdwActions, "keys" ); // create widgets createWidgets(); m_keys->insert( "Toggle switch", i18n( "Toggle Switch" ), TQString(), - TDEShortcut(), TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT( toggleSwitch() ) ); + TDEShortcut(), TDEShortcut(), this, TQ_SLOT( toggleSwitch() ) ); // The keys are loaded in KMixerWidget::loadConfig, see kmixerwidget.cpp (now: kmixtoolbox.cpp) //m_keys->readSettings(); @@ -77,7 +77,7 @@ MDWSwitch::~MDWSwitch() void MDWSwitch::createWidgets() { - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { _layout = new TQVBoxLayout( this ); _layout->setAlignment(TQt::AlignHCenter); } @@ -90,7 +90,7 @@ void MDWSwitch::createWidgets() _layout->addSpacing( 4 ); // --- LEDS -------------------------- - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { if( m_mixdevice->isRecordable() ) _switchLED = new KLedButton( TQt::red, m_mixdevice->isRecSource()?KLed::On:KLed::Off, @@ -124,7 +124,7 @@ void MDWSwitch::createWidgets() _switchLED->installEventFilter( this ); _label->installEventFilter( this ); } - connect( _switchLED, TQT_SIGNAL(stateChanged(bool)), this, TQT_SLOT(toggleSwitch()) ); + connect( _switchLED, TQ_SIGNAL(stateChanged(bool)), this, TQ_SLOT(toggleSwitch()) ); _layout->addSpacing( 4 ); } @@ -219,8 +219,8 @@ void MDWSwitch::setDisabled( bool value ) { bool MDWSwitch::eventFilter( TQObject* obj, TQEvent* e ) { if (e->type() == TQEvent::MouseButtonPress) { - TQMouseEvent *qme = TQT_TQMOUSEEVENT(e); - if (qme->button() == Qt::RightButton) { + TQMouseEvent *qme = static_cast<TQMouseEvent*>(e); + if (qme->button() == TQt::RightButton) { showContextMenu(); return true; } diff --git a/kmix/mdwswitch.h b/kmix/mdwswitch.h index e7759546..8be74e95 100644 --- a/kmix/mdwswitch.h +++ b/kmix/mdwswitch.h @@ -1,4 +1,3 @@ -//-*-C++-*- /* * KMix -- KDE's full featured mini mixer * @@ -51,12 +50,12 @@ class ViewBase; class MDWSwitch : public MixDeviceWidget { - Q_OBJECT + TQ_OBJECT public: MDWSwitch( Mixer *mixer, MixDevice* md, - bool small, Qt::Orientation orientation, + bool small, TQt::Orientation orientation, TQWidget* parent = 0, ViewBase* mw = 0, const char* name = 0); ~MDWSwitch(); diff --git a/kmix/mixdevice.h b/kmix/mixdevice.h index cc048a62..3a719e5d 100644 --- a/kmix/mixdevice.h +++ b/kmix/mixdevice.h @@ -18,7 +18,7 @@ */ class MixDevice : public TQObject { - Q_OBJECT + TQ_OBJECT public: diff --git a/kmix/mixdevicewidget.cpp b/kmix/mixdevicewidget.cpp index d6bf2ff1..81d7c4ed 100644 --- a/kmix/mixdevicewidget.cpp +++ b/kmix/mixdevicewidget.cpp @@ -25,7 +25,7 @@ #include <tdeconfig.h> #include <tdeaction.h> #include <tdepopupmenu.h> -#include <kglobalaccel.h> +#include <tdeglobalaccel.h> #include <kkeydialog.h> #include <kdebug.h> @@ -53,13 +53,13 @@ * be "small" (uses KSmallSlider instead of TQSlider then). */ MixDeviceWidget::MixDeviceWidget(Mixer *mixer, MixDevice* md, - bool small, Qt::Orientation orientation, + bool small, TQt::Orientation orientation, TQWidget* parent, ViewBase* mw, const char* name) : TQWidget( parent, name ), m_mixer(mixer), m_mixdevice( md ), m_mixerwidget( mw ), m_disabled( false ), _orientation( orientation ), m_small( small ) { _mdwActions = new TDEActionCollection( this ); - m_keys = new TDEGlobalAccel( TQT_TQOBJECT(this), "Keys" ); + m_keys = new TDEGlobalAccel( this, "Keys" ); } MixDeviceWidget::~MixDeviceWidget() @@ -109,7 +109,7 @@ void MixDeviceWidget::setMutedColors( TQColor , TQColor , TQColor ) { /* is virt void MixDeviceWidget::mousePressEvent( TQMouseEvent *e ) { - if ( e->button()==Qt::RightButton ) + if ( e->button()==TQt::RightButton ) showContextMenu(); else { TQWidget::mousePressEvent(e); diff --git a/kmix/mixdevicewidget.h b/kmix/mixdevicewidget.h index 676199e1..ccd779f6 100644 --- a/kmix/mixdevicewidget.h +++ b/kmix/mixdevicewidget.h @@ -1,4 +1,3 @@ -//-*-C++-*- /* * KMix -- KDE's full featured mini mixer * @@ -53,14 +52,14 @@ class ViewBase; class MixDeviceWidget : public TQWidget { - Q_OBJECT + TQ_OBJECT public: enum ValueStyle { NNONE = 0, NABSOLUTE = 1, NRELATIVE = 2 } ; MixDeviceWidget( Mixer *mixer, MixDevice* md, - bool small, Qt::Orientation orientation, + bool small, TQt::Orientation orientation, TQWidget* parent = 0, ViewBase* mw = 0, const char* name = 0); ~MixDeviceWidget(); @@ -106,7 +105,7 @@ protected: TDEGlobalAccel* m_keys; ViewBase* m_mixerwidget; bool m_disabled; - Qt::Orientation _orientation; + TQt::Orientation _orientation; bool m_small; private: diff --git a/kmix/mixer.cpp b/kmix/mixer.cpp index 150b196d..953afce9 100644 --- a/kmix/mixer.cpp +++ b/kmix/mixer.cpp @@ -89,7 +89,7 @@ Mixer::Mixer( int driver, int device ) : DCOPObject( "Mixer" ) m_profiles.setAutoDelete( true ); _pollingTimer = new TQTimer(); // will be started on open() and stopped on close() - connect( _pollingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(readSetFromHW())); + connect( _pollingTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(readSetFromHW())); TQCString objid; #ifndef KMIX_DCOP_OBJID_TEST @@ -207,7 +207,7 @@ int Mixer::open() else { _mixerBackend->prepareSignalling(this); // poll once to give the GUI a chance to rebuild it's info - TQTimer::singleShot( 50, this, TQT_SLOT( readSetFromHW() ) ); + TQTimer::singleShot( 50, this, TQ_SLOT( readSetFromHW() ) ); } return err; } @@ -516,7 +516,7 @@ void Mixer::setVolume( int deviceidx, int percentage ) _mixerBackend->writeVolumeToHW(deviceidx, vol); // Make sure volume reading is synced readSetFromHWforceUpdate(); - TQTimer::singleShot(50, this, TQT_SLOT(readSetFromHW())); + TQTimer::singleShot(50, this, TQ_SLOT(readSetFromHW())); } /** @@ -534,7 +534,7 @@ void Mixer::commitVolumeChange( MixDevice* md ) { // Muting/unmuting PulseAudio directly does not send back any notification to the mixer // so we make sure we always update the tray icon after each operation. readSetFromHWforceUpdate(); - TQTimer::singleShot(50, this, TQT_SLOT(readSetFromHW())); + TQTimer::singleShot(50, this, TQ_SLOT(readSetFromHW())); } // @dcop only @@ -586,7 +586,7 @@ void Mixer::setAbsoluteVolume( int deviceidx, long absoluteVolume ) { _mixerBackend->writeVolumeToHW(deviceidx, vol); // Make sure volume reading is synced readSetFromHWforceUpdate(); - TQTimer::singleShot(50, this, TQT_SLOT(readSetFromHW())); + TQTimer::singleShot(50, this, TQ_SLOT(readSetFromHW())); } // @dcop , especially for use in KMilo diff --git a/kmix/mixer.h b/kmix/mixer.h index 47b49ebb..2ec99a1e 100644 --- a/kmix/mixer.h +++ b/kmix/mixer.h @@ -1,4 +1,3 @@ -//-*-C++-*- /* * KMix -- KDE's full featured mini mixer * @@ -43,7 +42,7 @@ class TDEConfig; class Mixer : public TQObject, virtual public MixerIface { - Q_OBJECT + TQ_OBJECT public: diff --git a/kmix/mixer_alsa9.cpp b/kmix/mixer_alsa9.cpp index 22303b43..aaf6a109 100644 --- a/kmix/mixer_alsa9.cpp +++ b/kmix/mixer_alsa9.cpp @@ -418,7 +418,7 @@ void Mixer_ALSA::prepareSignalling( Mixer *mixer ) { kdDebug() << "socket " << i << endl; m_sns[i] = new TQSocketNotifier(m_fds[i].fd, TQSocketNotifier::Read); - mixer->connect(m_sns[i], TQT_SIGNAL(activated(int)), mixer, TQT_SLOT(readSetFromHW())); + mixer->connect(m_sns[i], TQ_SIGNAL(activated(int)), mixer, TQ_SLOT(readSetFromHW())); } } diff --git a/kmix/mixer_backend.h b/kmix/mixer_backend.h index d5a9ed18..d2725eb5 100644 --- a/kmix/mixer_backend.h +++ b/kmix/mixer_backend.h @@ -1,4 +1,3 @@ -//-*-C++-*- /* * KMix -- KDE's full featured mini mixer * diff --git a/kmix/mixer_hpux.cpp b/kmix/mixer_hpux.cpp index 20ef91f3..0f491ac9 100644 --- a/kmix/mixer_hpux.cpp +++ b/kmix/mixer_hpux.cpp @@ -145,12 +145,12 @@ void Mixer_HPUX::setDevNumName_I(int devnum) */ bool Mixer_HPUX::setRecsrcHW( int devnum, bool on ) { - return FALSE; + return false; } bool Mixer_HPUX::isRecsrcHW( int devnum ) { - return FALSE; + return false; } int Mixer_HPUX::readVolumeFromHW( int devnum, Volume &vol ) diff --git a/kmix/mixer_oss.h b/kmix/mixer_oss.h index 7bedf7f5..b1ed17d0 100644 --- a/kmix/mixer_oss.h +++ b/kmix/mixer_oss.h @@ -1,5 +1,3 @@ -//-*-C++-*- - #ifndef MIXER_OSS_H #define MIXER_OSS_H diff --git a/kmix/mixer_oss4.h b/kmix/mixer_oss4.h index 40f14785..8ce23f54 100644 --- a/kmix/mixer_oss4.h +++ b/kmix/mixer_oss4.h @@ -1,5 +1,3 @@ -//-*-C++-*- - #ifndef MIXER_OSS4_H #define MIXER_OSS4_H diff --git a/kmix/mixer_sun.cpp b/kmix/mixer_sun.cpp index 12806bda..af5cfb8b 100644 --- a/kmix/mixer_sun.cpp +++ b/kmix/mixer_sun.cpp @@ -105,7 +105,7 @@ const uint_t MixerSunPortMasks[] = //====================================================================== -// FUNCTION/TQT_METHOD DEFINITIONS +// FUNCTION/METHOD DEFINITIONS //====================================================================== @@ -267,14 +267,14 @@ int Mixer_SUN::readVolumeFromHW( int devnum, Volume& volume ) break; case MIXERDEV_RECORD_MONITOR : - volume.setMuted(FALSE); + volume.setMuted(false); volume.setAllVolumes( audioinfo.monitor_gain ); break; case MIXERDEV_INTERNAL_SPEAKER : case MIXERDEV_HEADPHONE : case MIXERDEV_LINE_OUT : - volume.setMuted( (audioinfo.play.port & devMask) ? FALSE : TRUE ); + volume.setMuted( !(audioinfo.play.port & devMask) ); GainBalanceToVolume( audioinfo.play.gain, audioinfo.play.balance, volume ); @@ -283,7 +283,7 @@ int Mixer_SUN::readVolumeFromHW( int devnum, Volume& volume ) case MIXERDEV_MICROPHONE : case MIXERDEV_LINE_IN : case MIXERDEV_CD : - volume.setMuted( (audioinfo.record.port & devMask) ? FALSE : TRUE ); + volume.setMuted( !(audioinfo.record.port & devMask) ); GainBalanceToVolume( audioinfo.record.gain, audioinfo.record.balance, volume ); @@ -384,7 +384,7 @@ int Mixer_SUN::writeVolumeToHW( int devnum, Volume &volume ) //====================================================================== bool Mixer_SUN::setRecsrcHW( int /* devnum */, bool /* on */ ) { - return FALSE; + return false; } //====================================================================== @@ -398,10 +398,10 @@ bool Mixer_SUN::isRecsrcHW( int devnum ) case MIXERDEV_MICROPHONE : case MIXERDEV_LINE_IN : case MIXERDEV_CD : - return TRUE; + return true; default : - return FALSE; + return false; } } diff --git a/kmix/pics/CMakeLists.txt b/kmix/pics/CMakeLists.txt index 35ea82c5..92af67f8 100644 --- a/kmix/pics/CMakeLists.txt +++ b/kmix/pics/CMakeLists.txt @@ -16,8 +16,10 @@ install( FILES mix_microphone.png mix_midi.png mix_recmon.png mix_treble.png mix_unknown.png mix_volume.png mix_surround.png mix_video.png mix_headphone.png - mix_digital.png mix_ac97.png kmixdocked.png - kmixdocked_mute.png kmixdocked_error.png mix_record.png + mix_digital.png mix_ac97.png mix_record.png SpeakerFrontLeft.png SpeakerRearLeft.png SpeakerFrontRight.png SpeakerRearRight.png Listener.png DESTINATION ${DATA_INSTALL_DIR}/kmix/pics ) + +add_subdirectory(oldcrystal) +add_subdirectory(crystal)
\ No newline at end of file diff --git a/kmix/pics/crystal/CMakeLists.txt b/kmix/pics/crystal/CMakeLists.txt new file mode 100644 index 00000000..71f61d26 --- /dev/null +++ b/kmix/pics/crystal/CMakeLists.txt @@ -0,0 +1,13 @@ +################################################################################ +# Copyright © 2024 Mavridis Philippe <mavridisf@gmail.com> # +# # +# This file is released under the GNU GPL version 3 or later. # +# Improvements and feedback are welcome! # +################################################################################ + +set(theme "crystal") + +install(FILES audio-volume-error.png audio-volume-muted.png + audio-volume-low.png audio-volume-medium.png + audio-volume-high.png + DESTINATION ${DATA_INSTALL_DIR}/kmix/pics/${theme})
\ No newline at end of file diff --git a/kmix/pics/kmixdocked_error.png b/kmix/pics/crystal/audio-volume-error.png Binary files differindex b0497662..b0497662 100644 --- a/kmix/pics/kmixdocked_error.png +++ b/kmix/pics/crystal/audio-volume-error.png diff --git a/kmix/pics/crystal/audio-volume-high.png b/kmix/pics/crystal/audio-volume-high.png Binary files differnew file mode 100644 index 00000000..bfa7234b --- /dev/null +++ b/kmix/pics/crystal/audio-volume-high.png diff --git a/kmix/pics/crystal/audio-volume-low.png b/kmix/pics/crystal/audio-volume-low.png Binary files differnew file mode 100644 index 00000000..e42f7c8b --- /dev/null +++ b/kmix/pics/crystal/audio-volume-low.png diff --git a/kmix/pics/crystal/audio-volume-medium.png b/kmix/pics/crystal/audio-volume-medium.png Binary files differnew file mode 100644 index 00000000..4be127eb --- /dev/null +++ b/kmix/pics/crystal/audio-volume-medium.png diff --git a/kmix/pics/crystal/audio-volume-muted.png b/kmix/pics/crystal/audio-volume-muted.png Binary files differnew file mode 100644 index 00000000..8ceb8690 --- /dev/null +++ b/kmix/pics/crystal/audio-volume-muted.png diff --git a/kmix/pics/oldcrystal/CMakeLists.txt b/kmix/pics/oldcrystal/CMakeLists.txt new file mode 100644 index 00000000..47b37e11 --- /dev/null +++ b/kmix/pics/oldcrystal/CMakeLists.txt @@ -0,0 +1,13 @@ +################################################################################ +# Copyright © 2024 Mavridis Philippe <mavridisf@gmail.com> # +# # +# This file is released under the GNU GPL version 3 or later. # +# Improvements and feedback are welcome! # +################################################################################ + +set(theme "oldcrystal") + +install(FILES audio-volume-error.png audio-volume-muted.png + audio-volume-low.png audio-volume-medium.png + audio-volume-high.png + DESTINATION ${DATA_INSTALL_DIR}/kmix/pics/${theme})
\ No newline at end of file diff --git a/kmix/pics/oldcrystal/audio-volume-error.png b/kmix/pics/oldcrystal/audio-volume-error.png Binary files differnew file mode 100644 index 00000000..b0497662 --- /dev/null +++ b/kmix/pics/oldcrystal/audio-volume-error.png diff --git a/kmix/pics/oldcrystal/audio-volume-high.png b/kmix/pics/oldcrystal/audio-volume-high.png new file mode 120000 index 00000000..dd3d1eea --- /dev/null +++ b/kmix/pics/oldcrystal/audio-volume-high.png @@ -0,0 +1 @@ +audio-volume-low.png
\ No newline at end of file diff --git a/kmix/pics/kmixdocked.png b/kmix/pics/oldcrystal/audio-volume-low.png Binary files differindex 0c3f17d7..9e8997e5 100644 --- a/kmix/pics/kmixdocked.png +++ b/kmix/pics/oldcrystal/audio-volume-low.png diff --git a/kmix/pics/oldcrystal/audio-volume-medium.png b/kmix/pics/oldcrystal/audio-volume-medium.png new file mode 120000 index 00000000..dd3d1eea --- /dev/null +++ b/kmix/pics/oldcrystal/audio-volume-medium.png @@ -0,0 +1 @@ +audio-volume-low.png
\ No newline at end of file diff --git a/kmix/pics/kmixdocked_mute.png b/kmix/pics/oldcrystal/audio-volume-muted.png Binary files differindex 0dae0f15..70764025 100644 --- a/kmix/pics/kmixdocked_mute.png +++ b/kmix/pics/oldcrystal/audio-volume-muted.png diff --git a/kmix/viewapplet.cpp b/kmix/viewapplet.cpp index 87020b95..ccd6080e 100644 --- a/kmix/viewapplet.cpp +++ b/kmix/viewapplet.cpp @@ -41,20 +41,20 @@ ViewApplet::ViewApplet(TQWidget* parent, const char* name, Mixer* mixer, ViewBas { setBackgroundOrigin(AncestorOrigin); // remove the menu bar action, that is put by the "ViewBase" constructor in _actions. - //TDEToggleAction *m = static_cast<TDEToggleAction*>(KStdAction::showMenubar( this, TQT_SLOT(toggleMenuBarSlot()), _actions )); - _actions->remove( KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenuBarSlot()), _actions) ); + //TDEToggleAction *m = static_cast<TDEToggleAction*>(KStdAction::showMenubar( this, TQ_SLOT(toggleMenuBarSlot()), _actions )); + _actions->remove( KStdAction::showMenubar(this, TQ_SLOT(toggleMenuBarSlot()), _actions) ); if ( position == KPanelApplet::pLeft || position == KPanelApplet::pRight ) { //kdDebug(67100) << "ViewApplet() isVertical" << "\n"; - _viewOrientation = Qt::Vertical; + _viewOrientation = TQt::Vertical; } else { //kdDebug(67100) << "ViewApplet() isHorizontal" << "\n"; - _viewOrientation = Qt::Horizontal; + _viewOrientation = TQt::Horizontal; } - if ( _viewOrientation == Qt::Horizontal ) { + if ( _viewOrientation == TQt::Horizontal ) { _layoutMDW = new TQHBoxLayout( this ); setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred); } @@ -104,11 +104,11 @@ TQWidget* ViewApplet::add(MixDevice *md) Slider orientation is exactly the other way round. If the applet stretches horzontally, the sliders must be vertical */ - Qt::Orientation sliderOrientation; - if (_viewOrientation == Qt::Horizontal ) - sliderOrientation = Qt::Vertical; + TQt::Orientation sliderOrientation; + if (_viewOrientation == TQt::Horizontal ) + sliderOrientation = TQt::Vertical; else - sliderOrientation = Qt::Horizontal; + sliderOrientation = TQt::Horizontal; // kdDebug(67100) << "ViewApplet::add()\n"; MixDeviceWidget *mdw = @@ -147,7 +147,7 @@ TQSize ViewApplet::sizeHint() const { } TQSizePolicy ViewApplet::sizePolicy() const { - if ( _viewOrientation == Qt::Horizontal ) { + if ( _viewOrientation == TQt::Horizontal ) { //kdDebug(67100) << "ViewApplet::sizePolicy=(Fixed,Expanding)\n"; return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding); } @@ -159,7 +159,7 @@ TQSizePolicy ViewApplet::sizePolicy() const { bool ViewApplet::shouldShowIcons(TQSize qsz) { bool showIcons = false; - if ( _viewOrientation == Qt::Horizontal ) { + if ( _viewOrientation == TQt::Horizontal ) { if ( qsz.height() >= 32 ) { //kdDebug(67100) << "ViewApplet::resizeEvent() hor >=32" << qre->size() << "\n"; showIcons = true; diff --git a/kmix/viewapplet.h b/kmix/viewapplet.h index a5e32611..abd31746 100644 --- a/kmix/viewapplet.h +++ b/kmix/viewapplet.h @@ -12,7 +12,7 @@ class Mixer; class ViewApplet : public ViewBase { - Q_OBJECT + TQ_OBJECT public: ViewApplet(TQWidget* parent, const char* name, Mixer* mixer, ViewBase::ViewFlags vflags, KPanelApplet::Position pos); @@ -41,7 +41,7 @@ private: // Position of the applet (pLeft, pRight, pTop, pBottom) //KPanelApplet::Position _KMIXposition; // Orientation of the applet (horizontal or vertical) - Qt::Orientation _viewOrientation; + TQt::Orientation _viewOrientation; }; #endif diff --git a/kmix/viewbase.cpp b/kmix/viewbase.cpp index 86d1524c..41d26f6a 100644 --- a/kmix/viewbase.cpp +++ b/kmix/viewbase.cpp @@ -51,7 +51,7 @@ ViewBase::ViewBase(TQWidget* parent, const char* name, const TQString & caption, // Plug in the "showMenubar" action, if the caller wants it. Typically this is only neccesary for views in the KMix main window. if ( vflags & ViewBase::HasMenuBar ) { - TDEToggleAction *m = static_cast<TDEToggleAction*>(KStdAction::showMenubar( TQT_TQOBJECT(this), TQT_SLOT(toggleMenuBarSlot()), _actions )); + TDEToggleAction *m = static_cast<TDEToggleAction*>(KStdAction::showMenubar( this, TQ_SLOT(toggleMenuBarSlot()), _actions )); if ( vflags & ViewBase::MenuBarVisible ) { m->setChecked(true); } @@ -59,9 +59,9 @@ ViewBase::ViewBase(TQWidget* parent, const char* name, const TQString & caption, m->setChecked(false); } } - new TDEAction(i18n("&Channels"), 0, TQT_TQOBJECT(this), TQT_SLOT(configureView()), _actions, "toggle_channels"); - new TDEAction(i18n("&Select Mixer"), 0, TQT_TQOBJECT(this), TQT_SLOT(selectMixerSlot()), _actions, "select_mixer"); - connect ( _mixer, TQT_SIGNAL(newVolumeLevels()), this, TQT_SLOT(refreshVolumeLevels()) ); + new TDEAction(i18n("&Channels"), 0, this, TQ_SLOT(configureView()), _actions, "toggle_channels"); + new TDEAction(i18n("&Select Mixer"), 0, this, TQ_SLOT(selectMixerSlot()), _actions, "select_mixer"); + connect ( _mixer, TQ_SIGNAL(newVolumeLevels()), this, TQ_SLOT(refreshVolumeLevels()) ); } ViewBase::~ViewBase() { @@ -113,7 +113,7 @@ void ViewBase::createDeviceWidgets() // ---------- Popup stuff START --------------------- void ViewBase::mousePressEvent( TQMouseEvent *e ) { - if ( e->button()==Qt::RightButton ) + if ( e->button()==TQt::RightButton ) showContextMenu(); } diff --git a/kmix/viewbase.h b/kmix/viewbase.h index 79f4220b..bda3aa06 100644 --- a/kmix/viewbase.h +++ b/kmix/viewbase.h @@ -16,7 +16,7 @@ class MixDevice; */ class ViewBase : public TQWidget { - Q_OBJECT + TQ_OBJECT public: diff --git a/kmix/viewdockareapopup.cpp b/kmix/viewdockareapopup.cpp index e9cd9155..79d8cfc4 100644 --- a/kmix/viewdockareapopup.cpp +++ b/kmix/viewdockareapopup.cpp @@ -127,7 +127,7 @@ TQWidget* ViewDockAreaPopup::add(MixDevice *md) true, // Show Mute LED false, // Show Record LED false, // Small - Qt::Vertical, // Direction: only 1 device, so doesn't matter + TQt::Vertical, // Direction: only 1 device, so doesn't matter _frame, // parent 0, // Is "NULL", so that there is no RMB-popup _dockDevice->name().local8Bit()); @@ -137,7 +137,7 @@ TQWidget* ViewDockAreaPopup::add(MixDevice *md) // Add button to show main panel _showPanelBox = new TQPushButton( i18n("Mixer"), _frame, "MixerPanel" ); - connect ( _showPanelBox, TQT_SIGNAL( clicked() ), TQT_SLOT( showPanelSlot() ) ); + connect ( _showPanelBox, TQ_SIGNAL( clicked() ), TQ_SLOT( showPanelSlot() ) ); _layoutMDW->addMultiCellWidget( _showPanelBox, 1, 1, 0, 2 ); return _mdw; diff --git a/kmix/viewdockareapopup.h b/kmix/viewdockareapopup.h index 8d4b0f90..a3f00342 100644 --- a/kmix/viewdockareapopup.h +++ b/kmix/viewdockareapopup.h @@ -17,7 +17,7 @@ class TQTime; class ViewDockAreaPopup : public ViewBase { - Q_OBJECT + TQ_OBJECT public: ViewDockAreaPopup(TQWidget* parent, const char* name, Mixer* mixer, ViewBase::ViewFlags vflags, KMixDockWidget *dockW); diff --git a/kmix/viewgrid.cpp b/kmix/viewgrid.cpp deleted file mode 100644 index e6aa2045..00000000 --- a/kmix/viewgrid.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* - * KMix -- KDE's full featured mini mixer - * - * - * Copyright (C) 1996-2004 Christian Esken <esken@kde.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "viewgrid.h" - -// TQt -#include <tqwidget.h> - -// KDE -#include <kdebug.h> - -// KMix -#include "mdwenum.h" -#include "mdwslider.h" -#include "mdwswitch.h" -#include "mixer.h" - -/** - */ -ViewGrid::ViewGrid(TQWidget* parent, const char* name, const TQString & caption, Mixer* mixer, ViewBase::ViewFlags vflags) - : ViewBase(parent, name, caption, mixer, WStyle_Customize|WStyle_NoBorder, vflags) -{ - m_spacingHorizontal = 5; - m_spacingVertical = 5; - - if ( _vflags & ViewBase::Vertical ) { - //_layoutMDW = new TQVBoxLayout(this); - } - else { - //_layoutMDW = new TQHBoxLayout(this); - } - init(); -} - -ViewGrid::~ViewGrid() { -} - -void ViewGrid::setMixSet(MixSet *mixset) -{ - MixDevice* md; - int testCounter = 0; - for ( md = mixset->first(); md != 0; md = mixset->next() ) { - if (testCounter<8) { - _mixSet->append(md); - } - testCounter++; - } -} - -int ViewGrid::count() -{ - return ( _mixSet->count() ); -} - -int ViewGrid::advice() { - if ( _mixSet->count() > 0 ) { - // The standard input and output views are always advised, if there are devices in it - return 100; - } - else { - return 0; - } -} - -TQWidget* ViewGrid::add(MixDevice *md) -{ - MixDeviceWidget *mdw = 0; - if ( md->isEnum() ) { - Qt::Orientation orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical; - mdw = new MDWEnum( - _mixer, // the mixer for this device - md, // MixDevice (parameter) - orientation, // Orientation - this, // parent - this, // View widget - md->name().latin1() - ); - } // an enum - else if (md->isSwitch()) { - Qt::Orientation orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical; - mdw = - new MDWSwitch( - _mixer, // the mixer for this device - md, // MixDevice (parameter) - false, // Small - orientation, // Orientation - this, // parent - this, // View widget - md->name().latin1() - ); - } // a switch - - else { // must be a slider - Qt::Orientation orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical; - mdw = - new MDWSlider( - _mixer, // the mixer for this device - md, // MixDevice (parameter) - true, // Show Mute LED - true, // Show Record LED - false, // Small - orientation, // Orientation - this, // parent - this, // View widget - md->name().latin1() - ); - } - return mdw; -} - -TQSize ViewGrid::sizeHint() const { - // kdDebug(67100) << "ViewGrid::sizeHint(): NewSize is " << _layoutMDW->sizeHint() << "\n"; - return( m_sizeHint); -} - -void ViewGrid::constructionFinished() { - //_layoutMDW->activate(); - - // do a manual layout - configurationUpdate(); -} - -void ViewGrid::refreshVolumeLevels() { - // kdDebug(67100) << "ViewGrid::refreshVolumeLevels()\n"; - - m_sizeHint.setWidth (0); - m_sizeHint.setHeight(0); - - m_testingX = 0; - m_testingY = 0; - - TQWidget *mdw = _mdws.first(); - MixDevice* md; - for ( md = _mixSet->first(); md != 0; md = _mixSet->next() ) { - if ( mdw == 0 ) { - kdError(67100) << "ViewGrid::refreshVolumeLevels(): mdw == 0\n"; - break; // sanity check (normally the lists are set up correctly) - } - else { - if ( mdw->inherits("MDWSlider")) { - //kdDebug(67100) << "ViewGrid::refreshVolumeLevels(): updating\n"; - // a slider, fine. Lets update its value - static_cast<MDWSlider*>(mdw)->update(); - } - else if ( mdw->inherits("MDWSwitch")) { - //kdDebug(67100) << "ViewGrid::refreshVolumeLevels(): updating\n"; - // a slider, fine. Lets update its value - static_cast<MDWSwitch*>(mdw)->update(); - } - else if ( mdw->inherits("MDWEnum")) { - static_cast<MDWEnum*>(mdw)->update(); - } - else { - kdError(67100) << "ViewGrid::refreshVolumeLevels(): mdw is unknown/unsupported type\n"; - // no slider. Cannot happen in theory => skip it - } - } - mdw = _mdws.next(); - } -} - -/** - This implementation makes sure the Grid's geometry is updated - after hiding/showing channels. -*/ -void ViewGrid::configurationUpdate() { - m_sizeHint.setWidth (0); - m_sizeHint.setHeight(0); - - m_testingX = 0; - m_testingY = 0; - - for (TQWidget *qw = _mdws.first(); qw !=0; qw = _mdws.next() ) { - - if ( qw->inherits("MixDeviceWidget")) { - MixDeviceWidget* mdw = static_cast<MixDeviceWidget*>(qw); - int xPos = m_testingX * m_spacingHorizontal; - int yPos = m_testingY * m_spacingVertical ; - mdw->move( xPos, yPos ); - mdw->resize( mdw->sizeHint() ); - int xMax = xPos + mdw->width() ; if ( xMax > m_sizeHint.width() ) m_sizeHint.setWidth(xMax); - int yMax = yPos + mdw->height(); if ( yMax > m_sizeHint.height() ) m_sizeHint.setHeight(yMax); - - m_testingX += 5; - if ( m_testingX > 50 ) { - m_testingY += 10; - m_testingX = 0; - } - } // inherits MixDeviceWidget - } // for all MDW's -} - - -#include "viewgrid.moc" diff --git a/kmix/viewgrid.h b/kmix/viewgrid.h deleted file mode 100644 index d9883ef6..00000000 --- a/kmix/viewgrid.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ViewGrid_h -#define ViewGrid_h - -class TQBoxLayout; -#include "tqsize.h" -class TQWidget; - -class Mixer; -#include "viewbase.h" - -class ViewGrid : public ViewBase -{ - Q_OBJECT - -public: - ViewGrid(TQWidget* parent, const char* name, const TQString & caption, Mixer* mixer, ViewBase::ViewFlags vflags); - ~ViewGrid(); - - virtual int count(); - virtual int advice(); - virtual void setMixSet(MixSet *mixset); - virtual TQWidget* add(MixDevice *mdw); - virtual void configurationUpdate(); - virtual void constructionFinished(); - - TQSize sizeHint() const; - -public slots: - virtual void refreshVolumeLevels(); - -private: - unsigned int m_spacingHorizontal; - unsigned int m_spacingVertical; - - // m_maxX and m_maxY are the highest coordiantes encountered - TQSize m_sizeHint; - - unsigned int m_testingX; - unsigned int m_testingY; -}; - -#endif - diff --git a/kmix/viewinput.cpp b/kmix/viewinput.cpp index eeadc61b..412b773b 100644 --- a/kmix/viewinput.cpp +++ b/kmix/viewinput.cpp @@ -29,7 +29,7 @@ ViewInput::ViewInput(TQWidget* parent, const char* name, const TQString & captio : ViewSliders(parent, name, caption, mixer, vflags) { init(); - connect ( _mixer, TQT_SIGNAL(newRecsrc()) , this, TQT_SLOT(refreshVolumeLevels()) ); // only the input widget has record sources + connect ( _mixer, TQ_SIGNAL(newRecsrc()) , this, TQ_SLOT(refreshVolumeLevels()) ); // only the input widget has record sources } ViewInput::~ViewInput() { diff --git a/kmix/viewinput.h b/kmix/viewinput.h index 01d3e0fe..2164d2f1 100644 --- a/kmix/viewinput.h +++ b/kmix/viewinput.h @@ -7,7 +7,7 @@ class Mixer; class ViewInput : public ViewSliders { - Q_OBJECT + TQ_OBJECT public: ViewInput(TQWidget* parent, const char* name, const TQString & caption, Mixer* mixer, ViewBase::ViewFlags vflags); diff --git a/kmix/viewoutput.h b/kmix/viewoutput.h index a0980494..93f710f8 100644 --- a/kmix/viewoutput.h +++ b/kmix/viewoutput.h @@ -7,7 +7,7 @@ class Mixer; class ViewOutput : public ViewSliders { - Q_OBJECT + TQ_OBJECT public: ViewOutput(TQWidget* parent, const char* name, const TQString & caption, Mixer* mixer, ViewBase::ViewFlags vflags); diff --git a/kmix/viewsliders.cpp b/kmix/viewsliders.cpp index b36f7c2f..fcd6e423 100644 --- a/kmix/viewsliders.cpp +++ b/kmix/viewsliders.cpp @@ -41,10 +41,10 @@ ViewSliders::ViewSliders(TQWidget* parent, const char* name, const TQString & ca : ViewBase(parent, name, caption, mixer, WStyle_Customize|WStyle_NoBorder, vflags) { if ( _vflags & ViewBase::Vertical ) { - _layoutMDW = new TQVBoxLayout(this); + _layoutMDW = new TQHBoxLayout(this); } else { - _layoutMDW = new TQHBoxLayout(this); + _layoutMDW = new TQVBoxLayout(this); } /* * Do not call init(). Call init() only for "end usage" classes. @@ -85,7 +85,7 @@ int ViewSliders::advice() { TQWidget* ViewSliders::add(MixDevice *md) { - Qt::Orientation orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical; + TQt::Orientation orientation = (_vflags & ViewBase::Vertical) ? TQt::Vertical : TQt::Horizontal; MixDeviceWidget *mdw = new MDWSlider( _mixer, // the mixer for this device diff --git a/kmix/viewsliders.h b/kmix/viewsliders.h index ce282247..6bded967 100644 --- a/kmix/viewsliders.h +++ b/kmix/viewsliders.h @@ -9,7 +9,7 @@ class Mixer; class ViewSliders : public ViewBase { - Q_OBJECT + TQ_OBJECT public: ViewSliders(TQWidget* parent, const char* name, const TQString & caption, Mixer* mixer, ViewBase::ViewFlags vflags); diff --git a/kmix/viewsurround.cpp b/kmix/viewsurround.cpp index 27cc1635..a7ab291c 100644 --- a/kmix/viewsurround.cpp +++ b/kmix/viewsurround.cpp @@ -102,7 +102,7 @@ int ViewSurround::advice() { TQWidget* ViewSurround::add(MixDevice *md) { bool small = false; - Qt::Orientation orientation = Qt::Vertical; + TQt::Orientation orientation = TQt::Vertical; switch ( md->type() ) { case MixDevice::VOLUME: _mdSurroundFront = md; @@ -113,22 +113,22 @@ TQWidget* ViewSurround::add(MixDevice *md) small = true; break; case MixDevice::SURROUND_LFE: - orientation = Qt::Horizontal; + orientation = TQt::Horizontal; small = true; break; case MixDevice::SURROUND_CENTERFRONT: - orientation = Qt::Horizontal; + orientation = TQt::Horizontal; small = true; break; case MixDevice::SURROUND_CENTERBACK: - orientation = Qt::Horizontal; + orientation = TQt::Horizontal; small = true; break; default: small = false; // these are the sliders on the left side of the surround View - orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical; + orientation = (_vflags & ViewBase::Vertical) ? TQt::Horizontal : TQt::Vertical; } // switch(type) MixDeviceWidget *mdw = createMDW(md, small, orientation); @@ -183,7 +183,7 @@ void ViewSurround::constructionFinished() { _layoutSurround->addWidget(personLabel ,rowOfSpeaker, 2, TQt::AlignHCenter | TQt::AlignVCenter); if ( _mdSurroundFront != 0 ) { - MixDeviceWidget *mdw = createMDW(_mdSurroundFront, true, Qt::Vertical); + MixDeviceWidget *mdw = createMDW(_mdSurroundFront, true, TQt::Vertical); _layoutSurround->addWidget(mdw,0,4, TQt::AlignBottom | TQt::AlignRight); _mdws.append(mdw); @@ -200,7 +200,7 @@ void ViewSurround::constructionFinished() { } if ( _mdSurroundBack != 0 ) { - MixDeviceWidget *mdw = createMDW(_mdSurroundBack, true, Qt::Vertical); + MixDeviceWidget *mdw = createMDW(_mdSurroundBack, true, TQt::Vertical); _layoutSurround->addWidget(mdw,2,4, TQt::AlignTop | TQt::AlignRight); _mdws.append(mdw); @@ -251,7 +251,7 @@ void ViewSurround::refreshVolumeLevels() { } -MixDeviceWidget* ViewSurround::createMDW(MixDevice *md, bool small, Qt::Orientation orientation) +MixDeviceWidget* ViewSurround::createMDW(MixDevice *md, bool small, TQt::Orientation orientation) { MixDeviceWidget* mdw = new MDWSlider( _mixer, // the mixer for this device diff --git a/kmix/viewsurround.h b/kmix/viewsurround.h index 32903f6b..df79ac8a 100644 --- a/kmix/viewsurround.h +++ b/kmix/viewsurround.h @@ -12,7 +12,7 @@ class Mixer; class ViewSurround : public ViewBase { - Q_OBJECT + TQ_OBJECT public: ViewSurround(TQWidget* parent, const char* name, const TQString & caption, Mixer* mixer, ViewBase::ViewFlags vflags); @@ -30,7 +30,7 @@ public slots: virtual void refreshVolumeLevels(); private: - MixDeviceWidget* createMDW(MixDevice *md, bool small, Qt::Orientation orientation); + MixDeviceWidget* createMDW(MixDevice *md, bool small, TQt::Orientation orientation); MixDevice *_mdSurroundFront; MixDevice *_mdSurroundBack; diff --git a/kmix/viewswitches.cpp b/kmix/viewswitches.cpp index 06b346e5..be364d55 100644 --- a/kmix/viewswitches.cpp +++ b/kmix/viewswitches.cpp @@ -36,19 +36,22 @@ ViewSwitches::ViewSwitches(TQWidget* parent, const char* name, const TQString & { // Create switch buttonGroup if ( _vflags & ViewBase::Vertical ) { - _layoutMDW = new TQVBoxLayout(this); - _layoutSwitch = new TQVBoxLayout(_layoutMDW); + _layoutMDW = new TQHBoxLayout(this); + _layoutSwitch = new TQHBoxLayout(_layoutMDW); _layoutEnum = new TQVBoxLayout(_layoutMDW); // always vertical! } else { - _layoutMDW = new TQHBoxLayout(this); - _layoutSwitch = new TQHBoxLayout(_layoutMDW); + _layoutMDW = new TQVBoxLayout(this); + _layoutSwitch = new TQVBoxLayout(_layoutMDW); // Place enums right from the switches: This is done, so that there will be no // ugly space on the left side, when no Switch is shown. // Actually it is not really clear yet, why there is empty space at all: There are 0 items in // the _layoutEnum, so it might be a sizeHint() or some other subtle layout issue. _layoutEnum = new TQVBoxLayout(_layoutMDW); - } + } + _layoutSwitch->setSpacing(10); + _layoutEnum->setSpacing(10); + _layoutMDW->setMargin(10); init(); } @@ -88,7 +91,7 @@ TQWidget* ViewSwitches::add(MixDevice *md) MixDeviceWidget *mdw; if ( md->isEnum() ) { - Qt::Orientation orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical; + TQt::Orientation orientation = (_vflags & ViewBase::Vertical) ? TQt::Vertical : TQt::Horizontal; mdw = new MDWEnum( _mixer, // the mixer for this device md, // MixDevice (parameter) @@ -101,7 +104,7 @@ TQWidget* ViewSwitches::add(MixDevice *md) } // an enum else { // must be a switch - Qt::Orientation orientation = (_vflags & ViewBase::Vertical) ? Qt::Horizontal : Qt::Vertical; + TQt::Orientation orientation = (_vflags & ViewBase::Vertical) ? TQt::Vertical : TQt::Horizontal; mdw = new MDWSwitch( _mixer, // the mixer for this device @@ -124,6 +127,9 @@ TQSize ViewSwitches::sizeHint() const { } void ViewSwitches::constructionFinished() { + if (_vflags & ViewBase::Horizontal) { + static_cast<TQBoxLayout*>(_layoutMDW)->addStretch(); + } configurationUpdate(); // also does _layoutMDW->activate(); } diff --git a/kmix/viewswitches.h b/kmix/viewswitches.h index cf0d8360..6b5ec27a 100644 --- a/kmix/viewswitches.h +++ b/kmix/viewswitches.h @@ -9,8 +9,8 @@ class Mixer; class ViewSwitches : public ViewBase { - Q_OBJECT - + TQ_OBJECT + public: ViewSwitches(TQWidget* parent, const char* name, const TQString & caption, Mixer* mixer, ViewBase::ViewFlags vflags); ~ViewSwitches(); diff --git a/kmix/volume.h b/kmix/volume.h index 9051ed0c..8f3b8537 100644 --- a/kmix/volume.h +++ b/kmix/volume.h @@ -1,4 +1,3 @@ -// -*-C++-*- #ifndef VOLUME_H #define VOLUME_H |