Merge lp:~chk2k2/me-tv/me-tv into lp:me-tv

Proposed by Christian
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
Reviewer Review Type Date Requested Status
Frédéric Côté Approve
Review via email: mp+255217@code.launchpad.net

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
=== modified file 'client/Makefile.am'
--- client/Makefile.am 2012-03-11 22:20:20 +0000
+++ client/Makefile.am 2015-04-03 22:53:30 +0000
@@ -32,6 +32,8 @@
32 epg_event_dialog.h \32 epg_event_dialog.h \
33 gstreamer_engine.h \33 gstreamer_engine.h \
34 gstreamer_engine.cc \34 gstreamer_engine.cc \
35 inhibitscreensaver.h \
36 inhibitscreensaver.cc \
35 me-tv-client.cc \37 me-tv-client.cc \
36 main_window.cc \38 main_window.cc \
37 main_window.h \39 main_window.h \
3840
=== added file 'client/inhibitscreensaver.cc'
--- client/inhibitscreensaver.cc 1970-01-01 00:00:00 +0000
+++ client/inhibitscreensaver.cc 2015-04-03 22:53:30 +0000
@@ -0,0 +1,257 @@
1//
2// Inhibit Screen Saver
3//
4// Copyright (C) Joachim Erbs, 2010-2011
5//
6// This file is part of Sinema.
7//
8// Sinema is free software: you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12//
13// Sinema is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with Sinema. If not, see <http://www.gnu.org/licenses/>.
20//
21
22#include "inhibitscreensaver.h"
23
24// -------------------------------------------------------------------
25// Determine which ScreenSaver interface has to be used (Gnome or KDE):
26// gdbus introspect --session --dest org.freedesktop.DBus --object-path /
27// gdbus call --session --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetNameOwner org.gnome.ScreenSaver
28// gdbus call --session --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetNameOwner org.freedesktop.ScreenSaver
29//
30// Accessing the ScreenSaver:
31// gdbus introspect --session --dest org.gnome.ScreenSaver --object-path /
32// gdbus introspect --session --dest org.freedesktop.ScreenSaver --object-path /ScreenSaver
33// gdbus call --session --dest org.gnome.ScreenSaver --object-path / --method org.gnome.ScreenSaver.SimulateUserActivity
34// gdbus call --session --dest org.freedesktop.ScreenSaver --object-path /ScreenSaver org.freedesktop.ScreenSaver.SimulateUserActivity
35// At least the Gnome screen saver does not send a response for SimulateUserActivity.
36//
37// Monitoring DBus:
38// gdbus monitor --session --dest org.gnome.ScreenSaver --object-path /
39//
40// Documentation:
41// gdbus documentation: http://library.gnome.org/devel/gio/2.26/gdbus.html
42
43DBusScreenSaverInterface::DBusScreenSaverInterface()
44 : proxyDBusDaemon(0),
45 proxyScreenSaver(0),
46 screenSaver(0),
47 dbusDaemon
48 {"org.freedesktop.DBus",
49 "org.freedesktop.DBus",
50 "/",
51 "org.freedesktop.DBus.GetNameOwner",
52 ""
53 },
54 freedesktopScreenSaver
55 {"org.freedesktop.ScreenSaver",
56 "org.freedesktop.ScreenSaver",
57 "/ScreenSaver",
58 "org.freedesktop.ScreenSaver.Inhibit",
59 "org.freedesktop.ScreenSaver.UnInhibit"
60 }
61{
62 g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION,
63 G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
64 NULL, // GDBusInterfaceInfo*
65 dbusDaemon.bus_name,
66 dbusDaemon.object_path,
67 dbusDaemon.interface_name,
68 NULL, // GCancellable*
69 &wrapper<DBusScreenSaverInterface,
70 &DBusScreenSaverInterface::finishProxyDBusDaemonNew>,
71 this);
72}
73
74DBusScreenSaverInterface::~DBusScreenSaverInterface()
75{
76 // Fixme: Cancel open asynchronous operations before deleting the object.
77
78 if (proxyDBusDaemon)
79 g_object_unref(proxyDBusDaemon);
80
81 if (proxyScreenSaver)
82 g_object_unref(proxyScreenSaver);
83}
84
85void DBusScreenSaverInterface::finishProxyDBusDaemonNew(GObject*, // source_object
86 GAsyncResult *res)
87{
88 GError* error = NULL;
89 proxyDBusDaemon = g_dbus_proxy_new_for_bus_finish(res, &error);
90 if (proxyDBusDaemon)
91 {
92 g_debug("DBus Proxy Daemon creation successfull");
93 screenSaver = &freedesktopScreenSaver;
94 sendDBusDaemonGetNameOwner();
95 }
96 else
97 {
98 g_debug("DBus Proxy Daemon creation successfull");
99 }
100}
101
102void DBusScreenSaverInterface::sendDBusDaemonGetNameOwner()
103{
104 g_debug("DBus Proxy checking: %s",screenSaver->bus_name);
105 g_dbus_proxy_call(proxyDBusDaemon,
106 dbusDaemon.method_name_inhibit,
107 g_variant_new ("(s)", screenSaver->bus_name),
108 G_DBUS_CALL_FLAGS_NO_AUTO_START,
109 500, // timeout in milliseconds, -1 use the proxy default timeout
110 NULL, // GCancellable*
111 &wrapper<DBusScreenSaverInterface,
112 &DBusScreenSaverInterface::finishDBusDaemonGetNameOwner>,
113 this);
114}
115
116void DBusScreenSaverInterface::finishDBusDaemonGetNameOwner(GObject*, // source_object
117 GAsyncResult *res)
118{
119 GError* error = NULL;
120 GVariant* gvariant = g_dbus_proxy_call_finish(proxyDBusDaemon, res, &error);
121
122 if (error != NULL)
123 {
124 g_debug("DBus Proxy error callingdomain: %d, code: %d, message: %s", error->domain, error->code, error->message);
125 g_error_free(error);
126
127 if (screenSaver == &freedesktopScreenSaver)
128 {
129 g_debug("DBus Proxy search failed: %s",screenSaver->bus_name);
130// screenSaver = &gnomeScreenSaver;
131// sendDBusDaemonGetNameOwner();
132 }
133 else
134 {
135 // No DBus screen saver found.
136 g_debug("DBus Proxy search failed: %s",screenSaver->bus_name);
137 }
138 }
139 else
140 {
141 g_debug("DBus Proxy found: %s",screenSaver->bus_name);
142 if (gvariant)
143 {
144 g_variant_unref(gvariant);
145 }
146
147 // Create DBus proxy for screen saver.
148 g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION,
149 G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
150 NULL, // GDBusInterfaceInfo*
151 screenSaver->bus_name,
152 screenSaver->object_path,
153 screenSaver->interface_name,
154 NULL, // GCancellable*
155 &wrapper<DBusScreenSaverInterface,
156 &DBusScreenSaverInterface::finishProxyScreenSaverNew>,
157 this);
158 }
159}
160
161void DBusScreenSaverInterface::finishProxyScreenSaverNew(GObject*, // source_object
162 GAsyncResult *res)
163{
164 GError* error = NULL;
165 proxyScreenSaver = g_dbus_proxy_new_for_bus_finish(res, &error);
166 if (error != NULL)
167 {
168 g_debug("DBus Proxy error callingdomain: %d, code: %d, message: %s", error->domain, error->code, error->message);
169 g_error_free(error);
170 }
171 else if (proxyScreenSaver)
172 {
173 g_debug("DBus Proxy created: %s",screenSaver->bus_name);
174 }
175 else
176 {
177 g_debug("DBus Proxy creation failed: %s",screenSaver->bus_name);
178 }
179}
180
181void DBusScreenSaverInterface::inhibit()
182{
183 if (proxyScreenSaver)
184 {
185 g_debug("DBus Inhibit ScreenSaver");
186 g_dbus_proxy_call(proxyScreenSaver,
187 screenSaver->method_name_inhibit,
188 g_variant_new("(ss)",
189 g_get_application_name (),
190 "showing TV stream"),
191 G_DBUS_CALL_FLAGS_NO_AUTO_START,
192 500, // timeout in milliseconds, -1 use the proxy default timeout
193 NULL, // GCancellable*
194 &wrapper<DBusScreenSaverInterface,
195 &DBusScreenSaverInterface::finishInhibit>,
196 this);
197 }
198}
199
200void DBusScreenSaverInterface::finishInhibit (GObject * source_object, GAsyncResult * res)
201{
202 GError* error = NULL;
203 GVariant *value;
204
205 value = g_dbus_proxy_call_finish (proxyScreenSaver, res, &error);
206 if (!value) {
207 g_warning ("Problem inhibiting the screensaver: %s", error->message);
208 g_error_free (error);
209 return;
210 }
211
212 /* save the cookie */
213 if (g_variant_is_of_type (value, G_VARIANT_TYPE ("(u)"))) {
214 g_variant_get (value, "(u)", &cookie);
215 }else
216 cookie = 0;
217
218 g_debug("DBus Inhibit ScreenSaver successfull with cookie: %d",cookie);
219 g_variant_unref (value);
220}
221
222void DBusScreenSaverInterface::uninhibit()
223{
224 if (proxyScreenSaver && (cookie>0))
225 {
226 g_debug("DBus UnInhibit ScreenSaver");
227 g_dbus_proxy_call(proxyScreenSaver,
228 screenSaver->method_name_uninhibit,
229 g_variant_new ("(u)", cookie),
230 G_DBUS_CALL_FLAGS_NO_AUTO_START,
231 500, // timeout in milliseconds, -1 use the proxy default timeout
232 NULL, // GCancellable*
233 &wrapper<DBusScreenSaverInterface,
234 &DBusScreenSaverInterface::finishUninhibit>,
235 this);
236 }
237}
238
239void DBusScreenSaverInterface::finishUninhibit (GObject * source_object, GAsyncResult * res)
240{
241 GError* error = NULL;
242 GVariant *value;
243
244 value = g_dbus_proxy_call_finish (proxyScreenSaver, res, &error);
245 if (!value) {
246 g_warning ("Problem uninhibiting the screensaver: %s", error->message);
247 g_error_free (error);
248 return;
249 }
250
251 /* clear the cookie */
252 cookie = 0;
253
254 g_debug("DBus UnInhibit ScreenSaver successfull");
255 g_variant_unref (value);
256}
257// -------------------------------------------------------------------
0258
=== added file 'client/inhibitscreensaver.h'
--- client/inhibitscreensaver.h 1970-01-01 00:00:00 +0000
+++ client/inhibitscreensaver.h 2015-04-03 22:53:30 +0000
@@ -0,0 +1,74 @@
1//
2// Inhibit Screen Saver
3//
4// Copyright (C) Joachim Erbs, 2010-2011
5//
6// This file is part of Sinema.
7//
8// Sinema is free software: you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12//
13// Sinema is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with Sinema. If not, see <http://www.gnu.org/licenses/>.
20//
21
22#ifndef INHIBIT_SCREEN_SAVER_H
23#define INHIBIT_SCREEN_SAVER_H
24
25#include <gio/gio.h>
26
27// -------------------------------------------------------------------
28
29class DBusScreenSaverInterface
30{
31public:
32 DBusScreenSaverInterface();
33 ~DBusScreenSaverInterface();
34
35 void inhibit();
36 void uninhibit();
37
38private:
39 template<typename C, void(C::*M)(GObject*, GAsyncResult*)>
40 static void wrapper(GObject *source_object,
41 GAsyncResult *res,
42 gpointer user_data)
43 {
44 C* obj = (C*)user_data;
45 (obj->*M)(source_object, res);
46 }
47
48 struct DBusMethod
49 {
50 const gchar* bus_name;
51 const gchar* interface_name;
52 const gchar* object_path;
53 const gchar* method_name_inhibit;
54 const gchar* method_name_uninhibit;
55 };
56
57 GDBusProxy* proxyDBusDaemon;
58 GDBusProxy* proxyScreenSaver;
59 const DBusMethod* screenSaver;
60 guint32 cookie;
61
62 const DBusMethod dbusDaemon;
63 const DBusMethod freedesktopScreenSaver;
64
65 void finishProxyDBusDaemonNew(GObject*, GAsyncResult *res);
66 void sendDBusDaemonGetNameOwner();
67 void finishDBusDaemonGetNameOwner(GObject*, GAsyncResult *res);
68 void finishProxyScreenSaverNew(GObject*, GAsyncResult *res);
69
70 void finishUninhibit (GObject * source_object, GAsyncResult * res);
71 void finishInhibit (GObject * source_object, GAsyncResult * res);
72};
73
74#endif
075
=== modified file 'client/main_window.cc'
--- client/main_window.cc 2012-12-08 23:09:19 +0000
+++ client/main_window.cc 2015-04-03 22:53:30 +0000
@@ -94,6 +94,8 @@
94 GdkPixmap* pixmap = gdk_bitmap_create_from_data(NULL, bits, 1, 1);94 GdkPixmap* pixmap = gdk_bitmap_create_from_data(NULL, bits, 1, 1);
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);
9696
97 inhibitScreenSaver = new DBusScreenSaverInterface();
98
97 g_debug("Loading UI files");99 g_debug("Loading UI files");
98 100
99 add_accel_group(ui_manager->get_accel_group());101 add_accel_group(ui_manager->get_accel_group());
@@ -281,6 +283,8 @@
281void MainWindow::unfullscreen(gboolean restore_mode)283void MainWindow::unfullscreen(gboolean restore_mode)
282{284{
283 Gtk::Window::unfullscreen();285 Gtk::Window::unfullscreen();
286 inhibitScreenSaver->uninhibit();
287
284 label_time->hide();288 label_time->hide();
285 289
286 if (restore_mode)290 if (restore_mode)
@@ -298,6 +302,7 @@
298 }302 }
299 label_time->show();303 label_time->show();
300 304
305 inhibitScreenSaver->inhibit();
301 Gtk::Window::fullscreen();306 Gtk::Window::fullscreen();
302}307}
303308
304309
=== modified file 'client/main_window.h'
--- client/main_window.h 2011-12-24 22:18:13 +0000
+++ client/main_window.h 2015-04-03 22:53:30 +0000
@@ -23,7 +23,7 @@
2323
24#include "me-tv.h"24#include "me-tv.h"
25#include "engine.h"25#include "engine.h"
26#include <dbus/dbus.h>26#include "inhibitscreensaver.h"
27#include <gtkmm/volumebutton.h>27#include <gtkmm/volumebutton.h>
2828
29typedef enum29typedef enum
@@ -63,6 +63,7 @@
63 Gtk::Label* label_epg_page;63 Gtk::Label* label_epg_page;
64 Gtk::Table* table_epg;64 Gtk::Table* table_epg;
65 Gtk::ScrolledWindow* scrolled_window_epg;65 Gtk::ScrolledWindow* scrolled_window_epg;
66 DBusScreenSaverInterface* inhibitScreenSaver;
66 67
67 void stop();68 void stop();
68 void set_view_mode(ViewMode display_mode);69 void set_view_mode(ViewMode display_mode);
6970
=== modified file 'client/me-tv-client.1'
--- client/me-tv-client.1 2011-12-24 22:18:13 +0000
+++ client/me-tv-client.1 2015-04-03 22:53:30 +0000
@@ -1,22 +1,24 @@
1.pc1.pc
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"
33
4.SH NAME4.SH NAME
5me-tv-client \- a digital television (DVB) viewer for GNOME5me-tv-client \- a digital television (DVB) viewer for GNOME
66
7.SH SYNOPSIS7.SH SYNOPSIS
8.B me-tv8.B me-tv-client
9.I [-?|--help]9.I [-?|-h|--help]
10.I [-v|--verbose]10.I [-v|--verbose]
11.I [-s|--safe-mode]11.I [-s|--safe-mode]
12.I [-m|--minimised]
13.I [--disable-epg]12.I [--disable-epg]
13.I [--engine]
14.I [--no-screensaver-inhibit]14.I [--no-screensaver-inhibit]
15.I [--display=DISPLAY]15.I [--display=DISPLAY]
16.I [--server-host]
17.I [--server-port]
1618
17.SH DESCRIPTION19.SH DESCRIPTION
18Me TV is a GTK desktop application for watching digital television services 20Me TV is a GTK desktop application for watching digital television services
19that use the DVB standard. Me TV works with DVB-T/C/S and ATSC cards that have 21that use the DVB standard. Me TV works with DVB-T/C/S and ATSC cards that have
20kernel driver support.22kernel driver support.
2123
22.SH OPTIONS24.SH OPTIONS
@@ -30,17 +32,23 @@
30.B -s|--safe-mode32.B -s|--safe-mode
31Show the preferences dialog an don't show video upon start.33Show the preferences dialog an don't show video upon start.
32.TP34.TP
33.B -m|--minimised-mode
34Show minimised in notification area at startup.
35.TP
36.B --disable-epg35.B --disable-epg
37Stops the rendering of the EPG event buttons on the UI.36Stops the rendering of the EPG event buttons on the UI.
38.TP37.TP
38.B --engine
39Specify engine type gstreamer or vlc (default: vlc).
40.TP
39.B --no-screensaver-inhibit41.B --no-screensaver-inhibit
40Tells Me TV not to call the screensaver Inhibit/UnInhibit methods for GNOME Screensaver.42Tells Me TV not to call the screensaver Inhibit/UnInhibit methods for GNOME Screensaver.
41.TP43.TP
42.B --display=DISPLAY44.B --display=DISPLAY
43X display to use45X display to use
46.TP
47.B --server-host
48Me TV server host (default: localhost)
49.TP
50.B --server-port
51Me TV server port (default: 1999)
4452
45.SH AUTHOR53.SH AUTHOR
46Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>.54Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>.
4755
=== modified file 'client/me-tv-client.cc'
--- client/me-tv-client.cc 2012-12-08 23:09:19 +0000
+++ client/me-tv-client.cc 2015-04-03 22:53:30 +0000
@@ -26,7 +26,6 @@
26#include <glib/gprintf.h>26#include <glib/gprintf.h>
27#include <X11/Xlib.h>27#include <X11/Xlib.h>
28#include <unique/unique.h>28#include <unique/unique.h>
29#include <dbus/dbus-glib.h>
30#include "me-tv-ui.h"29#include "me-tv-ui.h"
31#include "configuration_manager.h"30#include "configuration_manager.h"
32#include "../common/exception.h"31#include "../common/exception.h"
@@ -45,7 +44,7 @@
45 UniqueResponse response = UNIQUE_RESPONSE_FAIL;44 UniqueResponse response = UNIQUE_RESPONSE_FAIL;
4645
47 switch (command)46 switch (command)
48 {47 {
49 case 1:48 case 1:
50 action_present->activate();49 action_present->activate();
51 response = UNIQUE_RESPONSE_OK;50 response = UNIQUE_RESPONSE_OK;
@@ -101,15 +100,6 @@
101 safe_mode_option_entry.set_short_name('s');100 safe_mode_option_entry.set_short_name('s');
102 safe_mode_option_entry.set_description(_("Start in safe mode"));101 safe_mode_option_entry.set_description(_("Start in safe mode"));
103102
104 Glib::OptionEntry minimised_option_entry;
105 minimised_option_entry.set_long_name("minimised");
106 minimised_option_entry.set_short_name('m');
107 minimised_option_entry.set_description(_("Start minimised in notification area"));
108
109 Glib::OptionEntry disable_epg_thread_option_entry;
110 disable_epg_thread_option_entry.set_long_name("disable-epg-thread");
111 disable_epg_thread_option_entry.set_description(_("Disable the EPG thread. Me TV will stop collecting EPG events."));
112
113 Glib::OptionEntry disable_epg_option_entry;103 Glib::OptionEntry disable_epg_option_entry;
114 disable_epg_option_entry.set_long_name("disable-epg");104 disable_epg_option_entry.set_long_name("disable-epg");
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."));
@@ -123,10 +113,6 @@
123 no_screensaver_inhibit_option_entry.set_long_name("no-screensaver-inhibit");113 no_screensaver_inhibit_option_entry.set_long_name("no-screensaver-inhibit");
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."));
125115
126 Glib::OptionEntry devices_option_entry;
127 devices_option_entry.set_long_name("devices");
128 devices_option_entry.set_description(_("Only use the specified frontend devices (e.g. --devices=/dev/dvb/adapter0/frontend0,/dev/dvb/adapter0/frontend1)"));
129
130 Glib::OptionEntry host_option_entry;116 Glib::OptionEntry host_option_entry;
131 host_option_entry.set_long_name("server-host");117 host_option_entry.set_long_name("server-host");
132 host_option_entry.set_description(_("Me TV server host (default: localhost)"));118 host_option_entry.set_description(_("Me TV server host (default: localhost)"));
@@ -135,19 +121,11 @@
135 port_option_entry.set_long_name("server-port");121 port_option_entry.set_long_name("server-port");
136 port_option_entry.set_description(_("Me TV server port (default: 1999)"));122 port_option_entry.set_description(_("Me TV server port (default: 1999)"));
137123
138 Glib::OptionEntry read_timeout_option_entry;
139 read_timeout_option_entry.set_long_name("read-timeout");
140 read_timeout_option_entry.set_description(_("How long to wait (in seconds) before timing out while waiting for data from demuxer (default 5)."));
141
142 Glib::OptionGroup option_group(PACKAGE_NAME, "", _("Show Me TV help options"));124 Glib::OptionGroup option_group(PACKAGE_NAME, "", _("Show Me TV help options"));
143 option_group.add_entry(verbose_option_entry, verbose_logging);125 option_group.add_entry(verbose_option_entry, verbose_logging);
144 option_group.add_entry(safe_mode_option_entry, safe_mode);126 option_group.add_entry(safe_mode_option_entry, safe_mode);
145 option_group.add_entry(minimised_option_entry, minimised_mode);
146 option_group.add_entry(disable_epg_thread_option_entry, disable_epg_thread);
147 option_group.add_entry(disable_epg_option_entry, disable_epg);127 option_group.add_entry(disable_epg_option_entry, disable_epg);
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);
149 option_group.add_entry(devices_option_entry, devices);
150 option_group.add_entry(read_timeout_option_entry, read_timeout);
151 option_group.add_entry(host_option_entry, server_host);129 option_group.add_entry(host_option_entry, server_host);
152 option_group.add_entry(port_option_entry, server_port);130 option_group.add_entry(port_option_entry, server_port);
153 option_group.add_entry(engine_option_entry, engine_type);131 option_group.add_entry(engine_option_entry, engine_type);
@@ -235,13 +213,6 @@
235213
236 ui_manager = Gtk::UIManager::create();214 ui_manager = Gtk::UIManager::create();
237 ui_manager->insert_action_group(action_group);215 ui_manager->insert_action_group(action_group);
238
239 GError *error = NULL;
240 DBusGConnection* dbus_connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
241 if (dbus_connection == NULL)
242 {
243 g_message(_("Failed to get DBus session"));
244 }
245216
246 configuration_manager.initialise();217 configuration_manager.initialise();
247 client.register_client(server_host, server_port);218 client.register_client(server_host, server_port);
248219
=== modified file 'client/me-tv.cc'
--- client/me-tv.cc 2012-03-17 14:07:31 +0000
+++ client/me-tv.cc 2015-04-03 22:53:30 +0000
@@ -25,12 +25,8 @@
2525
26bool verbose_logging = false;26bool verbose_logging = false;
27bool safe_mode = false;27bool safe_mode = false;
28bool minimised_mode = false;
29bool disable_epg_thread = false;
30bool disable_epg = false;28bool disable_epg = false;
31bool no_screensaver_inhibit = false;29bool no_screensaver_inhibit = false;
32Glib::ustring devices;
33gint read_timeout = 5;
34Glib::ustring server_host = "localhost";30Glib::ustring server_host = "localhost";
35gint server_port = 1999;31gint server_port = 1999;
36Glib::ustring engine_type = "vlc";32Glib::ustring engine_type = "vlc";
3733
=== modified file 'client/me-tv.h'
--- client/me-tv.h 2012-03-11 22:20:20 +0000
+++ client/me-tv.h 2015-04-03 22:53:30 +0000
@@ -31,12 +31,8 @@
3131
32extern bool verbose_logging;32extern bool verbose_logging;
33extern bool safe_mode;33extern bool safe_mode;
34extern bool minimised_mode;
35extern bool disable_epg_thread;
36extern bool disable_epg;34extern bool disable_epg;
37extern bool no_screensaver_inhibit;35extern bool no_screensaver_inhibit;
38extern Glib::ustring devices;
39extern gint read_timeout;
40extern Glib::ustring server_host;36extern Glib::ustring server_host;
41extern gint server_port;37extern gint server_port;
42extern Glib::ustring engine_type;38extern Glib::ustring engine_type;
4339
=== modified file 'configure.ac'
--- configure.ac 2012-12-29 22:49:32 +0000
+++ configure.ac 2015-04-03 22:53:30 +0000
@@ -1,7 +1,7 @@
1# Process this file with autoconf to produce a configure script.1# Process this file with autoconf to produce a configure script.
22
3AC_PREREQ(2.53)3AC_PREREQ(2.53)
4AC_INIT([Me TV], [1.4.0.12], [http://launchpad.net/me-tv], me-tv)4AC_INIT([Me TV], [1.4.0.58], [http://launchpad.net/me-tv], me-tv)
5AC_COPYRIGHT([Michael Lamothe <michael.lamothe@gmail.com>])5AC_COPYRIGHT([Michael Lamothe <michael.lamothe@gmail.com>])
6AM_INIT_AUTOMAKE([1.9 foreign])6AM_INIT_AUTOMAKE([1.9 foreign])
7AC_GNU_SOURCE7AC_GNU_SOURCE
88
=== modified file 'server/channel_manager.cc'
--- server/channel_manager.cc 2012-06-10 20:50:55 +0000
+++ server/channel_manager.cc 2015-04-03 22:53:30 +0000
@@ -271,6 +271,23 @@
271 return *channel;271 return *channel;
272}272}
273273
274Channel& ChannelManager::get_channel_by_name(Glib::ustring name)
275{
276 Glib::RecMutex::Lock lock(mutex);
277
278 Channel* channel = NULL;
279
280 for (ChannelList::iterator iterator = channels.begin(); iterator != channels.end() && channel == NULL; iterator++)
281 {
282 if ((*iterator).name == name)
283 {
284 channel = &(*iterator);
285 }
286 }
287
288 return *channel;
289}
290
274Channel& ChannelManager::get_channel_by_id(guint channel_id)291Channel& ChannelManager::get_channel_by_id(guint channel_id)
275{292{
276 Glib::RecMutex::Lock lock(mutex);293 Glib::RecMutex::Lock lock(mutex);
277294
=== modified file 'server/channel_manager.h'
--- server/channel_manager.h 2011-12-24 22:18:13 +0000
+++ server/channel_manager.h 2015-04-03 22:53:30 +0000
@@ -53,6 +53,7 @@
5353
54 Channel& get_channel_by_id(guint channel_id);54 Channel& get_channel_by_id(guint channel_id);
55 Channel& get_channel_by_index(guint number);55 Channel& get_channel_by_index(guint number);
56 Channel& get_channel_by_name(Glib::ustring name);
56 Channel* find_channel(guint frequency, guint service_id);57 Channel* find_channel(guint frequency, guint service_id);
57 Channel* find_channel(guint channel_id);58 Channel* find_channel(guint channel_id);
5859
5960
=== modified file 'server/me-tv-server.1'
--- server/me-tv-server.1 2011-12-24 22:18:13 +0000
+++ server/me-tv-server.1 2015-04-03 22:53:30 +0000
@@ -1,16 +1,18 @@
1.pc1.pc
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"
33
4.SH NAME4.SH NAME
5me-tv-server \- a digital television (DVB) viewer for GNOME5me-tv-server \- a digital television (DVB) viewer for GNOME
66
7.SH SYNOPSIS7.SH SYNOPSIS
8.B me-tv-server8.B me-tv-server
9.I [-?|--help]9.I [-?|-h|--help]
10.I [-v|--verbose]10.I [-v|--verbose]
11.I [--disable-epg-thread]11.I [--disable-epg-thread]
12.I [--devices]12.I [--devices]
13.I [--read-timeout]13.I [--read-timeout]
14.I [--broadcast-address]
15.I [--server-port]
1416
15.SH DESCRIPTION17.SH DESCRIPTION
16Me TV is a GTK desktop application for watching digital television services 18Me TV is a GTK desktop application for watching digital television services
@@ -35,6 +37,12 @@
35.TP37.TP
36.B --read-timeout38.B --read-timeout
37How long to wait (in seconds) before timing out while waiting for data from demuxer (default 5)39How long to wait (in seconds) before timing out while waiting for data from demuxer (default 5)
40.TP
41.B --broadcast-address
42The network broadcast address to send video streams for clients to display (default 127.0.0.1).
43.TP
44.B --server-port
45The network port for clients to connect to (default 1999).
3846
39.SH AUTHOR47.SH AUTHOR
40Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>.48Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>.
4149
=== modified file 'server/request_handler.cc'
--- server/request_handler.cc 2012-03-17 16:43:02 +0000
+++ server/request_handler.cc 2015-04-03 22:53:30 +0000
@@ -262,7 +262,23 @@
262 }262 }
263 else if (command == "set_channel_order")263 else if (command == "set_channel_order")
264 {264 {
265265 ChannelList newchannels;
266
267 NodeSet nodes = root_node->find("parameter");
268 for (NodeSet::iterator i = nodes.begin(); i != nodes.end(); i++)
269 {
270 Node* node = *i;
271
272 const Glib::ustring& name = get_attribute_value(node, "@name");
273 const Glib::ustring& value = get_attribute_value(node, "@value");
274
275 newchannels.push_back(channel_manager.get_channel_by_name(name));
276
277 Glib::ustring s = Glib::ustring::compose(" name=%1 -- value=%2", name, value);
278 g_debug(s.c_str());
279 }
280
281 channel_manager.set_channels(schema, connection, newchannels);
266 }282 }
267 else if (command == "get_epg")283 else if (command == "get_epg")
268 {284 {

Subscribers

People subscribed via source and target branches