From a5f06dc69e0696c0f64246ee2debaa5d504c1c10 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Thu, 28 Feb 2013 00:05:01 +0100 Subject: Use libnotify instead of libmatenotify Fix some things in leave message feature --- src/gs-lock-plug.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/gs-lock-plug.c') diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c index dff9a5a..7f95adc 100644 --- a/src/gs-lock-plug.c +++ b/src/gs-lock-plug.c @@ -43,8 +43,8 @@ #include #endif -#ifdef WITH_LIBMATENOTIFY -#include +#ifdef WITH_LIBNOTIFY +#include #endif #include "gs-lock-plug.h" @@ -1183,7 +1183,7 @@ static void submit_note (GtkButton *button, GSLockPlug *plug) { -#ifdef WITH_LIBMATENOTIFY +#ifdef WITH_LIBNOTIFY char *text; char summary[128]; char *escaped_text; @@ -1204,8 +1204,7 @@ submit_note (GtkButton *button, tmp = localtime (&t); strftime (summary, 128, "%X", tmp); - notify_init ("mate-screensaver-dialog"); - note = notify_notification_new (summary, escaped_text, NULL, NULL); + note = notify_notification_new (summary, escaped_text, NULL); notify_notification_set_timeout (note, NOTIFY_EXPIRES_NEVER); notify_notification_show (note, NULL); g_object_unref (note); @@ -1214,7 +1213,7 @@ submit_note (GtkButton *button, g_free (escaped_text); gs_lock_plug_response (plug, GS_LOCK_PLUG_RESPONSE_CANCEL); -#endif /* WITH_LIBMATENOTIFY */ +#endif /* WITH_LIBNOTIFY */ } static void @@ -1882,10 +1881,7 @@ on_note_text_buffer_changed (GtkTextBuffer *buffer, int len; len = gtk_text_buffer_get_char_count (buffer); - if (len > NOTE_BUFFER_MAX_CHARS) - { - gtk_widget_set_sensitive (plug->priv->note_text_view, FALSE); - } + gtk_widget_set_sensitive (plug->priv->note_ok_button, len <= NOTE_BUFFER_MAX_CHARS); } static void @@ -1897,7 +1893,8 @@ gs_lock_plug_init (GSLockPlug *plug) clear_clipboards (plug); -#ifdef WITH_LIBMATENOTIFY +#ifdef WITH_LIBNOTIFY + notify_init ("mate-screensaver-dialog"); plug->priv->leave_note_enabled = TRUE; #else plug->priv->leave_note_enabled = FALSE; @@ -2084,6 +2081,9 @@ gs_lock_plug_finalize (GObject *object) remove_response_idle (plug); remove_cancel_timeout (plug); +#ifdef WITH_LIBNOTIFY + notify_uninit (); +#endif G_OBJECT_CLASS (gs_lock_plug_parent_class)->finalize (object); } -- cgit v1.2.1