Bug 73300 - Play... Button stays enabled when no sound file
Summary: Play... Button stays enabled when no sound file
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kab3
Classification: Miscellaneous
Component: general (show other bugs)
Version: 3.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Koenig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-23 02:52 UTC by Agron
Modified: 2009-08-05 16:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agron 2004-01-23 02:52:35 UTC
Version:           3.2 (using KDE 3.2.90 (CVS >= 20040117), compiled sources)
Compiler:          gcc version 3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)
OS:          Linux (i686) release 2.4.22-10mdk

Edit contact / misc tab / Play... button remains enabled after picking any file with Browse button and then deleting the filename from the edit-box beside the Play... button.
Comment 1 Tobias Koenig 2004-01-23 13:47:54 UTC
Subject: kdepim/kaddressbook

CVS commit by tokoe: 

Enable/Disable the play button according to the content of the URL widget.
That fixes #73300 and #73301.

CCMAIL:73300-done@bugs.kde.org,73301-done@bugs.kde.org


  M +32 -23    soundwidget.cpp   1.8
  M +20 -19    soundwidget.h   1.6


--- kdepim/kaddressbook/soundwidget.h  #1.5:1.6
@@ -1,5 +1,5 @@
 /*                                                                      
     This file is part of KAddressBook.                                  
-    Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>                   
+    Copyright (c) 2003 - 2004 Tobias Koenig <tokoe@kde.org>
                                                                         
     This program is free software; you can redistribute it and/or modify
@@ -50,4 +50,5 @@ class SoundWidget : public KAB::ContactE
     void loadSound();
     void updateGUI();
+    void urlChanged( const QString& );
 
   private:

--- kdepim/kaddressbook/soundwidget.cpp  #1.7:1.8
@@ -1,5 +1,5 @@
 /*                                                                      
     This file is part of KAddressBook.                                  
-    Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>                   
+    Copyright (c) 2003 - 2004 Tobias Koenig <tokoe@kde.org>
                                                                         
     This program is free software; you can redistribute it and/or modify
@@ -64,4 +64,6 @@ SoundWidget::SoundWidget( KABC::AddressB
   connect( mSoundUrl, SIGNAL( textChanged( const QString& ) ),
            SIGNAL( changed() ) );
+  connect( mSoundUrl, SIGNAL( textChanged( const QString& ) ),
+           SLOT( urlChanged( const QString& ) ) );
   connect( mUseSoundUrl, SIGNAL( toggled( bool ) ),
            SIGNAL( changed() ) );
@@ -159,7 +161,14 @@ void SoundWidget::loadSound()
 void SoundWidget::updateGUI()
 {
-  if ( !mReadOnly )
-    mUseSoundUrl->setEnabled( true );  
-  mPlayButton->setEnabled( true );
+  mUseSoundUrl->setEnabled( !mReadOnly );
+}
+
+void SoundWidget::urlChanged( const QString &url )
+{
+  if ( !mUseSoundUrl->isChecked() ) {
+    bool state = !url.isEmpty();
+    mPlayButton->setEnabled( state );
+    mUseSoundUrl->setEnabled( state && !mSound.isIntern() );
+  }
 }
 


Comment 2 Tobias Koenig 2009-08-05 16:03:59 UTC
The development of the old KAddressBook will be discontinued for KDE 4.4.
Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product.