Version: 1.2.1 (using KDE KDE 3.5.0) OS: Linux PROBLEM: In the various Edit view object dialogs the Apply button is always enabled. STEPS TO REPRODUCE: Start Kst Create a label Enter layout mode Double click on the label - the Edit Label dialog is opened RESULTS: The Apply button is enabled. EXPECTED RESULTS: The Apply button should be disabled as there no changes to apply
Created attachment 16769 [details] Proposed patch
SVN commit 555213 by arwalker: BUG:129599 Only enable the Apply when there are pending changes to view objects. M +24 -1 libkstapp/ksteditviewobjectdialog_i.cpp M +1 -0 libkstapp/ksteditviewobjectdialog_i.h M +1 -1 libkstapp/ksttoplevelview.cpp M +28 -0 libkstapp/kstviewlabel.cpp M +2 -1 libkstapp/kstviewlabel.h M +26 -0 libkstapp/kstviewlegend.cpp M +2 -1 libkstapp/kstviewlegend.h M +6 -0 libkstapp/kstviewobject.cpp M +2 -1 libkstapp/kstviewobject.h M +51 -68 libkstapp/viewlabelwidget.ui M +3 -0 libkstapp/viewlegendwidget.ui M +2 -0 libkstapp/viewlegendwidget.ui.h M +6 -2 widgets/plotlistbox.cpp M +2 -0 widgets/plotlistbox.h
SVN commit 555227 by arwalker: CCBUG:129599 Revert. Should not have been checked in. M +1 -1 ksttoplevelview.cpp --- trunk/extragear/graphics/kst/src/libkstapp/ksttoplevelview.cpp #555226:555227 @@ -1820,7 +1820,7 @@ bool KstTopLevelView::handleDoubleClick(const QPoint& pos, bool shift) { handlePress(pos, shift); if (_pressTarget) { - _pressTarget->showDialog(this, true); + _pressTarget->showDialog(this); } return true; }
SVN commit 555229 by arwalker: CCBUG:129599 Never enable Apply button when creating new object as it is not supported at that time. M +37 -15 ksteditviewobjectdialog_i.cpp --- trunk/extragear/graphics/kst/src/libkstapp/ksteditviewobjectdialog_i.cpp #555228:555229 @@ -116,7 +116,9 @@ _customWidget->reparent(_propertiesFrame, QPoint(0, 0)); _grid->addWidget(_customWidget, 0, 0); _viewObject->fillConfigWidget(_customWidget, _isNew); - _viewObject->connectConfigWidget(this, _customWidget); + if (!_isNew) { + _viewObject->connectConfigWidget(this, _customWidget); + } resize(minimumSizeHint()); return; } @@ -160,36 +162,48 @@ // insert a spinbox propertyWidget = new QSpinBox(_propertiesFrame, (propertyName+","+"value").latin1()); propertyWidget->setProperty("value", _viewObject->property(property->name())); - connect(propertyWidget, SIGNAL(valueChanged(const QString&)), this, SLOT(modified())); - connect(propertyWidget->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(valueChanged(const QString&)), this, SLOT(modified())); + connect(propertyWidget->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(modified())); + } } else if (widgetType == "KColorButton") { // insert a colorbutton propertyWidget = new KColorButton(_propertiesFrame, (propertyName+","+"color").latin1()); propertyWidget->setProperty("color", _viewObject->property(property->name())); - connect(propertyWidget, SIGNAL(changed(const QColor&)), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(changed(const QColor&)), this, SLOT(modified())); + } } else if (widgetType == "QLineEdit") { // insert a text field propertyWidget = new QLineEdit(_propertiesFrame, (propertyName+","+"text").latin1()); propertyWidget->setProperty("text", _viewObject->property(property->name())); - connect(propertyWidget, SIGNAL(textChanged(const QString&)), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(textChanged(const QString&)), this, SLOT(modified())); + } } else if (widgetType == "KURLRequester") { // insert a url requester propertyWidget = new KURLRequester(_propertiesFrame, (propertyName+","+"url").latin1()); propertyWidget->setProperty("url", _viewObject->property(property->name())); - connect(propertyWidget, SIGNAL(textChanged(const QString&)), this, SLOT(modified())); - connect(propertyWidget, SIGNAL(urlSelected(const QString&)), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(textChanged(const QString&)), this, SLOT(modified())); + connect(propertyWidget, SIGNAL(urlSelected(const QString&)), this, SLOT(modified())); + } } else if (widgetType == "PenStyleWidget") { // insert a combobox with QT pen styles QComboBox* combo = new QComboBox(_propertiesFrame, (propertyName+","+"currentItem").latin1()); fillPenStyleWidget(combo); propertyWidget = combo; propertyWidget->setProperty("currentItem", _viewObject->property(property->name())); - connect(propertyWidget, SIGNAL(activated(int)), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(activated(int)), this, SLOT(modified())); + } } else if (widgetType == "QCheckBox") { // insert a checkbox propertyWidget = new QCheckBox(_propertiesFrame, (propertyName+","+"checked").latin1()); propertyWidget->setProperty("checked", _viewObject->property(property->name())); - connect(propertyWidget, SIGNAL(pressed()), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(pressed()), this, SLOT(modified())); + } } else if (widgetType == "KDoubleSpinBox") { // insert a double num spinbox KDoubleSpinBox* input = new KDoubleSpinBox(_propertiesFrame, (propertyName+","+"value").latin1()); @@ -203,28 +217,36 @@ propertyWidget = input; propertyWidget->setProperty("value", _viewObject->property(property->name())); // need the following line because of a KDE bug causing valueChanged(double) never to be emitted - connect(propertyWidget, SIGNAL(valueChanged(int)), this, SLOT(modified())); - connect(propertyWidget, SIGNAL(valueChanged(double)), this, SLOT(modified())); - connect(propertyWidget->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(valueChanged(int)), this, SLOT(modified())); + connect(propertyWidget, SIGNAL(valueChanged(double)), this, SLOT(modified())); + connect(propertyWidget->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(modified())); + } } else if (widgetType == "KFontCombo") { // insert a font combo box propertyWidget = new KFontCombo(_propertiesFrame, (propertyName+","+"currentText").latin1()); propertyWidget->setProperty("currentText", _viewObject->property(property->name())); - connect(propertyWidget, SIGNAL(activated(int)), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(activated(int)), this, SLOT(modified())); + } } else if (widgetType == "HJustifyCombo") { // insert a combo box filled with horizontal justifications QComboBox* combo = new QComboBox(_propertiesFrame, (propertyName+","+"currentItem").latin1()); fillHJustifyWidget(combo); propertyWidget = combo; propertyWidget->setProperty("currentItem", _viewObject->property(property->name())); - connect(propertyWidget, SIGNAL(activated(int)), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(activated(int)), this, SLOT(modified())); + } } else if (widgetType == "VJustifyCombo") { // insert a combo box filled with vertical justifications QComboBox* combo = new QComboBox(_propertiesFrame, (propertyName+","+"currentItem").latin1()); fillVJustifyWidget(combo); propertyWidget = combo; propertyWidget->setProperty("currentItem", _viewObject->property(property->name())); - connect(propertyWidget, SIGNAL(activated(int)), this, SLOT(modified())); + if (!_isNew) { + connect(propertyWidget, SIGNAL(activated(int)), this, SLOT(modified())); + } } // also set any additional properties specified by metaData
SVN commit 555286 by arwalker: CCBUG:129599 Disable the Apply button when Edit Object dialog is launched. M +1 -0 ksteditviewobjectdialog_i.cpp --- trunk/extragear/graphics/kst/src/libkstapp/ksteditviewobjectdialog_i.cpp #555285:555286 @@ -82,6 +82,7 @@ if (_viewObject) { setCaption(i18n("Edit %1").arg(_viewObject->type())); } + _apply->setEnabled(false); show(); raise(); }