def __init__(self, parent): wx.Panel.__init__(self, parent) sizer = wx.BoxSizer(wx.VERTICAL) volume = wx.StaticText(self, -1, _(u"Volume")) self.volumeCtrl = wx.Slider(self) self.volumeCtrl.SetRange(0, 100) self.volumeCtrl.SetValue(config.main["sound"]["volume"] * 100) self.volumeCtrl.SetSize(self.volumeCtrl.GetBestSize()) volumeBox = wx.BoxSizer(wx.HORIZONTAL) volumeBox.Add(volume, 0, wx.ALL, 5) volumeBox.Add(self.volumeCtrl, 0, wx.ALL, 5) sizer.Add(volumeBox, 0, wx.ALL, 5) self.global_mute = wx.CheckBox(self, -1, _(u"Global mute")) self.global_mute.SetValue(config.main["sound"]["global_mute"]) sizer.Add(self.global_mute, 0, wx.ALL, 5) self.output_devices = sound_lib.output.Output.get_device_names() output_label = wx.StaticText(self, -1, _(u"Output device")) self.output = wx.ComboBox(self, -1, choices=self.output_devices, style=wx.CB_READONLY) self.output.SetValue(config.main["sound"]["output_device"]) self.output.SetSize(self.output.GetBestSize()) outputBox = wx.BoxSizer(wx.HORIZONTAL) outputBox.Add(output_label, 0, wx.ALL, 5) outputBox.Add(self.output, 0, wx.ALL, 5) sizer.Add(outputBox, 0, wx.ALL, 5) self.input_devices = sound_lib.input.Input.get_device_names() input_label = wx.StaticText(self, -1, _(u"Input device")) self.input = wx.ComboBox(self, -1, choices=self.input_devices, style=wx.CB_READONLY) self.input.SetValue(config.main["sound"]["input_device"]) self.input.SetSize(self.input.GetBestSize()) inputBox = wx.BoxSizer(wx.HORIZONTAL) inputBox.Add(input_label, 0, wx.ALL, 5) inputBox.Add(self.input, 0, wx.ALL, 5) sizer.Add(inputBox, 0, wx.ALL, 5) soundBox = wx.BoxSizer(wx.VERTICAL) self.soundpacks = [] [ self.soundpacks.append(i) for i in os.listdir(paths.sound_path()) if os.path.isdir(paths.sound_path(i)) == True ] soundpack_label = wx.StaticText(self, -1, _(u"Sound pack")) self.soundpack = wx.ComboBox(self, -1, choices=self.soundpacks, style=wx.CB_READONLY) self.soundpack.SetValue(config.main["sound"]["current_soundpack"]) self.soundpack.SetSize(self.soundpack.GetBestSize()) soundBox.Add(soundpack_label, 0, wx.ALL, 5) soundBox.Add(self.soundpack, 0, wx.ALL, 5) sizer.Add(soundBox, 0, wx.ALL, 5) self.SetSizer(sizer)
def check_soundpack(self): """ Checks if the folder where live the current soundpack exists.""" self.soundpack_OK = False if os.path.exists(paths.sound_path(config.main["sound"]["current_soundpack"])): self.path = paths.sound_path(config.main["sound"]["current_soundpack"]) self.soundpack_OK = True elif os.path.exists(paths.sound_path("default")): self.path = paths.sound_path("default") self.soundpack_OK = True else: self.soundpack_OK = False
def check_soundpack(self): """ Checks if the folder where live the current soundpack exists.""" self.soundpack_OK = False if os.path.exists(paths.sound_path(self.config["current_soundpack"])): self.path = paths.sound_path(self.config["current_soundpack"]) self.soundpack_OK = True elif os.path.exists(paths.sound_path("default")): log.error("The soundpack does not exist, using default...") self.path = paths.sound_path("default") self.soundpack_OK = True else: log.error("The current soundpack could not be found and the default soundpack has been deleted, Socializer will not play sounds.") self.soundpack_OK = False
def check_soundpack(self): """ Checks if the folder where live the current soundpack exists.""" self.soundpack_OK = False if os.path.exists(paths.sound_path(self.config["current_soundpack"])): self.path = paths.sound_path(self.config["current_soundpack"]) self.soundpack_OK = True elif os.path.exists(paths.sound_path("default")): log.error("The soundpack does not exist, using default...") self.path = paths.sound_path("default") self.soundpack_OK = True else: log.error("The current soundpack could not be found and the default soundpack has been deleted, " + application.name + " will not play sounds.") self.soundpack_OK = False
def check_soundpack(self): """ Checks if the folder where live the current soundpack exists.""" self.soundpack_OK = False if os.path.exists( paths.sound_path(config.main["sound"]["current_soundpack"])): self.path = paths.sound_path( config.main["sound"]["current_soundpack"]) self.soundpack_OK = True elif os.path.exists(paths.sound_path("default")): self.path = paths.sound_path("default") self.soundpack_OK = True else: self.soundpack_OK = False
def __init__(self): self.actions = [ _(u"The tweet may contain a playable audio"), _(u"A timeline has been created"), _(u"A timeline has been deleted"), _(u"You've received a direct message"), _(u"You've sent a direct message"), _(u"A bug has happened"), _(u"You've added a tweet to your favourites"), _(u"Someone's favourites have been updated"), _(u"The tweet has coordinates to determine its location"), _(u"There are no more tweets to read"), _(u"A list has a new tweet"), _(u"You can't add any more characters on the tweet"), _(u"You've been mentioned "), _(u"A new event has happened"), _(u"TW Blue is ready "), _(u"You've replied"), _(u"You've retweeted"), _(u"A search has been updated"), _(u"the buffer for trending topics has been updated"), _(u"There's a new tweet in the main buffer"), _(u"You've sent a tweet"), _(u"There's a new tweet in a timeline"), _(u"You have a new follower"), _(u"You've turned the volume up or down") ] self.files = os.listdir(paths.sound_path("default")) super(soundsTutorial, self).__init__(None, -1) if len(self.actions) > len(self.files): wx.MessageDialog( None, _(u"It seems as though the currently used sound pack needs an update. %i fails are still be required to use this function. Make sure to obtain the needed lacking sounds or to contact with the sound pack developer." ) % (len(self.actions) - len(self.files)), _(u"Error"), wx.ICON_ERROR).ShowModal() self.Destroy() self.SetTitle(_(u"Sounds tutorial")) panel = wx.Panel(self) sizer = wx.BoxSizer(wx.VERTICAL) label = wx.StaticText( panel, -1, _(u"Press enter to listen to the sound for the selected event")) self.items = wx.ListBox(panel, 1, choices=self.actions, style=wx.LB_SINGLE) self.items.SetSelection(0) listBox = wx.BoxSizer(wx.HORIZONTAL) listBox.Add(label) listBox.Add(self.items) play = wx.Button(panel, 1, (u"Play")) play.SetDefault() self.Bind(wx.EVT_BUTTON, self.onPlay, play) close = wx.Button(panel, wx.ID_CANCEL) btnBox = wx.BoxSizer(wx.HORIZONTAL) btnBox.Add(play) btnBox.Add(close) sizer.Add(listBox) sizer.Add(btnBox) panel.SetSizer(sizer)
def __init__(self): self.actions = [ _(u"The tweet may contain a playable audio"), _(u"A timeline has been created"), _(u"A timeline has been deleted"), _(u"You've received a direct message"), _(u"You've sent a direct message"), _(u"A bug has happened"), _(u"You've added a tweet to your favourites"), _(u"Someone's favourites have been updated"), _(u"The tweet has coordinates to determine its location"), _(u"There are no more tweets to read"), _(u"A list has a new tweet"), _(u"You can't add any more characters on the tweet"), _(u"You've been mentioned "), _(u"A new event has happened"), _(u"TW Blue is ready "), _(u"You've replied"), _(u"You've retweeted"), _(u"A search has been updated"), _(u"the buffer for trending topics has been updated"), _(u"There's a new tweet in the main buffer"), _(u"You've sent a tweet"), _(u"There's a new tweet in a timeline"), _(u"You have a new follower"), _(u"You've turned the volume up or down")] self.files = os.listdir(paths.sound_path("default")) super(soundsTutorial, self).__init__(None, -1) if len(self.actions) > len(self.files): wx.MessageDialog(None, _(u"It seems as though the currently used sound pack needs an update. %i fails are still be required to use this function. Make sure to obtain the needed lacking sounds or to contact with the sound pack developer.") % (len(self.actions) - len(self.files)), _(u"Error"), wx.ICON_ERROR).ShowModal() self.Destroy() self.SetTitle(_(u"Sounds tutorial")) panel = wx.Panel(self) sizer = wx.BoxSizer(wx.VERTICAL) label = wx.StaticText(panel, -1, _(u"Press enter to listen to the sound for the selected event")) self.items = wx.ListBox(panel, 1, choices=self.actions, style=wx.LB_SINGLE) self.items.SetSelection(0) listBox = wx.BoxSizer(wx.HORIZONTAL) listBox.Add(label) listBox.Add(self.items) play = wx.Button(panel, 1, (u"Play")) play.SetDefault() self.Bind(wx.EVT_BUTTON, self.onPlay, play) close = wx.Button(panel, wx.ID_CANCEL) btnBox = wx.BoxSizer(wx.HORIZONTAL) btnBox.Add(play) btnBox.Add(close) sizer.Add(listBox) sizer.Add(btnBox) panel.SetSizer(sizer)
def create_config(self): self.dialog.create_general_account() widgetUtils.connect_event(self.dialog.general.au, widgetUtils.BUTTON_PRESSED, self.manage_autocomplete) self.dialog.set_value("general", "relative_time", self.config["general"]["relative_times"]) self.dialog.set_value("general", "apiCalls", self.config["general"]["max_api_calls"]) self.dialog.set_value("general", "itemsPerApiCall", self.config["general"]["max_tweets_per_call"]) self.dialog.set_value("general", "reverse_timelines", self.config["general"]["reverse_timelines"]) rt = self.config["general"]["retweet_mode"] if rt == "ask": self.dialog.set_value("general", "retweet_mode", _(u"Ask")) elif rt == "direct": self.dialog.set_value("general", "retweet_mode", _(u"Retweet without comments")) else: self.dialog.set_value("general", "retweet_mode", _(u"Retweet with comments")) self.dialog.set_value("general", "persist_size", str(self.config["general"]["persist_size"])) self.dialog.create_other_buffers() buffer_values = self.get_buffers_list() self.dialog.buffers.insert_buffers(buffer_values) self.dialog.buffers.connect_hook_func(self.toggle_buffer_active) widgetUtils.connect_event(self.dialog.buffers.toggle_state, widgetUtils.BUTTON_PRESSED, self.toggle_state) widgetUtils.connect_event(self.dialog.buffers.up, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.move_up) widgetUtils.connect_event(self.dialog.buffers.down, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.move_down) self.dialog.create_ignored_clients(self.config["twitter"]["ignored_clients"]) widgetUtils.connect_event(self.dialog.ignored_clients.add, widgetUtils.BUTTON_PRESSED, self.add_ignored_client) widgetUtils.connect_event(self.dialog.ignored_clients.remove, widgetUtils.BUTTON_PRESSED, self.remove_ignored_client) self.input_devices = sound_lib.input.Input.get_device_names() self.output_devices = sound_lib.output.Output.get_device_names() self.soundpacks = [] [self.soundpacks.append(i) for i in os.listdir(paths.sound_path()) if os.path.isdir(paths.sound_path(i)) == True ] self.dialog.create_sound(self.input_devices, self.output_devices, self.soundpacks) self.dialog.set_value("sound", "volumeCtrl", self.config["sound"]["volume"]*100) self.dialog.set_value("sound", "input", self.config["sound"]["input_device"]) self.dialog.set_value("sound", "output", self.config["sound"]["output_device"]) self.dialog.set_value("sound", "session_mute", self.config["sound"]["session_mute"]) self.dialog.set_value("sound", "soundpack", self.config["sound"]["current_soundpack"]) self.dialog.create_services() if self.config["services"]["pocket_access_token"] == "": self.dialog.services.set_pocket(False) else: self.dialog.services.set_pocket(True) widgetUtils.connect_event(self.dialog.services.pocketBtn, widgetUtils.BUTTON_PRESSED, self.manage_pocket) self.dialog.set_value("services", "apiKey", self.config["sound"]["sndup_api_key"]) self.dialog.realize() self.dialog.set_title(_(u"Account settings for %s") % (self.user,)) self.response = self.dialog.get_response()
def __init__(self, parent): wx.Panel.__init__(self, parent) sizer = wx.BoxSizer(wx.VERTICAL) volume = wx.StaticText(self, -1, _(u"Volume")) self.volumeCtrl = wx.Slider(self) self.volumeCtrl.SetRange(0, 100) self.volumeCtrl.SetValue(config.main["sound"]["volume"]*100) self.volumeCtrl.SetSize(self.volumeCtrl.GetBestSize()) volumeBox = wx.BoxSizer(wx.HORIZONTAL) volumeBox.Add(volume, 0, wx.ALL, 5) volumeBox.Add(self.volumeCtrl, 0, wx.ALL, 5) sizer.Add(volumeBox, 0, wx.ALL, 5) self.global_mute = wx.CheckBox(self, -1, _(u"Global mute")) self.global_mute.SetValue(config.main["sound"]["global_mute"]) sizer.Add(self.global_mute, 0, wx.ALL, 5) self.output_devices = sound_lib.output.Output.get_device_names() output_label = wx.StaticText(self, -1, _(u"Output device")) self.output = wx.ComboBox(self, -1, choices=self.output_devices, style=wx.CB_READONLY) self.output.SetValue(config.main["sound"]["output_device"]) self.output.SetSize(self.output.GetBestSize()) outputBox = wx.BoxSizer(wx.HORIZONTAL) outputBox.Add(output_label, 0, wx.ALL, 5) outputBox.Add(self.output, 0, wx.ALL, 5) sizer.Add(outputBox, 0, wx.ALL, 5) self.input_devices = sound_lib.input.Input.get_device_names() input_label = wx.StaticText(self, -1, _(u"Input device")) self.input = wx.ComboBox(self, -1, choices=self.input_devices, style=wx.CB_READONLY) self.input.SetValue(config.main["sound"]["input_device"]) self.input.SetSize(self.input.GetBestSize()) inputBox = wx.BoxSizer(wx.HORIZONTAL) inputBox.Add(input_label, 0, wx.ALL, 5) inputBox.Add(self.input, 0, wx.ALL, 5) sizer.Add(inputBox, 0, wx.ALL, 5) soundBox = wx.BoxSizer(wx.VERTICAL) self.soundpacks = [] [self.soundpacks.append(i) for i in os.listdir(paths.sound_path()) if os.path.isdir(paths.sound_path(i)) == True ] soundpack_label = wx.StaticText(self, -1, _(u"Sound pack")) self.soundpack = wx.ComboBox(self, -1, choices=self.soundpacks, style=wx.CB_READONLY) self.soundpack.SetValue(config.main["sound"]["current_soundpack"]) self.soundpack.SetSize(self.soundpack.GetBestSize()) soundBox.Add(soundpack_label, 0, wx.ALL, 5) soundBox.Add(self.soundpack, 0, wx.ALL, 5) sizer.Add(soundBox, 0, wx.ALL, 5) self.SetSizer(sizer)
def create_config(self): self.dialog.create_general_account() widgetUtils.connect_event(self.dialog.general.au, widgetUtils.BUTTON_PRESSED, self.manage_autocomplete) self.dialog.set_value("general", "relative_time", self.config["general"]["relative_times"]) self.dialog.set_value("general", "apiCalls", self.config["general"]["max_api_calls"]) self.dialog.set_value("general", "itemsPerApiCall", self.config["general"]["max_tweets_per_call"]) self.dialog.set_value("general", "reverse_timelines", self.config["general"]["reverse_timelines"]) rt = self.config["general"]["retweet_mode"] if rt == "ask": self.dialog.set_value("general", "retweet_mode", _(u"Ask")) elif rt == "direct": self.dialog.set_value("general", "retweet_mode", _(u"Retweet without comments")) else: self.dialog.set_value("general", "retweet_mode", _(u"Retweet with comments")) self.dialog.set_value("general", "persist_size", str(self.config["general"]["persist_size"])) self.dialog.create_other_buffers() buffer_values = self.get_buffers_list() self.dialog.buffers.insert_buffers(buffer_values) self.dialog.buffers.connect_hook_func(self.toggle_buffer_active) widgetUtils.connect_event(self.dialog.buffers.toggle_state, widgetUtils.BUTTON_PRESSED, self.toggle_state) widgetUtils.connect_event(self.dialog.buffers.up, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.move_up) widgetUtils.connect_event(self.dialog.buffers.down, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.move_down) self.dialog.create_ignored_clients( self.config["twitter"]["ignored_clients"]) widgetUtils.connect_event(self.dialog.ignored_clients.add, widgetUtils.BUTTON_PRESSED, self.add_ignored_client) widgetUtils.connect_event(self.dialog.ignored_clients.remove, widgetUtils.BUTTON_PRESSED, self.remove_ignored_client) self.input_devices = sound_lib.input.Input.get_device_names() self.output_devices = sound_lib.output.Output.get_device_names() self.soundpacks = [] [ self.soundpacks.append(i) for i in os.listdir(paths.sound_path()) if os.path.isdir(paths.sound_path(i)) == True ] self.dialog.create_sound(self.input_devices, self.output_devices, self.soundpacks) self.dialog.set_value("sound", "volumeCtrl", self.config["sound"]["volume"] * 100) self.dialog.set_value("sound", "input", self.config["sound"]["input_device"]) self.dialog.set_value("sound", "output", self.config["sound"]["output_device"]) self.dialog.set_value("sound", "session_mute", self.config["sound"]["session_mute"]) self.dialog.set_value("sound", "soundpack", self.config["sound"]["current_soundpack"]) self.dialog.create_services() if self.config["services"]["pocket_access_token"] == "": self.dialog.services.set_pocket(False) else: self.dialog.services.set_pocket(True) widgetUtils.connect_event(self.dialog.services.pocketBtn, widgetUtils.BUTTON_PRESSED, self.manage_pocket) self.dialog.set_value("services", "apiKey", self.config["sound"]["sndup_api_key"]) self.dialog.realize() self.dialog.set_title(_(u"Account settings for %s") % (self.user, )) self.response = self.dialog.get_response()