Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/forms/kexiformview.cpp
1 | /* This file is part of the KDE project | 1 | /* This file is part of the KDE project | ||
---|---|---|---|---|---|
2 | Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr> | 2 | Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr> | ||
3 | Copyright (C) 2004-2016 Jarosław Staniek <staniek@kde.org> | 3 | Copyright (C) 2004-2017 Jarosław Staniek <staniek@kde.org> | ||
4 | 4 | | |||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public | ||
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either | ||
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. | ||
9 | 9 | | |||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 441 Lines • ▼ Show 20 Line(s) | 452 | if (!window()->neverSaved()) { | |||
453 | // normal load | 453 | // normal load | ||
454 | QString data; | 454 | QString data; | ||
455 | if (!loadDataBlock(&data)) { | 455 | if (!loadDataBlock(&data)) { | ||
456 | return false; | 456 | return false; | ||
457 | } | 457 | } | ||
458 | if (!KFormDesigner::FormIO::loadFormFromString(form(), d->dbform, data)) { | 458 | if (!KFormDesigner::FormIO::loadFormFromString(form(), d->dbform, data)) { | ||
459 | return false; | 459 | return false; | ||
460 | } | 460 | } | ||
461 | tempData()->setDataSource(d->dbform->dataSourcePluginId(), d->dbform->dataSource()); | ||||
461 | } | 462 | } | ||
462 | 463 | | |||
463 | //"autoTabStops" property is loaded -set it within the form tree as well | 464 | //"autoTabStops" property is loaded -set it within the form tree as well | ||
464 | form()->setAutoTabStops(d->dbform->autoTabStops()); | 465 | form()->setAutoTabStops(d->dbform->autoTabStops()); | ||
465 | 466 | | |||
466 | updateAutoFieldsDataSource(); | 467 | updateAutoFieldsDataSource(); | ||
467 | updateValuesForSubproperties(); | 468 | updateValuesForSubproperties(); | ||
468 | return true; | 469 | return true; | ||
▲ Show 20 Lines • Show All 590 Lines • ▼ Show 20 Line(s) | 1059 | { | |||
1059 | Q_UNUSED(in); | 1060 | Q_UNUSED(in); | ||
1060 | } | 1061 | } | ||
1061 | 1062 | | |||
1062 | void | 1063 | void | ||
1063 | KexiFormView::updateDataSourcePage() | 1064 | KexiFormView::updateDataSourcePage() | ||
1064 | { | 1065 | { | ||
1065 | if (viewMode() == Kexi::DesignViewMode) { | 1066 | if (viewMode() == Kexi::DesignViewMode) { | ||
1066 | KPropertySet *set = form()->propertySet(); | 1067 | KPropertySet *set = form()->propertySet(); | ||
1067 | const QString dataSourcePartClass = set->propertyValue("dataSourcePartClass").toString(); | 1068 | QString dataSourcePartClass = set->propertyValue("dataSourcePartClass").toString(); | ||
1068 | const QString dataSource = set->propertyValue("dataSource").toString(); | 1069 | const QString dataSource = set->propertyValue("dataSource").toString(); | ||
1069 | formPart()->dataSourcePage()->setFormDataSource(dataSourcePartClass, dataSource); | 1070 | formPart()->dataSourcePage()->setFormDataSource(dataSourcePartClass, dataSource); | ||
1071 | if (dataSourcePartClass.isEmpty() | ||||
1072 | && !formPart()->dataSourcePage()->selectedPluginId().isEmpty()) | ||||
1073 | { | ||||
1074 | set->property("dataSourcePartClass") | ||||
1075 | .setValue(formPart()->dataSourcePage()->selectedPluginId(), | ||||
1076 | KProperty::ValueOption::IgnoreOld); | ||||
1077 | } | ||||
1070 | } | 1078 | } | ||
1071 | } | 1079 | } | ||
1072 | 1080 | | |||
1073 | void | 1081 | void | ||
1074 | KexiFormView::slotHandleDragMoveEvent(QDragMoveEvent* e) | 1082 | KexiFormView::slotHandleDragMoveEvent(QDragMoveEvent* e) | ||
1075 | { | 1083 | { | ||
1076 | #ifdef KEXI_AUTOFIELD_FORM_WIDGET_SUPPORT | 1084 | #ifdef KEXI_AUTOFIELD_FORM_WIDGET_SUPPORT | ||
1077 | if (KexiFieldDrag::canDecode(e)) { | 1085 | if (KexiFieldDrag::canDecode(e)) { | ||
▲ Show 20 Lines • Show All 223 Lines • Show Last 20 Lines |