106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
self.add_(uikit.label("You can update existing plugins, or install new contrib/ channels. User plugins reside in ~/.config/streamtuner2/plugins/ and can even be modified there (such as setting a custom # color: entry).\n", size=520, markup=1))
self.add_(self.button("Refresh", stock="gtk-refresh", cb=self.refresh), "Show available plugins from repository\nhttp://fossil.include-once.org/streamtuner2/")
self.add_(gtk.image_new_from_stock("gtk-info", gtk.ICON_SIZE_LARGE_TOOLBAR), "While plugins are generally compatible across releases, newer versions may also require to update the streamtuner2 core setup.")
for i in range(1,10):
self.add_(uikit.label(""))
# Append to vbox
def add_(self, w, label=None, markup=0):
w = uikit.wrap(w=w, label=label, align=10, label_size=400, label_markup=1)
self.vbox.add(w)
# Create button, connect click signal
def button(self, label, stock=None, cb=None):
b = gtk.Button(label, stock=stock)
b.connect("clicked", cb)
return b
|
<
<
<
<
<
|
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
self.add_(uikit.label("You can update existing plugins, or install new contrib/ channels. User plugins reside in ~/.config/streamtuner2/plugins/ and can even be modified there (such as setting a custom # color: entry).\n", size=520, markup=1))
self.add_(self.button("Refresh", stock="gtk-refresh", cb=self.refresh), "Show available plugins from repository\nhttp://fossil.include-once.org/streamtuner2/")
self.add_(gtk.image_new_from_stock("gtk-info", gtk.ICON_SIZE_LARGE_TOOLBAR), "While plugins are generally compatible across releases, newer versions may also require to update the streamtuner2 core setup.")
for i in range(1,10):
self.add_(uikit.label(""))
# Create button, connect click signal
def button(self, label, stock=None, cb=None):
b = gtk.Button(label, stock=stock)
b.connect("clicked", cb)
return b
|
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
if dep.valid(newpl) and dep.depends(newpl):
self.add_plugin(newpl)
# Readd some filler labels
_ = [self.add_(uikit.label("")) for i in range(1,3)]
# Entry for plugin list
def add_plugin(self, p):
b = self.button("Install", stock="gtk-save", cb=lambda *w:self.install(p))
p = self.update_p(p)
text = "<b>$title</b>, "\
"<small>version:</small> <span weight='bold' color='orange'>$version</span>, "\
"<small>type: <i><span color='#559'>$type</span></i> "\
"category: <i><span color='blue'>$category</span></i></small>\n"\
"<span size='smaller' color='#364'>$description</span>\n"\
"<span size='small' color='#532' weight='ultralight'>$extras, <a href='$file'>view src</a></span>"
self.add_(b, safe_format(text, **p), markup=1)
# Add placeholder fields
def update_p(self, p):
fields = ("status", "priority", "support", "author", "depends")
extras = ["{}: <b>{}</b>".format(n, html_escape(p[n])) for n in fields if p.get(n)]
p["extras"] = " ".join(["💁"] + extras)
|
>
>
>
>
>
|
|
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
if dep.valid(newpl) and dep.depends(newpl):
self.add_plugin(newpl)
# Readd some filler labels
_ = [self.add_(uikit.label("")) for i in range(1,3)]
# Append to vbox
def add_(self, w, label=None, markup=0, align=10, label_size=400):
w = uikit.wrap(w=w, label=label, align=align, label_size=label_size, label_markup=markup)
self.vbox.add(w)
# Entry for plugin list
def add_plugin(self, p):
b = self.button("Install", stock="gtk-save", cb=lambda *w:self.install(p))
p = self.update_p(p)
text = "<b>$title</b>, "\
"<small>version:</small> <span weight='bold' color='orange'>$version</span>, "\
"<small>type: <i><span color='#559'>$type</span></i> "\
"category: <i><span color='blue'>$category</span></i></small>\n"\
"<span size='smaller' color='#364'>$description</span>\n"\
"<span size='small' color='#532' weight='ultralight'>$extras, <a href='$file'>view src</a></span>"
self.add_(b, label=safe_format(text, **p), markup=1, align=10, label_size=375)
# Add placeholder fields
def update_p(self, p):
fields = ("status", "priority", "support", "author", "depends")
extras = ["{}: <b>{}</b>".format(n, html_escape(p[n])) for n in fields if p.get(n)]
p["extras"] = " ".join(["💁"] + extras)
|