Exemplo n.º 1
0
int menu_entry_pathdir_set_value(uint32_t i, const char *s)
{
   const char *menu_label   = NULL;
   const char *menu_path    = NULL;
   rarch_setting_t *setting = NULL;
   menu_list_t *menu_list   = menu_list_get_ptr();

   menu_list_get_last_stack(menu_list,
         &menu_path, &menu_label, NULL, NULL);

   setting = menu_setting_find(menu_label);

   if (!setting)
      return -1;

   if (setting->type != ST_DIR)
      return -1;

   (void)s;
   setting_set_with_string_representation(setting, menu_path);

   menu_setting_generic(setting, false);

   menu_list_pop_stack_by_needle(menu_list, setting->name);

   return 0;
}
Exemplo n.º 2
0
static int action_ok_path_use_directory(const char *path,
      const char *label, unsigned type, size_t idx)
{
   const char *menu_label   = NULL;
   const char *menu_path    = NULL;
   rarch_setting_t *setting = NULL;
   menu_handle_t *menu = menu_driver_get_ptr();
   if (!menu)
      return -1;

   menu_list_get_last_stack(menu->menu_list,
         &menu_path, &menu_label, NULL);

   setting = menu_setting_find(menu_label);

   if (!setting)
      return -1;

   if (setting->type != ST_DIR)
      return -1;

   strlcpy(setting->value.string, menu_path, setting->size);
   menu_setting_generic(setting);
   menu_list_pop_stack_by_needle(menu->menu_list, setting->name);

   return 0;
}
Exemplo n.º 3
0
static int action_ok_menu_wallpaper_load(const char *path,
      const char *label, unsigned type, size_t idx)
{
   char wallpaper_path[PATH_MAX_LENGTH];
   const char *menu_label   = NULL;
   const char *menu_path    = NULL;
   rarch_setting_t *setting = NULL;
   menu_handle_t *menu      = menu_driver_get_ptr();
   settings_t *settings     = config_get_ptr();
   if (!menu)
      return -1;

   menu_list_get_last_stack(menu->menu_list, &menu_path, &menu_label,
         NULL);

   setting = menu_setting_find(menu_label);

   if (!setting)
      return -1;

   fill_pathname_join(wallpaper_path, menu_path, path, sizeof(wallpaper_path));

   if (path_file_exists(wallpaper_path))
   {
      strlcpy(settings->menu.wallpaper, wallpaper_path, sizeof(settings->menu.wallpaper));

      rarch_main_data_msg_queue_push(DATA_TYPE_IMAGE, wallpaper_path, "cb_menu_wallpaper", 0, 1,
            true);
   }

   menu_list_pop_stack_by_needle(menu->menu_list, setting->name);

   return 0;
}
Exemplo n.º 4
0
static int action_ok_file_load(const char *path,
      const char *label, unsigned type, size_t idx)
{
   const char *menu_label   = NULL;
   const char *menu_path    = NULL;
   rarch_setting_t *setting = NULL;
   menu_handle_t *menu      = menu_driver_get_ptr();
   global_t *global         = global_get_ptr();

   if (!menu)
      return -1;

   menu_list_get_last(menu->menu_list->menu_stack,
         &menu_path, &menu_label, NULL);

   setting = menu_setting_find(menu_label);

   if (setting && setting->type == ST_PATH)
   {
      menu_action_setting_set_current_string_path(setting, menu_path, path);
      menu_list_pop_stack_by_needle(menu->menu_list, setting->name);
   }
   else
   {
      if (type == MENU_FILE_IN_CARCHIVE)
         fill_pathname_join_delim(global->fullpath, menu_path, path,
               '#',sizeof(global->fullpath));
      else
         fill_pathname_join(global->fullpath, menu_path, path,
               sizeof(global->fullpath));

      menu_entries_common_load_content(true);

      return -1;
   }

   return 0;
}
Exemplo n.º 5
0
static int action_ok_set_path(const char *path,
      const char *label, unsigned type, size_t idx)
{
   const char *menu_path    = NULL;
   const char *menu_label   = NULL;
   rarch_setting_t *setting = NULL;
   menu_handle_t *menu = menu_driver_get_ptr();

   if (!menu)
      return -1;

   menu_list_get_last_stack(menu->menu_list,
         &menu_path, &menu_label, NULL);

   setting = menu_setting_find(menu_label);

   if (!setting)
      return -1;

   menu_action_setting_set_current_string_path(setting, menu_path, path);
   menu_list_pop_stack_by_needle(menu->menu_list, setting->name);

   return 0;
}