Diffstat (limited to 'core/applets/volumeapplet/volume.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/volumeapplet/volume.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp index 8fd88f6..942cebb 100644 --- a/core/applets/volumeapplet/volume.cpp +++ b/core/applets/volumeapplet/volume.cpp | |||
@@ -387,69 +387,69 @@ VolumeControl::VolumeControl ( VolumeApplet *icon, bool /*showMic*/, QWidget *pa | |||
387 | tapBox-> setFocusPolicy ( QWidget::NoFocus ); | 387 | tapBox-> setFocusPolicy ( QWidget::NoFocus ); |
388 | 388 | ||
389 | vbox-> addWidget ( tapBox, AlignVCenter | AlignLeft ); | 389 | vbox-> addWidget ( tapBox, AlignVCenter | AlignLeft ); |
390 | 390 | ||
391 | keyBox = new QCheckBox ( tr( "Key Clicks" ), this ); | 391 | keyBox = new QCheckBox ( tr( "Key Clicks" ), this ); |
392 | keyBox-> setFocusPolicy ( QWidget::NoFocus ); | 392 | keyBox-> setFocusPolicy ( QWidget::NoFocus ); |
393 | 393 | ||
394 | vbox-> addWidget ( keyBox, AlignVCenter | AlignLeft ); | 394 | vbox-> addWidget ( keyBox, AlignVCenter | AlignLeft ); |
395 | 395 | ||
396 | alarmBox = new QCheckBox ( tr( "Alarm Sound" ), this ); | 396 | alarmBox = new QCheckBox ( tr( "Alarm Sound" ), this ); |
397 | alarmBox-> setFocusPolicy ( QWidget::NoFocus ); | 397 | alarmBox-> setFocusPolicy ( QWidget::NoFocus ); |
398 | 398 | ||
399 | vbox-> addWidget ( alarmBox, AlignVCenter | AlignLeft ); | 399 | vbox-> addWidget ( alarmBox, AlignVCenter | AlignLeft ); |
400 | 400 | ||
401 | if ( has_wav_alarm ) { | 401 | if ( has_wav_alarm ) { |
402 | alarmBox-> hide ( ); | 402 | alarmBox-> hide ( ); |
403 | } | 403 | } |
404 | 404 | ||
405 | vbox-> addStretch ( 100 ); | 405 | vbox-> addStretch ( 100 ); |
406 | 406 | ||
407 | setFixedSize ( sizeHint ( )); | 407 | setFixedSize ( sizeHint ( )); |
408 | setFocusPolicy ( QWidget::NoFocus ); | 408 | setFocusPolicy ( QWidget::NoFocus ); |
409 | 409 | ||
410 | rateTimer = new QTimer( this ); | 410 | rateTimer = new QTimer( this ); |
411 | connect ( rateTimer, SIGNAL( timeout ( )), this, SLOT( rateTimerDone ( ))); | 411 | connect ( rateTimer, SIGNAL( timeout()), this, SLOT( rateTimerDone())); |
412 | 412 | ||
413 | connect ( upButton, SIGNAL( pressed ( )), this, SLOT( buttonChanged ( ))); | 413 | connect ( upButton, SIGNAL( pressed()), this, SLOT( buttonChanged())); |
414 | connect ( upButton, SIGNAL( released ( )), this, SLOT( buttonChanged ( ))); | 414 | connect ( upButton, SIGNAL( released()), this, SLOT( buttonChanged())); |
415 | connect ( downButton, SIGNAL( pressed ( )), this, SLOT( buttonChanged ( ))); | 415 | connect ( downButton, SIGNAL( pressed()), this, SLOT( buttonChanged())); |
416 | connect ( downButton, SIGNAL( released ( )), this, SLOT( buttonChanged ( ))); | 416 | connect ( downButton, SIGNAL( released()), this, SLOT( buttonChanged())); |
417 | 417 | ||
418 | connect ( micSlider, SIGNAL( valueChanged ( int )), this, SLOT( micMoved( int ))); | 418 | connect ( micSlider, SIGNAL( valueChanged(int)), this, SLOT( micMoved(int))); |
419 | connect ( volSlider, SIGNAL( valueChanged ( int )), this, SLOT( volMoved( int ))); | 419 | connect ( volSlider, SIGNAL( valueChanged(int)), this, SLOT( volMoved(int))); |
420 | connect ( alarmSlider, SIGNAL( valueChanged ( int )), this, SLOT( alarmMoved( int ))); | 420 | connect ( alarmSlider, SIGNAL( valueChanged(int)), this, SLOT( alarmMoved(int))); |
421 | connect ( bassSlider, SIGNAL( valueChanged ( int )), this, SLOT( bassMoved( int ))); | 421 | connect ( bassSlider, SIGNAL( valueChanged(int)), this, SLOT( bassMoved(int))); |
422 | connect ( trebleSlider, SIGNAL( valueChanged ( int )), this, SLOT( trebleMoved( int ))); | 422 | connect ( trebleSlider, SIGNAL( valueChanged(int)), this, SLOT( trebleMoved(int))); |
423 | 423 | ||
424 | 424 | ||
425 | connect ( volLed, SIGNAL( toggled ( bool )), this, SLOT( volMuteToggled ( bool ))); | 425 | connect ( volLed, SIGNAL( toggled(bool)), this, SLOT( volMuteToggled(bool))); |
426 | connect ( micLed, SIGNAL( toggled ( bool )), this, SLOT( micMuteToggled ( bool ))); | 426 | connect ( micLed, SIGNAL( toggled(bool)), this, SLOT( micMuteToggled(bool))); |
427 | connect ( alarmLed, SIGNAL( toggled ( bool )), this, SLOT( alarmSoundToggled ( bool ))); | 427 | connect ( alarmLed, SIGNAL( toggled(bool)), this, SLOT( alarmSoundToggled(bool))); |
428 | 428 | ||
429 | connect ( alarmBox, SIGNAL( toggled ( bool )), this, SLOT( alarmSoundToggled ( bool ))); | 429 | connect ( alarmBox, SIGNAL( toggled(bool)), this, SLOT( alarmSoundToggled(bool))); |
430 | connect ( keyBox, SIGNAL( toggled ( bool )), this, SLOT( keyClickToggled ( bool ))); | 430 | connect ( keyBox, SIGNAL( toggled(bool)), this, SLOT( keyClickToggled(bool))); |
431 | connect ( tapBox, SIGNAL( toggled ( bool )), this, SLOT( screenTapToggled ( bool ))); | 431 | connect ( tapBox, SIGNAL( toggled(bool)), this, SLOT( screenTapToggled(bool))); |
432 | 432 | ||
433 | // initialize variables | 433 | // initialize variables |
434 | 434 | ||
435 | readConfig ( true ); | 435 | readConfig ( true ); |
436 | 436 | ||
437 | // initialize the config file, in case some entries are missing | 437 | // initialize the config file, in case some entries are missing |
438 | 438 | ||
439 | writeConfigEntry ( "VolumePercent", m_vol_percent, UPD_None ); | 439 | writeConfigEntry ( "VolumePercent", m_vol_percent, UPD_None ); |
440 | writeConfigEntry ( "BassPercent", m_vol_percent, UPD_None ); | 440 | writeConfigEntry ( "BassPercent", m_vol_percent, UPD_None ); |
441 | writeConfigEntry ( "TreblePercent", m_vol_percent, UPD_None ); | 441 | writeConfigEntry ( "TreblePercent", m_vol_percent, UPD_None ); |
442 | writeConfigEntry ( "Mute", m_vol_muted, UPD_None ); | 442 | writeConfigEntry ( "Mute", m_vol_muted, UPD_None ); |
443 | writeConfigEntry ( "AlarmPercent", m_alarm_percent, UPD_None ); | 443 | writeConfigEntry ( "AlarmPercent", m_alarm_percent, UPD_None ); |
444 | writeConfigEntry ( "TouchSound", m_snd_touch, UPD_None ); | 444 | writeConfigEntry ( "TouchSound", m_snd_touch, UPD_None ); |
445 | writeConfigEntry ( "KeySound", m_snd_key, UPD_None ); | 445 | writeConfigEntry ( "KeySound", m_snd_key, UPD_None ); |
446 | writeConfigEntry ( "AlarmSound", m_snd_alarm, UPD_Vol ); | 446 | writeConfigEntry ( "AlarmSound", m_snd_alarm, UPD_Vol ); |
447 | 447 | ||
448 | writeConfigEntry ( "Mic", m_mic_percent, UPD_None ); | 448 | writeConfigEntry ( "Mic", m_mic_percent, UPD_None ); |
449 | writeConfigEntry ( "MicMute", m_mic_muted, UPD_Mic ); | 449 | writeConfigEntry ( "MicMute", m_mic_muted, UPD_Mic ); |
450 | } | 450 | } |
451 | 451 | ||
452 | bool VolumeControl::volMuted ( ) const | 452 | bool VolumeControl::volMuted ( ) const |
453 | { | 453 | { |
454 | return m_vol_muted; | 454 | return m_vol_muted; |
455 | } | 455 | } |
@@ -703,50 +703,50 @@ void VolumeControl::writeConfigEntry ( const char *entry, int val, eUpdate upd ) | |||
703 | break; | 703 | break; |
704 | } | 704 | } |
705 | case UPD_Treble: { | 705 | case UPD_Treble: { |
706 | QCopEnvelope ( "QPE/System", "trebleChange(bool)" ) << true; | 706 | QCopEnvelope ( "QPE/System", "trebleChange(bool)" ) << true; |
707 | break; | 707 | break; |
708 | } | 708 | } |
709 | 709 | ||
710 | case UPD_None: | 710 | case UPD_None: |
711 | break; | 711 | break; |
712 | } | 712 | } |
713 | #endif | 713 | #endif |
714 | } | 714 | } |
715 | 715 | ||
716 | //=========================================================================== | 716 | //=========================================================================== |
717 | 717 | ||
718 | VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) | 718 | VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) |
719 | : QWidget( parent, name ) | 719 | : QWidget( parent, name ) |
720 | { | 720 | { |
721 | setFixedWidth ( AppLnk::smallIconSize() ); | 721 | setFixedWidth ( AppLnk::smallIconSize() ); |
722 | setFixedHeight ( AppLnk::smallIconSize()+4 ); | 722 | setFixedHeight ( AppLnk::smallIconSize()+4 ); |
723 | 723 | ||
724 | m_pixmap = new QPixmap ( Resource::loadPixmap ( "volume" )); | 724 | m_pixmap = new QPixmap ( Resource::loadPixmap ( "volume" )); |
725 | m_dialog = new VolumeControl ( this, true, this, "volumecontrol" ); | 725 | m_dialog = new VolumeControl ( this, true, this, "volumecontrol" ); |
726 | 726 | ||
727 | connect ( qApp, SIGNAL( volumeChanged ( bool )), m_dialog, SLOT( volumeChanged( bool ))); | 727 | connect ( qApp, SIGNAL( volumeChanged(bool)), m_dialog, SLOT( volumeChanged(bool))); |
728 | connect ( qApp, SIGNAL( micChanged ( bool )), m_dialog, SLOT ( micChanged( bool ))); | 728 | connect ( qApp, SIGNAL( micChanged(bool)), m_dialog, SLOT ( micChanged(bool))); |
729 | } | 729 | } |
730 | 730 | ||
731 | VolumeApplet::~VolumeApplet() | 731 | VolumeApplet::~VolumeApplet() |
732 | { | 732 | { |
733 | delete m_pixmap; | 733 | delete m_pixmap; |
734 | } | 734 | } |
735 | 735 | ||
736 | int VolumeApplet::position() | 736 | int VolumeApplet::position() |
737 | { | 737 | { |
738 | return 6; | 738 | return 6; |
739 | } | 739 | } |
740 | 740 | ||
741 | void VolumeApplet::mousePressEvent ( QMouseEvent * ) | 741 | void VolumeApplet::mousePressEvent ( QMouseEvent * ) |
742 | { | 742 | { |
743 | if ( m_dialog-> isVisible ( )) | 743 | if ( m_dialog-> isVisible ( )) |
744 | m_dialog-> hide ( ); | 744 | m_dialog-> hide ( ); |
745 | else | 745 | else |
746 | m_dialog-> show ( true ); | 746 | m_dialog-> show ( true ); |
747 | } | 747 | } |
748 | 748 | ||
749 | void VolumeApplet::redraw ( bool all ) | 749 | void VolumeApplet::redraw ( bool all ) |
750 | { | 750 | { |
751 | if ( all ) | 751 | if ( all ) |
752 | repaint ( true ); | 752 | repaint ( true ); |