Still moving stuff around

This commit is contained in:
sezanzeb 2020-11-09 23:47:54 +01:00
parent f7db8b4a26
commit d4ad001560
2 changed files with 3 additions and 16 deletions

View File

@ -33,7 +33,7 @@ from gi.repository import Gtk
from keymapper.logger import logger, update_verbosity, log_info from keymapper.logger import logger, update_verbosity, log_info
from keymapper.gtk.error import ErrorDialog from keymapper.gtk.error import ErrorDialog
from keymapper.gtk.window import launch from keymapper.gtk.window import Window
if __name__ == '__main__': if __name__ == '__main__':
@ -48,7 +48,7 @@ if __name__ == '__main__':
update_verbosity(options.debug) update_verbosity(options.debug)
log_info() log_info()
window = launch() window = Window()
if getpass.getuser() != 'root' and 'unittest' not in sys.modules.keys(): if getpass.getuser() != 'root' and 'unittest' not in sys.modules.keys():
# TODO add a polkit thing like # TODO add a polkit thing like

View File

@ -163,7 +163,7 @@ class Window:
f'Saved "{self.selected_preset}"' f'Saved "{self.selected_preset}"'
) )
except PermissionError as e: except PermissionError as e:
window.get('status_bar').push( self.get('status_bar').push(
CTX_ERROR, CTX_ERROR,
'Error: Permission denied!' 'Error: Permission denied!'
) )
@ -269,16 +269,3 @@ class Window:
self.selected_device, self.selected_device,
self.selected_preset self.selected_preset
) )
window = None
def launch():
"""Construct the window and prepare it for other modules to import.
You still have to run the GTK main loop.
"""
global window
window = Window()
return window