-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathapplication.py
34 lines (26 loc) · 1.08 KB
/
application.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
import logging
from .controllers import controllers
from .layouts import MainWindow
from .logger import ABHandler
logger = logging.getLogger('ab_logs')
log = ABHandler.setup_with_logger(logger, __name__)
class Application(object):
def __init__(self):
self.main_window = MainWindow(self)
# Provide the log file path, so it is available for the Activity-Browser
# debug window/text box
log.info("The Activity-Browser log file can be found at {}".format(log.log_file_path()))
# Instantiate all the controllers.
# -> Ensure all controller instances have access to the MainWindow
# object, this propagates the 'AB' icon to all controller-handled
# dialogs and wizards.
for attr, controller in controllers.items():
setattr(self, attr, controller(self.main_window))
def show(self):
self.main_window.showMaximized()
def close(self):
self.plugin_controller.close_plugins()
self.main_window.close()
def deleteLater(self):
self.main_window.deleteLater()