Exemplo n.º 1
0
static void
message_list_view_delete_clicked(struct MessageListViewData *data,
				 Evas_Object * obj, void *event_info)
{
	g_debug("message_list_view_delete_clicked()");
	evas_object_hide(data->hv);

	data->selected_row = etk_tree_selected_row_get(data->tree);
	if (data->selected_row != NULL) {
		GValueArray *message =
			etk_tree_row_data_get(data->selected_row);

		GHashTable *options = g_hash_table_new(g_str_hash, g_str_equal);
		g_hash_table_insert(options, "id",
				    GINT_TO_POINTER(g_value_get_int
						    (g_value_array_get_nth
						     (message, 0))));
		g_hash_table_insert(options, "delete_callback",
				    message_list_view_message_deleted);
		g_hash_table_insert(options, "delete_callback_data", data);

		struct Window *win = window_new(D_("Delete Message"));
		window_init(win);
		window_view_show(win, options, message_delete_view_show,
				 message_delete_view_hide);
	}
}
Exemplo n.º 2
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.º 3
0
static void
message_list_view_message_deleted_callback(struct MessageListViewData *data)
{
	// TODO: Reload list instead of deleting the selected message
	data->selected_row = etk_tree_selected_row_get(data->tree);
	if (data->selected_row != NULL) {
		etk_tree_row_delete(data->selected_row);
	}
}
Exemplo n.º 4
0
static void
frame_recipient_delete_clicked(struct MessageNewViewData *data,
			       Evas_Object * obj, void *event_info)
{
	Etk_Tree_Row *row = etk_tree_selected_row_get(data->tree_recipients);
	if (row != NULL) {
		GHashTable *parameters = etk_tree_row_data_get(row);
		g_ptr_array_remove(data->recipients, parameters);
		etk_tree_clear(data->tree_recipients);
		g_ptr_array_foreach(data->recipients,
				    frame_recipient_process_recipient, data);
	}
}
Exemplo n.º 5
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.º 6
0
static void
message_list_view_answer_clicked(struct MessageListViewData *data,
				 Evas_Object * obj, void *event_info)
{
	evas_object_hide(data->hv);

	data->selected_row = etk_tree_selected_row_get(data->tree);
	if (data->selected_row != NULL) {
		GValueArray *message =
			etk_tree_row_data_get(data->selected_row);

		GHashTable *options = g_hash_table_new(g_str_hash, g_str_equal);
		g_hash_table_insert(options, "recipient", (gpointer) g_value_get_string(g_value_array_get_nth(message, 2)));	/* lose the const */

		struct Window *win = window_new(D_("SMS Answer"));
		window_init(win);
		window_view_show(win, options, message_new_view_show,
				 message_new_view_hide);
	}
}
Exemplo n.º 7
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.º 8
0
Etk_Bool
_state_EntryImage_clicked_cb(Etk_Object *object, void *data)
{
   const char *name;

   printf("Mouse Click Signal on StateEntryImage Emitted\n");

   name = etk_entry_text_get(ETK_ENTRY(UI_StateEntry));

   if (!name || !etk_string_length_get(Cur.state)) return ETK_TRUE;

   if (!strcmp(name, Cur.state->string))
   {
      etk_widget_hide(ETK_WIDGET(UI_StateEntryImage));
      return ETK_TRUE;
   }

   /* Change state name */
   if (strcmp("default 0.00", Cur.state->string))
   {
      if (edje_edit_state_name_set(edje_o, Cur.part->string, Cur.state->string, name))
      {
         /* update tree */
         Etk_Tree_Row *row;
         row = etk_tree_selected_row_get(ETK_TREE(UI_PartsTree));
         etk_tree_row_fields_set(row,TRUE,
                                    COL_NAME, EdjeFile, "DESC.PNG", name,
                                    NULL);
         /* update Cur */
         Cur.state = etk_string_set(Cur.state, name);
         /* Hide the entry image */
         etk_widget_hide(ETK_WIDGET(UI_StateEntryImage));
      }
      else
         dialog_alert_show("<b>Wrong name format</b><br>Name must be in the form:<br>\"default 0.00\"");
   }
   else
      dialog_alert_show("You can't rename default 0.0");

   return ETK_TRUE;
}
Exemplo n.º 9
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.º 10
0
void _ex_Binding(Etk_Object *obj, void *data){
	Etk_Tree_Row *irow;	
	Etk_Combobox_Item *active_item;
	midi_t * midibinding;
	char midi_label[255];
	irow = etk_tree_selected_row_get(rack_tree);
	active_item = etk_combobox_active_item_get(combobox);
	midibinding = (midi_t *)evas_list_nth(live_plugin->midi_data, (int)etk_tree_row_data_get(irow)-1);

	midibinding->type = (int)etk_combobox_item_data_get(active_item);
	midibinding->channel = spinner_data;
	midibinding->program = spinner1_data;
	midibinding->trow = irow;
	if(midibinding->type==1){
		sprintf(midi_label, "ch# %i PC %i", midibinding->channel, midibinding->program);
	}
	if(midibinding->type==2){
		sprintf(midi_label, "ch# %i CC %i", midibinding->channel, midibinding->program);
	}
	etk_tree_row_fields_set(irow, ETK_FALSE, col2, midi_label, NULL);
	etk_widget_hide(ETK_WIDGET(midi_win));
}
Exemplo n.º 11
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.º 12
0
void show_midi_window(void *data){
	Etk_Widget *vbox, *vbox1, *hbox;
	Etk_Widget *frame;
	Etk_Widget *button;
	Etk_Widget *label;
	Etk_Combobox_Item *item;
	midi_t * midibinding;
	
	if (midi_win){
		etk_widget_show(ETK_WIDGET(midi_win));
		return;
	}
	
	midibinding = (midi_t *)evas_list_nth(live_plugin->midi_data, (int)etk_tree_row_data_get(etk_tree_selected_row_get(rack_tree))-1);
	if(midibinding->channel != 0){
		spinner_data = midibinding->channel;
	}else{
		spinner_data = 1;
	}
	spinner1_data = midibinding->program;
		
	midi_win = etk_window_new();
	etk_window_title_set(ETK_WINDOW(midi_win), "Set Midi Properties");
	etk_window_resize(ETK_WINDOW(midi_win), 200, 0);
	etk_signal_connect("delete-event", ETK_OBJECT(midi_win), ETK_CALLBACK(etk_window_hide_on_delete), NULL);
	vbox = etk_vbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(midi_win), vbox);

	frame = etk_frame_new("Set Midi Binding for Rack State");
	etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 5);
	
	hbox = etk_hbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(frame), hbox);
	label = etk_label_new("ch#");
	etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 3);	
	
	spinner = etk_spinner_new(1.0, 16.0, midibinding->channel, 1.0, 5.0);
	etk_box_append(ETK_BOX(hbox), spinner, ETK_BOX_START, ETK_BOX_NONE, 7);
	etk_signal_connect("value-changed", ETK_OBJECT(spinner), ETK_CALLBACK(_ex_changed_value), 1);

	combobox = etk_combobox_new_default();
	etk_box_append(ETK_BOX(hbox), combobox, ETK_BOX_START, ETK_BOX_NONE, 2);
	item = etk_combobox_item_append(ETK_COMBOBOX(combobox), "Program Change");
	etk_combobox_item_data_set(item, 1);
	if(midibinding->type==1){
		etk_combobox_active_item_set(combobox, item);
	}	
	item = etk_combobox_item_append(ETK_COMBOBOX(combobox), "Control Change");
	etk_combobox_item_data_set(item, 2);
	if(midibinding->type==2){
		etk_combobox_active_item_set(combobox, item);
	}

	spinner1 = etk_spinner_new(0.0, 127.0, midibinding->program, 1.0, 5.0);
	etk_box_append(ETK_BOX(hbox), spinner1, ETK_BOX_START, ETK_BOX_NONE, 7);
	etk_signal_connect("value-changed", ETK_OBJECT(spinner1), ETK_CALLBACK(_ex_changed_value), 2);

	/*
	button = etk_button_new_with_label("Learn");
	etk_box_append(ETK_BOX(hbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);	
	*/

	button = etk_button_new_with_label("Add Binding");
	etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);
	etk_signal_connect("clicked", ETK_OBJECT(button), _ex_Binding, data);
	
	
	
	etk_widget_show_all(midi_win);   
}