-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathppconverterdialog.py
55 lines (49 loc) · 2.28 KB
/
ppconverterdialog.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
# -*- coding: utf-8 -*-
"""
/***************************************************************************
PPConverterDialog
A QGIS plugin
Plugin to convert files created with PP
-------------------
begin : 2013-04-03
copyright : (C) 2013 by Nils Müller-Scheeßel
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* 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 import QtCore, QtGui
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from ui_ppconverter import Ui_PPConverter
# create the dialog for zoom to point
class PPConverterDialog(QDialog, Ui_PPConverter):
def __init__(self):
QDialog.__init__(self)
# Set up the user interface from Designer.
self.ui = Ui_PPConverter()
self.setupUi(self)
QObject.connect(self.outButton, SIGNAL("clicked()"), self.outFile)
QObject.connect(self.inButton, SIGNAL("clicked()"), self.inFile)
def outFile(self):
self.outTiff.clear()
fileDialog = QFileDialog()
fileDialog.setConfirmOverwrite(False)
dst_filepath = fileDialog.getSaveFileName(self, SaveGeoTIFF, '', "TIFF (*.tif)")
outPath = QFileInfo(dst_filepath).absoluteFilePath()
if outPath.right(4) != ".tif":
outPath = outPath + ".tif"
if not dst_filepath.isEmpty():
self.outFile.clear()
self.outFile.insert(outPath)
def inFile(self):
self.inTiff.clear()
fileDialog = QFileDialog()
src_filepath = fileDialog.getOpenFileName(None, LocateImage)