@@ -160,6 +160,10 @@ def on_click(self, event=None):
160160 # quit
161161 self .root .destroy ()
162162
163+ def check_submit (self ):
164+ if len (self .entry_username .get ()) > 0 and len (self .entry_password .get ()) > 0 :
165+ self .button_login .invoke ()
166+
163167 def show_loading_animation (self , index ):
164168 if index == self .frame_count :
165169 self .root .destroy ()
@@ -295,22 +299,24 @@ def resize(self, width: int, height: int):
295299 if self .fakeLoginScreen is not None :
296300 self .fakeLoginScreen .resize (width , height )
297301
302+ def check_submit (self ):
303+ self .fakeLoginScreen .check_submit ()
304+
298305 def set_username (self , username : str ):
299306 # FIXME: properly solve this concurrency
300307 if self .fakeLoginScreen is None :
301308 time .sleep (0.1 )
302309 if self .fakeLoginScreen is not None :
303310 self .fakeLoginScreen .set_username (username )
311+ self .check_submit ()
304312
305313 def set_password (self , password : str ):
306314 self .fakeLoginScreen .set_password (password )
315+ self .check_submit ()
307316
308317 def terminate (self ):
309318 # TODO: the user sees "An internal error has occurred."
310- for proc in (
311- self .rdp_server_process ,
312- self .rdp_client_process ,
313- ):
319+ for proc in (self .rdp_server_process , self .rdp_client_process ):
314320 if not isinstance (proc , subprocess .CompletedProcess ):
315321 proc .kill ()
316322 self .display .stop ()
0 commit comments