else
g_assert_not_reached ();
- sokoke_message_dialog (GTK_MESSAGE_ERROR, message, detailed_message);
+ sokoke_message_dialog (GTK_MESSAGE_ERROR, message, detailed_message, FALSE);
g_free (message);
g_free (detailed_message);
g_object_unref (download);
"Alternatively go to Preferences, Applications in Midori, "
"and select a News Aggregator. Next time you click the "
"news feed icon, it will be added automatically."));
- sokoke_message_dialog (GTK_MESSAGE_INFO, _("New feed"), description);
+ sokoke_message_dialog (GTK_MESSAGE_INFO, _("New feed"), description, FALSE);
g_free (description);
}
}
if (!sokoke_show_uri_with_mime_type (gtk_widget_get_screen (view),
uri, "text/plain", gtk_get_current_event_time (), &error))
sokoke_message_dialog (GTK_MESSAGE_ERROR,
- _("Could not run external program."), error ? error->message : "");
+ _("Could not run external program."),
+ error ? error->message : "", FALSE);
if (error)
g_error_free (error);
g_free (text_editor);
if (path && !midori_array_from_file (bookmarks, path, NULL, &error))
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
- _("Failed to import bookmarks"), error ? error->message : "");
+ _("Failed to import bookmarks"),
+ error ? error->message : "", FALSE);
if (error)
g_error_free (error);
}
if (!browser->bookmarks || !gtk_widget_get_visible (GTK_WIDGET (browser)))
return;
+wrong_format:
file_dialog = sokoke_file_chooser_dialog_new (_("Save file as"),
GTK_WINDOW (browser), GTK_FILE_CHOOSER_ACTION_SAVE);
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_dialog),
if (gtk_dialog_run (GTK_DIALOG (file_dialog)) == GTK_RESPONSE_OK)
path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_dialog));
gtk_widget_destroy (file_dialog);
+ if (g_str_has_suffix (path, ".xbel"))
+ format = "xbel";
+ else if (g_str_has_suffix (path, ".html"))
+ format = "netscape";
+ else if (path != NULL)
+ {
+ sokoke_message_dialog (GTK_MESSAGE_ERROR,
+ _("Midori can only export to XBEL (*.xbel) and Netscape (*.html)"),
+ "", TRUE);
+ katze_assign (path, NULL);
+ goto wrong_format;
+ }
if (path == NULL)
return;
db = g_object_get_data (G_OBJECT (browser->history), "db");
bookmarks = katze_array_new (KATZE_TYPE_ARRAY);
midori_bookmarks_export_array_db (db, bookmarks, "");
- if (g_str_has_suffix (path, ".xbel"))
- format = "xbel";
- else if (g_str_has_suffix (path, ".html"))
- format = "netscape";
- else
- g_assert_not_reached ();
if (!midori_array_to_file (bookmarks, path, format, &error))
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
- _("Failed to export bookmarks"), error ? error->message : "");
+ _("Failed to export bookmarks"), error ? error->message : "", FALSE);
if (error)
g_error_free (error);
}
void
sokoke_message_dialog (GtkMessageType message_type,
const gchar* short_message,
- const gchar* detailed_message)
+ const gchar* detailed_message,
+ gboolean modal)
{
GtkWidget* dialog = gtk_message_dialog_new (
NULL, 0, message_type,
"%s", short_message);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", detailed_message);
- g_signal_connect (dialog, "response",
- G_CALLBACK (sokoke_message_dialog_response_cb), NULL);
- gtk_widget_show (dialog);
+ if (modal)
+ {
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ }
+ else
+ {
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (sokoke_message_dialog_response_cb), NULL);
+ gtk_widget_show (dialog);
+ }
+
}
/**
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
- "Failed to initialize libosso");
+ "Failed to initialize libosso", FALSE);
return FALSE;
}
osso_deinitialize (osso);
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
- "Failed to get dbus connection from osso context");
+ "Failed to get dbus connection from osso context", FALSE);
return FALSE;
}
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
- error ? error->message : "");
+ error ? error->message : "", FALSE);
if (error)
g_error_free (error);
return FALSE;
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
- error->message);
+ error->message, FALSE);
g_error_free (error);
g_free (command_ready);
return FALSE;
{
sokoke_message_dialog (GTK_MESSAGE_ERROR,
_("Could not run external program."),
- error->message);
+ error->message, FALSE);
g_error_free (error);
}