[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdemultimedia/kaudiocreator
From:       Charis Kouzinopoulos <haris () mpa ! gr>
Date:       2006-10-17 21:07:43
Message-ID: 1161119263.217291.32488.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 596565 by charis:

Only enable the "Encode File" button when the user has selected a file


 M  +9 -2      encodefile.ui  
 M  +5 -0      encodefileimp.cpp  
 M  +2 -0      encodefileimp.h  


--- branches/KDE/3.5/kdemultimedia/kaudiocreator/encodefile.ui #596564:596565
@@ -294,9 +294,15 @@
                     <property name="name">
                         <cstring>encodeButton</cstring>
                     </property>
+                    <property name="enabled">
+                        <bool>false</bool>
+                    </property>
                     <property name="text">
                         <string>&amp;Encode File</string>
                     </property>
+                    <property name="accel">
+                        <string>Alt+E</string>
+                    </property>
                 </widget>
                 <widget class="QPushButton">
                     <property name="name">
@@ -305,13 +311,14 @@
                     <property name="text">
                         <string>&amp;Close</string>
                     </property>
+                    <property name="accel">
+                        <string>Alt+C</string>
+                    </property>
                 </widget>
             </hbox>
         </widget>
     </vbox>
 </widget>
-<customwidgets>
-</customwidgets>
 <connections>
     <connection>
         <sender>closeButton</sender>
--- branches/KDE/3.5/kdemultimedia/kaudiocreator/encodefileimp.cpp #596564:596565
@@ -33,6 +33,7 @@
   // Specify to only accept wav files
   file->setFilter("*.wav|Wav Files");
 
+  connect(file,SIGNAL(textChanged(const QString &)),this,SLOT(enableEncodeButton(const QString &)));
   connect(encodeButton,SIGNAL(clicked()),this,SLOT(encode()));
 }
 
@@ -71,5 +72,9 @@
  i18n("Jobs have started"), i18n("Jobs have started"));
 }
 
+void EncodeFileImp::enableEncodeButton(const QString &text){
+  encodeButton->setEnabled(!text.isEmpty());
+}
 
+
 #include "encodefileimp.moc"
--- branches/KDE/3.5/kdemultimedia/kaudiocreator/encodefileimp.h #596564:596565
@@ -44,6 +44,8 @@
 protected slots:
   // Encode button
   void encode();
+  // Enable encode button when user selects a file
+  void enableEncodeButton(const QString &text);
 
 private:
   // List of genres and i18n versions
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic