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));
}
Esempio n. 2
0
Etk_Bool
_state_CCEntry_text_changed_cb(Etk_Object *object, void *data)
{
   printf("Text Changed Signal on CC Entry Emitted\n");
   edje_edit_state_color_class_set(edje_o, Cur.part->string, Cur.state->string,
                                   etk_entry_text_get(ETK_ENTRY(UI_StateCCEntry)));
   return ETK_TRUE;
}
Esempio n. 3
0
static void evolve_gui_property_entry_text_changed_cb(Etk_Object *object, void *data)
{
   Evolve_Widget *widget;
   Evolve_Property *prop;
   
   prop = etk_object_data_get(object, "prop");
   widget = data;
   
   evolve_widget_property_set(widget, prop->name, (char*)etk_entry_text_get(ETK_ENTRY(object)), prop->type);
}
void etk_directory_add_dialog_create_cb(Etk_Object* w, void* user_data) 
{
	etk_directory_add_dialog* dialog = user_data;
	const char* child;

	child = etk_entry_text_get(ETK_ENTRY(dialog->entry));
	if (child && child[0] != 0) {
		entropy_plugin_filesystem_directory_create(dialog->parent, child);
	}

	etk_object_destroy(ETK_OBJECT(dialog->window));
	free(dialog);	
}
Esempio n. 5
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;
}
Esempio n. 6
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;
}
Esempio n. 7
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;
}
Esempio n. 8
0
void
emphasis_configgui_save(Emphasis_Config_Gui *configgui)
{
  Emphasis_Config *config;
  char *key = NULL, *value = NULL;
  int reconnect = 0;

  config = config_load();

  if((key = config->hostname))
    {
      value = strdup(etk_entry_text_get(ETK_ENTRY(configgui->hostname)));
      if(strcmp(key,value)) { reconnect = 1; }
      free(config->hostname);
    }
  config->hostname = value;

  if((key = config->password))
    {
      value = strdup(etk_entry_text_get(ETK_ENTRY(configgui->password)));
      if(!reconnect && strcmp(key,value)) { reconnect = 1; }
      free(config->password);
    }
  config->password = value;
  
  if(!reconnect && config->port != etk_range_value_get(ETK_RANGE(configgui->port)))
    {
      reconnect = 1;
    }
  config->port = etk_range_value_get(ETK_RANGE(configgui->port));


  config->crossfade    =
   etk_range_value_get(ETK_RANGE(configgui->xfade));
  config->stop_on_exit =
   etk_toggle_button_active_get(ETK_TOGGLE_BUTTON(configgui->stop));
  config->keep_aspect  =
   etk_toggle_button_active_get(ETK_TOGGLE_BUTTON(configgui->aspect));

  if(configgui->data)
    {
      etk_image_keep_aspect_set
        (ETK_IMAGE(((Emphasis_Gui*)configgui->data)->player->small.cover),
         config->keep_aspect);
      etk_image_keep_aspect_set
        (ETK_IMAGE(((Emphasis_Gui*)configgui->data)->player->full.cover),
         config->keep_aspect);
    }
  mpc_set_crossfade(config->crossfade);

  config_save(config);
  config_free(config);

  if(reconnect)
    {
      Emphasis_Gui *gui = configgui->data;
      emphasis_player_cover_set(gui->player, NULL);
      emphasis_player_progress_set(gui->player, 0.0, 0.001);
      mpc_disconnect();
    }
}