Skip to content

Commit 73e68db

Browse files
committed
grant roles and install demodata
1 parent 767914b commit 73e68db

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

oqtopus/gui/main_dialog.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,12 @@ def __initGuiDatabase(self):
171171

172172
actionCreateDb = QAction(self.tr("Create database"), db_operations_menu)
173173
self.__actionDuplicateDb = QAction(self.tr("Duplicate database"), db_operations_menu)
174-
actionCreateAndGrantRoles = QAction(self.tr("Create and grant roles"), db_operations_menu)
175174

176175
actionCreateDb.triggered.connect(self.__createDatabaseClicked)
177176
self.__actionDuplicateDb.triggered.connect(self.__duplicateDatabaseClicked)
178-
actionCreateAndGrantRoles.triggered.connect(self.__createAndGrantRolesClicked)
179177

180178
db_operations_menu.addAction(actionCreateDb)
181179
db_operations_menu.addAction(self.__actionDuplicateDb)
182-
db_operations_menu.addAction(actionCreateAndGrantRoles)
183180

184181
self.db_operations_toolButton.setMenu(db_operations_menu)
185182

@@ -681,10 +678,14 @@ def __installModuleClicked(self):
681678
parameters={"SRID": srid},
682679
)
683680
with OverrideCursor(Qt.CursorShape.WaitCursor):
684-
upgrader.install()
681+
upgrader.install(
682+
roles=self.db_parameters_CreateAndGrantRoles_checkBox.isChecked(),
683+
grant=self.db_parameters_CreateAndGrantRoles_checkBox.isChecked(),
684+
demo_data=self.db_parameters_DemoData_checkBox.isChecked(),
685+
)
685686
except Exception as exception:
686687
CriticalMessageBox(
687-
self.tr("Error"), self.tr("Can't install/upgrade module:"), exception, self
688+
self.tr("Error"), self.tr("Can't install the module:"), exception, self
688689
).exec()
689690
return
690691

@@ -716,16 +717,6 @@ def __upgradeModuleClicked(self):
716717

717718
raise NotImplementedError("Upgrade module is not implemented yet")
718719

719-
def __createAndGrantRolesClicked(self):
720-
721-
if self.__pum_config is None:
722-
CriticalMessageBox(
723-
self.tr("Error"), self.tr("No valid module available."), None, self
724-
).exec()
725-
return
726-
727-
raise NotImplementedError("Create and grant roles is not implemented yet")
728-
729720
def __projectInstallClicked(self):
730721

731722
if self.__current_module is None:

oqtopus/ui/main_dialog.ui

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,23 @@
593593
</property>
594594
</widget>
595595
</item>
596+
<item row="1" column="0" colspan="2">
597+
<widget class="QCheckBox" name="db_parameters_CreateAndGrantRoles_checkBox">
598+
<property name="text">
599+
<string>Create and grant roles</string>
600+
</property>
601+
<property name="checked">
602+
<bool>true</bool>
603+
</property>
604+
</widget>
605+
</item>
606+
<item row="2" column="0" colspan="2">
607+
<widget class="QCheckBox" name="checkBox">
608+
<property name="text">
609+
<string>Install demo data</string>
610+
</property>
611+
</widget>
612+
</item>
596613
</layout>
597614
</widget>
598615
</item>

0 commit comments

Comments
 (0)