Exemplo n.º 1
0
    def _get_gw2_file_name(self):
        path = str(utilities.dialog_get_file_path())
        if path != "":
            file_name = str(path.split("\\")[-1])
            gw2_name = constants.GW2_64_BIT_EXEC_NAME

            if gw2_name.lower() == file_name.lower():
                self.qtObj.gw2Path_label.setText(path)
                self.configs['gw2Path'] = path
                self._enable_form()
                utilities.set_file_settings("GW2", "gw2Path", f"\"{path}\"")
            elif file_name.lower() == "gw2.exe":
                utilities.show_message_window(
                    "error", "ERROR", str(messages.gw2_32bit_not_supported))
            else:
                not_valid_gw2_msg = f"\"{file_name}\" {messages.not_valid_gw2}"
                utilities.show_message_window("error", "ERROR",
                                              not_valid_gw2_msg)

        if str(self.configs['gw2Path']
               ) == "" or self.configs['gw2Path'] is None:
            self._disable_form()
            self.qtObj.gw2Path_label.clear()
            self.qtObj.gw2Path_label.setText(messages.need_find_gw2)
            self.qtObj.findGw2File_button.setFocus()
Exemplo n.º 2
0
    def _set_port(self):
        if self.qtObj.port80_radioButton.isChecked():
            self.configs['port'] = 80
        elif self.qtObj.port443_radioButton.isChecked():
            self.configs['port'] = 443
        else:
            self.configs['port'] = 6112

        utilities.set_file_settings("GW2", "port", str(self.configs['port']))
        self._set_all_configs_on_form_from_settings_file()
Exemplo n.º 3
0
    def _set_portal(self):
        portal_textEdit = str(self.qtObj.portal_textEdit.toPlainText())

        if portal_textEdit is not None and portal_textEdit != "":
            self.configs['portal'] = portal_textEdit
        else:
            self.configs['portal'] = ""

        utilities.set_file_settings("Parameters2", "portal",
                                    f"\"{self.configs['portal']}\"")
        self._set_all_configs_on_form_from_settings_file()
Exemplo n.º 4
0
    def _set_authsrv(self):
        authsrv_textEdit = str(self.qtObj.authsrv_textEdit.toPlainText())

        if authsrv_textEdit is not None and authsrv_textEdit != "":
            self.configs['authsrv'] = authsrv_textEdit
        else:
            self.configs['authsrv'] = ""

        utilities.set_file_settings("Parameters2", "authsrv",
                                    f"\"{self.configs['authsrv']}\"")
        self._set_all_configs_on_form_from_settings_file()
Exemplo n.º 5
0
    def init(self):
        self.progressBar.setValues(messages.initializing, 0)
        utilities.set_paypal_button(self)
        utilities.check_dirs()
        self.log = utilities.setup_logging(self)
        sys.excepthook = utilities.log_uncaught_exceptions
        utilities.check_files(self)
        self.configs = utilities.get_all_ini_file_settings(
            constants.SETTINGS_FILENAME)
        if self.configs['useTheme'] is None:
            self.configs['useTheme'] = True
        if self.configs['programVersion'] is None or self.configs[
                'programVersion'] != constants.VERSION:
            utilities.set_file_settings("Main", "programVersion",
                                        constants.VERSION)

        self.progressBar.setValues(messages.checking_new_version, 25)
        self._check_new_program_version()

        self.progressBar.setValues(messages.arcdps_new_version, 50)
        self._check_arcdps_installed()
        if self.configs['gw2Path'] is not None:
            self._update_arcdps()

        self.progressBar.setValues(messages.get_arcdps_html, 75)
        self._set_arcdps_tab()

        if self.configs['useTheme']:
            self.form.setStyleSheet(
                open(constants.STYLE_QSS_FILENAME, "r").read())

        if self.configs['gw2Path'] is None or self.configs['gw2Path'] == "":
            self._disable_form()
            find_gw2_exec_msg = messages.find_gw2_exec
            utilities.show_message_window("info", "INFO", find_gw2_exec_msg)
            self._get_gw2_file_name()
        else:
            self._enable_form()

        self._set_all_configs_on_form_from_settings_file()
        self._register_form_events()
        self.qtObj.main_tabWidget.setCurrentIndex(0)
        self.qtObj.findGw2File_button.setFocus()
        self.progressBar.close()
Exemplo n.º 6
0
    def _check_arcdps_installed(self):
        gw2_dir_path = ""
        if self.configs['gw2Path'] is not None:
            gw2_dir_path = os.path.dirname(self.configs['gw2Path'])

        if os.path.exists(f"{gw2_dir_path}\\bin64\\"):
            d3d9_path = f"{gw2_dir_path}\\bin64\\d3d9.dll"
            if os.path.isfile(d3d9_path):
                self.configs['arcdps'] = True
                self.qtObj.arcdps_yes_radioButton.setChecked(True)
                self.qtObj.arcdps_no_radioButton.setChecked(False)
                utilities.set_file_settings("GW2", "arcdps",
                                            str(self.configs['arcdps']))
                return

        self.configs['arcdps'] = False
        self.qtObj.arcdps_yes_radioButton.setChecked(False)
        self.qtObj.arcdps_no_radioButton.setChecked(True)
        utilities.set_file_settings("GW2", "arcdps",
                                    str(self.configs['arcdps']))
Exemplo n.º 7
0
    def _set_arcdps(self):
        self.qtObj.main_tabWidget.setCurrentIndex(2)
        window_type = None
        window_title = None
        msg = None

        if self.qtObj.arcdps_yes_radioButton.isChecked():
            if self._update_arcdps():
                window_type = "information"
                window_title = "Installed"
                msg = messages.arcdps_installed
                self.configs['arcdps'] = True
            else:
                window_type = "error"
                window_title = "ERROR"
                msg = messages.arcdps_error_install
                self.configs['arcdps'] = False
                self.qtObj.arcdps_yes_radioButton.setChecked(False)
                self.qtObj.arcdps_no_radioButton.setChecked(True)
        elif self.qtObj.arcdps_no_radioButton.isChecked():
            if utilities.remove_arcdps_files(self):
                window_type = "information"
                window_title = "Removed"
                msg = messages.arcdps_removed
                self.configs['arcdps'] = False
            else:
                window_type = "error"
                window_title = "ERROR"
                msg = messages.arcdps_error_remove
                self.configs['arcdps'] = True
                self.qtObj.arcdps_yes_radioButton.setChecked(True)
                self.qtObj.arcdps_no_radioButton.setChecked(False)

        utilities.set_file_settings("GW2", "arcdps",
                                    str(self.configs['arcdps']))
        utilities.show_message_window(window_type, window_title, msg)
Exemplo n.º 8
0
    def _set_all_configs_on_form_from_settings_file(self):
        self.current_parameters_list = list()
        self.current_parameters_list.append(
            f"-clientport:{self.configs['port']}")
        if int(self.configs['port']) == 80:
            self.qtObj.port80_radioButton.setChecked(True)
            self.qtObj.port443_radioButton.setChecked(False)
            self.qtObj.port6112_radioButton.setChecked(False)
        elif int(self.configs['port']) == 443:
            self.qtObj.port80_radioButton.setChecked(False)
            self.qtObj.port443_radioButton.setChecked(True)
            self.qtObj.port6112_radioButton.setChecked(False)
        else:
            self.qtObj.port80_radioButton.setChecked(False)
            self.qtObj.port443_radioButton.setChecked(False)
            self.qtObj.port6112_radioButton.setChecked(True)

        if str(self.configs['arcdps']).lower() == "true":
            self.qtObj.arcdps_yes_radioButton.setChecked(True)
            self.qtObj.arcdps_no_radioButton.setChecked(False)
        else:
            self.qtObj.arcdps_yes_radioButton.setChecked(False)
            self.qtObj.arcdps_no_radioButton.setChecked(True)

        # Parameters1
        if str(self.configs['autologin']).lower() == "true":
            self.current_parameters_list.append("-autologin")
            self.qtObj.autologin_checkBox.setChecked(True)
        else:
            self.qtObj.autologin_checkBox.setChecked(False)

        if str(self.configs['32bits']).lower() == "true":
            self.current_parameters_list.append("-32")
            self.qtObj.bit32_checkBox.setChecked(True)
        else:
            self.qtObj.bit32_checkBox.setChecked(False)

        if str(self.configs['bmp']).lower() == "true":
            self.current_parameters_list.append("-bmp")
            self.qtObj.bmp_checkBox.setChecked(True)
        else:
            self.qtObj.bmp_checkBox.setChecked(False)

        if str(self.configs['mapLoadinfo']).lower() == "true":
            self.current_parameters_list.append("-mapLoadinfo")
            self.qtObj.mapLoadinfo_checkBox.setChecked(True)
        else:
            self.qtObj.mapLoadinfo_checkBox.setChecked(False)

        if str(self.configs['mce']).lower() == "true":
            self.current_parameters_list.append("-mce")
            self.qtObj.mce_checkBox.setChecked(True)
        else:
            self.qtObj.mce_checkBox.setChecked(False)

        if str(self.configs['dx9single']).lower() == "true":
            self.current_parameters_list.append("-dx9single")
            self.qtObj.dx9single_checkBox.setChecked(True)
        else:
            self.qtObj.dx9single_checkBox.setChecked(False)

        if str(self.configs["forwardrenderer"]).lower() == "true":
            self.current_parameters_list.append("-forwardrenderer")
            self.qtObj.forwardrenderer_checkBox.setChecked(True)
        else:
            self.qtObj.forwardrenderer_checkBox.setChecked(False)

        if str(self.configs['log']).lower() == "true":
            self.current_parameters_list.append("-log")
            self.qtObj.log_checkBox.setChecked(True)
        else:
            self.qtObj.log_checkBox.setChecked(False)

        if str(self.configs['nodelta']).lower() == "true":
            self.current_parameters_list.append("-nodelta")
            self.qtObj.nodelta_checkBox.setChecked(True)
        else:
            self.qtObj.nodelta_checkBox.setChecked(False)

        if str(self.configs['nomusic']).lower() == "true":
            self.current_parameters_list.append("-nomusic")
            self.qtObj.nomusic_checkBox.setChecked(True)
        else:
            self.qtObj.nomusic_checkBox.setChecked(False)

        if str(self.configs['noui']).lower() == "true":
            self.current_parameters_list.append("-noui")
            self.qtObj.noui_checkBox.setChecked(True)
        else:
            self.qtObj.noui_checkBox.setChecked(False)

        if str(self.configs['nosound']).lower() == "true":
            self.current_parameters_list.append("-nosound")
            self.qtObj.nosound_checkBox.setChecked(True)
        else:
            self.qtObj.nosound_checkBox.setChecked(False)

        if str(self.configs['prefreset']).lower() == "true":
            self.current_parameters_list.append("-prefreset")
            self.qtObj.prefreset_checkBox.setChecked(True)
        else:
            self.qtObj.prefreset_checkBox.setChecked(False)

        if str(self.configs['shareArchive']).lower() == "true":
            self.current_parameters_list.append("-shareArchive")
            self.qtObj.shareArchive_checkBox.setChecked(True)
        else:
            self.qtObj.shareArchive_checkBox.setChecked(False)

        if str(self.configs['uispanallmonitors']).lower() == "true":
            self.current_parameters_list.append("-uispanallmonitors")
            self.qtObj.uispanallmonitors_checkBox.setChecked(True)
        else:
            self.qtObj.uispanallmonitors_checkBox.setChecked(False)

        if str(self.configs['useOldFov']).lower() == "true":
            self.current_parameters_list.append("-useOldFov")
            self.qtObj.useOldFov_checkBox.setChecked(True)
        else:
            self.qtObj.useOldFov_checkBox.setChecked(False)

        if str(self.configs['windowed']).lower() == "true":
            self.current_parameters_list.append("-windowed")
            self.qtObj.windowed_checkBox.setChecked(True)
        else:
            self.qtObj.windowed_checkBox.setChecked(False)

        if str(self.configs['umbra']).lower() == "true":
            self.current_parameters_list.append("-umbra gpu")
            self.qtObj.umbra_checkBox.setChecked(True)
        else:
            self.qtObj.umbra_checkBox.setChecked(False)

        # Parameters2
        if self.configs[
                'assetsrv'] is not None and self.configs['assetsrv'] != "":
            self.current_parameters_list.append(
                f"-assetsrv {self.configs['assetsrv']}")
            assetsrv_text = str(self.qtObj.assetsrv_textEdit.toPlainText())
            if assetsrv_text == "":
                self.qtObj.assetsrv_textEdit.setText(
                    str(self.configs['assetsrv']))

        if self.configs[
                'authsrv'] is not None and self.configs['authsrv'] != "":
            self.current_parameters_list.append(
                f"-authsrv {self.configs['authsrv']}")
            authsrv_text = str(self.qtObj.authsrv_textEdit.toPlainText())
            if authsrv_text == "":
                self.qtObj.authsrv_textEdit.setText(
                    str(self.configs['authsrv']))

        if self.configs['portal'] is not None and self.configs['portal'] != "":
            self.current_parameters_list.append(
                f"-portal {self.configs['portal']}")
            portal_text = str(self.qtObj.portal_textEdit.toPlainText())
            if portal_text == "":
                self.qtObj.portal_textEdit.setText(str(self.configs['portal']))

        if str(self.configs['useDatFile']).lower() == "true":
            if (self.configs['datFile']
                    is not None) and (self.configs['datFile'] != ""):
                self.qtObj.dat_checkBox.setChecked(True)
                self.current_parameters_list.append(
                    f"-dat {self.configs['datFile']}")
                dat_checkBox_text = str(self.qtObj.dat_checkBox.text())
                if dat_checkBox_text == "":
                    self.qtObj.dat_checkBox.setText(
                        str(self.configs['datFile']))
            else:
                self.qtObj.dat_checkBox.setChecked(False)
                self.configs['useDatFile'] = False
                utilities.set_file_settings("Parameters2", "usedatfile",
                                            str(self.configs['useDatFile']))

        if (self.configs['datFile']
                is not None) and (self.configs['datFile'] != ""):
            self.qtObj.dat_checkBox.setText(str(self.configs['datFile']))

        # Other Utilities
        if str(self.configs['verify']).lower() == "true":
            self.current_parameters_list.append("-verify")
            self.qtObj.verify_checkBox.setChecked(True)
        else:
            self.qtObj.verify_checkBox.setChecked(False)

        if str(self.configs['repair']).lower() == "true":
            self.current_parameters_list.append("-repair")
            self.qtObj.repair_checkBox.setChecked(True)
        else:
            self.qtObj.repair_checkBox.setChecked(False)

        if str(self.configs['diag']).lower() == "true":
            self.current_parameters_list.append("-diag")
            self.qtObj.diag_checkBox.setChecked(True)
        else:
            self.qtObj.diag_checkBox.setChecked(False)

        if str(self.configs['uninstall']).lower() == "true":
            self.current_parameters_list.append("-uninstall")
            self.qtObj.uninstall_checkBox.setChecked(True)
        else:
            self.qtObj.uninstall_checkBox.setChecked(False)

        self.current_parameters = str(' '.join(self.current_parameters_list))
        self.qtObj.current_param_label.setText(str(self.current_parameters))
        if self.qtObj.gw2Path_label.text() == "":
            self.qtObj.gw2Path_label.setText(str(self.configs['gw2Path']))