[PATCH] for gnomepager and minimized tasks.
- From: bagfors hpc2n umu se
- To: gnome-devel-list gnome org
- Subject: [PATCH] for gnomepager and minimized tasks.
- Date: Wed, 17 Mar 1999 12:21:21 +0100
Hi!
I wanted the option to have ONLY minimized tasks in the gnomepager. This
makes the tasklist act the same as an iconbox. So I added that functionality.
Here is a patch.
/Erik
\|/
-----------------------000-------000----------------------------------
Erik Bagfors | http://www.acc.umu.se/~bagfors
Email: bagfors@acc.umu.se | SysAdmin at HPC2N umea university
bagfors@hpc2n.umu.se | Supporter of free software
Work: +46-90 786 7928 | GSM: +46-70 632 19 06
----------------------------------------------------------------------
*** The light at the end of the tunnel is electric ***
----------------------------------------------------------------------
Index: gnomepager_applet.c
===================================================================
RCS file: /cvs/gnome/gnome-core/applets/gnome-pager/gnomepager_applet.c,v
retrieving revision 1.60
diff -u -r1.60 gnomepager_applet.c
--- gnomepager_applet.c 1999/03/16 08:42:17 1.60
+++ gnomepager_applet.c 1999/03/17 11:14:09
@@ -28,6 +28,7 @@
gint pager_size; /*bool*/
gint tasks_all; /*bool*/
gint minimized_tasks_all; /*bool*/
+ gint minimized_tasks_only; /*bool*/
gint task_rows_h;
gint task_rows_v;
gint max_task_width;
@@ -225,6 +226,16 @@
gtk_table_attach(GTK_TABLE(table), check,
2, 4, 1, 2, GTK_FILL|GTK_EXPAND,0,0,0);
+ check = gtk_check_button_new_with_label(_("Show only minimized tasks"));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), config.minimized_tasks_only);
+ gtk_signal_connect(GTK_OBJECT(check), "toggled",
+ GTK_SIGNAL_FUNC(cb_check), &o_config.minimized_tasks_only);
+ gtk_object_set_data(GTK_OBJECT(check), "prop", prop);
+
+ gtk_widget_show(check);
+ gtk_table_attach(GTK_TABLE(table), check,
+ 2, 4, 2, 3, GTK_FILL|GTK_EXPAND,0,0,0);
+
check = gtk_check_button_new_with_label(_("Show tasks"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), config.show_tasks);
gtk_signal_connect(GTK_OBJECT(check), "toggled",
@@ -232,7 +243,7 @@
gtk_object_set_data(GTK_OBJECT(check), "prop", prop);
gtk_widget_show(check);
gtk_table_attach(GTK_TABLE(table), check,
- 2, 4, 2, 3, GTK_FILL|GTK_EXPAND,0,0,0);
+ 2, 4, 3, 4, GTK_FILL|GTK_EXPAND,0,0,0);
check = gtk_check_button_new_with_label(_("Show pager"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), config.show_pager);
gtk_signal_connect(GTK_OBJECT(check), "toggled",
@@ -240,7 +251,7 @@
gtk_object_set_data(GTK_OBJECT(check), "prop", prop);
gtk_widget_show(check);
gtk_table_attach(GTK_TABLE(table), check,
- 2, 4, 3, 4, GTK_FILL|GTK_EXPAND,0,0,0);
+ 2, 4, 4, 5, GTK_FILL|GTK_EXPAND,0,0,0);
check = gtk_check_button_new_with_label(_("Use small pagers"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), config.pager_size);
gtk_signal_connect(GTK_OBJECT(check), "toggled",
@@ -248,7 +259,7 @@
gtk_object_set_data(GTK_OBJECT(check), "prop", prop);
gtk_widget_show(check);
gtk_table_attach(GTK_TABLE(table), check,
- 2, 4, 4, 5, GTK_FILL|GTK_EXPAND,0,0,0);
+ 2, 4, 5, 6, GTK_FILL|GTK_EXPAND,0,0,0);
check = gtk_check_button_new_with_label(_("Show icons in tasks"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), config.show_icons);
gtk_signal_connect(GTK_OBJECT(check), "toggled",
@@ -256,7 +267,7 @@
gtk_object_set_data(GTK_OBJECT(check), "prop", prop);
gtk_widget_show(check);
gtk_table_attach(GTK_TABLE(table), check,
- 2, 4, 5, 6, GTK_FILL|GTK_EXPAND,0,0,0);
+ 2, 4, 6, 7, GTK_FILL|GTK_EXPAND,0,0,0);
check = gtk_check_button_new_with_label(_("Show task list button"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(check), config.show_arrow);
gtk_signal_connect(GTK_OBJECT(check), "toggled",
@@ -264,7 +275,7 @@
gtk_object_set_data(GTK_OBJECT(check), "prop", prop);
gtk_widget_show(check);
gtk_table_attach(GTK_TABLE(table), check,
- 2, 4, 6, 7, GTK_FILL|GTK_EXPAND,0,0,0);
+ 2, 4, 7, 8, GTK_FILL|GTK_EXPAND,0,0,0);
check = gtk_check_button_new_with_label(_("Tasklist always maximum size"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(check), config.fixed_tasklist);
@@ -273,7 +284,7 @@
gtk_object_set_data(GTK_OBJECT(check), "prop", prop);
gtk_widget_show(check);
gtk_table_attach(GTK_TABLE(table), check,
- 2, 4, 7, 8, GTK_FILL|GTK_EXPAND,0,0,0);
+ 2, 4, 8, 9, GTK_FILL|GTK_EXPAND,0,0,0);
adj = (GtkAdjustment *)gtk_adjustment_new((gfloat)config.max_task_width,
20,
@@ -702,9 +713,11 @@
{
gint i, tdesk;
gchar tsticky;
+ gchar iconified;
tsticky = t->sticky;
tdesk = t->desktop;
+ iconified = t->iconified;
task_get_info(t);
if (tsticky)
@@ -729,6 +742,10 @@
else
desktop_draw(t->desktop);
}
+
+ if (iconified != t->iconified)
+ populate_tasks(FALSE);
+
set_task_info_to_button(t);
widget = NULL;
}
@@ -1286,6 +1303,7 @@
gnome_config_set_int("stuff/pager_size", config.pager_size);
gnome_config_set_int("stuff/tasks_all", config.tasks_all);
gnome_config_set_int("stuff/minimized_tasks_all", config.minimized_tasks_all);
+ gnome_config_set_int("stuff/minimized_tasks_only", config.minimized_tasks_only);
gnome_config_set_int("stuff/task_rows_h", config.task_rows_h);
gnome_config_set_int("stuff/task_rows_v", config.task_rows_v);
gnome_config_set_int("stuff/max_task_width", config.max_task_width);
@@ -1440,6 +1458,7 @@
config.pager_size = gnome_config_get_int("stuff/pager_size=1");
config.tasks_all = gnome_config_get_int("stuff/tasks_all=0");
config.minimized_tasks_all = gnome_config_get_int("stuff/minimized_tasks_all=0");
+ config.minimized_tasks_only = gnome_config_get_int("stuff/minimized_tasks_only=0");
config.task_rows_h = gnome_config_get_int("stuff/task_rows_h=2");
config.task_rows_v = gnome_config_get_int("stuff/task_rows_v=1");
config.max_task_width = gnome_config_get_int("stuff/max_task_width=400");
@@ -2253,7 +2272,7 @@
while (p)
{
Task *t = p->data;
- if ((config.tasks_all) ||
+ if (((config.tasks_all) ||
(t->sticky) ||
(config.minimized_tasks_all && t->iconified) ||
(
@@ -2261,7 +2280,8 @@
&& (t->ax == area_x)
&& (t->ay == area_y)
)
- )
+ ) && ((config.minimized_tasks_only && t->iconified) ||
+ (!config.minimized_tasks_only)))
num++;
p = p->next;
}
@@ -2414,7 +2434,7 @@
while (p)
{
t = p->data;
- if ((config.tasks_all) ||
+ if (((config.tasks_all) ||
(t->sticky) ||
(config.minimized_tasks_all && t->iconified) ||
(
@@ -2422,7 +2442,8 @@
&& (t->ax == area_x)
&& (t->ay == area_y)
)
- )
+ ) && ((config.minimized_tasks_only && t->iconified) ||
+ (!config.minimized_tasks_only)))
num++;
if (popbox)
{
@@ -2460,6 +2481,7 @@
{
t = (Task *)p->data;
+
if ( (((t->desktop == current_desk)
&& (t->ax == area_x)
&& (t->ay == area_y)
@@ -2467,9 +2489,12 @@
(config.tasks_all) ||
(t->sticky) ||
(config.minimized_tasks_all && t->iconified)
- ) &&
+ ) &&
+ ((config.minimized_tasks_only && t->iconified) ||
+ (!config.minimized_tasks_only)) &&
!just_popbox)
{
+
hbox = gtk_hbox_new(0, FALSE);
gtk_widget_show(hbox);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]