SF.net SVN: geany:[5142] branches/Geany-0_19_1

ntrel at users.sourceforge.net ntrel at xxxxx
Wed Aug 11 14:41:15 UTC 2010


Revision: 5142
          http://geany.svn.sourceforge.net/geany/?rev=5142&view=rev
Author:   ntrel
Date:     2010-08-11 14:41:15 +0000 (Wed, 11 Aug 2010)

Log Message:
-----------
r5094

Modified Paths:
--------------
    branches/Geany-0_19_1/ChangeLog
    branches/Geany-0_19_1/src/build.c
    branches/Geany-0_19_1/src/project.c
    branches/Geany-0_19_1/src/project.h

Modified: branches/Geany-0_19_1/ChangeLog
===================================================================
--- branches/Geany-0_19_1/ChangeLog	2010-08-11 14:39:15 UTC (rev 5141)
+++ branches/Geany-0_19_1/ChangeLog	2010-08-11 14:41:15 UTC (rev 5142)
@@ -1,3 +1,10 @@
+2010-07-07  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/build.c, src/project.c, src/project.h:
+   Show the Project Properties build tab when choosing 'Set Build
+   Commands' for now to prevent confusion with non-project commands.
+
+
 2010-07-06  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/search.c, doc/geany.txt, doc/geany.html:

Modified: branches/Geany-0_19_1/src/build.c
===================================================================
--- branches/Geany-0_19_1/src/build.c	2010-08-11 14:39:15 UTC (rev 5141)
+++ branches/Geany-0_19_1/src/build.c	2010-08-11 14:41:15 UTC (rev 5142)
@@ -1616,7 +1616,11 @@
 
 static void on_set_build_commands_activate(GtkWidget *w, gpointer u)
 {
-	show_build_commands_dialog();
+	/* For now, just show the project dialog */
+	if (app->project)
+		project_build_properties();
+	else
+		show_build_commands_dialog();
 }
 
 

Modified: branches/Geany-0_19_1/src/project.c
===================================================================
--- branches/Geany-0_19_1/src/project.c	2010-08-11 14:39:15 UTC (rev 5141)
+++ branches/Geany-0_19_1/src/project.c	2010-08-11 14:41:15 UTC (rev 5142)
@@ -70,16 +70,16 @@
 typedef struct _PropertyDialogElements
 {
 	GtkWidget *dialog;
+	GtkWidget *notebook;
 	GtkWidget *name;
 	GtkWidget *description;
 	GtkWidget *file_name;
 	GtkWidget *base_path;
 	GtkWidget *patterns;
-	BuildTableData  build_properties;
+	BuildTableData build_properties;
 } PropertyDialogElements;
 
 
-
 static gboolean update_config(const PropertyDialogElements *e);
 static void on_file_save_button_clicked(GtkButton *button, PropertyDialogElements *e);
 static gboolean load_config(const gchar *filename);
@@ -388,6 +388,8 @@
 }
 
 
+static gint build_page_num = 0;
+
 static void create_properties_dialog(PropertyDialogElements *e)
 {
 	GtkWidget *table, *notebook, *build_table;
@@ -476,7 +478,8 @@
 	gtk_container_set_border_width(GTK_CONTAINER(build_table), 6);
 	label = gtk_label_new(_("Build"));
 	notebook = ui_lookup_widget(e->dialog, "project_notebook");
-	gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), build_table, label, 2);
+	build_page_num = gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), build_table, label, 2);
+	e->notebook = notebook;
 
 	label = gtk_label_new(_("Set the Build non-filetype working directories to use base path:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
@@ -517,13 +520,12 @@
 #endif
 
 	label = gtk_label_new(_("Project"));
-	gtk_widget_show(table);	/* needed to switch current page */
 	gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), table, label, 0);
-	gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
+	build_page_num++;
 }
 
 
-void project_properties(void)
+static void show_project_properties(gboolean show_build)
 {
 	PropertyDialogElements *e = g_new(PropertyDialogElements, 1);
 	GeanyProject *p = app->project;
@@ -585,6 +587,12 @@
 
 	gtk_widget_show_all(e->dialog);
 
+	/* note: notebook page must be shown before setting current page */
+	if (show_build)
+		gtk_notebook_set_current_page(GTK_NOTEBOOK(e->notebook), build_page_num);
+	else
+		gtk_notebook_set_current_page(GTK_NOTEBOOK(e->notebook), 0);
+
 	while (gtk_dialog_run(GTK_DIALOG(e->dialog)) == GTK_RESPONSE_OK)
 	{
 		if (update_config(e))
@@ -599,6 +607,18 @@
 }
 
 
+void project_properties(void)
+{
+	show_project_properties(FALSE);
+}
+
+
+void project_build_properties(void)
+{
+	show_project_properties(TRUE);
+}
+
+
 /* checks whether there is an already open project and asks the user if he wants to close it or
  * abort the current action. Returns FALSE when the current action(the caller) should be cancelled
  * and TRUE if we can go ahead */

Modified: branches/Geany-0_19_1/src/project.h
===================================================================
--- branches/Geany-0_19_1/src/project.h	2010-08-11 14:39:15 UTC (rev 5141)
+++ branches/Geany-0_19_1/src/project.h	2010-08-11 14:41:15 UTC (rev 5142)
@@ -74,6 +74,8 @@
 
 void project_properties(void);
 
+void project_build_properties(void);
+
 gboolean project_ask_close(void);
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list