From e3db584672f9ec310836dada13c4ae58f3f5c3a7 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 24 Jul 2014 10:41:53 -0500 Subject: Do not allow device link creation/modification if no device is specified This relates to Bug 2076 --- tdeio/tdefile/kpropertiesdialog.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tdeio/tdefile/kpropertiesdialog.cpp') 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 ) -- cgit v1.2.1