diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-29 17:34:37 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-29 17:34:37 -0700 |
commit | 5a217925e3088bfbb187d274ced159754e2397c2 (patch) | |
tree | 6b873f69d25637695b039259367d4572ac1c8b66 /src | |
parent | d3ac12d94f6ddb25866e10856ec47919a4b6d7a6 (diff) | |
download | mana-client-5a217925e3088bfbb187d274ced159754e2397c2.tar.gz mana-client-5a217925e3088bfbb187d274ced159754e2397c2.tar.bz2 mana-client-5a217925e3088bfbb187d274ced159754e2397c2.tar.xz mana-client-5a217925e3088bfbb187d274ced159754e2397c2.zip |
Trimmed out a few help functions from some subclasses, and moved them
back to the chat class, where they really belong. Since the party class
parses its own suboptions, I left the suboptions within that class.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/chat.cpp | 13 | ||||
-rw-r--r-- | src/gui/recorder.cpp | 19 | ||||
-rw-r--r-- | src/gui/recorder.h | 15 | ||||
-rw-r--r-- | src/party.cpp | 5 | ||||
-rw-r--r-- | src/party.h | 1 |
5 files changed, 13 insertions, 40 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 3a22581f..36e33160 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -478,7 +478,7 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) else if (command == "whisper" || command == "msg" || command == "w") whisper(nick, msg); else if (command == "record") - mRecorder->changeStatus(msg); + mRecorder->changeRecordingStatus(msg); else if (command == "toggle") { if (msg == "") @@ -804,10 +804,11 @@ void ChatWindow::help(const std::string & msg1, const std::string & msg2) chatLog(_("/announce: Global announcement (GM only)"), BY_SERVER); chatLog(_("/clear: Clears this window"), BY_SERVER); chatLog(_("/help: Display this help"), BY_SERVER); - mParty->help(); + chatLog(_("/party <command> <params>: Party commands."), BY_SERVER); chatLog(_("/msg <nick> <message>: Alternate form for /whisper"), BY_SERVER); chatLog(_("/present: Get list of players present"), BY_SERVER); - mRecorder->help(); + chatLog(_("/record <filename>: Start recording the chat to an" + " external file."), BY_SERVER); chatLog(_("/toggle: Determine whether <return> toggles the chat log."), BY_SERVER); chatLog(_("/where: Display map name"), BY_SERVER); @@ -851,7 +852,11 @@ void ChatWindow::help(const std::string & msg1, const std::string & msg2) } else if (msg1 == "record") { - mRecorder->help2(); + chatLog(_("Command: /record <filename>"), BY_SERVER); + chatLog(_("This command starts recording the chat log to the file " + "<filename>."), BY_SERVER); + chatLog(_("Command: /record"), BY_SERVER); + chatLog(_("This command finishes a recording session."), BY_SERVER); } else if (msg1 == "toggle") { diff --git a/src/gui/recorder.cpp b/src/gui/recorder.cpp index da67875b..02eddbe5 100644 --- a/src/gui/recorder.cpp +++ b/src/gui/recorder.cpp @@ -46,7 +46,7 @@ void Recorder::record(const std::string &msg) } } -void Recorder::changeStatus(const std::string &msg) +void Recorder::changeRecordingStatus(const std::string &msg) { std::string msgCopy = msg; trim(msgCopy); @@ -91,24 +91,9 @@ void Recorder::changeStatus(const std::string &msg) } } -void Recorder::help() const -{ - mChat->chatLog("/record <filename>: Start recording the chat.", BY_SERVER); -} - -void Recorder::help2() const -{ - mChat->chatLog("Command: /record <filename>", BY_SERVER); - mChat->chatLog("This command starts recording the chat log to the file " - "<filename>.", BY_SERVER); - mChat->chatLog("Command: /record", BY_SERVER); - mChat->chatLog("This command finishes a recording session.", BY_SERVER); -} - void Recorder::action(const gcn::ActionEvent &event) { - if (event.getId() == "activate") - changeStatus(""); + changeRecordingStatus(""); } Recorder::~Recorder() diff --git a/src/gui/recorder.h b/src/gui/recorder.h index 6f917c25..420c4a2b 100644 --- a/src/gui/recorder.h +++ b/src/gui/recorder.h @@ -53,20 +53,9 @@ class Recorder : public Window, public gcn::ActionListener /* * Outputs the message to the recorder file * - * @param msg the line to write to the recorded file. - */ - void changeStatus(const std::string &msg); - - /* - * Displays a help message on how to use this class in the chat window. - */ - void help() const; - - /* - * Displays an extended help message on how to use this class in the - * chat window. + * @param msg The file to write out to. If null, then stop recording. */ - void help2() const; + void changeRecordingStatus(const std::string &msg); /* * Whether or not the recorder is in use. diff --git a/src/party.cpp b/src/party.cpp index ecb0ab2d..67262176 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -166,11 +166,6 @@ void Party::receiveChat(Being *being, const std::string &msg) mChat->chatLog(being->getName() + " : " + msg, BY_PARTY); } -void Party::help() -{ - mChat->chatLog(_("/party <command> <params>: Party commands."), BY_SERVER); -} - void Party::help(const std::string &msg) { if (msg == "") diff --git a/src/party.h b/src/party.h index 8d6dce47..5643f894 100644 --- a/src/party.h +++ b/src/party.h @@ -47,7 +47,6 @@ class Party void leftResponse(const std::string &nick); void receiveChat(Being *being, const std::string &msg); - void help(); void help(const std::string &msg); private: ChatWindow *mChat; |