Exemple #1
0
 def applicationDidFinishLaunching_(self, notification):
     if debug_mode:
         Debugging.installPythonExceptionHandler()
     self.reg = Registry()
     self.the_account = Account(self.reg, read_config())
     self._set_up_ui()
     self.the_account.update_if_needed()
Exemple #2
0
class tinymailAppDelegate(NSObject):
    window = objc.IBOutlet()
    foldersPane = objc.IBOutlet()
    messagesPane = objc.IBOutlet()
    messageView = objc.IBOutlet()
    activityTable = objc.IBOutlet()

    def applicationDidFinishLaunching_(self, notification):
        if debug_mode:
            Debugging.installPythonExceptionHandler()
        self.reg = Registry()
        self.the_account = Account(self.reg, read_config())
        self._set_up_ui()
        self.the_account.update_if_needed()

    def _set_up_ui(self):
        FolderListingDelegate.create(self.reg, self.foldersPane,
                                     self.the_account)
        MessageListingDelegate.create(self.reg, self.messagesPane)
        MessageViewDelegate.create(self.reg, self.messageView)
        ActivityDelegate.create(self.reg, self.activityTable)

        self.window.orderWindow_relativeTo_(AppKit.NSWindowAbove,
                self.activityTable.window().windowNumber())

    @objc.IBAction
    def doSync_(self, sender):
        self.the_account.sync_folders()

    def applicationWillTerminate_(self, notification):
        self.the_account.cleanup()