--- src/print.c.org 2010-07-12 20:12:45.111950564 +1000 +++ src/print.c 2010-07-12 20:46:10.005825460 +1000 @@ -142,7 +142,8 @@ gchar * get_lily_version_string (void) { - GError *error = NULL; + GError *err = NULL; + gboolean ok; gchar *version_string; double d; int standard_output; @@ -155,7 +156,7 @@ NULL }; - g_spawn_async_with_pipes (NULL, /* dir */ + ok = g_spawn_async_with_pipes (NULL, /* dir */ arguments, NULL, /* env */ G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, /* child setup func */ NULL, /* user data */ @@ -163,7 +164,18 @@ NULL, /*standard_input*/ &standard_output, /*standard output*/ NULL, /*standard error*/ - &error); + &err); + + if (!ok) + { + if (err) + { + g_warning ("%s", err->message); + g_error_free (err); + err = NULL; + } + return NULL; + } read(standard_output, buf, sizeof(buf)); return regex_parse_version_number(buf); @@ -203,6 +215,7 @@ void convert_ly(gchar *lilyfile){ GError *err = NULL; + gboolean ok; #ifdef G_OS_WIN32 gchar *conv_argv[] = { "python" @@ -219,7 +232,7 @@ NULL }; #endif - g_spawn_sync (locatedotdenemo (), /* dir */ + ok = g_spawn_sync (locatedotdenemo (), /* dir */ conv_argv, NULL, /* env */ G_SPAWN_SEARCH_PATH, NULL, /* child setup func */ NULL, /* user data */ @@ -227,7 +240,7 @@ NULL, /* stderr */ NULL, &err); - if (err != NULL) + if (!ok && err != NULL) { g_warning ("%s", err->message); if(err) g_error_free (err); @@ -378,6 +391,7 @@ void run_lilypond(gchar *filename, DenemoGUI *gui){ + gboolean ok; gchar *lilyfile = g_strconcat (filename, ".ly", NULL); gchar *resolution = g_strdup_printf("-dresolution=%d",(int) Denemo.prefs.resolution); gchar *printfile = g_strconcat (filename, "_", NULL); @@ -438,7 +452,7 @@ if (!gui->lilycontrol.excerpt) arguments = pdf; - g_spawn_async_with_pipes (locatedotdenemo (), /* dir */ + ok = g_spawn_async_with_pipes (locatedotdenemo (), /* dir */ arguments, NULL, /* env */ G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, /* child setup func */ NULL, /* user data */ @@ -447,6 +461,16 @@ NULL, /* stdout */ &errors, /* stderr */ &lily_err); + if (!ok) + { + if (lily_err) + { + g_warning ("%s", lily_err->message); + g_error_free (lily_err); + lily_err = NULL; + } + return; + } if (gui->lilycontrol.excerpt == TRUE) g_child_watch_add (printpid, (GChildWatchFunc)open_pngviewer /* GChildWatchFunc function */, filename); else @@ -1011,6 +1035,7 @@ g_spawn_close_pid (printviewpid); printviewpid = GPID_NONE; GError *error = NULL; + gboolean ok; normal_cursor(); process_printpreview_errors(); gchar *filename = get_printfile_pathbasename(); @@ -1040,6 +1065,7 @@ void refresh_print_view (gboolean preview_only) { DenemoGUI *gui = Denemo.gui; GError *error = NULL; + gboolean ok; //g_print("preview only %d\n", preview_only); if((changecount == Denemo.gui->changecount) && ((gint)g_object_get_data(G_OBJECT(Denemo.gui->printarea), "printviewupdate")==Denemo.gui->changecount)) { if(confirm ("No changes since last update", "Cancel refresh of print view?")) @@ -1116,7 +1142,7 @@ busy_cursor(); changecount = Denemo.gui->changecount;// keep track so we know it update is needed - g_spawn_async_with_pipes (locatedotdenemo (), /* dir */ + ok = g_spawn_async_with_pipes (locatedotdenemo (), /* dir */ arguments, NULL, /* env */ G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, /* child setup func */ NULL, /* user data */ @@ -1126,6 +1152,16 @@ &printpreview_errors, /* stderr */ &error); g_free(lilyfile); + if (!ok) + { + if (error) + { + g_warning ("%s", error->message); + g_error_free (error); + error = NULL; + } + return; + } g_child_watch_add (printviewpid, (GChildWatchFunc)printview_finished /* GChildWatchFunc function */, (gpointer)preview_only); } --- src/view.c.orig 2010-07-07 15:12:28.000000000 +1000 +++ src/view.c 2010-07-14 07:01:19.920825277 +1000 @@ -2937,6 +2937,7 @@ //create window system create_window(); + Denemo.prefs.cursor_highlight = TRUE; @@ -4480,10 +4481,7 @@ button = (GtkToolButton *)gtk_tool_button_new(NULL, NULL); label = gtk_label_new(NULL); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - GtkWidget *ev = gtk_event_box_new(); - gtk_container_add (GTK_CONTAINER(ev), label); - gtk_tool_button_set_label_widget (button, ev); - //gtk_event_box_set_above_child (ev, TRUE); + gtk_tool_button_set_label_widget (button, label); r->button = button; } if(!singleton) { @@ -4639,7 +4637,7 @@ else return; //FIXME memory leak of r - well pattern is never NULL //g_print("rsteps is %p entry is %s, %s\n", r->rsteps, pattern, labelstr); - label = LABEL(r->button); + label = gtk_tool_button_get_label_widget(r->button); gtk_label_set_markup(GTK_LABEL(label), labelstr); g_free(labelstr); } @@ -6539,7 +6537,9 @@ /* set all labels in the hierarchy below widget to use markup */ static void use_markup(GtkWidget *widget) { - // show_type(widget, "Widget Type: "); + if (!widget) + return; + //show_type(widget, "Widget Type: "); //g_print("container type %x\n", GTK_IS_CONTAINER(widget)); @@ -6552,7 +6552,7 @@ // gtk_label_set_use_underline (GTK_LABEL (widget), FALSE); font_desc gets interpreted in GtkLabel but not GtkAccelLabel hmmm... //g_print("Before we have %d\n", gtk_label_get_use_markup (widget)); //gchar * label = gtk_label_get_label(widget); - //g_print("label before is %s\n", label); + //g_print("label before is \"%s\"\n", label); gtk_label_set_use_markup (GTK_LABEL (widget), TRUE); //g_print("after we have %d\n", gtk_label_get_use_markup (widget)); @@ -6874,6 +6874,13 @@ {"LilyDelete", NULL, N_("Delete Block"),NULL, N_("Delete this block"),G_CALLBACK (delete_lily_cb)} }; + { + GtkActionGroup *lilyaction_group = gtk_action_group_new ("LilyActions"); + gtk_action_group_set_translation_domain (lilyaction_group, NULL); + gtk_action_group_add_actions (lilyaction_group, lily_menus, + G_N_ELEMENTS (lily_menus), Denemo.gui); + gtk_ui_manager_insert_action_group (ui_manager, lilyaction_group, 1); + } data_file = g_build_filename ( #ifndef USE_LOCAL_DENEMOUI get_data_dir (), @@ -7084,13 +7091,6 @@ use_markup(Denemo.window);/* set all the labels to use markup so that we can use the music font. Be aware this means you cannot use labels involving "&" "<" and ">" and so on without escaping them FIXME labels in toolitems are not correct until you do NewWindow. Really we should change the default for the class.*/ - { - GtkActionGroup *lilyaction_group = gtk_action_group_new ("LilyActions"); - gtk_action_group_set_translation_domain (lilyaction_group, NULL); - gtk_action_group_add_actions (lilyaction_group, lily_menus, - G_N_ELEMENTS (lily_menus), Denemo.gui); - gtk_ui_manager_insert_action_group (ui_manager, lilyaction_group, 1); - } // g_print("Turning on the modes\n");