SF.net SVN: geany:[3992] branches/build-system

elextr at users.sourceforge.net elextr at xxxxx
Sun Jul 19 09:20:37 UTC 2009


Revision: 3992
          http://geany.svn.sourceforge.net/geany/?rev=3992&view=rev
Author:   elextr
Date:     2009-07-19 09:20:37 +0000 (Sun, 19 Jul 2009)

Log Message:
-----------
Build commands & project dialog improvements

Modified Paths:
--------------
    branches/build-system/ChangeLog
    branches/build-system/src/build.c
    branches/build-system/src/build.h
    branches/build-system/src/project.c

Modified: branches/build-system/ChangeLog
===================================================================
--- branches/build-system/ChangeLog	2009-07-18 14:45:43 UTC (rev 3991)
+++ branches/build-system/ChangeLog	2009-07-19 09:20:37 UTC (rev 3992)
@@ -1,3 +1,14 @@
+2009-07-19  Lex Trotman  <elextr(at)gmail(dot)com>
+
+ * src/build.c, src/build.h
+   Added set_build_non_ft_wd_to_proj() for use by project dialog.
+   Improved interpretation of run_in_base_dir from old [build-settings]
+   Added spacing to build commands dialog
+ * src/project.c
+   Removed run in base path option from project dialog and added button to
+   set working directories to d the same.
+
+
 2009-07-18  Lex Trotman  <elextr(at)gmail(dot)com>
 
  * src/build.c

Modified: branches/build-system/src/build.c
===================================================================
--- branches/build-system/src/build.c	2009-07-18 14:45:43 UTC (rev 3991)
+++ branches/build-system/src/build.c	2009-07-19 09:20:37 UTC (rev 3992)
@@ -1629,6 +1629,9 @@
 #define DC_CLEAR 4
 #define DC_N_COL 5
 
+static const int entry_x_padding = 3;
+static const int entry_y_padding = 0;
+
 static RowWidgets *build_add_dialog_row(GeanyDocument *doc, GtkTable *table, gint row,
 				GeanyBuildSource dst, gint grp, gint cmd, gboolean dir)
 {
@@ -1641,7 +1644,8 @@
     gint column = 0;
 	
 	label = gtk_label_new(g_strdup_printf("%d:", cmd+1));
-	gtk_table_attach(table, label, column, column+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, label, column, column+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	roww = g_new0(RowWidgets, 1);
 	roww->src = BCS_COUNT;
 	roww->grp = grp;
@@ -1652,14 +1656,15 @@
         column+=1;
         roww->entries[i] = gtk_entry_new();
         gtk_table_attach(table, roww->entries[i], column, column+1, row, row+1, GTK_FILL,
-							GTK_FILL | GTK_EXPAND, 0, 0);
+							GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding);
     }
     column++;
-	clearicon = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_SMALL_TOOLBAR);
+	clearicon = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU);
 	clear = gtk_button_new();
 	gtk_button_set_image(GTK_BUTTON(clear), clearicon);
 	g_signal_connect((gpointer)clear, "clicked", G_CALLBACK(on_clear_dialog_row), (gpointer)roww);
-	gtk_table_attach(table, clear, column, column+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, clear, column, column+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	roww->cmdsrc = bc = get_build_cmd(doc, grp, cmd, &src);
 	if (bc!=NULL)roww->src = src;
 
@@ -1678,7 +1683,6 @@
 	return roww;
 }
 
-
 typedef struct TableFields {
 	RowWidgets 	**rows;
 	GtkWidget	 *fileregex, *nonfileregex;
@@ -1703,10 +1707,11 @@
 	{
 		label = gtk_label_new(gettext(*ch));
 		gtk_table_attach(table, label, col, col+1, 0, 1,
-							GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+							GTK_FILL, GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding);
 	}
 	sep = gtk_hseparator_new();
-	gtk_table_attach(table, sep, 0, DC_N_COL, 1, 2, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, sep, 0, DC_N_COL, 1, 2, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	if (ft!=NULL){
 		txt = g_strdup_printf(_("%s commands"), ft->title);
 	} else
@@ -1714,11 +1719,13 @@
 	label = gtk_label_new(txt);
 	g_free(txt);
 	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-	gtk_table_attach(table, label, 0, DC_N_COL, 2, 3, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, label, 0, DC_N_COL, 2, 3, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	for (row=3, cmdindex=0, cmd=0; cmd<build_groups_count[GBG_FT]; ++row, ++cmdindex, ++cmd)
 		fields->rows[cmdindex] = build_add_dialog_row(doc, table, row, dst, GBG_FT, cmd, FALSE);
 	label = gtk_label_new(_("Error Regular Expression"));
-	gtk_table_attach(table, label, 0, DC_ENTRIES+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, label, 0, DC_ENTRIES+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	fields->fileregex = gtk_entry_new();
 	fields->fileregexstring = get_build_regex(GBG_FT, NULL, &src);
 	sensitivity = ft==NULL?FALSE:TRUE;
@@ -1728,26 +1735,30 @@
 		if (src>dst) sensitivity = FALSE;
 	}
 	gtk_table_attach(table, fields->fileregex, DC_ENTRIES+1, DC_CLEAR, row, row+1, GTK_FILL,
-						GTK_FILL | GTK_EXPAND, 0, 0);
-	clearicon = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_SMALL_TOOLBAR);
+						GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding);
+	clearicon = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU);
 	clear = gtk_button_new();
 	gtk_button_set_image(GTK_BUTTON(clear), clearicon);
 	g_signal_connect_swapped((gpointer)clear, "clicked", G_CALLBACK(on_clear_dialog_regex_row),
 							(gpointer)(fields->fileregex));
-	gtk_table_attach(table, clear, DC_CLEAR, DC_CLEAR+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, clear, DC_CLEAR, DC_CLEAR+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	gtk_widget_set_sensitive(fields->fileregex, sensitivity);
 	gtk_widget_set_sensitive(clear, sensitivity);
 	++row;
 	sep = gtk_hseparator_new();
-	gtk_table_attach(table, sep, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, sep, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	++row;
 	label = gtk_label_new(_("Non Filetype Commands"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-	gtk_table_attach(table, label, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, label, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	for (++row, cmd=0; cmd<build_groups_count[GBG_NON_FT]; ++row,++cmdindex, ++cmd)
 		fields->rows[cmdindex] = build_add_dialog_row(doc, table, row, dst, GBG_NON_FT, cmd, TRUE);
 	label = gtk_label_new(_("Error Regular Expression"));
-	gtk_table_attach(table, label, 0, DC_ENTRIES+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, label, 0, DC_ENTRIES+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	fields->nonfileregex = gtk_entry_new();
 	fields->nonfileregexstring = get_build_regex(GBG_NON_FT, NULL, &src);
 	sensitivity = TRUE;
@@ -1757,42 +1768,57 @@
 		sensitivity = src>dst?FALSE:TRUE;
 	}
 	gtk_table_attach(table, fields->nonfileregex, DC_ENTRIES+1, DC_CLEAR, row, row+1, GTK_FILL,
-						GTK_FILL | GTK_EXPAND, 0, 0);
-	clearicon = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_SMALL_TOOLBAR);
+						GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding);
+	clearicon = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU);
 	clear = gtk_button_new();
 	gtk_button_set_image(GTK_BUTTON(clear), clearicon);
 	g_signal_connect_swapped((gpointer)clear, "clicked", G_CALLBACK(on_clear_dialog_regex_row),
 								(gpointer)(fields->nonfileregex));
-	gtk_table_attach(table, clear, DC_CLEAR, DC_CLEAR+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, clear, DC_CLEAR, DC_CLEAR+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	gtk_widget_set_sensitive(fields->nonfileregex, sensitivity);
 	gtk_widget_set_sensitive(clear, sensitivity);
 	++row;
 	sep = gtk_hseparator_new();
-	gtk_table_attach(table, sep, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, sep, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	++row;
 	label = gtk_label_new(_("Execute Commands"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-	gtk_table_attach(table, label, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, label, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	for (++row, cmd=0; cmd<build_groups_count[GBG_EXEC]; ++row,++cmdindex, ++cmd)
 		fields->rows[cmdindex] = build_add_dialog_row(doc, table, row, dst, GBG_EXEC, cmd, TRUE);
 	sep = gtk_hseparator_new();
-	gtk_table_attach(table, sep, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, sep, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	++row;
 	sep = gtk_hseparator_new();
-	gtk_table_attach(table, sep, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, sep, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 	++row;
 	label = gtk_label_new(_(
 				"Notes:\n"
 				"   %d, %e, %f, %p are substituted in Commands and Working dir, see manual for details\n"
 				"   Non-filetype menu Item 2 opens a dialog and appends the reponse to the command"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-	gtk_table_attach(table, label, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+	gtk_table_attach(table, label, 0, DC_N_COL, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
+					entry_x_padding, entry_y_padding);
 /*	printf("%d extra rows in dialog\n", row-build_items_count); */
 	++row;
 	*table_data = fields;
 	return GTK_WIDGET(table);
 }
 
+void free_build_fields(TableData table_data)
+{
+	gint cmdindex;
+	for (cmdindex=0; cmdindex<build_items_count; ++cmdindex)
+		g_free(table_data->rows[cmdindex]);
+	g_free(table_data->rows);
+	g_free(table_data);
+}
+
 /* string compare where null pointers match null or 0 length strings */
 static int stcmp(const gchar *a, const gchar *b)
 {
@@ -1802,15 +1828,6 @@
 	return strcmp(a, b);
 }
 
-void free_build_fields(TableData table_data)
-{
-	gint cmdindex;
-	for (cmdindex=0; cmdindex<build_items_count; ++cmdindex)
-		g_free(table_data->rows[cmdindex]);
-	g_free(table_data->rows);
-	g_free(table_data);
-}
-
 static gboolean read_row(BuildDestination *dst, TableData table_data, gint drow, gint grp, gint cmd)
 {
 	gchar			*entries[BC_CMDENTRIES_COUNT];
@@ -1923,7 +1940,7 @@
 
 static void show_build_commands_dialog()
 {
-	GtkWidget		*dialog, *table;
+	GtkWidget		*dialog, *table, *vbox;
 	GeanyDocument	*doc = document_get_current();
 	GeanyFiletype	*ft = NULL;
 	gchar			*title = _("Set Build Commands");
@@ -1938,7 +1955,8 @@
 										GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 										GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
 	table = build_commands_table(doc, BCS_PREF, &table_data, ft);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), table, TRUE, TRUE, 0); 
+	vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog));
+	gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0); 
 	gtk_widget_show_all(dialog);
 	/* run modally to prevent user changing idx filetype */
 	response = gtk_dialog_run(GTK_DIALOG(dialog));
@@ -1973,6 +1991,16 @@
 	return items;
 }
 
+/* set non_ft working directory entries to %p for project */
+void set_build_non_ft_wd_to_proj(TableData table_data)
+{
+	gint i, start, end;
+	start = build_groups_count[GBG_FT];
+	end = start + build_groups_count[GBG_NON_FT];
+	for (i = start; i<end; ++i)
+		gtk_entry_set_text(GTK_ENTRY(table_data->rows[i]->entries[BC_WORKING_DIR]), "%p");
+}
+
 /*----------------------------------------------------------
  * 
  * Load and store configuration
@@ -2107,11 +2135,12 @@
 	
 	/* set GeanyBuildCommand if it doesn't already exist and there is a command */
 #define ASSIGNIF(type, id, string, value) \
-	if (value!=NULL && !type[GBO_TO_CMD(id)].exists && (value)!=NULL && strlen(value)>0) { \
+	if (value!=NULL && !type[GBO_TO_CMD(id)].exists && strlen(value)>0) { \
 		type[GBO_TO_CMD(id)].exists = TRUE; \
 		type[GBO_TO_CMD(id)].entries[BC_LABEL] = g_strdup(_(string)); \
 		type[GBO_TO_CMD(id)].entries[BC_COMMAND] = (value); \
 		type[GBO_TO_CMD(id)].entries[BC_WORKING_DIR] = NULL; \
+		type[GBO_TO_CMD(id)].old = TRUE; \
 	}
 		
 	switch(src)
@@ -2133,8 +2162,12 @@
 			if (non_ft_proj==NULL)non_ft_proj = g_new0(GeanyBuildCommand, build_groups_count[GBG_NON_FT]);
 			bvalue = g_key_file_get_boolean(config, "project", "make_in_base_path", NULL);
 			value = bvalue?"%p":"%d";
-			for (cmd=0; cmd<build_groups_count[GBG_NON_FT]; ++cmd)
-				non_ft_proj[cmd].entries[BC_WORKING_DIR] = g_strdup(value);
+			if (non_ft_pref[GBO_TO_CMD(GBO_MAKE_ALL)].old)
+				setptr(non_ft_pref[GBO_TO_CMD(GBO_MAKE_ALL)].entries[BC_WORKING_DIR], value );
+			if (non_ft_pref[GBO_TO_CMD(GBO_MAKE_CUSTOM)].old)
+				setptr(non_ft_pref[GBO_TO_CMD(GBO_MAKE_CUSTOM)].entries[BC_WORKING_DIR], value );
+			if (non_ft_pref[GBO_TO_CMD(GBO_MAKE_OBJECT)].old)
+				setptr(non_ft_pref[GBO_TO_CMD(GBO_MAKE_OBJECT)].entries[BC_WORKING_DIR], value );
 			value = g_key_file_get_string(config, "project", "run_cmd", NULL);
 			if (value !=NULL)
 			{
@@ -2284,6 +2317,11 @@
 	build_items_count = sum;
 }
 
+gint get_build_group_count(GeanyBuildGroup grp)
+{
+	return build_groups_count[grp];
+}
+
 static struct {
 	gchar *entries[BC_CMDENTRIES_COUNT];
 	GeanyBuildCommand **ptr;

Modified: branches/build-system/src/build.h
===================================================================
--- branches/build-system/src/build.h	2009-07-18 14:45:43 UTC (rev 3991)
+++ branches/build-system/src/build.h	2009-07-19 09:20:37 UTC (rev 3992)
@@ -104,6 +104,7 @@
 	gchar *entries[BC_CMDENTRIES_COUNT];
 	gboolean	 exists;
 	gboolean	 changed;
+	gboolean	 old;
 } GeanyBuildCommand;
 
 extern GeanyBuildCommand *non_ft_proj, *exec_proj; /* project command array pointers */
@@ -137,6 +138,8 @@
 
 void free_build_data( TableData data );
 
+void set_build_non_ft_wd_to_proj(TableData table_data);
+
 /* build response decode assistance function */
 gboolean build_parse_make_dir(const gchar *string, gchar **prefix);
 
@@ -147,15 +150,17 @@
 
 void build_toolbutton_build_clicked(GtkAction *action, gpointer user_data);
 
-void remove_command( GeanyBuildSource src, GeanyBuildGroup grp, gint cmd );
+void remove_command(GeanyBuildSource src, GeanyBuildGroup grp, gint cmd);
 
 /* load and store menu configuration */
-void load_build_menu( GKeyFile *config, GeanyBuildSource dst, gpointer ptr );
+void load_build_menu( GKeyFile *config, GeanyBuildSource dst, gpointer ptr);
 
-void save_build_menu( GKeyFile *config, gpointer ptr, GeanyBuildSource src );
+void save_build_menu( GKeyFile *config, gpointer ptr, GeanyBuildSource src);
 
-void set_build_grp_count( GeanyBuildGroup grp, gint count );
+void set_build_grp_count(GeanyBuildGroup grp, gint count);
 
+gint get_build_group_count(GeanyBuildGroup grp);
+
 gchar **get_build_regex(GeanyBuildGroup grp, GeanyFiletype *ft, gint *from);
 
 #endif

Modified: branches/build-system/src/project.c
===================================================================
--- branches/build-system/src/project.c	2009-07-18 14:45:43 UTC (rev 3991)
+++ branches/build-system/src/project.c	2009-07-19 09:20:37 UTC (rev 3992)
@@ -386,10 +386,15 @@
 	update_ui();
 }
 
+static void on_set_use_base_path_clicked( GtkWidget *unused1, gpointer user_data )
+{
+	TableData td = (TableData)user_data;
+	set_build_non_ft_wd_to_proj(td);
+}
 
 static void create_properties_dialog(PropertyDialogElements *e)
 {
-	GtkWidget *table, *notebook;
+	GtkWidget *table, *notebook, *build_table;
 	GtkWidget *image;
 	GtkWidget *button;
 	GtkWidget *bbox;
@@ -416,7 +421,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
 
 	e->name = gtk_entry_new();
 	ui_entry_add_clear_icon(e->name);
@@ -429,7 +434,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
 
 	e->file_name = gtk_entry_new();
 	ui_entry_add_clear_icon(e->file_name);
@@ -442,7 +447,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (GTK_FILL), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
 
 	e->description = gtk_text_view_new();
 	gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(e->description), GTK_WRAP_WORD);
@@ -459,7 +464,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
 
 	e->base_path = gtk_entry_new();
 	ui_entry_add_clear_icon(e->base_path);
@@ -472,34 +477,28 @@
 	gtk_table_attach(GTK_TABLE(table), bbox, 1, 2, 3, 4,
 					(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
 					(GtkAttachOptions) (0), 0, 0);
+	
+	if (doc!=NULL) ft=doc->file_type;
+	build_table = build_commands_table( doc, BCS_PROJ, &(e->build_properties), ft );
+	label = gtk_label_new(_("Build"));
+	notebook = ui_lookup_widget(e->dialog, "project_notebook");
+	gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), build_table, label, 2);
 
-	e->make_in_base_path = gtk_check_button_new_with_label(_("Make in base path"));
-	gtk_table_attach(GTK_TABLE(table), e->make_in_base_path, 0, 3, 4, 5,
-					(GtkAttachOptions) (GTK_FILL),
-					(GtkAttachOptions) (0), 0, 0);
-
-	label = gtk_label_new(_("Run command:"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6,
-					(GtkAttachOptions) (GTK_FILL),
-					(GtkAttachOptions) (0), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
-
-	e->run_cmd = gtk_entry_new();
-	ui_entry_add_clear_icon(e->run_cmd);
-	ui_widget_set_tooltip_text(e->run_cmd,
-		_("Command-line to run in the project base directory. "
-		"Options can be appended to the command. "
-		"Leave blank to use the default run command."));
-	button = gtk_button_new();
-	g_signal_connect(button, "clicked", G_CALLBACK(on_file_open_button_clicked), e);
-	image = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
-	gtk_container_add(GTK_CONTAINER(button), image);
+	label = gtk_label_new(_("Set the non-filetype working directories on build tab to use base path:"));
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+	
+	button = gtk_button_new_with_label(_("Set"));
+	ui_widget_set_tooltip_text(button,
+		_("Set the working directories (on the Build tab) "
+		"for the non-filetype build commands to use the base path"));
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+	g_signal_connect(button, "clicked", G_CALLBACK(on_set_use_base_path_clicked), e->build_properties);
 	bbox = gtk_hbox_new(FALSE, 6);
-	gtk_box_pack_start_defaults(GTK_BOX(bbox), e->run_cmd);
+	gtk_box_pack_start(GTK_BOX(bbox), label, TRUE, TRUE, 0);
 	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
-	gtk_table_attach(GTK_TABLE(table), bbox, 1, 2, 5, 6,
+	gtk_table_attach(GTK_TABLE(table), bbox, 0, 2, 4, 5,
 					(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-					(GtkAttachOptions) (0), 0, 0);
+					(GtkAttachOptions) (GTK_FILL), 0, 0);
 
 #if 0
 	label = gtk_label_new(_("File patterns:"));
@@ -507,7 +506,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 6, 7,
 					(GtkAttachOptions) (GTK_FILL),
 					(GtkAttachOptions) (GTK_FILL), 0, 0);
-	gtk_misc_set_alignment(GTK_MISC(label), -1, 0);
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
 
 	e->patterns = gtk_text_view_new();
 	swin = gtk_scrolled_window_new(NULL, NULL);
@@ -520,14 +519,9 @@
 					(GtkAttachOptions) (0), 0, 0);
 #endif
 
-	notebook = ui_lookup_widget(e->dialog, "project_notebook");
 	label = gtk_label_new(_("Project"));
 	gtk_widget_show(table);	/* needed to switch current page */
 	gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), table, label, 0);
-	if (doc!=NULL) ft=doc->file_type;
-	table = build_commands_table( doc, BCS_PROJ, &(e->build_properties), ft );
-	label = gtk_label_new(_("Build"));
-	gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), table, label, 2);
 	gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
 }
 
@@ -578,11 +572,6 @@
 
 	gtk_entry_set_text(GTK_ENTRY(e->file_name), p->file_name);
 	gtk_entry_set_text(GTK_ENTRY(e->base_path), p->base_path);
-	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e->make_in_base_path),
-		p->make_in_base_path);
-	if (p->run_cmd != NULL)
-		gtk_entry_set_text(GTK_ENTRY(e->run_cmd), p->run_cmd);
-
 	gtk_widget_show_all(e->dialog);
 
 	retry:
@@ -741,10 +730,6 @@
 		GeanyBuildCommand 	*oldvalue;
 		GeanyFiletype 		*ft=NULL;
 
-		p->make_in_base_path = gtk_toggle_button_get_active(
-			GTK_TOGGLE_BUTTON(e->make_in_base_path));
-		setptr(p->run_cmd, g_strdup(gtk_entry_get_text(GTK_ENTRY(e->run_cmd))));
-
 		/* get and set the project description */
 		buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(e->description));
 		gtk_text_buffer_get_start_iter(buffer, &start);


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