Connect Help in Preferences to HelpContents
This commit is contained in:
parent
8953a9b26b
commit
5eb74b6bf3
2 changed files with 24 additions and 6 deletions
|
@ -1428,6 +1428,15 @@ midori_browser_menu_trash_activate_cb (GtkWidget* widget,
|
||||||
SOKOKE_MENU_POSITION_RIGHT);
|
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
|
static void
|
||||||
_action_preferences_activate (GtkAction* action,
|
_action_preferences_activate (GtkAction* action,
|
||||||
MidoriBrowser* browser)
|
MidoriBrowser* browser)
|
||||||
|
@ -1440,6 +1449,8 @@ _action_preferences_activate (GtkAction* action,
|
||||||
{
|
{
|
||||||
dialog = midori_preferences_new (GTK_WINDOW (browser),
|
dialog = midori_preferences_new (GTK_WINDOW (browser),
|
||||||
browser->settings);
|
browser->settings);
|
||||||
|
g_signal_connect (dialog, "response",
|
||||||
|
G_CALLBACK (midori_preferences_response_help_cb), browser);
|
||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,12 +64,22 @@ midori_preferences_class_init (MidoriPreferencesClass* class)
|
||||||
G_PARAM_WRITABLE));
|
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
|
static void
|
||||||
midori_preferences_init (MidoriPreferences* preferences)
|
midori_preferences_init (MidoriPreferences* preferences)
|
||||||
{
|
{
|
||||||
|
gchar* dialog_title;
|
||||||
|
|
||||||
preferences->notebook = NULL;
|
preferences->notebook = NULL;
|
||||||
|
|
||||||
gchar* dialog_title = g_strdup_printf (_("%s Preferences"),
|
dialog_title = g_strdup_printf (_("%s Preferences"),
|
||||||
g_get_application_name ());
|
g_get_application_name ());
|
||||||
g_object_set (preferences,
|
g_object_set (preferences,
|
||||||
"icon-name", GTK_STOCK_PREFERENCES,
|
"icon-name", GTK_STOCK_PREFERENCES,
|
||||||
|
@ -80,11 +90,8 @@ midori_preferences_init (MidoriPreferences* preferences)
|
||||||
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
|
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
|
||||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
||||||
NULL);
|
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_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? */
|
/* TODO: Do we want tooltips for explainations or can we omit that? */
|
||||||
g_free (dialog_title);
|
g_free (dialog_title);
|
||||||
|
|
Loading…
Reference in a new issue