[gedit] Make Change Case sensitivity depend on selection
- From: Paolo Borelli <pborelli src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Make Change Case sensitivity depend on selection
- Date: Sat, 1 Aug 2009 11:18:29 +0000 (UTC)
commit 69f3c603f9cf27517619c503c44728ae7061b429
Author: Paolo Borelli <porelli gnome org>
Date: Sat Aug 1 13:18:32 2009 +0200
Make Change Case sensitivity depend on selection
plugins/changecase/gedit-changecase-plugin.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/plugins/changecase/gedit-changecase-plugin.c b/plugins/changecase/gedit-changecase-plugin.c
index 6adc6db..29fc072 100644
--- a/plugins/changecase/gedit-changecase-plugin.c
+++ b/plugins/changecase/gedit-changecase-plugin.c
@@ -283,17 +283,22 @@ update_ui_real (GeditWindow *window,
WindowData *data)
{
GtkTextView *view;
+ GtkTextBuffer *buffer;
+ gboolean sensitive;
GtkAction *action;
gedit_debug (DEBUG_PLUGINS);
view = GTK_TEXT_VIEW (gedit_window_get_active_view (window));
+ buffer = gtk_text_view_get_buffer (view);
+
+ sensitive = ((view != NULL) &&
+ gtk_text_view_get_editable (view) &&
+ gtk_text_buffer_get_has_selection (buffer));
action = gtk_action_group_get_action (data->action_group,
"ChangeCase");
- gtk_action_set_sensitive (action,
- (view != NULL) &&
- gtk_text_view_get_editable (view));
+ gtk_action_set_sensitive (action, sensitive);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]