Beispiel #1
0
import PyQt5.uic as uic
import traceback
from PyQt5.QtGui import QPixmap, QIcon
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
import maidfiddler.util.util as util
from maidfiddler.util.translation import tr, tr_str
from maidfiddler.ui.resources import APP_ICON, ERR_ICON

(ui_class, ui_base) = uic.loadUiType(
    open(util.get_resource_path("templates/error_dialog.ui")))


class ErrorDialog(ui_class, ui_base):
    def __init__(self, t, error, tb):
        super(ErrorDialog, self).__init__()
        self.setupUi(self)

        self.error = error
        self.traceback = tb
        self.t = t

        self.close_button.clicked.connect(self.stop)

        self.load()

    def stop(self):
        QApplication.instance().exit()
        self.accept()

    def load(self):
from maidfiddler.ui.resources import APP_ICON
from maidfiddler.util.logger import logger
import urllib.request as request
from urllib.error import URLError
import json
import markdown2
import subprocess

from app_info import GIT_REPO, VERSION

TMP_FOLDER = "tmp_downloads"
UPDATER_FILE = "installer.exe"

DETACHED_PROCESS = 0x00000008
(ui_class, ui_base) = uic.loadUiType(
    open(util.get_resource_path("templates/updater_dialog.ui")))


class GetUpdateDataThread(QThread):
    update_available = pyqtSignal(dict)
    no_update = pyqtSignal()
    error = pyqtSignal(str)

    def __init__(self):
        QThread.__init__(self)

    def __del__(self):
        self.wait()

    def run(self):
        logger.debug("doing request")
import PyQt5.uic as uic
from PyQt5.QtGui import QPixmap, QIcon
from PyQt5.QtCore import Qt
import maidfiddler.util.util as util
from maidfiddler.util.translation import tr, tr_str
from maidfiddler.ui.resources import APP_ICON
import app_info as info

(ui_class, ui_base) = uic.loadUiType(
    open(util.get_resource_path("templates/about_dialog.ui")))


class AboutDialog(ui_class, ui_base):
    def __init__(self):
        super(AboutDialog, self).__init__()
        self.setupUi(self)
        self.close_button.clicked.connect(self.accept)
        self.setWindowFlags(self.windowFlags()
                            & ~Qt.WindowContextHelpButtonHint)

    def reload(self, core_version):
        icon = QPixmap()
        icon.loadFromData(APP_ICON)
        self.setWindowIcon(QIcon(icon))

        self.description_label.setText(tr(self.description_label))
        self.close_button.setText(tr(self.close_button))

        about_icon = QPixmap()
        about_icon.loadFromData(APP_ICON)
        self.icon_label.setPixmap(about_icon.scaled(32, 32))
import PyQt5.uic as uic
import time
import threading
from PyQt5.QtGui import QPixmap, QIcon
from PyQt5.QtWidgets import QPushButton, QLabel, QApplication
from PyQt5.QtCore import Qt, QThread, pyqtSignal
import maidfiddler.util.util as util
from maidfiddler.util.translation import tr, tr_str
from maidfiddler.ui.resources import APP_ICON

(ui_class, ui_base) = uic.loadUiType(
    open(util.get_resource_path("templates/connect_dialog.ui")))


class ConnectWorker(QThread):
    connected = pyqtSignal()
    setup_complete = pyqtSignal(dict)
    connection_reset = pyqtSignal()

    def __init__(self, core):
        QThread.__init__(self)
        self.connecting = False
        self.core = core

    def __del__(self):
        self.wait()

    def _connected(self):
        self.connected.emit()
        print("Got connection! Trying to get game data!")
        try:
Beispiel #5
0
                                          get_random_title, get_language_name,
                                          tr_str)

from maidfiddler.util.config import CONFIG, save_config

from maidfiddler.ui.resources import APP_ICON
from maidfiddler.util.pipes import PipedEventHandler, PipeRpcCaller

from maidfiddler.ui.dialogs.update_checker import UpdateDialog

from app_info import MIN_SUPPORTED_GAME_VERSION, VERSION

from maidfiddler.util.logger import logger

UI_MainWindow = uic.loadUiType(
    open(util.get_resource_path("templates/maid_fiddler.ui")))

BASE_TITLE = "Maid Fiddler COM3D2"


class MaidManager:
    def __init__(self):
        self.maid_data = {}
        self.selected_maid = None

    def clear(self):
        self.maid_data.clear()
        self.selected_maid = None

    def add_maid(self, maid):
        self.maid_data[maid["guid"]] = maid