Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ ⎇ branch:  streamtuner2


Check-in [927dc82086]

Overview
Comment:Simplify streamedit_ by reusing config_dialog.load_config() (Also allows to use a liststore table later..)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 927dc820861ae7081781c43364762b15f841ba6a
User & Date: mario on 2014-05-25 17:23:30
Other Links: manifest | tags
Context
2014-05-26
03:00
Youtube video browsing channel replaces DMOZ listings. check-in: 404f0b4329 user: mario tags: trunk
2014-05-25
17:23
Simplify streamedit_ by reusing config_dialog.load_config() (Also allows to use a liststore table later..) check-in: 927dc82086 user: mario tags: trunk
16:36
Allow to supply ordered (key,value) list[] to mygtk.ComboBoxText. Config specifiers can use ID=abc|XY=xyz|... now. check-in: 7b5b2a40e8 user: mario tags: trunk
Changes

Modified st2.py from [3e127b9d62] to [647f8af5c1].

694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722

# aux win: stream data editing dialog
class streamedit (auxiliary_window):


        # show stream data editing dialog
        def open(self, mw):
            row = main.row()
            for name in ("title", "playing", "genre", "homepage", "url", "favicon", "format", "extra"):
                w = main.get_widget("streamedit_" + name) 
                if w:
                    w.set_text((str(row.get(name)) if row.get(name) else ""))
            self.win_streamedit.show()


        # copy widget contents to stream
        def save(self, w):
            row = main.row()
            for name in ("title", "playing", "genre", "homepage", "url", "favicon", "format", "extra"):
               w = main.get_widget("streamedit_" + name)
               if w:
                   row[name] = w.get_text()
            main.channel().save()
            self.cancel(w)

            
        # add a new list entry, update window
        def new(self, w):
            s = main.channel().stations()







|
<
<
<
<





|
<
<
<
<







694
695
696
697
698
699
700
701




702
703
704
705
706
707




708
709
710
711
712
713
714

# aux win: stream data editing dialog
class streamedit (auxiliary_window):


        # show stream data editing dialog
        def open(self, mw):
            config_dialog.load_config(main.row(), "streamedit_")




            self.win_streamedit.show()


        # copy widget contents to stream
        def save(self, w):
            config_dialog.save_config(main.row(), "streamedit_")




            main.channel().save()
            self.cancel(w)

            
        # add a new list entry, update window
        def new(self, w):
            s = main.channel().stations()
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
            fav = self.streams["favourite"]
        
            # First we'll generate a list of current bookmark stream urls, and then
            # remove all but those from the currently UPDATED_channel + category.
            # This step is most likely redundant, but prevents accidently re-rewriting
            # stations that are in two channels (=duplicates with different PLS urls).
            check = {"http//": "[row]"}
            check = dict((row["url"],row) for row in fav)
            # walk through all channels/streams
            for chname,channel in main.channels.items():
                for cat,streams in channel.streams.items():

                    # keep the potentially changed rows
                    if (chname == updated_channel) and (cat == updated_category):
                        freshened_streams = streams







|







1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
            fav = self.streams["favourite"]
        
            # First we'll generate a list of current bookmark stream urls, and then
            # remove all but those from the currently UPDATED_channel + category.
            # This step is most likely redundant, but prevents accidently re-rewriting
            # stations that are in two channels (=duplicates with different PLS urls).
            check = {"http//": "[row]"}
            check = dict((row.get("url", "http//"),row) for row in fav)
            # walk through all channels/streams
            for chname,channel in main.channels.items():
                for cat,streams in channel.streams.items():

                    # keep the potentially changed rows
                    if (chname == updated_channel) and (cat == updated_category):
                        freshened_streams = streams