def launch_report_dialog(self): try: error = self.ui.log_textEdit.toHtml() self.dialog_report = dialog_report.Main(error) build.launch_dialog_as_child(self.dialog_report) except: logger.error(str(traceback.format_exc()))
def undo(self): self.dialog_accept = dialog_accept.Main("Are you sure ?", "Do you want to undo ?", defaults._warning_) if build.launch_dialog_as_child(self.dialog_accept): self.renamer.undo() self.clear_all() self.refresh_all()
def confirm_email(self, user, email, full_name): temp_pass = str(random.randint(1000, 9999)) send_email.send_confirm(user, email, temp_pass, full_name) self.dialog_confirm_email = dialog_confirm_email.Main(self, temp_pass) if build.launch_dialog_as_child(self.dialog_confirm_email): logger.info("Email verified !") return 1 else: return 0
def apply(self): self.dialog_accept = dialog_accept.Main( "Are you sure ?", "Please confirm that you want to rename these files", defaults._warning_) if build.launch_dialog_as_child(self.dialog_accept): self.renamer.apply() self.clear_all() self.refresh_all()
def select_icon(self): self.icons_list_dialog = icons_list_dialog.Main() if build.launch_dialog_as_child(self.icons_list_dialog): # if file exists (means that's a custom_icon) set icon with full path and not based on defaults module if os.path.isfile(self.icons_list_dialog.icon): self.icon = self.icons_list_dialog.icon else: self.icon = defaults._icon_path_ + self.icons_list_dialog.icon self.ui.script_icon_pushButton.setIcon(QtGui.QIcon(self.icon))
def accept_dialog(self): run = 1 if self.modified: self.dialog_accept = dialog_accept.Main( "File not saved !", "File modified, continue ?") if build.launch_dialog_as_child(self.dialog_accept): run = 1 else: run = 0 return run
def show_imported_asset_manager(self): old_namespace = reference.get_name_space(self.asset, self.count) self.dialog_imported_asset_manager = dialog_imported_asset_manager.Main(self.asset, self.count, self.proxy, self.visible) if build.launch_dialog_as_child(self.dialog_imported_asset_manager): old_asset = copy.deepcopy(self.asset) self.asset = copy.deepcopy(self.dialog_imported_asset_manager.asset) self.proxy = copy.deepcopy(self.dialog_imported_asset_manager.proxy) self.visible = copy.deepcopy(self.dialog_imported_asset_manager.visible) self.add_name() self.node_editor.replace_reference(self, old_namespace, self.proxy, self.visible)
def admin_request(self): if self.ui.admin_checkBox.isChecked(): temp_pass = defaults._admin_key_ self.dialog_confirm_email = dialog_confirm_email.Main( self, temp_pass) self.dialog_confirm_email.ui.recover_pushButton.setVisible(0) self.dialog_confirm_email.ui.confirm_email_title_label.setText( 'Enter the administrator password') if build.launch_dialog_as_child(self.dialog_confirm_email): logger.info("Admin verified !") self.ui.admin_checkBox.setChecked(1) else: self.ui.admin_checkBox.setCheckState(0)
def change_state(self): if self.state == defaults._ticket_open_: self.dialog_close_ticket = dialog_close_ticket.Main() if build.launch_dialog_as_child(self.dialog_close_ticket): self.state = defaults._ticket_close_ self.tickets_obj.close_ticket(self.id, self.dialog_close_ticket.comment) self.close_date = self.tickets_obj.get_ticket_close_date( self.id) self.close_signal.emit(1) else: self.state = defaults._ticket_open_ self.tickets_obj.open_ticket(self.id) self.close_date = self.tickets_obj.get_ticket_close_date(self.id) self.setup_ui()
def __init__(self): os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" # Create the pyqt5 application self.app = QtWidgets.QApplication(sys.argv) #self.app.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) # Add the default wizard icon self.app.setWindowIcon(QtGui.QIcon(defaults._wizard_ico_)) if not site.is_site(): self.dialog_add_site = dialog_add_site.Main() if build.launch_dialog_as_child(self.dialog_add_site): site_path = self.dialog_add_site.site_path site.modify_site(site_path) #if not os.path.isfile('wizard.exe'): #os.startfile('wizard_site.bat') #else: os.startfile('wizard.exe') else: import wizard_ui wizard_ui.Main_application()
def __init__(self): # Create the pyqt5 application os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" self.app = QtWidgets.QApplication(sys.argv) self.app.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) #self.app.setStyle(QtWidgets.QStyleFactory.create("Fusion")) # Add the default wizard icon self.app.setWindowIcon(QtGui.QIcon(defaults._wizard_ico_)) # Call the introduction widget # This widget is used to help the users in the using of Wizard self.ui_welcome = ui_welcome.Main() # Define the "run" variable # it will permit to block the process in a case of exception run = 1 # Check if we need this widget before launching wizard main ui # Needed if no user is logged # no project is logged # or no server is launched if self.ui_welcome.need: # Check if the widget call was successful if not build.launch_dialog_as_child_frameless_trans( self.ui_welcome): # If not stop the process run = 0 # If the variable "run" is not 0 or None, continue the process if run: run = 0 ''' try: new_version = version.check_version().check_version() except: ''' new_version = None if new_version and prefs().show_new_version: self.dialog_new_version = dialog_new_version.Main(new_version) if build.launch_dialog_as_child(self.dialog_new_version): pass else: run = 1 else: run = 1 if run: # Call the loading ui self.ui_load = ui_load.Main() # Launch the loading ui with the module "gui.build" build.launch_normal_as_child_frameless_no_transparent( self.ui_load) # When the ui is showed, start the wizard introduction gif #self.ui_load.start_gif() # Wait for the wizard introduction gif to end #while not self.ui_load.go : # Refresh the ui while the wizard gif is running QApplication.processEvents() self.prefs = prefs() # Fake some loadings # Need to remove that self.ui_load.ui.loading_user_label.setText('User : {}'.format( self.prefs.user)) self.ui_load.ui.loading_project_label.setText( 'Project : {}'.format(self.prefs.project_name)) self.update_loading_infos('Reading project...', 65) # Call the main ui but don't launch it - This function is the longest to run self.ui_main = ui_main.Main() self.update_loading_infos('Launching main ui...', 85) self.update_loading_infos('Launching main ui...', 90) self.update_loading_infos('Launching main ui...', 100) # Close the loading ui self.ui_load.close() # Call the desktop shutter and give it the main ui object shutter = prefs.shutter if shutter: self.wizard_desktop = ui_wizard_desktop.wizard_desktop( self.ui_main) # Show the main ui with the "build" module (from wizard) build.launch_stray_as_child( self.ui_main, self.app, title=f'Wizard - Project : {self.prefs.project_name}') # Refresh the main ui self.ui_main.asset_item_changed() # Show the wizard desktop tray icon with the "build" module ( from wizard ) if shutter: build.launch_wizard_desktop(self.wizard_desktop)
def launch_report_dialog(self): try: self.dialog_report = dialog_report.Main(self.get_logs()) build.launch_dialog_as_child(self.dialog_report) except: logger.error(str(traceback.format_exc()))
def open(self): self.dialog_projects = dialog_projects.Main() if build.launch_dialog_as_child(self.dialog_projects): self.project_openned.emit('')
def new_project(self): self.dialog_new_project = dialog_new_project.Main() if build.launch_dialog_as_child(self.dialog_new_project): self.reject()
def log(self): self.dialog_users = dialog_users.Main() if build.launch_dialog_as_child(self.dialog_users): self.user_created.emit('')
def create_user(self): self.dialog_new_user = dialog_new_user.Main() if build.launch_dialog_as_child(self.dialog_new_user): self.user_created.emit('')
def add_site(self): self.add_site_dialog = add_site_dialog.Main() if build.launch_dialog_as_child(self.add_site_dialog): self.site_created.emit('')
def manual_export(self): self.dialog_manual_export = dialog_manual_export.Main(self.asset) if build.launch_dialog_as_child(self.dialog_manual_export): self.refresh_all()
def recover(self): self.ui_recover_password = ui_recover_password.Main(self) build.launch_dialog_as_child(self.ui_recover_password)
def launch_add_joke_ui(self): self.add_joke_ui = add_joke_ui.Main() if build.launch_dialog_as_child(self.add_joke_ui): joke_data = self.add_joke_ui.joke joke_id = jokes().add_joke(joke_data) self.refresh_joke(joke_id)
def create_project(self): self.dialog_new_project = dialog_new_project.Main() if build.launch_dialog_as_child(self.dialog_new_project): self.project_openned.emit('')