[gedit-plugins] Restore codecomment sensitivity check
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins] Restore codecomment sensitivity check
- Date: Sat, 27 Nov 2010 15:20:24 +0000 (UTC)
commit 6e334bf63bc7485786cb5fd8df01829f594c895a
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Nov 27 16:21:56 2010 +0100
Restore codecomment sensitivity check
plugins/codecomment/codecomment.py | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/plugins/codecomment/codecomment.py b/plugins/codecomment/codecomment.py
index 5d3b0d2..d7be7b3 100644
--- a/plugins/codecomment/codecomment.py
+++ b/plugins/codecomment/codecomment.py
@@ -66,16 +66,13 @@ class CodeCommentPlugin(GObject.Object, Gedit.WindowActivatable):
self._remove_menu()
def do_update_state(self):
+ sensitive = False
doc = self.window.get_active_document()
if doc:
- #FIXME: This crashes
- #lang = doc.get_language()
- lang = None
+ lang = doc.get_language()
if lang is not None:
sensitive = self.get_comment_tags(lang) != (None, None)
- self._action_group.set_sensitive(sensitive)
- return
- self._action_group.set_sensitive(True)
+ self._action_group.set_sensitive(sensitive)
def _remove_menu(self):
manager = self.window.get_ui_manager()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]