106inline int ATTR_DLL_LOCAL
Show(
const std::string& heading,
107 const std::vector<std::string>& entries,
109 unsigned int autoclose = 0)
111 using namespace ::kodi::addon;
112 unsigned int size =
static_cast<unsigned int>(entries.size());
113 const char** cEntries = (
const char**)malloc(size *
sizeof(
const char**));
114 for (
unsigned int i = 0; i < size; ++i)
116 cEntries[i] = entries[i].c_str();
118 int ret = CPrivateBase::m_interface->toKodi->kodi_gui->dialogSelect->open(
119 CPrivateBase::m_interface->toKodi->kodiBase, heading.c_str(), cEntries, size, selected,
165inline int ATTR_DLL_LOCAL
Show(
const std::string& heading,
166 std::vector<kodi::gui::dialogs::SSelectionEntry>& entries,
168 unsigned int autoclose = 0)
170 using namespace ::kodi::addon;
171 unsigned int size =
static_cast<unsigned int>(entries.size());
172 const char** cEntries =
static_cast<const char**
>(malloc(size *
sizeof(
const char*)));
173 for (
unsigned int i = 0; i < size; ++i)
175 cEntries[i] = entries[i].name.c_str();
176 if (selected == -1 && entries[i].selected)
179 int ret = CPrivateBase::m_interface->toKodi->kodi_gui->dialogSelect->open(
180 CPrivateBase::m_interface->toKodi->kodiBase, heading.c_str(), cEntries, size, selected,
184 entries[ret].selected =
true;
235 std::vector<kodi::gui::dialogs::SSelectionEntry>& entries,
238 using namespace ::kodi::addon;
239 unsigned int size =
static_cast<unsigned int>(entries.size());
240 const char** cEntryIDs =
static_cast<const char**
>(malloc(size *
sizeof(
const char*)));
241 const char** cEntryNames =
static_cast<const char**
>(malloc(size *
sizeof(
const char*)));
242 bool* cEntriesSelected =
static_cast<bool*
>(malloc(size *
sizeof(
bool)));
243 for (
unsigned int i = 0; i < size; ++i)
245 cEntryIDs[i] = entries[i].id.c_str();
246 cEntryNames[i] = entries[i].name.c_str();
247 cEntriesSelected[i] = entries[i].selected;
249 bool ret = CPrivateBase::m_interface->toKodi->kodi_gui->dialogSelect->open_multi_select(
250 CPrivateBase::m_interface->toKodi->kodiBase, heading.c_str(), cEntryIDs, cEntryNames,
251 cEntriesSelected, size, autoclose);
254 for (
unsigned int i = 0; i < size; ++i)
255 entries[i].selected = cEntriesSelected[i];
259 free(cEntriesSelected);
Selection entry structure Used to provide the necessary data for the selection dialog and to declare ...
Definition Select.h:38
int ATTR_DLL_LOCAL Show(const std::string &heading, const std::vector< std::string > &entries, int selected=-1, unsigned int autoclose=0)
Show a selection dialog about given parts.
Definition Select.h:106
bool ATTR_DLL_LOCAL ShowMultiSelect(const std::string &heading, std::vector< kodi::gui::dialogs::SSelectionEntry > &entries, int autoclose=0)
Show a multiple selection dialog about given parts.
Definition Select.h:234