From 909773f4a46197e655d63910d3f04546403cde9a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 24 Jul 2014 10:41:53 -0500 Subject: [PATCH] Do not allow device link creation/modification if no device is specified This relates to Bug 2076 (cherry picked from commit e3db584672f9ec310836dada13c4ae58f3f5c3a7) --- kio/kfile/kpropertiesdialog.cpp | 16 ++++++++++++++++ kio/kfile/kpropertiesdialog.h | 1 + 2 files changed, 17 insertions(+) diff --git a/kio/kfile/kpropertiesdialog.cpp b/kio/kfile/kpropertiesdialog.cpp index f3a20ab88..29eee9c34 100644 --- a/kio/kfile/kpropertiesdialog.cpp +++ b/kio/kfile/kpropertiesdialog.cpp @@ -3032,6 +3032,8 @@ KDevicePropsPlugin::KDevicePropsPlugin( KPropertiesDialog *_props ) : KPropsDlgP connect( device, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( slotDeviceChanged() ) ); + + processLockouts(); } KDevicePropsPlugin::~KDevicePropsPlugin() @@ -3044,6 +3046,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 +3075,8 @@ void KDevicePropsPlugin::updateInfo() job->readDF( mountpoint->text() ); } + + processLockouts(); } void KDevicePropsPlugin::slotActivated( int index ) diff --git a/kio/kfile/kpropertiesdialog.h b/kio/kfile/kpropertiesdialog.h index 4243bf602..fa0abec1c 100644 --- a/kio/kfile/kpropertiesdialog.h +++ b/kio/kfile/kpropertiesdialog.h @@ -740,6 +740,7 @@ private slots: private: void updateInfo(); + void processLockouts(); private: TQComboBox* device;