Revision: 566 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=566&view=rev Author: andrew_janke Date: 2009-03-30 23:38:59 +0000 (Mon, 30 Mar 2009)
Log Message: ----------- * added doc check patch from Frank
Modified Paths: -------------- trunk/shiftcolumn/ChangeLog trunk/shiftcolumn/NEWS trunk/shiftcolumn/src/shiftcolumn.c
Modified: trunk/shiftcolumn/ChangeLog =================================================================== --- trunk/shiftcolumn/ChangeLog 2009-03-29 16:40:05 UTC (rev 565) +++ trunk/shiftcolumn/ChangeLog 2009-03-30 23:38:59 UTC (rev 566) @@ -1,3 +1,8 @@ +2009-03-31 Andrew L Janke a.janke@gmail.com + + * src/shiftcolumn.c: Check if document is open + before doing anything (Thanks Frank) + 2009-03-17 Andrew L Janke a.janke@gmail.com
* src/shiftcolumn.c: Added VERSION instead of static string
Modified: trunk/shiftcolumn/NEWS =================================================================== --- trunk/shiftcolumn/NEWS 2009-03-29 16:40:05 UTC (rev 565) +++ trunk/shiftcolumn/NEWS 2009-03-30 23:38:59 UTC (rev 566) @@ -2,7 +2,8 @@ New in Version 0.3 ------------------
-* added license and po files +* added license and po files (de,fr,ru,sw translations) +* will no longer crash if called when no document is open
New in Version 0.2 ------------------
Modified: trunk/shiftcolumn/src/shiftcolumn.c =================================================================== --- trunk/shiftcolumn/src/shiftcolumn.c 2009-03-29 16:40:05 UTC (rev 565) +++ trunk/shiftcolumn/src/shiftcolumn.c 2009-03-30 23:38:59 UTC (rev 566) @@ -348,10 +348,22 @@
static void kb_shift_left(G_GNUC_UNUSED guint key_id){ + + /* sanity check */ + if (document_get_current() == NULL){ + return; + } + shift_left_cb(NULL, NULL); }
static void kb_shift_right(G_GNUC_UNUSED guint key_id){ + + /* sanity check */ + if (document_get_current() == NULL){ + return; + } + shift_right_cb(NULL, NULL); }
@@ -373,12 +385,16 @@ menu_item_shift_right); g_signal_connect(menu_item_shift_right, "activate", G_CALLBACK(shift_right_cb), NULL); + + /* make sure our menu items aren't called when there is no doc open */ + ui_add_document_sensitive(menu_item_shift_right); + ui_add_document_sensitive(menu_item_shift_left);
/* setup keybindings */ keybindings_set_item(plugin_key_group, KB_SHIFT_LEFT, kb_shift_left, - GDK_9, GDK_CONTROL_MASK, "shift_left", _("Shift Left"), NULL); + GDK_9, GDK_CONTROL_MASK, "shift_left", _("Shift Left"), menu_item_shift_left); keybindings_set_item(plugin_key_group, KB_SHIFT_RIGHT, kb_shift_right, - GDK_0, GDK_CONTROL_MASK, "shift_right", _("Shift Right"), NULL); + GDK_0, GDK_CONTROL_MASK, "shift_right", _("Shift Right"), menu_item_shift_right); }
void plugin_cleanup(void){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org