Ejemplo n.º 1
0
    def show_download_wizard(self, download_kind, download_directory, downloads):
        self.set_edit_buttons_enabled(False)
        self.set_program_callbacks_enabled(False)

        context = ProgramWizardContext(self.session, [], self.script_manager, self.image_version, self.executable_versions)

        self.download_wizard = ProgramWizardDownload(self, context, self.program, download_kind, download_directory, downloads)
        self.download_wizard.exec_()
        self.download_wizard = None

        if self.tab_is_alive:
            self.set_program_callbacks_enabled(True)
            self.set_edit_buttons_enabled(True)
Ejemplo n.º 2
0
    def show_edit_language_wizard(self):
        language_api_name = self.program.cast_custom_option_value(
            'language', unicode, '<unknown>')

        try:
            language_page = Constants.get_language_page(language_api_name)
        except:
            return

        language_page_classes = {
            Constants.PAGE_C: ProgramPageC,
            Constants.PAGE_CSHARP: ProgramPageCSharp,
            Constants.PAGE_DELPHI: ProgramPageDelphi,
            Constants.PAGE_JAVA: ProgramPageJava,
            Constants.PAGE_JAVASCRIPT: ProgramPageJavaScript,
            Constants.PAGE_OCTAVE: ProgramPageOctave,
            Constants.PAGE_PERL: ProgramPagePerl,
            Constants.PAGE_PHP: ProgramPagePHP,
            Constants.PAGE_PYTHON: ProgramPagePython,
            Constants.PAGE_RUBY: ProgramPageRuby,
            Constants.PAGE_SHELL: ProgramPageShell,
            Constants.PAGE_VBNET: ProgramPageVBNET
        }

        self.set_edit_buttons_enabled(False)

        context = ProgramWizardContext(self.session, [], self.script_manager,
                                       self.image_version,
                                       self.executable_versions)
        page = language_page_classes[language_page]()

        self.edit_language_wizard = ProgramWizardEdit(
            self,
            context,
            self.program,
            self.widget_files.available_files,
            self.widget_files.available_directories,
        )
        self.edit_language_wizard.setPage(language_page, page)

        if self.edit_language_wizard.exec_() == QDialog.Accepted:
            page.apply_program_changes()
            self.refresh_info()

        self.edit_language_wizard = None

        if self.tab_is_alive:
            self.set_edit_buttons_enabled(True)
Ejemplo n.º 3
0
    def show_edit_schedule_wizard(self):
        self.set_edit_buttons_enabled(False)

        context = ProgramWizardContext(self.session, [], self.script_manager, self.image_version, self.executable_versions)
        page    = ProgramPageSchedule()

        self.edit_schedule_wizard = ProgramWizardEdit(self, context, self.program, self.widget_files.available_files, self.widget_files.available_directories)
        self.edit_schedule_wizard.setPage(Constants.PAGE_SCHEDULE, page)

        if self.edit_schedule_wizard.exec_() == QDialog.Accepted:
            page.apply_program_changes()
            self.refresh_info()

        self.edit_schedule_wizard = None

        if self.tab_is_alive:
            self.set_edit_buttons_enabled(True)
Ejemplo n.º 4
0
    def show_upload_files_wizard(self):
        self.set_edit_buttons_enabled(False)
        self.set_program_callbacks_enabled(False)

        context = ProgramWizardContext(self.session, [], self.script_manager, self.image_version, self.executable_versions)

        self.upload_files_wizard = ProgramWizardUpload(self, context, self.program, self.last_upload_files_wizard_directory)
        self.upload_files_wizard.exec_()

        self.last_upload_files_wizard_directory = self.upload_files_wizard.last_directory

        if self.upload_files_wizard.upload_successful:
            self.widget_files.refresh_files()

        self.upload_files_wizard = None

        if self.tab_is_alive:
            self.set_program_callbacks_enabled(True)
            self.set_edit_buttons_enabled(True)
Ejemplo n.º 5
0
    def show_new_program_wizard(self):
        self.button_new.setEnabled(False)

        if self.stacked_container.count() > 1:
            current_widget = self.stacked_container.currentWidget()
        else:
            current_widget = None

        if current_widget != None:
            current_widget.set_program_callbacks_enabled(False)

        identifiers = []

        for i in range(self.tree_programs.topLevelItemCount()):
            identifiers.append(
                self.tree_programs.topLevelItem(i).data(
                    0, Qt.UserRole).program.identifier)

        context = ProgramWizardContext(self.session, identifiers,
                                       self.script_manager, self.image_version,
                                       self.executable_versions)

        self.new_program_wizard = ProgramWizardNew(self, context)

        self.new_program_wizard.exec_()

        if self.new_program_wizard.upload_successful:
            self.add_program_to_tree(self.new_program_wizard.program)
            self.tree_programs.topLevelItem(
                self.tree_programs.topLevelItemCount() - 1).setSelected(True)

            for i in reversed(range(self.tree_programs.topLevelItemCount() -
                                    1)):
                self.tree_programs.topLevelItem(i).setSelected(False)

        if self.tab_is_alive:
            self.new_program_wizard = None

            if current_widget != None:
                current_widget.set_program_callbacks_enabled(True)

            self.button_new.setEnabled(True)