Exemplo n.º 1
0
void
on_add_dialog_response(Etk_Dialog *dialog, int response_id, void *data)
{
  const char *artist;
  const char *album;
  char *key;
  Etk_Tree_Row *row;

  if (response_id == ETK_RESPONSE_OK)
    {
      artist = etk_entry_text_get(ETK_ENTRY(entry_add_artist));
      album = etk_entry_text_get(ETK_ENTRY(entry_add_album));

      if (artist && strcmp(artist, "")
          && album && strcmp(album, ""))
        {
          asprintf(&key, "/%s/%s", artist, album);
          row = etk_tree_row_append(ETK_TREE(tree), NULL,
                                     etk_tree_nth_col_get(ETK_TREE(tree), 0),
                                     key, NULL);
        }
    }
  etk_entry_text_set(ETK_ENTRY(entry_add_artist), "");
  etk_entry_text_set(ETK_ENTRY(entry_add_album), "");
  etk_widget_hide_all(ETK_WIDGET(dialog));
}
Exemplo n.º 2
0
void
image_tweenlist_populate(void)
{
   Eina_List *tweens, *l;
   Etk_Tree_Col *col;

   if (!etk_string_length_get(Cur.state)) return;
   if (!etk_string_length_get(Cur.part)) return;

   col = etk_tree_nth_col_get(ETK_TREE(UI_ImageTweenList), 0);

   etk_tree_clear(ETK_TREE(UI_ImageTweenList));

   tweens = l = edje_edit_state_tweens_list_get(edje_o, Cur.part->string, Cur.state->string);
   while (l)
   {
      //printf("RET: %s (id: %d)\n", l->data, edje_edit_image_id_get(edje_o, l->data));
      //snprintf(buf, sizeof(buf), "images/%d", edje_edit_image_id_get(edje_o, l->data)); TODO: find a way to append image directly from the edje file.
      etk_tree_row_append(ETK_TREE(UI_ImageTweenList), NULL,
                          col, NULL, NULL, l->data,
                          NULL);
      l = l->next;
   }
   edje_edit_string_list_free(tweens);
}
Exemplo n.º 3
0
void 
tree_populate(void)
{
   Eina_List *parts, *pp;
   Eina_List *progs;

   etk_tree_freeze(ETK_TREE(UI_PartsTree));
   etk_tree_clear(ETK_TREE(UI_PartsTree));

   parts = pp = edje_edit_parts_list_get(edje_o);
   while(pp)
   {
      printf("  P: %s\n", (char*)pp->data);
      tree_part_add((char*)pp->data, NULL);
      pp = pp->next;
   }
   edje_edit_string_list_free(parts);

   progs = pp = edje_edit_programs_list_get(edje_o);
   while(pp)
   {
      tree_program_add((char*)pp->data);
      pp = pp->next;
   }
   edje_edit_string_list_free(progs);

   etk_tree_row_select(etk_tree_first_row_get (ETK_TREE(UI_PartsTree)));
   etk_tree_thaw(ETK_TREE(UI_PartsTree));
}
Exemplo n.º 4
0
boot_panel* bootpanel_create(main_window *win)
{
    boot_panel* pnl;
    Etk_Widget *scroll,*vbox, *hbox,*text,*frame;

    pnl = malloc(sizeof(boot_panel));
    pnl->win = win;

    vbox = etk_vbox_new(ETK_FALSE, 5);
    hbox = etk_hbox_new(ETK_FALSE, 5);

    pnl->frame = hbox;
    etk_box_append(ETK_BOX(hbox), vbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

    scroll = etk_scrolled_view_new ();
    etk_box_append(ETK_BOX(vbox), scroll, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
    etk_widget_show(scroll);

    pnl->eth_list = etk_tree_new();
    pnl->eth_col0 = etk_tree_col_new(ETK_TREE(pnl->eth_list), _("Interfaces"), 80, 0.0);
    etk_tree_col_model_add(pnl->eth_col0, etk_tree_model_checkbox_new());
    etk_tree_col_model_add(pnl->eth_col0, etk_tree_model_text_new());

    etk_signal_connect_by_code(ETK_TREE_COL_CELL_VALUE_CHANGED_SIGNAL,
            ETK_OBJECT(pnl->eth_col0),
            ETK_CALLBACK(bootpanel_ethlist_checkbox_change_cb), pnl);

    etk_tree_mode_set(ETK_TREE(pnl->eth_list), ETK_TREE_MODE_LIST);
    etk_tree_build(ETK_TREE(pnl->eth_list));
    etk_container_add(ETK_CONTAINER(scroll), pnl->eth_list);

    text = etk_text_view_new();
    etk_widget_size_request_set(text, -1, 150);
    etk_object_properties_set(ETK_OBJECT(text), "focusable", ETK_FALSE, NULL);
    etk_textblock_text_set(ETK_TEXT_VIEW(text)->textblock,
            _("<p align=\"center\"><style effect=glow color1=#fa14 color2=#fe87><b>Help!</b></style>"
                "\n<p>When your computer boot, exalt starts and configure yours networks interfaces in the background. If you use the DHCP, your interface will get a IP address after a while.</p>"
                "\n<p>You can have a problem if you use a daemon as nfs-client. If the daemon need a network connection when it starts and your interface has no IP address, the daemon will not work. To avoid this problem Exalt can configure your interface in the foreground. If you select the interface in the list, Exalt will wait until your interface gets a IP address.</p>"
                "\n<p>If the interface doesn't get a IP address before the timeout, your computer will continue the boot process.</p>"
             ),
            ETK_TRUE);
    etk_box_append(ETK_BOX(hbox), text, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);


    frame=etk_frame_new(_("Timeout"));
    etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_FILL, 0);

    hbox = etk_hbox_new(ETK_FALSE, 5);
    etk_container_add(ETK_CONTAINER(frame), hbox);

    pnl->slider = etk_hslider_new(1,60,30,1,5);
    etk_box_append(ETK_BOX(hbox), pnl->slider, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
    etk_slider_label_set(ETK_SLIDER(pnl->slider), "%.0f");
    etk_signal_connect_by_code(ETK_RANGE_VALUE_CHANGED_SIGNAL, ETK_OBJECT(pnl->slider), ETK_CALLBACK(bootpanel_slider_value_changed_cb), pnl);
    etk_slider_update_policy_set(ETK_SLIDER(pnl->slider), ETK_SLIDER_DELAYED);

    bootpanel_update_timeout(pnl);

    return pnl;
}
void etk_file_cache_dialog_create()
{
	Etk_Widget* window = NULL;
	Etk_Widget* tree = NULL;
	Etk_Tree_Col* tree_col;
	Etk_Widget* button;
	Etk_Widget* vbox;


	if (_etk_file_cache_dialog_running)
		return;

	_etk_file_cache_dialog_running = 1;

	window = etk_window_new();

	etk_window_title_set(ETK_WINDOW(window), "File Cache");
	etk_window_wmclass_set(ETK_WINDOW(window), "entropyfilecache", "entropyfilecache");

	etk_widget_size_request_set(ETK_WIDGET(window), 450, 500);

	vbox = etk_vbox_new(ETK_FALSE,0);
	etk_container_add(ETK_CONTAINER(window), vbox);


	tree = etk_tree_new();
	etk_box_append(ETK_BOX(vbox), tree, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
	
	etk_tree_mode_set(ETK_TREE(tree), ETK_TREE_MODE_LIST);

	tree_col = etk_tree_col_new(ETK_TREE(tree), _("Listeners"), 125,0.0);
	etk_tree_col_model_add(tree_col, etk_tree_model_text_new());

  // Not yet implemented in Tree2
	//etk_tree_col_sort_func_set(tree_col, _entropy_etk_file_cache_dialog_listener_compare_cb, NULL);

	tree_col = etk_tree_col_new(ETK_TREE(tree), _("Filename"), 150, 0.0);
	etk_tree_col_model_add(tree_col, etk_tree_model_text_new());
        
	etk_tree_col_expand_set(tree_col, ETK_TRUE);

	etk_tree_build(ETK_TREE(tree));

	
	etk_file_cache_dialog_refresh(tree);

	button = etk_button_new_with_label("Refresh");
	etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(_etk_file_cache_dialog_refresh_cb), tree);

	
	etk_box_append(ETK_BOX(vbox), button, ETK_BOX_END, ETK_BOX_NONE, 0);


	  etk_signal_connect ("delete_event", ETK_OBJECT (window),
		      ETK_CALLBACK (_etk_file_cache_debug_dialog_delete_cb), window);
	
	etk_widget_show_all(window);
}
Exemplo n.º 6
0
main_window* mainwindow_create()
{/*{{{*/
	Etk_Widget *hbox,*scroll;
	main_window* win;
	win=(main_window*)malloc((unsigned int)sizeof(main_window));

	win->win = etk_window_new();
	etk_window_title_set(ETK_WINDOW(win->win), _("Exalt: network manager"));
	etk_window_wmclass_set(ETK_WINDOW(win->win),"Exalt_network_manager","Exalt_network_manager");
        etk_window_resize(ETK_WINDOW(win->win), 623,268);
	etk_signal_connect("delete-event", ETK_OBJECT(win->win), ETK_CALLBACK( mainWindow_close), win);

	hbox = etk_hbox_new(ETK_FALSE, 5);
	etk_container_add(ETK_CONTAINER(win->win), hbox);

	scroll = etk_scrolled_view_new ();
	etk_box_append(ETK_BOX(hbox), scroll, ETK_BOX_START, ETK_BOX_FILL, 0);
	etk_widget_show(scroll);

	win->eth_list = etk_tree_new();
	etk_widget_size_request_set(win->eth_list, 120, 50);

	win->eth_col0 = etk_tree_col_new(ETK_TREE(win->eth_list), _("Interfaces"), 80, 0.0);
   	etk_tree_col_model_add(win->eth_col0, etk_tree_model_image_new());
   	etk_tree_col_model_add(win->eth_col0, etk_tree_model_text_new());

	etk_tree_rows_height_set(ETK_TREE(win->eth_list),40);
	etk_tree_mode_set(ETK_TREE(win->eth_list), ETK_TREE_MODE_LIST);
	etk_tree_build(ETK_TREE(win->eth_list));
	etk_container_add(ETK_CONTAINER(scroll), win->eth_list);

	etk_signal_connect("row-clicked", ETK_OBJECT(win->eth_list),ETK_CALLBACK(mainWindow_ethList_row_clicked_cb), win);


	//add the general panel in the list
	etk_tree_row_append(ETK_TREE(win->eth_list), NULL,
    		win->eth_col0,PACKAGE_DATA_DIR ICONS_NETWORK_CONFIG,NULL,_("General") , NULL);

	//attach the add callback function to exalt
	exalt_eth_set_cb(mainWindow_eth_cb, win);

	etk_widget_show_all(win->win);

	win->eth_panel = ethpanel_create(win);
	etk_box_append(ETK_BOX(hbox),win->eth_panel->frame , ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

	win->wireless_panel = wirelesspanel_create(win);
	etk_box_append(ETK_BOX(hbox),win->wireless_panel->frame , ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

	win->general_panel = generalpanel_create();
	etk_box_append(ETK_BOX(hbox),win->general_panel->frame , ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

	//launch the timer to update the network state
	//win->eth_state_timer = ecore_timer_add(MAINWINDOW_ETH_STATE_TIME_MAX ,mainWindow_eth_state_timer,win);

	return win;
}/*}}}*/
Exemplo n.º 7
0
/* TODO : documentation */
void
emphasis_clear(Emphasis_Gui *gui)
{
  Emphasis_Player_Gui *player;
  
  player = gui->player;

  etk_tree_clear(ETK_TREE(player->media.artist));
  etk_tree_clear(ETK_TREE(player->media.album));
  etk_tree_clear(ETK_TREE(player->media.track));
  etk_tree_clear(ETK_TREE(player->media.pls));
}
Exemplo n.º 8
0
/* Insert a row sorted in the tree */
static int _etk_test_tree_insert_sorted_button_cb(Etk_Object *object, void *data)
{
   Etk_Tree *tree = data;
   Etk_Tree_Row *row;
   Etk_Tree_Col *col1, *col2, *col3, *col4, *col5, *col6;
   const char *stock_key;

   col1 = etk_tree_nth_col_get(tree, 0);
   col2 = etk_tree_nth_col_get(tree, 1);
   col3 = etk_tree_nth_col_get(tree, 2);
   col4 = etk_tree_nth_col_get(tree, 3);
   col5 = etk_tree_nth_col_get(tree, 4);
   col6 = etk_tree_nth_col_get(tree, 5);
   stock_key = etk_stock_key_get(ETK_STOCK_PLACES_USER_HOME, ETK_STOCK_SMALL);
   row = etk_tree_row_insert_sorted(ETK_TREE(tree), NULL,
                                    col1, etk_theme_icon_path_get(), stock_key, "Sorted Row",
                                    col2, 0.42,
                                    col3, rand(),
                                    col4, PACKAGE_DATA_DIR "/images/1star.png", NULL,
                                    col5, ETK_TRUE,
                                    col6, 0.42, "42 %",
                                    NULL);
   etk_tree_row_select(row);
   etk_tree_row_scroll_to(row, ETK_TRUE);
   return 0;
}
Exemplo n.º 9
0
static void
process_message(gpointer _message, gpointer _data)
{
	GValueArray *message = (GValueArray *) _message;
	struct MessageListViewData *data = (struct MessageListViewData *) _data;
	GHashTable *details =
		g_value_get_boxed(g_value_array_get_nth(message, 4));
	long timestamp =
		g_value_get_long(g_hash_table_lookup(details, "timestamp_int"));
	char datestr[32];
	strftime(datestr, 31, "%e.%m.%Y, %H:%M", localtime(&timestamp));

	GHashTable *parameters = g_hash_table_new(NULL, NULL);
	g_hash_table_insert(parameters, strdup("number"),
			    strdup(phonegui_contact_cache_lookup((char *)
								 g_value_get_string
								 (g_value_array_get_nth
								  (message,
								   2)))));
	char *content =
		strdup(g_value_get_string(g_value_array_get_nth(message, 3)));
	string_replace_newline(content);
	g_hash_table_insert(parameters, strdup("content"), content);
	g_hash_table_insert(parameters, strdup("date"), strdup(datestr));


	Etk_Tree_Row *row =
		etk_tree_row_append(ETK_TREE(data->tree), NULL, data->col1,
				    parameters, NULL);
	etk_tree_row_data_set(row, g_value_array_copy(message));
}
Exemplo n.º 10
0
void
on_filechooser_dialog_response(Etk_Dialog *filechooser_dialog,
                               int response_id,
                               void *data)
{
  const char *cover_file_name;
  const char *cover_file_folder;
  char *cover_path;
  Etk_Tree_Row *row;

  if (response_id == ETK_RESPONSE_OK)
    {
      cover_file_name =
       etk_filechooser_widget_selected_file_get
       (ETK_FILECHOOSER_WIDGET(filechooser));
      
      cover_file_folder =
       etk_filechooser_widget_current_folder_get
       (ETK_FILECHOOSER_WIDGET(filechooser));

      asprintf(&cover_path, "%s/%s", cover_file_folder, cover_file_name);

      change_cover_path(cover_path);

      row = etk_tree_selected_row_get(ETK_TREE(tree));
      free(etk_tree_row_data_get(row));
      etk_tree_row_data_set(row, cover_path);
      etk_image_set_from_file(ETK_IMAGE(cover), cover_path, NULL);
    }
  etk_widget_hide_all(ETK_WIDGET(filechooser_dialog));
}
Exemplo n.º 11
0
/* Called when a key is pressed while the tree is focused:
 * we use this to delete the selected rows if "DEL" is pressed */
static Etk_Bool _etk_test_tree_key_down_cb(Etk_Object *object, Etk_Event_Key_Down *event, void *data)
{
   Etk_Tree *tree;
   Etk_Tree_Row *r;

   if (!(tree = ETK_TREE(object)))
      return ETK_FALSE;

   if (strcmp(event->keyname, "Delete") == 0)
   {
      /* We walk through all the rows of the tree, and we delete those which are selected.
       * Note that we can safely manipulate "r" with etk_tree_row_walk_next(), even if it
       * has been deleted with etk_tree_row_delete(), because etk_tree_row_delete() just
       * marks the row as deleted, but the row is not effectively deleted immediately */
      for (r = etk_tree_first_row_get(tree); r; r = etk_tree_row_walk_next(r, ETK_TRUE))
      {
         if (etk_tree_row_is_selected(r))
            etk_tree_row_delete(r);
      }

      return ETK_TRUE;
   }

   return ETK_FALSE;
}
Exemplo n.º 12
0
static int _etk_test_tree_unselect_all_cb(Etk_Object *object, void *data)
{
   Etk_Tree *tree = data;
   
   etk_tree_unselect_all(ETK_TREE(tree));
   
   return 0;
}
Exemplo n.º 13
0
/* Data Windows Callbacks */
Etk_Bool
_data_list_row_selected_cb(Etk_Tree *tree, Etk_Tree_Row *row, void *data)
{
   Etk_Tree_Col *col1, *col2;
   const char *name, *value;

   col1 = etk_tree_nth_col_get(ETK_TREE(UI_DataList), 0);
   col2 = etk_tree_nth_col_get(ETK_TREE(UI_DataList), 1);

   etk_tree_row_fields_get(row, col1, &name, NULL);
   etk_tree_row_fields_get(row, col2, &value, NULL);

   etk_entry_text_set(ETK_ENTRY(UI_DataNameEntry), name);
   etk_entry_text_set(ETK_ENTRY(UI_DataValueEntry), value);

   etk_widget_disabled_set(UI_DataApplyButton, ETK_FALSE);

   return ETK_TRUE;
}
Exemplo n.º 14
0
/***   Implementation   ***/
Etk_Widget*
tree_create(void)
{
   //UI_GroupsComboBox
   UI_GroupsComboBox = etk_combobox_entry_new_default();
   etk_combobox_entry_items_height_set(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox), 18);
   etk_combobox_entry_autosearch_set(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox), GROUP_COMBO_AUTOSEARCH_COL, strcasestr);
  
   etk_signal_connect("active-item-changed", ETK_OBJECT(UI_GroupsComboBox),
                      ETK_CALLBACK(_tree_combobox_active_item_changed_cb), NULL);

   //UI_PartsTree
   Etk_Tree_Col *col;
   UI_PartsTree = etk_tree_new();
   etk_widget_padding_set(UI_PartsTree,2,2,2,2);
   etk_tree_mode_set(ETK_TREE(UI_PartsTree), ETK_TREE_MODE_TREE);
   etk_tree_headers_visible_set(ETK_TREE(UI_PartsTree), ETK_FALSE);
   etk_widget_size_request_set(UI_PartsTree, 260, 300);
   //Main column
   col = etk_tree_col_new(ETK_TREE(UI_PartsTree), "File contents",100,0);
   etk_tree_col_model_add(col,etk_tree_model_image_new());
   etk_tree_col_model_add(col,etk_tree_model_text_new());
   etk_tree_col_resizable_set(col, ETK_FALSE);
   etk_tree_col_expand_set(col,ETK_TRUE);
   //Visibility column
   col = etk_tree_col_new(ETK_TREE(UI_PartsTree), "vis", 10,0);
   etk_tree_col_visible_set(col, DEBUG_MODE);
   etk_tree_col_model_add(col,etk_tree_model_checkbox_new());
   etk_tree_col_resizable_set(col, ETK_FALSE);
   etk_tree_col_expand_set(col,ETK_FALSE);
   //RowType column
   col = etk_tree_col_new(ETK_TREE(UI_PartsTree), "type",10, 0);
   etk_tree_col_model_add(col,etk_tree_model_int_new());
   etk_tree_col_visible_set(col, DEBUG_MODE);
   etk_tree_col_resizable_set(col, ETK_FALSE);
   etk_tree_col_expand_set(col,ETK_FALSE);
   //Parent part row
   col = etk_tree_col_new(ETK_TREE(UI_PartsTree), "parent",100, 0);
   etk_tree_col_model_add(col,etk_tree_model_text_new());
   etk_tree_col_visible_set(col, DEBUG_MODE);
   etk_tree_col_resizable_set(col, ETK_FALSE);
   etk_tree_col_expand_set(col,ETK_FALSE);
   etk_tree_build(ETK_TREE(UI_PartsTree));

   etk_signal_connect("row-selected", ETK_OBJECT(UI_PartsTree),
                      ETK_CALLBACK(_tree_row_selected_cb), NULL);
   etk_signal_connect("row-clicked", ETK_OBJECT(UI_PartsTree),
                      ETK_CALLBACK(_tree_click_cb), NULL);

   //vbox
   Etk_Widget *vbox;
   vbox = etk_vbox_new(ETK_FALSE, 0);
   etk_box_append(ETK_BOX(vbox), UI_GroupsComboBox, ETK_BOX_START, ETK_BOX_NONE, 0);
   etk_box_append(ETK_BOX(vbox), UI_PartsTree, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   return vbox;
}
Exemplo n.º 15
0
Ex_Tab *
_ex_tab_find_by_itree(Etk_Tree *itree)
{
   Eina_List *l;
   Ex_Tab *tab;

   EINA_LIST_FOREACH(e->tabs, l , tab)
     if (ETK_TREE(tab->itree) == itree)
       return tab;
   return NULL;
}
Exemplo n.º 16
0
void bootpanel_add_interface(char* interface, boot_panel* pnl)
{
    int checked;
    EXALT_ASSERT_RETURN_VOID(interface!=NULL);
    EXALT_ASSERT_RETURN_VOID(pnl!=NULL);

    checked = exalt_dbus_bootprocess_iface_is(exalt_conn, interface);
    etk_tree_row_append(ETK_TREE(pnl->eth_list), NULL,
            pnl->eth_col0,checked,interface ,
            NULL);
}
Exemplo n.º 17
0
Etk_Bool
_data_del_button_click_cb(Etk_Button *button, void *data)
{
   const char *name;
   Etk_Tree_Row *row, *next_row;

   name = etk_entry_text_get(ETK_ENTRY(UI_DataNameEntry));
   if (!name) return ETK_TRUE;

   row = etk_tree_selected_row_get(ETK_TREE(UI_DataList));
   next_row = etk_tree_row_next_get(row);

   edje_edit_data_del(edje_o, name);
   etk_tree_row_delete(row);

   if (!next_row) next_row = etk_tree_last_row_get(ETK_TREE(UI_DataList));
   etk_tree_row_select(next_row);

   return ETK_TRUE;
}
Exemplo n.º 18
0
static void
frame_recipient_process_recipient(gpointer _properties, gpointer _data)
{
	GHashTable *properties = (GHashTable *) _properties;
	struct MessageNewViewData *data = (struct MessageNewViewData *) _data;

	Etk_Tree_Row *row =
		etk_tree_row_append(ETK_TREE(data->tree_recipients), NULL,
				    data->col1_recipients, properties, NULL);
	etk_tree_row_data_set(row, properties);
}
Exemplo n.º 19
0
/* callback for engines list */
static void _etk_prefs_engine_row_selected_cb(Etk_Object *object, Etk_Tree_Row *row)
{
   Etk_Tree *tree;
   char *icol_string;
     
   tree = ETK_TREE(object);

   etk_tree_row_fields_get(row, etk_tree_nth_col_get(tree, 0), &icol_string, NULL, NULL, NULL);
   free(_etk_prefs_engine);
   _etk_prefs_engine = strdup(icol_string);
}
Exemplo n.º 20
0
static void
_change_page_cb (Etk_Object *object, Etk_Tree_Row *row, Etk_Event_Mouse_Up *event, void *data)
{
  Etk_Tree *tree;
  Etk_Pdf  *pdf;
  int       row_number;

  tree = ETK_TREE (object);
  pdf = ETK_PDF (data);
  row_number = *(int *)etk_tree_row_data_get (row);
  etk_pdf_page_set (pdf, row_number);
}
Exemplo n.º 21
0
void
change_cover_path(char *cover_path)
{
  Etk_Tree_Row *row;
  Cover_Entry *ce;
  char *key;

  row = etk_tree_selected_row_get(ETK_TREE(tree));
  if (!row)
    {
      return;
    }

  ce = malloc(sizeof(Cover_Entry));
  etk_tree_row_fields_get(row, etk_tree_nth_col_get(ETK_TREE(tree), 0), 
                          &key, NULL);
  ce->key = strdup(key);
  ce->path = strdup(cover_path);

  cover_changed = eina_list_append(cover_changed, ce);
}
Exemplo n.º 22
0
void
data_window_populate(void)
{
   Eina_List *l, *datas;
   Etk_Tree_Col *col1, *col2;
   // FIXME type of data ?
   char *data;

   col1 = etk_tree_nth_col_get(ETK_TREE(UI_DataList), 0);
   col2 = etk_tree_nth_col_get(ETK_TREE(UI_DataList), 1);

   etk_tree_freeze(ETK_TREE(UI_DataList));
   etk_tree_clear(ETK_TREE(UI_DataList));

   datas = edje_edit_data_list_get(edje_o);
   EINA_LIST_FOREACH(datas, l , data)
   {
      const char *val;

      val = edje_edit_data_value_get(edje_o, data);
      etk_tree_row_append(ETK_TREE(UI_DataList), NULL,
                    col1, data,
                    col2, val,
                    NULL);
      edje_edit_string_free(val);
   }
   edje_edit_string_list_free(datas);

   etk_tree_thaw(ETK_TREE(UI_DataList));
   
   etk_widget_disabled_set(UI_DataApplyButton, ETK_TRUE);
   etk_entry_text_set(ETK_ENTRY(UI_DataNameEntry), "");
   etk_entry_text_set(ETK_ENTRY(UI_DataValueEntry), "");
}
void etk_file_cache_dialog_refresh(Etk_Widget* tree)
{
	Etk_Tree_Col* col1;
	Etk_Tree_Col* col2;

	char* key;
	char buffer[PATH_MAX];
	Ecore_List* keys;	
	
	etk_tree_clear(ETK_TREE(tree));
	
	/*Populate the tree*/
	col1 = etk_tree_nth_col_get(ETK_TREE(tree), 0);
	col2 = etk_tree_nth_col_get(ETK_TREE(tree), 1);

	etk_tree_freeze(ETK_TREE(tree));
	
	keys = entropy_core_file_cache_keys_retrieve();
	while ( (key = ecore_list_first_remove(keys))) {
		  entropy_file_listener* listen = entropy_core_file_cache_retrieve(key);
		  
		  if (listen) {
			  snprintf(buffer, PATH_MAX, "%s/%s", listen->file->path, listen->file->filename);
		
			  etk_tree_row_append(ETK_TREE(tree), NULL,
			  col1, listen->count, 
			  col2,   buffer,
			  NULL);
		  }
	
	}
	ecore_list_destroy(keys);

	etk_tree_thaw(ETK_TREE(tree));
}
Exemplo n.º 24
0
void
on_btn_open_clicked(Etk_Object *object, void *data)
{
  if (!etk_tree_selected_row_get(ETK_TREE(tree)))
    {
      return;
    }
  
  if (filechooser_dialog)
    {
      etk_widget_show_all(ETK_WIDGET(filechooser_dialog));
      return;
    }
}
Exemplo n.º 25
0
static Etk_Widget *_etk_prefs_other_tab_create()
{
   Eina_List *engines;
   Eina_List *l;   
   char *engine;
   
   Etk_Widget *engine_list;
   
   Etk_Widget *frame;
   Etk_Widget *vbox;
   Etk_Tree_Col *col1;
   Etk_Tree_Row *row;
      
   /* main vbox */
   vbox = etk_vbox_new(ETK_FALSE, 0);
   
   /* tree to hold the engines list */
   engine_list = etk_tree_new();
   etk_widget_size_request_set(engine_list, 180, 240);
   etk_tree_mode_set(ETK_TREE(engine_list), ETK_TREE_MODE_LIST);
   etk_tree_multiple_select_set(ETK_TREE(engine_list), ETK_FALSE);
   etk_tree_rows_height_set(ETK_TREE(engine_list), 45);   
   etk_tree_headers_visible_set(ETK_TREE(engine_list), ETK_FALSE);
   etk_signal_connect("row-selected", ETK_OBJECT(engine_list), ETK_CALLBACK(_etk_prefs_engine_row_selected_cb), NULL);
   
   col1 = etk_tree_col_new(ETK_TREE(engine_list), "Engines", 150, 0.0);
   etk_tree_col_model_add(col1, etk_tree_model_text_new());
   etk_tree_build(ETK_TREE(engine_list));   
   
   /* scan for engines and add them to the list */
   engines = etk_engine_list_get();
   for(l = engines; l; l = l->next)
     {
        const char *engine_current = etk_config_engine_get();
	
	engine = l->data;
        row = etk_tree_row_append(ETK_TREE(engine_list), NULL, col1, engine,  NULL);
	if (engine_current)
        if (!strcmp(engine, engine_current))
	    etk_tree_row_select(row);
     }
   
   /* pack tree */
   etk_box_append(ETK_BOX(vbox), engine_list, ETK_BOX_START, ETK_BOX_NONE, 0);
      
   etk_container_border_width_set(ETK_CONTAINER(vbox), 5);

   frame = etk_frame_new(_("Engines"));
   etk_container_add(ETK_CONTAINER(frame), vbox);
   
   return frame;
}
Exemplo n.º 26
0
/* callback for theme list */
static void _etk_prefs_theme_row_selected_cb(Etk_Object *object, Etk_Tree_Row *row, void *data)
{
   Etk_Widget *child = NULL;
   Etk_Tree *tree;
   char *icol_string;
   Etk_Widget *preview;
     
   tree = ETK_TREE(object);
   preview = data;

   etk_tree_row_fields_get(row, etk_tree_nth_col_get(tree, 0), &icol_string, NULL, NULL, NULL);
   child = _etk_prefs_theme_preview_get(icol_string);
   etk_container_add(ETK_CONTAINER(preview), child);
   etk_widget_show_all(child);
}
Exemplo n.º 27
0
Etk_Bool
_data_apply_button_click_cb(Etk_Button *button, void *data)
{
   Etk_Tree_Col *col1, *col2;
   Etk_Tree_Row *row;
   const char *name, *value, *new_name, *new_value;

   col1 = etk_tree_nth_col_get(ETK_TREE(UI_DataList), 0);
   col2 = etk_tree_nth_col_get(ETK_TREE(UI_DataList), 1);
   row = etk_tree_selected_row_get(ETK_TREE(UI_DataList));
   etk_tree_row_fields_get(row, col1, &name, col2, &value, NULL);

   new_name = etk_entry_text_get(ETK_ENTRY(UI_DataNameEntry));
   new_value = etk_entry_text_get(ETK_ENTRY(UI_DataValueEntry));

   if (strcmp(value, new_value))
     edje_edit_data_value_set(edje_o, name, new_value);

   if (strcmp(name, new_name))
     edje_edit_data_name_set(edje_o, name, new_name);

   etk_tree_row_fields_set(row, ETK_FALSE, col1, new_name, col2, new_value, NULL);
   return ETK_TRUE;
}
Exemplo n.º 28
0
/* Image Frame Callbacks */
Etk_Bool
_image_TweenList_row_selected_cb(Etk_Object *object, Etk_Tree_Row *row, void *data)
{
   Etk_Tree_Col *col;
   char *selected = NULL;
   printf("Row selected signal on ImageTweenList EMITTED\n");

   col = etk_tree_nth_col_get(ETK_TREE(UI_ImageTweenList), 0);
   etk_tree_row_fields_get(row, col, NULL, NULL, &selected, NULL);
   if (!selected) return ETK_TRUE;

   Cur.tween = etk_string_set(Cur.tween, selected);
   etk_widget_disabled_set(UI_DeleteTweenButton, FALSE);
  // etk_widget_disabled_set(UI_MoveDownTweenButton, FALSE);
  // etk_widget_disabled_set(UI_MoveUpTweenButton, FALSE);

   return ETK_TRUE;
}
Exemplo n.º 29
0
Etk_Bool
_data_add_button_click_cb(Etk_Button *button, void *data)
{
   char buf[64];
   int i = 0;
   Etk_Tree_Row *last_row;
   
   do snprintf(buf, sizeof(buf), "New data %d", ++i);
   while (!edje_edit_data_add(edje_o, buf, "New value") && i < 100);
      
   data_window_populate();
   
   last_row = etk_tree_last_row_get(ETK_TREE(UI_DataList));
   etk_tree_row_select(last_row);
   etk_tree_row_scroll_to(last_row, 1);
   
   return ETK_TRUE;
}
Exemplo n.º 30
0
Etk_Tree_Row * mainWindow_findrow(main_window* win, exalt_ethernet* eth)
{/*{{{*/
	Etk_Tree_Row* row;
	char* row_name;

	row = etk_tree_first_row_get(ETK_TREE(win->eth_list));
	//the first row is "General", we can jump it
	row = etk_tree_row_next_get(row);
	while(row)
	{
		etk_tree_row_fields_get(row, win->eth_col0, NULL, NULL, &row_name, NULL);
		if(strcmp(row_name,exalt_eth_get_name(eth))==0)
			return row;

		row = etk_tree_row_next_get(row);
	}

 	return NULL;
}/*}}}*/