Changeset 2170
- Timestamp:
- 06/06/07 10:00:36 (6 years ago)
- Location:
- trunk/src/target/OM-2007/applications/openmoko-today
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
src/today-main.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
r2165 r2170 1 2007-06-06 Thomas Wood <thomas@openedhand.com> 2 3 * src/today-main.c: (today_infoline_new), (child_setup), 4 (today_launcher_clicked_cb), (create_ui): 5 Use argv array to start applications. Open the dialer with --show-missed when 6 missed call info is clicked 7 1 8 2007-06-05 Thomas Wood <thomas@openedhand.com> 2 9 -
trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
r2165 r2170 46 46 47 47 /*** functions ***/ 48 static void today_launcher_clicked_cb (GtkWidget *widget, gchar * command);48 static void today_launcher_clicked_cb (GtkWidget *widget, gchar **argv); 49 49 50 50 … … 100 100 today_infoline_clicked_cb (GtkWidget *widget, GdkEventButton *button, gchar *data) 101 101 { 102 today_launcher_clicked_cb (widget, data); 102 gchar *argv[1]; 103 argv[0] = data; 104 today_launcher_clicked_cb (widget, argv); 103 105 } 104 106 … … 114 116 115 117 static GtkWidget * 116 today_infoline_new (gchar * exec, gchar * message)118 today_infoline_new (gchar **argv, gchar * message) 117 119 { 118 120 GtkWidget *eventbox, *hbox, *icon, *label; … … 126 128 gtk_widget_add_events (eventbox, GDK_BUTTON_PRESS_MASK); 127 129 128 g_signal_connect (G_OBJECT (eventbox), "button-press-event", (GCallback) today_infoline_clicked_cb, exec);130 g_signal_connect (G_OBJECT (eventbox), "button-press-event", (GCallback) today_infoline_clicked_cb, argv); 129 131 130 132 hbox = gtk_hbox_new (FALSE, 0); 131 133 gtk_container_add (GTK_CONTAINER (eventbox), hbox); 132 134 133 if (gtk_icon_theme_has_icon (icon_theme, exec))134 { 135 pb = gtk_icon_theme_load_icon (icon_theme, exec, 32, GTK_ICON_LOOKUP_NO_SVG, NULL);135 if (gtk_icon_theme_has_icon (icon_theme, argv[0])) 136 { 137 pb = gtk_icon_theme_load_icon (icon_theme, argv[0], 32, GTK_ICON_LOOKUP_NO_SVG, NULL); 136 138 } 137 139 else … … 170 172 171 173 static void 172 today_launcher_clicked_cb (GtkWidget *widget, gchar * command)174 today_launcher_clicked_cb (GtkWidget *widget, gchar **argv) 173 175 { 174 176 /* The following code is a modified version of code from launcher-util.c in … … 181 183 int screen; 182 184 GError *error = NULL; 183 gchar *argv[1];184 185 185 186 display = gdk_x11_display_get_xdisplay (gtk_widget_get_display (widget)); … … 191 192 192 193 /* sn_launcher_context_set_name (context, data->name); */ 193 sn_launcher_context_set_binary_name (context, command); 194 sn_launcher_context_initiate (context, "openmoko-today", command, CurrentTime); 195 196 argv[0] = command; 194 sn_launcher_context_set_binary_name (context, argv[0]); 195 sn_launcher_context_initiate (context, "openmoko-today", argv[0], CurrentTime); 196 197 197 if (!g_spawn_async (NULL, argv, NULL, 198 198 G_SPAWN_SEARCH_PATH, child_setup, context, 199 199 NULL, &error)) 200 200 { 201 g_warning ("Cannot launch %s: %s", command, error->message);201 g_warning ("Cannot launch %s: %s", argv[0], error->message); 202 202 g_error_free (error); 203 203 sn_launcher_context_complete (context); … … 273 273 GtkWidget *infoline; 274 274 GtkWidget *button_box; 275 276 gchar *missed_calls_cmd[] = { "openmoko-dialer", "--show-missed" }; 277 gchar *messages_inbox_cmd[] = { "openmoko-messages" }; 275 278 276 279 /* main window */ … … 313 316 314 317 /* unread messages */ 315 infoline = today_infoline_new ( "openmoko-messages", "Unread Messages");318 infoline = today_infoline_new (messages_inbox_cmd, "Unread Messages"); 316 319 gtk_box_pack_start (GTK_BOX (vbox), infoline, FALSE, FALSE, 0); 317 320 318 321 /* missed calls */ 319 infoline = today_infoline_new ( "openmoko-dialer", "Missed Calls");322 infoline = today_infoline_new (missed_calls_cmd, "Missed Calls"); 320 323 gtk_box_pack_start (GTK_BOX (vbox), infoline, FALSE, FALSE, 0); 321 324
Note: See TracChangeset
for help on using the changeset viewer.
