Example #1
0
void
ConfigScope::dump(
	StringBuffer &			buf,
	bool					wantExpandedUidNames,
	int						indentLevel) const
{
	int						i;
	int						len;
	StringVector			nameVec;
	ConfigItem *			item;
	
	//--------
	// First pass. Dump the variables
	//--------
	listLocalNames(Configuration::CFG_VARIABLES, nameVec);
	nameVec.sort();
	len = nameVec.length();
	for (i = 0; i < len; i++) {
		item = findItem(nameVec[i]);
		assert(item->type() & Configuration::CFG_VARIABLES);
		item->dump(buf, item->name(), wantExpandedUidNames, indentLevel);
	}

	//--------
	// Second pass. Dump the nested scopes
	//--------
	listLocalNames(Configuration::CFG_SCOPE, nameVec);
	nameVec.sort();
	len = nameVec.length();
	for (i = 0; i < len; i++) {
		item = findItem(nameVec[i]);
		assert(item->type() == Configuration::CFG_SCOPE);
		item->dump(buf, item->name(), wantExpandedUidNames, indentLevel);
	}
}
Example #2
0
void *ConfigureDialog::processEvent(Event *e)
{
    if (e->type() == EventLanguageChanged)
        bLanguageChanged = true;
    if (e->type() == EventPluginChanged){
        pluginInfo *info = (pluginInfo*)(e->param());
        if (info->plugin == NULL){
            for (QListViewItem *i = lstBox->firstChild(); i; i = i->nextSibling()){
                ConfigItem *item = static_cast<ConfigItem*>(i);
                if (item->type() != PLUGIN_ITEM)
                    continue;
                if (static_cast<PluginItem*>(item)->info() == info){
                    item->deleteWidget();
                    break;
                }
            }
        }
    }
    if (e->type() == EventClientsChanged){
        unsigned id = 0;
        if (lstBox->currentItem())
            id = static_cast<ConfigItem*>(lstBox->currentItem())->id();
        fill(id);
    }
    if (e->type() == EventClientChanged){
        if (m_nUpdates){
            if (--m_nUpdates == 0){
                setTitle();
                btnUpdate->setEnabled(true);
            }
        }
    }
    return NULL;
}