summaryrefslogtreecommitdiff
path: root/src/gui/recorder.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-30 17:49:31 -0700
committerIra Rice <irarice@gmail.com>2009-01-30 17:49:31 -0700
commit202280724138614924e473a693dc974929ef5836 (patch)
tree141c6111767b676f9a369b12e59e4b5328953568 /src/gui/recorder.cpp
parentff6cd3ac0855cf516e364382153a77f61521ccdb (diff)
downloadMana-202280724138614924e473a693dc974929ef5836.tar.gz
Mana-202280724138614924e473a693dc974929ef5836.tar.bz2
Mana-202280724138614924e473a693dc974929ef5836.tar.xz
Mana-202280724138614924e473a693dc974929ef5836.zip
Made the recorder class messages translatable, as well as moved the
recorder over to the layout code (not that it helps much at the moment). Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/recorder.cpp')
-rw-r--r--src/gui/recorder.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/gui/recorder.cpp b/src/gui/recorder.cpp
index 02eddbe5..9db1df2a 100644
--- a/src/gui/recorder.cpp
+++ b/src/gui/recorder.cpp
@@ -24,18 +24,33 @@
#include "button.h"
#include "chat.h"
#include "recorder.h"
+#include "windowcontainer.h"
+#include "widgets/layout.h"
+
+#include "../utils/gettext.h"
#include "../utils/trim.h"
Recorder::Recorder(ChatWindow *chat, const std::string &title,
const std::string &buttonTxt) :
Window(title)
{
+ setWindowName(_("Recorder"));
+ const int offsetX = 2 * getPadding() + 10;
+ const int offsetY = getTitleBarHeight() + getPadding() + 10;
+
mChat = chat;
Button *button = new Button(buttonTxt, "activate", this);
- setContentSize(button->getWidth() + 10, button->getHeight() + 10);
- button->setPosition(5, 5);
- add(button);
+ setDefaultSize(0, windowContainer->getHeight() - 123 - button->getHeight() -
+ offsetY, button->getWidth() + offsetX, button->getHeight() +
+ offsetY);
+
+ place(0, 0, button);
+
+ Layout &layout = getLayout();
+ layout.setRowHeight(0, Layout::AUTO_SET);
+
+ loadWindowState();
}
void Recorder::record(const std::string &msg)
@@ -62,16 +77,16 @@ void Recorder::changeRecordingStatus(const std::string &msg)
* Message should go after mStream is closed so that it isn't
* recorded.
*/
- mChat->chatLog("Finishing recording.", BY_SERVER);
+ mChat->chatLog(_("Finishing recording."), BY_SERVER);
}
else
{
- mChat->chatLog("Not currently recording.", BY_SERVER);
+ mChat->chatLog(_("Not currently recording."), BY_SERVER);
}
}
else if (mStream.is_open())
{
- mChat->chatLog("Already recording.", BY_SERVER);
+ mChat->chatLog(_("Already recording."), BY_SERVER);
}
else
{
@@ -79,7 +94,7 @@ void Recorder::changeRecordingStatus(const std::string &msg)
* Message should go before mStream is opened so that it isn't
* recorded.
*/
- mChat->chatLog("Starting to record...", BY_SERVER);
+ mChat->chatLog(_("Starting to record..."), BY_SERVER);
std::string file = std::string(PHYSFS_getUserDir()) + "/.aethyra/" + msgCopy;
mStream.open(file.c_str(), std::ios_base::trunc);
@@ -87,7 +102,7 @@ void Recorder::changeRecordingStatus(const std::string &msg)
if (mStream.is_open())
setVisible(true);
else
- mChat->chatLog("Failed to start recording.", BY_SERVER);
+ mChat->chatLog(_("Failed to start recording."), BY_SERVER);
}
}