gnome-screensaver r1424 - in trunk: . src
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-screensaver r1424 - in trunk: . src
- Date: Mon, 7 Apr 2008 23:14:39 +0100 (BST)
Author: mccann
Date: Mon Apr 7 23:14:39 2008
New Revision: 1424
URL: http://svn.gnome.org/viewvc/gnome-screensaver?rev=1424&view=rev
Log:
2008-04-07 William Jon McCann <jmccann redhat com>
* src/gs-lock-plug.c: (on_note_text_buffer_changed),
(gs_lock_plug_init):
Add a 160 char limit to the notes.
Fixes #519447
Modified:
trunk/ChangeLog
trunk/src/gs-lock-plug.c
Modified: trunk/src/gs-lock-plug.c
==============================================================================
--- trunk/src/gs-lock-plug.c (original)
+++ trunk/src/gs-lock-plug.c Mon Apr 7 23:14:39 2008
@@ -56,6 +56,8 @@
#define GDM_FLEXISERVER_COMMAND "gdmflexiserver"
#define GDM_FLEXISERVER_ARGS "--startnew Standard"
+#define NOTE_BUFFER_MAX_CHARS 160 /* same as SMS ;) */
+
enum {
AUTH_PAGE = 0,
};
@@ -81,7 +83,6 @@
GtkWidget *auth_prompt_box;
GtkWidget *auth_capslock_label;
GtkWidget *auth_message_label;
- GtkWidget *switch_user_treeview;
GtkWidget *away_message_label;
GtkWidget *auth_unlock_button;
@@ -1578,6 +1579,18 @@
gtk_clipboard_set_text (clipboard, "", -1);
}
+static void
+on_note_text_buffer_changed (GtkTextBuffer *buffer,
+ GSLockPlug *plug)
+{
+ 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);
+ }
+}
+
#define INVISIBLE_CHAR_DEFAULT '*'
#define INVISIBLE_CHAR_BLACK_CIRCLE 0x25cf
#define INVISIBLE_CHAR_WHITE_BULLET 0x25e6
@@ -1622,6 +1635,12 @@
gtk_widget_show_all (plug->priv->vbox);
}
+ if (plug->priv->note_text_view != NULL) {
+ GtkTextBuffer *buffer;
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (plug->priv->note_text_view));
+ g_signal_connect (buffer, "changed", G_CALLBACK (on_note_text_buffer_changed), plug);
+ }
+
/* Layout indicator */
#ifdef WITH_KBD_LAYOUT_INDICATOR
if (plug->priv->auth_prompt_kbd_layout_indicator != NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]