diff --git a/QGIS Plugin/metadata.txt b/QGIS Plugin/metadata.txt index c1a27c1..a8195f1 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.1.3 +version=1.1.4 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.1.3 - New features: +

changelog=1.1.4 - New features: + - Added option for setting custom dpi values for printing +

changelog=1.1.3 - New features: - added defaults.txt with predefined paths to projects and templates

1.1.2 - Bug fixes: - Fixed plugin crashing when choosing current map canvas scale diff --git a/QGIS Plugin/projectselectordialog.py b/QGIS Plugin/projectselectordialog.py index 9047d57..cafe179 100644 --- a/QGIS Plugin/projectselectordialog.py +++ b/QGIS Plugin/projectselectordialog.py @@ -19,13 +19,13 @@ * * ***************************************************************************/ """ -import collections import os from PyQt4 import QtCore, QtGui from ui_projectselector import Ui_ProjectSelector # create the dialog for zoom to point + class ProjectSelectorException(Exception): pass diff --git a/QGIS Plugin/settingsdialog.py b/QGIS Plugin/settingsdialog.py index ab38c61..fbdfcff 100644 --- a/QGIS Plugin/settingsdialog.py +++ b/QGIS Plugin/settingsdialog.py @@ -20,7 +20,7 @@ ***************************************************************************/ """ -from PyQt4 import QtCore, QtGui, QtXml +from PyQt4 import QtCore, QtGui from ui_settings import Ui_Dialog # create the dialog for zoom to point diff --git a/QGIS Plugin/templateselectordialog.py b/QGIS Plugin/templateselectordialog.py index 833a85e..d43e113 100644 --- a/QGIS Plugin/templateselectordialog.py +++ b/QGIS Plugin/templateselectordialog.py @@ -65,8 +65,20 @@ def __init__(self, iface): self.plugin_dir = os.path.dirname(__file__) # Replacement map + self.ui.suitableForComboBox.addItem('') self.replaceMap = {'username': os.environ['username']} self.ui.autofit_btn.clicked.connect(self.autofit_map) + self.ui.suitableForComboBox.currentIndexChanged.connect(self.specify_dpi) + self.ui.suitableForComboBox.editTextChanged.connect(self.text_changed) + + def specify_dpi(self, idx): + if idx == 2: + self.ui.suitableForComboBox.setEditable(True) + else: + self.ui.suitableForComboBox.setEditable(False) + + def text_changed(self, txt): + self.ui.suitableForComboBox.setItemText(self.ui.suitableForComboBox.currentIndex(), txt) def autofit_map(self): canvas = self.iface.mapCanvas() @@ -394,13 +406,19 @@ def openTemplate(self): compMap.updateCachedImage() # Set scale - resText = self.ui.suitableForComboBox.currentText() - dpi = 0 - if resText.startswith('Paper'): + cur_idx = self.ui.suitableForComboBox.currentIndex() + if cur_idx == 0: + # Paper dpi = 300 - else: + elif cur_idx == 1: # Electronic dpi = 96 + else: + res_text = self.ui.suitableForComboBox.currentText() + try: + dpi = int(res_text) + except TypeError: + dpi = 96 composerView.composition().setPrintResolution(dpi) # All done