File tree 6 files changed +118
-16
lines changed
6 files changed +118
-16
lines changed Original file line number Diff line number Diff line change 1
- from qgis .PyQt .QtWidgets import QDialog
2
-
3
1
from arho_feature_template .core .feature_template import FeatureTemplate
2
+ from arho_feature_template .core .forms .feature_attribute_form import \
3
+ FeatureAttributeForm
4
4
5
5
6
- class AddFeatureForm (QDialog ):
6
+ class AddFeatureForm (FeatureAttributeForm ):
7
7
"""Dialog for filling and saving attribute data that opens when a new feature has been digitized."""
8
8
9
9
def __init__ (self , feature_template : FeatureTemplate ):
10
- self . feature_template = feature_template
10
+ super (). __init__ ( feature_template )
11
11
12
12
def _init_feature_attributes (self ):
13
13
# for feature_attribute in self.feature_template.feature_attributes:
Original file line number Diff line number Diff line change
1
+ from qgis .PyQt .QtWidgets import QDialog
2
+
3
+ from arho_feature_template .core .feature_template import FeatureTemplate
4
+ from arho_feature_template .qgis_plugin_tools .tools .resources import load_ui
5
+
6
+
7
+ class FeatureAttributeForm (QDialog , load_ui ("feature_attribute_form.ui" )):
8
+ """Parent class for feature forms for adding and modifying feature attribute data."""
9
+
10
+ def __init__ (self , feature_template : FeatureTemplate ):
11
+ super ().__init__ ()
12
+ self .setupUi (self )
13
+ self .feature_template = feature_template
Original file line number Diff line number Diff line change 1
-
2
1
from qgis .PyQt .QtWidgets import QWidget
3
2
4
- from arho_feature_template .core .feature_template_library import FeatureTemplateLibrary
5
- from arho_feature_template .qgis_plugin_tools .tools .resources import load_ui # noqa F401
3
+ from arho_feature_template .core .feature_template_library import \
4
+ FeatureTemplateLibrary
5
+ from arho_feature_template .qgis_plugin_tools .tools .resources import load_ui
6
6
7
7
8
- # class AddFeaturePanel(QWidget, load_ui("add_feature_panel.ui")): # NOTE: UI file does not exist yet
9
- class AddFeaturePanel (QWidget ):
8
+ class AddFeaturePanel (QWidget , load_ui ("add_feature_panel.ui" )):
10
9
"""Dock widget for selecting a feature template."""
11
10
12
11
def __init__ (self , feature_template_library : FeatureTemplateLibrary ):
13
12
super ().__init__ ()
14
- # self.setupUi(self)
13
+ self .setupUi (self )
15
14
self .initialize_from_library (feature_template_library )
16
15
17
-
18
16
def initialize_from_library (self , feature_template_library : FeatureTemplateLibrary ):
19
17
# Initialization logic
20
18
self .library = feature_template_library
Original file line number Diff line number Diff line change 8
8
from qgis .PyQt .QtWidgets import QAction , QWidget
9
9
from qgis .utils import iface
10
10
11
- from arho_feature_template .core .add_feature_panel import AddFeaturePanel
12
- from arho_feature_template .core .feature_template_library import FeatureTemplateLibrary
13
- from arho_feature_template .qgis_plugin_tools .tools .custom_logging import setup_logger , teardown_logger
14
- from arho_feature_template .qgis_plugin_tools .tools .i18n import setup_translation
15
- from arho_feature_template .qgis_plugin_tools .tools .resources import plugin_name , resources_path
11
+ from arho_feature_template .core .feature_template_library import \
12
+ FeatureTemplateLibrary
13
+ from arho_feature_template .core .panels .add_feature_panel import AddFeaturePanel
14
+ from arho_feature_template .qgis_plugin_tools .tools .custom_logging import (
15
+ setup_logger , teardown_logger )
16
+ from arho_feature_template .qgis_plugin_tools .tools .i18n import \
17
+ setup_translation
18
+ from arho_feature_template .qgis_plugin_tools .tools .resources import (
19
+ plugin_name , resources_path )
16
20
17
21
LIBRARY_JSON = resources_path ("asemakaava-template-library-test.json" )
18
22
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <ui version =" 4.0" >
3
+ <class >Form</class >
4
+ <widget class =" QWidget" name =" Form" >
5
+ <property name =" geometry" >
6
+ <rect >
7
+ <x >0</x >
8
+ <y >0</y >
9
+ <width >640</width >
10
+ <height >480</height >
11
+ </rect >
12
+ </property >
13
+ <property name =" windowTitle" >
14
+ <string >Form</string >
15
+ </property >
16
+ </widget >
17
+ <resources />
18
+ <connections />
19
+ </ui >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <ui version =" 4.0" >
3
+ <class >Dialog</class >
4
+ <widget class =" QDialog" name =" Dialog" >
5
+ <property name =" geometry" >
6
+ <rect >
7
+ <x >0</x >
8
+ <y >0</y >
9
+ <width >640</width >
10
+ <height >480</height >
11
+ </rect >
12
+ </property >
13
+ <property name =" windowTitle" >
14
+ <string >Dialog</string >
15
+ </property >
16
+ <widget class =" QDialogButtonBox" name =" buttonBox" >
17
+ <property name =" geometry" >
18
+ <rect >
19
+ <x >10</x >
20
+ <y >440</y >
21
+ <width >621</width >
22
+ <height >32</height >
23
+ </rect >
24
+ </property >
25
+ <property name =" orientation" >
26
+ <enum >Qt::Horizontal</enum >
27
+ </property >
28
+ <property name =" standardButtons" >
29
+ <set >QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set >
30
+ </property >
31
+ </widget >
32
+ </widget >
33
+ <resources />
34
+ <connections >
35
+ <connection >
36
+ <sender >buttonBox</sender >
37
+ <signal >accepted()</signal >
38
+ <receiver >Dialog</receiver >
39
+ <slot >accept()</slot >
40
+ <hints >
41
+ <hint type =" sourcelabel" >
42
+ <x >248</x >
43
+ <y >254</y >
44
+ </hint >
45
+ <hint type =" destinationlabel" >
46
+ <x >157</x >
47
+ <y >274</y >
48
+ </hint >
49
+ </hints >
50
+ </connection >
51
+ <connection >
52
+ <sender >buttonBox</sender >
53
+ <signal >rejected()</signal >
54
+ <receiver >Dialog</receiver >
55
+ <slot >reject()</slot >
56
+ <hints >
57
+ <hint type =" sourcelabel" >
58
+ <x >316</x >
59
+ <y >260</y >
60
+ </hint >
61
+ <hint type =" destinationlabel" >
62
+ <x >286</x >
63
+ <y >274</y >
64
+ </hint >
65
+ </hints >
66
+ </connection >
67
+ </connections >
68
+ </ui >
You can’t perform that action at this time.
0 commit comments