-
Notifications
You must be signed in to change notification settings - Fork 3
/
dockableMirrorMap.py
72 lines (53 loc) · 2.19 KB
/
dockableMirrorMap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : Dockable MirrorMap
Description : Creates a dockable map canvas
Date : February 1, 2011
copyright : (C) 2011 by Giuseppe Sucameli (Faunalia)
email : brush.tyler@gmail.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from mirrorMap import MirrorMap
class DockableMirrorMap(QDockWidget):
TITLE = "MirrorMap"
def __init__(self, parent, iface):
QDockWidget.__init__(self, parent)
self.mainWidget = MirrorMap(self, iface)
self.location = Qt.RightDockWidgetArea
self.number = -1
self.setupUi()
self.connect(self, SIGNAL("dockLocationChanged(Qt::DockWidgetArea)"), self.setLocation)
def closeEvent(self, event):
self.emit( SIGNAL( "closed(PyQt_PyObject)" ), self )
return QDockWidget.closeEvent(self, event)
def setNumber(self, n=-1):
self.number = n
self.updateLabel()
def getMirror(self):
return self.mainWidget
def getLocation(self):
return self.location
def setLocation(self, location):
self.location = location
def setupUi(self):
self.setObjectName( "dockablemirrormap_dockwidget" )
self.updateLabel()
self.setWidget(self.mainWidget)
def updateLabel(self):
title = "%s #%s" % (self.TITLE, self.number) if self.number >= 0 else self.TITLE
if len(self.mainWidget.label) != 0:
title += ": " + self.mainWidget.label
self.setWindowTitle( title )