diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-05-22 19:33:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-05-22 19:34:10 +0300 |
commit | 8fb121ec3791bfe3e4d4b1003fcc3397d0b0ea19 (patch) | |
tree | 08d6f69f2d65be1874d233c24d6f3355fb01f283 /src/gui/setup_players.cpp | |
parent | 668306a14e6ecfc6ce9b283b10f9f59cdab788a0 (diff) | |
download | plus-8fb121ec3791bfe3e4d4b1003fcc3397d0b0ea19.tar.gz plus-8fb121ec3791bfe3e4d4b1003fcc3397d0b0ea19.tar.bz2 plus-8fb121ec3791bfe3e4d4b1003fcc3397d0b0ea19.tar.xz plus-8fb121ec3791bfe3e4d4b1003fcc3397d0b0ea19.zip |
Add option to secure trades. Enabled by default.
If client detect problems, it cancel trade.
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r-- | src/gui/setup_players.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index 0b870ccd5..0290c24d5 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -229,6 +229,7 @@ public: #define ACTION_SHOW_LEVEL "show level" #define ACTION_TARGET_DEAD "target dead" #define ACTION_SHOW_OWN_NAME "show own name" +#define ACTION_SECURE_TRADES "secure trades" Setup_Players::Setup_Players(): mPlayerTableTitleModel(new StaticTableModel(1, COLUMNS_NR)), @@ -249,7 +250,8 @@ Setup_Players::Setup_Players(): mShowGenderCheckBox(new CheckBox(_("Show gender"), mShowGender)), mShowLevel(config.getBoolValue("showlevel")), mShowOwnName(config.getBoolValue("showownname")), - mTargetDead(config.getBoolValue("targetDeadPlayers")) + mTargetDead(config.getBoolValue("targetDeadPlayers")), + mSecureTrades(config.getBoolValue("securetrades")) { setName(_("Players")); @@ -311,6 +313,10 @@ Setup_Players::Setup_Players(): mTargetDeadCheckBox->setActionEventId(ACTION_TARGET_DEAD); mTargetDeadCheckBox->addActionListener(this); + mSecureTradesCheckBox = new CheckBox(_("Secure trades"), mSecureTrades); + mSecureTradesCheckBox->setActionEventId(ACTION_SECURE_TRADES); + mSecureTradesCheckBox->addActionListener(this); + reset(); // Do the layout @@ -326,8 +332,9 @@ Setup_Players::Setup_Players(): place(1, 5, mOldButton, 1); place(3, 5, ignore_action_label); place(3, 6, mIgnoreActionChoicesBox, 2).setPadding(2); - place(3, 7, mDefaultTrading); - place(3, 8, mDefaultWhisper); + place(3, 7, mDefaultTrading, 2); + place(3, 8, mDefaultWhisper, 2); + place(3, 9, mSecureTradesCheckBox, 2); place(0, 9, mWhisperTabCheckBox, 4).setPadding(4); place(0, 10, mTargetDeadCheckBox, 4).setPadding(4); @@ -381,6 +388,7 @@ void Setup_Players::apply() config.setValue("showownname", mShowOwnName); config.setValue("targetDeadPlayers", mTargetDead); config.setValue("showgender", mShowGender); + config.setValue("securetrades", mSecureTrades); if (actorSpriteManager) actorSpriteManager->updatePlayerNames(); @@ -401,6 +409,8 @@ void Setup_Players::cancel() mShowOwnNameCheckBox->setSelected(mShowOwnName); mTargetDead = config.getBoolValue("targetDeadPlayers"); mTargetDeadCheckBox->setSelected(mTargetDead); + mSecureTrades = config.getBoolValue("securetrades"); + mSecureTradesCheckBox->setSelected(mSecureTrades); } void Setup_Players::action(const gcn::ActionEvent &event) @@ -464,6 +474,10 @@ void Setup_Players::action(const gcn::ActionEvent &event) { mTargetDead = mTargetDeadCheckBox->isSelected(); } + else if (event.getId() == ACTION_SECURE_TRADES) + { + mSecureTrades = mSecureTradesCheckBox->isSelected(); + } } |