Re: App-start feedback



Peter Astrand <altic@lysator.liu.se> writes:

> A few weeks ago, I released Xalf 0.2. It's a tool to give
> feedback when starting X applications. KDE already has a working
> implementation, and will use the same method as Xalf. I'm
> investigating how application start feedback can be implemented in
> Gnome. Assuming we agree on this is something we want, there are
> some design decisions that has to be made. 

I've actually been meaning to get this working with GNOME for a while :)

I am fine with it being an external program, which means less code in
gnome-libs etc.

I am not yet sure where this would go though.  I kinda think it should
just sit in gnome_dekstop_entry_launch().

Unfortunately gnome-dentry starts stuff with /bin/sh (yes, evil and
broken and what not) so I added a --title param to xalf, which
probably is a good idea anyway.

Anyway, this is a first stab at this.  It seems to break my netscape
(3.0) for some reason.  Also, ignore the DESKTOP_ICON stuff, that's
for a different hack :)

Comments...

Jacob
-- 
"Is this love... or just confusion?"  -- Jimi Hendrix

--- xalf.c~	Sun Apr 16 16:01:13 2000
+++ xalf.c	Tue May  2 16:48:55 2000
@@ -65,7 +65,8 @@
    -i, --invisiblewindow    use an invisible window as indicator (default)\n\
                             (for use with Gnome panel, KDE taskbar etc)\n\
    -s, --splash             use splashscreen as indicator\n\
-   -c, --cursor             add hourglass to mouse cursor\n"
+   -c, --cursor             add hourglass to mouse cursor\n\
+       --title              Title to show in the tasklist\n"
 
 enum { VERSION_MAJOR = 0 };
 enum { VERSION_MINOR = 2 };
@@ -100,6 +101,8 @@
 char *programname;
 /* The name of the binary launched */
 char *taskname;
+/* and the label */
+char *taskname2;
 /* The pid of this tracing process */
 char launch_pid[22];
 /* The current display */
@@ -226,6 +229,7 @@
 		{ "invisiblewindow", 0, 0, 'i' },
 		{ "splash", 0, 0, 's' },
 		{ "cursor", 0, 0, 'c' },
+		{ "title",  1, 0, 'l' },
 		{ 0, 0, 0, 0 }
 	    };
 	    
@@ -257,6 +261,10 @@
 			}
 		    break;
 
+		case 'l':
+		    taskname2 = g_strdup (optarg);
+		    break;
+
 		case 'n':
 		    noxalf_opt = TRUE;
 		    break;
@@ -298,8 +306,9 @@
 	execvp (argv[optind], argv+optind); 
 
     gtk_init (&argc, &argv); 
-    taskname = g_strdup (argv[optind]);	
-
+    taskname = g_strdup (argv[optind]);
+    if (!taskname2)
+	    taskname2 = taskname;
     /* Show indicators. We do this as early as possible, to give rapid feedback */
 
     dpy = GDK_DISPLAY ();
@@ -435,7 +444,7 @@
     GtkWidget *window;
     char *tasktitle;
 	
-    tasktitle = g_strconcat ("(", taskname, ")", NULL);
+    tasktitle = g_strconcat ("(", taskname2, ")", NULL);
     /* Create the indicator: An invisible window, to be shown in a pager */
     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
     gtk_window_set_title (GTK_WINDOW(window), tasktitle); 
@@ -495,7 +504,7 @@
     gtk_widget_show (dialog_action_area1);
     gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1), 10);
 
-    labeltext = g_strconcat ("Starting ", taskname, "...", NULL);
+    labeltext = g_strconcat ("Starting ", taskname2, "...", NULL);
     label1 = gtk_label_new (labeltext);
     
     gtk_widget_show (label1);

--- xalf.c~	Sun Apr 16 16:01:13 2000
+++ xalf.c	Tue May  2 16:48:55 2000
@@ -65,7 +65,8 @@
    -i, --invisiblewindow    use an invisible window as indicator (default)\n\
                             (for use with Gnome panel, KDE taskbar etc)\n\
    -s, --splash             use splashscreen as indicator\n\
-   -c, --cursor             add hourglass to mouse cursor\n"
+   -c, --cursor             add hourglass to mouse cursor\n\
+       --title              Title to show in the tasklist\n"
 
 enum { VERSION_MAJOR = 0 };
 enum { VERSION_MINOR = 2 };
@@ -100,6 +101,8 @@
 char *programname;
 /* The name of the binary launched */
 char *taskname;
+/* and the label */
+char *taskname2;
 /* The pid of this tracing process */
 char launch_pid[22];
 /* The current display */
@@ -226,6 +229,7 @@
 		{ "invisiblewindow", 0, 0, 'i' },
 		{ "splash", 0, 0, 's' },
 		{ "cursor", 0, 0, 'c' },
+		{ "title",  1, 0, 'l' },
 		{ 0, 0, 0, 0 }
 	    };
 	    
@@ -257,6 +261,10 @@
 			}
 		    break;
 
+		case 'l':
+		    taskname2 = g_strdup (optarg);
+		    break;
+
 		case 'n':
 		    noxalf_opt = TRUE;
 		    break;
@@ -298,8 +306,9 @@
 	execvp (argv[optind], argv+optind); 
 
     gtk_init (&argc, &argv); 
-    taskname = g_strdup (argv[optind]);	
-
+    taskname = g_strdup (argv[optind]);
+    if (!taskname2)
+	    taskname2 = taskname;
     /* Show indicators. We do this as early as possible, to give rapid feedback */
 
     dpy = GDK_DISPLAY ();
@@ -435,7 +444,7 @@
     GtkWidget *window;
     char *tasktitle;
 	
-    tasktitle = g_strconcat ("(", taskname, ")", NULL);
+    tasktitle = g_strconcat ("(", taskname2, ")", NULL);
     /* Create the indicator: An invisible window, to be shown in a pager */
     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
     gtk_window_set_title (GTK_WINDOW(window), tasktitle); 
@@ -495,7 +504,7 @@
     gtk_widget_show (dialog_action_area1);
     gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1), 10);
 
-    labeltext = g_strconcat ("Starting ", taskname, "...", NULL);
+    labeltext = g_strconcat ("Starting ", taskname2, "...", NULL);
     label1 = gtk_label_new (labeltext);
     
     gtk_widget_show (label1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]