SVN commit 730089 by smileaf: Only enable the import button when there is something to attempt to import. M +8 -0 adddialog.cpp M +1 -0 adddialog.h --- trunk/playground/base/autostart/adddialog.cpp #730088:730089 @@ -29,14 +29,22 @@ connect( widget->btnImport, SIGNAL(clicked()), SLOT(importPrg()) ); connect( widget->btnAdd, SIGNAL(clicked()), SLOT(addPrg()) ); connect( widget->btnCancel, SIGNAL(clicked()), SLOT(reject()) ); + connect( widget->kurlfrScript, SIGNAL(textChanged(const QString&)), SLOT(textChanged(const QString&)) ); + + widget->btnImport->setEnabled(false); } AddDialog::~AddDialog() {} +void AddDialog::textChanged(const QString &text) { + widget->btnImport->setEnabled(!text.isNull()); +} + KUrl AddDialog::importUrl() { return widget->kurlfrScript->lineEdit()->text(); } + bool AddDialog::symLink() { return (widget->chkSymlink->checkState() == Qt::Checked); } --- trunk/playground/base/autostart/adddialog.h #730088:730089 @@ -38,6 +38,7 @@ public slots: void addPrg(); void importPrg(); + void textChanged(const QString &text); private: Ui_AddDialog * widget;