Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 58 | ||||||||||||
Proposed branch: | lp:~chk2k2/me-tv/me-tv | ||||||||||||
Merge into: | lp:me-tv | ||||||||||||
Diff against target: |
701 lines (+403/-51) 14 files modified
client/Makefile.am (+2/-0) client/inhibitscreensaver.cc (+257/-0) client/inhibitscreensaver.h (+74/-0) client/main_window.cc (+5/-0) client/main_window.h (+2/-1) client/me-tv-client.1 (+16/-8) client/me-tv-client.cc (+1/-30) client/me-tv.cc (+0/-4) client/me-tv.h (+0/-4) configure.ac (+1/-1) server/channel_manager.cc (+17/-0) server/channel_manager.h (+1/-0) server/me-tv-server.1 (+10/-2) server/request_handler.cc (+17/-1) |
||||||||||||
To merge this branch: | bzr merge lp:~chk2k2/me-tv/me-tv | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Frédéric Côté | Approve | ||
Review via email: mp+255217@code.launchpad.net |
Commit message
Description of the change
fixes 3 bugs:
Bug #769574: reordering channels doesn't work
Bug #983673: me-tv-client doesn't interrupt screensaver
Bug #1414449: Help screen shows wrong version
To post a comment you must log in.
Revision history for this message
Frédéric Côté (frederic-cote) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'client/Makefile.am' | |||
2 | --- client/Makefile.am 2012-03-11 22:20:20 +0000 | |||
3 | +++ client/Makefile.am 2015-04-03 22:53:30 +0000 | |||
4 | @@ -32,6 +32,8 @@ | |||
5 | 32 | epg_event_dialog.h \ | 32 | epg_event_dialog.h \ |
6 | 33 | gstreamer_engine.h \ | 33 | gstreamer_engine.h \ |
7 | 34 | gstreamer_engine.cc \ | 34 | gstreamer_engine.cc \ |
8 | 35 | inhibitscreensaver.h \ | ||
9 | 36 | inhibitscreensaver.cc \ | ||
10 | 35 | me-tv-client.cc \ | 37 | me-tv-client.cc \ |
11 | 36 | main_window.cc \ | 38 | main_window.cc \ |
12 | 37 | main_window.h \ | 39 | main_window.h \ |
13 | 38 | 40 | ||
14 | === added file 'client/inhibitscreensaver.cc' | |||
15 | --- client/inhibitscreensaver.cc 1970-01-01 00:00:00 +0000 | |||
16 | +++ client/inhibitscreensaver.cc 2015-04-03 22:53:30 +0000 | |||
17 | @@ -0,0 +1,257 @@ | |||
18 | 1 | // | ||
19 | 2 | // Inhibit Screen Saver | ||
20 | 3 | // | ||
21 | 4 | // Copyright (C) Joachim Erbs, 2010-2011 | ||
22 | 5 | // | ||
23 | 6 | // This file is part of Sinema. | ||
24 | 7 | // | ||
25 | 8 | // Sinema is free software: you can redistribute it and/or modify | ||
26 | 9 | // it under the terms of the GNU General Public License as published by | ||
27 | 10 | // the Free Software Foundation, either version 3 of the License, or | ||
28 | 11 | // (at your option) any later version. | ||
29 | 12 | // | ||
30 | 13 | // Sinema is distributed in the hope that it will be useful, | ||
31 | 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
32 | 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
33 | 16 | // GNU General Public License for more details. | ||
34 | 17 | // | ||
35 | 18 | // You should have received a copy of the GNU General Public License | ||
36 | 19 | // along with Sinema. If not, see <http://www.gnu.org/licenses/>. | ||
37 | 20 | // | ||
38 | 21 | |||
39 | 22 | #include "inhibitscreensaver.h" | ||
40 | 23 | |||
41 | 24 | // ------------------------------------------------------------------- | ||
42 | 25 | // Determine which ScreenSaver interface has to be used (Gnome or KDE): | ||
43 | 26 | // gdbus introspect --session --dest org.freedesktop.DBus --object-path / | ||
44 | 27 | // gdbus call --session --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetNameOwner org.gnome.ScreenSaver | ||
45 | 28 | // gdbus call --session --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetNameOwner org.freedesktop.ScreenSaver | ||
46 | 29 | // | ||
47 | 30 | // Accessing the ScreenSaver: | ||
48 | 31 | // gdbus introspect --session --dest org.gnome.ScreenSaver --object-path / | ||
49 | 32 | // gdbus introspect --session --dest org.freedesktop.ScreenSaver --object-path /ScreenSaver | ||
50 | 33 | // gdbus call --session --dest org.gnome.ScreenSaver --object-path / --method org.gnome.ScreenSaver.SimulateUserActivity | ||
51 | 34 | // gdbus call --session --dest org.freedesktop.ScreenSaver --object-path /ScreenSaver org.freedesktop.ScreenSaver.SimulateUserActivity | ||
52 | 35 | // At least the Gnome screen saver does not send a response for SimulateUserActivity. | ||
53 | 36 | // | ||
54 | 37 | // Monitoring DBus: | ||
55 | 38 | // gdbus monitor --session --dest org.gnome.ScreenSaver --object-path / | ||
56 | 39 | // | ||
57 | 40 | // Documentation: | ||
58 | 41 | // gdbus documentation: http://library.gnome.org/devel/gio/2.26/gdbus.html | ||
59 | 42 | |||
60 | 43 | DBusScreenSaverInterface::DBusScreenSaverInterface() | ||
61 | 44 | : proxyDBusDaemon(0), | ||
62 | 45 | proxyScreenSaver(0), | ||
63 | 46 | screenSaver(0), | ||
64 | 47 | dbusDaemon | ||
65 | 48 | {"org.freedesktop.DBus", | ||
66 | 49 | "org.freedesktop.DBus", | ||
67 | 50 | "/", | ||
68 | 51 | "org.freedesktop.DBus.GetNameOwner", | ||
69 | 52 | "" | ||
70 | 53 | }, | ||
71 | 54 | freedesktopScreenSaver | ||
72 | 55 | {"org.freedesktop.ScreenSaver", | ||
73 | 56 | "org.freedesktop.ScreenSaver", | ||
74 | 57 | "/ScreenSaver", | ||
75 | 58 | "org.freedesktop.ScreenSaver.Inhibit", | ||
76 | 59 | "org.freedesktop.ScreenSaver.UnInhibit" | ||
77 | 60 | } | ||
78 | 61 | { | ||
79 | 62 | g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION, | ||
80 | 63 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, | ||
81 | 64 | NULL, // GDBusInterfaceInfo* | ||
82 | 65 | dbusDaemon.bus_name, | ||
83 | 66 | dbusDaemon.object_path, | ||
84 | 67 | dbusDaemon.interface_name, | ||
85 | 68 | NULL, // GCancellable* | ||
86 | 69 | &wrapper<DBusScreenSaverInterface, | ||
87 | 70 | &DBusScreenSaverInterface::finishProxyDBusDaemonNew>, | ||
88 | 71 | this); | ||
89 | 72 | } | ||
90 | 73 | |||
91 | 74 | DBusScreenSaverInterface::~DBusScreenSaverInterface() | ||
92 | 75 | { | ||
93 | 76 | // Fixme: Cancel open asynchronous operations before deleting the object. | ||
94 | 77 | |||
95 | 78 | if (proxyDBusDaemon) | ||
96 | 79 | g_object_unref(proxyDBusDaemon); | ||
97 | 80 | |||
98 | 81 | if (proxyScreenSaver) | ||
99 | 82 | g_object_unref(proxyScreenSaver); | ||
100 | 83 | } | ||
101 | 84 | |||
102 | 85 | void DBusScreenSaverInterface::finishProxyDBusDaemonNew(GObject*, // source_object | ||
103 | 86 | GAsyncResult *res) | ||
104 | 87 | { | ||
105 | 88 | GError* error = NULL; | ||
106 | 89 | proxyDBusDaemon = g_dbus_proxy_new_for_bus_finish(res, &error); | ||
107 | 90 | if (proxyDBusDaemon) | ||
108 | 91 | { | ||
109 | 92 | g_debug("DBus Proxy Daemon creation successfull"); | ||
110 | 93 | screenSaver = &freedesktopScreenSaver; | ||
111 | 94 | sendDBusDaemonGetNameOwner(); | ||
112 | 95 | } | ||
113 | 96 | else | ||
114 | 97 | { | ||
115 | 98 | g_debug("DBus Proxy Daemon creation successfull"); | ||
116 | 99 | } | ||
117 | 100 | } | ||
118 | 101 | |||
119 | 102 | void DBusScreenSaverInterface::sendDBusDaemonGetNameOwner() | ||
120 | 103 | { | ||
121 | 104 | g_debug("DBus Proxy checking: %s",screenSaver->bus_name); | ||
122 | 105 | g_dbus_proxy_call(proxyDBusDaemon, | ||
123 | 106 | dbusDaemon.method_name_inhibit, | ||
124 | 107 | g_variant_new ("(s)", screenSaver->bus_name), | ||
125 | 108 | G_DBUS_CALL_FLAGS_NO_AUTO_START, | ||
126 | 109 | 500, // timeout in milliseconds, -1 use the proxy default timeout | ||
127 | 110 | NULL, // GCancellable* | ||
128 | 111 | &wrapper<DBusScreenSaverInterface, | ||
129 | 112 | &DBusScreenSaverInterface::finishDBusDaemonGetNameOwner>, | ||
130 | 113 | this); | ||
131 | 114 | } | ||
132 | 115 | |||
133 | 116 | void DBusScreenSaverInterface::finishDBusDaemonGetNameOwner(GObject*, // source_object | ||
134 | 117 | GAsyncResult *res) | ||
135 | 118 | { | ||
136 | 119 | GError* error = NULL; | ||
137 | 120 | GVariant* gvariant = g_dbus_proxy_call_finish(proxyDBusDaemon, res, &error); | ||
138 | 121 | |||
139 | 122 | if (error != NULL) | ||
140 | 123 | { | ||
141 | 124 | g_debug("DBus Proxy error callingdomain: %d, code: %d, message: %s", error->domain, error->code, error->message); | ||
142 | 125 | g_error_free(error); | ||
143 | 126 | |||
144 | 127 | if (screenSaver == &freedesktopScreenSaver) | ||
145 | 128 | { | ||
146 | 129 | g_debug("DBus Proxy search failed: %s",screenSaver->bus_name); | ||
147 | 130 | // screenSaver = &gnomeScreenSaver; | ||
148 | 131 | // sendDBusDaemonGetNameOwner(); | ||
149 | 132 | } | ||
150 | 133 | else | ||
151 | 134 | { | ||
152 | 135 | // No DBus screen saver found. | ||
153 | 136 | g_debug("DBus Proxy search failed: %s",screenSaver->bus_name); | ||
154 | 137 | } | ||
155 | 138 | } | ||
156 | 139 | else | ||
157 | 140 | { | ||
158 | 141 | g_debug("DBus Proxy found: %s",screenSaver->bus_name); | ||
159 | 142 | if (gvariant) | ||
160 | 143 | { | ||
161 | 144 | g_variant_unref(gvariant); | ||
162 | 145 | } | ||
163 | 146 | |||
164 | 147 | // Create DBus proxy for screen saver. | ||
165 | 148 | g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION, | ||
166 | 149 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, | ||
167 | 150 | NULL, // GDBusInterfaceInfo* | ||
168 | 151 | screenSaver->bus_name, | ||
169 | 152 | screenSaver->object_path, | ||
170 | 153 | screenSaver->interface_name, | ||
171 | 154 | NULL, // GCancellable* | ||
172 | 155 | &wrapper<DBusScreenSaverInterface, | ||
173 | 156 | &DBusScreenSaverInterface::finishProxyScreenSaverNew>, | ||
174 | 157 | this); | ||
175 | 158 | } | ||
176 | 159 | } | ||
177 | 160 | |||
178 | 161 | void DBusScreenSaverInterface::finishProxyScreenSaverNew(GObject*, // source_object | ||
179 | 162 | GAsyncResult *res) | ||
180 | 163 | { | ||
181 | 164 | GError* error = NULL; | ||
182 | 165 | proxyScreenSaver = g_dbus_proxy_new_for_bus_finish(res, &error); | ||
183 | 166 | if (error != NULL) | ||
184 | 167 | { | ||
185 | 168 | g_debug("DBus Proxy error callingdomain: %d, code: %d, message: %s", error->domain, error->code, error->message); | ||
186 | 169 | g_error_free(error); | ||
187 | 170 | } | ||
188 | 171 | else if (proxyScreenSaver) | ||
189 | 172 | { | ||
190 | 173 | g_debug("DBus Proxy created: %s",screenSaver->bus_name); | ||
191 | 174 | } | ||
192 | 175 | else | ||
193 | 176 | { | ||
194 | 177 | g_debug("DBus Proxy creation failed: %s",screenSaver->bus_name); | ||
195 | 178 | } | ||
196 | 179 | } | ||
197 | 180 | |||
198 | 181 | void DBusScreenSaverInterface::inhibit() | ||
199 | 182 | { | ||
200 | 183 | if (proxyScreenSaver) | ||
201 | 184 | { | ||
202 | 185 | g_debug("DBus Inhibit ScreenSaver"); | ||
203 | 186 | g_dbus_proxy_call(proxyScreenSaver, | ||
204 | 187 | screenSaver->method_name_inhibit, | ||
205 | 188 | g_variant_new("(ss)", | ||
206 | 189 | g_get_application_name (), | ||
207 | 190 | "showing TV stream"), | ||
208 | 191 | G_DBUS_CALL_FLAGS_NO_AUTO_START, | ||
209 | 192 | 500, // timeout in milliseconds, -1 use the proxy default timeout | ||
210 | 193 | NULL, // GCancellable* | ||
211 | 194 | &wrapper<DBusScreenSaverInterface, | ||
212 | 195 | &DBusScreenSaverInterface::finishInhibit>, | ||
213 | 196 | this); | ||
214 | 197 | } | ||
215 | 198 | } | ||
216 | 199 | |||
217 | 200 | void DBusScreenSaverInterface::finishInhibit (GObject * source_object, GAsyncResult * res) | ||
218 | 201 | { | ||
219 | 202 | GError* error = NULL; | ||
220 | 203 | GVariant *value; | ||
221 | 204 | |||
222 | 205 | value = g_dbus_proxy_call_finish (proxyScreenSaver, res, &error); | ||
223 | 206 | if (!value) { | ||
224 | 207 | g_warning ("Problem inhibiting the screensaver: %s", error->message); | ||
225 | 208 | g_error_free (error); | ||
226 | 209 | return; | ||
227 | 210 | } | ||
228 | 211 | |||
229 | 212 | /* save the cookie */ | ||
230 | 213 | if (g_variant_is_of_type (value, G_VARIANT_TYPE ("(u)"))) { | ||
231 | 214 | g_variant_get (value, "(u)", &cookie); | ||
232 | 215 | }else | ||
233 | 216 | cookie = 0; | ||
234 | 217 | |||
235 | 218 | g_debug("DBus Inhibit ScreenSaver successfull with cookie: %d",cookie); | ||
236 | 219 | g_variant_unref (value); | ||
237 | 220 | } | ||
238 | 221 | |||
239 | 222 | void DBusScreenSaverInterface::uninhibit() | ||
240 | 223 | { | ||
241 | 224 | if (proxyScreenSaver && (cookie>0)) | ||
242 | 225 | { | ||
243 | 226 | g_debug("DBus UnInhibit ScreenSaver"); | ||
244 | 227 | g_dbus_proxy_call(proxyScreenSaver, | ||
245 | 228 | screenSaver->method_name_uninhibit, | ||
246 | 229 | g_variant_new ("(u)", cookie), | ||
247 | 230 | G_DBUS_CALL_FLAGS_NO_AUTO_START, | ||
248 | 231 | 500, // timeout in milliseconds, -1 use the proxy default timeout | ||
249 | 232 | NULL, // GCancellable* | ||
250 | 233 | &wrapper<DBusScreenSaverInterface, | ||
251 | 234 | &DBusScreenSaverInterface::finishUninhibit>, | ||
252 | 235 | this); | ||
253 | 236 | } | ||
254 | 237 | } | ||
255 | 238 | |||
256 | 239 | void DBusScreenSaverInterface::finishUninhibit (GObject * source_object, GAsyncResult * res) | ||
257 | 240 | { | ||
258 | 241 | GError* error = NULL; | ||
259 | 242 | GVariant *value; | ||
260 | 243 | |||
261 | 244 | value = g_dbus_proxy_call_finish (proxyScreenSaver, res, &error); | ||
262 | 245 | if (!value) { | ||
263 | 246 | g_warning ("Problem uninhibiting the screensaver: %s", error->message); | ||
264 | 247 | g_error_free (error); | ||
265 | 248 | return; | ||
266 | 249 | } | ||
267 | 250 | |||
268 | 251 | /* clear the cookie */ | ||
269 | 252 | cookie = 0; | ||
270 | 253 | |||
271 | 254 | g_debug("DBus UnInhibit ScreenSaver successfull"); | ||
272 | 255 | g_variant_unref (value); | ||
273 | 256 | } | ||
274 | 257 | // ------------------------------------------------------------------- | ||
275 | 0 | 258 | ||
276 | === added file 'client/inhibitscreensaver.h' | |||
277 | --- client/inhibitscreensaver.h 1970-01-01 00:00:00 +0000 | |||
278 | +++ client/inhibitscreensaver.h 2015-04-03 22:53:30 +0000 | |||
279 | @@ -0,0 +1,74 @@ | |||
280 | 1 | // | ||
281 | 2 | // Inhibit Screen Saver | ||
282 | 3 | // | ||
283 | 4 | // Copyright (C) Joachim Erbs, 2010-2011 | ||
284 | 5 | // | ||
285 | 6 | // This file is part of Sinema. | ||
286 | 7 | // | ||
287 | 8 | // Sinema is free software: you can redistribute it and/or modify | ||
288 | 9 | // it under the terms of the GNU General Public License as published by | ||
289 | 10 | // the Free Software Foundation, either version 3 of the License, or | ||
290 | 11 | // (at your option) any later version. | ||
291 | 12 | // | ||
292 | 13 | // Sinema is distributed in the hope that it will be useful, | ||
293 | 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
294 | 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
295 | 16 | // GNU General Public License for more details. | ||
296 | 17 | // | ||
297 | 18 | // You should have received a copy of the GNU General Public License | ||
298 | 19 | // along with Sinema. If not, see <http://www.gnu.org/licenses/>. | ||
299 | 20 | // | ||
300 | 21 | |||
301 | 22 | #ifndef INHIBIT_SCREEN_SAVER_H | ||
302 | 23 | #define INHIBIT_SCREEN_SAVER_H | ||
303 | 24 | |||
304 | 25 | #include <gio/gio.h> | ||
305 | 26 | |||
306 | 27 | // ------------------------------------------------------------------- | ||
307 | 28 | |||
308 | 29 | class DBusScreenSaverInterface | ||
309 | 30 | { | ||
310 | 31 | public: | ||
311 | 32 | DBusScreenSaverInterface(); | ||
312 | 33 | ~DBusScreenSaverInterface(); | ||
313 | 34 | |||
314 | 35 | void inhibit(); | ||
315 | 36 | void uninhibit(); | ||
316 | 37 | |||
317 | 38 | private: | ||
318 | 39 | template<typename C, void(C::*M)(GObject*, GAsyncResult*)> | ||
319 | 40 | static void wrapper(GObject *source_object, | ||
320 | 41 | GAsyncResult *res, | ||
321 | 42 | gpointer user_data) | ||
322 | 43 | { | ||
323 | 44 | C* obj = (C*)user_data; | ||
324 | 45 | (obj->*M)(source_object, res); | ||
325 | 46 | } | ||
326 | 47 | |||
327 | 48 | struct DBusMethod | ||
328 | 49 | { | ||
329 | 50 | const gchar* bus_name; | ||
330 | 51 | const gchar* interface_name; | ||
331 | 52 | const gchar* object_path; | ||
332 | 53 | const gchar* method_name_inhibit; | ||
333 | 54 | const gchar* method_name_uninhibit; | ||
334 | 55 | }; | ||
335 | 56 | |||
336 | 57 | GDBusProxy* proxyDBusDaemon; | ||
337 | 58 | GDBusProxy* proxyScreenSaver; | ||
338 | 59 | const DBusMethod* screenSaver; | ||
339 | 60 | guint32 cookie; | ||
340 | 61 | |||
341 | 62 | const DBusMethod dbusDaemon; | ||
342 | 63 | const DBusMethod freedesktopScreenSaver; | ||
343 | 64 | |||
344 | 65 | void finishProxyDBusDaemonNew(GObject*, GAsyncResult *res); | ||
345 | 66 | void sendDBusDaemonGetNameOwner(); | ||
346 | 67 | void finishDBusDaemonGetNameOwner(GObject*, GAsyncResult *res); | ||
347 | 68 | void finishProxyScreenSaverNew(GObject*, GAsyncResult *res); | ||
348 | 69 | |||
349 | 70 | void finishUninhibit (GObject * source_object, GAsyncResult * res); | ||
350 | 71 | void finishInhibit (GObject * source_object, GAsyncResult * res); | ||
351 | 72 | }; | ||
352 | 73 | |||
353 | 74 | #endif | ||
354 | 0 | 75 | ||
355 | === modified file 'client/main_window.cc' | |||
356 | --- client/main_window.cc 2012-12-08 23:09:19 +0000 | |||
357 | +++ client/main_window.cc 2015-04-03 22:53:30 +0000 | |||
358 | @@ -94,6 +94,8 @@ | |||
359 | 94 | GdkPixmap* pixmap = gdk_bitmap_create_from_data(NULL, bits, 1, 1); | 94 | GdkPixmap* pixmap = gdk_bitmap_create_from_data(NULL, bits, 1, 1); |
360 | 95 | hidden_cursor = gdk_cursor_new_from_pixmap(pixmap, pixmap, &color, &color, 0, 0); | 95 | hidden_cursor = gdk_cursor_new_from_pixmap(pixmap, pixmap, &color, &color, 0, 0); |
361 | 96 | 96 | ||
362 | 97 | inhibitScreenSaver = new DBusScreenSaverInterface(); | ||
363 | 98 | |||
364 | 97 | g_debug("Loading UI files"); | 99 | g_debug("Loading UI files"); |
365 | 98 | 100 | ||
366 | 99 | add_accel_group(ui_manager->get_accel_group()); | 101 | add_accel_group(ui_manager->get_accel_group()); |
367 | @@ -281,6 +283,8 @@ | |||
368 | 281 | void MainWindow::unfullscreen(gboolean restore_mode) | 283 | void MainWindow::unfullscreen(gboolean restore_mode) |
369 | 282 | { | 284 | { |
370 | 283 | Gtk::Window::unfullscreen(); | 285 | Gtk::Window::unfullscreen(); |
371 | 286 | inhibitScreenSaver->uninhibit(); | ||
372 | 287 | |||
373 | 284 | label_time->hide(); | 288 | label_time->hide(); |
374 | 285 | 289 | ||
375 | 286 | if (restore_mode) | 290 | if (restore_mode) |
376 | @@ -298,6 +302,7 @@ | |||
377 | 298 | } | 302 | } |
378 | 299 | label_time->show(); | 303 | label_time->show(); |
379 | 300 | 304 | ||
380 | 305 | inhibitScreenSaver->inhibit(); | ||
381 | 301 | Gtk::Window::fullscreen(); | 306 | Gtk::Window::fullscreen(); |
382 | 302 | } | 307 | } |
383 | 303 | 308 | ||
384 | 304 | 309 | ||
385 | === modified file 'client/main_window.h' | |||
386 | --- client/main_window.h 2011-12-24 22:18:13 +0000 | |||
387 | +++ client/main_window.h 2015-04-03 22:53:30 +0000 | |||
388 | @@ -23,7 +23,7 @@ | |||
389 | 23 | 23 | ||
390 | 24 | #include "me-tv.h" | 24 | #include "me-tv.h" |
391 | 25 | #include "engine.h" | 25 | #include "engine.h" |
393 | 26 | #include <dbus/dbus.h> | 26 | #include "inhibitscreensaver.h" |
394 | 27 | #include <gtkmm/volumebutton.h> | 27 | #include <gtkmm/volumebutton.h> |
395 | 28 | 28 | ||
396 | 29 | typedef enum | 29 | typedef enum |
397 | @@ -63,6 +63,7 @@ | |||
398 | 63 | Gtk::Label* label_epg_page; | 63 | Gtk::Label* label_epg_page; |
399 | 64 | Gtk::Table* table_epg; | 64 | Gtk::Table* table_epg; |
400 | 65 | Gtk::ScrolledWindow* scrolled_window_epg; | 65 | Gtk::ScrolledWindow* scrolled_window_epg; |
401 | 66 | DBusScreenSaverInterface* inhibitScreenSaver; | ||
402 | 66 | 67 | ||
403 | 67 | void stop(); | 68 | void stop(); |
404 | 68 | void set_view_mode(ViewMode display_mode); | 69 | void set_view_mode(ViewMode display_mode); |
405 | 69 | 70 | ||
406 | === modified file 'client/me-tv-client.1' | |||
407 | --- client/me-tv-client.1 2011-12-24 22:18:13 +0000 | |||
408 | +++ client/me-tv-client.1 2015-04-03 22:53:30 +0000 | |||
409 | @@ -1,22 +1,24 @@ | |||
410 | 1 | .pc | 1 | .pc |
412 | 2 | .TH "ME TV" 1 "2011-03-31" "2.0.0" "Me TV Client Manual" | 2 | .TH "ME TV" 1 "2015-03-26" "1.4.0" "Me TV Client Manual" |
413 | 3 | 3 | ||
414 | 4 | .SH NAME | 4 | .SH NAME |
415 | 5 | me-tv-client \- a digital television (DVB) viewer for GNOME | 5 | me-tv-client \- a digital television (DVB) viewer for GNOME |
416 | 6 | 6 | ||
417 | 7 | .SH SYNOPSIS | 7 | .SH SYNOPSIS |
420 | 8 | .B me-tv | 8 | .B me-tv-client |
421 | 9 | .I [-?|--help] | 9 | .I [-?|-h|--help] |
422 | 10 | .I [-v|--verbose] | 10 | .I [-v|--verbose] |
423 | 11 | .I [-s|--safe-mode] | 11 | .I [-s|--safe-mode] |
424 | 12 | .I [-m|--minimised] | ||
425 | 13 | .I [--disable-epg] | 12 | .I [--disable-epg] |
426 | 13 | .I [--engine] | ||
427 | 14 | .I [--no-screensaver-inhibit] | 14 | .I [--no-screensaver-inhibit] |
428 | 15 | .I [--display=DISPLAY] | 15 | .I [--display=DISPLAY] |
429 | 16 | .I [--server-host] | ||
430 | 17 | .I [--server-port] | ||
431 | 16 | 18 | ||
432 | 17 | .SH DESCRIPTION | 19 | .SH DESCRIPTION |
433 | 18 | Me TV is a GTK desktop application for watching digital television services | 20 | Me TV is a GTK desktop application for watching digital television services |
435 | 19 | that use the DVB standard. Me TV works with DVB-T/C/S and ATSC cards that have | 21 | that use the DVB standard. Me TV works with DVB-T/C/S and ATSC cards that have |
436 | 20 | kernel driver support. | 22 | kernel driver support. |
437 | 21 | 23 | ||
438 | 22 | .SH OPTIONS | 24 | .SH OPTIONS |
439 | @@ -30,17 +32,23 @@ | |||
440 | 30 | .B -s|--safe-mode | 32 | .B -s|--safe-mode |
441 | 31 | Show the preferences dialog an don't show video upon start. | 33 | Show the preferences dialog an don't show video upon start. |
442 | 32 | .TP | 34 | .TP |
443 | 33 | .B -m|--minimised-mode | ||
444 | 34 | Show minimised in notification area at startup. | ||
445 | 35 | .TP | ||
446 | 36 | .B --disable-epg | 35 | .B --disable-epg |
447 | 37 | Stops the rendering of the EPG event buttons on the UI. | 36 | Stops the rendering of the EPG event buttons on the UI. |
448 | 38 | .TP | 37 | .TP |
449 | 38 | .B --engine | ||
450 | 39 | Specify engine type gstreamer or vlc (default: vlc). | ||
451 | 40 | .TP | ||
452 | 39 | .B --no-screensaver-inhibit | 41 | .B --no-screensaver-inhibit |
453 | 40 | Tells Me TV not to call the screensaver Inhibit/UnInhibit methods for GNOME Screensaver. | 42 | Tells Me TV not to call the screensaver Inhibit/UnInhibit methods for GNOME Screensaver. |
454 | 41 | .TP | 43 | .TP |
455 | 42 | .B --display=DISPLAY | 44 | .B --display=DISPLAY |
456 | 43 | X display to use | 45 | X display to use |
457 | 46 | .TP | ||
458 | 47 | .B --server-host | ||
459 | 48 | Me TV server host (default: localhost) | ||
460 | 49 | .TP | ||
461 | 50 | .B --server-port | ||
462 | 51 | Me TV server port (default: 1999) | ||
463 | 44 | 52 | ||
464 | 45 | .SH AUTHOR | 53 | .SH AUTHOR |
465 | 46 | Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>. | 54 | Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>. |
466 | 47 | 55 | ||
467 | === modified file 'client/me-tv-client.cc' | |||
468 | --- client/me-tv-client.cc 2012-12-08 23:09:19 +0000 | |||
469 | +++ client/me-tv-client.cc 2015-04-03 22:53:30 +0000 | |||
470 | @@ -26,7 +26,6 @@ | |||
471 | 26 | #include <glib/gprintf.h> | 26 | #include <glib/gprintf.h> |
472 | 27 | #include <X11/Xlib.h> | 27 | #include <X11/Xlib.h> |
473 | 28 | #include <unique/unique.h> | 28 | #include <unique/unique.h> |
474 | 29 | #include <dbus/dbus-glib.h> | ||
475 | 30 | #include "me-tv-ui.h" | 29 | #include "me-tv-ui.h" |
476 | 31 | #include "configuration_manager.h" | 30 | #include "configuration_manager.h" |
477 | 32 | #include "../common/exception.h" | 31 | #include "../common/exception.h" |
478 | @@ -45,7 +44,7 @@ | |||
479 | 45 | UniqueResponse response = UNIQUE_RESPONSE_FAIL; | 44 | UniqueResponse response = UNIQUE_RESPONSE_FAIL; |
480 | 46 | 45 | ||
481 | 47 | switch (command) | 46 | switch (command) |
483 | 48 | { | 47 | { |
484 | 49 | case 1: | 48 | case 1: |
485 | 50 | action_present->activate(); | 49 | action_present->activate(); |
486 | 51 | response = UNIQUE_RESPONSE_OK; | 50 | response = UNIQUE_RESPONSE_OK; |
487 | @@ -101,15 +100,6 @@ | |||
488 | 101 | safe_mode_option_entry.set_short_name('s'); | 100 | safe_mode_option_entry.set_short_name('s'); |
489 | 102 | safe_mode_option_entry.set_description(_("Start in safe mode")); | 101 | safe_mode_option_entry.set_description(_("Start in safe mode")); |
490 | 103 | 102 | ||
491 | 104 | Glib::OptionEntry minimised_option_entry; | ||
492 | 105 | minimised_option_entry.set_long_name("minimised"); | ||
493 | 106 | minimised_option_entry.set_short_name('m'); | ||
494 | 107 | minimised_option_entry.set_description(_("Start minimised in notification area")); | ||
495 | 108 | |||
496 | 109 | Glib::OptionEntry disable_epg_thread_option_entry; | ||
497 | 110 | disable_epg_thread_option_entry.set_long_name("disable-epg-thread"); | ||
498 | 111 | disable_epg_thread_option_entry.set_description(_("Disable the EPG thread. Me TV will stop collecting EPG events.")); | ||
499 | 112 | |||
500 | 113 | Glib::OptionEntry disable_epg_option_entry; | 103 | Glib::OptionEntry disable_epg_option_entry; |
501 | 114 | disable_epg_option_entry.set_long_name("disable-epg"); | 104 | disable_epg_option_entry.set_long_name("disable-epg"); |
502 | 115 | disable_epg_option_entry.set_description(_("Stops the rendering of the EPG event buttons on the UI.")); | 105 | disable_epg_option_entry.set_description(_("Stops the rendering of the EPG event buttons on the UI.")); |
503 | @@ -123,10 +113,6 @@ | |||
504 | 123 | no_screensaver_inhibit_option_entry.set_long_name("no-screensaver-inhibit"); | 113 | no_screensaver_inhibit_option_entry.set_long_name("no-screensaver-inhibit"); |
505 | 124 | no_screensaver_inhibit_option_entry.set_description(_("Tells Me TV not to call the screensaver Inhibit/UnInhibit methods for GNOME Screensaver.")); | 114 | no_screensaver_inhibit_option_entry.set_description(_("Tells Me TV not to call the screensaver Inhibit/UnInhibit methods for GNOME Screensaver.")); |
506 | 125 | 115 | ||
507 | 126 | Glib::OptionEntry devices_option_entry; | ||
508 | 127 | devices_option_entry.set_long_name("devices"); | ||
509 | 128 | devices_option_entry.set_description(_("Only use the specified frontend devices (e.g. --devices=/dev/dvb/adapter0/frontend0,/dev/dvb/adapter0/frontend1)")); | ||
510 | 129 | |||
511 | 130 | Glib::OptionEntry host_option_entry; | 116 | Glib::OptionEntry host_option_entry; |
512 | 131 | host_option_entry.set_long_name("server-host"); | 117 | host_option_entry.set_long_name("server-host"); |
513 | 132 | host_option_entry.set_description(_("Me TV server host (default: localhost)")); | 118 | host_option_entry.set_description(_("Me TV server host (default: localhost)")); |
514 | @@ -135,19 +121,11 @@ | |||
515 | 135 | port_option_entry.set_long_name("server-port"); | 121 | port_option_entry.set_long_name("server-port"); |
516 | 136 | port_option_entry.set_description(_("Me TV server port (default: 1999)")); | 122 | port_option_entry.set_description(_("Me TV server port (default: 1999)")); |
517 | 137 | 123 | ||
518 | 138 | Glib::OptionEntry read_timeout_option_entry; | ||
519 | 139 | read_timeout_option_entry.set_long_name("read-timeout"); | ||
520 | 140 | read_timeout_option_entry.set_description(_("How long to wait (in seconds) before timing out while waiting for data from demuxer (default 5).")); | ||
521 | 141 | |||
522 | 142 | Glib::OptionGroup option_group(PACKAGE_NAME, "", _("Show Me TV help options")); | 124 | Glib::OptionGroup option_group(PACKAGE_NAME, "", _("Show Me TV help options")); |
523 | 143 | option_group.add_entry(verbose_option_entry, verbose_logging); | 125 | option_group.add_entry(verbose_option_entry, verbose_logging); |
524 | 144 | option_group.add_entry(safe_mode_option_entry, safe_mode); | 126 | option_group.add_entry(safe_mode_option_entry, safe_mode); |
525 | 145 | option_group.add_entry(minimised_option_entry, minimised_mode); | ||
526 | 146 | option_group.add_entry(disable_epg_thread_option_entry, disable_epg_thread); | ||
527 | 147 | option_group.add_entry(disable_epg_option_entry, disable_epg); | 127 | option_group.add_entry(disable_epg_option_entry, disable_epg); |
528 | 148 | option_group.add_entry(no_screensaver_inhibit_option_entry, no_screensaver_inhibit); | 128 | option_group.add_entry(no_screensaver_inhibit_option_entry, no_screensaver_inhibit); |
529 | 149 | option_group.add_entry(devices_option_entry, devices); | ||
530 | 150 | option_group.add_entry(read_timeout_option_entry, read_timeout); | ||
531 | 151 | option_group.add_entry(host_option_entry, server_host); | 129 | option_group.add_entry(host_option_entry, server_host); |
532 | 152 | option_group.add_entry(port_option_entry, server_port); | 130 | option_group.add_entry(port_option_entry, server_port); |
533 | 153 | option_group.add_entry(engine_option_entry, engine_type); | 131 | option_group.add_entry(engine_option_entry, engine_type); |
534 | @@ -235,13 +213,6 @@ | |||
535 | 235 | 213 | ||
536 | 236 | ui_manager = Gtk::UIManager::create(); | 214 | ui_manager = Gtk::UIManager::create(); |
537 | 237 | ui_manager->insert_action_group(action_group); | 215 | ui_manager->insert_action_group(action_group); |
538 | 238 | |||
539 | 239 | GError *error = NULL; | ||
540 | 240 | DBusGConnection* dbus_connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); | ||
541 | 241 | if (dbus_connection == NULL) | ||
542 | 242 | { | ||
543 | 243 | g_message(_("Failed to get DBus session")); | ||
544 | 244 | } | ||
545 | 245 | 216 | ||
546 | 246 | configuration_manager.initialise(); | 217 | configuration_manager.initialise(); |
547 | 247 | client.register_client(server_host, server_port); | 218 | client.register_client(server_host, server_port); |
548 | 248 | 219 | ||
549 | === modified file 'client/me-tv.cc' | |||
550 | --- client/me-tv.cc 2012-03-17 14:07:31 +0000 | |||
551 | +++ client/me-tv.cc 2015-04-03 22:53:30 +0000 | |||
552 | @@ -25,12 +25,8 @@ | |||
553 | 25 | 25 | ||
554 | 26 | bool verbose_logging = false; | 26 | bool verbose_logging = false; |
555 | 27 | bool safe_mode = false; | 27 | bool safe_mode = false; |
556 | 28 | bool minimised_mode = false; | ||
557 | 29 | bool disable_epg_thread = false; | ||
558 | 30 | bool disable_epg = false; | 28 | bool disable_epg = false; |
559 | 31 | bool no_screensaver_inhibit = false; | 29 | bool no_screensaver_inhibit = false; |
560 | 32 | Glib::ustring devices; | ||
561 | 33 | gint read_timeout = 5; | ||
562 | 34 | Glib::ustring server_host = "localhost"; | 30 | Glib::ustring server_host = "localhost"; |
563 | 35 | gint server_port = 1999; | 31 | gint server_port = 1999; |
564 | 36 | Glib::ustring engine_type = "vlc"; | 32 | Glib::ustring engine_type = "vlc"; |
565 | 37 | 33 | ||
566 | === modified file 'client/me-tv.h' | |||
567 | --- client/me-tv.h 2012-03-11 22:20:20 +0000 | |||
568 | +++ client/me-tv.h 2015-04-03 22:53:30 +0000 | |||
569 | @@ -31,12 +31,8 @@ | |||
570 | 31 | 31 | ||
571 | 32 | extern bool verbose_logging; | 32 | extern bool verbose_logging; |
572 | 33 | extern bool safe_mode; | 33 | extern bool safe_mode; |
573 | 34 | extern bool minimised_mode; | ||
574 | 35 | extern bool disable_epg_thread; | ||
575 | 36 | extern bool disable_epg; | 34 | extern bool disable_epg; |
576 | 37 | extern bool no_screensaver_inhibit; | 35 | extern bool no_screensaver_inhibit; |
577 | 38 | extern Glib::ustring devices; | ||
578 | 39 | extern gint read_timeout; | ||
579 | 40 | extern Glib::ustring server_host; | 36 | extern Glib::ustring server_host; |
580 | 41 | extern gint server_port; | 37 | extern gint server_port; |
581 | 42 | extern Glib::ustring engine_type; | 38 | extern Glib::ustring engine_type; |
582 | 43 | 39 | ||
583 | === modified file 'configure.ac' | |||
584 | --- configure.ac 2012-12-29 22:49:32 +0000 | |||
585 | +++ configure.ac 2015-04-03 22:53:30 +0000 | |||
586 | @@ -1,7 +1,7 @@ | |||
587 | 1 | # Process this file with autoconf to produce a configure script. | 1 | # Process this file with autoconf to produce a configure script. |
588 | 2 | 2 | ||
589 | 3 | AC_PREREQ(2.53) | 3 | AC_PREREQ(2.53) |
591 | 4 | AC_INIT([Me TV], [1.4.0.12], [http://launchpad.net/me-tv], me-tv) | 4 | AC_INIT([Me TV], [1.4.0.58], [http://launchpad.net/me-tv], me-tv) |
592 | 5 | AC_COPYRIGHT([Michael Lamothe <michael.lamothe@gmail.com>]) | 5 | AC_COPYRIGHT([Michael Lamothe <michael.lamothe@gmail.com>]) |
593 | 6 | AM_INIT_AUTOMAKE([1.9 foreign]) | 6 | AM_INIT_AUTOMAKE([1.9 foreign]) |
594 | 7 | AC_GNU_SOURCE | 7 | AC_GNU_SOURCE |
595 | 8 | 8 | ||
596 | === modified file 'server/channel_manager.cc' | |||
597 | --- server/channel_manager.cc 2012-06-10 20:50:55 +0000 | |||
598 | +++ server/channel_manager.cc 2015-04-03 22:53:30 +0000 | |||
599 | @@ -271,6 +271,23 @@ | |||
600 | 271 | return *channel; | 271 | return *channel; |
601 | 272 | } | 272 | } |
602 | 273 | 273 | ||
603 | 274 | Channel& ChannelManager::get_channel_by_name(Glib::ustring name) | ||
604 | 275 | { | ||
605 | 276 | Glib::RecMutex::Lock lock(mutex); | ||
606 | 277 | |||
607 | 278 | Channel* channel = NULL; | ||
608 | 279 | |||
609 | 280 | for (ChannelList::iterator iterator = channels.begin(); iterator != channels.end() && channel == NULL; iterator++) | ||
610 | 281 | { | ||
611 | 282 | if ((*iterator).name == name) | ||
612 | 283 | { | ||
613 | 284 | channel = &(*iterator); | ||
614 | 285 | } | ||
615 | 286 | } | ||
616 | 287 | |||
617 | 288 | return *channel; | ||
618 | 289 | } | ||
619 | 290 | |||
620 | 274 | Channel& ChannelManager::get_channel_by_id(guint channel_id) | 291 | Channel& ChannelManager::get_channel_by_id(guint channel_id) |
621 | 275 | { | 292 | { |
622 | 276 | Glib::RecMutex::Lock lock(mutex); | 293 | Glib::RecMutex::Lock lock(mutex); |
623 | 277 | 294 | ||
624 | === modified file 'server/channel_manager.h' | |||
625 | --- server/channel_manager.h 2011-12-24 22:18:13 +0000 | |||
626 | +++ server/channel_manager.h 2015-04-03 22:53:30 +0000 | |||
627 | @@ -53,6 +53,7 @@ | |||
628 | 53 | 53 | ||
629 | 54 | Channel& get_channel_by_id(guint channel_id); | 54 | Channel& get_channel_by_id(guint channel_id); |
630 | 55 | Channel& get_channel_by_index(guint number); | 55 | Channel& get_channel_by_index(guint number); |
631 | 56 | Channel& get_channel_by_name(Glib::ustring name); | ||
632 | 56 | Channel* find_channel(guint frequency, guint service_id); | 57 | Channel* find_channel(guint frequency, guint service_id); |
633 | 57 | Channel* find_channel(guint channel_id); | 58 | Channel* find_channel(guint channel_id); |
634 | 58 | 59 | ||
635 | 59 | 60 | ||
636 | === modified file 'server/me-tv-server.1' | |||
637 | --- server/me-tv-server.1 2011-12-24 22:18:13 +0000 | |||
638 | +++ server/me-tv-server.1 2015-04-03 22:53:30 +0000 | |||
639 | @@ -1,16 +1,18 @@ | |||
640 | 1 | .pc | 1 | .pc |
642 | 2 | .TH "ME TV" 1 "2011-03-31" "2.0.0" "Me TV Server Manual" | 2 | .TH "ME TV" 1 "2015-03-26" "1.4.0" "Me TV Server Manual" |
643 | 3 | 3 | ||
644 | 4 | .SH NAME | 4 | .SH NAME |
645 | 5 | me-tv-server \- a digital television (DVB) viewer for GNOME | 5 | me-tv-server \- a digital television (DVB) viewer for GNOME |
646 | 6 | 6 | ||
647 | 7 | .SH SYNOPSIS | 7 | .SH SYNOPSIS |
648 | 8 | .B me-tv-server | 8 | .B me-tv-server |
650 | 9 | .I [-?|--help] | 9 | .I [-?|-h|--help] |
651 | 10 | .I [-v|--verbose] | 10 | .I [-v|--verbose] |
652 | 11 | .I [--disable-epg-thread] | 11 | .I [--disable-epg-thread] |
653 | 12 | .I [--devices] | 12 | .I [--devices] |
654 | 13 | .I [--read-timeout] | 13 | .I [--read-timeout] |
655 | 14 | .I [--broadcast-address] | ||
656 | 15 | .I [--server-port] | ||
657 | 14 | 16 | ||
658 | 15 | .SH DESCRIPTION | 17 | .SH DESCRIPTION |
659 | 16 | Me TV is a GTK desktop application for watching digital television services | 18 | Me TV is a GTK desktop application for watching digital television services |
660 | @@ -35,6 +37,12 @@ | |||
661 | 35 | .TP | 37 | .TP |
662 | 36 | .B --read-timeout | 38 | .B --read-timeout |
663 | 37 | How long to wait (in seconds) before timing out while waiting for data from demuxer (default 5) | 39 | How long to wait (in seconds) before timing out while waiting for data from demuxer (default 5) |
664 | 40 | .TP | ||
665 | 41 | .B --broadcast-address | ||
666 | 42 | The network broadcast address to send video streams for clients to display (default 127.0.0.1). | ||
667 | 43 | .TP | ||
668 | 44 | .B --server-port | ||
669 | 45 | The network port for clients to connect to (default 1999). | ||
670 | 38 | 46 | ||
671 | 39 | .SH AUTHOR | 47 | .SH AUTHOR |
672 | 40 | Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>. | 48 | Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>. |
673 | 41 | 49 | ||
674 | === modified file 'server/request_handler.cc' | |||
675 | --- server/request_handler.cc 2012-03-17 16:43:02 +0000 | |||
676 | +++ server/request_handler.cc 2015-04-03 22:53:30 +0000 | |||
677 | @@ -262,7 +262,23 @@ | |||
678 | 262 | } | 262 | } |
679 | 263 | else if (command == "set_channel_order") | 263 | else if (command == "set_channel_order") |
680 | 264 | { | 264 | { |
682 | 265 | 265 | ChannelList newchannels; | |
683 | 266 | |||
684 | 267 | NodeSet nodes = root_node->find("parameter"); | ||
685 | 268 | for (NodeSet::iterator i = nodes.begin(); i != nodes.end(); i++) | ||
686 | 269 | { | ||
687 | 270 | Node* node = *i; | ||
688 | 271 | |||
689 | 272 | const Glib::ustring& name = get_attribute_value(node, "@name"); | ||
690 | 273 | const Glib::ustring& value = get_attribute_value(node, "@value"); | ||
691 | 274 | |||
692 | 275 | newchannels.push_back(channel_manager.get_channel_by_name(name)); | ||
693 | 276 | |||
694 | 277 | Glib::ustring s = Glib::ustring::compose(" name=%1 -- value=%2", name, value); | ||
695 | 278 | g_debug(s.c_str()); | ||
696 | 279 | } | ||
697 | 280 | |||
698 | 281 | channel_manager.set_channels(schema, connection, newchannels); | ||
699 | 266 | } | 282 | } |
700 | 267 | else if (command == "get_epg") | 283 | else if (command == "get_epg") |
701 | 268 | { | 284 | { |