Exemple #1
0
const QStringList XineConfig::getCategories()
{
	QStringList cats;
	xine_cfg_entry_t* ent = new xine_cfg_entry_t;
	if (!xine_config_get_first_entry(m_xine, ent))
		return cats;
	QString entCat;

	do
	{
		entCat = QString(ent->key);
		entCat = entCat.left(entCat.find("."));
		if (cats.findIndex(entCat) == -1)
		{
			// kdDebug() << "XineConfig: new category: " << entCat << endl;
			cats.append(entCat);
		}
		delete ent;
		ent = new xine_cfg_entry_t;

	}
	while(xine_config_get_next_entry(m_xine, ent));

	delete ent;
	return cats;
}
Exemple #2
0
PyObject *
Xine_PyObject_config_get_first_entry(Xine_PyObject *self, PyObject *args, PyObject *kwargs)
{
    xine_cfg_entry_t cfg;

    if (!xine_config_get_first_entry(self->xine, &cfg)) {
        PyErr_Format(xine_error, "Failed to get first config entry");
        return NULL;
    }

    return _xine_config_entry_to_pydict(&cfg);
}
Exemple #3
0
void XineConfig::createPage(const QString& cat, bool expert, QWidget* parent)
{
	xine_cfg_entry_t* ent;

	QScrollView* sv = new QScrollView(parent);
	sv->setResizePolicy(QScrollView::AutoOneFit);
	parent = new QWidget(sv->viewport());
	sv->addChild(parent);

	QGridLayout* grid = new QGridLayout(parent, 20 ,2);
	grid->setColStretch(1,8);
	grid->setSpacing(10);
	grid->setMargin(10);

	uint row = 0;
	QString entCat;

	/*********** read in xine config entries ***********/
	ent = new xine_cfg_entry_t;
	xine_config_get_first_entry(m_xine, ent);

	do
	{
		entCat = QString(ent->key);
		entCat = entCat.left(entCat.find("."));
		if (entCat == cat)
		{
			if (((!expert) && (QString(NON_EXPERT_OPTIONS).contains(ent->key))) ||
			        ((expert) && (!QString(NON_EXPERT_OPTIONS).contains(ent->key))))
			{
				m_entries.append(new XineConfigEntry(parent, grid, row, ent));
				delete ent;
				ent = new xine_cfg_entry_t;
				row += 2;
			}
		}
	}
	while(xine_config_get_next_entry(m_xine, ent));

	delete ent;
}