brasero r1528 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1528 - in trunk: . src
- Date: Fri, 14 Nov 2008 16:14:34 +0000 (UTC)
Author: philippr
Date: Fri Nov 14 16:14:34 2008
New Revision: 1528
URL: http://svn.gnome.org/viewvc/brasero?rev=1528&view=rev
Log:
When not running full standalone application make sure modality works
for dialogs
* src/brasero-app.c (brasero_app_toplevel_destroyed_cb),
(brasero_app_dialog), (brasero_app_alert):
* src/brasero-app.h:
* src/brasero-audio-disc.c (brasero_audio_disc_short_track_dialog),
(brasero_audio_disc_file_type_error_dialog),
(brasero_audio_disc_video_file_dialog),
(brasero_audio_disc_add_dir),
(brasero_audio_disc_unreadable_dialog), (brasero_audio_disc_split),
(brasero_audio_disc_inotify_removal_warning):
* src/brasero-data-disc.c
(brasero_data_disc_import_failure_dialog),
(brasero_data_disc_image_uri_cb),
(brasero_data_disc_unreadable_uri_cb),
(brasero_data_disc_recursive_uri_cb),
(brasero_data_disc_unknown_uri_cb),
(brasero_data_disc_name_collision_cb),
(brasero_data_disc_2G_file_cb),
(brasero_data_disc_deep_directory_cb):
* src/brasero-playlist.c (brasero_playlist_dialog_error):
* src/brasero-project-manager.c (brasero_project_manager_open_uri):
* src/brasero-project.c (brasero_project_check_status),
(brasero_project_no_song_dialog), (brasero_project_no_file_dialog),
(brasero_project_confirm_switch), (brasero_project_empty_cb),
(brasero_project_invalid_project_dialog),
(brasero_project_not_saved_dialog),
(brasero_project_save_project_dialog):
* src/brasero-search-beagle.c (brasero_search_beagle_error_dialog):
* src/brasero-utils.c (brasero_utils_launch_app):
* src/brasero-video-disc.c (brasero_video_disc_directory_dialog),
(brasero_video_disc_unreadable_uri_dialog),
(brasero_video_disc_not_video_dialog):
* src/main.c (brasero_app_parse_options):
Modified:
trunk/ChangeLog
trunk/src/brasero-app.c
trunk/src/brasero-app.h
trunk/src/brasero-audio-disc.c
trunk/src/brasero-data-disc.c
trunk/src/brasero-playlist.c
trunk/src/brasero-project-manager.c
trunk/src/brasero-project.c
trunk/src/brasero-search-beagle.c
trunk/src/brasero-utils.c
trunk/src/brasero-video-disc.c
trunk/src/main.c
Modified: trunk/src/brasero-app.c
==============================================================================
--- trunk/src/brasero-app.c (original)
+++ trunk/src/brasero-app.c Fri Nov 14 16:14:34 2008
@@ -35,22 +35,25 @@
#endif
#include "brasero-app.h"
+#include "brasero-utils.h"
#include "brasero-jacket-edit.h"
#include "brasero-blank-dialog.h"
#include "brasero-sum-dialog.h"
#include "brasero-eject-dialog.h"
#include "brasero-session.h"
#include "brasero-project-manager.h"
-#include "burn-drive.h"
#include "brasero-pref.h"
#include "burn-debug.h"
-#include "burn.h"
+#include "burn-drive.h"
#include "burn-caps.h"
+#include "burn.h"
#include "burn-plugin-manager.h"
typedef struct _BraseroAppPrivate BraseroAppPrivate;
struct _BraseroAppPrivate
{
+ GtkWidget *toplevel;
+
GtkWidget *projects;
GtkWidget *contents;
GtkWidget *statusbar1;
@@ -157,6 +160,86 @@
"</ui>"
};
+/**
+ * These functions are only useful because they set the proper toplevel parent
+ * for the message dialog. The following one also sets some properties in case
+ * there isn't any toplevel parent (like show in taskbar, ...).
+ **/
+
+static void
+brasero_app_toplevel_destroyed_cb (GtkObject *object,
+ BraseroApp *app)
+{
+ BraseroAppPrivate *priv;
+
+ priv = BRASERO_APP_PRIVATE (app);
+ priv->toplevel = NULL;
+}
+
+GtkWidget *
+brasero_app_dialog (BraseroApp *app,
+ const gchar *primary_message,
+ GtkButtonsType button_type,
+ GtkMessageType msg_type)
+{
+ gboolean is_on_top = FALSE;
+ BraseroAppPrivate *priv;
+ GtkWindow *toplevel;
+ GtkWidget *dialog;
+
+ priv = BRASERO_APP_PRIVATE (app);
+
+ if (priv->is_running)
+ toplevel = GTK_WINDOW (app);
+ else if (!priv->toplevel) {
+ is_on_top = TRUE;
+ toplevel = NULL;
+ }
+ else
+ toplevel = GTK_WINDOW (priv->toplevel);
+
+ dialog = gtk_message_dialog_new (toplevel,
+ GTK_DIALOG_DESTROY_WITH_PARENT|
+ GTK_DIALOG_MODAL,
+ msg_type,
+ button_type,
+ primary_message);
+
+ if (is_on_top) {
+ gtk_window_set_skip_pager_hint (GTK_WINDOW (dialog), FALSE);
+ gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE);
+
+ priv->toplevel = dialog;
+ g_signal_connect (dialog,
+ "destroy",
+ G_CALLBACK (brasero_app_toplevel_destroyed_cb),
+ app);
+ }
+
+ return dialog;
+}
+
+void
+brasero_app_alert (BraseroApp *app,
+ const gchar *primary_message,
+ const gchar *secondary_message,
+ GtkMessageType type)
+{
+ BraseroAppPrivate *priv;
+ GtkWidget *parent = NULL;
+
+ priv = BRASERO_APP_PRIVATE (app);
+ if (priv->is_running)
+ parent = GTK_WIDGET (app);
+ else
+ parent = priv->toplevel;
+
+ brasero_utils_message_dialog (parent,
+ primary_message,
+ secondary_message,
+ type);
+}
+
GtkUIManager *
brasero_app_get_ui_manager (BraseroApp *app)
{
Modified: trunk/src/brasero-app.h
==============================================================================
--- trunk/src/brasero-app.h (original)
+++ trunk/src/brasero-app.h Fri Nov 14 16:14:34 2008
@@ -58,6 +58,18 @@
gboolean
brasero_app_is_running (BraseroApp *app);
+GtkWidget *
+brasero_app_dialog (BraseroApp *app,
+ const gchar *primary_message,
+ GtkButtonsType button_type,
+ GtkMessageType msg_type);
+
+void
+brasero_app_alert (BraseroApp *app,
+ const gchar *primary_message,
+ const gchar *secondary_message,
+ GtkMessageType type);
+
void
brasero_app_blank (BraseroApp *app,
const gchar *device,
Modified: trunk/src/brasero-audio-disc.c
==============================================================================
--- trunk/src/brasero-audio-disc.c (original)
+++ trunk/src/brasero-audio-disc.c Fri Nov 14 16:14:34 2008
@@ -62,6 +62,7 @@
#include "burn-basics.h"
#include "burn-debug.h"
+#include "brasero-app.h"
#include "brasero-disc.h"
#include "brasero-audio-disc.h"
#include "brasero-metadata.h"
@@ -1155,10 +1156,10 @@
static void
brasero_audio_disc_short_track_dialog (BraseroAudioDisc *disc)
{
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (disc)),
- _("The track will be padded at its end."),
- _("The track is shorter than 6 seconds"),
- GTK_MESSAGE_WARNING);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (disc))),
+ _("The track will be padded at its end."),
+ _("The track is shorter than 6 seconds"),
+ GTK_MESSAGE_WARNING);
}
static gchar *
@@ -1337,10 +1338,10 @@
BRASERO_GET_BASENAME_FOR_DISPLAY (uri, name);
primary = g_strdup_printf (_("\"%s\" could not be handled by gstreamer."), name);
- brasero_utils_message_dialog (toplevel,
- primary,
- _("Make sure the appropriate codec is installed"),
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (toplevel),
+ primary,
+ _("Make sure the appropriate codec is installed"),
+ GTK_MESSAGE_ERROR);
g_free (primary);
g_free (name);
}
@@ -1351,6 +1352,7 @@
{
GtkWidget *dialog, *toplevel;
GtkResponseType answer;
+ gchar *string;
gchar *name;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (disc));
@@ -1360,13 +1362,12 @@
}
BRASERO_GET_BASENAME_FOR_DISPLAY (uri, name);
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT|
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("Do you want to add \"%s\" which is a video file?"),
- name);
+ string = g_strdup_printf (_("Do you want to add \"%s\" which is a video file?"), name);
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ string,
+ GTK_BUTTONS_NONE,
+ GTK_MESSAGE_QUESTION);
+ g_free (string);
g_free (name);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
@@ -1496,12 +1497,10 @@
GtkWidget *toplevel;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (disc));
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Do you want to search for audio files inside the directory?"));
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ _("Do you want to search for audio files inside the directory"),
+ GTK_BUTTONS_NONE,
+ GTK_MESSAGE_WARNING);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("Directories cannot be added to an audio disc."));
@@ -1573,10 +1572,10 @@
}
primary = g_strdup_printf (_("\"%s\" could not be opened."), name);
- brasero_utils_message_dialog (toplevel,
- primary,
- error->message,
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (toplevel),
+ primary,
+ error->message,
+ GTK_MESSAGE_ERROR);
g_free (primary);
g_free (name);
}
@@ -2757,10 +2756,10 @@
/* don't check g_slist_length == 0 since then the button is greyed */
if (g_list_length (selected) > 1) {
- brasero_utils_message_dialog (toplevel,
- _("Select one song only please."),
- _("Impossible to split more than one song at a time"),
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (toplevel),
+ _("Select one song only please."),
+ _("Impossible to split more than one song at a time"),
+ GTK_MESSAGE_ERROR);
g_list_foreach (selected, (GFunc) gtk_tree_path_free, NULL);
g_list_free (selected);
@@ -3639,10 +3638,10 @@
BRASERO_GET_BASENAME_FOR_DISPLAY (uri, name);
primary = g_strdup_printf (_("\"%s\" was removed from the file system."), name);
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (disc)),
- primary,
- _("It will be removed from the project"),
- GTK_MESSAGE_WARNING);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (disc))),
+ primary,
+ _("It will be removed from the project"),
+ GTK_MESSAGE_WARNING);
g_free (primary);
g_free (name);
}
Modified: trunk/src/brasero-data-disc.c
==============================================================================
--- trunk/src/brasero-data-disc.c (original)
+++ trunk/src/brasero-data-disc.c Fri Nov 14 16:14:34 2008
@@ -214,10 +214,10 @@
brasero_data_disc_import_failure_dialog (BraseroDataDisc *disc,
GError *error)
{
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (disc)),
- _("The session could not be imported."),
- error?error->message:_("An unknown error occured"),
- GTK_MESSAGE_WARNING);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (disc))),
+ _("The session could not be imported."),
+ error?error->message:_("An unknown error occured"),
+ GTK_MESSAGE_WARNING);
}
static gboolean
@@ -781,6 +781,7 @@
{
gint answer;
gchar *name;
+ gchar *string;
GtkWidget *button;
GtkWidget *dialog;
GtkWidget *toplevel;
@@ -797,13 +798,12 @@
return BRASERO_BURN_OK;
name = brasero_file_node_get_uri_name (uri);
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("Do you want to burn \"%s\" to a disc or add it in to the data project?"),
- name);
+ string = g_strdup_printf (_("Do you want to burn \"%s\" to a disc or add it in to the data project?"), name);
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ string,
+ GTK_BUTTONS_NONE,
+ GTK_MESSAGE_QUESTION);
+ g_free (string);
g_free (name);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
@@ -895,10 +895,10 @@
}
primary = g_strdup_printf (_("\"%s\" cannot be added to the selection."), name);
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (self)),
- primary,
- error->message,
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (self))),
+ primary,
+ error->message,
+ GTK_MESSAGE_ERROR);
g_free (primary);
g_free (name);
}
@@ -926,10 +926,10 @@
}
primary = g_strdup_printf (_("\"%s\" cannot be added to the selection."), name);
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (self)),
- primary,
- _("It is a recursive symlink"),
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (self))),
+ primary,
+ _("It is a recursive symlink"),
+ GTK_MESSAGE_ERROR);
g_free (primary);
g_free (name);
}
@@ -957,10 +957,10 @@
}
primary = g_strdup_printf (_("\"%s\" cannot be added to the selection."), name);
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (self)),
- primary,
- _("It doesn't exist at the specified location"),
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (self))),
+ primary,
+ _("It doesn't exist at the specified location"),
+ GTK_MESSAGE_ERROR);
g_free (primary);
g_free (name);
}
@@ -971,6 +971,7 @@
BraseroDataDisc *self)
{
gint answer;
+ gchar *string;
GtkWidget *dialog;
GtkWidget *toplevel;
BraseroDataDiscPrivate *priv;
@@ -983,13 +984,12 @@
}
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self));
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Do you really want to replace \"%s\"?"),
- name);
+ string = g_strdup_printf (_("Do you really want to replace \"%s\"?"), name);
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ string,
+ GTK_BUTTONS_NONE,
+ GTK_MESSAGE_WARNING);
+ g_free (string);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("It already exists in the directory."));
@@ -1012,6 +1012,7 @@
BraseroDataDisc *self)
{
gint answer;
+ gchar *string;
GtkWidget *dialog;
GtkWidget *toplevel;
BraseroDataDiscPrivate *priv;
@@ -1028,13 +1029,12 @@
}
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self));
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Do you really want to add \"%s\" to the selection and use the third version of ISO9660 standard to support it?"),
- name);
+ string = g_strdup_printf (_("Do you really want to add \"%s\" to the selection and use the third version of ISO9660 standard to support it?"), name);
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ string,
+ GTK_BUTTONS_NONE,
+ GTK_MESSAGE_WARNING);
+ g_free (string);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("The size of the file is over 2 GiB. This isn't supported by ISO9660 standard in his first and second versions (the most widespread ones)."
@@ -1058,6 +1058,7 @@
BraseroDataDisc *self)
{
gint answer;
+ gchar *string;
GtkWidget *dialog;
GtkWidget *toplevel;
BraseroDataDiscPrivate *priv;
@@ -1074,13 +1075,13 @@
}
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self));
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Do you really want to add \"%s\" to the selection?"),
- name);
+
+ string = g_strdup_printf (_("Do you really want to add \"%s\" to the selection?"), name);
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ string,
+ GTK_BUTTONS_NONE,
+ GTK_MESSAGE_WARNING);
+ g_free (string);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("The children of this directory will have 6 parent directories. This is a violation of the ISO9660 standard which only allows 6."
Modified: trunk/src/brasero-playlist.c
==============================================================================
--- trunk/src/brasero-playlist.c (original)
+++ trunk/src/brasero-playlist.c Fri Nov 14 16:14:34 2008
@@ -47,6 +47,7 @@
#include <totem-pl-parser.h>
+#include "brasero-app.h"
#include "brasero-playlist.h"
#include "brasero-utils.h"
#include "brasero-metadata.h"
@@ -811,10 +812,10 @@
BRASERO_GET_BASENAME_FOR_DISPLAY (uri, name);
primary = g_strdup_printf (_("Error parsing playlist \"%s\"."), name);
- brasero_utils_message_dialog (GTK_WIDGET (toplevel),
- primary,
- _("An unknown error occured"),
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (toplevel),
+ primary,
+ _("An unknown error occured"),
+ GTK_MESSAGE_ERROR);
g_free (primary);
g_free (name);
}
Modified: trunk/src/brasero-project-manager.c
==============================================================================
--- trunk/src/brasero-project-manager.c (original)
+++ trunk/src/brasero-project-manager.c Fri Nov 14 16:14:34 2008
@@ -1049,10 +1049,10 @@
gchar *string;
string = g_strdup_printf (_("The project \"%s\" does not exist"), uri);
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (manager)),
- _("Error while loading the project."),
- string,
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (manager))),
+ _("Error while loading the project."),
+ string,
+ GTK_MESSAGE_ERROR);
g_free (string);
type = BRASERO_PROJECT_TYPE_INVALID;
Modified: trunk/src/brasero-project.c
==============================================================================
--- trunk/src/brasero-project.c (original)
+++ trunk/src/brasero-project.c Fri Nov 14 16:14:34 2008
@@ -774,25 +774,18 @@
* or get the metadata of a song or a film */
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (project));
- /* This dialog will run as a standalone window when run from nautilus
+ /* This dialog can run as a standalone window when run from nautilus
* to burn burn:// URI contents. */
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_OTHER,
- GTK_BUTTONS_CANCEL,
- _("Please, wait until the estimation of the project size is completed."));
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ _("Please, wait until the estimation of the project size is completed."),
+ GTK_BUTTONS_CANCEL,
+ GTK_MESSAGE_OTHER);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("All files from the project need to be analysed to complete this operation."));
gtk_window_set_title (GTK_WINDOW (dialog), _("Project Size Estimation"));
- if (!brasero_app_is_running (BRASERO_APP (toplevel))) {
- gtk_window_set_skip_pager_hint (GTK_WINDOW (dialog), FALSE);
- gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE);
- }
-
box = gtk_vbox_new (FALSE, 4);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
box,
@@ -876,19 +869,19 @@
static void
brasero_project_no_song_dialog (BraseroProject *project)
{
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (project)),
- _("Please add songs to the project."),
- _("The project is empty"),
- GTK_MESSAGE_WARNING);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (project))),
+ _("Please add songs to the project."),
+ _("The project is empty"),
+ GTK_MESSAGE_WARNING);
}
static void
brasero_project_no_file_dialog (BraseroProject *project)
{
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (project)),
- _("Please add files to the project."),
- _("The project is empty"),
- GTK_MESSAGE_WARNING);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (project))),
+ _("Please add files to the project."),
+ _("The project is empty"),
+ GTK_MESSAGE_WARNING);
}
void
@@ -1099,12 +1092,10 @@
if (!project->priv->modified)
return TRUE;
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CANCEL,
- _("Do you really want to create a new project and discard the changes to current one?"));
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ _("Do you really want to create a new project and discard the changes to current one?"),
+ GTK_BUTTONS_CANCEL,
+ GTK_MESSAGE_WARNING);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("If you choose to create a new project, all changes made will be lost."));
@@ -1117,12 +1108,10 @@
return TRUE;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (project));
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CANCEL,
- _("Do you really want to create a new project and discard the current one?"));
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ _("Do you really want to create a new project and discard the current one?"),
+ GTK_BUTTONS_CANCEL,
+ GTK_MESSAGE_WARNING);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("If you choose to create a new project, "
@@ -1498,12 +1487,10 @@
GtkResponseType answer;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (project));
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CANCEL,
- _("Do you really want to empty the current project?"));
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ _("Do you really want to empty the current project?"),
+ GTK_BUTTONS_CANCEL,
+ GTK_MESSAGE_WARNING);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("Emptying a project will remove all files already added. "
@@ -1662,10 +1649,10 @@
brasero_project_invalid_project_dialog (BraseroProject *project,
const char *reason)
{
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (project)),
- _("Error while loading the project."),
- reason,
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (project))),
+ _("Error while loading the project."),
+ reason,
+ GTK_MESSAGE_ERROR);
}
static gboolean
@@ -2230,10 +2217,10 @@
xmlError *error;
error = xmlGetLastError ();
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (project)),
- _("Your project has not been saved."),
- error?error->message:_("An unknown error occured"),
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (project))),
+ _("Your project has not been saved."),
+ error? error->message:_("An unknown error occured"),
+ GTK_MESSAGE_ERROR);
xmlResetLastError ();
}
@@ -2246,12 +2233,10 @@
GtkResponseType result;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (project));
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT|
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Save the changes of current project before closing?"));
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ _("Save the changes of current project before closing?"),
+ GTK_BUTTONS_NONE,
+ GTK_MESSAGE_WARNING);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("If you don't save, changes will be permanently lost."));
Modified: trunk/src/brasero-search-beagle.c
==============================================================================
--- trunk/src/brasero-search-beagle.c (original)
+++ trunk/src/brasero-search-beagle.c Fri Nov 14 16:14:34 2008
@@ -44,6 +44,7 @@
#include <beagle/beagle.h>
+#include "brasero-app.h"
#include "brasero-utils.h"
#include "brasero-search-entry.h"
#include "brasero-mime-filter.h"
@@ -1033,10 +1034,10 @@
return;
}
- brasero_utils_message_dialog (toplevel,
- _("Error querying beagle."),
- error->message,
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (toplevel),
+ _("Error querying beagle."),
+ error->message,
+ GTK_MESSAGE_ERROR);
}
static void
Modified: trunk/src/brasero-utils.c
==============================================================================
--- trunk/src/brasero-utils.c (original)
+++ trunk/src/brasero-utils.c Fri Nov 14 16:14:34 2008
@@ -40,6 +40,7 @@
#include <gst/gst.h>
+#include "brasero-app.h"
#include "brasero-utils.h"
#include "brasero-data-tree-model.h"
@@ -471,10 +472,10 @@
gchar *string;
string = g_strdup_printf ("\"%s\" could not be opened", uri);
- brasero_utils_message_dialog (gtk_widget_get_toplevel (GTK_WIDGET (widget)),
- string,
- error->message,
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (gtk_widget_get_toplevel (GTK_WIDGET (widget))),
+ string,
+ error->message,
+ GTK_MESSAGE_ERROR);
g_free (string);
g_error_free (error);
continue;
Modified: trunk/src/brasero-video-disc.c
==============================================================================
--- trunk/src/brasero-video-disc.c (original)
+++ trunk/src/brasero-video-disc.c Fri Nov 14 16:14:34 2008
@@ -33,6 +33,7 @@
#include "eggtreemultidnd.h"
#include "burn-debug.h"
+#include "brasero-app.h"
#include "brasero-disc.h"
#include "brasero-io.h"
#include "brasero-utils.h"
@@ -237,12 +238,10 @@
GtkWidget *toplevel;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self));
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Do you want to search for video files inside the directory?"));
+ dialog = brasero_app_dialog (BRASERO_APP (toplevel),
+ _("Do you want to search for video files inside the directory?"),
+ GTK_BUTTONS_NONE,
+ GTK_MESSAGE_WARNING);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("Directories cannot be added to video discs."));
@@ -282,10 +281,10 @@
name = g_filename_display_basename (uri);
primary = g_strdup_printf (_("\"%s\" could not be opened."), name);
- brasero_utils_message_dialog (toplevel,
- primary,
- error->message,
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (toplevel),
+ primary,
+ error->message,
+ GTK_MESSAGE_ERROR);
g_free (primary);
g_free (name);
}
@@ -307,10 +306,10 @@
BRASERO_GET_BASENAME_FOR_DISPLAY (uri, name);
primary = g_strdup_printf (_("\"%s\" does not have a suitable type for video projects."), name);
- brasero_utils_message_dialog (toplevel,
- primary,
- _("Please only add files with video contents"),
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (BRASERO_APP (toplevel),
+ primary,
+ _("Please only add files with video contents"),
+ GTK_MESSAGE_ERROR);
g_free (primary);
g_free (name);
}
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Fri Nov 14 16:14:34 2008
@@ -195,10 +195,10 @@
nb ++;
if (nb > 1) {
- brasero_utils_message_dialog (NULL,
- _("Incompatible command line options used."),
- _("Only one option can be given at a time"),
- GTK_MESSAGE_ERROR);
+ brasero_app_alert (app,
+ _("Incompatible command line options used."),
+ _("Only one option can be given at a time"),
+ GTK_MESSAGE_ERROR);
brasero_project_manager_empty (BRASERO_PROJECT_MANAGER (manager));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]