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

⌈⌋ ⎇ branch:  streamtuner2


Diff

Differences From Artifact [b6f7f7a5cd]:

To Artifact [b3b5b37bef]:


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class configwin (AuxiliaryWindow):


    # Display win_config, pre-fill text fields from global conf. object
    def open(self, widget):
        if self.first_open:
            self.add_plugins()
            self.combobox_theme()
            self.first_open = 0
            self.win_config.resize(565, 625)
        self.load_config(conf.__dict__, "config_")
        self.load_config(conf.plugins, "config_plugins_")
        [callback() for callback in self.hooks["config_load"]]
        self.win_config.show_all()
    first_open = 1







<







26
27
28
29
30
31
32

33
34
35
36
37
38
39
class configwin (AuxiliaryWindow):


    # Display win_config, pre-fill text fields from global conf. object
    def open(self, widget):
        if self.first_open:
            self.add_plugins()

            self.first_open = 0
            self.win_config.resize(565, 625)
        self.load_config(conf.__dict__, "config_")
        self.load_config(conf.plugins, "config_plugins_")
        [callback() for callback in self.hooks["config_load"]]
        self.win_config.show_all()
    first_open = 1
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
        m = re.search("(?![$(`])\S+", v)
        if m and m.group(0) and find_executable(m.group(0)):
            return gtk.STOCK_MEDIA_PLAY
        else:
            return gtk.STOCK_CANCEL
        

    # list of Gtk themes in dropdown
    def combobox_theme(self):
        # find themes
        themedirs = (conf.share+"/themes", conf.dir+"/themes", "/usr/share/themes")
        themes = ["no theme"]
        [[themes.append(e) for e in os.listdir(dir)] for dir in themedirs if os.path.exists(dir)]
        __print__(dbg.STAT, themes)
        # add dropdown
        self.widgets["theme"] = ComboBoxText(themes)
        self.theme_cb_placeholder.pack_start(self.theme)
        self.theme_cb_placeholder.pack_end(uikit.label(""))


    # retrieve currently selected value
    def apply_theme(self):
        conf.theme = self.theme.get_active_text()
        uikit.load_theme(conf.theme)


    # iterate over channel and feature plugins
    def add_plugins(self):
        ls = {}
        for name in module_list():
            if name in self.channels:
                ls[name] = self.channels[name].meta







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







101
102
103
104
105
106
107


















108
109
110
111
112
113
114
        m = re.search("(?![$(`])\S+", v)
        if m and m.group(0) and find_executable(m.group(0)):
            return gtk.STOCK_MEDIA_PLAY
        else:
            return gtk.STOCK_CANCEL
        




















    # iterate over channel and feature plugins
    def add_plugins(self):
        ls = {}
        for name in module_list():
            if name in self.channels:
                ls[name] = self.channels[name].meta
185
186
187
188
189
190
191
192
193
194
195
        self.plugin_options.pack_start(w)
    
    # save config
    def save(self, widget):
        self.save_config(conf.__dict__, "config_")
        self.save_config(conf.plugins, "config_plugins_")
        [callback() for callback in self.hooks["config_save"]]
        self.apply_theme()
        conf.save(nice=1)
        self.hide()








<



166
167
168
169
170
171
172

173
174
175
        self.plugin_options.pack_start(w)
    
    # save config
    def save(self, widget):
        self.save_config(conf.__dict__, "config_")
        self.save_config(conf.plugins, "config_plugins_")
        [callback() for callback in self.hooks["config_save"]]

        conf.save(nice=1)
        self.hide()