Пример #1
0
    def __init__(self, App, execpath):
        super().__init__()

        logging.basicConfig(
            level=TRACE,
            filename=Log.apppath,
            filemode="w",
            format="%(asctime)s:%(levelname)s:%(name)s:%(funcName)s:%(message)s"
        )

        apikey = current_settings["api key"]
        current_settings["api key"] = None  # avoid logging api key
        logging.info(
            "Current settings is updated to: {}".format(current_settings))
        current_settings["api key"] = apikey

        logging.info("Current config is updated to: {}".format(current_config))

        self.setFocus()
        App.applicationStateChanged.connect(self.applicationStateChanged)
        self.setWindowIcon(
            QtGui.QIcon(os.path.join(abspath, "res/OsrLogo.png")))
        self.setWindowTitle("Osr2mp4")
        self.setStyleSheet("background-color: rgb(30, 30, 33);")

        window_width, window_height = 832, 469

        self.execpath = execpath
        self.minimum_resolution = [640, 360]
        self.previous_resolution = [0, 0]
        self.default_width, self.default_height = window_width, window_height

        self.popup_bool = True
        self.clicked_inside = False
        self.prevreplay = ""

        self.osrbutton = OsrButton(self)
        self.mapsetbutton = MapsetButton(self)
        self.startbutton = StartButton(self)
        self.logo = Logo(self)
        self.osrpath = OsrPath(self)
        self.mapsetpath = MapSetPath(self)
        self.skin_dropdown = SkinDropDown(self)
        self.options = Options(self)
        self.updatebutton = UpdateButton(self)

        logging.info("Loaded Buttons")

        self.blurrable_widgets = [
            self.osrbutton, self.mapsetbutton, self.startbutton, self.logo,
            self.osrpath, self.mapsetpath, self.options, self.skin_dropdown
        ]

        self.popup_window = PopupWindow(self)
        self.output_window = OutputButton(self)
        self.osu_window = osuButton(self)

        self.customwindow = CustomTextWindow(self)
        self.customwindow.hide()

        logging.info("Loaded Popupwindow output button and osu button")
        self.settingspage = SettingsPage(self)

        logging.info("Loaded settings page")

        self.popup_widgets = [
            self.popup_window, self.output_window, self.osu_window
        ]

        self.progressbar = ProgressBar(self)
        self.progressbar.hide()

        self.check_osuPath()
        # self.check_replay_map()

        self.show()
        self.resize(window_width, window_height)
Пример #2
0
    def __init__(self, App, execpath):
        super().__init__()

        logging.basicConfig(
            level=TRACE,
            filename=Log.apppath,
            filemode="w",
            format="%(asctime)s:%(levelname)s:%(name)s:%(funcName)s:%(message)s"
        )

        apikey = current_settings["api key"]
        current_settings["api key"] = None  # avoid logging api key
        logging.info(
            "Current settings is updated to: {}".format(current_settings))
        current_settings["api key"] = apikey

        logging.info("Current config is updated to: {}".format(current_config))

        self.setFocus()
        App.applicationStateChanged.connect(self.applicationStateChanged)
        self.setWindowIcon(
            QtGui.QIcon(os.path.join(abspath, "res/OsrLogo.png")))
        self.setWindowTitle("osr2mp4")
        self.setStyleSheet("background-color: rgb(30, 30, 33);")
        self.setAcceptDrops(True)

        window_width, window_height = 832, 469

        self.execpath = execpath
        self.minimum_resolution = [640, 360]
        self.previous_resolution = [0, 0]
        self.default_width, self.default_height = window_width, window_height

        self.popup_bool = True
        self.clicked_inside = False
        self.prevreplay = ""

        self.osrbutton = OsrButton(self)
        self.mapsetbutton = MapsetButton(self)
        self.startbutton = StartButton(self)
        self.logo = Logo(self)
        self.osrpath = OsrPath(self)
        self.mapsetpath = MapSetPath(self)
        self.skin_dropdown = SkinDropDown(self)
        self.options = Options(self)
        self.updatebutton = UpdateButton(self)
        self.folderbutton = FolderButton(self)
        self.osrgraybutton = OsrGrayButton(self)
        self.osumapbutton = osuMapButton(self)
        self.autocheckbox = AutoCheckBox(self)
        self.cancelbutton = CancelButton(self)

        logging.info("Loaded Buttons")

        self.blurrable_widgets = [
            self.osrbutton, self.mapsetbutton, self.startbutton, self.logo,
            self.osrpath, self.mapsetpath, self.options, self.skin_dropdown,
            self.cancelbutton, self.folderbutton, self.autocheckbox
        ]

        self.langs_dropdown = LanguageDropDown(self)
        self.popup_window = PopupWindow(self)
        self.output_window = OutputButton(self)
        self.osu_window = osuButton(self)

        self.customwindow = CustomTextWindow(self)
        self.customwindow.hide()

        logging.info("Loaded Popupwindow output button and osu button")
        self.settingspage = SettingsPage(self)

        logging.info("Loaded settings page")

        self.popup_widgets = [
            self.popup_window, self.output_window, self.osu_window
        ]

        self.progressbar = ProgressBar(self)
        self.progressbar.hide()

        current_config[
            ".osr path"] = "brrrrr"  # because if .osr path is auto, it won't check for latest play on startup
        self.check_osu_path()
        # self.check_replay_map()

        self.show()

        # bind taskbar progress, windows only
        if getattr(
                self.progressbar, 'taskbar_btn', None
        ):  # could also import the using_windows variable and use that
            self.progressbar.taskbar_btn.setWindow(
                self.windowHandle())  # maybe do that instead?

        self.resize(window_width, window_height)