Update of /home/kde/kdeaddons/atlantikdesigner/designer In directory office:/tmp/cvs-serv944/designer Modified Files: designer.cpp designer.h editor.cpp editor.h Log Message: don't allow multiple go estates Index: designer.cpp =================================================================== RCS file: /home/kde/kdeaddons/atlantikdesigner/designer/designer.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- designer.cpp 2002/06/11 01:39:43 1.39 +++ designer.cpp 2002/06/11 03:29:55 1.40 @@ -133,6 +133,7 @@ setCentralWidget(board); layout = new QVBoxLayout(board->centerWidget()); editor = new EstateEdit(&groups, &estates, &cards, board->centerWidget(), "Estate Editor"); + connect(editor, SIGNAL(goChecked(int)), this, SLOT(goChanged(int))); connect(editor, SIGNAL(updateBackground()), this, SLOT(updateBackground())); layout->addWidget(editor); @@ -153,7 +154,7 @@ initMembers(); initBoard(); - for(int i = 0; i < 40; ++i) + for (int i = 0; i < 40; ++i) { (void) newEstate(i); } @@ -776,12 +777,10 @@ void AtlanticDesigner::changeEstate(int index) { - setFocus(); - - (void) editor->saveEstate(); + if (index < 0 || index > max - 1) + return; - editor->setEstate(estates.at(index)); - movePlayer(estates.at(index)); + changeEstate(estates.at(index)); } void AtlanticDesigner::changeEstate(Estate *estate) @@ -789,6 +788,8 @@ if (!estate) return; + setFocus(); + (void) editor->saveEstate(); editor->setEstate(static_cast(estate)); @@ -897,6 +898,14 @@ connect(groupEditor, SIGNAL(changed()), this, SLOT(modified())); connect(groupEditor, SIGNAL(update()), this, SLOT(groupsChanged())); connect(groupEditor, SIGNAL(update()), editor, SLOT(groupsChanged())); +} + +void AtlanticDesigner::goChanged(int id) +{ + ConfigEstate *curEstate = 0; + for (curEstate = estates.first(); curEstate; curEstate = estates.next()) + if (curEstate->go() && curEstate->estateId() != id) + curEstate->setGo(false); } void AtlanticDesigner::groupsChanged() Index: designer.h =================================================================== RCS file: /home/kde/kdeaddons/atlantikdesigner/designer/designer.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- designer.h 2002/06/10 04:08:05 1.15 +++ designer.h 2002/06/11 03:29:55 1.16 @@ -51,6 +51,7 @@ void info(); void editGroups(); void groupsChanged(); + void goChanged(int); void updateBackground(); void up(); Index: editor.cpp =================================================================== RCS file: /home/kde/kdeaddons/atlantikdesigner/designer/editor.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- editor.cpp 2002/06/11 01:39:43 1.26 +++ editor.cpp 2002/06/11 03:29:55 1.27 @@ -174,6 +174,7 @@ goCheck = new QCheckBox(i18n("This estate is Go"), this); connect(goCheck, SIGNAL(toggled(bool)), this, SIGNAL(somethingChanged())); + connect(goCheck, SIGNAL(toggled(bool)), this, SLOT(goToggled(bool))); layout->addWidget(goCheck, 5, 0); QStringList estateTypes(i18n("Street")); @@ -292,6 +293,12 @@ void EstateEdit::groupsChanged() { confDlg->groupsChanged(); +} + +void EstateEdit::goToggled(bool on) +{ + if (on) + emit goChecked(estate->estateId()); } bool EstateEdit::upArrow() Index: editor.h =================================================================== RCS file: /home/kde/kdeaddons/atlantikdesigner/designer/editor.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- editor.h 2002/06/10 04:08:05 1.19 +++ editor.h 2002/06/11 03:29:55 1.20 @@ -122,9 +122,11 @@ void somethingChanged(); void modified(); void updateBackground(); + void goChecked(int id); private slots: void configure(); + void goToggled(bool); private: KComboBox *typeCombo; _______________________________________________ atlantik-devel mailing list atlantik-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/atlantik-devel