@@ -27,7 +27,7 @@ class AccountDialogWidget(QDialog):
27
27
28
28
def __init__ (self , parent : QWidget | None = None , account : Account | None = None ):
29
29
super ().__init__ (parent )
30
- self .setFixedHeight (200 )
30
+ self .setFixedHeight (230 )
31
31
self .setFixedWidth (700 )
32
32
main_layout = QVBoxLayout ()
33
33
options_group_box = QGroupBox ("Options" )
@@ -39,16 +39,13 @@ def __init__(self, parent: QWidget | None = None, account: Account | None = None
39
39
left_layout = QFormLayout ()
40
40
right_layout = QFormLayout ()
41
41
42
- username_label : Final = QLabel ("Account :" , self )
43
- self .username : Final = QLineEdit ()
44
- left_layout .addRow (username_label , self .username )
42
+ profile_name_label : Final = QLabel ("Profile Name :" , self )
43
+ self .profile_name : Final = QLineEdit ()
44
+ left_layout .addRow (profile_name_label , self .profile_name )
45
45
46
- region_label : Final = QLabel ("Region:" , self )
47
- self .region_combobox : Final = QComboBox ()
48
- self .region_combobox .addItem (Region .Europe .name , Region .Europe )
49
- self .region_combobox .addItem (Region .Americas .name , Region .Americas )
50
- self .region_combobox .addItem (Region .Asia .name , Region .Asia )
51
- right_layout .addRow (region_label , self .region_combobox )
46
+ email_label : Final = QLabel ("Account:" , self )
47
+ self .email : Final = QLineEdit ()
48
+ left_layout .addRow (email_label , self .email )
52
49
53
50
auth_label : Final = QLabel ("Auth Method:" , self )
54
51
self .auth_combobox : Final = QComboBox ()
@@ -57,11 +54,22 @@ def __init__(self, parent: QWidget | None = None, account: Account | None = None
57
54
self .auth_combobox .currentTextChanged .connect (self .change_password_token_widget )
58
55
left_layout .addRow (auth_label , self .auth_combobox )
59
56
57
+ region_label : Final = QLabel ("Region:" , self )
58
+ self .region_combobox : Final = QComboBox ()
59
+ self .region_combobox .addItem (Region .Europe .name , Region .Europe )
60
+ self .region_combobox .addItem (Region .Americas .name , Region .Americas )
61
+ self .region_combobox .addItem (Region .Asia .name , Region .Asia )
62
+ right_layout .addRow (region_label , self .region_combobox )
63
+
60
64
self .password_label : Final = QLabel ("Password:" , self )
61
65
# self.password: Final = QLineEdit()
62
66
# right_layout.addRow(self.password_label, self.password)
63
67
self .password : PasswordWidget = PasswordWidget ("" )
64
- right_layout .addRow (self .password_label , self .password )
68
+ left_layout .addRow (self .password_label , self .password )
69
+
70
+ params_label : Final = QLabel ("Start Parameters:" , self )
71
+ self .params : Final = QLineEdit ()
72
+ right_layout .addRow (params_label , self .params )
65
73
66
74
self .token_label : Final = QLabel ("Token:" , self )
67
75
self .token : Final = QTextEdit ()
@@ -70,12 +78,9 @@ def __init__(self, parent: QWidget | None = None, account: Account | None = None
70
78
)
71
79
right_layout .addRow (self .token_label , self .token )
72
80
73
- params_label : Final = QLabel ("Start Parameters:" , self )
74
- self .params : Final = QLineEdit ()
75
- left_layout .addRow (params_label , self .params )
76
-
77
81
if account is not None :
78
- self .username .setText (account .username )
82
+ self .profile_name .setText (account .profile_name or "" )
83
+ self .email .setText (account .email )
79
84
account_idx = self .auth_combobox .findData (account .auth_method )
80
85
self .auth_combobox .setCurrentIndex (account_idx )
81
86
region_idx = self .region_combobox .findData (account .region )
@@ -104,7 +109,7 @@ def __init__(self, parent: QWidget | None = None, account: Account | None = None
104
109
if account is None :
105
110
self .setWindowTitle ("Add a new Account" )
106
111
else :
107
- self .setWindowTitle (f"Edit Account - Username : { account .username } " )
112
+ self .setWindowTitle (f"Edit Account - email : { account .email } " )
108
113
109
114
button_box .accepted .connect (self .accept )
110
115
button_box .rejected .connect (self .reject )
@@ -115,7 +120,8 @@ def __init__(self, parent: QWidget | None = None, account: Account | None = None
115
120
@property
116
121
def data (self ):
117
122
return Account (
118
- username = self .username .text (),
123
+ profile_name = self .profile_name .text (),
124
+ email = self .email .text (),
119
125
auth_method = cast (
120
126
AuthMethod ,
121
127
self .auth_combobox .itemData (self .auth_combobox .currentIndex ()),
0 commit comments