660
665
/* The TreeView for the message */
661
666
buffer = gtk_text_buffer_new (NULL);
662
667
gtk_text_buffer_create_tag (buffer, "Title",
664
"justification", GTK_JUSTIFY_LEFT,
665
"foreground", "grey50",
668
gtk_text_buffer_create_tag (buffer, "TextBody",
669
"justification", GTK_JUSTIFY_LEFT,
670
"foreground", "grey50",
669
"justification", GTK_JUSTIFY_CENTER,
670
"foreground", "grey50",
671
"wrap-mode", GTK_WRAP_WORD,
673
674
gtk_text_buffer_get_start_iter (buffer, &iter);
675
/* Translators: this messages will appear as a list of possible
677
* To add/remove files you can:
678
* * perform action one
679
* * perform action two
680
* The full message will be showed in the main area of an empty
681
* project, suggesting users how to add and remove items to project.
682
* You simply have to translate messages in the best form
683
* for a list of actions. */
684
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("To add files to this project you can:"), -1, "Title", NULL);
685
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\n\t* ", -1, "TextBody", NULL);
687
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("click the \"Add\" button to show a selection dialog"), -1, "TextBody", NULL);
688
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\n\t* ", -1, "TextBody", NULL);
689
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("select files in the selection pane and click the \"Add\" button"), -1, "TextBody", NULL);
690
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\n\t* ", -1, "TextBody", NULL);
691
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("drag files in this area from the selection pane or from the file manager"), -1, "TextBody", NULL);
692
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\n\t* ", -1, "TextBody", NULL);
693
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("double-click on files in the selection pane"), -1, "TextBody", NULL);
694
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\n\t* ", -1, "TextBody", NULL);
695
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("copy files (from file manager for example) and paste in this area"), -1, "TextBody", NULL);
675
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("To add files to this project click the \"Add\" button or drag files to this area"), -1, "Title", NULL);
696
676
gtk_text_buffer_insert (buffer, &iter, "\n\n\n", -1);
698
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("To remove files from this project you can:"), -1, "Title", NULL);
699
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\n\t* ", -1, "TextBody", NULL);
701
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("click on the \"Remove\" button to remove selected items in this area"), -1, "TextBody", NULL);
702
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\n\t* ", -1, "TextBody", NULL);
703
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("select items in this area, and choose \"Remove\" from context menu"), -1, "TextBody", NULL);
704
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\n\t* ", -1, "TextBody", NULL);
705
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("select items in this area, and press \"Delete\" key"), -1, "TextBody", NULL);
677
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, _("To remove files select them then click on the \"Remove\" button or press \"Delete\" key"), -1, "Title", NULL);
707
679
textview = gtk_text_view_new_with_buffer (buffer);
708
680
gtk_text_view_set_editable (GTK_TEXT_VIEW (textview), FALSE);
1293
1270
status = brasero_status_new ();
1294
1271
brasero_burn_session_get_status (BRASERO_BURN_SESSION (project->priv->session), status);
1295
1272
result = brasero_status_get_result (status);
1296
brasero_status_free (status);
1273
g_object_unref (status);
1298
1275
if (result == BRASERO_BURN_ERR) {
1299
1276
/* At the moment the only error possible is an empty project */
1300
if (BRASERO_IS_AUDIO_DISC (project->priv->current))
1301
brasero_project_no_song_dialog (project);
1303
brasero_project_no_file_dialog (project);
1305
return BRASERO_BURN_ERR;
1308
if (result == BRASERO_BURN_OK)
1309
return BRASERO_BURN_OK;
1277
if (BRASERO_IS_AUDIO_DISC (project->priv->current))
1278
brasero_project_no_song_dialog (project);
1280
brasero_project_no_file_dialog (project);
1282
return BRASERO_BURN_ERR;
1285
if (result == BRASERO_BURN_OK)
1286
return BRASERO_BURN_OK;
1311
1288
dialog = brasero_status_dialog_new (BRASERO_BURN_SESSION (project->priv->session),
1312
1289
gtk_widget_get_toplevel (GTK_WIDGET (project)));
1318
1295
return (response == GTK_RESPONSE_OK)? BRASERO_BURN_OK:BRASERO_BURN_CANCEL;
1298
static BraseroBurnResult
1299
brasero_project_install_missing (BraseroPluginErrorType type,
1300
const gchar *detail,
1303
BraseroProject *project = BRASERO_PROJECT (user_data);
1304
GCancellable *cancel;
1311
parent = gtk_widget_get_toplevel (GTK_WIDGET (project));
1312
xid = gdk_x11_drawable_get_xid (GDK_DRAWABLE (GTK_WIDGET (parent)->window));
1314
package = brasero_pk_new ();
1315
cancel = g_cancellable_new ();
1316
project->priv->cancel = cancel;
1318
case BRASERO_PLUGIN_ERROR_MISSING_APP:
1319
res = brasero_pk_install_missing_app (package, detail, xid, cancel);
1322
case BRASERO_PLUGIN_ERROR_MISSING_LIBRARY:
1323
res = brasero_pk_install_missing_library (package, detail, xid, cancel);
1326
case BRASERO_PLUGIN_ERROR_MISSING_GSTREAMER_PLUGIN:
1327
res = brasero_pk_install_gstreamer_plugin (package, detail, xid, cancel);
1336
g_object_unref (package);
1340
if (g_cancellable_is_cancelled (cancel)) {
1341
g_object_unref (cancel);
1342
return BRASERO_BURN_CANCEL;
1345
project->priv->cancel = NULL;
1346
g_object_unref (cancel);
1349
return BRASERO_BURN_ERR;
1351
return BRASERO_BURN_RETRY;
1354
static BraseroBurnResult
1355
brasero_project_list_missing (BraseroPluginErrorType type,
1356
const gchar *detail,
1359
GString *string = user_data;
1361
if (type == BRASERO_PLUGIN_ERROR_MISSING_APP) {
1362
g_string_append_c (string, '\n');
1363
/* Translators: %s is the name of a missing application */
1364
g_string_append_printf (string, _("%s (application)"), detail);
1366
else if (type == BRASERO_PLUGIN_ERROR_MISSING_LIBRARY) {
1367
g_string_append_c (string, '\n');
1368
/* Translators: %s is the name of a missing library */
1369
g_string_append_printf (string, _("%s (library)"), detail);
1371
else if (type == BRASERO_PLUGIN_ERROR_MISSING_GSTREAMER_PLUGIN) {
1372
g_string_append_c (string, '\n');
1373
/* Translators: %s is the name of a missing Gstreamer plugin */
1374
g_string_append_printf (string, _("%s (Gstreamer plugin)"), detail);
1377
return BRASERO_BURN_OK;
1380
static BraseroBurnResult
1381
brasero_project_check_plugins_not_ready (BraseroProject *project,
1382
BraseroBurnSession *session)
1384
BraseroBurnResult result;
1388
parent = gtk_widget_get_toplevel (GTK_WIDGET (project));
1389
gtk_widget_set_sensitive (parent, FALSE);
1391
result = brasero_session_foreach_plugin_error (session,
1392
brasero_project_install_missing,
1394
if (result == BRASERO_BURN_CANCEL)
1397
gtk_widget_set_sensitive (parent, TRUE);
1399
if (result == BRASERO_BURN_OK)
1402
string = g_string_new (_("Please install the following manually and try again:"));
1403
brasero_session_foreach_plugin_error (session,
1404
brasero_project_list_missing,
1407
brasero_utils_message_dialog (parent,
1408
_("All required applications and libraries are not installed."),
1411
g_string_free (string, TRUE);
1413
return BRASERO_BURN_ERR;
1321
1416
/******************************** burning **************************************/
1323
1418
brasero_project_setup_session (BraseroProject *project,