Commit 31f2aebd authored by Nick Schermer's avatar Nick Schermer

Add Help button and make existing buttons work with wiki.

parent 96e594d6
......@@ -80,8 +80,8 @@ XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.20.0])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.24.0])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.24.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.8.0])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
XDT_CHECK_PACKAGE([LIBXFCE4KBD_PRIVATE], [libxfce4kbd-private-2], [4.8.0])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.9.0])
XDT_CHECK_PACKAGE([LIBXFCE4KBD_PRIVATE], [libxfce4kbd-private-2], [4.9.0])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.8.0])
XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.34])
XDT_CHECK_PACKAGE([FONTCONFIG], [fontconfig], [2.6.0])
......
......@@ -819,6 +819,22 @@ next time you login</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -830,6 +846,7 @@ next time you login</property>
</child>
<action-widgets>
<action-widget response="0">button2</action-widget>
<action-widget response="-11">button1</action-widget>
</action-widgets>
</object>
</interface>
......@@ -159,6 +159,18 @@ accessibility_settings_dialog_configure_widgets (GtkBuilder *builder)
static void
accessibility_settings_dialog_response (GtkWidget *dialog,
gint response_id)
{
if (response_id == GTK_RESPONSE_HELP)
xfce_dialog_show_help (GTK_WINDOW (dialog), "xfce4-settings", "accessibility", NULL);
else
gtk_main_quit ();
}
gint
main (gint argc, gchar **argv)
{
......@@ -234,15 +246,14 @@ main (gint argc, gchar **argv)
/* Get the dialog widget */
dialog = gtk_builder_get_object (builder, "dialog");
gtk_widget_show (GTK_WIDGET (dialog));
g_signal_connect (dialog, "response", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (accessibility_settings_dialog_response), NULL);
gtk_window_present (GTK_WINDOW (dialog));
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
gtk_main ();
gtk_widget_destroy (GTK_WIDGET (dialog));
}
else
{
......
......@@ -10,4 +10,4 @@ Categories=X-XFCE;Settings;DesktopSettings;X-XfceSettingsDialog;
StartupNotify=true
OnlyShowIn=XFCE;
X-XfcePluggable=true
X-XfceHelpFile=xfce4-settings.html
X-XfceHelpPage=accessibility
......@@ -610,6 +610,22 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -621,6 +637,7 @@
</child>
<action-widgets>
<action-widget response="0">button1</action-widget>
<action-widget response="-11">button2</action-widget>
</action-widgets>
</object>
</interface>
......@@ -20,7 +20,7 @@
#include <config.h>
#endif
static const gchar *rgba_image_none_xpm[] =
static const gchar *rgba_image_none_xpm[] =
{
"18 15 1 1",
" c None",
......@@ -41,7 +41,7 @@ static const gchar *rgba_image_none_xpm[] =
" "
};
static const gchar *rgba_image_rgb_xpm[] =
static const gchar *rgba_image_rgb_xpm[] =
{
"18 15 4 1",
" c None",
......@@ -65,7 +65,7 @@ static const gchar *rgba_image_rgb_xpm[] =
".....+++++@@@@@ "
};
static const gchar *rgba_image_bgr_xpm[] =
static const gchar *rgba_image_bgr_xpm[] =
{
"18 15 4 1",
" c None",
......@@ -89,7 +89,7 @@ static const gchar *rgba_image_bgr_xpm[] =
".....+++++@@@@@ "
};
static const gchar *rgba_image_vrgb_xpm[] =
static const gchar *rgba_image_vrgb_xpm[] =
{
"18 15 4 1",
" c None",
......@@ -113,7 +113,7 @@ static const gchar *rgba_image_vrgb_xpm[] =
"@@@@@@@@@@@@@@@ "
};
static const gchar *rgba_image_vbgr_xpm[] =
static const gchar *rgba_image_vbgr_xpm[] =
{
"18 15 4 1",
" c None",
......
......@@ -935,8 +935,18 @@ appearance_settings_dialog_configure_widgets (GtkBuilder *builder)
#endif
}
static void
appearance_settings_dialog_response (GtkWidget *dialog,
gint response_id)
{
if (response_id == GTK_RESPONSE_HELP)
xfce_dialog_show_help (GTK_WINDOW (dialog), "xfce4-settings", "appearance", NULL);
else
gtk_main_quit ();
}
gint
main(gint argc, gchar **argv)
main (gint argc, gchar **argv)
{
GObject *dialog, *plug_child;
GtkWidget *plug;
......@@ -1013,15 +1023,14 @@ main(gint argc, gchar **argv)
/* build the dialog */
dialog = gtk_builder_get_object (builder, "dialog");
gtk_widget_show (GTK_WIDGET (dialog));
g_signal_connect (dialog, "response", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (appearance_settings_dialog_response), NULL);
gtk_window_present (GTK_WINDOW (dialog));
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
gtk_main ();
gtk_widget_destroy (GTK_WIDGET (dialog));
}
else
{
......
......@@ -10,4 +10,4 @@ Categories=X-XFCE;Settings;DesktopSettings;X-XfceSettingsDialog;
StartupNotify=true
OnlyShowIn=XFCE;
X-XfcePluggable=true
X-XfceHelpFile=xfce4-settings.html
X-XfceHelpPage=appearance
......@@ -179,9 +179,6 @@
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkButton" id="button-close">
<property name="label">gtk-close</property>
......@@ -196,6 +193,22 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button-help">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -207,6 +220,7 @@
</child>
<action-widgets>
<action-widget response="0">button-close</action-widget>
<action-widget response="-11">button-help</action-widget>
</action-widgets>
</object>
</interface>
......@@ -43,7 +43,7 @@ struct Vendor
};
/* This list of vendor codes derived from lshw
*
*
* http://ezix.org/project/wiki/HardwareLiSter
*
* Note: we now prefer to use data coming from hwdata (and shipped with
......@@ -51,7 +51,7 @@ struct Vendor
* http://git.fedorahosted.org/git/?p=hwdata.git;a=blob_plain;f=pnp.ids;hb=HEAD
* All contributions to the list of vendors should go there.
*/
static const struct Vendor vendors[] =
static const struct Vendor vendors[] =
{
{ "AIC", "AG Neovo" },
{ "ACR", "Acer" },
......@@ -284,7 +284,7 @@ make_display_name (const MonitorInfo *info)
width_mm = -1;
height_mm = -1;
}
if (width_mm != -1 && height_mm != -1)
{
double d = sqrt (width_mm * width_mm + height_mm * height_mm);
......
......@@ -42,7 +42,7 @@ static int
get_bits (int in, int begin, int end)
{
int mask = (1 << (end - begin + 1)) - 1;
return (in >> begin) & mask;
}
......@@ -58,14 +58,14 @@ static int
decode_vendor_and_product_identification (const uchar *edid, MonitorInfo *info)
{
int is_model_year;
/* Manufacturer Code */
info->manufacturer_code[0] = get_bits (edid[0x08], 2, 6);
info->manufacturer_code[1] = get_bits (edid[0x08], 0, 1) << 3;
info->manufacturer_code[1] |= get_bits (edid[0x09], 5, 7);
info->manufacturer_code[2] = get_bits (edid[0x09], 0, 4);
info->manufacturer_code[3] = '\0';
info->manufacturer_code[0] += 'A' - 1;
info->manufacturer_code[1] += 'A' - 1;
info->manufacturer_code[2] += 'A' - 1;
......@@ -127,7 +127,7 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
if (info->is_digital)
{
int bits;
static const int bit_depth[8] =
{
-1, 6, 8, 10, 12, 14, 16, -1
......@@ -142,7 +142,7 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
info->connector.digital.bits_per_primary = bit_depth[bits];
bits = get_bits (edid[0x14], 0, 3);
if (bits <= 5)
info->connector.digital.interface = interfaces[bits];
else
......@@ -151,7 +151,7 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
else
{
int bits = get_bits (edid[0x14], 5, 6);
static const double levels[][3] =
{
{ 0.7, 0.3, 1.0 },
......@@ -183,7 +183,7 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
else if (edid[0x16] == 0)
{
info->width_mm = -1;
info->height_mm = -1;
info->height_mm = -1;
info->aspect_ratio = 100.0 / (edid[0x15] + 99);
}
else if (edid[0x15] == 0)
......@@ -271,7 +271,7 @@ decode_color_characteristics (const uchar *edid, MonitorInfo *info)
static int
decode_established_timings (const uchar *edid, MonitorInfo *info)
{
static const Timing established[][8] =
static const Timing established[][8] =
{
{
{ 800, 600, 60 },
......@@ -325,7 +325,7 @@ static int
decode_standard_timings (const uchar *edid, MonitorInfo *info)
{
int i;
for (i = 0; i < 8; i++)
{
int first = edid[0x26 + 2 * i];
......@@ -349,7 +349,7 @@ decode_standard_timings (const uchar *edid, MonitorInfo *info)
info->standard[i].frequency = get_bits (second, 0, 5) + 60;
}
}
return TRUE;
}
......@@ -425,7 +425,7 @@ decode_detailed_timing (const uchar *timing,
TWO_WAY_RIGHT_ON_EVEN, TWO_WAY_LEFT_ON_EVEN,
FOUR_WAY_INTERLEAVED, SIDE_BY_SIDE
};
detailed->pixel_clock = (timing[0x00] | timing[0x01] << 8) * 10000;
detailed->h_addr = timing[0x02] | ((timing[0x04] & 0xf0) << 4);
detailed->h_blank = timing[0x03] | ((timing[0x04] & 0x0f) << 8);
......@@ -482,9 +482,9 @@ decode_descriptors (const uchar *edid, MonitorInfo *info)
{
int i;
int timing_idx;
timing_idx = 0;
for (i = 0; i < 4; ++i)
{
int idx = 0x36 + i * 18;
......@@ -524,7 +524,7 @@ decode_edid (const uchar *edid)
MonitorInfo *info = g_new0 (MonitorInfo, 1);
decode_check_sum (edid, info);
if (decode_header (edid)
&& decode_vendor_and_product_identification (edid, info)
&& decode_edid_version (edid, info)
......
/* edid.h
*
* Copyright 2007, 2008, Red Hat, Inc.
*
*
* This file is part of the Gnome Library.
*
*
* The Gnome Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
......@@ -13,7 +13,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License along
* with the Gnome Library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
......@@ -112,7 +112,7 @@ struct MonitorInfo
char manufacturer_code[4];
int product_code;
unsigned int serial_number;
int production_week; /* -1 if not specified */
int production_year; /* -1 if not specified */
int model_year; /* -1 if not specified */
......@@ -121,7 +121,7 @@ struct MonitorInfo
int minor_version;
int is_digital;
union
{
struct
......@@ -174,12 +174,12 @@ struct MonitorInfo
Timing established[24]; /* Terminated by 0x0x0 */
Timing standard[8];
int n_detailed_timings;
DetailedTiming detailed_timings[4]; /* If monitor has a preferred
* mode, it is the first one
* (whether it has, is
* determined by the
* determined by the
* preferred_timing_includes
* bit.
*/
......
......@@ -830,7 +830,10 @@ display_settings_dialog_response (GtkDialog *dialog,
gint response_id,
GtkBuilder *builder)
{
gtk_main_quit ();
if (response_id == GTK_RESPONSE_HELP)
xfce_dialog_show_help (GTK_WINDOW (dialog), "xfce4-settings", "display", NULL);
else
gtk_main_quit ();
}
......@@ -1150,10 +1153,11 @@ main (gint argc, gchar **argv)
if (G_UNLIKELY (opt_socket_id == 0))
{
g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (display_settings_dialog_response), builder);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (display_settings_dialog_response), builder);
/* Show the dialog */
gtk_widget_show (dialog);
gtk_window_present (GTK_WINDOW (dialog));
}
else
{
......@@ -1207,7 +1211,8 @@ main (gint argc, gchar **argv)
/* Build the minimal dialog */
dialog = (GtkWidget *) gtk_builder_get_object (builder, "dialog1");
g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (display_settings_minimal_dialog_response), builder);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (display_settings_minimal_dialog_response), builder);
/* Set the radio buttons captions */
first_screen_radio =
......@@ -1232,7 +1237,7 @@ main (gint argc, gchar **argv)
g_free (screen_name);
/* Show the minimal dialog and start the main loop */
gtk_widget_show (dialog);
gtk_window_present (GTK_WINDOW (dialog));
gtk_main ();
}
else
......
......@@ -10,4 +10,4 @@ Categories=X-XFCE;Settings;DesktopSettings;X-XfceSettingsDialog;
StartupNotify=true
OnlyShowIn=XFCE;
X-XfcePluggable=true
X-XfceHelpFile=xfce4-settings.html
X-XfceHelpPage=display
......@@ -127,6 +127,22 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -824,6 +840,7 @@
</child>
<action-widgets>
<action-widget response="0">button2</action-widget>
<action-widget response="-11">button1</action-widget>
</action-widgets>
</object>
<object class="GtkAdjustment" id="net_cursor_blink_time">
......
......@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4ui/libxfce4ui.h>
#include <xfconf/xfconf.h>
#include "xfce-keyboard-settings.h"
......@@ -42,6 +43,18 @@ static GOptionEntry entries[] = {
static void
keyboard_settings_dialog_response (GtkWidget *dialog,
gint response_id)
{
if (response_id == GTK_RESPONSE_HELP)
xfce_dialog_show_help (GTK_WINDOW (dialog), "xfce4-settings", "keyboard", NULL);
else
gtk_main_quit ();
}
int
main (int argc,
char **argv)
......@@ -110,15 +123,14 @@ main (int argc,
dialog = xfce_keyboard_settings_create_dialog (settings);
gtk_window_set_default_size (GTK_WINDOW (dialog), 450, -1);
gtk_widget_show (GTK_WIDGET (dialog));
g_signal_connect (dialog, "response", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (keyboard_settings_dialog_response), NULL);
gtk_window_present (GTK_WINDOW (dialog));
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
gtk_main ();
gtk_widget_destroy (GTK_WIDGET (dialog));
}
else
{
......
......@@ -10,4 +10,4 @@ Categories=X-XFCE;Settings;DesktopSettings;X-XfceSettingsDialog;
StartupNotify=true
OnlyShowIn=XFCE;
X-XfcePluggable=true
X-XfceHelpFile=xfce4-settings.html
X-XfceHelpPage=keyboard
......@@ -1476,6 +1476,18 @@ mouse_settings_create_event_filter (GtkBuilder *builder)
static void
mouse_settings_dialog_response (GtkWidget *dialog,
gint response_id)
{
if (response_id == GTK_RESPONSE_HELP)
xfce_dialog_show_help (GTK_WINDOW (dialog), "xfce4-settings", "mouse", NULL);
else
gtk_main_quit ();
}
gint
main (gint argc, gchar **argv)
{
......@@ -1687,8 +1699,9 @@ main (gint argc, gchar **argv)
/* unlock */
locked--;
gtk_widget_show (GTK_WIDGET (dialog));
g_signal_connect (dialog, "response", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (mouse_settings_dialog_response), NULL);
gtk_window_present (GTK_WINDOW (dialog));
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
......
......@@ -74,6 +74,22 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -1137,6 +1153,7 @@
</child>
<action-widgets>
<action-widget response="0">button1</action-widget>
<action-widget response="-11">button2</action-widget>
</action-widgets>
</object>
<object class="GtkAdjustment" id="theme-cursor-size">
......
......@@ -10,4 +10,4 @@ Categories=X-XFCE;Settings;DesktopSettings;X-XfceSettingsDialog;
StartupNotify=true
OnlyShowIn=XFCE;
X-XfcePluggable=true
X-XfceHelpFile=xfce4-settings.html
X-XfceHelpPage=mouse