Example #1
0
Etk_Bool bootpanel_ethlist_checkbox_change_cb(Etk_Object *object, Etk_Tree_Row *row, void *data)
{
    Etk_Tree_Col* col;
    char* interface;
    Etk_Bool checked;
    boot_panel *pnl;

    pnl = (boot_panel*) data;
    col = ETK_TREE_COL(object);
    EXALT_ASSERT_RETURN(col!=NULL);
    EXALT_ASSERT_RETURN(row!=NULL);
    EXALT_ASSERT_RETURN(pnl!=NULL);

    etk_tree_row_fields_get(row, col, NULL, &interface, NULL);
    etk_tree_row_fields_get(row, col, &checked, NULL, NULL);

    //we change the state of the checkbox because it will be update when the daemon will update the configuration (see main_window.c::mainwindow_notify_cb())
    bootpanel_update_interface(interface, pnl);

    if(checked)
        exalt_dbus_bootprocess_iface_add(exalt_conn,interface);
    else
        exalt_dbus_bootprocess_iface_remove(exalt_conn,interface);

    return ETK_TRUE;
}
Example #2
0
/* Called when a checkbox of the tree is toggled: we display its new state in the statusbar */
static Etk_Bool _etk_test_tree_checkbox_toggled_cb(Etk_Object *object, Etk_Tree_Row *row, void *data)
{
   Etk_Tree *tree;
   Etk_Tree_Col *col;
   Etk_Statusbar *statusbar;
   Etk_Bool checked;
   char *row_name;
   char message[1024];

   if (!(col = ETK_TREE_COL(object)) || !(statusbar = ETK_STATUSBAR(data)) || !row)
      return ETK_TRUE;

   tree = etk_tree_col_tree_get(col);

   /* We retrieve the name of the row: see _etk_test_tree_row_clicked_cb() for more info*/
   etk_tree_row_fields_get(row, etk_tree_nth_col_get(tree, 0), NULL, NULL, &row_name, NULL);
   /* We then retrieve the new state of the checkbox */
   etk_tree_row_fields_get(row, col, &checked, NULL);

   sprintf(message, "Row \"%s\" has been %s", row_name, checked ? "checked" : "unchecked");
   etk_statusbar_message_push(statusbar, message, 0);

   return ETK_TRUE;
}