示例#1
0
文件: upshot.py 项目: asmod3us/upshot
    def applicationDidFinishLaunching_(self, notification):
        if not DROPBOX_DIR:  # Oh-oh.
            alert('Unable to detect Dropbox folder',
                  'UpShot requires Dropbox, for now. Please install it, then '
                  'try again.', ['OK'])
            self.quit_(self)

        if not os.path.exists(PUBLIC_DIR):  # No public folder?
            pressed = alert(
                'Unable to detect Public Dropbox folder',
                'UpShot requires a Dropbox Public folder. You seem to have '
                'Dropbox, but no Public folder.\n\n'
                'Since October 2012, Dropbox will only create a public '
                'folder for you if you opt in to it.\n\n'
                'Please do so before using UpShot.',
                ['Learn How to Create a Dropbox Public Folder',
                 'Quit UpShot'])
            if pressed == NSAlertFirstButtonReturn:
                # Open Dropboc opt-in
                sw = NSWorkspace.sharedWorkspace()
                sw.openURL_(NSURL.URLWithString_(DROPBOX_PUBLIC_INFO))
            self.quit_(self)

        self.build_menu()
        # Go do something useful.
        if utils.get_pref('dropboxid'):
            self.startListening_()
        else:
            self.stopListening_()
            DropboxDetect.DropboxDetectWindowController.showWindow()
示例#2
0
文件: upshot.py 项目: asmod3us/upshot
    def applicationDidFinishLaunching_(self, notification):
        if not DROPBOX_DIR:  # Oh-oh.
            alert(
                'Unable to detect Dropbox folder',
                'UpShot requires Dropbox, for now. Please install it, then '
                'try again.', ['OK'])
            self.quit_(self)

        if not os.path.exists(PUBLIC_DIR):  # No public folder?
            pressed = alert(
                'Unable to detect Public Dropbox folder',
                'UpShot requires a Dropbox Public folder. You seem to have '
                'Dropbox, but no Public folder.\n\n'
                'Since October 2012, Dropbox will only create a public '
                'folder for you if you opt in to it.\n\n'
                'Please do so before using UpShot.',
                ['Learn How to Create a Dropbox Public Folder', 'Quit UpShot'])
            if pressed == NSAlertFirstButtonReturn:
                # Open Dropboc opt-in
                sw = NSWorkspace.sharedWorkspace()
                sw.openURL_(NSURL.URLWithString_(DROPBOX_PUBLIC_INFO))
            self.quit_(self)

        self.build_menu()
        # Go do something useful.
        if utils.get_pref('dropboxid'):
            self.startListening_()
        else:
            self.stopListening_()
            DropboxDetect.DropboxDetectWindowController.showWindow()
示例#3
0
文件: upshot.py 项目: jirwin/upshot
    def applicationDidFinishLaunching_(self, notification):
        if not DROPBOX_DIR:  # Oh-oh.
            alert('Unable to detect Dropbox folder',
                  'UpShot requires Dropbox, for now. Please install it, then '
                  'try again.', ['OK'])
            self.terminate_(self)

        self.build_menu()
        # Go do something useful.
        if utils.get_pref('dropboxid'):
            self.startListening_()
        else:
            self.stopListening_()
            DropboxDetect.DropboxDetectWindowController.showWindow()
示例#4
0
    def applicationDidFinishLaunching_(self, notification):
        if not DROPBOX_DIR:  # Oh-oh.
            alert(
                'Unable to detect Dropbox folder',
                'UpShot requires Dropbox, for now. Please install it, then '
                'try again.', ['OK'])
            self.terminate_(self)

        self.build_menu()
        # Go do something useful.
        if utils.get_pref('dropboxid'):
            self.startListening_()
        else:
            self.stopListening_()
            DropboxDetect.DropboxDetectWindowController.showWindow()