summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-27 10:49:31 +0200
committerJasmine Hassan <[email protected]>2012-11-16 09:45:49 +0200
commita71f882835029bbcbd2f46f54f18407606a558a3 (patch)
treea83b677fc88a1aa7720358ac54dbe8bda13fb4c0
parentcebbe2c78c33b41e164d8e5318d7a51d8cd8839b (diff)
downloadcaja-a71f882835029bbcbd2f46f54f18407606a558a3.tar.bz2
caja-a71f882835029bbcbd2f46f54f18407606a558a3.tar.xz
[all] use GtkMessageDialog instead of EelAlertDialog (going away)
This covers 4 commits: file-operations: use GtkMessageDialog http://git.gnome.org/browse/nautilus/commit/?id=51ec5861ca0697e802e8c003053211ac12f2fd54 mime-actions: use GtkMessageDialog http://git.gnome.org/browse/nautilus/commit/?id=7a3dcdd4bf667aac271be74988770e18575a7df2 tree-view: don't include eel-alert-dialog.h http://git.gnome.org/browse/nautilus/commit/?id=930af7f3058eed256a42c0c1558c7307bb93f411 [eel] use GtkMessageDialog for stock dialogs http://git.gnome.org/browse/nautilus/commit/?id=82c5b6c0d82ebd8a705d542fcc9aa58e6e9b0da4
-rw-r--r--eel/eel-stock-dialogs.c62
-rw-r--r--libcaja-private/caja-file-operations.c23
-rw-r--r--libcaja-private/caja-mime-actions.c53
-rw-r--r--src/file-manager/fm-tree-view.c1
4 files changed, 79 insertions, 60 deletions
diff --git a/eel/eel-stock-dialogs.c b/eel/eel-stock-dialogs.c
index eb675733..6cf48f02 100644
--- a/eel/eel-stock-dialogs.c
+++ b/eel/eel-stock-dialogs.c
@@ -25,10 +25,9 @@
#include <config.h>
#include "eel-stock-dialogs.h"
-#include "eel-alert-dialog.h"
#include "eel-glib-extensions.h"
-#include "eel-mate-extensions.h"
-#include "eel-string.h"
+#include "eel-gtk-extensions.h"
+
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
@@ -203,12 +202,16 @@ timed_wait_callback (gpointer callback_data)
/* Put up the timed wait window. */
button = wait->cancel_callback != NULL ? GTK_STOCK_CANCEL : GTK_STOCK_OK;
- dialog = GTK_DIALOG (eel_alert_dialog_new (wait->parent_window,
- 0,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_NONE,
- wait->wait_message,
- _("You can stop this operation by clicking cancel.")));
+ dialog = GTK_DIALOG (gtk_message_dialog_new (wait->parent_window,
+ 0,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_NONE,
+ NULL));
+
+ g_object_set (dialog,
+ "text", wait->wait_message,
+ "secondary-text", _("You can stop this operation by clicking cancel."),
+ NULL);
gtk_dialog_add_button (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
@@ -340,12 +343,16 @@ eel_run_simple_dialog (GtkWidget *parent, gboolean ignore_close_box,
}
/* Create the dialog. */
- dialog = eel_alert_dialog_new (GTK_WINDOW (chosen_parent),
- 0,
- message_type,
- GTK_BUTTONS_NONE,
- primary_text,
- secondary_text);
+ dialog = gtk_message_dialog_new (GTK_WINDOW (chosen_parent),
+ 0,
+ message_type,
+ GTK_BUTTONS_NONE,
+ NULL);
+
+ g_object_set (dialog,
+ "text", primary_text,
+ "secondary-text", secondary_text,
+ NULL);
va_start (button_title_args, secondary_text);
response_id = 0;
@@ -370,7 +377,7 @@ eel_run_simple_dialog (GtkWidget *parent, gboolean ignore_close_box,
gtk_widget_show (GTK_WIDGET (dialog));
result = gtk_dialog_run (GTK_DIALOG (dialog));
}
- gtk_object_destroy (GTK_OBJECT (dialog));
+ gtk_widget_destroy (dialog);
return result;
}
@@ -384,12 +391,17 @@ create_message_dialog (const char *primary_text,
{
GtkWidget *dialog;
- dialog = eel_alert_dialog_new (parent,
- 0,
- type,
- buttons_type,
- primary_text,
- secondary_text);
+ dialog = gtk_message_dialog_new (parent,
+ 0,
+ type,
+ buttons_type,
+ NULL);
+
+ g_object_set (dialog,
+ "text", primary_text,
+ "secondary-text", secondary_text,
+ NULL);
+
return GTK_DIALOG (dialog);
}
@@ -405,9 +417,9 @@ show_message_dialog (const char *primary_text,
dialog = create_message_dialog (primary_text, secondary_text, type,
buttons_type, parent);
- if (details_text != NULL)
- {
- eel_alert_dialog_set_details_label (EEL_ALERT_DIALOG (dialog), details_text);
+ if (details_text != NULL) {
+ eel_gtk_message_dialog_set_details_label (GTK_MESSAGE_DIALOG (dialog),
+ details_text);
}
gtk_widget_show (GTK_WIDGET (dialog));
diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c
index 55140e6b..24bb4a19 100644
--- a/libcaja-private/caja-file-operations.c
+++ b/libcaja-private/caja-file-operations.c
@@ -44,7 +44,6 @@
#include "caja-progress-info.h"
-#include <eel/eel-alert-dialog.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-stock-dialogs.h>
@@ -1065,12 +1064,16 @@ do_run_simple_dialog (gpointer _data)
int response_id;
/* Create the dialog. */
- dialog = eel_alert_dialog_new (*data->parent_window,
- 0,
- data->message_type,
- GTK_BUTTONS_NONE,
- data->primary_text,
- data->secondary_text);
+ dialog = gtk_message_dialog_new (*data->parent_window,
+ 0,
+ data->message_type,
+ GTK_BUTTONS_NONE,
+ NULL);
+
+ g_object_set (dialog,
+ "text", data->primary_text,
+ "secondary-text", data->secondary_text,
+ NULL);
for (response_id = 0;
data->button_titles[response_id] != NULL;
@@ -1085,8 +1088,8 @@ do_run_simple_dialog (gpointer _data)
}
if (data->details_text) {
- eel_alert_dialog_set_details_label (EEL_ALERT_DIALOG (dialog),
- data->details_text);
+ eel_gtk_message_dialog_set_details_label (GTK_MESSAGE_DIALOG (dialog),
+ data->details_text);
}
/* Run it. */
@@ -1098,7 +1101,7 @@ do_run_simple_dialog (gpointer _data)
result = gtk_dialog_run (GTK_DIALOG (dialog));
}
- gtk_object_destroy (GTK_OBJECT (dialog));
+ gtk_widget_destroy (dialog);
data->result = result;
diff --git a/libcaja-private/caja-mime-actions.c b/libcaja-private/caja-mime-actions.c
index 501263f0..a4dc8c97 100644
--- a/libcaja-private/caja-mime-actions.c
+++ b/libcaja-private/caja-mime-actions.c
@@ -27,7 +27,6 @@
#include <eel/eel-glib-extensions.h>
#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-alert-dialog.h>
#include <eel/eel-string.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
@@ -1372,26 +1371,29 @@ show_unhandled_type_error (ActivateParametersInstall *parameters)
char *mime_type = caja_file_get_mime_type (parameters->file);
char *error_message = get_application_no_mime_type_handler_message (parameters->file, parameters->uri);
- if (g_content_type_is_unknown (mime_type))
- {
- dialog = eel_alert_dialog_new (parameters->parent_window,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- 0,
- error_message,
- _("The file is of an unknown type"));
- }
- else
- {
+ if (g_content_type_is_unknown (mime_type)) {
+ dialog = gtk_message_dialog_new (parameters->parent_window,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ 0,
+ NULL);
+ g_object_set (dialog,
+ "text", error_message,
+ "secondary-text", _("The file is of an unknown type"),
+ NULL);
+ } else {
char *text;
text = g_strdup_printf (_("There is no application installed for %s files"), g_content_type_get_description (mime_type));
- dialog = eel_alert_dialog_new (parameters->parent_window,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- 0,
- error_message,
- text);
+ dialog = gtk_message_dialog_new (parameters->parent_window,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ 0,
+ NULL);
+ g_object_set (dialog,
+ "text", error_message,
+ "secondary-text", text,
+ NULL);
g_free (text);
}
@@ -1734,12 +1736,15 @@ activate_desktop_file (ActivateParameters *parameters,
),
display_name);
- dialog = eel_alert_dialog_new (parameters->parent_window,
- 0,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- primary,
- secondary);
+ dialog = gtk_message_dialog_new (parameters->parent_window,
+ 0,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_NONE,
+ NULL);
+ g_object_set (dialog,
+ "text", primary,
+ "secondary-text", secondary,
+ NULL);
gtk_dialog_add_button (GTK_DIALOG (dialog),
_("_Launch Anyway"), RESPONSE_RUN);
if (caja_file_can_set_permissions (file))
diff --git a/src/file-manager/fm-tree-view.c b/src/file-manager/fm-tree-view.c
index cb27a07d..d673c70b 100644
--- a/src/file-manager/fm-tree-view.c
+++ b/src/file-manager/fm-tree-view.c
@@ -35,7 +35,6 @@
#include "fm-tree-model.h"
#include "fm-properties-window.h"
#include <string.h>
-#include <eel/eel-alert-dialog.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-stock-dialogs.h>