summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2014-07-24 10:41:53 -0500
committerTimothy Pearson <[email protected]>2014-07-24 10:41:53 -0500
commite3db584672f9ec310836dada13c4ae58f3f5c3a7 (patch)
tree766fa1aa8fee5103b5d9b735df9ccd14f7404dd9
parent5a3c9e46415b103f33ccd5b848eadfb0f8b50d3d (diff)
downloadtdelibs-e3db584672f9ec310836dada13c4ae58f3f5c3a7.tar.gz
tdelibs-e3db584672f9ec310836dada13c4ae58f3f5c3a7.zip
Do not allow device link creation/modification if no device is specified
This relates to Bug 2076
-rw-r--r--tdeio/tdefile/kpropertiesdialog.cpp18
-rw-r--r--tdeio/tdefile/kpropertiesdialog.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/tdeio/tdefile/kpropertiesdialog.cpp b/tdeio/tdefile/kpropertiesdialog.cpp
index db2e8af0c..fdd72884e 100644
--- a/tdeio/tdefile/kpropertiesdialog.cpp
+++ b/tdeio/tdefile/kpropertiesdialog.cpp
@@ -2925,6 +2925,8 @@ KDevicePropsPlugin::KDevicePropsPlugin( KPropertiesDialog *_props ) : KPropsDlgP
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 @@ KDevicePropsPlugin::KDevicePropsPlugin( KPropertiesDialog *_props ) : KPropsDlgP
connect( device, TQT_SIGNAL( textChanged( const TQString & ) ),
this, TQT_SLOT( slotDeviceChanged() ) );
+
+ processLockouts();
}
KDevicePropsPlugin::~KDevicePropsPlugin()
@@ -3044,6 +3048,18 @@ KDevicePropsPlugin::~KDevicePropsPlugin()
// return i18n ("De&vice");
// }
+void KDevicePropsPlugin::processLockouts()
+{
+ if (device->currentText().stripWhiteSpace() != "")
+ {
+ properties->enableButtonOK(true);
+ }
+ else
+ {
+ properties->enableButtonOK(false);
+ }
+}
+
void KDevicePropsPlugin::updateInfo()
{
// we show it in the slot when we know the values
@@ -3061,6 +3077,8 @@ void KDevicePropsPlugin::updateInfo()
job->readDF( mountpoint->text() );
}
+
+ processLockouts();
}
void KDevicePropsPlugin::slotActivated( int index )
diff --git a/tdeio/tdefile/kpropertiesdialog.h b/tdeio/tdefile/kpropertiesdialog.h
index c67659ba7..2ff0c576d 100644
--- a/tdeio/tdefile/kpropertiesdialog.h
+++ b/tdeio/tdefile/kpropertiesdialog.h
@@ -740,6 +740,7 @@ private slots:
private:
void updateInfo();
+ void processLockouts();
private:
TQComboBox* device;