Commit 9795bf51 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

Remove the user large icons, avoid collissions and merge menus config

Wed Dec 12 23:33:33 2001  George Lebl <jirka@5z.com>

	* basep-widget.c, session.c, panel-config-global.h,
	  gnome-panel-properties.c, panel-global-config.schemas,
	  gnome-panel-properties.glade:  Remove the user large icons,
	  avoid collissions and merge menus config options and keys and
	  all that.  large icons were gone already, merged menus as well,
	  and who would ever want to turn off collision avoidance.  Also
	  fix some memleaks and some cleanups.

	* foobar-widget.c: fix memleaks
parent 0edc6202
Wed Dec 12 23:33:33 2001 George Lebl <jirka@5z.com>
* basep-widget.c, session.c, panel-config-global.h,
gnome-panel-properties.c, panel-global-config.schemas,
gnome-panel-properties.glade: Remove the user large icons,
avoid collissions and merge menus config options and keys and
all that. large icons were gone already, merged menus as well,
and who would ever want to turn off collision avoidance. Also
fix some memleaks and some cleanups.
* foobar-widget.c: fix memleaks
Wed Dec 12 12:47:38 2001 George Lebl <jirka@5z.com>
* foobar-widget.c: reposition menu after hiding an item
......
......@@ -2353,10 +2353,7 @@ basep_border_recalc (int screen)
sb->borders[i].right = 0;
}
/* if not avoiding collisions, keeping things at 0 is a safe bet */
if (global_config.avoid_collisions) {
basep_calculate_borders (screen);
}
sb->left = border_max (sb, BORDER_LEFT);
sb->right = border_max (sb, BORDER_RIGHT);
......
......@@ -696,14 +696,18 @@ add_window (WnckWindow *window, FoobarWidget *foo)
pix_y = gdk_pixbuf_get_height (pb);
if (pix_x > ICON_SIZE || pix_y > ICON_SIZE) {
double greatest;
GdkPixbuf *scaled;
greatest = pix_x > pix_y ? pix_x : pix_y;
pb = gdk_pixbuf_scale_simple (pb,
scaled = gdk_pixbuf_scale_simple (pb,
(ICON_SIZE / greatest) * pix_x,
(ICON_SIZE / greatest) * pix_y,
GDK_INTERP_BILINEAR);
}
image = gtk_image_new_from_pixbuf (scaled);
gdk_pixbuf_unref (scaled);
} else {
image = gtk_image_new_from_pixbuf (pb);
}
gtk_widget_show (image);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item),
GTK_WIDGET (image));
......@@ -808,14 +812,18 @@ set_das_pixmap (FoobarWidget *foo, WnckWindow *window)
pix_y = gdk_pixbuf_get_height (pb);
if (pix_x > ICON_SIZE || pix_y > ICON_SIZE) {
double greatest;
GdkPixbuf *scaled;
greatest = pix_x > pix_y ? pix_x : pix_y;
pb = gdk_pixbuf_scale_simple (pb,
scaled = gdk_pixbuf_scale_simple (pb,
(ICON_SIZE / greatest) * pix_x,
(ICON_SIZE / greatest) * pix_y,
GDK_INTERP_BILINEAR);
}
foo->task_image = gtk_image_new_from_pixbuf (scaled);
gdk_pixbuf_unref (scaled);
} else {
foo->task_image = gtk_image_new_from_pixbuf (pb);
}
gtk_widget_show (foo->task_image);
gtk_container_add (GTK_CONTAINER (foo->task_bin),
......
......@@ -231,12 +231,12 @@ entry_changed (GtkWidget *widget, gpointer data)
}
static void
load_checkboxes()
load_checkboxes (void)
{
gchar* checkboxes[] = {"drawer-autoclose", "auto-raise-panel",
"confirm-panel-remove", "avoid-panel-overlap",
"keep-menus-in-memory", "enable-animations",
"enable-key-bindings", "auto-update-menus", NULL };
"confirm-panel-remove", "keep-menus-in-memory",
"enable-animations", "enable-key-bindings",
"auto-update-menus", NULL };
int i = 0;
while(checkboxes[i]!=NULL){
......@@ -257,7 +257,7 @@ load_checkboxes()
}
static void
load_option_menus()
load_option_menus (void)
{
gchar *optionmenus[] = {"panel-animation-speed", "panel-window-layer",
NULL };
......@@ -271,15 +271,17 @@ load_option_menus()
key = g_strdup_printf("/apps/panel/global/%s",optionmenus[i]);
gtk_option_menu_set_history(GTK_OPTION_MENU(option),
gconf_client_get_int(gconf_client,key,NULL));
g_signal_connect(G_OBJECT(option),"changed",
G_CALLBACK(option_menu_changed),key);
g_signal_connect_data (G_OBJECT (option), "changed",
G_CALLBACK (option_menu_changed),
key,
(GClosureNotify)g_free,
0 /* connect_flags */);
i++;
/*g_free(key);*/
}
}
static void
load_spin_buttons()
load_spin_buttons (void)
{
/* keep the spin buttons and their associated adjustment in sync */
gchar *spinbuttons[] = {"panel-hide-delay", "panel-show-delay", NULL };
......@@ -300,10 +302,12 @@ load_spin_buttons()
key = g_strdup_printf("/apps/panel/global/%s",spinbuttons[i]);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button),
(double)gconf_client_get_int(gconf_client, key, NULL));
g_signal_connect(G_OBJECT(spin_button),"value-changed",
G_CALLBACK(spin_button_changed), key);
g_signal_connect_data (G_OBJECT (spin_button), "value-changed",
G_CALLBACK (spin_button_changed),
key,
(GClosureNotify)g_free,
0 /* connect_flags */);
i++;
/*g_free(key);*/
}
}
......@@ -325,10 +329,13 @@ load_key_bindings()
button = glade_xml_get_widget(glade_gui, button_name);
g_signal_connect(G_OBJECT(button),"clicked",
G_CALLBACK(grab_button_pressed), entry);
g_signal_connect(G_OBJECT(entry),"changed",
G_CALLBACK(entry_changed),key);
g_signal_connect_data (G_OBJECT (entry), "changed",
G_CALLBACK (entry_changed),
key,
(GClosureNotify)g_free,
0 /* connect_flags */);
i++;
/*g_free(button_name);*/
g_free (button_name);
}
}
......
......@@ -231,12 +231,12 @@ entry_changed (GtkWidget *widget, gpointer data)
}
static void
load_checkboxes()
load_checkboxes (void)
{
gchar* checkboxes[] = {"drawer-autoclose", "auto-raise-panel",
"confirm-panel-remove", "avoid-panel-overlap",
"keep-menus-in-memory", "enable-animations",
"enable-key-bindings", "auto-update-menus", NULL };
"confirm-panel-remove", "keep-menus-in-memory",
"enable-animations", "enable-key-bindings",
"auto-update-menus", NULL };
int i = 0;
while(checkboxes[i]!=NULL){
......@@ -257,7 +257,7 @@ load_checkboxes()
}
static void
load_option_menus()
load_option_menus (void)
{
gchar *optionmenus[] = {"panel-animation-speed", "panel-window-layer",
NULL };
......@@ -271,15 +271,17 @@ load_option_menus()
key = g_strdup_printf("/apps/panel/global/%s",optionmenus[i]);
gtk_option_menu_set_history(GTK_OPTION_MENU(option),
gconf_client_get_int(gconf_client,key,NULL));
g_signal_connect(G_OBJECT(option),"changed",
G_CALLBACK(option_menu_changed),key);
g_signal_connect_data (G_OBJECT (option), "changed",
G_CALLBACK (option_menu_changed),
key,
(GClosureNotify)g_free,
0 /* connect_flags */);
i++;
/*g_free(key);*/
}
}
static void
load_spin_buttons()
load_spin_buttons (void)
{
/* keep the spin buttons and their associated adjustment in sync */
gchar *spinbuttons[] = {"panel-hide-delay", "panel-show-delay", NULL };
......@@ -300,10 +302,12 @@ load_spin_buttons()
key = g_strdup_printf("/apps/panel/global/%s",spinbuttons[i]);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button),
(double)gconf_client_get_int(gconf_client, key, NULL));
g_signal_connect(G_OBJECT(spin_button),"value-changed",
G_CALLBACK(spin_button_changed), key);
g_signal_connect_data (G_OBJECT (spin_button), "value-changed",
G_CALLBACK (spin_button_changed),
key,
(GClosureNotify)g_free,
0 /* connect_flags */);
i++;
/*g_free(key);*/
}
}
......@@ -325,10 +329,13 @@ load_key_bindings()
button = glade_xml_get_widget(glade_gui, button_name);
g_signal_connect(G_OBJECT(button),"clicked",
G_CALLBACK(grab_button_pressed), entry);
g_signal_connect(G_OBJECT(entry),"changed",
G_CALLBACK(entry_changed),key);
g_signal_connect_data (G_OBJECT (entry), "changed",
G_CALLBACK (entry_changed),
key,
(GClosureNotify)g_free,
0 /* connect_flags */);
i++;
/*g_free(button_name);*/
g_free (button_name);
}
}
......
......@@ -138,20 +138,6 @@ Keep panels above other windows
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>avoid-panel-overlap</name>
<can_focus>True</can_focus>
<label>_Try to avoid overlapping panels</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>keep-menus-in-memory</name>
......
......@@ -32,9 +32,6 @@ struct _GlobalConfig {
guint window_screenshot_keysym; /* these are not really properties */
guint window_screenshot_state; /* but from the above */
int menu_flags;
gboolean use_large_icons;
gboolean merge_menus;
gboolean avoid_collisions;
gboolean menu_check;
};
......
......@@ -30,18 +30,6 @@ Panel Global Config Schema File - work in progress
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/use-large-icons</key>
<applyto>/apps/panel/global/use-large-icons</applyto>
<owner>panel</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/auto-update-menus</key>
<applyto>/apps/panel/global/auto-update-menus</applyto>
......@@ -234,18 +222,6 @@ Panel Global Config Schema File - work in progress
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/avoid-panel-overlap</key>
<applyto>/apps/panel/global/avoid-panel-overlap</applyto>
<owner>panel</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/clock-format</key>
<applyto>/apps/panel/global/clock-format</applyto>
......
......@@ -30,18 +30,6 @@ Panel Global Config Schema File - work in progress
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/use-large-icons</key>
<applyto>/apps/panel/global/use-large-icons</applyto>
<owner>panel</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/auto-update-menus</key>
<applyto>/apps/panel/global/auto-update-menus</applyto>
......@@ -234,18 +222,6 @@ Panel Global Config Schema File - work in progress
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/avoid-panel-overlap</key>
<applyto>/apps/panel/global/avoid-panel-overlap</applyto>
<owner>panel</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/clock-format</key>
<applyto>/apps/panel/global/clock-format</applyto>
......
......@@ -30,18 +30,6 @@ Panel Global Config Schema File - work in progress
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/use-large-icons</key>
<applyto>/apps/panel/global/use-large-icons</applyto>
<owner>panel</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/auto-update-menus</key>
<applyto>/apps/panel/global/auto-update-menus</applyto>
......@@ -234,18 +222,6 @@ Panel Global Config Schema File - work in progress
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/avoid-panel-overlap</key>
<applyto>/apps/panel/global/avoid-panel-overlap</applyto>
<owner>panel</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/clock-format</key>
<applyto>/apps/panel/global/clock-format</applyto>
......
......@@ -30,18 +30,6 @@ Panel Global Config Schema File - work in progress
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/use-large-icons</key>
<applyto>/apps/panel/global/use-large-icons</applyto>
<owner>panel</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/auto-update-menus</key>
<applyto>/apps/panel/global/auto-update-menus</applyto>
......@@ -234,18 +222,6 @@ Panel Global Config Schema File - work in progress
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/avoid-panel-overlap</key>
<applyto>/apps/panel/global/avoid-panel-overlap</applyto>
<owner>panel</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short></short>
<long></long>
</locale>
</schema>
<schema>
<key>/schemas/apps/panel/global/clock-format</key>
<applyto>/apps/panel/global/clock-format</applyto>
......
......@@ -91,10 +91,7 @@ apply_global_config (void)
{
static int layer_old = -1;
static int menu_flags_old = -1;
static int old_use_large_icons = -1;
static int old_merge_menus = -1;
static int old_menu_check = -1;
static int old_avoid_collisions = -1;
GSList *li;
if (global_config.tooltips_enabled)
......@@ -103,16 +100,10 @@ apply_global_config (void)
gtk_tooltips_disable (panel_tooltips);
/* not incredibly efficent way to do this, we just make
* sure that all directories are reread */
if (old_merge_menus != global_config.merge_menus ||
old_menu_check != global_config.menu_check) {
fr_force_reread();
}
/*if we changed small_icons mark all menus as dirty
for rereading, hopefullly the user doesn't do this too often
so that he doesn't have to reread his menus all the time:)*/
if( old_use_large_icons != global_config.use_large_icons ||
old_merge_menus != global_config.merge_menus ||
old_menu_check != global_config.menu_check) {
if (old_menu_check != global_config.menu_check) {
fr_force_reread ();
}
if(old_menu_check != global_config.menu_check) {
GSList *li;
for(li = applets; li != NULL; li = g_slist_next(li)) {
AppletInfo *info = li->data;
......@@ -140,8 +131,6 @@ apply_global_config (void)
}
foobar_widget_force_menu_remake();
}
old_use_large_icons = global_config.use_large_icons;
old_merge_menus = global_config.merge_menus;
old_menu_check = global_config.menu_check;
/* if we changed global menu flags, cmark all main menus that use
......@@ -191,13 +180,6 @@ apply_global_config (void)
}
menu_flags_old = global_config.menu_flags;
if (old_avoid_collisions != global_config.avoid_collisions) {
int i;
for (i = 0; i < multiscreen_screens (); i++)
basep_border_queue_recalc (i);
}
old_avoid_collisions = global_config.avoid_collisions;
panel_global_keys_setup();
}
......@@ -1365,16 +1347,16 @@ load_system_wide (void)
void
session_read_global_config (void)
{
GSList *l;
GSList *li, *list;
l = panel_gconf_all_global_entries ();
list = panel_gconf_all_global_entries ();
for (; l ; l = l->next) {
for (li = list; li != NULL ; li = li->next) {
GConfEntry *entry;
GConfValue *value;
gchar *key;
entry = (GConfEntry *)l->data;
entry = (GConfEntry *)li->data;
value = gconf_entry_get_value (entry);
......@@ -1493,26 +1475,20 @@ session_read_global_config (void)
&global_config.window_screenshot_keysym,
&global_config.window_screenshot_state);
} else if (!strcmp (key, "use-large-icons"))
global_config.use_large_icons =
gconf_value_get_bool (value);
else if (!strcmp (key, "avoid-panel-overlap"))
global_config.avoid_collisions =
gconf_value_get_bool (value);
else
} else {
g_warning ("%s not handled", key);
}
g_free (key);
gconf_entry_free (l->data);
gconf_entry_free (entry);
}
g_slist_free (l);
g_slist_free (list);
/* FIXME STUFF THAT IS BORKED */
global_config.merge_menus = TRUE;
global_config.menu_check = TRUE;
global_config.menu_flags = get_default_menu_flags();
g_print ("Got flags: %d\n", global_config.menu_flags);
apply_global_config ();
}
......@@ -1528,7 +1504,6 @@ session_write_global_config (void)
/* FIXME STUFF THAT IS BORKED
panel_gconf_global_config_set_int ("menu-flags", global_config.menu_flags);
panel_gconf_global_config_set_bool ("merge-menus", global_config.merge_menus);
panel_gconf_global_config_set_bool ("menu-check", global_config.menu_check);
*/
......@@ -1539,14 +1514,12 @@ session_write_global_config (void)
gconf_change_set_set_int (global_config_cs, "panel-window-layer", global_config.layer);
gconf_change_set_set_bool (global_config_cs, "tooltips-enabled", global_config.tooltips_enabled);
gconf_change_set_set_bool (global_config_cs, "use-large-icons", global_config.use_large_icons);
gconf_change_set_set_bool (global_config_cs, "enable-animations", global_config.enable_animations);
gconf_change_set_set_bool (global_config_cs, "autoraise-panel", global_config.autoraise);
gconf_change_set_set_bool (global_config_cs, "drawer-autoclose", global_config.drawer_auto_close);
gconf_change_set_set_bool (global_config_cs, "highlight-launchers-on-mouseover", global_config.highlight_when_over);
gconf_change_set_set_bool (global_config_cs, "confirm-panel-remove", global_config.confirm_panel_remove);
gconf_change_set_set_bool (global_config_cs, "keep-menus-in-memory", global_config.keep_menus_in_memory);
gconf_change_set_set_bool (global_config_cs, "avoid-panel-overlap", global_config.avoid_collisions);
gconf_change_set_set_string (global_config_cs, "menu-key", global_config.menu_key);
gconf_change_set_set_string (global_config_cs, "run-key", global_config.run_key);
......
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