Branch: master

e3db5846 2014-07-24 10:41:53 Timothy Pearson
Do not allow device link creation/modification if no device is specified
This relates to Bug 2076
M tdeio/tdefile/kpropertiesdialog.cpp
M tdeio/tdefile/kpropertiesdialog.h
diff --git a/tdeio/tdefile/kpropertiesdialog.cpp b/tdeio/tdefile/kpropertiesdialog.cpp
index db2e8af..fdd7288 100644
--- a/tdeio/tdefile/kpropertiesdialog.cpp
+++ b/tdeio/tdefile/kpropertiesdialog.cpp
@@ -2925,6 +2925,8 @@
                       i18n("Device:") ); // new style (combobox)
   layout->addWidget(label, 0, 0);
 
+// RAJA FIXME
+// Disable the OK button if no device is selected!
   device = new TQComboBox( true, d->m_frame, "ComboBox_device" );
   device->insertStringList( devices );
   layout->addWidget(device, 0, 1);
@@ -3032,6 +3034,8 @@
 
   connect( device, TQT_SIGNAL( textChanged( const TQString & ) ),
            this, TQT_SLOT( slotDeviceChanged() ) );
+
+  processLockouts();
 }
 
 KDevicePropsPlugin::~KDevicePropsPlugin()
@@ -3043,6 +3047,18 @@
 // {
 //   return i18n ("De&vice");
 // }
+
+void KDevicePropsPlugin::processLockouts()
+{
+  if (device->currentText().stripWhiteSpace() != "")
+  {
+    properties->enableButtonOK(true);
+  }
+  else
+  {
+    properties->enableButtonOK(false);
+  }
+}
 
 void KDevicePropsPlugin::updateInfo()
 {
@@ -3061,6 +3077,8 @@
 
     job->readDF( mountpoint->text() );
   }
+
+  processLockouts();
 }
 
 void KDevicePropsPlugin::slotActivated( int index )
diff --git a/tdeio/tdefile/kpropertiesdialog.h b/tdeio/tdefile/kpropertiesdialog.h
index c67659b..2ff0c57 100644
--- a/tdeio/tdefile/kpropertiesdialog.h
+++ b/tdeio/tdefile/kpropertiesdialog.h
@@ -740,6 +740,7 @@
 
 private:
   void updateInfo();
+  void processLockouts();
 
 private:
   TQComboBox* device;