Commit 35c1e88f authored by Manish Singh's avatar Manish Singh Committed by Manish Singh
Browse files

added gboolean can_change_accels

2003-04-01  Manish Singh  <yosh@gimp.org>

        * config/gimpguiconfig.[ch]: added gboolean can_change_accels

        * config/gimprc-blurbs.h: blurb for the above

        * gui/preferences-dialog.c: UI for the above. Has warning about
        not working in GNOME2 yet (pending resolution of Bug #109653)

        * gui/menus.c: use can_change_accels. It simply parses the rc
        string gtk-can-change-accels = [0|1] depending on the state
        of can_change_accels in the gui config.

        * etc/gimprc
        * docs/gimprc-1.3.5.in: regenerated
parent 06f25b1c
2003-04-01 Manish Singh <yosh@gimp.org>
* config/gimpguiconfig.[ch]: added gboolean can_change_accels
* config/gimprc-blurbs.h: blurb for the above
* gui/preferences-dialog.c: UI for the above. Has warning about
not working in GNOME2 yet (pending resolution of Bug #109653)
* gui/menus.c: use can_change_accels. It simply parses the rc
string gtk-can-change-accels = [0|1] depending on the state
of can_change_accels in the gui config.
* etc/gimprc
* docs/gimprc-1.3.5.in: regenerated
2003-04-01 Sven Neumann <sven@gimp.org>
 
* app/text/gimptext-compat.c (text_render): strip the size from
......@@ -65,6 +65,7 @@ enum
PROP_SHOW_TIPS,
PROP_SHOW_TOOL_TIPS,
PROP_TEAROFF_MENUS,
PROP_CAN_CHANGE_ACCELS,
PROP_LAST_OPENED_SIZE,
PROP_MAX_NEW_IMAGE_SIZE,
PROP_THEME_PATH,
......@@ -165,6 +166,10 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
"tearoff-menus", TEAROFF_MENUS_BLURB,
TRUE,
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CAN_CHANGE_ACCELS,
"can-change-accels", CAN_CHANGE_ACCELS_BLURB,
FALSE,
0);
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_LAST_OPENED_SIZE,
"last-opened-size", LAST_OPENED_SIZE_BLURB,
0, 1024, 4,
......@@ -252,6 +257,9 @@ gimp_gui_config_set_property (GObject *object,
case PROP_TEAROFF_MENUS:
gui_config->tearoff_menus = g_value_get_boolean (value);
break;
case PROP_CAN_CHANGE_ACCELS:
gui_config->can_change_accels = g_value_get_boolean (value);
break;
case PROP_LAST_OPENED_SIZE:
gui_config->last_opened_size = g_value_get_int (value);
break;
......@@ -324,6 +332,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_TEAROFF_MENUS:
g_value_set_boolean (value, gui_config->tearoff_menus);
break;
case PROP_CAN_CHANGE_ACCELS:
g_value_set_boolean (value, gui_config->can_change_accels);
break;
case PROP_LAST_OPENED_SIZE:
g_value_set_int (value, gui_config->last_opened_size);
break;
......
......@@ -51,6 +51,7 @@ struct _GimpGuiConfig
gboolean show_tips;
gboolean show_tool_tips;
gboolean tearoff_menus;
gboolean can_change_accels;
gint last_opened_size;
gulong max_new_image_size;
gchar *theme_path;
......
......@@ -270,19 +270,22 @@ N_("Sets the swap file location. The gimp uses a tile based memory " \
"a directory that is mounted over NFS. For these reasons, it may " \
"be desirable to put your swap file in \"/tmp\".")
#define TEAROFF_MENUS_BLURB \
#define TEAROFF_MENUS_BLURB \
N_("When enabled, menus can be torn off.")
#define CAN_CHANGE_ACCELS_BLURB \
N_("When enabled, you can change keyboard shortcuts for menu items on the fly.")
#define TEMP_PATH_BLURB \
N_("Sets the temporary storage directory. Files will appear here " \
"during the course of running the GIMP. Most files will disappear " \
"when the GIMP exits, but some files are likely to remain, so it is " \
"best if this directory not be one that is shared by other users.")
#define THEME_BLURB \
#define THEME_BLURB \
"The name of the theme to use."
#define THEME_PATH_BLURB \
#define THEME_PATH_BLURB \
"Sets the theme search path."
#define THUMBNAIL_SIZE_BLURB \
......
......@@ -1124,6 +1124,10 @@ prefs_dialog_new (Gimp *gimp,
_("Enable _Tearoff Menus"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "can-change-accels",
_("Dynamic _Keyboard Shortcuts (does not work in GNOME2 yet)"),
GTK_BOX (vbox2));
/* Window Positions */
vbox2 = prefs_frame_new (_("Window Positions"), GTK_CONTAINER (vbox), FALSE);
......
......@@ -72,6 +72,8 @@ static void menus_last_opened_reorder (GimpContainer *container,
gint unused2,
GimpItemFactory *item_factory);
static void menu_can_change_accels (GimpGuiConfig *config);
/* global variables */
......@@ -95,6 +97,11 @@ menus_init (Gimp *gimp)
menus_initialized = TRUE;
g_signal_connect (gimp->config, "notify::can-change-accels",
G_CALLBACK (menu_can_change_accels), NULL);
menu_can_change_accels (GIMP_GUI_CONFIG (gimp->config));
global_menu_factory = gimp_menu_factory_new (gimp);
gimp_menu_factory_menu_register (global_menu_factory,
......@@ -236,6 +243,10 @@ menus_exit (Gimp *gimp)
g_object_unref (global_menu_factory);
global_menu_factory = NULL;
g_signal_handlers_disconnect_by_func (gimp->config,
menu_can_change_accels,
NULL);
}
void
......@@ -422,3 +433,16 @@ menus_last_opened_reorder (GimpContainer *container,
{
menus_last_opened_update (container, unused1, item_factory);
}
static void
menu_can_change_accels (GimpGuiConfig *config)
{
gchar *rc_string;
rc_string = g_strdup_printf ("gtk-can-change-accels = %s",
config->can_change_accels ? "1" : "0");
gtk_rc_parse_string (rc_string);
g_free (rc_string);
}
......@@ -1124,6 +1124,10 @@ prefs_dialog_new (Gimp *gimp,
_("Enable _Tearoff Menus"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "can-change-accels",
_("Dynamic _Keyboard Shortcuts (does not work in GNOME2 yet)"),
GTK_BOX (vbox2));
/* Window Positions */
vbox2 = prefs_frame_new (_("Window Positions"), GTK_CONTAINER (vbox), FALSE);
......
......@@ -72,6 +72,8 @@ static void menus_last_opened_reorder (GimpContainer *container,
gint unused2,
GimpItemFactory *item_factory);
static void menu_can_change_accels (GimpGuiConfig *config);
/* global variables */
......@@ -95,6 +97,11 @@ menus_init (Gimp *gimp)
menus_initialized = TRUE;
g_signal_connect (gimp->config, "notify::can-change-accels",
G_CALLBACK (menu_can_change_accels), NULL);
menu_can_change_accels (GIMP_GUI_CONFIG (gimp->config));
global_menu_factory = gimp_menu_factory_new (gimp);
gimp_menu_factory_menu_register (global_menu_factory,
......@@ -236,6 +243,10 @@ menus_exit (Gimp *gimp)
g_object_unref (global_menu_factory);
global_menu_factory = NULL;
g_signal_handlers_disconnect_by_func (gimp->config,
menu_can_change_accels,
NULL);
}
void
......@@ -422,3 +433,16 @@ menus_last_opened_reorder (GimpContainer *container,
{
menus_last_opened_update (container, unused1, item_factory);
}
static void
menu_can_change_accels (GimpGuiConfig *config)
{
gchar *rc_string;
rc_string = g_strdup_printf ("gtk-can-change-accels = %s",
config->can_change_accels ? "1" : "0");
gtk_rc_parse_string (rc_string);
g_free (rc_string);
}
......@@ -157,6 +157,12 @@ palette path. This is a string value.
Specify a default gradient. The gradient is searched for in the specified
gradient path. This is a string value.
.TP
(default-font "Sans")
Specify a default font. The font is searched for in the fontconfig font path.
This is a string value.
.TP
(default-comment "Created with The GIMP")
......@@ -565,6 +571,12 @@ Enable to display tooltips. Possible values are yes and no.
When enabled, menus can be torn off. Possible values are yes and no.
.TP
(can-change-accels no)
When enabled, you can change keyboard shortcuts for menu items on the fly.
Possible values are yes and no.
.TP
(last-opened-size 4)
......
......@@ -157,6 +157,12 @@ palette path. This is a string value.
Specify a default gradient. The gradient is searched for in the specified
gradient path. This is a string value.
.TP
(default-font "Sans")
Specify a default font. The font is searched for in the fontconfig font path.
This is a string value.
.TP
(default-comment "Created with The GIMP")
......@@ -565,6 +571,12 @@ Enable to display tooltips. Possible values are yes and no.
When enabled, menus can be torn off. Possible values are yes and no.
.TP
(can-change-accels no)
When enabled, you can change keyboard shortcuts for menu items on the fly.
Possible values are yes and no.
.TP
(last-opened-size 4)
......
......@@ -117,6 +117,11 @@
#
# (default-gradient "FG to BG (RGB)")
# Specify a default font. The font is searched for in the fontconfig font
# path. This is a string value.
#
# (default-font "Sans")
# Sets the default comment. This is a string value.
#
# (default-comment "Created with The GIMP")
......@@ -433,6 +438,11 @@
#
# (tearoff-menus yes)
# When enabled, you can change keyboard shortcuts for menu items on the fly.
# Possible values are yes and no.
#
# (can-change-accels no)
# How many recently opened image filenames to keep on the File menu. This is
# an integer value.
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment