Пример #1
0
static gboolean
handle_create (LoomSettings *object,
               GDBusMethodInvocation *invocation,
               GVariant *arg_configuration)
{
  Settings *settings = SETTINGS (object);
  Setting *setting;
  gs_free gchar **object_paths = NULL;
  GError *error = NULL;

  if (!validate_configuration (arg_configuration, &error))
    {
      g_dbus_method_invocation_take_error (invocation, error);
      return TRUE;
    }

  setting = SETTING (setting_new (settings->daemon, arg_configuration));
  setting_export (setting);
  g_hash_table_insert (settings->settings,
                       (gchar *)setting_get_object_path (setting),
                       setting);

  object_paths = (gchar **)g_hash_table_get_keys_as_array (settings->settings,
                                                           NULL);
  loom_settings_set_settings (object, (const gchar* const*)object_paths);

  loom_settings_complete_create (object, invocation,
                                 setting_get_object_path (setting));

  return TRUE;
}
Пример #2
0
/**
 * menu_entries_init:
 * @menu                     : Menu handle.
 *
 * Creates and initializes menu entries.
 *
 * Returns: true (1) if successful, otherwise false (0).
 **/
bool menu_entries_init(menu_handle_t *menu)
{
   if (!menu)
      return false;

   menu->list_settings = setting_new(SL_FLAG_ALL);

   menu_list_push_stack(menu->menu_list, "", "Main Menu", MENU_SETTINGS, 0);
   menu_navigation_clear(&menu->navigation, true);
   menu_entries_push_list(menu, menu->menu_list->selection_buf,
         "", "Main Menu", 0, SL_FLAG_MAIN_MENU);

   return true;
}
Пример #3
0
int menu_entries_push_list(menu_handle_t *menu,
      file_list_t *list,
      const char *path, const char *label,
      unsigned type, unsigned setting_flags)
{
   rarch_setting_t *setting = NULL;
   settings_t *settings     = config_get_ptr();
   
   if (menu && menu->list_settings)
      settings_list_free(menu->list_settings);

   menu->list_settings      = (rarch_setting_t *)setting_new(setting_flags);
   setting                  = (rarch_setting_t*)menu_setting_find(label);

   if (!setting)
      return -1;

   menu_list_clear(list);

   for (; setting->type != ST_END_GROUP; setting++)
   {
      if (
            setting->type == ST_GROUP 
            || setting->type == ST_SUB_GROUP
            || setting->type == ST_END_SUB_GROUP
            || (setting->flags & SD_FLAG_ADVANCED && 
               !settings->menu.show_advanced_settings)
         )
         continue;

      menu_list_push(list, setting->short_description,
            setting->name, menu_entries_setting_set_flags(setting), 0);
   }

   menu_driver_populate_entries(path, label, type);

   return 0;
}