mirror of
https://github.com/nixietab/picodulce.git
synced 2025-04-10 10:28:56 +01:00
autism
This commit is contained in:
parent
b56efa6b1f
commit
b817b18331
128
picodulce.py
128
picodulce.py
@ -324,74 +324,112 @@ class PicomcVersionSelector(QWidget):
|
|||||||
with open(config_path, "w") as config_file:
|
with open(config_path, "w") as config_file:
|
||||||
json.dump(self.config, config_file, indent=4)
|
json.dump(self.config, config_file, indent=4)
|
||||||
|
|
||||||
|
|
||||||
def manage_accounts(self):
|
def manage_accounts(self):
|
||||||
dialog = QDialog(self)
|
dialog = QDialog(self)
|
||||||
dialog.setWindowTitle('Manage Accounts')
|
dialog.setWindowTitle('Manage Accounts')
|
||||||
dialog.setFixedSize(400, 250)
|
dialog.setFixedSize(400, 250)
|
||||||
|
|
||||||
# Create title label
|
|
||||||
title_label = QLabel('Manage Accounts')
|
title_label = QLabel('Manage Accounts')
|
||||||
title_label.setFont(QFont("Arial", 14))
|
title_label.setFont(QFont("Arial", 14))
|
||||||
|
|
||||||
# Create dropdown menu for accounts
|
create_account_button = QPushButton('Create Account')
|
||||||
|
create_account_button.clicked.connect(self.open_create_account_dialog)
|
||||||
|
|
||||||
|
select_account_button = QPushButton('Select Account')
|
||||||
|
select_account_button.clicked.connect(self.open_select_account_dialog)
|
||||||
|
|
||||||
|
authenticate_account_button = QPushButton('Authenticate Account')
|
||||||
|
authenticate_account_button.clicked.connect(self.open_authenticate_account_dialog)
|
||||||
|
|
||||||
|
remove_account_button = QPushButton('Remove Account')
|
||||||
|
remove_account_button.clicked.connect(self.open_remove_account_dialog)
|
||||||
|
|
||||||
|
layout = QVBoxLayout()
|
||||||
|
layout.addWidget(title_label)
|
||||||
|
layout.addWidget(create_account_button)
|
||||||
|
layout.addWidget(select_account_button)
|
||||||
|
layout.addWidget(authenticate_account_button)
|
||||||
|
layout.addWidget(remove_account_button)
|
||||||
|
|
||||||
|
dialog.setLayout(layout)
|
||||||
|
dialog.exec_()
|
||||||
|
|
||||||
|
def open_create_account_dialog(self):
|
||||||
|
dialog = QDialog(self)
|
||||||
|
dialog.setWindowTitle('Create Account')
|
||||||
|
dialog.setFixedSize(300, 150)
|
||||||
|
|
||||||
|
username_input = QLineEdit()
|
||||||
|
username_input.setPlaceholderText('Enter Username')
|
||||||
|
|
||||||
|
microsoft_checkbox = QCheckBox('Microsoft Account')
|
||||||
|
|
||||||
|
create_button = QPushButton('Create')
|
||||||
|
create_button.clicked.connect(lambda: self.create_account(dialog, username_input.text(), microsoft_checkbox.isChecked()))
|
||||||
|
|
||||||
|
layout = QVBoxLayout()
|
||||||
|
layout.addWidget(username_input)
|
||||||
|
layout.addWidget(microsoft_checkbox)
|
||||||
|
layout.addWidget(create_button)
|
||||||
|
|
||||||
|
dialog.setLayout(layout)
|
||||||
|
dialog.exec_()
|
||||||
|
|
||||||
|
def open_select_account_dialog(self):
|
||||||
|
dialog = QDialog(self)
|
||||||
|
dialog.setWindowTitle('Select Account')
|
||||||
|
dialog.setFixedSize(300, 150)
|
||||||
|
|
||||||
account_combo = QComboBox()
|
account_combo = QComboBox()
|
||||||
self.populate_accounts(account_combo)
|
self.populate_accounts(account_combo)
|
||||||
|
|
||||||
# Create select button
|
|
||||||
select_button = QPushButton('Select')
|
select_button = QPushButton('Select')
|
||||||
select_button.clicked.connect(lambda: self.set_default_account(dialog, account_combo.currentText()))
|
select_button.clicked.connect(lambda: self.set_default_account(dialog, account_combo.currentText()))
|
||||||
|
|
||||||
# Create input field for account name
|
layout = QVBoxLayout()
|
||||||
account_input = QLineEdit()
|
layout.addWidget(account_combo)
|
||||||
account_input.setPlaceholderText('Xx_PussySlayer_xX')
|
layout.addWidget(select_button)
|
||||||
|
|
||||||
# Create button to create new account
|
dialog.setLayout(layout)
|
||||||
create_account_button = QPushButton('Create')
|
dialog.exec_()
|
||||||
create_account_button.clicked.connect(lambda: self.create_account(dialog, account_input.text(), microsoft_checkbox.isChecked()))
|
|
||||||
|
|
||||||
# Create checkbox for Microsoft account
|
def open_authenticate_account_dialog(self):
|
||||||
microsoft_checkbox = QCheckBox('Microsoft Account')
|
dialog = QDialog(self)
|
||||||
|
dialog.setWindowTitle('Authenticate Account')
|
||||||
|
dialog.setFixedSize(300, 150)
|
||||||
|
|
||||||
|
account_combo = QComboBox()
|
||||||
|
self.populate_accounts(account_combo)
|
||||||
|
|
||||||
# Create button to authenticate
|
|
||||||
authenticate_button = QPushButton('Authenticate')
|
authenticate_button = QPushButton('Authenticate')
|
||||||
authenticate_button.clicked.connect(lambda: self.authenticate_account(dialog, account_combo.currentText()))
|
authenticate_button.clicked.connect(lambda: self.authenticate_account(dialog, account_combo.currentText()))
|
||||||
|
|
||||||
# Create button to remove account
|
layout = QVBoxLayout()
|
||||||
remove_account_button = QPushButton('Remove Account')
|
layout.addWidget(account_combo)
|
||||||
remove_account_button.clicked.connect(lambda: self.remove_account(dialog, account_combo.currentText()))
|
layout.addWidget(authenticate_button)
|
||||||
|
|
||||||
# Create layout for account selection
|
dialog.setLayout(layout)
|
||||||
account_selection_layout = QVBoxLayout()
|
|
||||||
account_selection_layout.addWidget(title_label)
|
|
||||||
account_selection_layout.addWidget(account_combo)
|
|
||||||
account_selection_layout.addWidget(select_button)
|
|
||||||
|
|
||||||
# Create layout for account creation
|
|
||||||
create_account_layout = QHBoxLayout()
|
|
||||||
create_account_layout.addWidget(account_input)
|
|
||||||
create_account_layout.addWidget(create_account_button)
|
|
||||||
|
|
||||||
# Create layout for Microsoft account checkbox and authenticate button
|
|
||||||
microsoft_layout = QVBoxLayout()
|
|
||||||
microsoft_layout.addWidget(microsoft_checkbox)
|
|
||||||
microsoft_layout.addWidget(authenticate_button)
|
|
||||||
|
|
||||||
# Create layout for remove account button
|
|
||||||
remove_account_layout = QVBoxLayout()
|
|
||||||
remove_account_layout.addWidget(remove_account_button)
|
|
||||||
|
|
||||||
# Create main layout
|
|
||||||
main_layout = QVBoxLayout()
|
|
||||||
main_layout.addLayout(account_selection_layout)
|
|
||||||
main_layout.addLayout(create_account_layout)
|
|
||||||
main_layout.addLayout(microsoft_layout)
|
|
||||||
# main_layout.addStretch(1)
|
|
||||||
main_layout.addLayout(remove_account_layout)
|
|
||||||
|
|
||||||
dialog.setLayout(main_layout)
|
|
||||||
dialog.exec_()
|
dialog.exec_()
|
||||||
|
|
||||||
|
def open_remove_account_dialog(self):
|
||||||
|
dialog = QDialog(self)
|
||||||
|
dialog.setWindowTitle('Remove Account')
|
||||||
|
dialog.setFixedSize(300, 150)
|
||||||
|
|
||||||
|
account_combo = QComboBox()
|
||||||
|
self.populate_accounts(account_combo)
|
||||||
|
|
||||||
|
remove_button = QPushButton('Remove')
|
||||||
|
remove_button.clicked.connect(lambda: self.remove_account(dialog, account_combo.currentText()))
|
||||||
|
|
||||||
|
layout = QVBoxLayout()
|
||||||
|
layout.addWidget(account_combo)
|
||||||
|
layout.addWidget(remove_button)
|
||||||
|
|
||||||
|
dialog.setLayout(layout)
|
||||||
|
dialog.exec_()
|
||||||
|
|
||||||
|
|
||||||
def authenticate_account(self, dialog, account_name):
|
def authenticate_account(self, dialog, account_name):
|
||||||
# Remove leading " * " from the account name
|
# Remove leading " * " from the account name
|
||||||
account_name = account_name.strip().lstrip(" * ")
|
account_name = account_name.strip().lstrip(" * ")
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.9.4",
|
"version": "0.9.5",
|
||||||
"links": [
|
"links": [
|
||||||
"https://raw.githubusercontent.com/nixietab/picodulce/main/version.json",
|
"https://raw.githubusercontent.com/nixietab/picodulce/main/version.json",
|
||||||
"https://raw.githubusercontent.com/nixietab/picodulce/main/picodulce.py",
|
"https://raw.githubusercontent.com/nixietab/picodulce/main/picodulce.py",
|
||||||
|
Loading…
Reference in New Issue
Block a user