From 0f2b4edb2fc4c631a537f32d6b1fa538c0927848 Mon Sep 17 00:00:00 2001 From: DamnBack Date: Wed, 10 Jan 2018 19:43:42 +0100 Subject: [PATCH] Fix for issue #7. --- QGIS Plugin/metadata.txt | 6 +- QGIS Plugin/projectselector.py | 16 ++- QGIS Plugin/projectselectordialog.py | 10 +- QGIS Plugin/settingsdialog.py | 15 +-- QGIS Plugin/templateselectordialog.py | 30 +++++- QGIS Plugin/ui_projectselector.py | 72 ------------- QGIS Plugin/ui_settings.py | 80 -------------- QGIS Plugin/ui_settings.ui | 16 ++- QGIS Plugin/ui_templateselector.py | 144 -------------------------- 9 files changed, 63 insertions(+), 326 deletions(-) delete mode 100644 QGIS Plugin/ui_projectselector.py delete mode 100644 QGIS Plugin/ui_settings.py delete mode 100644 QGIS Plugin/ui_templateselector.py diff --git a/QGIS Plugin/metadata.txt b/QGIS Plugin/metadata.txt index f244bda..81964b1 100644 --- a/QGIS Plugin/metadata.txt +++ b/QGIS Plugin/metadata.txt @@ -13,7 +13,7 @@ name=Project Selector qgisMinimumVersion=2.0 qgisMaximumVersion=2.99 description=Tool for selecting pre-defined QGIS projects. -version=1.2.0 +version=1.2.1 author=Dartmoor National Park Authority email=gi@dartmoor.gov.uk about=Tools for simplifying and automating common tasks for national parks and other protected areas. Catchy name courtesy of Dartmoor National Park, UK. @@ -24,7 +24,9 @@ about=Tools for simplifying and automating common tasks for national parks and o # Uncomment the following line and add your changelog entries: -changelog=1.2.0 - New features: +changelog=1.2.1 - New features: + - Added checkbox for using only identifiable layers in legend compositions +

1.2.0 - New features: - Added ability to enable / disable project selector through settings

1.1.4 - New features: - Added option for setting custom dpi values for printing diff --git a/QGIS Plugin/projectselector.py b/QGIS Plugin/projectselector.py index b9b19a9..1d123f8 100644 --- a/QGIS Plugin/projectselector.py +++ b/QGIS Plugin/projectselector.py @@ -20,6 +20,7 @@ ***************************************************************************/ """ # Import the PyQt and QGIS libraries +import os.path from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * @@ -29,10 +30,9 @@ from projectselectordialog import * from templateselectordialog import * from settingsdialog import * -import os.path -class ProjectSelector: +class ProjectSelector(object): def __init__(self, iface): # Save reference to the QGIS interface @@ -54,12 +54,10 @@ def __init__(self, iface): def initGui(self): # Create action that will start plugin configuration - self.projectSelectorAction = QAction( - QIcon(":/plugins/projectselector/icon.png"), - u"Project Selector", self.iface.mainWindow()) - self.templateSelectorAction = QAction( - QIcon(":/plugins/projectselector/template_selector_icon.png"), - u"Template Selector", self.iface.mainWindow()) + self.projectSelectorAction = QAction(QIcon(":/plugins/projectselector/icon.png"), + u"Project Selector", self.iface.mainWindow()) + self.templateSelectorAction = QAction(QIcon(":/plugins/projectselector/template_selector_icon.png"), + u"Template Selector", self.iface.mainWindow()) self.configureAction = QAction(u"Configure Moor Tools", self.iface.mainWindow()) # connect the action to the run method self.projectSelectorAction.triggered.connect(self.selectProject) @@ -74,7 +72,7 @@ def initGui(self): self.iface.addPluginToMenu(u"&Moor Tools", self.configureAction) # Connect the dialog to QGIS' initializationCompleted() signal - QObject.connect( self.iface, SIGNAL("initializationCompleted()"), self.onInitializationCompleted ) + QObject.connect(self.iface, SIGNAL("initializationCompleted()"), self.onInitializationCompleted ) def unload(self): # Disconnect the dialog to QGIS' initializationCompleted() signal diff --git a/QGIS Plugin/projectselectordialog.py b/QGIS Plugin/projectselectordialog.py index cafe179..9fc03f4 100644 --- a/QGIS Plugin/projectselectordialog.py +++ b/QGIS Plugin/projectselectordialog.py @@ -20,11 +20,11 @@ ***************************************************************************/ """ import os - -from PyQt4 import QtCore, QtGui -from ui_projectselector import Ui_ProjectSelector +from PyQt4 import QtCore, QtGui, uic # create the dialog for zoom to point +ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ui_projectselector.ui') + class ProjectSelectorException(Exception): pass @@ -35,10 +35,10 @@ class ProjectSelectorDialog(QtGui.QDialog): def __init__(self, iface): self.iface = iface + QtGui.QDialog.__init__(self) # Set up the user interface from Designer. - self.ui = Ui_ProjectSelector() - self.ui.setupUi(self) + self.ui = uic.loadUi(ui_file, self) self.plugin_dir = os.path.dirname(__file__) # import pydevd; pydevd.settrace() diff --git a/QGIS Plugin/settingsdialog.py b/QGIS Plugin/settingsdialog.py index f5554dd..5877c56 100644 --- a/QGIS Plugin/settingsdialog.py +++ b/QGIS Plugin/settingsdialog.py @@ -20,15 +20,15 @@ ***************************************************************************/ """ -from PyQt4 import QtCore, QtGui -from ui_settings import Ui_Dialog -# create the dialog for zoom to point - import os +from PyQt4 import QtCore, QtGui, uic +# create the dialog for zoom to point PARENT_DIR = os.path.dirname(os.path.abspath(__file__)) DEFAULTS = os.path.join(PARENT_DIR, 'defaults.txt') +ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ui_settings.ui') + class SettingsDialog(QtGui.QDialog): @@ -36,8 +36,7 @@ def __init__(self): QtGui.QDialog.__init__(self) # Set up the user interface from Designer. - self.ui = Ui_Dialog() - self.ui.setupUi(self) + self.ui = uic.loadUi(ui_file, self) self.settings = QtCore.QSettings() @@ -48,7 +47,9 @@ def __init__(self): self.ui.projectsFolderLineEdit.setText(projects) self.ui.templateRootLineEdit.setText(templates) project_selector_enabled = self.settings.value("MoorTools/ProjectSelector/isEnabled", True, type=bool) + identifiable_only = self.settings.value("MoorTools/ProjectSelector/identifiableOnly", True, type=bool) self.ui.projectSelectorEnabledCheckBox.setChecked(project_selector_enabled) + self.ui.identifiableOnly.setChecked(identifiable_only) def browseForProjectRoot(self): startingDir = str(self.settings.value("MoorTools/ProjectSelector/projectRoot", os.path.expanduser("~"), type=str)) @@ -72,4 +73,6 @@ def accept(self): paths.write('templates:{}\n'.format(templates)) project_selector_enabled = self.ui.projectSelectorEnabledCheckBox.isChecked() self.settings.setValue("MoorTools/ProjectSelector/isEnabled", project_selector_enabled) + identifiable_only = self.ui.identifiableOnly.isChecked() + self.settings.setValue("MoorTools/ProjectSelector/identifiableOnly", identifiable_only) QtGui.QDialog.accept(self) diff --git a/QGIS Plugin/templateselectordialog.py b/QGIS Plugin/templateselectordialog.py index d43e113..4f7b52a 100644 --- a/QGIS Plugin/templateselectordialog.py +++ b/QGIS Plugin/templateselectordialog.py @@ -20,10 +20,9 @@ ***************************************************************************/ """ -from PyQt4 import QtCore, QtGui, QtXml +from PyQt4 import QtCore, QtGui, QtXml, uic from qgis.core import * from qgis.gui import * -from ui_templateselector import Ui_TemplateSelector from math import ceil # create the dialog for zoom to point @@ -33,6 +32,8 @@ from xml.etree import ElementTree as ET from xy_to_osgb import xy_to_osgb +ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ui_templateselector.ui') + class TemplateSelectorException(Exception): pass @@ -49,11 +50,11 @@ def __init__(self, iface): self.iface = iface QtGui.QDialog.__init__(self) # Set up the user interface from Designer. - self.ui = Ui_TemplateSelector() - self.ui.setupUi(self) + self.ui = uic.loadUi(ui_file, self) # Set up the list of templates s = QtCore.QSettings() + self.identifiable_only = s.value("MoorTools/ProjectSelector/identifiableOnly", True, type=bool) self.templateFileRoot = s.value("MoorTools/TemplateSelector/templateRoot", '', type=str) if len(self.templateFileRoot) == 0 or not os.path.isdir(self.templateFileRoot): raise TemplateSelectorException('\'%s\' is not a valid template file root folder.' % self.templateFileRoot) @@ -259,6 +260,24 @@ def fetchComposerMapNames(self): i += 1 return composerNames + def set_legend_compositions(self, composerView): + non_ident = QgsProject.instance().nonIdentifiableLayers() + self.legend_tree_root = QgsLayerTreeGroup() + layer_nodes = [] + + for lyr in self.iface.mapCanvas().layers(): + if lyr.id() not in non_ident: + layer_nodes.append(QgsLayerTreeLayer(lyr)) + + self.legend_tree_root.insertChildNodes(-1, layer_nodes) + # update the model + for item in composerView.composition().items(): + if not isinstance(item, QgsComposerLegend): + continue + legend_model = item.modelV2() + legend_model.setRootGroup(self.legend_tree_root) + item.synchronizeWithModel() + def getQptFilePath(self): try: qptFilePath = os.path.join(self.templateFileRoot, @@ -378,7 +397,8 @@ def openTemplate(self): return # Update the ComposerMap cached images of all ComposerMaps - + if self.identifiable_only: + self.set_legend_compositions(composerView) for i in range(len(self.maps_properties)): compMap = composerView.composition().getComposerMapById(i) values = self.maps_properties[compMap.displayName()] diff --git a/QGIS Plugin/ui_projectselector.py b/QGIS Plugin/ui_projectselector.py deleted file mode 100644 index 2093647..0000000 --- a/QGIS Plugin/ui_projectselector.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui_projectselector.ui' -# -# Created: Wed Nov 25 15:28:52 2015 -# by: PyQt4 UI code generator 4.10.2 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) -except AttributeError: - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) - -class Ui_ProjectSelector(object): - def setupUi(self, ProjectSelector): - ProjectSelector.setObjectName(_fromUtf8("ProjectSelector")) - ProjectSelector.setWindowModality(QtCore.Qt.ApplicationModal) - ProjectSelector.resize(470, 285) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(ProjectSelector.sizePolicy().hasHeightForWidth()) - ProjectSelector.setSizePolicy(sizePolicy) - ProjectSelector.setModal(True) - self.gridLayout = QtGui.QGridLayout(ProjectSelector) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.formLayout = QtGui.QFormLayout() - self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) - self.formLayout.setObjectName(_fromUtf8("formLayout")) - self.label = QtGui.QLabel(ProjectSelector) - self.label.setObjectName(_fromUtf8("label")) - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label) - self.projectGroupComboBox = QtGui.QComboBox(ProjectSelector) - self.projectGroupComboBox.setObjectName(_fromUtf8("projectGroupComboBox")) - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.projectGroupComboBox) - self.label_2 = QtGui.QLabel(ProjectSelector) - self.label_2.setObjectName(_fromUtf8("label_2")) - self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_2) - self.selectedProjectListWidget = QtGui.QListWidget(ProjectSelector) - self.selectedProjectListWidget.setObjectName(_fromUtf8("selectedProjectListWidget")) - self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.selectedProjectListWidget) - self.gridLayout.addLayout(self.formLayout, 0, 0, 1, 1) - self.buttonBox = QtGui.QDialogButtonBox(ProjectSelector) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1) - - self.retranslateUi(ProjectSelector) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), ProjectSelector.reject) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), ProjectSelector.loadProject) - QtCore.QObject.connect(self.projectGroupComboBox, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(int)")), ProjectSelector.onProjectGroupChanged) - QtCore.QMetaObject.connectSlotsByName(ProjectSelector) - ProjectSelector.setTabOrder(self.projectGroupComboBox, self.buttonBox) - - def retranslateUi(self, ProjectSelector): - ProjectSelector.setWindowTitle(_translate("ProjectSelector", "Select Project", None)) - self.label.setText(_translate("ProjectSelector", "Project Groups", None)) - self.label_2.setText(_translate("ProjectSelector", "Selected Project", None)) - diff --git a/QGIS Plugin/ui_settings.py b/QGIS Plugin/ui_settings.py deleted file mode 100644 index e054234..0000000 --- a/QGIS Plugin/ui_settings.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui_settings.ui' -# -# Created: Tue Dec 12 09:20:31 2017 -# by: PyQt4 UI code generator 4.10.2 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) -except AttributeError: - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName(_fromUtf8("Dialog")) - Dialog.resize(428, 156) - self.gridLayout_2 = QtGui.QGridLayout(Dialog) - self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.gridLayout = QtGui.QGridLayout() - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.projectsFolderLabel = QtGui.QLabel(Dialog) - self.projectsFolderLabel.setObjectName(_fromUtf8("projectsFolderLabel")) - self.gridLayout.addWidget(self.projectsFolderLabel, 0, 0, 1, 1) - self.projectsFolderLineEdit = QtGui.QLineEdit(Dialog) - self.projectsFolderLineEdit.setObjectName(_fromUtf8("projectsFolderLineEdit")) - self.gridLayout.addWidget(self.projectsFolderLineEdit, 0, 1, 1, 1) - self.templateRootPushButton = QtGui.QPushButton(Dialog) - self.templateRootPushButton.setObjectName(_fromUtf8("templateRootPushButton")) - self.gridLayout.addWidget(self.templateRootPushButton, 1, 2, 1, 1) - self.projectsFolderPushButton = QtGui.QPushButton(Dialog) - self.projectsFolderPushButton.setObjectName(_fromUtf8("projectsFolderPushButton")) - self.gridLayout.addWidget(self.projectsFolderPushButton, 0, 2, 1, 1) - self.templateRootLineEdit = QtGui.QLineEdit(Dialog) - self.templateRootLineEdit.setObjectName(_fromUtf8("templateRootLineEdit")) - self.gridLayout.addWidget(self.templateRootLineEdit, 1, 1, 1, 1) - self.templateRootLabel = QtGui.QLabel(Dialog) - self.templateRootLabel.setObjectName(_fromUtf8("templateRootLabel")) - self.gridLayout.addWidget(self.templateRootLabel, 1, 0, 1, 1) - self.projectSelectorEnabledCheckBox = QtGui.QCheckBox(Dialog) - self.projectSelectorEnabledCheckBox.setChecked(True) - self.projectSelectorEnabledCheckBox.setTristate(False) - self.projectSelectorEnabledCheckBox.setObjectName(_fromUtf8("projectSelectorEnabledCheckBox")) - self.gridLayout.addWidget(self.projectSelectorEnabledCheckBox, 2, 0, 1, 3) - self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) - spacerItem = QtGui.QSpacerItem(20, 0, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_2.addItem(spacerItem, 1, 0, 1, 1) - self.buttonBox = QtGui.QDialogButtonBox(Dialog) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.gridLayout_2.addWidget(self.buttonBox, 2, 0, 1, 1) - - self.retranslateUi(Dialog) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) - QtCore.QObject.connect(self.templateRootPushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Dialog.browseForTemplateRoot) - QtCore.QObject.connect(self.projectsFolderPushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Dialog.browseForProjectRoot) - QtCore.QMetaObject.connectSlotsByName(Dialog) - - def retranslateUi(self, Dialog): - Dialog.setWindowTitle(_translate("Dialog", "Moor Tools Settings", None)) - self.projectsFolderLabel.setText(_translate("Dialog", "Projects Folder", None)) - self.templateRootPushButton.setText(_translate("Dialog", "Browse", None)) - self.projectsFolderPushButton.setText(_translate("Dialog", "Browse", None)) - self.templateRootLabel.setText(_translate("Dialog", "Folder Containing Templates", None)) - self.projectSelectorEnabledCheckBox.setText(_translate("Dialog", "Show project selector on QGIS startup", None)) - diff --git a/QGIS Plugin/ui_settings.ui b/QGIS Plugin/ui_settings.ui index 2a8be00..5e4a829 100644 --- a/QGIS Plugin/ui_settings.ui +++ b/QGIS Plugin/ui_settings.ui @@ -16,6 +16,9 @@ + + + @@ -23,9 +26,6 @@ - - - @@ -63,6 +63,16 @@ + + + + Show only identifiable items in legend + + + true + + + diff --git a/QGIS Plugin/ui_templateselector.py b/QGIS Plugin/ui_templateselector.py deleted file mode 100644 index 4236488..0000000 --- a/QGIS Plugin/ui_templateselector.py +++ /dev/null @@ -1,144 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui_templateselector.ui' -# -# Created: Thu Mar 23 18:34:27 2017 -# by: PyQt4 UI code generator 4.10.2 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) -except AttributeError: - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) - -class Ui_TemplateSelector(object): - def setupUi(self, TemplateSelector): - TemplateSelector.setObjectName(_fromUtf8("TemplateSelector")) - TemplateSelector.setWindowModality(QtCore.Qt.ApplicationModal) - TemplateSelector.resize(312, 270) - TemplateSelector.setModal(True) - self.gridLayout = QtGui.QGridLayout(TemplateSelector) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.buttonBox = QtGui.QDialogButtonBox(TemplateSelector) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Help|QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.gridLayout.addWidget(self.buttonBox, 10, 0, 1, 5) - self.poiFieldComboBox = QtGui.QComboBox(TemplateSelector) - self.poiFieldComboBox.setObjectName(_fromUtf8("poiFieldComboBox")) - self.gridLayout.addWidget(self.poiFieldComboBox, 8, 4, 1, 1) - self.poiFieldLabel = QtGui.QLabel(TemplateSelector) - self.poiFieldLabel.setObjectName(_fromUtf8("poiFieldLabel")) - self.gridLayout.addWidget(self.poiFieldLabel, 8, 3, 1, 1) - self.templateTypeComboBox = QtGui.QComboBox(TemplateSelector) - self.templateTypeComboBox.setObjectName(_fromUtf8("templateTypeComboBox")) - self.gridLayout.addWidget(self.templateTypeComboBox, 0, 1, 1, 4) - self.copyrightLabel = QtGui.QLabel(TemplateSelector) - self.copyrightLabel.setObjectName(_fromUtf8("copyrightLabel")) - self.gridLayout.addWidget(self.copyrightLabel, 7, 0, 1, 1) - self.copyrightComboBox = QtGui.QComboBox(TemplateSelector) - self.copyrightComboBox.setObjectName(_fromUtf8("copyrightComboBox")) - self.gridLayout.addWidget(self.copyrightComboBox, 7, 1, 1, 4) - self.templateTypeLabel = QtGui.QLabel(TemplateSelector) - self.templateTypeLabel.setObjectName(_fromUtf8("templateTypeLabel")) - self.gridLayout.addWidget(self.templateTypeLabel, 0, 0, 1, 1) - self.sizeLabel = QtGui.QLabel(TemplateSelector) - self.sizeLabel.setObjectName(_fromUtf8("sizeLabel")) - self.gridLayout.addWidget(self.sizeLabel, 3, 0, 1, 1) - self.sizeComboBox = QtGui.QComboBox(TemplateSelector) - self.sizeComboBox.setObjectName(_fromUtf8("sizeComboBox")) - self.gridLayout.addWidget(self.sizeComboBox, 3, 1, 1, 2) - self.orientationLabel = QtGui.QLabel(TemplateSelector) - self.orientationLabel.setObjectName(_fromUtf8("orientationLabel")) - self.gridLayout.addWidget(self.orientationLabel, 3, 3, 1, 1) - self.orientationComboBox = QtGui.QComboBox(TemplateSelector) - self.orientationComboBox.setObjectName(_fromUtf8("orientationComboBox")) - self.gridLayout.addWidget(self.orientationComboBox, 3, 4, 1, 1) - self.poiLayerLabel = QtGui.QLabel(TemplateSelector) - self.poiLayerLabel.setEnabled(True) - self.poiLayerLabel.setObjectName(_fromUtf8("poiLayerLabel")) - self.gridLayout.addWidget(self.poiLayerLabel, 8, 0, 1, 1) - spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout.addItem(spacerItem, 9, 0, 1, 1) - self.poiLayerComboBox = QtGui.QComboBox(TemplateSelector) - self.poiLayerComboBox.setEnabled(True) - self.poiLayerComboBox.setObjectName(_fromUtf8("poiLayerComboBox")) - self.gridLayout.addWidget(self.poiLayerComboBox, 8, 1, 1, 2) - self.titleLineEdit = QtGui.QLineEdit(TemplateSelector) - self.titleLineEdit.setObjectName(_fromUtf8("titleLineEdit")) - self.gridLayout.addWidget(self.titleLineEdit, 1, 1, 1, 4) - self.suitableForComboBox = QtGui.QComboBox(TemplateSelector) - self.suitableForComboBox.setObjectName(_fromUtf8("suitableForComboBox")) - self.suitableForComboBox.addItem(_fromUtf8("")) - self.suitableForComboBox.addItem(_fromUtf8("")) - self.gridLayout.addWidget(self.suitableForComboBox, 6, 1, 1, 4) - self.titleLabel = QtGui.QLabel(TemplateSelector) - self.titleLabel.setObjectName(_fromUtf8("titleLabel")) - self.gridLayout.addWidget(self.titleLabel, 1, 0, 1, 1) - self.suitableForLabel = QtGui.QLabel(TemplateSelector) - self.suitableForLabel.setObjectName(_fromUtf8("suitableForLabel")) - self.gridLayout.addWidget(self.suitableForLabel, 6, 0, 1, 1) - self.label = QtGui.QLabel(TemplateSelector) - self.label.setObjectName(_fromUtf8("label")) - self.gridLayout.addWidget(self.label, 2, 0, 1, 1) - self.subtitleLineEdit = QtGui.QLineEdit(TemplateSelector) - self.subtitleLineEdit.setObjectName(_fromUtf8("subtitleLineEdit")) - self.gridLayout.addWidget(self.subtitleLineEdit, 2, 1, 1, 4) - self.mapScalesGroupBox = QtGui.QGroupBox(TemplateSelector) - self.mapScalesGroupBox.setObjectName(_fromUtf8("mapScalesGroupBox")) - self.gridLayout_2 = QtGui.QGridLayout(self.mapScalesGroupBox) - self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.scalesGridLayout = QtGui.QGridLayout() - self.scalesGridLayout.setObjectName(_fromUtf8("scalesGridLayout")) - self.gridLayout_2.addLayout(self.scalesGridLayout, 0, 0, 1, 1) - self.gridLayout.addWidget(self.mapScalesGroupBox, 4, 0, 1, 5) - self.autofit_btn = QtGui.QPushButton(TemplateSelector) - self.autofit_btn.setObjectName(_fromUtf8("autofit_btn")) - self.gridLayout.addWidget(self.autofit_btn, 5, 4, 1, 1) - - self.retranslateUi(TemplateSelector) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), TemplateSelector.reject) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), TemplateSelector.openTemplate) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("helpRequested()")), TemplateSelector.loadHelpPage) - QtCore.QObject.connect(self.templateTypeComboBox, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(int)")), TemplateSelector.onTemplateTypeChanged) - QtCore.QObject.connect(self.sizeComboBox, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(int)")), TemplateSelector.onPaperSizeChanged) - QtCore.QObject.connect(self.orientationComboBox, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(int)")), TemplateSelector.onPaperOrientationChanged) - QtCore.QMetaObject.connectSlotsByName(TemplateSelector) - TemplateSelector.setTabOrder(self.templateTypeComboBox, self.titleLineEdit) - TemplateSelector.setTabOrder(self.titleLineEdit, self.subtitleLineEdit) - TemplateSelector.setTabOrder(self.subtitleLineEdit, self.sizeComboBox) - TemplateSelector.setTabOrder(self.sizeComboBox, self.orientationComboBox) - TemplateSelector.setTabOrder(self.orientationComboBox, self.suitableForComboBox) - TemplateSelector.setTabOrder(self.suitableForComboBox, self.copyrightComboBox) - TemplateSelector.setTabOrder(self.copyrightComboBox, self.poiLayerComboBox) - TemplateSelector.setTabOrder(self.poiLayerComboBox, self.poiFieldComboBox) - TemplateSelector.setTabOrder(self.poiFieldComboBox, self.buttonBox) - - def retranslateUi(self, TemplateSelector): - TemplateSelector.setWindowTitle(_translate("TemplateSelector", "Open Template", None)) - self.poiFieldLabel.setText(_translate("TemplateSelector", "Field Name", None)) - self.copyrightLabel.setText(_translate("TemplateSelector", "Copyright", None)) - self.templateTypeLabel.setText(_translate("TemplateSelector", "Template Type", None)) - self.sizeLabel.setText(_translate("TemplateSelector", "Size", None)) - self.orientationLabel.setText(_translate("TemplateSelector", "Orientation", None)) - self.poiLayerLabel.setText(_translate("TemplateSelector", "POI Layer", None)) - self.suitableForComboBox.setItemText(0, _translate("TemplateSelector", "Paper (High res, 300 dpi)", None)) - self.suitableForComboBox.setItemText(1, _translate("TemplateSelector", "Electronic (Low res, 96 dpi)", None)) - self.titleLabel.setText(_translate("TemplateSelector", "Title", None)) - self.suitableForLabel.setText(_translate("TemplateSelector", "Suitable for", None)) - self.label.setText(_translate("TemplateSelector", "Sub-title", None)) - self.mapScalesGroupBox.setTitle(_translate("TemplateSelector", "Composer Map Scale(s)", None)) - self.autofit_btn.setText(_translate("TemplateSelector", "Autofit", None)) -