void KDMGeneralWidget::load() { set_def(); KConfigGroup configGrp = config->group( "X-*-Greeter" ); useThemeCheck->setChecked( configGrp.readEntry( "UseTheme", false ) ); // Check the GUI type guicombo->setCurrentId( configGrp.readEntry( "GUIStyle" ) ); // Check the Color Scheme colcombo->setCurrentId( configGrp.readEntry("ColorScheme" ) ); // get the language langcombo->setCurrentItem( configGrp.readEntry( "Language", "C" ) ); // Read the fonts QFont font = stdFontChooser->font(); stdFontChooser->setFont( configGrp.readEntry( "StdFont", font ) ); font = failFontChooser->font(); failFontChooser->setFont( configGrp.readEntry( "FailFont", font ) ); font = greetingFontChooser->font(); greetingFontChooser->setFont( configGrp.readEntry( "GreetFont", font ) ); aacb->setChecked( configGrp.readEntry( "AntiAliasing", false ) ); }
void KDMGeneralWidget::defaults() { useThemeCheck->setChecked( false ); guicombo->setCurrentId( "" ); colcombo->setCurrentId( "" ); langcombo->setCurrentItem( "en_US" ); set_def(); aacb->setChecked( false ); }
void Perso::load_caracteristics(){ // Initializing xml document class QDomDocument doc; { QFile f("Persos.xml"); f.open(QIODevice::ReadOnly); doc.setContent(&f); f.close(); } // Filling data { QDomElement root=doc.firstChild().toElement(); QDomElement child=root.firstChild().toElement(); while(!child.isNull()) { if(child.tagName() == "persos") { QDomElement enemy_node = child.firstChild().toElement(); while(!enemy_node.isNull()) { // If we are if (enemy_node.tagName() == "perso" && enemy_node.attribute("id").toStdString()==_name) { QDomElement tag_child = enemy_node.firstChild().toElement(); while(!tag_child.isNull()) { if (tag_child.tagName() == "dead") { _dead_equipment.add_money(tag_child.attribute("gold").toInt()); _dead_equipment.set_xp(tag_child.attribute("xp").toInt()); // TODO _dead_equipment.add_item(new Weapon/Shield("tag_child.attribute("weapon/shield")")); } else if (tag_child.tagName() == "lvl") { if (tag_child.attribute("id").toInt() == _lvl) { set_HP(tag_child.attribute("HP").toInt()); set_MP(tag_child.attribute("MP").toInt()); set_max_HP(tag_child.attribute("HP").toInt()); set_max_MP(tag_child.attribute("MP").toInt()); set_def(tag_child.attribute("def").toInt()); set_strength(tag_child.attribute("str").toInt()); set_mobility(tag_child.attribute("mob").toInt()); } } tag_child = tag_child.nextSibling().toElement(); } } enemy_node = enemy_node.nextSibling().toElement(); } } child = child.nextSibling().toElement(); } } }
t_molwin *init_mw(t_x11 *x11,Window Parent, int x,int y,int width,int height, unsigned long fg,unsigned long bg, int ePBC,matrix box) { t_molwin *mw; snew(mw,1); set_def(mw,ePBC,box); InitWin(&mw->wd,x,y,width,height,1,"Mol Window"); mw->wd.Parent=Parent; mw->wd.self=XCreateSimpleWindow(x11->disp,Parent,x,y,width,height,1,fg,bg); x11->RegisterCallback(x11,mw->wd.self,Parent,MWCallBack,mw); x11->SetInputMask(x11,mw->wd.self, ExposureMask | StructureNotifyMask | ButtonPressMask); return mw; }
void __fastcall TForm2::Button1Click(TObject *Sender) { set_def(); sync_const(); }
// --------------------------------------------------------------------------- __fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner) { set_def(); sync_const(); }