mirror of
https://github.com/JDM170/SaveWizard
synced 2025-04-20 22:30:42 +07:00
Remove unused module_choice
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
# initialize module 'choice'
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<author>JDM170</author>
|
|
||||||
<class>Choice</class>
|
|
||||||
<widget class="QDialog" name="Choice">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>490</width>
|
|
||||||
<height>130</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>490</width>
|
|
||||||
<height>130</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>490</width>
|
|
||||||
<height>130</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Select game</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="gridLayoutWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>471</width>
|
|
||||||
<height>111</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QPushButton" name="ets2_button">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Times New Roman</family>
|
|
||||||
<pointsize>14</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>ETS2</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QPushButton" name="ats_button">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Times New Roman</family>
|
|
||||||
<pointsize>14</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>ATS</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Times New Roman</family>
|
|
||||||
<pointsize>18</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Select the configs you want to use:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Times New Roman</family>
|
|
||||||
<pointsize>12</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>DON'T USE CONFIGS FROM ANOTHER GAME INTENTIONALLY,
|
|
||||||
YOU CAN DAMAGE THE GAME'S SAVE.</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<tabstops>
|
|
||||||
<tabstop>ats_button</tabstop>
|
|
||||||
<tabstop>ets2_button</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
|
||||||
from PyQt5.QtWidgets import QDialog, QMessageBox
|
|
||||||
from ast import literal_eval
|
|
||||||
from os.path import isfile
|
|
||||||
from .form import Ui_Choice
|
|
||||||
from module_main.script import MainWindow
|
|
||||||
from module_parsing.script import check_remote_hashes, update_configs
|
|
||||||
from statics import update_config_name
|
|
||||||
|
|
||||||
|
|
||||||
class ChoiceWindow(QDialog, Ui_Choice):
|
|
||||||
def __init__(self, parent=None):
|
|
||||||
# Setup UI
|
|
||||||
QDialog.__init__(self, parent, flags=Qt.Window)
|
|
||||||
Ui_Choice.__init__(self)
|
|
||||||
self.ui = Ui_Choice()
|
|
||||||
self.ui.setupUi(self)
|
|
||||||
|
|
||||||
self.ui.ats_button.clicked.connect(self.button_clicked)
|
|
||||||
self.ui.ets2_button.clicked.connect(self.button_clicked)
|
|
||||||
|
|
||||||
remember_data = {"answer_updates": True, "update_on_start": False}
|
|
||||||
if isfile(update_config_name):
|
|
||||||
with open(update_config_name, "r") as f:
|
|
||||||
remember_data = literal_eval(f.read())
|
|
||||||
|
|
||||||
upd_list = check_remote_hashes()
|
|
||||||
if upd_list and len(upd_list) > 0:
|
|
||||||
if remember_data.get("update_on_start"):
|
|
||||||
update_configs(upd_list)
|
|
||||||
return
|
|
||||||
if remember_data.get("answer_updates"):
|
|
||||||
box = QMessageBox(QMessageBox.Information, "Info",
|
|
||||||
"Some configs have been updated. Do you want to update the local configs?")
|
|
||||||
box.addButton("Yes", QMessageBox.YesRole) # 0
|
|
||||||
box.addButton("Yes, remember that", QMessageBox.YesRole) # 1
|
|
||||||
box.addButton("No", QMessageBox.NoRole) # 2
|
|
||||||
box.addButton("No, remember that", QMessageBox.NoRole) # 3
|
|
||||||
update_configs(upd_list, box.exec())
|
|
||||||
|
|
||||||
def button_clicked(self):
|
|
||||||
sender = self.sender()
|
|
||||||
if sender == self.ui.ats_button:
|
|
||||||
selected = "ats"
|
|
||||||
elif sender == self.ui.ets2_button:
|
|
||||||
selected = "ets2"
|
|
||||||
else:
|
|
||||||
return
|
|
||||||
self.close()
|
|
||||||
win = MainWindow(selected)
|
|
||||||
win.exec()
|
|
||||||
Reference in New Issue
Block a user