Connect Help in Preferences to HelpContents

This commit is contained in:
Christian Dywan 2008-10-04 00:46:54 +02:00
parent 8953a9b26b
commit 5eb74b6bf3
2 changed files with 24 additions and 6 deletions

View file

@ -1428,6 +1428,15 @@ midori_browser_menu_trash_activate_cb (GtkWidget* widget,
SOKOKE_MENU_POSITION_RIGHT);
}
static void
midori_preferences_response_help_cb (GtkWidget* preferences,
gint response,
MidoriBrowser* browser)
{
if (response == GTK_RESPONSE_HELP)
gtk_action_activate (_action_by_name (browser, "HelpContents"));
}
static void
_action_preferences_activate (GtkAction* action,
MidoriBrowser* browser)
@ -1440,6 +1449,8 @@ _action_preferences_activate (GtkAction* action,
{
dialog = midori_preferences_new (GTK_WINDOW (browser),
browser->settings);
g_signal_connect (dialog, "response",
G_CALLBACK (midori_preferences_response_help_cb), browser);
gtk_widget_show (dialog);
}
}

View file

@ -64,13 +64,23 @@ midori_preferences_class_init (MidoriPreferencesClass* class)
G_PARAM_WRITABLE));
}
static void
midori_preferences_response_cb (MidoriPreferences* preferences,
gint response)
{
if (response == GTK_RESPONSE_CLOSE)
gtk_widget_destroy (GTK_WIDGET (preferences));
}
static void
midori_preferences_init (MidoriPreferences* preferences)
{
gchar* dialog_title;
preferences->notebook = NULL;
gchar* dialog_title = g_strdup_printf (_("%s Preferences"),
g_get_application_name ());
dialog_title = g_strdup_printf (_("%s Preferences"),
g_get_application_name ());
g_object_set (preferences,
"icon-name", GTK_STOCK_PREFERENCES,
"title", dialog_title,
@ -80,11 +90,8 @@ midori_preferences_init (MidoriPreferences* preferences)
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
/* TODO: Implement some kind of help function */
gtk_dialog_set_response_sensitive (GTK_DIALOG (preferences),
GTK_RESPONSE_HELP, FALSE);
g_signal_connect (preferences, "response",
G_CALLBACK (gtk_widget_destroy), preferences);
G_CALLBACK (midori_preferences_response_cb), NULL);
/* TODO: Do we want tooltips for explainations or can we omit that? */
g_free (dialog_title);