-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleExport_dialog.py
More file actions
96 lines (74 loc) · 4.22 KB
/
ModuleExport_dialog.py
File metadata and controls
96 lines (74 loc) · 4.22 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# -*- coding: utf-8 -*-
"""
/***************************************************************************
ModuleExportDialog
A QGIS plugin
export
-------------------
begin : 2016-04-14
git sha : $Format:%H$
copyright : (C) 2016 by Loic Martel
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. *
* *
***************************************************************************/
"""
import os
from PyQt4 import QtGui, uic
from PyQt4.Qt import QDateEdit, QPushButton
from PyQt4.QtGui import QProgressBar
FORM_CLASS, _ = uic.loadUiType(os.path.join(
os.path.dirname(__file__), 'ModuleExport_dialog_base.ui'))
class ModuleExportDialog(QtGui.QDialog, FORM_CLASS):
def __init__(self, iface, parent=None):
"""Constructor."""
super(ModuleExportDialog, self).__init__(parent)
# Set up the user interface from Designer.
# After setupUI you can access any designer object by doing
# self.<objectname>, and you can use autoconnect slots - see
# http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html
# #widgets-and-dialogs-with-auto-connect
self.setupUi(self)
self.iface = iface
#Forcer le passage en premeir plan
self.setModal(1)
#Méthodes pour passer les dates en format annee ou jour
self.date_min_pec.setDisplayFormat('yyyy')
self.date_max_pec.setDisplayFormat('yyyy')
self.radioSaisie.toggled.connect(lambda: self.date_min_pec.setDisplayFormat('dd-MM-yyyy'))
self.radioSaisie.toggled.connect(lambda: self.date_max_pec.setDisplayFormat('dd-MM-yyyy'))
self.radioObs.toggled.connect(lambda: self.date_min_pec.setDisplayFormat('yyyy'))
self.radioObs.toggled.connect(lambda: self.date_max_pec.setDisplayFormat('yyyy'))
self.radioSaisie.toggle()
#self.ButtonFlore.setEnabled(0)
#Méthodes pour afficher ou faire disparaitre les boutons de selection d especes..
self.rad_all_espece.toggled.connect(lambda: self.ButtonFlore.hide())
self.rad_all_espece.toggled.connect(lambda: self.ButtonFaune.hide())
self.rad_all_espece.toggled.connect(lambda: self.checkFlore.hide())
self.rad_all_espece.toggled.connect(lambda: self.checkFaune.hide())
self.rad_slc_espece.toggled.connect(lambda: self.ButtonFaune.show())
self.rad_slc_espece.toggled.connect(lambda: self.ButtonFlore.show())
self.rad_slc_espece.toggled.connect(lambda: self.checkFlore.show())
self.rad_slc_espece.toggled.connect(lambda: self.checkFaune.show())
self.rad_all_espece.toggle()
self.checkFlore.clicked.connect(lambda: self.griser_bouton(self.ButtonFlore))
self.checkFaune.clicked.connect(lambda: self.griser_bouton(self.ButtonFaune))
# Rendre le bouton d'export plus explicite.
self.buttonLaunch.setStyleSheet('QPushButton {background-color: #CCF390;font-weight: bold}')
self.killButton.setStyleSheet('QPushButton {background-color: #FC9D9A;font-weight: bold}')
self.buttonCleanExport.setStyleSheet('QPushButton {background-color: #FC9D9A;font-weight: bold}')
self.checkClean.setStyleSheet('QCheckBox{font-weight: bold}')
#Cacher la progressbar
self.progressBar.hide()
self.avancee.hide()
def griser_bouton(self, monbouton):
if monbouton.isEnabled()== True:
return monbouton.setEnabled(0)
else:
return monbouton.setEnabled(1)