Revision: 2003 http://geany.svn.sourceforge.net/geany/?rev=2003&view=rev Author: ntrel Date: 2007-11-01 05:54:38 -0700 (Thu, 01 Nov 2007)
Log Message: ----------- Enable build support on Windows.
Modified Paths: -------------- trunk/ChangeLog trunk/src/build.c trunk/src/prefs.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-01 12:53:00 UTC (rev 2002) +++ trunk/ChangeLog 2007-11-01 12:54:38 UTC (rev 2003) @@ -2,6 +2,8 @@
* src/win32.c: Prevent prefs dialog being hidden after using the prefs file dialog. + * src/build.c, src/prefs.c: + Enable build support on Windows.
2007-11-01 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2007-11-01 12:53:00 UTC (rev 2002) +++ trunk/src/build.c 2007-11-01 12:54:38 UTC (rev 2003) @@ -489,11 +489,15 @@ g_free(tmp); g_free(executable);
+#ifdef G_OS_WIN32 + argv = g_strsplit(cmd_string, " ", 0); +#else argv = g_new0(gchar *, 4); argv[0] = g_strdup("/bin/sh"); argv[1] = g_strdup("-c"); argv[2] = cmd_string; argv[3] = NULL; +#endif
utf8_cmd_string = utils_get_utf8_from_locale(cmd_string); utf8_working_dir = (dir != NULL) ? g_strdup(dir) : @@ -884,7 +888,6 @@ }
-#ifndef G_OS_WIN32 static void show_build_result_message(gboolean failure) { gchar *msg; @@ -905,14 +908,17 @@ } else { +#ifdef G_OS_UNIX msg = _("Compilation finished successfully."); +#else + msg = _("Compilation finished."); // we don't know what the result was on Windows +#endif msgwin_compiler_add(COLOR_BLUE, msg); if (! ui_prefs.msgwindow_visible || gtk_notebook_get_current_page(GTK_NOTEBOOK(msgwindow.notebook)) != MSG_COMPILER) ui_set_statusbar(FALSE, "%s", msg); } } -#endif
static void build_exit_cb(GPid child_pid, gint status, gpointer user_data) @@ -935,6 +941,8 @@ failure = TRUE; } show_build_result_message(failure); +#else + show_build_result_message(FALSE); #endif
utils_beep(); @@ -1008,7 +1016,6 @@
menu = gtk_menu_new();
-#ifndef G_OS_WIN32 // compile the code item = gtk_image_menu_item_new_with_mnemonic(_("_Compile")); gtk_widget_show(item); @@ -1083,7 +1090,6 @@ item = gtk_separator_menu_item_new(); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); -#endif
// execute the code item = gtk_image_menu_item_new_from_stock("gtk-execute", accel_group); @@ -1126,7 +1132,6 @@
menu = gtk_menu_new();
-#ifndef G_OS_WIN32 // DVI item = gtk_image_menu_item_new_with_mnemonic(_("LaTeX -> DVI")); gtk_widget_show(item); @@ -1194,7 +1199,6 @@ item = gtk_separator_menu_item_new(); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); -#endif
// DVI view #define LATEX_VIEW_DVI_LABEL _("View DVI File") // used later again @@ -1636,12 +1640,6 @@ ft = doc_list[idx].file_type; g_return_if_fail(ft != NULL);
-#ifdef G_OS_WIN32 - // disable compile and link under Windows until it is implemented - ft->actions->can_compile = FALSE; - ft->actions->can_link = FALSE; -#endif - menu_items = build_get_menu_items(ft->id); /* Note: don't remove the submenu first because it can now cause an X hang if * the menu is already open when called from build_exit_cb(). */ @@ -1994,15 +1992,4 @@ { widgets.compile_button = lookup_widget(app->window, "toolbutton13"); widgets.run_button = lookup_widget(app->window, "toolbutton26"); - -#ifdef G_OS_WIN32 - // hide build support items, at least until they are available for Windows - gtk_widget_hide(widgets.compile_button); - { - GtkWidget *compiler_tab; - compiler_tab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(msgwindow.notebook), - gtk_notebook_get_nth_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_COMPILER)); - gtk_widget_set_sensitive(compiler_tab, FALSE); - } -#endif }
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2007-11-01 12:53:00 UTC (rev 2002) +++ trunk/src/prefs.c 2007-11-01 12:54:38 UTC (rev 2003) @@ -336,15 +336,9 @@
// Tools Settings -#ifdef G_OS_WIN32 - // hide related Make path setting - gtk_widget_set_sensitive(lookup_widget(ui_widgets.prefs_dialog, "label11"), FALSE); - gtk_widget_set_sensitive(lookup_widget(ui_widgets.prefs_dialog, "entry_com_make"), FALSE); - gtk_widget_set_sensitive(lookup_widget(ui_widgets.prefs_dialog, "button_make"), FALSE); -#else - if (prefs.tools_make_cmd) - gtk_entry_set_text(GTK_ENTRY(lookup_widget(ui_widgets.prefs_dialog, "entry_com_make")), prefs.tools_make_cmd); -#endif + if (prefs.tools_make_cmd) + gtk_entry_set_text(GTK_ENTRY(lookup_widget(ui_widgets.prefs_dialog, "entry_com_make")), prefs.tools_make_cmd); + if (prefs.tools_term_cmd) gtk_entry_set_text(GTK_ENTRY(lookup_widget(ui_widgets.prefs_dialog, "entry_com_term")), prefs.tools_term_cmd);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.