From 8ab26b1cd3f1a5e67c6f06adf59d3de8c9bb14d5 Mon Sep 17 00:00:00 2001 From: "Marco Trevisan (Treviño)" Date: Sat, 9 Jul 2011 05:42:45 +0200 Subject: Get support for gtk+2.0 back indicator-session can still be compiled with gtk, using the --with-gtk=2 configure flag (I've changed it to match the other indicators). --- configure.ac | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 4f2cb04..f3a9039 100644 --- a/configure.ac +++ b/configure.ac @@ -31,18 +31,18 @@ INDICATOR_REQUIRED_VERSION=0.3.19 DBUSMENUGTK_REQUIRED_VERSION=0.3.91 POLKIT_REQUIRED_VERSION=0.92 -AC_ARG_WITH([indicator-gtk], - [AS_HELP_STRING([--with-indicator-gtk], +AC_ARG_WITH([gtk], + [AS_HELP_STRING([--with-gtk], [Which version of gtk to use for the indicator @<:@default=3@:>@])], [], - [with_indicator_gtk=3]) + [with_gtk=3]) -AS_IF([test "x$with_indicator_gtk" = x3], +AS_IF([test "x$with_gtk" = x3], [PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK3_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) ], - [test "x$with_indicator_gtk" = x2], + [test "x$with_gtk" = x2], [PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION indicator-0.4 >= $INDICATOR_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) @@ -54,17 +54,34 @@ AC_SUBST(APPLET_LIBS) DBUSMENUGLIB_REQUIRED_VERSION=0.1.1 -PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION - dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION - dbus-glib-1 - gio-unix-2.0 - indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION) +AS_IF([test "x$with_gtk" = x3], + [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION + dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION + dbus-glib-1 + gio-unix-2.0 + indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION) + ], + [test "x$with_gtk" = x2], + [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION + dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION + dbus-glib-1 + gio-unix-2.0 + indicator-0.4 >= $INDICATOR_REQUIRED_VERSION) + ] +) AC_SUBST(SESSIONERVICE_CFLAGS) AC_SUBST(SESSIONERVICE_LIBS) -PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-3.0 >= $GTK3_REQUIRED_VERSION - polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION) +AS_IF([test "x$with_gtk" = x3], + [PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-3.0 >= $GTK3_REQUIRED_VERSION + polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION) + ], + [test "x$with_gtk" = x2], + [PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-2.0 >= $GTK_REQUIRED_VERSION + polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION) + ] +) AC_SUBST(GTKLOGOUTHELPER_CFLAGS) @@ -94,7 +111,7 @@ AC_ARG_ENABLE(localinstall, AS_HELP_STRING([--enable-localinstall], [install all if test "x$with_localinstall" = "xyes"; then INDICATORDIR="${libdir}/indicators/2/" INDICATORICONSDIR="${datadir}/indicator-applet/icons/" -elif test "x$with_indicator_gtk" = x2; then +elif test "x$with_gtk" = x2; then INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator-0.4` INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator-0.4` else @@ -179,5 +196,5 @@ AC_MSG_NOTICE([ SUS Indicator Configuration: Prefix: $prefix - Indicator GTK: $with_indicator_gtk + Indicator GTK: $with_gtk ]) -- cgit v1.2.3 From ff7cd22d1cc2ff22dc35dc7c0e513bd3423020ae Mon Sep 17 00:00:00 2001 From: "Marco Trevisan (Treviño)" Date: Sat, 9 Jul 2011 05:57:42 +0200 Subject: configure.ac: include the indicator dir in output --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index f3a9039..c03639e 100644 --- a/configure.ac +++ b/configure.ac @@ -196,5 +196,6 @@ AC_MSG_NOTICE([ SUS Indicator Configuration: Prefix: $prefix + Indicator Dir: $INDICATORDIR Indicator GTK: $with_gtk ]) -- cgit v1.2.3 From 84fb2fdde96442f79bb1da1edf4d707019b68f98 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 14 Jul 2011 17:40:43 +0100 Subject: bumped release version --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 4f2cb04..59227b8 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.2.92) +AM_INIT_AUTOMAKE(indicator-session, 0.2.93) AM_MAINTAINER_MODE -- cgit v1.2.3 From 92208b4e83ca7d486aa65ebc4b80e0d36e94095f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 22 Jul 2011 18:07:00 +0100 Subject: bumped version in configure ac in prep for release --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 2c4c867..17f5c55 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.2.93) +AM_INIT_AUTOMAKE(indicator-session, 0.2.94) AM_MAINTAINER_MODE -- cgit v1.2.3 From df0f2927babbf31d51b8a33fcf744d2a92e70ac5 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 22 Jul 2011 18:15:55 +0100 Subject: moving to 0.3.0 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 17f5c55..369f12b 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.2.94) +AM_INIT_AUTOMAKE(indicator-session, 0.3.0) AM_MAINTAINER_MODE -- cgit v1.2.3 From 6dce39846999951353c2e866019a79d568c99dfa Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 25 Jul 2011 18:42:24 +0100 Subject: the beginnings of the udev work --- configure.ac | 2 ++ src/device-menu-mgr.c | 8 +++--- src/udev-mgr.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++---- src/udev-mgr.h | 14 ++++++++--- 4 files changed, 80 insertions(+), 12 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 369f12b..e32ac4a 100644 --- a/configure.ac +++ b/configure.ac @@ -58,12 +58,14 @@ AS_IF([test "x$with_gtk" = x3], [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION dbus-glib-1 + gudev-1.0 gio-unix-2.0 indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION) ], [test "x$with_gtk" = x2], [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION + gudev-1.0 dbus-glib-1 gio-unix-2.0 indicator-0.4 >= $INDICATOR_REQUIRED_VERSION) diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index 324b3f1..063045e 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -27,7 +27,7 @@ with this program. If not, see . #include "lock-helper.h" #include "upower-client.h" #include "apt-watcher.h" - +#include "udev-mgr.h" #define UP_ADDRESS "org.freedesktop.UPower" #define UP_OBJECT "/org/freedesktop/UPower" @@ -41,6 +41,7 @@ struct _DeviceMenuMgr DbusmenuMenuitem* root_item; SessionDbus* session_dbus_interface; AptWatcher* apt_watcher; + UdevMgr* udev_mgr; }; static GConfClient *gconf_client = NULL; @@ -214,7 +215,6 @@ machine_sleep_with_context (DeviceMenuMgr* self, gchar* type) screensaver_throttle(type); lock_if_possible (self); - dbus_g_proxy_begin_call(up_main_proxy, type, sleep_response, @@ -681,7 +681,9 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self) restart_shutdown_logout_mi->logout_mi = logout_mi; restart_shutdown_logout_mi->shutdown_mi = shutdown_mi; - update_menu_entries(restart_shutdown_logout_mi); + update_menu_entries(restart_shutdown_logout_mi); + // Time to create the udev mgr and hand it the static relevant items. + self->udev_mgr = udev_mgr_new (webcam_menuitem, scanners_menuitem); } diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 6575ca5..b5c1936 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -18,21 +18,63 @@ with this program. If not, see . */ #include "udev-mgr.h" +#include + +static void udevice_mgr_device_list_iterator (gpointer data, + gpointer userdata); +static void udev_mgr_uevent_cb (GUdevClient *client, + gchar *action, + GUdevDevice *device, + gpointer user_data); +struct _UdevMgr +{ + GObject parent_instance; + DbusmenuMenuitem* scanner_item; + DbusmenuMenuitem* webcam_item; + GUdevClient* client; +}; G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT); static void -udev_mgr_init (UdevMgr *object) +udev_mgr_init (UdevMgr* self) +{ + self->client = NULL; + const gchar *subsystems[1] = {"usb"}; + self->client = g_udev_client_new (subsystems); + const gchar* usb_subsystem = "usb"; + + GList* devices_available = g_udev_client_query_by_subsystem (self->client, + usb_subsystem); + + if (FALSE){ + g_list_foreach (devices_available, udevice_mgr_device_list_iterator, self); + } + //g_list_free (devices_available); + if (FALSE){ + g_signal_connect (G_OBJECT (self->client), + "u-event", + G_CALLBACK (udev_mgr_uevent_cb), + self); + } +} + +static void +udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) { - /* TODO: Add initialization code here */ + g_return_if_fail (G_UDEV_IS_DEVICE (data)); + GUdevDevice* device = G_UDEV_DEVICE (data); + const gchar* name = g_udev_device_get_name (device); + + g_debug ("UDEV MGR - the name of the device = %s", name); + // for now tidy up here. + g_object_unref (device); } static void udev_mgr_finalize (GObject *object) { - /* TODO: Add deinitalization code here */ - G_OBJECT_CLASS (udev_mgr_parent_class)->finalize (object); } @@ -40,7 +82,23 @@ static void udev_mgr_class_init (UdevMgrClass *klass) { GObjectClass* object_class = G_OBJECT_CLASS (klass); - object_class->finalize = udev_mgr_finalize; } +static void udev_mgr_uevent_cb (GUdevClient *client, + gchar *action, + GUdevDevice *device, + gpointer user_data) +{ + g_debug ("just received a UEVENT with an action : %s", action); + g_return_if_fail (UDEV_IS_MGR (user_data)); +} + +UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, + DbusmenuMenuitem* webcam) +{ + UdevMgr* mgr = g_object_new (UDEV_TYPE_MGR, NULL); + mgr->scanner_item = scanner; + mgr->webcam_item = webcam; + return mgr; +} diff --git a/src/udev-mgr.h b/src/udev-mgr.h index 1c5ae73..323364a 100644 --- a/src/udev-mgr.h +++ b/src/udev-mgr.h @@ -21,6 +21,14 @@ with this program. If not, see . #define _UDEV_MGR_H_ #include +#include + +#include +#if GTK_CHECK_VERSION(3, 0, 0) +#include +#else +#include +#endif G_BEGIN_DECLS @@ -39,12 +47,10 @@ struct _UdevMgrClass GObjectClass parent_class; }; -struct _UdevMgr -{ - GObject parent_instance; -}; GType udev_mgr_get_type (void) G_GNUC_CONST; +UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner_item, + DbusmenuMenuitem* webcam_item); G_END_DECLS -- cgit v1.2.3 From fb32494de9b55663cec088ade6967da349c0cac7 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 10 Aug 2011 19:15:18 +0100 Subject: bumped for new release --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index e32ac4a..19cc4bc 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.3.0) +AM_INIT_AUTOMAKE(indicator-session, 0.3.1) AM_MAINTAINER_MODE -- cgit v1.2.3