def check_flash_install(): request_count = app.config.get(prefs.FLASH_REQUEST_COUNT) if _is_flash_installed() or request_count > 0: return title = _("Install Adobe Flash?") description = _( "For the best %(appname)s experience, we suggest you install Adobe Flash. Would you " "like to do this now?", {"appname": app.config.get(prefs.SHORT_APP_NAME)}) ret = dialogs.show_choice_dialog( title, description, [dialogs.BUTTON_YES, dialogs.BUTTON_NOT_NOW, dialogs.BUTTON_NO]) if ret is None or ret == dialogs.BUTTON_NOT_NOW: return elif ret == dialogs.BUTTON_YES: app.widgetapp.open_url(FLASH_URL) title = _("Install Adobe Flash") description = _( "Your browser will load the web-site where you can download and install " "Adobe Flash.\n" "\n" "You should quit %(appname)s now and start it up again after Adobe Flash has " "been installed.", {"appname": app.config.get(prefs.SHORT_APP_NAME)}) dialogs.show_message(title, description) else: app.config.set(prefs.FLASH_REQUEST_COUNT, 1)
def check_bonjour_install(): request_count = app.config.get(prefs.BONJOUR_REQUEST_COUNT) if app.sharing_manager.mdns_present or request_count > 0: return title = _('Install Bonjour') description = _( 'For the best %(appname)s experience, we suggest you ' 'install Bonjour, which is distributed as a part of ' 'Print Services.\n\n' 'Installing Bonjour will allow you share your media ' 'library with other %(appname)s users on your network, ' 'as well as stream media from other %(appname)s users ' 'on your network.\n\n' 'After installing Print Services, you will have to restart ' '%(appname)s.\n\n' 'Would you like to do this now?', {"appname": app.config.get(prefs.SHORT_APP_NAME)} ) ret = dialogs.show_choice_dialog(title, description, [dialogs.BUTTON_YES, dialogs.BUTTON_NOT_NOW, dialogs.BUTTON_NO ]) if ret is None or ret == dialogs.BUTTON_NOT_NOW: return elif ret == dialogs.BUTTON_YES: install_bonjour() else: app.config.set(prefs.BONJOUR_REQUEST_COUNT, 1)
def check_flash_install(): request_count = app.config.get(prefs.FLASH_REQUEST_COUNT) if _is_flash_installed() or request_count > 0: return title = _("Install Adobe Flash?") description = _( "For the best %(appname)s experience, we suggest you install Adobe Flash. Would you " "like to do this now?", {"appname": app.config.get(prefs.SHORT_APP_NAME)} ) ret = dialogs.show_choice_dialog(title, description, [dialogs.BUTTON_YES, dialogs.BUTTON_NOT_NOW, dialogs.BUTTON_NO]) if ret is None or ret == dialogs.BUTTON_NOT_NOW: return elif ret == dialogs.BUTTON_YES: app.widgetapp.open_url(FLASH_URL) title = _("Install Adobe Flash") description = _( "Your browser will load the web-site where you can download and install " "Adobe Flash.\n" "\n" "You should quit %(appname)s now and start it up again after Adobe Flash has " "been installed.", {"appname": app.config.get(prefs.SHORT_APP_NAME)} ) dialogs.show_message(title, description) else: app.config.set(prefs.FLASH_REQUEST_COUNT, 1)
def on_window_closed(self): if self.path != self.initial_path: title = _("Migrate existing movies?") description = _("You've selected a new folder to download movies " "to. Should %(appname)s migrate your existing downloads there? " "(Currently downloading movies will not be moved until " "they finish.)", {'appname': app.config.get(prefs.SHORT_APP_NAME)}) response = dialogs.show_choice_dialog(title, description, (dialogs.BUTTON_MIGRATE, dialogs.BUTTON_DONT_MIGRATE), transient_for=_pref_window) migrate = (response is dialogs.BUTTON_MIGRATE) m = messages.ChangeMoviesDirectory(self.path, migrate) m.send_to_backend()
def ask_for_feed_subscribe(url): url = feed.normalize_feed_url(url) title = _("Subscribe to Podcast") text = _( "This link appears to be a podcast. Do you want to add it to " "your subscriptions?\n" "\n" "%(url)s", {"url": url} ) choices = (dialogs.BUTTON_SUBSCRIBE, dialogs.BUTTON_CANCEL) ret = dialogs.show_choice_dialog(title, text, choices) if ret == dialogs.BUTTON_SUBSCRIBE: messages.NewFeed(url).send_to_backend()
def install_bonjour(startup=False): title = _("Install Bonjour") if not startup: description = _('For the best %(appname)s experience, we suggest you ' 'install Bonjour. Installing Bonjour will ' 'allow you share your media library with other ' '%(appname)s users on your network, as well as stream ' 'media from other %(appname)s users on your ' 'network.\n\n' '%(appname)s has determined that your system is most ' 'likely missing the Avahi mDNSResponder compatibility ' 'library. Please refer to your operating system ' 'documentation on how you can install this library.', {"appname": app.config.get(prefs.SHORT_APP_NAME)} ) else: description = _('For the best %(appname)s experience, we suggest you ' 'install Bonjour. Installing Bonjour will ' 'allow you share your media library with other ' '%(appname)s users on your network, as well as stream ' 'media from other %(appname)s users on your ' 'network.\n\n' '%(appname)s has determined that your system is most ' 'likely missing the Avahi mDNSResponder compatibility ' 'library. Please refer to your operating system ' 'documentation on how you can install this ' 'library.\n\n' 'Would you like %(appname)s to warn you on next ' 'startup?', {"appname": app.config.get(prefs.SHORT_APP_NAME)} ) if not startup: dialogs.show_message(title, description) else: # Buttons in this order because if the window is destroyed by the # "X" button it becomes -1 which is the last element of the list. ret = dialogs.show_choice_dialog(title, description, [dialogs.BUTTON_NO, dialogs.BUTTON_YES ]) if ret is None or ret == dialogs.BUTTON_YES: return else: app.config.set(prefs.BONJOUR_REQUEST_COUNT, 1)
def on_close(self): if app.config.get(prefs.MINIMIZE_TO_TRAY_ASK_ON_CLOSE): ret = dialogs.show_choice_dialog( _("Close to tray?"), _("When you click the red close button, would you like %(appname)s to " "close to the system tray or quit? You can change this " "setting later in the Options.", {"appname": app.config.get(prefs.SHORT_APP_NAME)}), (dialogs.BUTTON_QUIT, dialogs.BUTTON_CLOSE_TO_TRAY)) app.config.set(prefs.MINIMIZE_TO_TRAY_ASK_ON_CLOSE, False) if ret == dialogs.BUTTON_CLOSE_TO_TRAY: app.config.set(prefs.MINIMIZE_TO_TRAY, True) else: app.config.set(prefs.MINIMIZE_TO_TRAY, False) if app.config.get(prefs.MINIMIZE_TO_TRAY): self.trayicon.on_click(None) else: self.quit()
def install_bonjour(startup=False): title = _("Install Bonjour") if not startup: description = _( 'For the best %(appname)s experience, we suggest you ' 'install Bonjour. Installing Bonjour will ' 'allow you share your media library with other ' '%(appname)s users on your network, as well as stream ' 'media from other %(appname)s users on your ' 'network.\n\n' '%(appname)s has determined that your system is most ' 'likely missing the Avahi mDNSResponder compatibility ' 'library. Please refer to your operating system ' 'documentation on how you can install this library.', {"appname": app.config.get(prefs.SHORT_APP_NAME)}) else: description = _( 'For the best %(appname)s experience, we suggest you ' 'install Bonjour. Installing Bonjour will ' 'allow you share your media library with other ' '%(appname)s users on your network, as well as stream ' 'media from other %(appname)s users on your ' 'network.\n\n' '%(appname)s has determined that your system is most ' 'likely missing the Avahi mDNSResponder compatibility ' 'library. Please refer to your operating system ' 'documentation on how you can install this ' 'library.\n\n' 'Would you like %(appname)s to warn you on next ' 'startup?', {"appname": app.config.get(prefs.SHORT_APP_NAME)}) if not startup: dialogs.show_message(title, description) else: # Buttons in this order because if the window is destroyed by the # "X" button it becomes -1 which is the last element of the list. ret = dialogs.show_choice_dialog( title, description, [dialogs.BUTTON_NO, dialogs.BUTTON_YES]) if ret is None or ret == dialogs.BUTTON_YES: return else: app.config.set(prefs.BONJOUR_REQUEST_COUNT, 1)