def start_XpraClient(): app = XpraClient(conn, xpra_opts) if xpra_opts.password: #pass the password to the class directly: app.password = xpra_opts.password #override exit code: warn_and_quit_save = app.warn_and_quit def warn_and_quit_override(exit_code, warning): app.cleanup() password_warning = warning.find("invalid password") >= 0 if password_warning: self.password_warning() err = exit_code != 0 or password_warning self.set_info_color(err) self.set_info_text(warning) if err: def ignore_further_quit_events(*args): pass app.warn_and_quit = ignore_further_quit_events self.set_sensitive(True) gobject.idle_add(self.window.show) else: app.warn_and_quit = warn_and_quit_save self.destroy() gtk.main_quit() app.warn_and_quit = warn_and_quit_override
def start_XpraClient(): app = XpraClient(socket_wrapper, opts) if opts.password: app.password = opts.password warn_and_quit_save = app.warn_and_quit def warn_and_quit_override(exit_code, warning): app.cleanup() err = exit_code != 0 or warning.find("invalid password") >= 0 self.set_info_color(err) self.set_info_text(warning) self.window.show() self.window.set_sensitive(True) if err: def ignore_further_quit_events(*args): pass app.warn_and_quit = ignore_further_quit_events else: app.warn_and_quit = warn_and_quit_save gtk.main_quit() app.warn_and_quit = warn_and_quit_override app.run() app.cleanup()
def start_XpraClient(): app = XpraClient(conn, xpra_opts) if xpra_opts.password: #pass the password to the class directly: app.password = xpra_opts.password #override exit code: warn_and_quit_save = app.warn_and_quit def warn_and_quit_override(exit_code, warning): app.cleanup() password_warning = warning.find("invalid password")>=0 if password_warning: self.password_warning() err = exit_code!=0 or password_warning self.set_info_color(err) self.set_info_text(warning) if err: def ignore_further_quit_events(*args): pass app.warn_and_quit = ignore_further_quit_events self.set_sensitive(True) gobject.idle_add(self.window.show) else: app.warn_and_quit = warn_and_quit_save self.destroy() gtk.main_quit() app.warn_and_quit = warn_and_quit_override