begin : 2013-11-05 copyright : (C) 2013 by Mikhail Titov email : mlt@gmx.us
***********************************************************************/
***********************************************************************/ This script initializes the plugin, making it known to QGIS.
Python 2 logger for multiprocessing taken from http://stackoverflow.com/questions/641420/how-should-i-log-while-using-multiprocessing-in-python
Quick & Dirty way to retrieve a hypsometry given a set of starting points and DEM.
Persistent entries dialog synopsis:
from persistent import PersistentDialog
from PyQt4.uic import loadUi
from PyQt4.QtCore import QSettings
from os.path import dirname, join
class MyDialog(PersistentDialog):
def __init__(self):
PersistentDialog.__init__(self)
loadUi(join(dirname(__file__), 'ui_mydialog.ui'), self)
self._load_settings()
def _load_settings(self):
... # extra initialization of, e.g., combo box items goes here
settings = QSettings()
settings.beginGroup('myplugin')
settings.beginGroup('mydialog')
self.loadall(settings) # magic happens here
settings.endGroup()
settings.endGroup()
def _save_settings(self):
settings = QSettings()
settings.beginGroup('myplugin')
settings.beginGroup('mydialog')
self.saveall(settings) # here is where magic happens
settings.endGroup()
settings.endGroup()
def accept(self):
super(MyDialog, self).accept()
self._save_settings()
Todo
Emit signals upon changing entries
Bases: PyQt4.QtGui.QDialog
QDialog with basic user entries persistence using QSettings
Load dialog entries once descended into necessary settings group
Save dialog entries once descended into necessary settings group