Changeset 1277


Ignore:
Timestamp:
03/08/07 17:14:00 (6 years ago)
Author:
thomas
Message:
  • Connect signal to launcher buttons in openmoko-today
  • Add some comments
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c

    r1275 r1277  
    181181} 
    182182 
     183/* information lines */ 
     184 
     185/** 
     186 * today_infoline_new: 
     187 * @stock_id: name of the stock icon to use 
     188 * @message: string containing the message 
     189 * 
     190 * Utility function to create new info lines 
     191 * 
     192 * Return value: The parent widget of the new widgets 
     193 */ 
     194 
    183195static GtkWidget * 
    184196today_infoline_new (gchar * stock_id, gchar * message) 
     
    203215} 
    204216 
     217 
     218/* launcher buttons */ 
     219 
     220/** 
     221 * callback for luncher buttons 
     222 */ 
     223static void 
     224today_launcher_clicked_cb (GtkWidget *button, gchar *command) 
     225{ 
     226  GError *error; 
     227 
     228  g_spawn_command_line_async (command, &error); 
     229 
     230  if (error) 
     231  { 
     232    LOG_ERROR; 
     233    g_error_free (error); 
     234  } 
     235 
     236  /* TODO: should we hide or quit after launching an application? */ 
     237} 
     238 
     239/** 
     240 * today_launcher_button_new: 
     241 * @icon: stock name to use as the icon in the button 
     242 * @exec: command to execute when the button is clicked 
     243 * 
     244 * Utility function to create new launcher buttons 
     245 * 
     246 * Return value: The parent widget of the new widgets 
     247 */ 
    205248static GtkWidget * 
    206249today_launcher_button_new (gchar * icon, gchar * exec) 
     
    212255 
    213256  gtk_widget_set_name (button, "today-launcher-button"); 
     257 
     258  g_signal_connect (G_OBJECT (button), 
     259                    "clicked", 
     260                    G_CALLBACK (today_launcher_clicked_cb), 
     261                    exec); 
    214262 
    215263  return button; 
     
    325373 
    326374  gtk_container_add (GTK_CONTAINER (button_box), 
    327                      today_launcher_button_new (GTK_STOCK_EXECUTE, "")); 
     375                     today_launcher_button_new (GTK_STOCK_EXECUTE, "contacts")); 
    328376  gtk_container_add (GTK_CONTAINER (button_box), 
    329377                     today_launcher_button_new (GTK_STOCK_EXECUTE, "")); 
Note: See TracChangeset for help on using the changeset viewer.