Пример #1
0
def save_preset():

    global name_ui
    name_ui = QtWidgets.QFrame()
    form_2 = Name_UI()
    form_2.setupUi(name_ui)
    name_ui.show()
    form_2.pushButton.clicked.connect(lambda: save_preset_2(form_2, name_ui))
Пример #2
0
def ea_reskin():

    global a
    global form
    global buttons

    a = QtWidgets.QFrame()
    form = Reskin_UI()
    form.setupUi(a)
    a.show()

    form.comboBox.addItem("<Current skin>")
    form.comboBox.activated.connect(load_preset)

    buttons = [
        [form.pushButton, form.pushButton_2,     None],
        [form.pushButton_23, form.pushButton_24, None],
        [form.pushButton_25, form.pushButton_26, None],
        [form.pushButton_9, form.pushButton_10,  None],
        [form.pushButton_13, form.pushButton_14, None],
        [form.pushButton_27, form.pushButton_28, None],
        [form.pushButton_21, form.pushButton_22, None],
        [form.pushButton_15, form.pushButton_16, None],
        [form.pushButton_11, form.pushButton_12, None],

        [form.pushButton_43, form.pushButton_44, None],
        [form.pushButton_3, form.pushButton_4, None],
        [form.pushButton_31, form.pushButton_32, None],
        [form.pushButton_29, form.pushButton_30, None],
        [form.pushButton_33, form.pushButton_34, None],
    ]

    for x in range(len(buttons)):
        buttons[x][0].clicked.connect(lambda x=x: select_color(x))
        buttons[x][1].clicked.connect(lambda x=x: select_color(x))

    form.pushButton_18.clicked.connect(save_preset)
    form.pushButton_17.clicked.connect(lambda: process_ui_action("SetColors"))
    form.pushButton_20.clicked.connect(apply_skin)
    form.checkBox.stateChanged.connect(lambda x: toggle_apply_on_startup(x))
    form.checkBox_2.stateChanged.connect(lambda x: toggle_match_background(x))
    load_preset(0)

    for i in config["skins"]:
        form.comboBox.addItem(i[0])

    if config["apply_skin_on_startup"]:
        form.checkBox.setChecked(True)

    if config["match_background"]:
        form.checkBox_2.setChecked(True)
        buttons[9][0].setStyleSheet("background: #" + buttons[0][0].styleSheet().split("#")[1])
Пример #3
0
def ea_warning(text, additional_buttons=[], title="EA Warning"):

    global warning
    global form
    global buttons

    warning = QtWidgets.QFrame()
    form = Warning_UI()
    form.setupUi(warning)
    form.label.setText(text)
    form.pushButton.clicked.connect(warning.close)

    for button, handler in additional_buttons:
        setattr(form, button, QtWidgets.QPushButton(warning))
        getattr(form, button).clicked.connect(handler)
        getattr(form, button).setText(QtWidgets.QApplication.translate("Dialog", button, None))
        form.horizontalLayout.addWidget(getattr(form, button))

    warning.setWindowFlags(warning.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
    warning.setWindowTitle(QtWidgets.QApplication.translate("Dialog", title, None))
    warning.show()
Пример #4
0
def ea_trace():

    global a
    global form

    if found_lib:
        a = QtWidgets.QFrame()
        form = Trace_UI()
        form.setupUi(a)
        form.checkBox.click()
        form.radioButton_2.click()
        form.pushButton.clicked.connect(select_dir)
        form.pushButton_2.clicked.connect(go)
        form.pushButton_4.clicked.connect(select_dump)
        if config["trace_dir"]:
            form.lineEdit.insert(config["trace_dir"])
        # a.setWindowFlags(a.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
        a.show()
    else:
        ea_warning(
            "Could not find Pandas in your Python distribution. Install it to use this feature"
        )
Пример #5
0
def ea_warning(text,
               buttons=(("OK", None, True), ),
               checkboxes=[],
               title="EA Warning"):

    global warning
    global form

    warning = QtWidgets.QFrame()
    form = Warning_UI()
    form.setupUi(warning)
    form.label.setText(text)

    for button, handler, close_on_click in buttons:
        setattr(form, button, QtWidgets.QPushButton(warning))
        getattr(form,
                button).clicked.connect(handler if handler else warning.close)
        getattr(form, button).setText(
            QtWidgets.QApplication.translate("Dialog", button, None))

        if close_on_click:
            getattr(form, button).clicked.connect(warning.close)

        form.horizontalLayout.addWidget(getattr(form, button))

    for checkbox, handler, checked in checkboxes:
        setattr(form, checkbox, QtWidgets.QCheckBox(warning))
        getattr(form, checkbox).stateChanged.connect(handler)
        getattr(form, checkbox).setText(
            QtWidgets.QApplication.translate("Dialog", checkbox, None))
        getattr(form, checkbox).setChecked(checked)
        form.horizontalLayout_2.addWidget(getattr(form, checkbox))

    warning.setWindowFlags(warning.windowFlags()
                           | QtCore.Qt.WindowStaysOnTopHint)
    warning.setWindowTitle(
        QtWidgets.QApplication.translate("Dialog", title, None))
    warning.show()
Пример #6
0
def ea_reskin():

    global a
    global form
    global buttons

    a = QtWidgets.QFrame()
    form = Reskin_UI()
    form.setupUi(a)
    a.show()

    for i in config["skins"]:
        form.comboBox.addItem(i[0])

    form.comboBox.activated.connect(changed)

    buttons = [[form.pushButton, form.pushButton_2, None],
               [form.pushButton_23, form.pushButton_24, None],
               [form.pushButton_25, form.pushButton_26, None],
               [form.pushButton_9, form.pushButton_10, None],
               [form.pushButton_13, form.pushButton_14, None],
               [form.pushButton_27, form.pushButton_28, None],
               [form.pushButton_21, form.pushButton_22, None],
               [form.pushButton_15, form.pushButton_16, None],
               [form.pushButton_11, form.pushButton_12, None]]

    for x in range(len(buttons)):
        buttons[x][0].clicked.connect(lambda x=x: select_color(x))
        buttons[x][1].clicked.connect(lambda x=x: select_color(x))

    form.pushButton_18.clicked.connect(save_preset)
    form.pushButton_17.clicked.connect(lambda: process_ui_action("SetColors"))
    form.pushButton_20.clicked.connect(apply_skin)
    form.checkBox.stateChanged.connect(lambda x: toggle_apply_onstartup(x))

    changed(0)