gcalctool r2288 - in trunk: . gcalctool
- From: rancell svn gnome org
- To: svn-commits-list gnome org
- Subject: gcalctool r2288 - in trunk: . gcalctool
- Date: Sun, 2 Nov 2008 12:20:10 +0000 (UTC)
Author: rancell
Date: Sun Nov 2 12:20:10 2008
New Revision: 2288
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2288&view=rev
Log:
Open help with gtk_show_uri() (Thomas Andersen, Bug #556207)
Modified:
trunk/ChangeLog
trunk/gcalctool/gtk.c
Modified: trunk/gcalctool/gtk.c
==============================================================================
--- trunk/gcalctool/gtk.c (original)
+++ trunk/gcalctool/gtk.c Sun Nov 2 12:20:10 2008
@@ -1280,50 +1280,26 @@
static void
help_display(void)
{
+ GdkScreen *screen;
GError *error = NULL;
- char *command;
- const char *lang;
- char *uri = NULL;
- GdkScreen *gscreen;
- int i;
-
- const char * const * langs = g_get_language_names ();
-
- for (i = 0; langs[i]; i++) {
- lang = langs[i];
- if (strchr (lang, '.')) {
- continue;
- }
-
- uri = g_build_filename(PACKAGE_DATA_DIR,
- "/gnome/help/gcalctool/",
- lang,
- "/gcalctool.xml",
- NULL);
-
- if (g_file_test (uri, G_FILE_TEST_EXISTS)) {
- break;
- }
- }
-
- command = g_strconcat ("gnome-open ghelp://", uri, NULL);
- gscreen = gdk_screen_get_default();
- gdk_spawn_command_line_on_screen (gscreen, command, &error);
- if (error) {
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (X->kframe));
+ gtk_show_uri (screen, "g1help:gcalctool", gtk_get_current_event_time (), &error);
+
+ if (error != NULL)
+ {
GtkWidget *d;
+ d = gtk_message_dialog_new (GTK_WINDOW (X->kframe),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ "%s", _("Unable to open help file"));
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (d),
+ "%s", error->message);
+ g_signal_connect (d, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ gtk_window_present (GTK_WINDOW (d));
- d = gtk_message_dialog_new(NULL,
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
- "%s", error->message);
- gtk_dialog_run(GTK_DIALOG(d));
- gtk_widget_destroy(d);
- g_error_free(error);
- error = NULL;
+ g_error_free (error);
}
-
- g_free (command);
- g_free (uri);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]