[Anjuta-list] [PATCH] Some fixes



Included here the diff for
1) Restore the error color to red (waiting for a configurable one )
2) Saving projects settings if you exit anjuta without closing an open
saved project
3) New Menu 'repaeat search' to search with a keystroke without pressing
the toolbar button
4) some define in the menus to better handle menu item update

bye
? anjuta/save
? anjuta/anjutagnome.tar.gz
Index: anjuta/src/anjuta.c
===================================================================
RCS file: /cvs/gnome/anjuta/src/anjuta.c,v
retrieving revision 1.15
diff -u -r1.15 anjuta.c
--- anjuta/src/anjuta.c	2001/09/12 17:06:45	1.15
+++ anjuta/src/anjuta.c	2001/09/13 21:01:22
@@ -901,6 +901,17 @@
 }
 
 void
+anjuta_application_exit(void)
+{
+	g_return_if_fail(app != NULL );
+	if(		( NULL != app->project_dbase )
+		&&	(app->project_dbase->project_is_open ) )
+	{
+		project_dbase_close_project(app->project_dbase) ;
+	}
+}
+
+void
 anjuta_clean_exit ()
 {
 	gchar *tmp;
@@ -917,7 +928,7 @@
 
 /* Is it necessary to free up all the memos on exit? */
 /* Assuming that it is not, I am disabling the following */
-/* Basicaly, because it is faster */
+/* Basically, because it is faster */
 
 #if 0				/* From here */
 	if (app->project_dbase->project_is_open)
Index: anjuta/src/anjuta.h
===================================================================
RCS file: /cvs/gnome/anjuta/src/anjuta.h,v
retrieving revision 1.9
diff -u -r1.9 anjuta.h
--- anjuta/src/anjuta.h	2001/09/12 17:06:45	1.9
+++ anjuta/src/anjuta.h	2001/09/13 21:01:22
@@ -167,6 +167,8 @@
 
 gboolean anjuta_load_yourself (PropsID pr);
 
+void anjuta_application_exit(void);
+
 void anjuta_clean_exit (void);
 
 void anjuta_update_title (void);
Index: anjuta/src/main.c
===================================================================
RCS file: /cvs/gnome/anjuta/src/main.c,v
retrieving revision 1.5
diff -u -r1.5 main.c
--- anjuta/src/main.c	2001/09/12 10:00:49	1.5
+++ anjuta/src/main.c	2001/09/13 21:01:23
@@ -115,6 +115,7 @@
 		anjuta_load_cmdline_files();
 	//gtk_main ();
 	retCode = MainLoop( &argc, argv, corb );
+	anjuta_application_exit();
 	write_config();
 	return retCode ;
 //	return 0;
Index: anjuta/src/main_menubar.c
===================================================================
RCS file: /cvs/gnome/anjuta/src/main_menubar.c,v
retrieving revision 1.7
diff -u -r1.7 main_menubar.c
--- anjuta/src/main_menubar.c	2001/08/30 15:48:36	1.7
+++ anjuta/src/main_menubar.c	2001/09/13 21:01:24
@@ -60,7 +60,7 @@
 	mb->file.recent_files = file1_menu_uiinfo[19].widget;
 	mb->file.recent_projects = file1_menu_uiinfo[20].widget;
 	mb->file.exit = file1_menu_uiinfo[22].widget;
-	for (i = 0; i < 23; i++)
+	for (i = 0; i < 23 ; i++)
 		gtk_widget_ref (file1_menu_uiinfo[i].widget);
 
 	mb->edit.uppercase = transform1_submenu_uiinfo[0].widget;
@@ -97,7 +97,9 @@
 	mb->edit.goto_prev_mesg = goto1_submenu_uiinfo[4].widget;
 	mb->edit.goto_next_mesg = goto1_submenu_uiinfo[5].widget;
 	mb->edit.edit_app_gui = edit1_menu_uiinfo[21].widget;
-	for (i = 0; i < 22; i++)
+	mb->edit.repeat_find = edit1_menu_uiinfo[24].widget;
+
+	for (i = 0; i < NUM_EDIT_MENUES ; i++)
 		gtk_widget_ref (edit1_menu_uiinfo[i].widget);
 
 	mb->view.main_toolbar = toolbar1_submenu_uiinfo[0].widget;
@@ -309,7 +311,7 @@
 		gtk_widget_unref (goto1_submenu_uiinfo[i].widget);
 	for (i = 0; i < 3; i++)
 		gtk_widget_unref (inserttext1_submenu_uiinfo[i].widget);
-	for (i = 0; i < 22; i++)
+	for (i = 0; i < NUM_EDIT_MENUES ; i++)
 		gtk_widget_unref (edit1_menu_uiinfo[i].widget);
 	for (i = 0; i < 11; i++)
 		gtk_widget_unref (toolbar1_submenu_uiinfo[i].widget);
Index: anjuta/src/main_menubar.h
===================================================================
RCS file: /cvs/gnome/anjuta/src/main_menubar.h,v
retrieving revision 1.4
diff -u -r1.4 main_menubar.h
--- anjuta/src/main_menubar.h	2001/08/30 15:40:51	1.4
+++ anjuta/src/main_menubar.h	2001/09/13 21:01:24
@@ -78,6 +78,7 @@
 	GtkWidget *calltip;
 
 	GtkWidget *find;
+	GtkWidget *repeat_find;	
 	GtkWidget *find_in_files;
 	GtkWidget *find_replace;
 
Index: anjuta/src/main_menubar_def.h
===================================================================
RCS file: /cvs/gnome/anjuta/src/main_menubar_def.h,v
retrieving revision 1.10
diff -u -r1.10 main_menubar_def.h
--- anjuta/src/main_menubar_def.h	2001/09/12 10:00:49	1.10
+++ anjuta/src/main_menubar_def.h	2001/09/13 21:01:26
@@ -251,140 +251,150 @@
 	GNOMEUIINFO_END
 };
 
-static GnomeUIInfo edit1_menu_uiinfo[] = {
-	{
+
+#define	NUM_EDIT_MENUES	(25)
+
+static GnomeUIInfo edit1_menu_uiinfo[NUM_EDIT_MENUES] = {
+	{/*0*/
 	 GNOME_APP_UI_ITEM, N_("U_ndo"),
 	 N_("Undo the last action"),
 	 on_undo1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_UNDO,
 	 GDK_Z, GDK_CONTROL_MASK, NULL},
 
-	{
+	{/*1*/
 	 GNOME_APP_UI_ITEM, N_("_Redo"),
 	 N_("Redo the last undone action"),
 	 on_redo1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REDO,
 	 GDK_R, GDK_CONTROL_MASK, NULL},
 
-	 GNOMEUIINFO_SEPARATOR,
+	 GNOMEUIINFO_SEPARATOR,/*2*/
 	
-	{
+	{/*3*/
 	 GNOME_APP_UI_ITEM, N_("C_ut"),
 	 N_("Cut the selected text from the editor to the clipboard"),
 	 on_cut1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CUT,
 	 GDK_X, GDK_CONTROL_MASK, NULL},
 	
-	{
+	{/*4*/
 	 GNOME_APP_UI_ITEM, N_("_Copy"),
 	 N_("Copy the selected text to the clipboard"),
 	 on_copy1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_COPY,
 	 GDK_C, GDK_CONTROL_MASK, NULL},
 	
-	{
+	{/*5*/
 	 GNOME_APP_UI_ITEM, N_("_Paste"),
 	 N_("Paste the content of clipboard at the current position"),
 	 on_paste1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PASTE,
 	 GDK_V, GDK_CONTROL_MASK, NULL},
 	
-	{
+	{/*6*/
 	 GNOME_APP_UI_ITEM, N_("C_lear"),
 	 N_("Delete the selected text from the editor"),
 	 on_clear1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 GDK_Delete, 0, NULL},
 	
-	GNOMEUIINFO_SEPARATOR,
+	GNOMEUIINFO_SEPARATOR,/*7*/
 	
-	{
+	{/*8*/
 	 GNOME_APP_UI_SUBTREE, N_("_Transform"),
 	 NULL,
 	 transform1_submenu_uiinfo, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 0, 0, NULL},
 	
-	{
+	{/*9*/
 	 GNOME_APP_UI_SUBTREE, N_("_Select"),
 	 NULL,
 	 select1_submenu_uiinfo, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 0, 0, NULL},
 	
-	{
+	{/*10*/
 	 GNOME_APP_UI_SUBTREE, N_("_Insert text"),
 	 NULL,
 	 inserttext1_submenu_uiinfo, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 0, 0, NULL},
 	
-	GNOMEUIINFO_SEPARATOR,
+	GNOMEUIINFO_SEPARATOR,/*11*/
 	
-	{
+	{/*12*/
 	 GNOME_APP_UI_ITEM, N_("_AutoComplete"),
 	 N_("AutoComplete the current word"),
 	 on_autocomplete1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 GDK_Return, GDK_CONTROL_MASK, NULL},
 	
-	{
+	{/*13*/
 	 GNOME_APP_UI_ITEM, N_("S_how calltip"),
 	 N_("Show calltip for the function"),
 	 on_calltip1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 0, 0, NULL},
 
-	 GNOMEUIINFO_SEPARATOR,
+	 GNOMEUIINFO_SEPARATOR,/*14*/
 	
-	{
+	{/*15*/
 	 GNOME_APP_UI_ITEM, N_("_Find ..."),
 	 N_("Search for a string or regexp in the editor"),
 	 on_find1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SEARCH,
 	 GDK_F, GDK_CONTROL_MASK, NULL},
 	
-	{
+	{/*16*/
 	 GNOME_APP_UI_ITEM, N_("Fin_d in files ..."),
 	 N_("Search for a string in multiple files or directories"),
 	 on_find_in_files1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 0, 0, NULL},
 	
-	{
+	{/*17*/
 	GNOME_APP_UI_ITEM, N_("Find and R_eplace ..."),
 	N_("Search for and replace a string or regexp with another string"),
 	on_find_and_replace1_activate, NULL, NULL,
 	GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SRCHRPL,
 	GDK_R, GDK_CONTROL_MASK, NULL},
 	
-	GNOMEUIINFO_SEPARATOR,
+	GNOMEUIINFO_SEPARATOR,/*18*/
 	
-	{
+	{/*19*/
 	 GNOME_APP_UI_SUBTREE, N_("G_o to"),
 	 NULL,
 	 goto1_submenu_uiinfo, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 0, 0, NULL},
 	
-	GNOMEUIINFO_SEPARATOR,
+	GNOMEUIINFO_SEPARATOR,/*20*/
 	
-	{
+	{/*21*/
 	 GNOME_APP_UI_ITEM, N_("Ed_it Application GUI ..."),
 	 N_("Edit application GUI with the Glade GUI editor"),
 	 on_edit_app_gui1_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 GDK_E, GDK_MOD1_MASK, NULL},
 	
-	GNOMEUIINFO_SEPARATOR,
+	GNOMEUIINFO_SEPARATOR,/*22*/
 	
-	{
+	{/*23*/
 	 GNOME_APP_UI_ITEM, N_("Save Build Messages"),
 	 N_("Save build messages to file"),
 	 on_save_build_messages_activate, NULL, NULL,
 	 GNOME_APP_PIXMAP_NONE, NULL,
 	 0, 0, NULL},
 
+	{/*24*/
+	 GNOME_APP_UI_ITEM, N_("_Repeat Find"),
+	 N_("Repeat the Last Find command"),
+	 on_findnext1_activate, NULL, NULL,
+	 GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SEARCH,
+	 GDK_F3, 0, NULL},
+	 
 	GNOMEUIINFO_END
 };
 
Index: anjuta/src/mainmenu_callbacks.c
===================================================================
RCS file: /cvs/gnome/anjuta/src/mainmenu_callbacks.c,v
retrieving revision 1.12
diff -u -r1.12 mainmenu_callbacks.c
--- anjuta/src/mainmenu_callbacks.c	2001/09/12 14:03:21	1.12
+++ anjuta/src/mainmenu_callbacks.c	2001/09/13 21:01:28
@@ -55,6 +55,8 @@
 #include "Scintilla.h"
 #include "ScintillaWidget.h"
 
+void on_toolbar_find_clicked (GtkButton * button, gpointer user_data);
+
 gboolean closing_state;		/* Do not temper with this variable  */
 
 void
@@ -1935,4 +1937,9 @@
 {
 	text_editor_load_file ((TextEditor *) te_data);
 	anjuta_update_title ();
+}
+void
+on_findnext1_activate (GtkMenuItem * menuitem, gpointer user_data)
+{
+	on_toolbar_find_clicked ( NULL, NULL );
 }
Index: anjuta/src/mainmenu_callbacks.h
===================================================================
RCS file: /cvs/gnome/anjuta/src/mainmenu_callbacks.h,v
retrieving revision 1.5
diff -u -r1.5 mainmenu_callbacks.h
--- anjuta/src/mainmenu_callbacks.h	2001/09/12 10:00:49	1.5
+++ anjuta/src/mainmenu_callbacks.h	2001/09/13 21:01:29
@@ -659,4 +659,8 @@
 void
 on_save_build_messages_activate (GtkMenuItem * menuitem, gpointer user_data);
 
+void
+on_findnext1_activate                   (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
 #endif
Index: anjuta/src/messages.c
===================================================================
RCS file: /cvs/gnome/anjuta/src/messages.c,v
retrieving revision 1.4
diff -u -r1.4 messages.c
--- anjuta/src/messages.c	2001/09/12 10:00:49	1.4
+++ anjuta/src/messages.c	2001/09/13 21:01:30
@@ -50,7 +50,7 @@
 		       GdkEvent * event, gpointer user_data);
 
 static GdkColor *GetColorError(Messages * m)
-{
	return & m->color_white ;
+{
	return & m->color_red ;
 }
 
 Messages *
Index: anjuta/src/project_dbase.c
===================================================================
RCS file: /cvs/gnome/anjuta/src/project_dbase.c,v
retrieving revision 1.10
diff -u -r1.10 project_dbase.c
--- anjuta/src/project_dbase.c	2001/09/12 17:06:45	1.10
+++ anjuta/src/project_dbase.c	2001/09/13 21:01:33
@@ -1277,6 +1277,7 @@
 	project_dbase_update_menu (p);	
 	project_dbase_clean_left (p);
 	ccview_project_clear(CCVIEW_PROJECT(p->widgets.ccview));
+	p->project_is_open = FALSE;
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]