-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathConfigDialog.py
55 lines (46 loc) · 1.94 KB
/
ConfigDialog.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
"""
***************************************************************************
Name : Geocoding
Description : Geocoding and reverse Geocoding using Google
Date : 2/May/13
copyright : (C) 2013 by ItOpen
email : info@itopen.it
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
"""
import os
# Import the PyQt and QGIS libraries
try:
from qgis.core import Qgis
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5 import uic
QT_VERSION=5
os.environ['QT_API'] = 'pyqt5'
except:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4 import uic
QT_VERSION=4
# create the dialog for Config
class ConfigDialog(QDialog ):
def __init__(self, caller):
super(ConfigDialog, self ).__init__()
uic.loadUi(os.path.join(os.path.dirname(__file__), 'Ui_Config.ui'), self)
# stupid qvariant return a tuple...
zoom_scale = caller.get_config('ZoomScale', 0)
# Use pdb for debugging
#import pdb
## These lines allow you to set a breakpoint in the app
#pyqtRemoveInputHook()
#pdb.set_trace()
self.ZoomScale.setValue(int(zoom_scale))
self.debugCheckBox.setChecked(caller.get_config('writeDebug', '') == True)