Appuyé une deuxième fois sur le plugin, je veux bien lancher la main window au lieu de la pop-up window
Bonjour,
Je suis en train de développer un python plugin sur QGIS. J'ai deux interfaces : main window quand j'appuie sur un bouton, une pop-up window s'ouvre. Mon problème est quand je ferme tout, et j'appuie une autre fois sur le plugin c'est la pop -up window qui s'ouvre au lieu de la main window. Or, je veux bien que c'est la main window qui se lance. Voilà un extrait de l'appel à la pop-window :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| def show(self):
self.project.load()
if self.project.tranus_project:
self.tranus_folder.setText(self.project.tranus_project.path)
self.activate_launch_button()
self.launch_options_TRANUS()
super(OptionsTRANUSDialog, self).show()
......
def launch_options_TRANUS(self):
self.get_checked_list()
if self.checked_list != [] :
dialog = launch_tranus_dialog.LaunchTRANUSDialog(self.checked_list,self.folder,self.tranus_binaries,parent=self)
dialog.show()
result = dialog.exec_()
self.reinitialise_checked_list() |
Voilà la classe de ma pop-up window :
Code:
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
| class LaunchTRANUSDialog(QtGui.QDialog, FORM_CLASS):
def __init__(self,checked_list,project_directory,tranus_bin_path,parent=None):
"""Constructor."""
super(LaunchTRANUSDialog, self).__init__(parent)
self.setupUi(self)
self.project = parent.project
self.proj = QgsProject.instance()
self.tranus_bin_path = tranus_bin_path
self.project_directory = project_directory
self.project = parent.project
self.checked_list = checked_list
self.is_all_checked = False
self.tabs = self.findChild(QtGui.QTabWidget, 'tabWidget')
self.proj = QgsProject.instance()
#control actions
self.tabs.blockSignals(True)
self.tabs.currentChanged.connect(self.onChange)
self.tabs.blockSignals(False)
def show(self):
self.put_tabs()
super(LaunchTRANUSDialog, self).show() |
Des pistes ? Merci.