Changeset 2170


Ignore:
Timestamp:
06/06/07 10:00:36 (6 years ago)
Author:
thomas
Message:
  • src/today-main.c: (today_infoline_new), (child_setup),

(today_launcher_clicked_cb), (create_ui):
Use argv array to start applications. Open the dialer with --show-missed when
missed call info is clicked

Location:
trunk/src/target/OM-2007/applications/openmoko-today
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog

    r2165 r2170  
     12007-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 
    182007-06-05  Thomas Wood  <thomas@openedhand.com> 
    29 
  • trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c

    r2165 r2170  
    4646 
    4747/*** functions ***/ 
    48 static void today_launcher_clicked_cb (GtkWidget *widget, gchar *command); 
     48static void today_launcher_clicked_cb (GtkWidget *widget, gchar **argv); 
    4949 
    5050 
     
    100100today_infoline_clicked_cb (GtkWidget *widget, GdkEventButton *button, gchar *data) 
    101101{ 
    102   today_launcher_clicked_cb (widget, data); 
     102  gchar *argv[1]; 
     103  argv[0] = data; 
     104  today_launcher_clicked_cb (widget, argv); 
    103105} 
    104106 
     
    114116 
    115117static GtkWidget * 
    116 today_infoline_new (gchar * exec, gchar * message) 
     118today_infoline_new (gchar **argv, gchar * message) 
    117119{ 
    118120  GtkWidget *eventbox, *hbox, *icon, *label; 
     
    126128  gtk_widget_add_events (eventbox, GDK_BUTTON_PRESS_MASK); 
    127129 
    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); 
    129131 
    130132  hbox = gtk_hbox_new (FALSE, 0); 
    131133  gtk_container_add (GTK_CONTAINER (eventbox), hbox); 
    132134 
    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); 
    136138  } 
    137139  else 
     
    170172 
    171173static void 
    172 today_launcher_clicked_cb (GtkWidget *widget, gchar *command) 
     174today_launcher_clicked_cb (GtkWidget *widget, gchar **argv) 
    173175{ 
    174176  /* The following code is a modified version of code from launcher-util.c in 
     
    181183  int screen; 
    182184  GError *error = NULL; 
    183   gchar *argv[1]; 
    184185 
    185186  display = gdk_x11_display_get_xdisplay (gtk_widget_get_display (widget)); 
     
    191192 
    192193  /* 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 
    197197  if (!g_spawn_async (NULL, argv, NULL, 
    198198                            G_SPAWN_SEARCH_PATH, child_setup, context, 
    199199                            NULL, &error)) 
    200200  { 
    201     g_warning ("Cannot launch %s: %s", command, error->message); 
     201    g_warning ("Cannot launch %s: %s", argv[0], error->message); 
    202202    g_error_free (error); 
    203203    sn_launcher_context_complete (context); 
     
    273273  GtkWidget *infoline; 
    274274  GtkWidget *button_box; 
     275 
     276  gchar *missed_calls_cmd[] = { "openmoko-dialer", "--show-missed" }; 
     277  gchar *messages_inbox_cmd[] = { "openmoko-messages" }; 
    275278 
    276279  /* main window */ 
     
    313316 
    314317  /* unread messages */ 
    315   infoline = today_infoline_new ("openmoko-messages", "Unread Messages"); 
     318  infoline = today_infoline_new (messages_inbox_cmd, "Unread Messages"); 
    316319  gtk_box_pack_start (GTK_BOX (vbox), infoline, FALSE, FALSE, 0); 
    317320 
    318321  /* missed calls */ 
    319   infoline = today_infoline_new ("openmoko-dialer", "Missed Calls"); 
     322  infoline = today_infoline_new (missed_calls_cmd, "Missed Calls"); 
    320323  gtk_box_pack_start (GTK_BOX (vbox), infoline, FALSE, FALSE, 0); 
    321324 
Note: See TracChangeset for help on using the changeset viewer.