// load a song and show machine properties dialog static void test_bt_machine_preferences_dialog_create (BT_TEST_ARGS) { BT_TEST_START; GST_INFO ("-- arrange --"); BtSong *song; BtSetup *setup; BtMachine *machine; GtkWidget *dialog; bt_edit_application_load_song (app, check_get_test_song_path ("melo3.xml"), NULL); g_object_get (app, "song", &song, NULL); g_object_get (song, "setup", &setup, NULL); machine = bt_setup_get_machine_by_id (setup, "beep1"); GST_INFO ("-- act --"); dialog = GTK_WIDGET (bt_machine_preferences_dialog_new (machine)); GST_INFO ("-- assert --"); fail_unless (dialog != NULL, NULL); gtk_widget_show_all (dialog); check_make_widget_screenshot (GTK_WIDGET (dialog), NULL); GST_INFO ("-- cleanup --"); gtk_widget_destroy (dialog); g_object_unref (machine); g_object_unref (setup); g_object_unref (song); BT_TEST_END; }
/** * bt_edit_application_load_and_run: * @self: the application instance to run * @input_file_name: the file to load initially * * load the file of the supplied name and start the gtk based editor application * * Returns: true for success */ gboolean bt_edit_application_load_and_run (const BtEditApplication * self, const gchar * input_file_name) { gboolean res = FALSE; g_return_val_if_fail (BT_IS_EDIT_APPLICATION (self), FALSE); GST_INFO ("application.load_and_run launched"); if (bt_edit_application_load_song (self, input_file_name, &self->priv->init_err)) { res = bt_edit_application_run_ui (self); } else { GST_WARNING ("loading song '%s' failed", input_file_name); self->priv->init_file_name = g_strdup (input_file_name); // start normaly bt_edit_application_run (self); } GST_INFO ("application.load_and_run finished"); return res; }