From atlantik-devel Sat Nov 09 19:41:40 2002 From: kde () office ! kde ! org Date: Sat, 09 Nov 2002 19:41:40 +0000 To: atlantik-devel Subject: [atlantik-cvs] CVS: kdeaddons/atlantikdesigner/designer designer.cpp,1.46,1.47 editor.cpp,1.33,1.34 X-MARC-Message: https://marc.info/?l=atlantik-devel&m=103687093215808 Update of /home/kde/kdeaddons/atlantikdesigner/designer In directory office:/tmp/cvs-serv21940/designer Modified Files: designer.cpp editor.cpp editor.h Log Message: update for the new monopd (absolutely necessary) adds one very short string (hides) Index: designer.cpp =================================================================== RCS file: /home/kde/kdeaddons/atlantikdesigner/designer/designer.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- designer.cpp 2002/10/05 05:27:07 1.46 +++ designer.cpp 2002/11/09 19:41:37 1.47 @@ -1,9 +1,11 @@ #include +#include #include #include #include #include #include +#include #include #include #include @@ -14,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -73,11 +76,14 @@ KConfig *config = kapp->config(); config->setGroup("General"); - defaultBg = config->readColorEntry("alternateBackground", &black); + QColor defaultColor = colorGroup().background(); + defaultBg = config->readColorEntry("alternateBackground", &defaultColor); config->setGroup("WM"); - defaultFg = config->readColorEntry("activeBackground", &black); + defaultColor = colorGroup().dark(); + defaultFg = config->readColorEntry("activeBackground", &defaultColor); - // these MUST match up to the ones in editor.cpp! + // these must match up to the ones in editor.cpp! + // I don't think these are used anymore. types.append("street"); types.append("cards"); types.append("freeparking"); @@ -225,6 +231,8 @@ { filename = url.path(); openFile(filename); + + recentAct->popupMenu()->setItemChecked(recentAct->currentItem(), false); } else { @@ -333,6 +341,7 @@ int rent[6] = {-1, -1, -1, -1, -1, -1}; int tax = -1; int taxPercentage = -1; + int passMoney = -1; QColor forceBg; // for groups @@ -399,9 +408,9 @@ type = Cards; } else if (key == "bgcolor") - { forceBg = QColor(value); - } + else if (key == "passmoney") + passMoney = value.toInt(); } else if (parseMode == Parse_EstateGroups) { @@ -458,6 +467,7 @@ estate->setTax(tax); estate->setTaxPercentage(taxPercentage); estate->setForceBg(forceBg); + estate->setPassMoney(passMoney); estates.append(estate); connect(estate, SIGNAL(LMBClicked(Estate *)), this, SLOT(changeEstate(Estate *))); @@ -616,7 +626,7 @@ } } if (!hasGo) - t << "go=1" << endl; + t << "go=" << 0 << endl; if (boardInfo.bgColor.isValid()) t << "bgcolor=" << boardInfo.bgColor.name() << endl; @@ -654,8 +664,13 @@ key = "advance"; } - if (key == "jailcard" || key == "tojail" || key == "nextrr" || key == "nextutil") + if (key == "outofjail" || key == "tojail" || key == "nextrr" || key == "nextutil") value = 1; + + if (key == "outofjail") + { + t << "canbeowned=" << 1 << endl; + } t << key << "=" << value << endl; } @@ -762,6 +777,9 @@ t << "bgcolor=" << estate->forceBg().name() << endl; break; } + + if (estate->passMoney() > 0) + t << "passmoney=" << estate->passMoney() << endl; } f.flush(); @@ -785,6 +803,7 @@ estate->setTakeCard(copiedEstate->takeCard()); estate->setType(copiedEstate->type()); estate->setName(copiedEstate->name()); + estate->setPassMoney(copiedEstate->passMoney()); editor->setEstate(estate); Index: editor.cpp =================================================================== RCS file: /home/kde/kdeaddons/atlantikdesigner/designer/editor.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- editor.cpp 2002/10/05 05:27:07 1.33 +++ editor.cpp 2002/11/09 19:41:37 1.34 @@ -30,7 +30,7 @@ ConfigEstate::ConfigEstate(int estateId) : Estate(estateId) { m_rent[0] = m_rent[1] = m_rent[2] = m_rent[3] = m_rent[4] = m_rent[5] = 0; - m_type = m_price = m_tax = m_taxPercentage = 0; + m_type = m_price = m_tax = m_taxPercentage = m_passMoney = 0; m_go = false; m_group = "Default"; } @@ -130,6 +130,15 @@ } } +void ConfigEstate::setPassMoney(const int passMoney) +{ + if (m_passMoney != passMoney) + { + m_passMoney = passMoney; + m_changed = true; + } +} + /////////////////////////// QStringList types; @@ -147,7 +156,7 @@ types.append("advance"); types.append("goback"); types.append("tojail"); - types.append("jailcard"); + types.append("outofjail"); types.append("nextutil"); types.append("nextrr"); types.append("payhouse"); @@ -162,7 +171,7 @@ connect(this, SIGNAL(somethingChanged()), this, SLOT(saveEstate())); - layout = new QGridLayout(this, 6, 1, KDialog::marginHint(), KDialog::spacingHint()); + layout = new QGridLayout(this, 7, 1, KDialog::marginHint(), KDialog::spacingHint()); nameEdit = new QLineEdit(this, "Name Edit"); layout->addWidget(nameEdit, 0, 0); connect(nameEdit, SIGNAL(returnPressed()), this, SIGNAL(somethingChanged())); @@ -188,6 +197,15 @@ connect(goCheck, SIGNAL(toggled(bool)), this, SLOT(goToggled(bool))); layout->addWidget(goCheck, 5, 0); + QHBoxLayout *passMoneyLayout = new QHBoxLayout(KDialog::spacingHint()); + layout->addLayout(passMoneyLayout, 6, 0); + QLabel *passMoneyLabel = new QLabel(i18n("Pass money:"), this); + passMoneyLayout->addWidget(passMoneyLabel); + passMoney = new QSpinBox(0, 3000, 10, this); + passMoney->setSpecialValueText(i18n("None")); + passMoney->setSuffix("$"); + passMoneyLayout->addWidget(passMoney); + QStringList estateTypes(i18n("Street")); estateTypes.append(i18n("Cards")); estateTypes.append(i18n("Free Parking")); @@ -229,6 +247,7 @@ nameEdit->setText(estate->name()); typeCombo->setCurrentItem(estate->type()); goCheck->setChecked(estate->go()); + passMoney->setValue(estate->passMoney()); ready = true; @@ -251,6 +270,7 @@ estate->setType(curType); estate->setName(nameEdit->text()); estate->setGo(goCheck->isChecked()); + estate->setPassMoney(passMoney->value()); } if (curType != Street) @@ -320,7 +340,9 @@ void EstateEdit::goToggled(bool on) { if (on) + { emit goChecked(estate->estateId()); + } } bool EstateEdit::upArrow() @@ -594,7 +616,7 @@ if (!number) return; - bool boolean = (key == "jailcard" || key == "tojail" || key == "nextrr" || key == "nextutil"); + bool boolean = (key == "outofjail" || key == "tojail" || key == "nextrr" || key == "nextutil"); if (boolean) { value->setValue(1); Index: editor.h =================================================================== RCS file: /home/kde/kdeaddons/atlantikdesigner/designer/editor.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- editor.h 2002/10/05 05:27:07 1.22 +++ editor.h 2002/11/09 19:41:37 1.23 @@ -45,6 +45,8 @@ void setForceBg(const QColor &); bool go() { return m_go; } void setGo(const bool); + int passMoney() { return m_passMoney; } + void setPassMoney(const int); void setChanged(bool); @@ -58,6 +60,7 @@ QString m_takeCard; QColor m_forceBg; bool m_go; + int m_passMoney; }; typedef QPtrList EstateList; @@ -140,6 +143,7 @@ KComboBox *typeCombo; QLineEdit *nameEdit; QCheckBox *goCheck; + QSpinBox *passMoney; QWidget *centerWidget; QGridLayout *layout; _______________________________________________ atlantik-cvs mailing list atlantik-cvs@mail.kde.org http://mail.kde.org/mailman/listinfo/atlantik-cvs