[Kst] extragear/graphics/kst/src/libkstapp
Andrew Walker
arwalker at sumusltd.com
Mon Jun 26 20:54:51 CEST 2006
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
More information about the Kst
mailing list