Index: channels/history.py ================================================================== --- channels/history.py +++ channels/history.py @@ -73,8 +73,8 @@ while max > 0 and len(hist) > max: hist.pop() # update store self.bm.save() - if self.bm.current == "history": - self.bm.load("history") + #if self.bm.current == "history": + # self.bm.load("history") Index: config.py ================================================================== --- config.py +++ config.py @@ -149,11 +149,14 @@ os.unlink(file) else: f = open(file, "w") # encode data = json.dumps(data, indent=(4 if nice else None)) - f.write(data.encode("utf-8")) + try: + f.write(data.encode("utf-8")) + except TypeError as e: + f.write(data) # Python3 sometimes wants to write strings rather than bytes f.close() # retrieve data from config file def load(self, name): Index: gtk2.xml ================================================================== --- gtk2.xml +++ gtk2.xml @@ -84,11 +84,11 @@ True automatic automatic - 0 + 540 200 True True 5 config_play @@ -103,11 +103,11 @@ 125 Format True - + 2 0 @@ -119,11 +119,11 @@ 10 300 Application - + 2 1 @@ -138,41 +138,25 @@ True 1 - - True - False - 0.019999999552965164 - 0.49000000953674316 - Use <a href="http://fossil.include-once.org/streamtuner2/wiki?name=player">placeholders</a> such as <b>%pls</b> for Shoutcast playlists, -or pass <b>%m3u</b> for players that expect mp3 playlist files, -and <b>%srv</b> to use direct streaming URLs. - True - True - - - True - True - 5 - 2 - - - True False 0 True True True - 3 + 2 + + + True False 0 @@ -184,60 +168,52 @@ True 4 - - True - True - automatic - automatic - - - 0 - 100 - True - True - 5 - config_record - False - True - 0 - 8 - both - - - 10 - 125 - Format - True - - - - - - 2 - 0 - - - - - - - 10 - 300 - Application - - - - - - 2 - 1 - - - + + 540 + 100 + True + True + 5 + config_record + False + True + 0 + 8 + both + + + 10 + 125 + Format + True + + + + + + 2 + 0 + + + + + + + 10 + 300 + Application + + + + + + 2 + 1 + @@ -244,10 +220,29 @@ True True 5 + + + True + True + 0.019999999552965164 + 0.49000000953674316 + Use <a href="http://fossil.include-once.org/streamtuner2/wiki?name=player">placeholders</a> such as <b>%pls</b> for Shoutcast playlists, +or pass <b>%m3u</b> for players that expect mp3 playlist files, +and <b>%srv</b> to use direct streaming URLs. + True + True + + + True + True + 5 + 6 + + True True 0.019999999552965164 @@ -258,20 +253,13 @@ True True True - 15 - 6 + 7 - - - - - - @@ -1856,10 +1844,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all channels True True @@ -2213,10 +2336,13 @@ True + + record,1 + False 5 normal @@ -2522,10 +2648,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True True @@ -2540,10 +2720,19 @@ 2 1 2 + + + + + + + + + @@ -3056,12 +3245,12 @@ True False bookmark True - + @@ -3068,12 +3257,12 @@ gtk-save-as True False True True - + @@ -3080,13 +3269,13 @@ gtk-edit True False True True - + - + @@ -3155,12 +3344,12 @@ gtk-delete True False True True - + Index: gtk3.xml ================================================================== --- gtk3.xml +++ gtk3.xml @@ -79,11 +79,11 @@ True True - 0 + 540 200 True True 5 config_play @@ -101,11 +101,11 @@ 125 Format True - + 2 0 @@ -117,11 +117,11 @@ 10 300 Application - + 2 1 @@ -136,41 +136,25 @@ True 1 - - True - False - 0.019999999552965164 - 0.49000000953674316 - Use <a href="http://fossil.include-once.org/streamtuner2/wiki?name=player">placeholders</a> such as <b>%pls</b> for Shoutcast playlists, -or pass <b>%m3u</b> for players that expect mp3 playlist files, -and <b>%srv</b> to use direct streaming URLs. - True - True - - - True - True - 5 - 2 - - - True False 0 True True True - 3 + 2 + + + True False 0 @@ -182,61 +166,55 @@ True 4 - - True - True - - - 0 - 100 - True - True - 5 - config_record - False - True - 0 - 8 - both - - - - - - 10 - 125 - Format - True - - - - - - 2 - 0 - - - - - - - 10 - 300 - Application - - - - - - 2 - 1 - - - + + 540 + 100 + True + True + 5 + config_record + False + True + 0 + 8 + both + + + + + + 10 + 125 + Format + True + + + + + + 2 + 0 + + + + + + + 10 + 300 + Application + + + + + + 2 + 1 + @@ -243,10 +221,29 @@ True True 5 + + + True + True + 0.019999999552965164 + 0.49000000953674316 + Use <a href="http://fossil.include-once.org/streamtuner2/wiki?name=player">placeholders</a> such as <b>%pls</b> for Shoutcast playlists, +or pass <b>%m3u</b> for players that expect mp3 playlist files, +and <b>%srv</b> to use direct streaming URLs. + True + True + + + True + True + 5 + 6 + + True True 0.019999999552965164 @@ -257,20 +254,13 @@ True True True - 15 - 6 + 7 - - - - - - @@ -1888,10 +1878,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all channels True True @@ -2250,10 +2375,13 @@ True + + record,1 + False 5 normal @@ -2577,10 +2705,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True True @@ -2593,10 +2775,19 @@ 2 1 2 + + + + + + + + + @@ -3092,12 +3283,12 @@ True False bookmark True - + gtk-save-as @@ -3104,12 +3295,12 @@ True False True True - + gtk-edit @@ -3116,13 +3307,13 @@ True False True True - + - + True @@ -3191,12 +3382,12 @@ True False True True - + gtk-find Index: st2.py ================================================================== --- st2.py +++ st2.py @@ -1,11 +1,11 @@ #!/usr/bin/env python # encoding: UTF-8 # api: python # type: application # title: streamtuner2 -# description: directory browser for internet radio / audio streams +# description: Directory browser for internet radio / audio streams # depends: pygtk | pygi, threading, pyquery, kronos, requests # version: 2.1.1 # author: mario salzer # license: public domain # url: http://freshmeat.net/projects/streamtuner2 @@ -92,11 +92,11 @@ import channels from channels import * import favicon -__version__ = "2.1.0" +__version__ = "2.1.1" # this represents the main window # and also contains most application behaviour main = None @@ -186,15 +186,14 @@ "menu_toolbar_size_large": lambda w: (self.toolbar.set_icon_size(gtk.ICON_SIZE_DIALOG)), # else "menu_properties": config_dialog.open, "config_cancel": config_dialog.hide, "config_save": config_dialog.save, - "config_player_edited": config_dialog.edited_player_row, - "config_player_edited_2": config_dialog.edited_player_row_2, - "config_record_edited": config_dialog.edited_record_row, - "config_record_edited_2": config_dialog.edited_record_row_2, - "update_categories": self.update_categories, + "config_play_list_edit_col0": lambda w,path,txt: (config_dialog.list_edit(self.config_play, path, 0, txt)), + "config_play_list_edit_col1": lambda w,path,txt: (config_dialog.list_edit(self.config_play, path, 1, txt)), + "config_record_list_edit_col0": lambda w,path,txt: (config_dialog.list_edit(self.config_record, path, 0, txt)), + "config_record_list_edit_col1": lambda w,path,txt: (config_dialog.list_edit(self.config_record, path, 1, txt)), "update_favicons": self.update_favicons, "app_state": self.app_state, "bookmark": self.bookmark, "save_as": self.save_as, "menu_about": lambda w: AboutStreamtuner2(), @@ -309,11 +308,11 @@ # streamripper def on_record_clicked(self, widget): row = self.row() - action.record(row.get("url"), "audio/mpeg", "url/direct", row=row) + action.record(row.get("url"), row.get("format", "audio/mpeg"), "url/direct", row=row) # browse stream def on_homepage_stream_clicked(self, widget): url = self.selected("homepage") @@ -796,19 +795,15 @@ if row[0] and row[1]: config[key][row[0]] = row[1] __print__(dbg.CONF, "config save", prefix+key, val) - # Gtk callback to update ListStore when entries get edited - def edited_player_row(self, cell, path, new_text, user_data=None, column=0): - main.config_play[path][column] = new_text - def edited_player_row_2(self, cell, path, new_text, user_data=None): - self.edited_player_row(cell, path, new_text, column=1) - def edited_record_row(self, cell, path, new_text, user_data=None, column=0): - main.config_record[path][column] = new_text - def edited_record_row_2(self, cell, path, new_text, user_data=None): - self.edited_record_row(cell, path, new_text, column=1) + # Generic Gtk callback to update ListStore when entries get edited + def list_edit(self, liststore, path, column, new_text): + liststore[path][column] = new_text + # The signal_connect() dict actually prepares individual lambda functions + # to bind the correct ListStore and column id. # list of Gtk themes in dropdown def combobox_theme(self): # find themes