Revision: 4792 http://geany.svn.sourceforge.net/geany/?rev=4792&view=rev Author: ntrel Date: 2010-03-31 11:35:31 +0000 (Wed, 31 Mar 2010)
Log Message: ----------- Beep if the user hasn't entered a class name on pressing OK.
Modified Paths: -------------- trunk/ChangeLog trunk/plugins/classbuilder.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-03-30 17:19:59 UTC (rev 4791) +++ trunk/ChangeLog 2010-03-31 11:35:31 UTC (rev 4792) @@ -1,3 +1,9 @@ +2010-03-31 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * plugins/classbuilder.c: + Beep if the user hasn't entered a class name on pressing OK. + + 2010-03-30 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* THANKS, src/vte.c:
Modified: trunk/plugins/classbuilder.c =================================================================== --- trunk/plugins/classbuilder.c 2010-03-30 17:19:59 UTC (rev 4791) +++ trunk/plugins/classbuilder.c 2010-03-31 11:35:31 UTC (rev 4792) @@ -188,7 +188,7 @@ static void cc_dlg_on_set_sensitive_toggled(GtkWidget *toggle_button, GtkWidget *target_widget); static void cc_dlg_on_class_name_entry_changed(GtkWidget *entry, CreateClassDialog *cc_dlg); static void cc_dlg_on_base_name_entry_changed(GtkWidget *entry, CreateClassDialog *cc_dlg); -static void cc_dlg_on_create_class(CreateClassDialog *cc_dlg); +static gboolean create_class(CreateClassDialog *cc_dlg);
/* The list must be ended with NULL as an extra check that arg_count is correct. */ @@ -446,9 +446,13 @@ }
gtk_widget_show_all(cc_dlg->dialog); - if (gtk_dialog_run(GTK_DIALOG(cc_dlg->dialog)) == GTK_RESPONSE_OK) - cc_dlg_on_create_class(cc_dlg); - + while (gtk_dialog_run(GTK_DIALOG(cc_dlg->dialog)) == GTK_RESPONSE_OK) + { + if (create_class(cc_dlg)) + break; + else + gdk_beep(); + } gtk_widget_destroy(cc_dlg->dialog); /* g_object_unref(G_OBJECT(cc_dlg->dialog)); */ } @@ -559,17 +563,17 @@ }
-static void cc_dlg_on_create_class(CreateClassDialog *cc_dlg) +static gboolean create_class(CreateClassDialog *cc_dlg) { ClassInfo *class_info; GeanyDocument *doc; gchar *text; gchar *tmp;
- g_return_if_fail(cc_dlg != NULL); + g_return_val_if_fail(cc_dlg != NULL, FALSE);
if (utils_str_equal(gtk_entry_get_text(GTK_ENTRY(cc_dlg->class_name_entry)), "")) - return; + return FALSE;
class_info = g_new0(ClassInfo, 1); class_info->type = cc_dlg->class_type; @@ -718,6 +722,7 @@ class_info->constructor_decl, class_info->constructor_impl, class_info->gtk_destructor_registration, class_info->destructor_decl, class_info->destructor_impl, class_info->base_gtype, class_info, NULL); + return TRUE; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.