def update_config_to_01215(self): """ Remove hardcoded ../data/sounds from config """ dirs = ['../data', app.gajimpaths.data_root, app.DATA_DIR] if os.name != 'nt': dirs.append(os.path.expanduser('~/.gajim')) for evt in app.config.get_per('soundevents'): path = app.config.get_per('soundevents', evt, 'path') # absolute and relative passes are necessary path = helpers.strip_soundfile_path(path, dirs, abs=False) path = helpers.strip_soundfile_path(path, dirs, abs=True) app.config.set_per('soundevents', evt, 'path', path) app.config.set('version', '0.12.1.5')
def _on_file_set(self, button): model, iter_ = self.sound_tree.get_selection().get_selected() filename = button.get_filename() directory = os.path.dirname(filename) app.config.set('last_sounds_dir', directory) path_to_snd_file = helpers.strip_soundfile_path(filename) # set new path to sounds_model model[iter_][2] = path_to_snd_file # set the sound to enabled model[iter_][0] = True
def _on_file_set(self, button): model, iter_ = self._ui.sounds_treeview.get_selection().get_selected() filename = button.get_filename() directory = os.path.dirname(filename) app.settings.set('last_sounds_dir', directory) path_to_snd_file = strip_soundfile_path(filename) # set new path to sounds_model model[iter_][2] = str(path_to_snd_file) # set the sound to enabled model[iter_][0] = True