def ok_(self, sender): if self.detected_id: set_pref('dropboxid', self.detected_id) # Start sharing. app = NSApplication.sharedApplication() app.delegate().restart_() self.cancel_(sender)
def saveSettings_(self, sender): """Save changed settings.""" set_pref('randomize', bool(self.randomize.state())) set_pref('copyonly', bool(self.copyonly.state())) set_pref('launchAtStartup', bool(self.launchAtStartup.state())) launch_at_startup(bool(self.launchAtStartup.state())) try: set_pref('dropboxid', int(self.dropboxid.stringValue())) except ValueError: pass
def saveSettings_(self, sender): """Save changed settings.""" set_pref("launchAtStartup", bool(self.launchAtStartup.state())) launch_at_startup(bool(self.launchAtStartup.state())) # Iconset iconset_sel = self.iconset.selectedCell().tag() if iconset_sel == 1: # Grayscale set_pref("iconset", "grayscale") else: set_pref("iconset", "default") upshot = NSApplication.sharedApplication().delegate() upshot.update_menu() set_pref("copyonly", bool(self.copyonly.state())) set_pref("retinascale", bool(self.retinascale.state())) # Custom URL settings. if self.url_select.selectedCell().tag() == 0: # Default set_pref("share_format", "long") elif self.url_select.selectedCell().tag() == 1: # Custom set_pref("share_format", "short")
def saveSettings_(self, sender): """Save changed settings.""" set_pref('launchAtStartup', bool(self.launchAtStartup.state())) launch_at_startup(bool(self.launchAtStartup.state())) # Iconset iconset_sel = self.iconset.selectedCell().tag() if iconset_sel == 1: # Grayscale set_pref('iconset', 'grayscale') else: set_pref('iconset', 'default') upshot = NSApplication.sharedApplication().delegate() upshot.update_menu() set_pref('randomize', bool(self.randomize.state())) set_pref('copyonly', bool(self.copyonly.state())) set_pref('retinascale', bool(self.retinascale.state())) try: set_pref('dropboxid', int(self.dropboxid.stringValue())) except ValueError: pass # Custom URL settings. if self.url_select.selectedCell().tag() == 0: # Default self.url_text.setStringValue_('') self.url_text.setEnabled_(False) self.url_example.setStringValue_( share_url(EXAMPLE_FILENAME, url='')) set_pref('customurl', '') else: # Custom self.url_text.setEnabled_(True) self.url_example.setStringValue_( share_url(EXAMPLE_FILENAME, url=self.url_text.stringValue())) set_pref('customurl', self.url_text.stringValue())
def saveSettings_(self, sender): """Save changed settings.""" set_pref("launchAtStartup", bool(self.launchAtStartup.state())) launch_at_startup(bool(self.launchAtStartup.state())) # Iconset iconset_sel = self.iconset.selectedCell().tag() if iconset_sel == 1: # Grayscale set_pref("iconset", "grayscale") else: set_pref("iconset", "default") upshot = NSApplication.sharedApplication().delegate() upshot.update_menu() set_pref("randomize", bool(self.randomize.state())) set_pref("copyonly", bool(self.copyonly.state())) try: set_pref("dropboxid", int(self.dropboxid.stringValue())) except ValueError: pass # Custom URL settings. if self.url_select.selectedCell().tag() == 0: # Default self.url_text.setStringValue_("") self.url_text.setEnabled_(False) self.url_example.setStringValue_(share_url(EXAMPLE_FILENAME, url="")) set_pref("customurl", "") else: # Custom self.url_text.setEnabled_(True) self.url_example.setStringValue_(share_url(EXAMPLE_FILENAME, url=self.url_text.stringValue())) set_pref("customurl", self.url_text.stringValue())
def saveSettings_(self, sender): """Save changed settings.""" set_pref('launchAtStartup', bool(self.launchAtStartup.state())) launch_at_startup(bool(self.launchAtStartup.state())) set_pref('autoupdate', bool(self.autoupdate.state())) upshot = NSApplication.sharedApplication().delegate() upshot.updater.sparkle.setAutomaticallyChecksForUpdates_( bool(self.autoupdate.state())) set_pref('randomize', bool(self.randomize.state())) set_pref('copyonly', bool(self.copyonly.state())) set_pref('retinascale', bool(self.retinascale.state())) try: set_pref('dropboxid', int(self.dropboxid.stringValue())) except ValueError: pass # Custom URL settings. example_filename = (EXAMPLE_FILENAME_SHORT if get_pref('randomize') else EXAMPLE_FILENAME_LONG) if self.url_select.selectedCell().tag() == 0: # Default self.url_text.setStringValue_('') self.url_text.setEnabled_(False) self.url_example.setStringValue_( share_url(example_filename, url='')) set_pref('customurl', '') else: # Custom self.url_text.setEnabled_(True) self.url_example.setStringValue_( share_url(example_filename, url=self.url_text.stringValue())) set_pref('customurl', self.url_text.stringValue())
def saveSettings_(self, sender): """Save changed settings.""" set_pref('launchAtStartup', bool(self.launchAtStartup.state())) launch_at_startup(bool(self.launchAtStartup.state())) # Iconset iconset_sel = self.iconset.selectedCell().tag() if iconset_sel == 1: # Grayscale set_pref('iconset', 'grayscale') else: set_pref('iconset', 'default') upshot = NSApplication.sharedApplication().delegate() upshot.update_menu() set_pref('randomize', bool(self.randomize.state())) set_pref('copyonly', bool(self.copyonly.state())) set_pref('retinascale', bool(self.retinascale.state())) try: set_pref('dropboxid', int(self.dropboxid.stringValue())) except ValueError: pass # Custom URL settings. if self.url_select.selectedCell().tag() == 0: # Default self.url_text.setStringValue_('') self.url_text.setEnabled_(False) self.url_example.setStringValue_(share_url(EXAMPLE_FILENAME, url='')) set_pref('customurl', '') else: # Custom self.url_text.setEnabled_(True) self.url_example.setStringValue_( share_url(EXAMPLE_FILENAME, url=self.url_text.stringValue())) set_pref('customurl', self.url_text.stringValue())
def saveSettings_(self, sender): """Save changed settings.""" set_pref('launchAtStartup', bool(self.launchAtStartup.state())) launch_at_startup(bool(self.launchAtStartup.state())) set_pref('autoupdate', bool(self.autoupdate.state())) upshot = NSApplication.sharedApplication().delegate() upshot.updater.sparkle.setAutomaticallyChecksForUpdates_( bool(self.autoupdate.state())) set_pref('randomize', bool(self.randomize.state())) set_pref('copyonly', bool(self.copyonly.state())) set_pref('retinascale', bool(self.retinascale.state())) try: set_pref('dropboxid', int(self.dropboxid.stringValue())) except ValueError: pass # Custom URL settings. example_filename = (EXAMPLE_FILENAME_SHORT if get_pref('randomize') else EXAMPLE_FILENAME_LONG) if self.url_select.selectedCell().tag() == 0: # Default self.url_text.setStringValue_('') self.url_text.setEnabled_(False) self.url_example.setStringValue_(share_url(example_filename, url='')) set_pref('customurl', '') else: # Custom self.url_text.setEnabled_(True) self.url_example.setStringValue_( share_url(example_filename, url=self.url_text.stringValue())) set_pref('customurl', self.url_text.stringValue())