From 05ebb83ba4276aba863b59db32a2a2f1a6ac759a Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Sat, 25 Jun 2011 21:21:19 +0200 Subject: [PATCH] improved banning; added [url] and [card] tags for chat --- cockatrice/cockatrice.pro | 1 + cockatrice/src/chatview.cpp | 144 +++++++- cockatrice/src/chatview.h | 26 +- cockatrice/src/localserver.h | 2 +- cockatrice/src/messagelogwidget.cpp | 200 ++++------- cockatrice/src/messagelogwidget.h | 21 +- cockatrice/src/tab.cpp | 30 ++ cockatrice/src/tab.h | 8 +- cockatrice/src/tab_game.cpp | 29 +- cockatrice/src/tab_game.h | 5 +- cockatrice/src/tab_message.cpp | 4 +- cockatrice/src/tab_room.cpp | 4 +- cockatrice/src/tab_supervisor.cpp | 4 +- cockatrice/src/userlist.cpp | 54 ++- cockatrice/src/userlist.h | 14 + cockatrice/translations/cockatrice_cs.ts | 361 ++++++++++--------- cockatrice/translations/cockatrice_de.ts | 362 +++++++++++--------- cockatrice/translations/cockatrice_en.ts | 361 ++++++++++--------- cockatrice/translations/cockatrice_es.ts | 357 ++++++++++--------- cockatrice/translations/cockatrice_fr.ts | 357 ++++++++++--------- cockatrice/translations/cockatrice_ja.ts | 356 ++++++++++--------- cockatrice/translations/cockatrice_pl.ts | 361 ++++++++++--------- cockatrice/translations/cockatrice_pt-br.ts | 357 ++++++++++--------- cockatrice/translations/cockatrice_pt.ts | 357 ++++++++++--------- cockatrice/translations/cockatrice_ru.ts | 357 ++++++++++--------- cockatrice/translations/cockatrice_sk.ts | 361 ++++++++++--------- common/protocol_items.cpp | 3 +- common/protocol_items.dat | 2 +- common/protocol_items.h | 3 +- common/server.cpp | 2 +- common/server.h | 3 +- common/server_protocolhandler.cpp | 2 - servatrice/servatrice.sql | 10 +- servatrice/src/servatrice.cpp | 35 +- servatrice/src/servatrice.h | 5 +- servatrice/src/serversocketinterface.cpp | 16 +- 36 files changed, 2501 insertions(+), 2073 deletions(-) create mode 100644 cockatrice/src/tab.cpp diff --git a/cockatrice/cockatrice.pro b/cockatrice/cockatrice.pro index 04599409..b126f14a 100644 --- a/cockatrice/cockatrice.pro +++ b/cockatrice/cockatrice.pro @@ -136,6 +136,7 @@ SOURCES += src/abstractcounter.cpp \ src/gamescene.cpp \ src/arrowitem.cpp \ src/arrowtarget.cpp \ + src/tab.cpp \ src/tab_server.cpp \ src/tab_room.cpp \ src/tab_message.cpp \ diff --git a/cockatrice/src/chatview.cpp b/cockatrice/src/chatview.cpp index 625301e3..700313ee 100644 --- a/cockatrice/src/chatview.cpp +++ b/cockatrice/src/chatview.cpp @@ -2,34 +2,41 @@ #include #include #include +#include +#include #include "chatview.h" -ChatView::ChatView(const QString &_ownName, QWidget *parent) - : QTextEdit(parent), ownName(_ownName) +ChatView::ChatView(const QString &_ownName, bool _showTimestamps, QWidget *parent) + : QTextBrowser(parent), ownName(_ownName), showTimestamps(_showTimestamps) { - setTextInteractionFlags(Qt::TextSelectableByMouse); + setReadOnly(true); + setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse); + setOpenLinks(false); + connect(this, SIGNAL(anchorClicked(const QUrl &)), this, SLOT(openLink(const QUrl &))); } -void ChatView::appendMessage(QString sender, const QString &message) +void ChatView::appendMessage(QString sender, QString message) { QTextCursor cursor(document()->lastBlock()); cursor.movePosition(QTextCursor::End); QTextBlockFormat blockFormat; - blockFormat.setBottomMargin(3); + blockFormat.setBottomMargin(2); cursor.insertBlock(blockFormat); - QTextCharFormat timeFormat; - timeFormat.setForeground(Qt::black); - cursor.setCharFormat(timeFormat); - cursor.insertText(QDateTime::currentDateTime().toString("[hh:mm] ")); + if (showTimestamps) { + QTextCharFormat timeFormat; + timeFormat.setForeground(Qt::black); + cursor.setCharFormat(timeFormat); + cursor.insertText(QDateTime::currentDateTime().toString("[hh:mm] ")); + } QTextCharFormat senderFormat; if (sender == ownName) { senderFormat.setFontWeight(QFont::Bold); senderFormat.setForeground(Qt::red); } else - senderFormat.setForeground(Qt::blue); + senderFormat.setForeground(QColor(0, 0, 254)); cursor.setCharFormat(senderFormat); if (!sender.isEmpty()) sender.append(": "); @@ -39,7 +46,122 @@ void ChatView::appendMessage(QString sender, const QString &message) if (sender.isEmpty()) messageFormat.setForeground(Qt::darkGreen); cursor.setCharFormat(messageFormat); - cursor.insertText(message); + + int from = 0, index = 0; + while ((index = message.indexOf('[', from)) != -1) { + cursor.insertText(message.left(index)); + message = message.mid(index); + if (message.isEmpty()) + break; + + if (message.startsWith("[card]")) { + message = message.mid(6); + QTextCharFormat tempFormat = messageFormat; + tempFormat.setForeground(Qt::blue); + cursor.setCharFormat(tempFormat); + int closeTagIndex = message.indexOf("[/card]"); + cursor.insertText(message.left(closeTagIndex)); + cursor.setCharFormat(messageFormat); + if (closeTagIndex == -1) + message.clear(); + else + message = message.mid(closeTagIndex + 7); + } else if (message.startsWith("[url]")) { + message = message.mid(5); + int closeTagIndex = message.indexOf("[/url]"); + QString url = message.left(closeTagIndex); + if (!url.startsWith("http://")) + url.prepend("http://"); + QTextCharFormat tempFormat = messageFormat; + tempFormat.setForeground(QColor(0, 0, 254)); + tempFormat.setAnchor(true); + tempFormat.setAnchorHref(url); + cursor.setCharFormat(tempFormat); + cursor.insertText(url); + cursor.setCharFormat(messageFormat); + if (closeTagIndex == -1) + message.clear(); + else + message = message.mid(closeTagIndex + 6); + } else + from = 1; + } + if (!message.isEmpty()) + cursor.insertText(message); verticalScrollBar()->setValue(verticalScrollBar()->maximum()); } + +void ChatView::enterEvent(QEvent * /*event*/) +{ + setMouseTracking(true); +} + +void ChatView::leaveEvent(QEvent * /*event*/) +{ + setMouseTracking(false); +} + +QTextFragment ChatView::getFragmentUnderMouse(const QPoint &pos) const +{ + QTextCursor cursor(cursorForPosition(pos)); + QTextBlock block(cursor.block()); + QTextBlock::iterator it; + for (it = block.begin(); !(it.atEnd()); ++it) { + QTextFragment frag = it.fragment(); + if (frag.contains(cursor.position())) + return frag; + } + return QTextFragment(); +} + +QString ChatView::getCardNameUnderMouse(QTextFragment frag) const +{ + if (frag.charFormat().foreground().color() == Qt::blue) + return frag.text(); + return QString(); +} + +QString ChatView::getCardNameUnderMouse(const QPoint &pos) const +{ + return getCardNameUnderMouse(getFragmentUnderMouse(pos)); +} + +void ChatView::mouseMoveEvent(QMouseEvent *event) +{ + QTextFragment frag = getFragmentUnderMouse(event->pos()); + QString cardName = getCardNameUnderMouse(frag); + if (!cardName.isEmpty()) { + viewport()->setCursor(Qt::PointingHandCursor); + emit cardNameHovered(cardName); + } else if (frag.charFormat().isAnchor()) + viewport()->setCursor(Qt::PointingHandCursor); + else + viewport()->setCursor(Qt::IBeamCursor); + + QTextBrowser::mouseMoveEvent(event); +} + +void ChatView::mousePressEvent(QMouseEvent *event) +{ + if (event->button() == Qt::MidButton) { + QString cardName = getCardNameUnderMouse(event->pos()); + if (!cardName.isEmpty()) + emit showCardInfoPopup(event->globalPos(), cardName); + } + + QTextBrowser::mousePressEvent(event); +} + +void ChatView::mouseReleaseEvent(QMouseEvent *event) +{ + if (event->button() == Qt::MidButton) + emit deleteCardInfoPopup(); + + QTextBrowser::mouseReleaseEvent(event); +} + +void ChatView::openLink(const QUrl &link) +{ + QDesktopServices::openUrl(link); +} diff --git a/cockatrice/src/chatview.h b/cockatrice/src/chatview.h index bd7e763a..c17f2375 100644 --- a/cockatrice/src/chatview.h +++ b/cockatrice/src/chatview.h @@ -1,18 +1,36 @@ #ifndef CHATVIEW_H #define CHATVIEW_H -#include +#include +#include class QTextTable; +class QMouseEvent; -class ChatView : public QTextEdit { +class ChatView : public QTextBrowser { Q_OBJECT; private: QTextTable *table; QString ownName; + bool showTimestamps; + QTextFragment getFragmentUnderMouse(const QPoint &pos) const; + QString getCardNameUnderMouse(QTextFragment frag) const; + QString getCardNameUnderMouse(const QPoint &pos) const; +private slots: + void openLink(const QUrl &link); public: - ChatView(const QString &_ownName, QWidget *parent = 0); - void appendMessage(QString sender, const QString &message); + ChatView(const QString &_ownName, bool _showTimestamps, QWidget *parent = 0); + void appendMessage(QString sender, QString message); +protected: + void enterEvent(QEvent *event); + void leaveEvent(QEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); +signals: + void cardNameHovered(QString cardName); + void showCardInfoPopup(QPoint pos, QString cardName); + void deleteCardInfoPopup(); }; #endif \ No newline at end of file diff --git a/cockatrice/src/localserver.h b/cockatrice/src/localserver.h index b68e4f25..406b3bff 100644 --- a/cockatrice/src/localserver.h +++ b/cockatrice/src/localserver.h @@ -11,7 +11,7 @@ class LocalServer : public Server public: LocalServer(QObject *parent = 0); ~LocalServer(); - AuthenticationResult checkUserPassword(const QString & /*user*/, const QString & /*password*/) { return UnknownUser; } + AuthenticationResult checkUserPassword(Server_ProtocolHandler * /*handler*/, const QString & /*user*/, const QString & /*password*/) { return UnknownUser; } QString getLoginMessage() const { return QString(); } bool getGameShouldPing() const { return false; } int getMaxGameInactivityTime() const { return 9999999; } diff --git a/cockatrice/src/messagelogwidget.cpp b/cockatrice/src/messagelogwidget.cpp index 9bb86706..216fe138 100644 --- a/cockatrice/src/messagelogwidget.cpp +++ b/cockatrice/src/messagelogwidget.cpp @@ -1,11 +1,9 @@ #include "messagelogwidget.h" #include "player.h" #include "cardzone.h" -#include "cardinfowidget.h" #include "protocol_items.h" #include "soundengine.h" -#include -#include +#include QString MessageLogWidget::sanitizeHtml(QString dirty) const { @@ -15,6 +13,20 @@ QString MessageLogWidget::sanitizeHtml(QString dirty) const .replace(">", ">"); } +void MessageLogWidget::myAppend(const QString &message) +{ + QTextCursor cursor(document()->lastBlock()); + cursor.movePosition(QTextCursor::End); + + QTextBlockFormat blockFormat; + blockFormat.setBottomMargin(2); + cursor.insertBlock(blockFormat); + + cursor.insertHtml(message); + + verticalScrollBar()->setValue(verticalScrollBar()->maximum()); +} + bool MessageLogWidget::isFemale(Player *player) const { return player->getUserInfo()->getGender() == ServerInfo_User::Female; @@ -22,129 +34,129 @@ bool MessageLogWidget::isFemale(Player *player) const void MessageLogWidget::logConnecting(QString hostname) { - append(tr("Connecting to %1...").arg(sanitizeHtml(hostname))); + myAppend(tr("Connecting to %1...").arg(sanitizeHtml(hostname))); } void MessageLogWidget::logConnected() { - append(tr("Connected.")); + myAppend(tr("Connected.")); } void MessageLogWidget::logDisconnected() { - append(tr("Disconnected from server.")); + myAppend(tr("Disconnected from server.")); } void MessageLogWidget::logSocketError(const QString &errorString) { - append(sanitizeHtml(errorString)); + myAppend(sanitizeHtml(errorString)); } void MessageLogWidget::logServerError(ResponseCode response) { switch (response) { - case RespWrongPassword: append(tr("Invalid password.")); break; + case RespWrongPassword: myAppend(tr("Invalid password.")); break; default: ; } } void MessageLogWidget::logProtocolVersionMismatch(int clientVersion, int serverVersion) { - append(tr("Protocol version mismatch. Client: %1, Server: %2").arg(clientVersion).arg(serverVersion)); + myAppend(tr("Protocol version mismatch. Client: %1, Server: %2").arg(clientVersion).arg(serverVersion)); } void MessageLogWidget::logProtocolError() { - append(tr("Protocol error.")); + myAppend(tr("Protocol error.")); } void MessageLogWidget::logGameJoined(int gameId) { - append(tr("You have joined game #%1.").arg(gameId)); + myAppend(tr("You have joined game #%1.").arg(gameId)); } void MessageLogWidget::logJoin(Player *player) { soundEngine->notification(); - append(tr("%1 has joined the game.").arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 has joined the game.").arg(sanitizeHtml(player->getName()))); } void MessageLogWidget::logLeave(Player *player) { - append(tr("%1 has left the game.").arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 has left the game.").arg(sanitizeHtml(player->getName()))); } void MessageLogWidget::logGameClosed() { - append(tr("The game has been closed.")); + myAppend(tr("The game has been closed.")); } void MessageLogWidget::logJoinSpectator(QString name) { - append(tr("%1 is now watching the game.").arg(sanitizeHtml(name))); + myAppend(tr("%1 is now watching the game.").arg(sanitizeHtml(name))); } void MessageLogWidget::logLeaveSpectator(QString name) { - append(tr("%1 is not watching the game any more.").arg(sanitizeHtml(name))); + myAppend(tr("%1 is not watching the game any more.").arg(sanitizeHtml(name))); } void MessageLogWidget::logDeckSelect(Player *player, int deckId) { if (deckId == -1) - append(tr("%1 has loaded a local deck.").arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 has loaded a local deck.").arg(sanitizeHtml(player->getName()))); else - append(tr("%1 has loaded deck #%2.").arg(sanitizeHtml(player->getName())).arg(deckId)); + myAppend(tr("%1 has loaded deck #%2.").arg(sanitizeHtml(player->getName())).arg(deckId)); } void MessageLogWidget::logReadyStart(Player *player) { - append(tr("%1 is ready to start the game.").arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 is ready to start the game.").arg(sanitizeHtml(player->getName()))); } void MessageLogWidget::logNotReadyStart(Player *player) { - append(tr("%1 is not ready to start the game any more.").arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 is not ready to start the game any more.").arg(sanitizeHtml(player->getName()))); } void MessageLogWidget::logConcede(Player *player) { - append(tr("%1 has conceded the game.").arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 has conceded the game.").arg(sanitizeHtml(player->getName()))); } void MessageLogWidget::logGameStart() { - append(tr("The game has started.")); + myAppend(tr("The game has started.")); } void MessageLogWidget::logConnectionStateChanged(Player *player, bool connectionState) { if (connectionState) - append(tr("%1 has restored connection to the game.").arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 has restored connection to the game.").arg(sanitizeHtml(player->getName()))); else - append(tr("%1 has lost connection to the game.").arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 has lost connection to the game.").arg(sanitizeHtml(player->getName()))); } void MessageLogWidget::logSay(Player *player, QString message) { - append(QString("getLocal() ? "red" : "#0000fe") + QString("\">%1: %2").arg(sanitizeHtml(player->getName())).arg(sanitizeHtml(message))); + appendMessage(player->getName(), message); } void MessageLogWidget::logSpectatorSay(QString spectatorName, QString message) { - append(QString("%1: %2").arg(sanitizeHtml(spectatorName)).arg(sanitizeHtml(message))); + myAppend(QString("%1: %2").arg(sanitizeHtml(spectatorName)).arg(sanitizeHtml(message))); } void MessageLogWidget::logShuffle(Player *player, CardZone *zone) { soundEngine->shuffle(); if (currentContext != MessageContext_Mulligan) - append(tr("%1 shuffles %2.").arg(sanitizeHtml(player->getName())).arg(zone->getTranslatedName(true, CaseAccusative))); + myAppend(tr("%1 shuffles %2.").arg(sanitizeHtml(player->getName())).arg(zone->getTranslatedName(true, CaseAccusative))); } void MessageLogWidget::logRollDie(Player *player, int sides, int roll) { - append(tr("%1 rolls a %2 with a %3-sided die.").arg(sanitizeHtml(player->getName())).arg(roll).arg(sides)); + myAppend(tr("%1 rolls a %2 with a %3-sided die.").arg(sanitizeHtml(player->getName())).arg(roll).arg(sides)); } void MessageLogWidget::logDrawCards(Player *player, int number) @@ -153,16 +165,16 @@ void MessageLogWidget::logDrawCards(Player *player, int number) mulliganPlayer = player; else { soundEngine->draw(); - append(tr("%1 draws %n card(s).", "", number).arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 draws %n card(s).", "", number).arg(sanitizeHtml(player->getName()))); } } void MessageLogWidget::logUndoDraw(Player *player, QString cardName) { if (cardName.isEmpty()) - append((isFemale(player) ? tr("%1 undoes her last draw.") : tr("%1 undoes his last draw.")).arg(sanitizeHtml(player->getName()))); + myAppend((isFemale(player) ? tr("%1 undoes her last draw.") : tr("%1 undoes his last draw.")).arg(sanitizeHtml(player->getName()))); else - append((isFemale(player) ? tr("%1 undoes her last draw (%2).") : tr("%1 undoes his last draw (%2).")).arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName)))); + myAppend((isFemale(player) ? tr("%1 undoes her last draw (%2).") : tr("%1 undoes his last draw (%2).")).arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName)))); } QPair MessageLogWidget::getFromStr(CardZone *zone, QString cardName, int position) const @@ -227,7 +239,7 @@ void MessageLogWidget::doMoveCard(LogMoveCard &attributes) cardStr = QString("%1").arg(sanitizeHtml(cardName)); if (attributes.startZone->getPlayer() != attributes.targetZone->getPlayer()) { - append(tr("%1 gives %2 control over %3.").arg(sanitizeHtml(attributes.player->getName())).arg(sanitizeHtml(attributes.targetZone->getPlayer()->getName())).arg(cardStr)); + myAppend(tr("%1 gives %2 control over %3.").arg(sanitizeHtml(attributes.player->getName())).arg(sanitizeHtml(attributes.targetZone->getPlayer()->getName())).arg(cardStr)); return; } @@ -260,7 +272,7 @@ void MessageLogWidget::doMoveCard(LogMoveCard &attributes) finalStr = tr("%1 plays %2%3."); } - append(finalStr.arg(sanitizeHtml(attributes.player->getName())).arg(cardStr).arg(fromStr).arg(attributes.newX)); + myAppend(finalStr.arg(sanitizeHtml(attributes.player->getName())).arg(cardStr).arg(fromStr).arg(attributes.newX)); } void MessageLogWidget::logMoveCard(Player *player, CardItem *card, CardZone *startZone, int oldX, CardZone *targetZone, int newX) @@ -280,50 +292,50 @@ void MessageLogWidget::logMulligan(Player *player, int number) return; if (number > -1) - append(tr("%1 takes a mulligan to %n.", "", number).arg(sanitizeHtml(player->getName()))); + myAppend(tr("%1 takes a mulligan to %n.", "", number).arg(sanitizeHtml(player->getName()))); else - append((isFemale(player) ? tr("%1 draws her initial hand.") : tr("%1 draws his initial hand.")).arg(sanitizeHtml(player->getName()))); + myAppend((isFemale(player) ? tr("%1 draws her initial hand.") : tr("%1 draws his initial hand.")).arg(sanitizeHtml(player->getName()))); } void MessageLogWidget::logFlipCard(Player *player, QString cardName, bool faceDown) { if (faceDown) - append(tr("%1 flips %2 face-down.").arg(sanitizeHtml(player->getName())).arg(cardName)); + myAppend(tr("%1 flips %2 face-down.").arg(sanitizeHtml(player->getName())).arg(cardName)); else - append(tr("%1 flips %2 face-up.").arg(sanitizeHtml(player->getName())).arg(cardName)); + myAppend(tr("%1 flips %2 face-up.").arg(sanitizeHtml(player->getName())).arg(cardName)); } void MessageLogWidget::logDestroyCard(Player *player, QString cardName) { - append(tr("%1 destroys %2.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName)))); + myAppend(tr("%1 destroys %2.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName)))); } void MessageLogWidget::logAttachCard(Player *player, QString cardName, Player *targetPlayer, QString targetCardName) { - append(tr("%1 attaches %2 to %3's %4.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName))).arg(sanitizeHtml(targetPlayer->getName())).arg(QString("%1").arg(sanitizeHtml(targetCardName)))); + myAppend(tr("%1 attaches %2 to %3's %4.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName))).arg(sanitizeHtml(targetPlayer->getName())).arg(QString("%1").arg(sanitizeHtml(targetCardName)))); } void MessageLogWidget::logUnattachCard(Player *player, QString cardName) { - append(tr("%1 unattaches %2.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName)))); + myAppend(tr("%1 unattaches %2.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName)))); } void MessageLogWidget::logCreateToken(Player *player, QString cardName, QString pt) { - append(tr("%1 creates token: %2%3.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName))).arg(pt.isEmpty() ? QString() : QString(" (%1)").arg(sanitizeHtml(pt)))); + myAppend(tr("%1 creates token: %2%3.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(cardName))).arg(pt.isEmpty() ? QString() : QString(" (%1)").arg(sanitizeHtml(pt)))); } void MessageLogWidget::logCreateArrow(Player *player, Player *startPlayer, QString startCard, Player *targetPlayer, QString targetCard, bool playerTarget) { if (playerTarget) - append(tr("%1 points from %2's %3 to %4.") + myAppend(tr("%1 points from %2's %3 to %4.") .arg(sanitizeHtml(player->getName())) .arg(sanitizeHtml(startPlayer->getName())) .arg(sanitizeHtml(startCard)) .arg(sanitizeHtml(targetPlayer->getName())) ); else - append(tr("%1 points from %2's %3 to %4's %5.") + myAppend(tr("%1 points from %2's %3 to %4's %5.") .arg(sanitizeHtml(player->getName())) .arg(sanitizeHtml(startPlayer->getName())) .arg(sanitizeHtml(startCard)) @@ -349,7 +361,7 @@ void MessageLogWidget::logSetCardCounter(Player *player, QString cardName, int c default: ; } - append(finalStr.arg(sanitizeHtml(player->getName())).arg(colorStr).arg(QString("%1").arg(sanitizeHtml(cardName))).arg(value)); + myAppend(finalStr.arg(sanitizeHtml(player->getName())).arg(colorStr).arg(QString("%1").arg(sanitizeHtml(cardName))).arg(value)); } void MessageLogWidget::logSetTapped(Player *player, CardItem *card, bool tapped) @@ -367,13 +379,13 @@ void MessageLogWidget::logSetTapped(Player *player, CardItem *card, bool tapped) cardStr = isFemale(player) ? tr("her permanents") : tr("his permanents"); else cardStr = QString("%1").arg(sanitizeHtml(card->getName())); - append(tr("%1 %2 %3.").arg(sanitizeHtml(player->getName())).arg(tapped ? tr("taps") : tr("untaps")).arg(cardStr)); + myAppend(tr("%1 %2 %3.").arg(sanitizeHtml(player->getName())).arg(tapped ? tr("taps") : tr("untaps")).arg(cardStr)); } } void MessageLogWidget::logSetCounter(Player *player, QString counterName, int value, int oldValue) { - append(tr("%1 sets counter %2 to %3 (%4%5).").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(counterName))).arg(QString("%1").arg(value)).arg(value > oldValue ? "+" : "").arg(value - oldValue)); + myAppend(tr("%1 sets counter %2 to %3 (%4%5).").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(counterName))).arg(QString("%1").arg(value)).arg(value > oldValue ? "+" : "").arg(value - oldValue)); } void MessageLogWidget::logSetDoesntUntap(Player *player, CardItem *card, bool doesntUntap) @@ -383,7 +395,7 @@ void MessageLogWidget::logSetDoesntUntap(Player *player, CardItem *card, bool do finalStr = tr("%1 sets %2 to not untap normally."); else finalStr = tr("%1 sets %2 to untap normally."); - append(finalStr.arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(card->getName())))); + myAppend(finalStr.arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(card->getName())))); } void MessageLogWidget::logSetPT(Player *player, CardItem *card, QString newPT) @@ -391,26 +403,26 @@ void MessageLogWidget::logSetPT(Player *player, CardItem *card, QString newPT) if (currentContext == MessageContext_MoveCard) moveCardPT.insert(card, newPT); else - append(tr("%1 sets PT of %2 to %3.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(card->getName()))).arg(QString("%1").arg(sanitizeHtml(newPT)))); + myAppend(tr("%1 sets PT of %2 to %3.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(card->getName()))).arg(QString("%1").arg(sanitizeHtml(newPT)))); } void MessageLogWidget::logSetAnnotation(Player *player, CardItem *card, QString newAnnotation) { - append(tr("%1 sets annotation of %2 to %3.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(card->getName()))).arg(QString("%1").arg(sanitizeHtml(newAnnotation)))); + myAppend(tr("%1 sets annotation of %2 to %3.").arg(sanitizeHtml(player->getName())).arg(QString("%1").arg(sanitizeHtml(card->getName()))).arg(QString("%1").arg(sanitizeHtml(newAnnotation)))); } void MessageLogWidget::logDumpZone(Player *player, CardZone *zone, int numberCards) { if (numberCards != -1) - append(tr("%1 is looking at the top %2 cards %3.").arg(sanitizeHtml(player->getName())).arg(numberCards).arg(zone->getTranslatedName(zone->getPlayer() == player, CaseGenitive))); + myAppend(tr("%1 is looking at the top %2 cards %3.").arg(sanitizeHtml(player->getName())).arg(numberCards).arg(zone->getTranslatedName(zone->getPlayer() == player, CaseGenitive))); else - append(tr("%1 is looking at %2.").arg(sanitizeHtml(player->getName())).arg(zone->getTranslatedName(zone->getPlayer() == player, CaseAccusative))); + myAppend(tr("%1 is looking at %2.").arg(sanitizeHtml(player->getName())).arg(zone->getTranslatedName(zone->getPlayer() == player, CaseAccusative))); } void MessageLogWidget::logStopDumpZone(Player *player, CardZone *zone) { QString zoneName = zone->getTranslatedName(zone->getPlayer() == player, CaseAccusative); - append(tr("%1 stops looking at %2.").arg(sanitizeHtml(player->getName())).arg(zoneName)); + myAppend(tr("%1 stops looking at %2.").arg(sanitizeHtml(player->getName())).arg(zoneName)); } void MessageLogWidget::logRevealCards(Player *player, CardZone *zone, int cardId, QString cardName, Player *otherPlayer) @@ -433,28 +445,28 @@ void MessageLogWidget::logRevealCards(Player *player, CardZone *zone, int cardId if (cardId == -1) { if (otherPlayer) - append(tr("%1 reveals %2 to %3.").arg(sanitizeHtml(player->getName())).arg(zone->getTranslatedName(true, CaseAccusative)).arg(sanitizeHtml(otherPlayer->getName()))); + myAppend(tr("%1 reveals %2 to %3.").arg(sanitizeHtml(player->getName())).arg(zone->getTranslatedName(true, CaseAccusative)).arg(sanitizeHtml(otherPlayer->getName()))); else - append(tr("%1 reveals %2.").arg(sanitizeHtml(player->getName())).arg(zone->getTranslatedName(true, CaseAccusative))); + myAppend(tr("%1 reveals %2.").arg(sanitizeHtml(player->getName())).arg(zone->getTranslatedName(true, CaseAccusative))); } else if (cardId == -2) { if (otherPlayer) - append(tr("%1 randomly reveals %2%3 to %4.").arg(sanitizeHtml(player->getName())).arg(cardStr).arg(fromStr).arg(sanitizeHtml(otherPlayer->getName()))); + myAppend(tr("%1 randomly reveals %2%3 to %4.").arg(sanitizeHtml(player->getName())).arg(cardStr).arg(fromStr).arg(sanitizeHtml(otherPlayer->getName()))); else - append(tr("%1 randomly reveals %2%3.").arg(sanitizeHtml(player->getName())).arg(cardStr).arg(fromStr)); + myAppend(tr("%1 randomly reveals %2%3.").arg(sanitizeHtml(player->getName())).arg(cardStr).arg(fromStr)); } else { if (otherPlayer) - append(tr("%1 reveals %2%3 to %4.").arg(sanitizeHtml(player->getName())).arg(cardStr).arg(fromStr).arg(sanitizeHtml(otherPlayer->getName()))); + myAppend(tr("%1 reveals %2%3 to %4.").arg(sanitizeHtml(player->getName())).arg(cardStr).arg(fromStr).arg(sanitizeHtml(otherPlayer->getName()))); else - append(tr("%1 reveals %2%3.").arg(sanitizeHtml(player->getName())).arg(cardStr).arg(fromStr)); + myAppend(tr("%1 reveals %2%3.").arg(sanitizeHtml(player->getName())).arg(cardStr).arg(fromStr)); } } void MessageLogWidget::logSetActivePlayer(Player *player) { soundEngine->notification(); - append(QString()); - append("" + tr("It is now %1's turn.").arg(player->getName()) + ""); - append(QString()); + myAppend(QString()); + myAppend("" + tr("It is now %1's turn.").arg(player->getName()) + ""); + myAppend(QString()); } void MessageLogWidget::logSetActivePhase(int phase) @@ -474,7 +486,7 @@ void MessageLogWidget::logSetActivePhase(int phase) case 9: phaseName = tr("second main phase"); break; case 10: phaseName = tr("ending phase"); break; } - append("" + tr("It is now the %1.").arg(phaseName) + ""); + myAppend("" + tr("It is now the %1.").arg(phaseName) + ""); } void MessageLogWidget::containerProcessingStarted(GameEventContext *_context) @@ -531,67 +543,7 @@ void MessageLogWidget::connectToPlayer(Player *player) connect(player, SIGNAL(logRevealCards(Player *, CardZone *, int, QString, Player *)), this, SLOT(logRevealCards(Player *, CardZone *, int, QString, Player *))); } -MessageLogWidget::MessageLogWidget(QWidget *parent) - : QTextEdit(parent) +MessageLogWidget::MessageLogWidget(const QString &_ownName, QWidget *parent) + : ChatView(_ownName, false, parent) { - setReadOnly(true); -} - -void MessageLogWidget::enterEvent(QEvent * /*event*/) -{ - setMouseTracking(true); -} - -void MessageLogWidget::leaveEvent(QEvent * /*event*/) -{ - setMouseTracking(false); -} - -QString MessageLogWidget::getCardNameUnderMouse(const QPoint &pos) const -{ - QTextCursor cursor(cursorForPosition(pos)); - QTextBlock block(cursor.block()); - QTextBlock::iterator it; - for (it = block.begin(); !(it.atEnd()); ++it) { - QTextFragment frag = it.fragment(); - if (!frag.contains(cursor.position())) - continue; - - if (frag.charFormat().foreground().color() == Qt::blue) - return frag.text(); - - break; - } - return QString(); -} - -void MessageLogWidget::mouseMoveEvent(QMouseEvent *event) -{ - QString cardName = getCardNameUnderMouse(event->pos()); - if (!cardName.isEmpty()) { - viewport()->setCursor(Qt::PointingHandCursor); - emit cardNameHovered(cardName); - } else - viewport()->setCursor(Qt::IBeamCursor); - - QTextEdit::mouseMoveEvent(event); -} - -void MessageLogWidget::mousePressEvent(QMouseEvent *event) -{ - if (event->button() == Qt::MidButton) { - QString cardName = getCardNameUnderMouse(event->pos()); - if (!cardName.isEmpty()) - emit showCardInfoPopup(event->globalPos(), cardName); - } - - QTextEdit::mousePressEvent(event); -} - -void MessageLogWidget::mouseReleaseEvent(QMouseEvent *event) -{ - if (event->button() == Qt::MidButton) - emit deleteCardInfoPopup(); - - QTextEdit::mouseReleaseEvent(event); } diff --git a/cockatrice/src/messagelogwidget.h b/cockatrice/src/messagelogwidget.h index efc8f6b5..c99851af 100644 --- a/cockatrice/src/messagelogwidget.h +++ b/cockatrice/src/messagelogwidget.h @@ -1,15 +1,13 @@ #ifndef MESSAGELOGWIDGET_H #define MESSAGELOGWIDGET_H -#include +#include "chatview.h" #include #include "translation.h" #include "protocol_datastructures.h" class Player; class CardZone; -class QMouseEvent; -class QEvent; class CardInfoWidget; class GameEventContext; class CardItem; @@ -24,16 +22,15 @@ struct LogMoveCard { int newX; }; -class MessageLogWidget : public QTextEdit { +class MessageLogWidget : public ChatView { Q_OBJECT private: enum MessageContext { MessageContext_None, MessageContext_MoveCard, MessageContext_Mulligan }; - CardInfoWidget *infoWidget; QString sanitizeHtml(QString dirty) const; + void myAppend(const QString &message); bool isFemale(Player *player) const; QPair getFromStr(CardZone *zone, QString cardName, int position) const; - QString getCardNameUnderMouse(const QPoint &pos) const; MessageContext currentContext; QList moveCardQueue; @@ -42,10 +39,6 @@ private: Player *mulliganPlayer; int mulliganNumber; -signals: - void cardNameHovered(QString cardName); - void showCardInfoPopup(QPoint pos, QString cardName); - void deleteCardInfoPopup(); public slots: void logConnecting(QString hostname); void logConnected(); @@ -96,13 +89,7 @@ public slots: void containerProcessingDone(); public: void connectToPlayer(Player *player); - MessageLogWidget(QWidget *parent = 0); -protected: - void enterEvent(QEvent *event); - void leaveEvent(QEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); + MessageLogWidget(const QString &_ownName, QWidget *parent = 0); }; #endif diff --git a/cockatrice/src/tab.cpp b/cockatrice/src/tab.cpp new file mode 100644 index 00000000..e85d4091 --- /dev/null +++ b/cockatrice/src/tab.cpp @@ -0,0 +1,30 @@ +#include "tab.h" +#include "cardinfowidget.h" +#include +#include + +Tab::Tab(TabSupervisor *_tabSupervisor, QWidget *parent) + : QWidget(parent), tabMenu(0), tabSupervisor(_tabSupervisor), contentsChanged(false), infoPopup(0) +{ +} + +void Tab::showCardInfoPopup(const QPoint &pos, const QString &cardName) +{ + infoPopup = new CardInfoWidget(CardInfoWidget::ModePopUp, 0, Qt::Widget | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint); + infoPopup->setAttribute(Qt::WA_TransparentForMouseEvents); + infoPopup->setCard(cardName); + QRect screenRect = qApp->desktop()->screenGeometry(this); + infoPopup->move( + qMax(screenRect.left(), qMin(pos.x() - infoPopup->width() / 2, screenRect.left() + screenRect.width() - infoPopup->width())), + qMax(screenRect.top(), qMin(pos.y() - infoPopup->height() / 2, screenRect.top() + screenRect.height() - infoPopup->height())) + ); + infoPopup->show(); +} + +void Tab::deleteCardInfoPopup() +{ + if (infoPopup) { + infoPopup->deleteLater(); + infoPopup = 0; + } +} diff --git a/cockatrice/src/tab.h b/cockatrice/src/tab.h index 5f50813c..ac4b0ea5 100644 --- a/cockatrice/src/tab.h +++ b/cockatrice/src/tab.h @@ -5,6 +5,7 @@ class QMenu; class TabSupervisor; +class CardInfoWidget; class Tab : public QWidget { Q_OBJECT @@ -13,11 +14,14 @@ signals: protected: QMenu *tabMenu; TabSupervisor *tabSupervisor; +protected slots: + void showCardInfoPopup(const QPoint &pos, const QString &cardName); + void deleteCardInfoPopup(); private: bool contentsChanged; + CardInfoWidget *infoPopup; public: - Tab(TabSupervisor *_tabSupervisor, QWidget *parent = 0) - : QWidget(parent), tabMenu(0), tabSupervisor(_tabSupervisor), contentsChanged(false) { } + Tab(TabSupervisor *_tabSupervisor, QWidget *parent = 0); QMenu *getTabMenu() const { return tabMenu; } bool getContentsChanged() const { return contentsChanged; } void setContentsChanged(bool _contentsChanged) { contentsChanged = _contentsChanged; } diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index e8018c98..04c15c50 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -5,8 +5,6 @@ #include #include #include -#include -#include #include "tab_game.h" #include "cardinfowidget.h" #include "playerlistwidget.h" @@ -160,8 +158,8 @@ void DeckViewContainer::setDeck(DeckList *deck) readyStartButton->setEnabled(true); } -TabGame::TabGame(TabSupervisor *_tabSupervisor, QList &_clients, int _gameId, const QString &_gameDescription, int _localPlayerId, bool _spectator, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, bool _resuming) - : Tab(_tabSupervisor), clients(_clients), gameId(_gameId), gameDescription(_gameDescription), localPlayerId(_localPlayerId), spectator(_spectator), spectatorsCanTalk(_spectatorsCanTalk), spectatorsSeeEverything(_spectatorsSeeEverything), started(false), resuming(_resuming), currentPhase(-1), infoPopup(0) +TabGame::TabGame(TabSupervisor *_tabSupervisor, QList &_clients, int _gameId, const QString &_gameDescription, int _localPlayerId, const QString &_userName, bool _spectator, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, bool _resuming) + : Tab(_tabSupervisor), clients(_clients), gameId(_gameId), gameDescription(_gameDescription), localPlayerId(_localPlayerId), spectator(_spectator), spectatorsCanTalk(_spectatorsCanTalk), spectatorsSeeEverything(_spectatorsSeeEverything), started(false), resuming(_resuming), currentPhase(-1) { phasesToolbar = new PhasesToolbar; phasesToolbar->hide(); @@ -178,7 +176,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList &_client timeElapsedLabel = new QLabel; timeElapsedLabel->setAlignment(Qt::AlignCenter); - messageLog = new MessageLogWidget; + messageLog = new MessageLogWidget(_userName); connect(messageLog, SIGNAL(cardNameHovered(QString)), cardInfo, SLOT(setCard(QString))); connect(messageLog, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString))); connect(messageLog, SIGNAL(deleteCardInfoPopup()), this, SLOT(deleteCardInfoPopup())); @@ -779,24 +777,3 @@ Player *TabGame::getActiveLocalPlayer() const return 0; } - -void TabGame::showCardInfoPopup(const QPoint &pos, const QString &cardName) -{ - infoPopup = new CardInfoWidget(CardInfoWidget::ModePopUp, 0, Qt::Widget | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint); - infoPopup->setAttribute(Qt::WA_TransparentForMouseEvents); - infoPopup->setCard(cardName); - QRect screenRect = qApp->desktop()->screenGeometry(this); - infoPopup->move( - qMax(screenRect.left(), qMin(pos.x() - infoPopup->width() / 2, screenRect.left() + screenRect.width() - infoPopup->width())), - qMax(screenRect.top(), qMin(pos.y() - infoPopup->height() / 2, screenRect.top() + screenRect.height() - infoPopup->height())) - ); - infoPopup->show(); -} - -void TabGame::deleteCardInfoPopup() -{ - if (infoPopup) { - infoPopup->deleteLater(); - infoPopup = 0; - } -} diff --git a/cockatrice/src/tab_game.h b/cockatrice/src/tab_game.h index 5982b42b..289451f1 100644 --- a/cockatrice/src/tab_game.h +++ b/cockatrice/src/tab_game.h @@ -100,7 +100,6 @@ private: int activePlayer; QSplitter *splitter; - CardInfoWidget *infoPopup; CardInfoWidget *cardInfo; PlayerListWidget *playerListWidget; QLabel *timeElapsedLabel; @@ -147,8 +146,6 @@ signals: void openMessageDialog(const QString &userName, bool focus); private slots: void newCardAdded(AbstractCardItem *card); - void showCardInfoPopup(const QPoint &pos, const QString &cardName); - void deleteCardInfoPopup(); void actConcede(); void actLeaveGame(); @@ -158,7 +155,7 @@ private slots: void actNextPhase(); void actNextTurn(); public: - TabGame(TabSupervisor *_tabSupervisor, QList &_clients, int _gameId, const QString &_gameDescription, int _localPlayerId, bool _spectator, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, bool _resuming); + TabGame(TabSupervisor *_tabSupervisor, QList &_clients, int _gameId, const QString &_gameDescription, int _localPlayerId, const QString &_userName, bool _spectator, bool _spectatorsCanTalk, bool _spectatorsSeeEverything, bool _resuming); ~TabGame(); void retranslateUi(); void closeRequest(); diff --git a/cockatrice/src/tab_message.cpp b/cockatrice/src/tab_message.cpp index 03fb401f..c79fbfee 100644 --- a/cockatrice/src/tab_message.cpp +++ b/cockatrice/src/tab_message.cpp @@ -11,7 +11,9 @@ TabMessage::TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const QString &_ownName, const QString &_userName) : Tab(_tabSupervisor), client(_client), userName(_userName), userOnline(true) { - chatView = new ChatView(_ownName); + chatView = new ChatView(_ownName, true); + connect(chatView, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString))); + connect(chatView, SIGNAL(deleteCardInfoPopup()), this, SLOT(deleteCardInfoPopup())); sayEdit = new QLineEdit; connect(sayEdit, SIGNAL(returnPressed()), this, SLOT(sendMessage())); diff --git a/cockatrice/src/tab_room.cpp b/cockatrice/src/tab_room.cpp index d72e13ef..621b4b08 100644 --- a/cockatrice/src/tab_room.cpp +++ b/cockatrice/src/tab_room.cpp @@ -137,7 +137,9 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, const Q userList = new UserList(tabSupervisor, client, UserList::RoomList); connect(userList, SIGNAL(openMessageDialog(const QString &, bool)), this, SIGNAL(openMessageDialog(const QString &, bool))); - chatView = new ChatView(ownName); + chatView = new ChatView(ownName, true); + connect(chatView, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString))); + connect(chatView, SIGNAL(deleteCardInfoPopup()), this, SLOT(deleteCardInfoPopup())); sayLabel = new QLabel; sayEdit = new QLineEdit; sayLabel->setBuddy(sayEdit); diff --git a/cockatrice/src/tab_supervisor.cpp b/cockatrice/src/tab_supervisor.cpp index c9cdc5d5..10e33aff 100644 --- a/cockatrice/src/tab_supervisor.cpp +++ b/cockatrice/src/tab_supervisor.cpp @@ -221,7 +221,7 @@ void TabSupervisor::addCloseButtonToTab(Tab *tab, int tabIndex) void TabSupervisor::gameJoined(Event_GameJoined *event) { - TabGame *tab = new TabGame(this, QList() << client, event->getGameId(), event->getGameDescription(), event->getPlayerId(), event->getSpectator(), event->getSpectatorsCanTalk(), event->getSpectatorsSeeEverything(), event->getResuming()); + TabGame *tab = new TabGame(this, QList() << client, event->getGameId(), event->getGameDescription(), event->getPlayerId(), userName, event->getSpectator(), event->getSpectatorsCanTalk(), event->getSpectatorsSeeEverything(), event->getResuming()); connect(tab, SIGNAL(gameClosing(TabGame *)), this, SLOT(gameLeft(TabGame *))); connect(tab, SIGNAL(openMessageDialog(const QString &, bool)), this, SLOT(addMessageTab(const QString &, bool))); int tabIndex = myAddTab(tab); @@ -232,7 +232,7 @@ void TabSupervisor::gameJoined(Event_GameJoined *event) void TabSupervisor::localGameJoined(Event_GameJoined *event) { - TabGame *tab = new TabGame(this, localClients, event->getGameId(), event->getGameDescription(), event->getPlayerId(), event->getSpectator(), event->getSpectatorsCanTalk(), event->getSpectatorsSeeEverything(), event->getResuming()); + TabGame *tab = new TabGame(this, localClients, event->getGameId(), event->getGameDescription(), event->getPlayerId(), QString(), event->getSpectator(), event->getSpectatorsCanTalk(), event->getSpectatorsSeeEverything(), event->getResuming()); connect(tab, SIGNAL(gameClosing(TabGame *)), this, SLOT(gameLeft(TabGame *))); int tabIndex = myAddTab(tab); addCloseButtonToTab(tab, tabIndex); diff --git a/cockatrice/src/userlist.cpp b/cockatrice/src/userlist.cpp index c904513c..02a04a6e 100644 --- a/cockatrice/src/userlist.cpp +++ b/cockatrice/src/userlist.cpp @@ -10,6 +10,53 @@ #include #include #include +#include +#include +#include +#include +#include + +BanDialog::BanDialog(QWidget *parent) + : QDialog(parent) +{ + QLabel *durationLabel = new QLabel(tr("Please enter the duration of the ban (in minutes).\nEnter 0 for an indefinite ban.")); + durationEdit = new QSpinBox; + durationEdit->setMinimum(0); + durationEdit->setValue(5); + QLabel *reasonLabel = new QLabel(tr("Please enter the reason for the ban.\nThis is only saved for moderators and cannot be seen by the banned person.")); + reasonEdit = new QPlainTextEdit; + + QPushButton *okButton = new QPushButton(tr("&OK")); + okButton->setAutoDefault(true); + connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); + QPushButton *cancelButton = new QPushButton(tr("&Cancel")); + connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); + + QHBoxLayout *buttonLayout = new QHBoxLayout; + buttonLayout->addStretch(); + buttonLayout->addWidget(okButton); + buttonLayout->addWidget(cancelButton); + + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addWidget(durationLabel); + vbox->addWidget(durationEdit); + vbox->addWidget(reasonLabel); + vbox->addWidget(reasonEdit); + vbox->addLayout(buttonLayout); + + setLayout(vbox); + setWindowTitle(tr("Ban user from server")); +} + +int BanDialog::getMinutes() const +{ + return durationEdit->value(); +} + +QString BanDialog::getReason() const +{ + return reasonEdit->toPlainText(); +} UserListItemDelegate::UserListItemDelegate(QObject *const parent) : QStyledItemDelegate(parent) @@ -215,10 +262,9 @@ void UserList::showContextMenu(const QPoint &pos, const QModelIndex &index) else if (actionClicked == aRemoveFromIgnoreList) client->sendCommand(new Command_RemoveFromList("ignore", userName)); else if (actionClicked == aBan) { - bool ok; - int minutes = QInputDialog::getInt(this, tr("Duration"), tr("Please enter the duration of the ban (in minutes).\nEnter 0 for an indefinite ban."), 0, 0, 2147483647, 10, &ok); - if (ok) - client->sendCommand(new Command_BanFromServer(userName, minutes)); + BanDialog dlg(this); + if (dlg.exec()) + client->sendCommand(new Command_BanFromServer(userName, dlg.getMinutes(), dlg.getReason())); } delete menu; diff --git a/cockatrice/src/userlist.h b/cockatrice/src/userlist.h index a611bf5d..a40fca0f 100644 --- a/cockatrice/src/userlist.h +++ b/cockatrice/src/userlist.h @@ -1,6 +1,7 @@ #ifndef USERLIST_H #define USERLIST_H +#include #include #include #include @@ -9,6 +10,19 @@ class QTreeWidget; class ServerInfo_User; class AbstractClient; class TabSupervisor; +class QSpinBox; +class QPlainTextEdit; + +class BanDialog : public QDialog { + Q_OBJECT +private: + QSpinBox *durationEdit; + QPlainTextEdit *reasonEdit; +public: + BanDialog(QWidget *parent = 0); + int getMinutes() const; + QString getReason() const; +}; class UserListItemDelegate : public QStyledItemDelegate { public: diff --git a/cockatrice/translations/cockatrice_cs.ts b/cockatrice/translations/cockatrice_cs.ts index 43f214c8..db45c0b2 100644 --- a/cockatrice/translations/cockatrice_cs.ts +++ b/cockatrice/translations/cockatrice_cs.ts @@ -121,6 +121,36 @@ + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + + + + + &Cancel + + + + + Ban user from server + + + CardDatabaseModel @@ -787,22 +817,22 @@ DeckViewContainer - + Load &local deck - + Load d&eck from server - + Ready to s&tart - + Load deck @@ -1628,117 +1658,117 @@ Local version is %1, remote version is %2. MessageLogWidget - + Connecting to %1... - + Connected. - + Disconnected from server. - + Invalid password. - + Protocol version mismatch. Client: %1, Server: %2 - + Protocol error. - + You have joined game #%1. - + %1 has joined the game. - + %1 has left the game. - + The game has been closed. - + %1 is now watching the game. - + %1 is not watching the game any more. - + %1 has loaded a local deck. - + %1 has loaded deck #%2. - + %1 is ready to start the game. - + %1 is not ready to start the game any more. - + %1 has conceded the game. - + The game has started. - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 rolls a %2 with a %3-sided die. - + %1 draws %n card(s). @@ -1747,188 +1777,188 @@ Local version is %1, remote version is %2. - + %1 undoes his last draw. - + %1 undoes her last draw. - + %1 undoes his last draw (%2). - + %1 undoes her last draw (%2). - + from table - + from graveyard - + from exile - + from hand - + the bottom card of his library - + the bottom card of her library - + from the bottom of his library - + from the bottom of her library - + the top card of his library - + the top card of her library - + from the top of his library - + from the top of her library - + from library - + from sideboard - + from the stack - - + + a card - + %1 gives %2 control over %3. - + %1 puts %2 into play tapped%3. - + %1 puts %2 into play%3. - + %1 puts %2%3 into graveyard. - + %1 exiles %2%3. - + %1 moves %2%3 to hand. - + %1 puts %2%3 into his library. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of his library. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of his library. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into his library at position %4. - + %1 puts %2%3 into her library at position %4. - + %1 moves %2%3 to sideboard. - + %1 plays %2%3. - + %1 takes a mulligan to %n. @@ -1937,57 +1967,57 @@ Local version is %1, remote version is %2. - + %1 draws his initial hand. - + %1 draws her initial hand. - + %1 flips %2 face-down. - + %1 flips %2 face-up. - + %1 destroys %2. - + %1 attaches %2 to %3's %4. - + %1 unattaches %2. - + %1 creates token: %2%3. - + %1 points from %2's %3 to %4. - + %1 points from %2's %3 to %4's %5. - + %1 places %n %2 counter(s) on %3 (now %4). @@ -1996,7 +2026,7 @@ Local version is %1, remote version is %2. - + %1 removes %n %2 counter(s) from %3 (now %4). @@ -2005,7 +2035,7 @@ Local version is %1, remote version is %2. - + red @@ -2014,7 +2044,7 @@ Local version is %1, remote version is %2. - + yellow @@ -2023,7 +2053,7 @@ Local version is %1, remote version is %2. - + green @@ -2032,162 +2062,162 @@ Local version is %1, remote version is %2. - + his permanents - + her permanents - + %1 %2 %3. - + taps - + untaps - + %1 sets counter %2 to %3 (%4%5). - + %1 sets %2 to not untap normally. - + %1 sets %2 to untap normally. - + %1 sets PT of %2 to %3. - + %1 sets annotation of %2 to %3. - + %1 is looking at the top %2 cards %3. - + %1 is looking at %2. - + %1 stops looking at %2. - + %1 reveals %2 to %3. - + %1 reveals %2. - + %1 randomly reveals %2%3 to %4. - + %1 randomly reveals %2%3. - + %1 reveals %2%3 to %4. - + %1 reveals %2%3. - + It is now %1's turn. - + untap step - + upkeep step - + draw step - + first main phase - + beginning of combat step - + declare attackers step - + declare blockers step - + combat damage step - + end of combat step - + second main phase - + ending phase - + It is now the %1. @@ -2877,137 +2907,137 @@ Please enter a name: TabGame - + F5 - + F6 - + F7 - + F8 - + F9 - + F10 - + &Phases - + &Game - + Next &phase - + Ctrl+Space - + Next &turn - + Ctrl+Return - + Ctrl+Enter - + &Remove all local arrows - + Ctrl+R - + &Concede - + F2 - + &Leave game - + Ctrl+Q - + &Say: - + Concede - + Are you sure you want to concede this game? - + Leave game - + Are you sure you want to leave this game? - + Kicked - + You have been kicked out of the game. - + Game %1: %2 @@ -3015,27 +3045,27 @@ Please enter a name: TabMessage - + Personal &talk - + &Leave - + This user is ignoring you. - + %1 has left the server. - + %1 has joined the server. @@ -3048,27 +3078,27 @@ Please enter a name: TabRoom - + &Say: - + Chat - + &Room - + &Leave room - + You are flooding the chat. Please wait a couple of seconds. @@ -3178,71 +3208,60 @@ Please enter a name: UserList - + Users online: %1 - + Users in this room: %1 - + Buddies online: %1 / %2 - + Ignored users online: %1 / %2 - + User &details - + Direct &chat - + Add to &buddy list - + Remove from &buddy list - + Add to &ignore list - + Remove from &ignore list - + Ban from &server - - - Duration - - - - - Please enter the duration of the ban (in minutes). -Enter 0 for an indefinite ban. - - WndDeckEditor diff --git a/cockatrice/translations/cockatrice_de.ts b/cockatrice/translations/cockatrice_de.ts index 38e34348..ce769bac 100644 --- a/cockatrice/translations/cockatrice_de.ts +++ b/cockatrice/translations/cockatrice_de.ts @@ -156,6 +156,42 @@ Pfad auswählen + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + Bitte geben Sie die Dauer des Banns ein (in Minuten). +Geben Sie 0 ein für einen unbefristeten Bann. + + + Please enter the reason for the ban. This is only saved for moderators and cannot be seen by the banned person. + Bitte geben Sie den Grund für den Bann ein. Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nicht gesehen werden. + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + Bitte geben Sie den Grund für den Bann ein. +Dies wird nur für Moderatoren gespeichert und kann von der gebannten Person nicht gesehen werden. + + + + &OK + &OK + + + + &Cancel + &Abbrechen + + + + Ban user from server + Benutzer vom Server bannen + + CardDatabaseModel @@ -1209,22 +1245,22 @@ DeckViewContainer - + Load &local deck &Lokales Deck laden - + Load d&eck from server Deck vom Server l&aden - + Ready to s&tart Bereit zum S&tarten - + Load deck Deck laden @@ -2429,22 +2465,22 @@ Lokale Version ist %1, Serverversion ist %2. MessageLogWidget - + Connecting to %1... Verbinde zu %1... - + Connected. Verbunden. - + Disconnected from server. Verbindung zum Server getrennt. - + Invalid password. Ungültiges Passwort. @@ -2485,8 +2521,8 @@ Lokale Version ist %1, Serverversion ist %2. %1 zieht %2 Karten - - + + a card eine Karte @@ -2543,7 +2579,7 @@ Lokale Version ist %1, Serverversion ist %2. %1s Sideboard - + The game has started. Das Spiel hat begonnen. @@ -2564,87 +2600,87 @@ Lokale Version ist %1, Serverversion ist %2. Protokollversion stimmt nicht überein. - + Protocol version mismatch. Client: %1, Server: %2 - + Protocol error. Protokollfehler. - + You have joined game #%1. Sie sind dem Spiel %1 beigetreten. - + %1 has joined the game. %1 ist dem Spiel beigetreten. - + %1 has left the game. %1 hat das Spiel verlassen. - + The game has been closed. Das Spiel wurde geschlossen. - + %1 is now watching the game. %1 schaut nun dem Spiel zu. - + %1 is not watching the game any more. %1 schaut dem Spiel nicht mehr zu. - + %1 has loaded a local deck. %1 hat ein lokales Deck geladen. - + %1 has loaded deck #%2. %1 hat das Deck Nr. %2 geladen. - + %1 is ready to start the game. %1 ist bereit, das Spiel zu starten. - + %1 is not ready to start the game any more. %1 ist nicht mehr bereit, das Spiel zu starten. - + %1 has conceded the game. %1 hat das Spiel aufgegeben. - + %1 has restored connection to the game. %1 ist wieder mit dem Spiel verbunden. - + %1 has lost connection to the game. %1 hat die Verbindung zum Spiel verloren. - + %1 shuffles %2. %1 mischt %2. - + %1 rolls a %2 with a %3-sided die. %1 würfelt eine %2 mit einem %3-seitigen Würfel. @@ -2657,7 +2693,7 @@ Lokale Version ist %1, Serverversion ist %2. %1 zieht %2 Karten. - + %1 draws %n card(s). %1 zieht eine Karte. @@ -2665,182 +2701,182 @@ Lokale Version ist %1, Serverversion ist %2. - + %1 undoes his last draw. %1 legt die zuletzt gezogene Karte zurück. - + %1 undoes her last draw. %1 legt die zuletzt gezogene Karte zurück. - + %1 undoes his last draw (%2). %1 legt die zuletzt gezogene Karte zurück (%2). - + %1 undoes her last draw (%2). %1 legt die zuletzt gezogene Karte zurück (%2). - + from table vom Spielfeld - + from graveyard aus dem Friedhof - + from exile aus dem Exil - + from hand von der Hand - + the bottom card of his library die unterste Karte seiner Bibliothek - + the bottom card of her library die unterste Karte ihrer Bibliothek - + from the bottom of his library , die unterste Karte seiner Bibliothek, - + from the bottom of her library , die unterste Karte ihrer Bibliothek, - + the top card of his library die oberste Karte seiner Bibliothek - + the top card of her library die oberste Karte ihrer Bibliothek - + from the top of his library , die oberste Karte seiner Bibliothek, - + from the top of her library , die oberste Karte ihrer Bibliothek, - + from library aus der Bibliothek - + from sideboard aus dem Sideboard - + from the stack vom Stapel - + %1 gives %2 control over %3. %1 überlässt %2 die Kontrolle über %3. - + %1 puts %2 into play tapped%3. %1 bringt %2 getappt%3 ins Spiel. - + %1 puts %2 into play%3. %1 bringt %2%3 ins Spiel. - + %1 puts %2%3 into graveyard. %1 legt %2%3 auf den Friedhof. - + %1 exiles %2%3. %1 schickt %2%3 ins Exil. - + %1 moves %2%3 to hand. %1 nimmt %2%3 auf die Hand. - + %1 puts %2%3 into his library. %1 legt %2%3 in seine Bibliothek. - + %1 puts %2%3 into her library. %1 legt %2%3 in ihre Bibliothek. - + %1 puts %2%3 on bottom of his library. %1 legt %2%3 unter seine Bibliothek. - + %1 puts %2%3 on bottom of her library. %1 legt %2%3 unter ihre Bibliothek. - + %1 puts %2%3 on top of his library. %1 legt %2%3 auf die Bibliothek. - + %1 puts %2%3 on top of her library. %1 legt %2%3 auf die Bibliothek. - + %1 puts %2%3 into his library at position %4. %1 legt %2%3 in seine Bibliothek an %4. Stelle. - + %1 puts %2%3 into her library at position %4. %1 legt %2%3 in ihre Bibliothek an %4. Stelle. - + %1 moves %2%3 to sideboard. %1 legt %2%3 in sein Sideboard. - + %1 plays %2%3. %1 spielt %2%3 aus. - + %1 takes a mulligan to %n. %1 nimmt einen Mulligan auf %n. @@ -2848,52 +2884,52 @@ Lokale Version ist %1, Serverversion ist %2. - + %1 draws his initial hand. %1 zieht seine Starthand. - + %1 draws her initial hand. %1 zieht ihre Starthand. - + %1 flips %2 face-down. %1 wendet %2 auf die Rückseite. - + %1 flips %2 face-up. %1 wendet %2 auf die Vorderseite. - + %1 destroys %2. %1 zerstört %2. - + %1 attaches %2 to %3's %4. %1 legt %2 an %3s %4 an. - + %1 unattaches %2. %1 löst %2 ab. - + %1 creates token: %2%3. %1 erstellt Token: %2%3. - + %1 points from %2's %3 to %4. %1 zeigt von %2s %3 auf %4. - + %1 places %n %2 counter(s) on %3 (now %4). %1 legt eine %2 Marke auf %3 (jetzt %4). @@ -2901,7 +2937,7 @@ Lokale Version ist %1, Serverversion ist %2. - + %1 removes %n %2 counter(s) from %3 (now %4). %1 entfernt eine %2 Marke von %3 (jetzt %4). @@ -2909,27 +2945,27 @@ Lokale Version ist %1, Serverversion ist %2. - + her permanents ihre bleibenden Karten - + %1 randomly reveals %2%3 to %4. %1 zeigt %4 zufällig %2%3 vor. - + %1 randomly reveals %2%3. %1 zeigt zufällig %2%3 offen vor. - + %1 reveals %2%3 to %4. %1 zeigt %4 %2%3 vor. - + %1 reveals %2%3. %1 zeigt %2%3 offen vor. @@ -2938,7 +2974,7 @@ Lokale Version ist %1, Serverversion ist %2. %1 erstellt einen Spielstein: %2 (%3). - + %1 points from %2's %3 to %4's %5. %1 zeigt von %2s %3 auf %4s %5. @@ -2957,7 +2993,7 @@ Lokale Version ist %1, Serverversion ist %2. - + red rote @@ -2965,7 +3001,7 @@ Lokale Version ist %1, Serverversion ist %2. - + yellow gelbe @@ -2973,7 +3009,7 @@ Lokale Version ist %1, Serverversion ist %2. - + green grüne @@ -2981,22 +3017,22 @@ Lokale Version ist %1, Serverversion ist %2. - + %1 sets counter %2 to %3 (%4%5). %1 setzt Zähler %2 auf %3 (%4%5). - + %1 sets PT of %2 to %3. %1 setzt Kampfwerte von %2 auf %3. - + %1 sets annotation of %2 to %3. %1 versieht %2 mit dem Hinweis %3. - + %1 is looking at the top %2 cards %3. %1 sieht sich die obersten %2 Karten %3 an. @@ -3093,7 +3129,7 @@ Lokale Version ist %1, Serverversion ist %2. %1 entfernt %2 Zählmarken von %3 (jetzt %4). - + %1 %2 %3. %1 %2 %3. @@ -3106,22 +3142,22 @@ Lokale Version ist %1, Serverversion ist %2. %1 sieht sich die obersten %2 Karten %3 an. - + %1 is looking at %2. %1 sieht sich %2 an. - + %1 stops looking at %2. %1 sieht sich %2 nicht mehr an. - + %1 reveals %2 to %3. %1 zeigt %3 %2. - + %1 reveals %2. %1 zeigt %2 offen vor. @@ -3142,7 +3178,7 @@ Lokale Version ist %1, Serverversion ist %2. %1 zeigt %2 aus %3 offen vor. - + ending phase die Zugendphase @@ -3171,57 +3207,57 @@ Lokale Version ist %1, Serverversion ist %2. %1 sieht sich %2s %3 nicht mehr an - + It is now %1's turn. %1 ist am Zug. - + untap step das Enttappsegment - + upkeep step das Versorgungssegment - + draw step das Ziehsegment - + first main phase die erste Hauptphase - + beginning of combat step das Anfangssegment der Kampfphase - + declare attackers step das Angreifer-Deklarieren-Segment - + declare blockers step das Blocker-Deklarieren-Segment - + combat damage step das Kampfschadenssegment - + end of combat step das Endsegment der Kampfphase - + second main phase die zweite Hauptphase @@ -3230,7 +3266,7 @@ Lokale Version ist %1, Serverversion ist %2. das Ende-des-Zuges-Segment - + It is now the %1. Es ist nun %1. @@ -3239,12 +3275,12 @@ Lokale Version ist %1, Serverversion ist %2. %1 bewegt %2 %3 nach %4 - + taps tappt - + untaps enttappt @@ -3269,7 +3305,7 @@ Lokale Version ist %1, Serverversion ist %2. %1 entfernt %2 Zählmarken von %3 (jetzt %4) - + his permanents seine bleibenden Karten @@ -3282,12 +3318,12 @@ Lokale Version ist %1, Serverversion ist %2. %1 setzt Zähler "%2" auf %3 (%4%5) - + %1 sets %2 to not untap normally. %1 setzt %2 auf explizites Enttappen. - + %1 sets %2 to untap normally. %1 setzt %2 auf normales Enttappen. @@ -4220,107 +4256,107 @@ Bitte geben Sie einen Namen ein: TabGame - + F5 F5 - + F6 F6 - + F7 F7 - + F8 F8 - + F9 F9 - + F10 F10 - + &Phases &Phasen - + &Game Spi&el - + Next &phase Nächste &Phase - + Ctrl+Space Ctrl+Space - + Next &turn Nächster &Zug - + Ctrl+Return Ctrl+Return - + Ctrl+Enter Ctrl+Enter - + &Remove all local arrows &Lokale Pfeile entfernen - + Ctrl+R Ctrl+R - + &Concede - + F2 F2 - + &Leave game Spiel ver&lassen - + Ctrl+Q Ctrl+Q - + Kicked Herausgeworfen - + You have been kicked out of the game. Sie wurden aus dem Spiel geworfen. @@ -4341,7 +4377,7 @@ Bitte geben Sie einen Namen ein: Spiel s&tarten - + &Say: &Sagen: @@ -4354,22 +4390,22 @@ Bitte geben Sie einen Namen ein: Esc - + Concede Aufgeben - + Are you sure you want to concede this game? Sind Sie sicher, dass Sie das Spiel aufgeben möchten? - + Leave game Spiel verlassen - + Are you sure you want to leave this game? Sind Sie sicher, dass Sie das Spiel verlassen möchten? @@ -4378,7 +4414,7 @@ Bitte geben Sie einen Namen ein: Deck laden - + Game %1: %2 Spiel %1: %2 @@ -4386,27 +4422,27 @@ Bitte geben Sie einen Namen ein: TabMessage - + Personal &talk Persönliches &Gespräch - + &Leave Ver&lassen - + This user is ignoring you. Dieser Benutzer ignoriert Sie. - + %1 has left the server. %1 hat den Server verlassen. - + %1 has joined the server. %1 hat den Server betreten. @@ -4419,27 +4455,27 @@ Bitte geben Sie einen Namen ein: TabRoom - + &Say: &Sagen: - + Chat Unterhaltung - + &Room &Raum - + &Leave room Raum ver&lassen - + You are flooding the chat. Please wait a couple of seconds. Sie überfluten den Chatraum. Bitte warten Sie ein paar Sekunden. @@ -4576,70 +4612,68 @@ Bitte geben Sie einen Namen ein: UserList - + Users online: %1 Benutzer online: %1 - + Users in this room: %1 Benutzer in diesem Raum: %1 - + Buddies online: %1 / %2 Freunde online: %1 / %2 - + Ignored users online: %1 / %2 Ignorierte Benutzer online: %1 / %2 - + User &details Benutzer&details - + Direct &chat &Persönliches Gespräch - + Add to &buddy list Zur &Freundesliste hinzufügen - + Remove from &buddy list Von &Freundesliste entfernen - + Add to &ignore list &Ignorieren - + Remove from &ignore list Nicht mehr &ignorieren - + Ban from &server Vom &Server bannen - Duration - Dauer + Dauer - Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - Bitte geben Sie die Dauer des Banns ein (in Minuten). + Bitte geben Sie die Dauer des Banns ein (in Minuten). Geben Sie 0 ein für einen unbefristeten Bann. diff --git a/cockatrice/translations/cockatrice_en.ts b/cockatrice/translations/cockatrice_en.ts index 02e8057d..c0d65f99 100644 --- a/cockatrice/translations/cockatrice_en.ts +++ b/cockatrice/translations/cockatrice_en.ts @@ -121,6 +121,36 @@ + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + + + + + &Cancel + + + + + Ban user from server + + + CardDatabaseModel @@ -787,22 +817,22 @@ DeckViewContainer - + Load &local deck - + Load d&eck from server - + Ready to s&tart - + Load deck @@ -1627,67 +1657,67 @@ Local version is %1, remote version is %2. MessageLogWidget - + Connecting to %1... - + Disconnected from server. - + Invalid password. - + Protocol error. - + The game has been closed. - + %1 is now watching the game. - + %1 is not watching the game any more. - + %1 is not ready to start the game any more. - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 rolls a %2 with a %3-sided die. - + %1 draws %n card(s). %1 draws a card. @@ -1695,208 +1725,208 @@ Local version is %1, remote version is %2. - + %1 undoes his last draw. - + %1 undoes her last draw. - + %1 undoes his last draw (%2). - + %1 undoes her last draw (%2). - + from table - + from graveyard - + from exile - + from hand - + the bottom card of his library - + the bottom card of her library - + from the bottom of his library - + from the bottom of her library - + the top card of his library - + the top card of her library - + from the top of his library - + from the top of her library - + from library - + from sideboard - + from the stack - + %1 gives %2 control over %3. - + %1 puts %2 into play tapped%3. - + %1 puts %2 into play%3. - + %1 puts %2%3 into graveyard. - + %1 exiles %2%3. - + %1 moves %2%3 to hand. - + %1 puts %2%3 into his library. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of his library. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of his library. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into his library at position %4. - + %1 puts %2%3 into her library at position %4. - + %1 moves %2%3 to sideboard. - + %1 plays %2%3. - - + + a card - + %1 flips %2 face-down. - + %1 flips %2 face-up. - + %1 attaches %2 to %3's %4. - + %1 unattaches %2. - + %1 points from %2's %3 to %4's %5. @@ -1915,7 +1945,7 @@ Local version is %1, remote version is %2. - + red @@ -1923,7 +1953,7 @@ Local version is %1, remote version is %2. - + yellow @@ -1931,7 +1961,7 @@ Local version is %1, remote version is %2. - + green @@ -1939,77 +1969,77 @@ Local version is %1, remote version is %2. - + %1 sets counter %2 to %3 (%4%5). - + %1 sets PT of %2 to %3. - + %1 sets annotation of %2 to %3. - + %1 is looking at the top %2 cards %3. - + The game has started. - + Connected. - + Protocol version mismatch. Client: %1, Server: %2 - + You have joined game #%1. - + %1 has joined the game. - + %1 has left the game. - + %1 has loaded a local deck. - + %1 has loaded deck #%2. - + %1 is ready to start the game. - + %1 has conceded the game. - + %1 takes a mulligan to %n. @@ -2017,32 +2047,32 @@ Local version is %1, remote version is %2. - + %1 draws his initial hand. - + %1 draws her initial hand. - + %1 destroys %2. - + %1 creates token: %2%3. - + %1 points from %2's %3 to %4. - + %1 places %n %2 counter(s) on %3 (now %4). %1 places a %2 counter on %3 (now %4). @@ -2050,7 +2080,7 @@ Local version is %1, remote version is %2. - + %1 removes %n %2 counter(s) from %3 (now %4). %1 removes a %2 counter from %3 (now %4). @@ -2058,142 +2088,142 @@ Local version is %1, remote version is %2. - + her permanents - + %1 %2 %3. - + %1 is looking at %2. - + %1 stops looking at %2. - + %1 reveals %2 to %3. - + %1 reveals %2. - + ending phase - + It is now %1's turn. - + %1 randomly reveals %2%3 to %4. - + %1 randomly reveals %2%3. - + %1 reveals %2%3 to %4. - + %1 reveals %2%3. - + untap step - + upkeep step - + draw step - + first main phase - + beginning of combat step - + declare attackers step - + declare blockers step - + combat damage step - + end of combat step - + second main phase - + It is now the %1. - + taps - + untaps - + %1 sets %2 to not untap normally. - + %1 sets %2 to untap normally. - + his permanents @@ -2883,137 +2913,137 @@ Please enter a name: TabGame - + F5 - + F6 - + F7 - + F8 - + F9 - + F10 - + &Phases - + &Game - + Next &phase - + Ctrl+Space - + Next &turn - + Ctrl+Return - + Ctrl+Enter - + &Remove all local arrows - + Ctrl+R - + &Concede - + F2 - + &Leave game - + Ctrl+Q - + &Say: - + Concede - + Are you sure you want to concede this game? - + Leave game - + Are you sure you want to leave this game? - + Kicked - + You have been kicked out of the game. - + Game %1: %2 @@ -3021,27 +3051,27 @@ Please enter a name: TabMessage - + Personal &talk - + &Leave - + This user is ignoring you. - + %1 has left the server. - + %1 has joined the server. @@ -3054,27 +3084,27 @@ Please enter a name: TabRoom - + &Say: - + Chat - + &Room - + &Leave room - + You are flooding the chat. Please wait a couple of seconds. @@ -3184,71 +3214,60 @@ Please enter a name: UserList - + Users online: %1 - + Users in this room: %1 - + Buddies online: %1 / %2 - + Ignored users online: %1 / %2 - + User &details - + Direct &chat - + Add to &buddy list - + Remove from &buddy list - + Add to &ignore list - + Remove from &ignore list - + Ban from &server - - - Duration - - - - - Please enter the duration of the ban (in minutes). -Enter 0 for an indefinite ban. - - WndDeckEditor diff --git a/cockatrice/translations/cockatrice_es.ts b/cockatrice/translations/cockatrice_es.ts index adb9e23a..d39522e9 100644 --- a/cockatrice/translations/cockatrice_es.ts +++ b/cockatrice/translations/cockatrice_es.ts @@ -129,6 +129,37 @@ Elija ruta + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + Por favor, introduce la duración del ban (en minutos) +Indica 0 para un ban indefinido. + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + &Aceptar + + + + &Cancel + &Cancelar + + + + Ban user from server + + + CardDatabaseModel @@ -1129,22 +1160,22 @@ DeckViewContainer - + Load &local deck Cargar mazo &local - + Load d&eck from server Cargar mazo del &servidor - + Ready to s&tart Listo para &empezar - + Load deck Cargar mazo @@ -2000,67 +2031,67 @@ La versión local es %1, la versión remota es %2. MessageLogWidget - + Connecting to %1... Conectando a %1... - + Disconnected from server. Desconectado del servidor. - + Invalid password. Contraseña incorrecta. - + Protocol error. Error del protocolo. - + The game has been closed. La partida ha sido cerrada. - + %1 is now watching the game. %1 está ahora observando la partida. - + %1 is not watching the game any more. %1 ya no está observado más la partida. - + %1 is not ready to start the game any more. %1 ya no está listo para empezar el juego. - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 rolls a %2 with a %3-sided die. %1 sacó un %2 con un dado de %3 caras. - + %1 draws %n card(s). %1 roba %n carta. @@ -2068,208 +2099,208 @@ La versión local es %1, la versión remota es %2. - + %1 undoes his last draw. %1 deshace su último robo. - + %1 undoes her last draw. - + %1 undoes his last draw (%2). %1 deshace su último robo (%2). - + %1 undoes her last draw (%2). - + from table de la mesa - + from graveyard del cementerio - + from exile del exilio - + from hand de la mano - + the bottom card of his library el fondo de la biblioteca - + the bottom card of her library - + from the bottom of his library del fondo de la biblioteca - + from the bottom of her library - + the top card of his library la parte superior de la biblioteca - + the top card of her library - + from the top of his library de la parte superior de la biblioteca - + from the top of her library - + from library de la biblioteca - + from sideboard de la reserva - + from the stack de la pila - + %1 gives %2 control over %3. %1 entrega a %2 el control sobre %3. - + %1 puts %2 into play tapped%3. %1 pone %2 en juego%3 girado. - + %1 puts %2 into play%3. %1 pone %2 en juego%3. - + %1 puts %2%3 into graveyard. %1 pone %2%3 en el cementerio. - + %1 exiles %2%3. %1 exilia %2%3. - + %1 moves %2%3 to hand. %1 mueve %2%3 a la mano. - + %1 puts %2%3 into his library. %1 pone %2%3 en la biblioteca. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of his library. %1 pone %2%3 en la parte inferior de su biblioteca. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of his library. %1 pone %2%3 en la parte superior de su biblioteca. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into his library at position %4. %1 pone %2%3 en su biblioteca en la posición %4. - + %1 puts %2%3 into her library at position %4. - + %1 moves %2%3 to sideboard. %1 mueve %2%3 a la reserva. - + %1 plays %2%3. %1 juega %2%3. - - + + a card una carta - + %1 flips %2 face-down. %1 voltea %2 boca abajo. - + %1 flips %2 face-up. %1 voltea %2 boca arriba. - + %1 attaches %2 to %3's %4. %1 anexa %2 a el %4 de %3. - + %1 unattaches %2. %1 desanexa %2. - + %1 points from %2's %3 to %4's %5. %1 apunta desde el %3 de %2 al %5 de %4. @@ -2288,7 +2319,7 @@ La versión local es %1, la versión remota es %2. - + red rojo @@ -2296,7 +2327,7 @@ La versión local es %1, la versión remota es %2. - + yellow amarillo @@ -2304,7 +2335,7 @@ La versión local es %1, la versión remota es %2. - + green verde @@ -2312,72 +2343,72 @@ La versión local es %1, la versión remota es %2. - + %1 sets counter %2 to %3 (%4%5). %1 establece los contadores de %2 a %3 (%4%5). - + %1 sets PT of %2 to %3. %1 establece F/R de %2 a %3. - + %1 sets annotation of %2 to %3. %1 establece la anotación de %2 a %3. - + %1 is looking at the top %2 cards %3. %1 esta mirando las primeras %2 cartas de %3. - + The game has started. La partida ha comenzado. - + Connected. Conectado. - + Protocol version mismatch. Client: %1, Server: %2 La versión del protocolo es diferente. Cliente: %1, Servidor: %2 - + You have joined game #%1. Te has unido a la partida #%1. - + %1 has joined the game. %1 se ha unido a la partida. - + %1 has left the game. %1 ha dejado la partida. - + %1 has loaded a local deck. %1 ha cargado un mazo local. - + %1 has loaded deck #%2. %1 ha cargado el mazo #%2. - + %1 is ready to start the game. %1 está preparado para empezar la partida. - + %1 has conceded the game. %1 ha concedido la partida. @@ -2390,22 +2421,22 @@ La versión local es %1, la versión remota es %2. %1 roba %2 cartas. - + %1 destroys %2. %1 destruye %2. - + %1 creates token: %2%3. %1 crea una ficha: %2%3. - + %1 points from %2's %3 to %4. %1 apunta desde el %3 de %2 a %4. - + %1 places %n %2 counter(s) on %3 (now %4). %1 pone %n %2 contador en %3 (ahora %4). @@ -2413,7 +2444,7 @@ La versión local es %1, la versión remota es %2. - + %1 removes %n %2 counter(s) from %3 (now %4). %1 remueve %n %2 contador en %3 (ahora %4). @@ -2421,37 +2452,37 @@ La versión local es %1, la versión remota es %2. - + %1 %2 %3. %1 %2 %3. - + %1 is looking at %2. %1 está mirando: %2. - + %1 stops looking at %2. %1 termina de mirar: %2. - + %1 reveals %2 to %3. %1 revela %2 a %3. - + %1 reveals %2. %1 revela %2. - + ending phase fase de fin de turno - + It is now %1's turn. Es el turno de %1. @@ -2460,7 +2491,7 @@ La versión local es %1, la versión remota es %2. %1 baraja su biblioteca. - + %1 takes a mulligan to %n. @@ -2468,117 +2499,117 @@ La versión local es %1, la versión remota es %2. - + %1 draws his initial hand. - + %1 draws her initial hand. - + her permanents - + %1 randomly reveals %2%3 to %4. %1 revela aleatoriamente %2%3 a %4. - + %1 randomly reveals %2%3. %1 revela aleatoriamente %2%3. - + %1 reveals %2%3 to %4. %1 revela %2%3 a %4. - + %1 reveals %2%3. %1 revela %2%3. - + untap step paso de enderezar - + upkeep step paso de mantenimiento - + draw step paso de robar - + first main phase primera fase principal - + beginning of combat step paso de inicio de combate - + declare attackers step paso de declarar atacantes - + declare blockers step paso de declarar bloqueadores - + combat damage step paso de daño de combate - + end of combat step paso de fin de combate - + second main phase segunda fase principal - + It is now the %1. Ahora es el %1. - + taps gira - + untaps endereza - + %1 sets %2 to not untap normally. %1 establece que %2 no se endereze normalmente. - + %1 sets %2 to untap normally. %1 establece que %2 se endereze normalmente. - + his permanents sus permanentes @@ -3331,137 +3362,137 @@ Por favor, introduzca un nombre: TabGame - + F5 F5 - + F6 F6 - + F7 F7 - + F8 F8 - + F9 F9 - + F10 F10 - + &Phases &Fases - + &Game &Partida - + Next &phase Próxima &fase - + Ctrl+Space Ctrl+Space - + Next &turn Próximo &turno - + Ctrl+Return Ctrl+Return - + Ctrl+Enter Ctrl+Enter - + &Remove all local arrows &Retirar todas las flechas locales - + Ctrl+R Ctrl+R - + &Concede &Conceder - + F2 F2 - + &Leave game &Abandonar la partida - + Ctrl+Q Ctrl+Q - + &Say: &Decir: - + Concede Conceder - + Are you sure you want to concede this game? ¿Estás seguro de que quieres conceder esta partida? - + Leave game Abandonar la partida - + Are you sure you want to leave this game? ¿Estás seguro de que quieres abandonar la partida? - + Kicked Expulsado - + You have been kicked out of the game. Has sido expulsado de la partida. - + Game %1: %2 Partida %1: %2 @@ -3469,27 +3500,27 @@ Por favor, introduzca un nombre: TabMessage - + Personal &talk &Conversación personal - + &Leave &Cerrar - + This user is ignoring you. Este usuario está ignorandote. - + %1 has left the server. %1 ha abandonado el servidor. - + %1 has joined the server. %1 se ha unido al servidor. @@ -3502,27 +3533,27 @@ Por favor, introduzca un nombre: TabRoom - + &Say: &Decir: - + Chat Chat - + &Room &Sala - + &Leave room &Dejar sala - + You are flooding the chat. Please wait a couple of seconds. Estás floodeando el chat. Por favor, espera unos segundos. @@ -3644,70 +3675,68 @@ Por favor, introduzca un nombre: UserList - + Users online: %1 Usuarios online: %1 - + Users in this room: %1 Usuarios en esta sala: %1 - + Buddies online: %1 / %2 Amigos online: %1 / %2 - + Ignored users online: %1 / %2 Usuarios ignorados online: %1 / %2 - + User &details &Detalles del usuario - + Direct &chat &Chat privado - + Add to &buddy list Añadir a la lista de &amigos - + Remove from &buddy list Quitar de la lista de &amigos - + Add to &ignore list Añadir a la lista de &ignorados - + Remove from &ignore list Quitar de la lista de &ignorados - + Ban from &server Banear del &servidor - Duration - Duración + Duración - Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - Por favor, introduce la duración del ban (en minutos) + Por favor, introduce la duración del ban (en minutos) Indica 0 para un ban indefinido. diff --git a/cockatrice/translations/cockatrice_fr.ts b/cockatrice/translations/cockatrice_fr.ts index c8950757..ecdd4519 100644 --- a/cockatrice/translations/cockatrice_fr.ts +++ b/cockatrice/translations/cockatrice_fr.ts @@ -121,6 +121,37 @@ Choisir le chemin + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + Entrez la durée de temps du ban (en minutes). +Entrez 0 pour une durée illimitée du ban. + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + &OK + + + + &Cancel + &Annuler + + + + Ban user from server + + + CardDatabaseModel @@ -991,22 +1022,22 @@ DeckViewContainer - + Load &local deck Charger un deck &local - + Load d&eck from server Charger un d&eck depuis le serveur - + Ready to s&tart P&rêt à démarrer - + Load deck Charger deck @@ -1857,93 +1888,93 @@ La version la plus récente est %1, l'ancienne version est %2. MessageLogWidget - + Connecting to %1... Connexion à %1... - + Connected. Connecté. - + Disconnected from server. Déconnecté du serveur. - + Invalid password. Mot de passe invalide. - + Protocol version mismatch. Client: %1, Server: %2 Version de protocole différente. Version locale: %1 ,version distante: %2 - + Protocol error. Erreur de protocole. - + You have joined game #%1. Vous avez rejoint la partie #%1. - + %1 has joined the game. %1 a rejoint la partie. - + %1 has left the game. %1 a quitté la partie. - + The game has been closed. La partie a été fermée. - + %1 is now watching the game. %1 est maintenant spectateur. - + %1 is not watching the game any more. %1 n'est plus spectateur. - + %1 has loaded a local deck. %1 a chargé un deck local. - + %1 has loaded deck #%2. %1 a chargé le deck #%2. - + %1 is ready to start the game. %1 est prêt à démarrer la partie. - + %1 is not ready to start the game any more. %1 n'est plus prêt à démarrer la partie. - + %1 has conceded the game. partie ou jeu %1 a concédé la partie. - + The game has started. La partie commence. @@ -1952,7 +1983,7 @@ La version la plus récente est %1, l'ancienne version est %2.%1 mélange sa bibliothèque. - + %1 rolls a %2 with a %3-sided die. is it always a dice? %1 lance un %2 à %3 faces. @@ -1966,179 +1997,179 @@ La version la plus récente est %1, l'ancienne version est %2.%1 pioche %2 cartes. - + from table depuis le champ de bataille - + from graveyard depuis son cimetière - + from exile depuis la zone exil - + from hand depuis sa main - + the bottom card of his library la carte du dessous de sa bibliothèque - + the bottom card of her library - + from the bottom of his library du dessous de sa bibliothèque - + from the bottom of her library - + the top card of his library le carte du dessus de sa bibliothèque - + the top card of her library - + from the top of his library du dessus de sa bibliothèque - + from the top of her library - + from library depuis sa bibliothèque - + from sideboard depuis sa réserve - + from the stack depuis la pile - + %1 puts %2 into play tapped%3. %1 met %2 en jeu engagé%3. - + %1 puts %2 into play%3. what is %3? plz exemple (resp. by Ranma : XX met island en jeu -depuis sa main-.) %1 met %2 en jeu %3. - + %1 puts %2%3 into graveyard. %1 met %2%3 dans son cimetière. - + %1 exiles %2%3. %1 exile %2%3. - + %1 moves %2%3 to hand. %1 met %2%3 dans sa main. - + %1 puts %2%3 into his library. %1 met %2%3 dans sa bibliothèque. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of his library. %1 met %2%3 en-dessous de sa bibliothèque. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of his library. %1 met %2%3 au-dessus de sa bibliothèque. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into his library at position %4. %1 met %2%3 dans sa bibliothèque à la position n°%4. - + %1 puts %2%3 into her library at position %4. - + %1 moves %2%3 to sideboard. %1 met %2%3 à sa réserve. - + %1 plays %2%3. %1 joue %2%3. - - + + a card une carte - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 draws %n card(s). %1 pioche %n carte. @@ -2146,32 +2177,32 @@ La version la plus récente est %1, l'ancienne version est %2. - + %1 undoes his last draw. %1 annule sa dernière pioche. - + %1 undoes her last draw. - + %1 undoes his last draw (%2). %1 annule sa dernière pioche (%2). - + %1 undoes her last draw (%2). - + %1 gives %2 control over %3. %1 donne le contrôle de %2 à %3. - + %1 takes a mulligan to %n. @@ -2179,54 +2210,54 @@ La version la plus récente est %1, l'ancienne version est %2. - + %1 draws his initial hand. - + %1 draws her initial hand. - + %1 flips %2 face-down. %1 retourne %2 face cachée. - + %1 flips %2 face-up. %1 retourne %2 face visible. - + %1 destroys %2. %1 détruit %2. - + %1 attaches %2 to %3's %4. need exemple (Resp'.by Ranma: JoueurA attache Adventuring Gear sur -Plated Geopede- de -JoueurB-.) %1 attache %2 sur %4 de %3. - + %1 unattaches %2. %1 détache %2. - + %1 creates token: %2%3. %1 crée un jeton %2%3. - + %1 points from %2's %3 to %4. need exemple %1 désigne le %3 de %2 à %4. - + %1 points from %2's %3 to %4's %5. need exemple %1 désigne le %3 de %2 à %5 de %4. @@ -2248,7 +2279,7 @@ La version la plus récente est %1, l'ancienne version est %2. - + %1 places %n %2 counter(s) on %3 (now %4). %1 met %n %2 marqueur sur %3 (maintenant %4). @@ -2256,7 +2287,7 @@ La version la plus récente est %1, l'ancienne version est %2. - + %1 removes %n %2 counter(s) from %3 (now %4). %1 retire %n %2 marqueur de %3 (maintenant %4). @@ -2264,7 +2295,7 @@ La version la plus récente est %1, l'ancienne version est %2. - + red rouge @@ -2272,7 +2303,7 @@ La version la plus récente est %1, l'ancienne version est %2. - + yellow jaune @@ -2280,7 +2311,7 @@ La version la plus récente est %1, l'ancienne version est %2. - + green vert @@ -2288,169 +2319,169 @@ La version la plus récente est %1, l'ancienne version est %2. - + his permanents ses permanents - + her permanents - + %1 %2 %3. wtf ? %1 %2 %3. - + taps engage - + untaps dégage - + %1 sets counter %2 to %3 (%4%5). need exemple %1 met les marqueurs %2 à %3 (%4%5). - + %1 sets %2 to not untap normally. need exemple %2 de %1 ne se dégagera pas lors de l'étape de dégagement. - + %1 sets %2 to untap normally. %2 de %1 se dégagera lors de l'étape de dégagement. - + %1 sets PT of %2 to %3. exemple plz %1 change la F/E de %2 à %3. - + %1 sets annotation of %2 to %3. %1 met l'annotation %3 à %2. - + %1 is looking at the top %2 cards %3. exemple plz %1 regarde les %2 cartes du dessus %3. - + %1 is looking at %2. exemple plz %1 regarde %2. - + %1 stops looking at %2. need exemple to be sure %1 arrête de regarder %2. - + %1 reveals %2 to %3. %1 révèle %2 à %3. - + %1 reveals %2. %1 révèle %2. - + %1 randomly reveals %2%3 to %4. %1 révèle au hasard %2%3 à %4. - + %1 randomly reveals %2%3. %1 révèle au hasard %2%3. - + %1 reveals %2%3 to %4. %1 révèle %2%3 à %4. - + %1 reveals %2%3. %1 révèle %2%3. - + It is now %1's turn. C'est maintenant le tour de %1. - + untap step étape de dégagement - + upkeep step étape d'entretien - + draw step étape de pioche - + first main phase première phase principale - + beginning of combat step étape de début du combat - + declare attackers step étape de déclaration des attaquants - + declare blockers step étape de déclaration des bloqueurs - + combat damage step étape de répartition et de résolution des blessures - + end of combat step étape de fin de combat - + second main phase seconde phase principale - + ending phase phase de fin de tour - + It is now the %1. need exemple C'est maintenant %1. @@ -3190,137 +3221,137 @@ Entrez un nom s'il vous plaît: TabGame - + F5 F5 - + F6 F6 - + F7 F7 - + F8 F8 - + F9 F9 - + F10 F10 - + &Phases - + &Game &Partie - + Next &phase &Prochaine phase - + Ctrl+Space Ctrl+Space - + Next &turn Prochain &Tour - + Ctrl+Return Ctrl+Return - + Ctrl+Enter Ctrl+Enter - + &Remove all local arrows &Retirer toutes les flèches locales - + Ctrl+R Ctrl+R - + &Concede &Concéder - + F2 F2 - + &Leave game &Quitter la partie - + Ctrl+Q Ctrl+Q - + &Say: &Dire: - + Concede Concéder - + Are you sure you want to concede this game? Êtes-vous sûr de vouloir concéder la partie? - + Leave game Quitter la partie - + Are you sure you want to leave this game? Êtes-vous sûr de vouloir quitter la partie? - + Kicked Exclu - + You have been kicked out of the game. Vous avez été exclu de la partie. - + Game %1: %2 Partie %1:%2 @@ -3328,28 +3359,28 @@ Entrez un nom s'il vous plaît: TabMessage - + Personal &talk need exemple &Discussion privée - + &Leave &Quitter - + This user is ignoring you. Cet utilisateur vous a ignoré. - + %1 has left the server. %1 a quitté le serveur. - + %1 has joined the server. %1 a rejoint le serveur. @@ -3362,27 +3393,27 @@ Entrez un nom s'il vous plaît: TabRoom - + &Say: &Dire: - + Chat Chat - + &Room &Salon - + &Leave room &Quitter le salon - + You are flooding the chat. Please wait a couple of seconds. Vous floodez le chat. Veuillez patienter quelques secondes. @@ -3505,70 +3536,68 @@ Entrez un nom s'il vous plaît: UserList - + Users online: %1 Utilisateurs en ligne:%1 - + Users in this room: %1 Utilisateurs dans ce salon: %1 - + Buddies online: %1 / %2 Amis connectés; %1 / %2 - + Ignored users online: %1 / %2 Personnes sur liste noire connectés: %1 / %2 - + User &details &Détails utilisateur - + Direct &chat &Chat direct - + Add to &buddy list Ajouter à la liste d'&amis - + Remove from &buddy list Retirer de la liste d'&amis - + Add to &ignore list Ajouter à la liste &noire - + Remove from &ignore list Retirer de la liste &noire - + Ban from &server Bannir du &serveur - Duration - Durée + Durée - Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - Entrez la durée de temps du ban (en minutes). + Entrez la durée de temps du ban (en minutes). Entrez 0 pour une durée illimitée du ban. diff --git a/cockatrice/translations/cockatrice_ja.ts b/cockatrice/translations/cockatrice_ja.ts index d3bf6ce8..5f63f561 100644 --- a/cockatrice/translations/cockatrice_ja.ts +++ b/cockatrice/translations/cockatrice_ja.ts @@ -126,6 +126,36 @@ 画像の指定 + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + バンする期間を入力してください(分単位).0でバンを解除します. + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + + + + + &Cancel + + + + + Ban user from server + + + CardDatabaseModel @@ -835,22 +865,22 @@ DeckViewContainer - + Load &local deck ローカルからデッキをロード - + Load d&eck from server サーバーからデッキをロード - + Ready to s&tart 開始準備完了 - + Load deck デッキをロード @@ -1683,275 +1713,275 @@ Local version is %1, remote version is %2. MessageLogWidget - + Connecting to %1... - + Disconnected from server. - + Invalid password. - + Protocol error. - + The game has been closed. - + %1 is now watching the game. - + %1 is not watching the game any more. - + %1 is not ready to start the game any more. - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 rolls a %2 with a %3-sided die. - + %1 draws %n card(s). - + %1 undoes his last draw. - + %1 undoes her last draw. - + %1 undoes his last draw (%2). - + %1 undoes her last draw (%2). - + from table - + from graveyard - + from exile - + from hand - + the bottom card of his library - + the bottom card of her library - + from the bottom of his library - + from the bottom of her library - + the top card of his library - + the top card of her library - + from the top of his library - + from the top of her library - + from library - + from sideboard - + from the stack - + %1 gives %2 control over %3. - + %1 puts %2 into play tapped%3. - + %1 puts %2 into play%3. - + %1 puts %2%3 into graveyard. - + %1 exiles %2%3. - + %1 moves %2%3 to hand. - + %1 puts %2%3 into his library. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of his library. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of his library. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into his library at position %4. - + %1 puts %2%3 into her library at position %4. - + %1 moves %2%3 to sideboard. - + %1 plays %2%3. - - + + a card - + %1 flips %2 face-down. - + %1 flips %2 face-up. - + %1 attaches %2 to %3's %4. - + %1 unattaches %2. - + %1 points from %2's %3 to %4's %5. @@ -1968,279 +1998,279 @@ Local version is %1, remote version is %2. - + red - + yellow - + green - + %1 sets counter %2 to %3 (%4%5). - + %1 sets PT of %2 to %3. - + %1 sets annotation of %2 to %3. - + %1 is looking at the top %2 cards %3. - + The game has started. - + Connected. - + Protocol version mismatch. Client: %1, Server: %2 - + You have joined game #%1. - + %1 has joined the game. - + %1 has left the game. - + %1 has loaded a local deck. - + %1 has loaded deck #%2. - + %1 is ready to start the game. - + %1 has conceded the game. - + %1 takes a mulligan to %n. - + %1 draws his initial hand. - + %1 draws her initial hand. - + %1 destroys %2. - + %1 creates token: %2%3. - + %1 points from %2's %3 to %4. - + %1 places %n %2 counter(s) on %3 (now %4). - + %1 removes %n %2 counter(s) from %3 (now %4). - + her permanents - + %1 %2 %3. - + %1 is looking at %2. - + %1 stops looking at %2. - + %1 reveals %2 to %3. - + %1 reveals %2. - + ending phase - + It is now %1's turn. - + %1 randomly reveals %2%3 to %4. - + %1 randomly reveals %2%3. - + %1 reveals %2%3 to %4. - + %1 reveals %2%3. - + untap step - + upkeep step - + draw step - + first main phase - + beginning of combat step - + declare attackers step - + declare blockers step - + combat damage step - + end of combat step - + second main phase - + It is now the %1. - + taps - + untaps - + %1 sets %2 to not untap normally. - + %1 sets %2 to untap normally. - + his permanents @@ -2968,137 +2998,137 @@ Please enter a name: TabGame - + F5 - + F6 - + F7 - + F8 - + F9 - + F10 - + &Phases フェイズ - + &Game ゲーム - + Next &phase 次のフェイズ - + Ctrl+Space - + Next &turn 次のターン - + Ctrl+Return - + Ctrl+Enter - + &Remove all local arrows 全ての矢印を消す - + Ctrl+R - + &Concede 投了する - + F2 - + &Leave game ゲームを退出する - + Ctrl+Q - + &Say: 発言する - + Concede 投了する - + Are you sure you want to concede this game? 本当にこのゲームに投了しますか? - + Leave game ゲームから退出する - + Are you sure you want to leave this game? 本当にこのゲームから退出しますか? - + Kicked キック - + You have been kicked out of the game. あなたはこのゲームからキックされました. - + Game %1: %2 ゲーム %1: %2 @@ -3106,27 +3136,27 @@ Please enter a name: TabMessage - + Personal &talk 個人会話 - + &Leave 退出する - + This user is ignoring you. このユーザーはあなたを無視しています. - + %1 has left the server. %1はサーバーから退出しました. - + %1 has joined the server. %1がサーバーに参加しました. @@ -3139,27 +3169,27 @@ Please enter a name: TabRoom - + &Say: 発言する - + Chat チャット - + &Room 部屋 - + &Leave room 部屋から出る - + You are flooding the chat. Please wait a couple of seconds. あなたはチャットルームから弾かれました.少々お待ちください. @@ -3281,70 +3311,68 @@ Please enter a name: UserList - + Users online: %1 ユーザー オンライン: %1 - + Users in this room: %1 部屋のユーザー数: %1 - + Buddies online: %1 / %2 フレンドオンライン: %1 / %2 - + Ignored users online: %1 / %2 無視ユーザーオンライン: %1 / %2 - + User &details ユーザー補足 - + Direct &chat 個人チャット - + Add to &buddy list フレンドリストに追加 - + Remove from &buddy list フレンドリストから削除 - + Add to &ignore list 無視リストに追加 - + Remove from &ignore list 無視リストから削除 - + Ban from &server サーバーからバンする - Duration - 期間 + 期間 - Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - バンする期間を入力してください(分単位).0でバンを解除します. + バンする期間を入力してください(分単位).0でバンを解除します. diff --git a/cockatrice/translations/cockatrice_pl.ts b/cockatrice/translations/cockatrice_pl.ts index 4a1f9307..564e6ac2 100644 --- a/cockatrice/translations/cockatrice_pl.ts +++ b/cockatrice/translations/cockatrice_pl.ts @@ -121,6 +121,36 @@ + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + + + + + &Cancel + + + + + Ban user from server + + + CardDatabaseModel @@ -787,22 +817,22 @@ DeckViewContainer - + Load &local deck - + Load d&eck from server - + Ready to s&tart - + Load deck @@ -1628,117 +1658,117 @@ Local version is %1, remote version is %2. MessageLogWidget - + Connecting to %1... - + Connected. - + Disconnected from server. - + Invalid password. - + Protocol version mismatch. Client: %1, Server: %2 - + Protocol error. - + You have joined game #%1. - + %1 has joined the game. - + %1 has left the game. - + The game has been closed. - + %1 is now watching the game. - + %1 is not watching the game any more. - + %1 has loaded a local deck. - + %1 has loaded deck #%2. - + %1 is ready to start the game. - + %1 is not ready to start the game any more. - + %1 has conceded the game. - + The game has started. - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 rolls a %2 with a %3-sided die. - + %1 draws %n card(s). @@ -1747,188 +1777,188 @@ Local version is %1, remote version is %2. - + %1 undoes his last draw. - + %1 undoes her last draw. - + %1 undoes his last draw (%2). - + %1 undoes her last draw (%2). - + from table - + from graveyard - + from exile - + from hand - + the bottom card of his library - + the bottom card of her library - + from the bottom of his library - + from the bottom of her library - + the top card of his library - + the top card of her library - + from the top of his library - + from the top of her library - + from library - + from sideboard - + from the stack - - + + a card - + %1 gives %2 control over %3. - + %1 puts %2 into play tapped%3. - + %1 puts %2 into play%3. - + %1 puts %2%3 into graveyard. - + %1 exiles %2%3. - + %1 moves %2%3 to hand. - + %1 puts %2%3 into his library. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of his library. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of his library. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into his library at position %4. - + %1 puts %2%3 into her library at position %4. - + %1 moves %2%3 to sideboard. - + %1 plays %2%3. - + %1 takes a mulligan to %n. @@ -1937,57 +1967,57 @@ Local version is %1, remote version is %2. - + %1 draws his initial hand. - + %1 draws her initial hand. - + %1 flips %2 face-down. - + %1 flips %2 face-up. - + %1 destroys %2. - + %1 attaches %2 to %3's %4. - + %1 unattaches %2. - + %1 creates token: %2%3. - + %1 points from %2's %3 to %4. - + %1 points from %2's %3 to %4's %5. - + %1 places %n %2 counter(s) on %3 (now %4). @@ -1996,7 +2026,7 @@ Local version is %1, remote version is %2. - + %1 removes %n %2 counter(s) from %3 (now %4). @@ -2005,7 +2035,7 @@ Local version is %1, remote version is %2. - + red @@ -2014,7 +2044,7 @@ Local version is %1, remote version is %2. - + yellow @@ -2023,7 +2053,7 @@ Local version is %1, remote version is %2. - + green @@ -2032,162 +2062,162 @@ Local version is %1, remote version is %2. - + his permanents - + her permanents - + %1 %2 %3. - + taps - + untaps - + %1 sets counter %2 to %3 (%4%5). - + %1 sets %2 to not untap normally. - + %1 sets %2 to untap normally. - + %1 sets PT of %2 to %3. - + %1 sets annotation of %2 to %3. - + %1 is looking at the top %2 cards %3. - + %1 is looking at %2. - + %1 stops looking at %2. - + %1 reveals %2 to %3. - + %1 reveals %2. - + %1 randomly reveals %2%3 to %4. - + %1 randomly reveals %2%3. - + %1 reveals %2%3 to %4. - + %1 reveals %2%3. - + It is now %1's turn. - + untap step - + upkeep step - + draw step - + first main phase - + beginning of combat step - + declare attackers step - + declare blockers step - + combat damage step - + end of combat step - + second main phase - + ending phase - + It is now the %1. @@ -2877,137 +2907,137 @@ Please enter a name: TabGame - + F5 - + F6 - + F7 - + F8 - + F9 - + F10 - + &Phases - + &Game - + Next &phase - + Ctrl+Space - + Next &turn - + Ctrl+Return - + Ctrl+Enter - + &Remove all local arrows - + Ctrl+R - + &Concede - + F2 - + &Leave game - + Ctrl+Q - + &Say: - + Concede - + Are you sure you want to concede this game? - + Leave game - + Are you sure you want to leave this game? - + Kicked - + You have been kicked out of the game. - + Game %1: %2 @@ -3015,27 +3045,27 @@ Please enter a name: TabMessage - + Personal &talk - + &Leave - + This user is ignoring you. - + %1 has left the server. - + %1 has joined the server. @@ -3048,27 +3078,27 @@ Please enter a name: TabRoom - + &Say: - + Chat - + &Room - + &Leave room - + You are flooding the chat. Please wait a couple of seconds. @@ -3178,71 +3208,60 @@ Please enter a name: UserList - + Users online: %1 - + Users in this room: %1 - + Buddies online: %1 / %2 - + Ignored users online: %1 / %2 - + User &details - + Direct &chat - + Add to &buddy list - + Remove from &buddy list - + Add to &ignore list - + Remove from &ignore list - + Ban from &server - - - Duration - - - - - Please enter the duration of the ban (in minutes). -Enter 0 for an indefinite ban. - - WndDeckEditor diff --git a/cockatrice/translations/cockatrice_pt-br.ts b/cockatrice/translations/cockatrice_pt-br.ts index ea855248..e94fc66b 100644 --- a/cockatrice/translations/cockatrice_pt-br.ts +++ b/cockatrice/translations/cockatrice_pt-br.ts @@ -125,6 +125,37 @@ Escolher caminho + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + Por favor, digite a duração do banimento (em minutos). +Digite 0 para banir indefinidamente. + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + &OK + + + + &Cancel + &Cancelar + + + + Ban user from server + + + CardDatabaseModel @@ -995,22 +1026,22 @@ DeckViewContainer - + Load &local deck Carregar dec&k local - + Load d&eck from server Carregar deck do &servidor - + Ready to s&tart &Pronto para começar - + Load deck Carregar deck @@ -1858,67 +1889,67 @@ A versão local é %1 e a versão remota é %2. MessageLogWidget - + Connecting to %1... Conectando a %1... - + Disconnected from server. Desconectado do servidor. - + Invalid password. Senha incorreta. - + Protocol error. Erro de protocolo. - + The game has been closed. O jogo foi fechado. - + %1 is now watching the game. %1 está assistindo o jogo agora. - + %1 is not watching the game any more. %1 não está mais assistindo o jogo. - + %1 is not ready to start the game any more. %1 não está mais pronto para começar o jogo. - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 rolls a %2 with a %3-sided die. %1 tirou um %2 com um dado de %3 lados. - + %1 draws %n card(s). %1 compra %n card. @@ -1926,208 +1957,208 @@ A versão local é %1 e a versão remota é %2. - + %1 undoes his last draw. %1 desfaz sua última compra. - + %1 undoes her last draw. - + %1 undoes his last draw (%2). %1 desfaz sua última compra (%2). - + %1 undoes her last draw (%2). - + from table vindo do campo de batalha - + from graveyard vindo do cemitério - + from exile vindo do exílio - + from hand vindo da mão - + the bottom card of his library o card do fundo do seu grimório - + the bottom card of her library - + from the bottom of his library vindo do fundo do seu grimório - + from the bottom of her library - + the top card of his library o card do topo do seu grimório - + the top card of her library - + from the top of his library vindo do topo do seu grimório - + from the top of her library - + from library vindo do grimório - + from sideboard vindo do sideboard - + from the stack vindo da pilha - + %1 gives %2 control over %3. %1 dá controle para %2 sobre %3. - + %1 puts %2 into play tapped%3. %1 põe %2 em jogo virado%3. - + %1 puts %2 into play%3. %1 põe %2 no campo de batalha %3. - + %1 puts %2%3 into graveyard. %1 põe %2 no cemitério%3. - + %1 exiles %2%3. %1 exila %2%3. - + %1 moves %2%3 to hand. %1 move %2 para a mão%3. - + %1 puts %2%3 into his library. %1 põe %2 no seu grimório%3. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of his library. %1 põe %2 no fundo do seu grimório%3. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of his library. %1 põe %2 no topo do seu grimório%3. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into his library at position %4. %1 põe %2 no seu grimório na posição %4%3. - + %1 puts %2%3 into her library at position %4. - + %1 moves %2%3 to sideboard. %1 move %2 para o sideboard%3. - + %1 plays %2%3. %1 põe %2 na pilha%3. - - + + a card um card - + %1 flips %2 face-down. %1 vira %2 para baixo. - + %1 flips %2 face-up. %1 vira %2 para cima. - + %1 attaches %2 to %3's %4. %1 anexa %2 a %4 de %3. - + %1 unattaches %2. %1 desanexa %2. - + %1 points from %2's %3 to %4's %5. %1 aponta para %5 de %4 com %3 de %2. @@ -2146,7 +2177,7 @@ A versão local é %1 e a versão remota é %2. - + red vermelho @@ -2154,7 +2185,7 @@ A versão local é %1 e a versão remota é %2. - + yellow amarelo @@ -2162,7 +2193,7 @@ A versão local é %1 e a versão remota é %2. - + green verde @@ -2170,72 +2201,72 @@ A versão local é %1 e a versão remota é %2. - + %1 sets counter %2 to %3 (%4%5). %1 altera o marcador %2 para %3 (%4%5). - + %1 sets PT of %2 to %3. %1 altera o P/R de %2 para %3. - + %1 sets annotation of %2 to %3. %1 altera a nota de %2 para%3. - + %1 is looking at the top %2 cards %3. %1 está olhando para os %2 cards do topo %3. - + The game has started. O jogo começou. - + Connected. Conectado. - + Protocol version mismatch. Client: %1, Server: %2 Versão dos protocolos incompatível. Versão do utilizador:%1, versão do servidor:%2 - + You have joined game #%1. Você entrou no jogo nº %1. - + %1 has joined the game. %1 entrou no jogo. - + %1 has left the game. %1 saiu do jogo. - + %1 has loaded a local deck. %1 carregou um deck local. - + %1 has loaded deck #%2. %1 carregou o deck nº %2. - + %1 is ready to start the game. %1 está pronto para começar o jogo. - + %1 has conceded the game. %1 concedeu o jogo. @@ -2248,22 +2279,22 @@ A versão local é %1 e a versão remota é %2. %1 compra %2 cards. - + %1 destroys %2. %1 destrói %2. - + %1 creates token: %2%3. %1 cria a ficha: %2%3. - + %1 points from %2's %3 to %4. %1 aponta para %4 com %3 de %2 . - + %1 places %n %2 counter(s) on %3 (now %4). %1 põe %n marcador %2 em %3 (agora %4). @@ -2271,7 +2302,7 @@ A versão local é %1 e a versão remota é %2. - + %1 removes %n %2 counter(s) from %3 (now %4). %1 tira %n marcador %2 em %3 (agora %4). @@ -2279,37 +2310,37 @@ A versão local é %1 e a versão remota é %2. - + %1 %2 %3. %1 %2 %3. - + %1 is looking at %2. %1 está olhando para %2. - + %1 stops looking at %2. %1 para de olhar para %2. - + %1 reveals %2 to %3. %1 revela %2 para %3. - + %1 reveals %2. %1 revela %2. - + ending phase fase final - + It is now %1's turn. Agora é o turno de %1. @@ -2318,7 +2349,7 @@ A versão local é %1 e a versão remota é %2. %1 embaralha o seu grimório. - + %1 takes a mulligan to %n. @@ -2326,117 +2357,117 @@ A versão local é %1 e a versão remota é %2. - + %1 draws his initial hand. - + %1 draws her initial hand. - + her permanents - + %1 randomly reveals %2%3 to %4. %1 revela aleatoriamente %2%3. para %4. - + %1 randomly reveals %2%3. %1 revela aleatoriamente %2%3. - + %1 reveals %2%3 to %4. %1 revela %2%3 para %4. - + %1 reveals %2%3. %1 revela %2%3. - + untap step etapa de desvirar - + upkeep step etapa de manutenção - + draw step etapa de compra - + first main phase primeira fase principal - + beginning of combat step etapa de início de combate - + declare attackers step etapa de declaracão de atacantes - + declare blockers step etapa de declaração de bloqueadores - + combat damage step etapa de dano de combate - + end of combat step etapa de fim de combate - + second main phase segunda fase principal - + It is now the %1. Agora é a %1. - + taps vira - + untaps desvira - + %1 sets %2 to not untap normally. %1 define que %2 não desvira normalmente. - + %1 sets %2 to untap normally. %1 define que %2 desvira normalmente. - + his permanents as suas permanentes @@ -3173,137 +3204,137 @@ Por favor, entre um nome: TabGame - + F5 F5 - + F6 F6 - + F7 F7 - + F8 F8 - + F9 F9 - + F10 F10 - + &Phases &Etapas - + &Game &Jogo - + Next &phase Próxima &etapa - + Ctrl+Space Ctrl+Espaço - + Next &turn Próximo &turno - + Ctrl+Return Ctrl+Return - + Ctrl+Enter Ctrl+Enter - + &Remove all local arrows &Apagar todas as setas locais - + Ctrl+R Ctrl+R - + &Concede &Conceder - + F2 F2 - + &Leave game &Sair do jogo - + Ctrl+Q Ctrl+Q - + &Say: &Falar: - + Concede Conceder - + Are you sure you want to concede this game? Você tem certeza que deseja conceder este jogo? - + Leave game Sair do jogo - + Are you sure you want to leave this game? Você tem certeza que deseja sair deste jogo? - + Kicked Chutado - + You have been kicked out of the game. Você foi chutado do jogo. - + Game %1: %2 Jogo %1: %2 @@ -3311,27 +3342,27 @@ Por favor, entre um nome: TabMessage - + Personal &talk Chat &privado - + &Leave &Sair - + This user is ignoring you. Este usuário está ignorando você. - + %1 has left the server. %1 saiu do servidor. - + %1 has joined the server. %1 entrou no servidor. @@ -3344,27 +3375,27 @@ Por favor, entre um nome: TabRoom - + &Say: &Falar: - + Chat Chat - + &Room &Sala - + &Leave room S&air da sala - + You are flooding the chat. Please wait a couple of seconds. Você está flodando o chat. Por favor, espere alguns segundos. @@ -3486,70 +3517,68 @@ Por favor, entre um nome: UserList - + Users online: %1 Usuários online: %1 - + Users in this room: %1 Usuários nesta sala: %1 - + Buddies online: %1 / %2 Amigos online: %1 / %2 - + Ignored users online: %1 / %2 Usuários ignorados online: %1 / %2 - + User &details &Detalhes do usuário - + Direct &chat &Chat direto - + Add to &buddy list Adicionar à &lista de amigos - + Remove from &buddy list Remover da li&sta de amigos - + Add to &ignore list Adicionar à li&sta dos ignorados - + Remove from &ignore list Remover da lista dos i&gnorados - + Ban from &server Ban&ir do servidor - Duration - Duração + Duração - Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - Por favor, digite a duração do banimento (em minutos). + Por favor, digite a duração do banimento (em minutos). Digite 0 para banir indefinidamente. diff --git a/cockatrice/translations/cockatrice_pt.ts b/cockatrice/translations/cockatrice_pt.ts index ed2d3b20..ea4aa904 100644 --- a/cockatrice/translations/cockatrice_pt.ts +++ b/cockatrice/translations/cockatrice_pt.ts @@ -125,6 +125,37 @@ Escolher directório + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + Por favor introduza a duração do banimento (em minutos). +Introduza 0 para um banimento indefinido. + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + + + + + &Cancel + &Cancelar + + + + Ban user from server + + + CardDatabaseModel @@ -995,22 +1026,22 @@ DeckViewContainer - + Load &local deck Carregar deck l&ocal - + Load d&eck from server Carregar deck do &servidor - + Ready to s&tart &Pronto para começar - + Load deck Carregar deck @@ -1862,92 +1893,92 @@ Versão local é %1, versão remota é %2. MessageLogWidget - + Connecting to %1... Ligando a %1... - + Connected. Ligado. - + Disconnected from server. Desligado do servidor. - + Invalid password. Password incorrecto. - + Protocol version mismatch. Client: %1, Server: %2 Versão dos protocolos incompatível. Versão do utilizador:%1, versão do servidor:%2 - + Protocol error. Erro de protocolo. - + You have joined game #%1. Você entrou no jogo #%1. - + %1 has joined the game. %1 entrou no jogo. - + %1 has left the game. %1 abandonou o jogo. - + The game has been closed. Este jogo foi encerrado. - + %1 is now watching the game. %1 está agora a ver o jogo. - + %1 is not watching the game any more. %1 já não está a ver o jogo. - + %1 has loaded a local deck. %1 carregou um deck local. - + %1 has loaded deck #%2. %1 carregou o deck #%2. - + %1 is ready to start the game. %1 está pronto a começar o jogo. - + %1 is not ready to start the game any more. %1 já não está pronto a começar o jogo. - + %1 has conceded the game. %1 concedeu o jogo. - + The game has started. O jogo começou. @@ -1956,7 +1987,7 @@ Versão local é %1, versão remota é %2. %1 baralha o grimório. - + %1 rolls a %2 with a %3-sided die. %1 obteve %2 com um dado de %3 faces. @@ -1969,157 +2000,157 @@ Versão local é %1, versão remota é %2. %1 compra %2 cartas. - + from table vindo da mesa - + from graveyard vindo do cemitério - + from exile vindo do exílio - + from hand vindo da mão - + the bottom card of his library a carta do fundo do seu grimório - + the bottom card of her library - + from the bottom of his library do fundo do seu grimório - + from the bottom of her library - + the top card of his library a carta do topo do seu grimório - + the top card of her library - + from the top of his library do topo do seu grimório - + from the top of her library - + from library do grimório - + from sideboard do sideboard - + from the stack da pilha - + %1 puts %2 into play tapped%3. %1 coloca %2 em jogo virado(a)%3. - + %1 puts %2 into play%3. %1 coloca %2 em jogo %3. - + %1 puts %2%3 into graveyard. %1 coloca %2%3 no cemitério. - + %1 exiles %2%3. %1 exila %2%3. - + %1 moves %2%3 to hand. %1 move %2%3 para a mão. - + %1 puts %2%3 into his library. %1 coloca %2%3 no seu grimório. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of his library. %1 coloca %2%3 no fundo do seu grimório. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of his library. %1 coloca %2%3 no topo do seu grimório. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into his library at position %4. %1 coloca %2%3 no seu grimório na posição %4. - + %1 puts %2%3 into her library at position %4. - + %1 moves %2%3 to sideboard. %1 move %2%3 para o sideboard. - + %1 plays %2%3. %1 joga %2%3. - + %1 takes a mulligan to %n. @@ -2127,17 +2158,17 @@ Versão local é %1, versão remota é %2. - + %1 draws his initial hand. - + %1 draws her initial hand. - + %1 places %n %2 counter(s) on %3 (now %4). %1 coloca %n %2 marcador em %3 (agora com %4). @@ -2145,7 +2176,7 @@ Versão local é %1, versão remota é %2. - + %1 removes %n %2 counter(s) from %3 (now %4). %1 remove %n %2 marcador de %3 (agora com %4). @@ -2153,28 +2184,28 @@ Versão local é %1, versão remota é %2. - - + + a card uma carta - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 draws %n card(s). %1 compra %n carta. @@ -2182,67 +2213,67 @@ Versão local é %1, versão remota é %2. - + %1 undoes his last draw. %1 desfaz a sua última compra. - + %1 undoes her last draw. - + %1 undoes his last draw (%2). %1 desfaz a sua última compra (%2). - + %1 undoes her last draw (%2). - + %1 gives %2 control over %3. %1 dá controlo sobre %3 a %2. - + %1 flips %2 face-down. %1 volta a face de %2 para baixo. - + %1 flips %2 face-up. %1 volta a face de %2 para cima. - + %1 destroys %2. %1 destrói %2. - + %1 attaches %2 to %3's %4. %1 anexa %2 a %4 de %3. - + %1 unattaches %2. %1 desanexa %2. - + %1 creates token: %2%3. %1 cria ficha: %2%3. - + %1 points from %2's %3 to %4. %1 aponta de %3 de %2 para %4. - + %1 points from %2's %3 to %4's %5. %1 aponta de %3 de %2 para %5 de %4. @@ -2261,7 +2292,7 @@ Versão local é %1, versão remota é %2. - + red vermelho @@ -2269,7 +2300,7 @@ Versão local é %1, versão remota é %2. - + yellow amarelo @@ -2277,7 +2308,7 @@ Versão local é %1, versão remota é %2. - + green verde @@ -2285,162 +2316,162 @@ Versão local é %1, versão remota é %2. - + his permanents as suas permanentes - + her permanents - + %1 %2 %3. %1 %2 %3. - + taps vira - + untaps desvira - + %1 sets counter %2 to %3 (%4%5). %1 altera o número de marcadores %2 para %3(%4%5). - + %1 sets %2 to not untap normally. %1 define %2 para não desvirar normalmente. - + %1 sets %2 to untap normally. %1 define %2 para desvirar normalmente. - + %1 sets PT of %2 to %3. %1 define o P/R de %2 como %3. - + %1 sets annotation of %2 to %3. %1 coloca uma nota de %2 em%3. - + %1 is looking at the top %2 cards %3. %1 está a olhar para as %2 cartas do topo %3. - + %1 is looking at %2. %1 está a olhar para %2. - + %1 stops looking at %2. %1 para de olhar para %2. - + %1 reveals %2 to %3. %1 revela %2 a %3. - + %1 reveals %2. %1 revela %2. - + %1 randomly reveals %2%3 to %4. %1 revela aleatoreamente %2%3. a %4. - + %1 randomly reveals %2%3. %1 revela aleatoreamente %2%3. - + %1 reveals %2%3 to %4. %1 revela %2%3 a %4. - + %1 reveals %2%3. %1 revela %2%3. - + It is now %1's turn. É agora o turno de %1. - + untap step Etapa de Desvirar - + upkeep step Etapa de Manutenção - + draw step Etapa de Compra - + first main phase 1ª Fase Principal (pré-combate) - + beginning of combat step Etapa de Início de Combate - + declare attackers step Etapa de Declaração de Atacantes - + declare blockers step Etapa de Declaração de Bloqueadores - + combat damage step Etapa de Dano de Combate - + end of combat step Etapa de Fim de Combate - + second main phase 2ª Fase Principal (pós-combate) - + ending phase Fase Final - + It is now the %1. É agora a %1. @@ -3177,137 +3208,137 @@ Por favor introduza um nome: TabGame - + F5 F5 - + F6 F6 - + F7 F7 - + F8 F8 - + F9 F9 - + F10 F10 - + &Phases Fa&ses - + &Game &Jogo - + Next &phase Próxima &fase - + Ctrl+Space Ctrl+Space - + Next &turn Próximo &turno - + Ctrl+Return Ctrl+Return - + Ctrl+Enter Ctrl+Enter - + &Remove all local arrows &Remover todas as setas locais - + Ctrl+R Ctrl+R - + &Concede &Conceder - + F2 F2 - + &Leave game Sair do &jogo - + Ctrl+Q Ctrl+Q - + &Say: &Dizer: - + Concede Conceder - + Are you sure you want to concede this game? Tem a certeza que deseja conceder este jogo? - + Leave game Sair do jogo - + Are you sure you want to leave this game? Tem a certeza que deseja sair deste jogo? - + Kicked Expulso - + You have been kicked out of the game. Você foi expulso do jogo. - + Game %1: %2 Jogo %1: %2 @@ -3315,27 +3346,27 @@ Por favor introduza um nome: TabMessage - + Personal &talk Conversação &privada - + &Leave &Abandonar - + This user is ignoring you. Este utilizador esta a ignorar-te. - + %1 has left the server. %1 abandonou o servidor. - + %1 has joined the server. %1 entrou no servidor. @@ -3348,27 +3379,27 @@ Por favor introduza um nome: TabRoom - + &Say: &Dizer: - + Chat - + &Room &Sala - + &Leave room &Abandonar a sala - + You are flooding the chat. Please wait a couple of seconds. Estás a inundar o chat .Por favor aguarde alguns segundos. @@ -3490,70 +3521,68 @@ Por favor introduza um nome: UserList - + Users online: %1 Utilizadores online: %1 - + Users in this room: %1 Utilizadores nesta sala:%1 - + Buddies online: %1 / %2 Amigos online: %1 / %2 - + Ignored users online: %1 / %2 Utilizadores ignorados online %1 / %2 - + User &details Detalhes do &utilizador - + Direct &chat Conversação &directa - + Add to &buddy list Adicionar a lista de &amigos - + Remove from &buddy list Remover da lista de &amigos - + Add to &ignore list Adicionar a lista a &ignorar - + Remove from &ignore list Remover da lista a &ignorar - + Ban from &server Banir do &servidor - Duration - Duração + Duração - Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - Por favor introduza a duração do banimento (em minutos). + Por favor introduza a duração do banimento (em minutos). Introduza 0 para um banimento indefinido. diff --git a/cockatrice/translations/cockatrice_ru.ts b/cockatrice/translations/cockatrice_ru.ts index 43d41057..94e9d03a 100644 --- a/cockatrice/translations/cockatrice_ru.ts +++ b/cockatrice/translations/cockatrice_ru.ts @@ -121,6 +121,37 @@ Выберите путь + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + Введите продолжительность бана (в минутах). +Введите 0 чтобы забанить пожизненно. + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + &Ок + + + + &Cancel + &Отмена + + + + Ban user from server + + + CardDatabaseModel @@ -941,22 +972,22 @@ DeckViewContainer - + Load &local deck Загрузить &колоду с диска - + Load d&eck from server Загрузить к&олоду с сервера - + Ready to s&tart &Готов - + Load deck Загрузить колоду @@ -1786,92 +1817,92 @@ Local version is %1, remote version is %2. MessageLogWidget - + Connecting to %1... Подключение к %1... - + Connected. Подключено. - + Disconnected from server. Нет соединения с сервером. - + Invalid password. Неверный пароль. - + Protocol version mismatch. Client: %1, Server: %2 Несовпадение версий. Клиент: %1, Сервер: %2 - + Protocol error. Ошибка протокола. - + You have joined game #%1. Вы присоединились к игре #%1. - + %1 has joined the game. %1 присоединился к игре. - + %1 has left the game. %1 покиул игру. - + The game has been closed. Игра закрыта. - + %1 is now watching the game. %1 вошел как зритель. - + %1 is not watching the game any more. %1 покинул зрительскую ложу. - + %1 has loaded a local deck. %1 загрузил колоду с диска. - + %1 has loaded deck #%2. %1 загрузил колоду #%2. - + %1 is ready to start the game. %1 готов начать игру. - + %1 is not ready to start the game any more. %1 все еще не готов. - + %1 has conceded the game. %1 решил сдаться. - + The game has started. Игра началась. @@ -1880,7 +1911,7 @@ Local version is %1, remote version is %2. %1 размешивает библиотеку. - + %1 rolls a %2 with a %3-sided die. %1 выкинул %2 / %3. @@ -1893,168 +1924,168 @@ Local version is %1, remote version is %2. %1 взял %2 карт. - + %1 undoes his last draw. %1 отменил последнее взятие. - + %1 undoes his last draw (%2). %1 отменил %2 последних взятий. - + from table с поля битвы - + from graveyard из кладбища - + from exile из изгнания - + from hand из руки - + the bottom card of his library нижнюю карту своей библиотеки - + from the bottom of his library со дна своей библиотеки - + the top card of his library верхнюю карту своей библиотеки - + from the top of his library с верха своей библиотеки - + from library из библиотеки - + from sideboard из сайда - + from the stack из стека - - + + a card карту - + %1 gives %2 control over %3. %1 передает %2 контроль над %3. - + %1 puts %2 into play%3. %1 поместил %2 на поле битвы %3. - + %1 puts %2%3 into graveyard. %1 поместил %2%3 на кладбище. - + %1 exiles %2%3. %1 изгоняет %2%3. - + %1 moves %2%3 to hand. %1 поместил %2%3 в руку. - + %1 puts %2%3 into his library. %1 поместил %2%3 в свою библиотеку. - + %1 puts %2%3 on bottom of his library. %1 поместил %2%3 на дно своей библиотеки. - + %1 puts %2%3 on top of his library. %1 поместил %2%3 на верх своей библиотеки. - + %1 puts %2%3 into his library at position %4. %1 поместил %2%3 в свою библиотеку %4 сверху. - + %1 moves %2%3 to sideboard. %1 поместил %2%3 в сайд. - + %1 plays %2%3. %1 разыгрывает %2%3. - + %1 flips %2 face-down. %1 перевернул %2 лицом вниз. - + %1 flips %2 face-up. %1 перевернул %2 лицом вверх. - + %1 destroys %2. %1 уничтожил %2. - + %1 attaches %2 to %3's %4. %1 присоединил %2 к %4 игрока %3. - + %1 unattaches %2. %1 отсоединил %2. - + %1 creates token: %2%3. %1 создал фишку: %2%3. - + %1 points from %2's %3 to %4. %1 указывает с %3 контролируемого %2 на %4. - + %1 points from %2's %3 to %4's %5. %1 указывает с %3 контролируемого %2 на %5 контролируемого %4. @@ -2075,22 +2106,22 @@ Local version is %1, remote version is %2. - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 draws %n card(s). %1 взял %n карту. @@ -2099,62 +2130,62 @@ Local version is %1, remote version is %2. - + %1 undoes her last draw. - + %1 undoes her last draw (%2). - + the bottom card of her library - + from the bottom of her library - + the top card of her library - + from the top of her library - + %1 puts %2 into play tapped%3. %1 положил %2 повернутым на поле битвы%3. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into her library at position %4. - + %1 takes a mulligan to %n. @@ -2163,17 +2194,17 @@ Local version is %1, remote version is %2. - + %1 draws his initial hand. - + %1 draws her initial hand. - + %1 places %n %2 counter(s) on %3 (now %4). %1 поместил %n %2 жетон на %3 (теперь %4). @@ -2182,7 +2213,7 @@ Local version is %1, remote version is %2. - + %1 removes %n %2 counter(s) from %3 (now %4). %1 снял %n %2 жетон с %3 (теперь %4). @@ -2191,7 +2222,7 @@ Local version is %1, remote version is %2. - + red красный @@ -2200,7 +2231,7 @@ Local version is %1, remote version is %2. - + yellow желтый @@ -2209,7 +2240,7 @@ Local version is %1, remote version is %2. - + green зеленый @@ -2218,162 +2249,162 @@ Local version is %1, remote version is %2. - + his permanents свои перманенты - + her permanents - + %1 %2 %3. %1 %2 %3. - + taps повернул - + untaps развернул - + %1 sets counter %2 to %3 (%4%5). %1 установил жетон %2 на %3 (%4%5). - + %1 sets %2 to not untap normally. %2 теперь не разворачивается как обычно (%1). - + %1 sets %2 to untap normally. %2 теперь разворачивается как обычно (%1). - + %1 sets PT of %2 to %3. %1 установил Силу/Защиту %2 %3. - + %1 sets annotation of %2 to %3. %1 сделал пометку на %2 "%3". - + %1 is looking at the top %2 cards %3. %1 смотрит верхние %2 карт библиотеки %3. - + %1 is looking at %2. %1 просматривает %2. - + %1 stops looking at %2. %1 закончил просматривать %2. - + %1 reveals %2 to %3. %1 показывает его %2 %3. - + %1 reveals %2. %1 открыл его %2. - + %1 randomly reveals %2%3 to %4. %1 показывает случайно выбранную%3 карту (%2) %4. - + %1 randomly reveals %2%3. %1 открывает случайно выбранную%3 карту (%2). - + %1 reveals %2%3 to %4. %1 показывает%2%3 %4. - + %1 reveals %2%3. %1 открывает%2%3. - + It is now %1's turn. Ход игрока %1. - + untap step шаг разворота - + upkeep step шаг поддержки - + draw step шаг взятия карты - + first main phase первая главная фаза - + beginning of combat step шаг начала битвы - + declare attackers step шаг назначения атакующих - + declare blockers step шаг назначения блокирующих - + combat damage step шаг нанесения повреждений - + end of combat step шаг завершения битвы - + second main phase вторая главная фаза - + ending phase заключительный шаг - + It is now the %1. Сейчас %1. @@ -3076,137 +3107,137 @@ Please enter a name: TabGame - + F5 - + F6 - + F7 - + F8 - + F9 - + F10 - + &Phases &Фазы - + &Game &Игра - + Next &phase Следующая &фаза - + Ctrl+Space - + Next &turn Следующий &ход - + Ctrl+Return - + Ctrl+Enter - + &Remove all local arrows &Удалить все указатели - + Ctrl+R - + &Concede Сда&юсь! - + F2 - + &Leave game Покинуть и&гру - + Ctrl+Q - + &Say: Ска&зать: - + Concede Сдаться - + Are you sure you want to concede this game? Испугался? - + Leave game Покинуть игру - + Are you sure you want to leave this game? Вы уверены, что хотите уйти? - + Kicked Выкинут - + You have been kicked out of the game. Вас выкинули из игры. - + Game %1: %2 Игра %1: %2 @@ -3214,27 +3245,27 @@ Please enter a name: TabMessage - + Personal &talk Личная &беседа - + &Leave &Покинуть - + This user is ignoring you. Этот пользователь добавил вас в игнор-лист. - + %1 has left the server. %1 отключился. - + %1 has joined the server. %1 зашел на сервер. @@ -3247,27 +3278,27 @@ Please enter a name: TabRoom - + &Say: &Сказать: - + Chat Чат - + &Room &Комната - + &Leave room &Покинуть комнату - + You are flooding the chat. Please wait a couple of seconds. Кажется, Вы нафлудили. Пожалуйста, подождите пару секунд. @@ -3381,70 +3412,68 @@ Please enter a name: UserList - + Users online: %1 Пользователей онлайн: %1 - + Users in this room: %1 Пользователей в этой комнате: %1 - + Buddies online: %1 / %2 Друзей онлайн: %1 / %2 - + Ignored users online: %1 / %2 Игнорируемых пользователей онлайн: %1 / %2 - + User &details Данные о &пользователе - + Direct &chat Обратиться &лично - + Add to &buddy list Добавить в список &друзей - + Remove from &buddy list &Удалить из друзей - + Add to &ignore list Добавить в &игнор-лист - + Remove from &ignore list Удалить и&з игнор-листа - + Ban from &server За&банить на сервере - Duration - Продолжительность + Продолжительность - Please enter the duration of the ban (in minutes). Enter 0 for an indefinite ban. - Введите продолжительность бана (в минутах). + Введите продолжительность бана (в минутах). Введите 0 чтобы забанить пожизненно. diff --git a/cockatrice/translations/cockatrice_sk.ts b/cockatrice/translations/cockatrice_sk.ts index aca97b8b..596131a7 100644 --- a/cockatrice/translations/cockatrice_sk.ts +++ b/cockatrice/translations/cockatrice_sk.ts @@ -121,6 +121,36 @@ + + BanDialog + + + Please enter the duration of the ban (in minutes). +Enter 0 for an indefinite ban. + + + + + Please enter the reason for the ban. +This is only saved for moderators and cannot be seen by the banned person. + + + + + &OK + + + + + &Cancel + + + + + Ban user from server + + + CardDatabaseModel @@ -787,22 +817,22 @@ DeckViewContainer - + Load &local deck - + Load d&eck from server - + Ready to s&tart - + Load deck @@ -1628,117 +1658,117 @@ Local version is %1, remote version is %2. MessageLogWidget - + Connecting to %1... - + Connected. - + Disconnected from server. - + Invalid password. - + Protocol version mismatch. Client: %1, Server: %2 - + Protocol error. - + You have joined game #%1. - + %1 has joined the game. - + %1 has left the game. - + The game has been closed. - + %1 is now watching the game. - + %1 is not watching the game any more. - + %1 has loaded a local deck. - + %1 has loaded deck #%2. - + %1 is ready to start the game. - + %1 is not ready to start the game any more. - + %1 has conceded the game. - + The game has started. - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 shuffles %2. - + %1 rolls a %2 with a %3-sided die. - + %1 draws %n card(s). @@ -1747,188 +1777,188 @@ Local version is %1, remote version is %2. - + %1 undoes his last draw. - + %1 undoes her last draw. - + %1 undoes his last draw (%2). - + %1 undoes her last draw (%2). - + from table - + from graveyard - + from exile - + from hand - + the bottom card of his library - + the bottom card of her library - + from the bottom of his library - + from the bottom of her library - + the top card of his library - + the top card of her library - + from the top of his library - + from the top of her library - + from library - + from sideboard - + from the stack - - + + a card - + %1 gives %2 control over %3. - + %1 puts %2 into play tapped%3. - + %1 puts %2 into play%3. - + %1 puts %2%3 into graveyard. - + %1 exiles %2%3. - + %1 moves %2%3 to hand. - + %1 puts %2%3 into his library. - + %1 puts %2%3 into her library. - + %1 puts %2%3 on bottom of his library. - + %1 puts %2%3 on bottom of her library. - + %1 puts %2%3 on top of his library. - + %1 puts %2%3 on top of her library. - + %1 puts %2%3 into his library at position %4. - + %1 puts %2%3 into her library at position %4. - + %1 moves %2%3 to sideboard. - + %1 plays %2%3. - + %1 takes a mulligan to %n. @@ -1937,57 +1967,57 @@ Local version is %1, remote version is %2. - + %1 draws his initial hand. - + %1 draws her initial hand. - + %1 flips %2 face-down. - + %1 flips %2 face-up. - + %1 destroys %2. - + %1 attaches %2 to %3's %4. - + %1 unattaches %2. - + %1 creates token: %2%3. - + %1 points from %2's %3 to %4. - + %1 points from %2's %3 to %4's %5. - + %1 places %n %2 counter(s) on %3 (now %4). @@ -1996,7 +2026,7 @@ Local version is %1, remote version is %2. - + %1 removes %n %2 counter(s) from %3 (now %4). @@ -2005,7 +2035,7 @@ Local version is %1, remote version is %2. - + red @@ -2014,7 +2044,7 @@ Local version is %1, remote version is %2. - + yellow @@ -2023,7 +2053,7 @@ Local version is %1, remote version is %2. - + green @@ -2032,162 +2062,162 @@ Local version is %1, remote version is %2. - + his permanents - + her permanents - + %1 %2 %3. - + taps - + untaps - + %1 sets counter %2 to %3 (%4%5). - + %1 sets %2 to not untap normally. - + %1 sets %2 to untap normally. - + %1 sets PT of %2 to %3. - + %1 sets annotation of %2 to %3. - + %1 is looking at the top %2 cards %3. - + %1 is looking at %2. - + %1 stops looking at %2. - + %1 reveals %2 to %3. - + %1 reveals %2. - + %1 randomly reveals %2%3 to %4. - + %1 randomly reveals %2%3. - + %1 reveals %2%3 to %4. - + %1 reveals %2%3. - + It is now %1's turn. - + untap step - + upkeep step - + draw step - + first main phase - + beginning of combat step - + declare attackers step - + declare blockers step - + combat damage step - + end of combat step - + second main phase - + ending phase - + It is now the %1. @@ -2877,137 +2907,137 @@ Please enter a name: TabGame - + F5 - + F6 - + F7 - + F8 - + F9 - + F10 - + &Phases - + &Game - + Next &phase - + Ctrl+Space - + Next &turn - + Ctrl+Return - + Ctrl+Enter - + &Remove all local arrows - + Ctrl+R - + &Concede - + F2 - + &Leave game - + Ctrl+Q - + &Say: - + Concede - + Are you sure you want to concede this game? - + Leave game - + Are you sure you want to leave this game? - + Kicked - + You have been kicked out of the game. - + Game %1: %2 @@ -3015,27 +3045,27 @@ Please enter a name: TabMessage - + Personal &talk - + &Leave - + This user is ignoring you. - + %1 has left the server. - + %1 has joined the server. @@ -3048,27 +3078,27 @@ Please enter a name: TabRoom - + &Say: - + Chat - + &Room - + &Leave room - + You are flooding the chat. Please wait a couple of seconds. @@ -3178,71 +3208,60 @@ Please enter a name: UserList - + Users online: %1 - + Users in this room: %1 - + Buddies online: %1 / %2 - + Ignored users online: %1 / %2 - + User &details - + Direct &chat - + Add to &buddy list - + Remove from &buddy list - + Add to &ignore list - + Remove from &ignore list - + Ban from &server - - - Duration - - - - - Please enter the duration of the ban (in minutes). -Enter 0 for an indefinite ban. - - WndDeckEditor diff --git a/common/protocol_items.cpp b/common/protocol_items.cpp index b92a182b..33670ef4 100644 --- a/common/protocol_items.cpp +++ b/common/protocol_items.cpp @@ -484,11 +484,12 @@ Command_ShutdownServer::Command_ShutdownServer(const QString &_reason, int _minu insertItem(new SerializableItem_String("reason", _reason)); insertItem(new SerializableItem_Int("minutes", _minutes)); } -Command_BanFromServer::Command_BanFromServer(const QString &_userName, int _minutes) +Command_BanFromServer::Command_BanFromServer(const QString &_userName, int _minutes, const QString &_reason) : ModeratorCommand("ban_from_server") { insertItem(new SerializableItem_String("user_name", _userName)); insertItem(new SerializableItem_Int("minutes", _minutes)); + insertItem(new SerializableItem_String("reason", _reason)); } void ProtocolItem::initializeHashAuto() { diff --git a/common/protocol_items.dat b/common/protocol_items.dat index ab83e15a..2e0f8603 100644 --- a/common/protocol_items.dat +++ b/common/protocol_items.dat @@ -80,4 +80,4 @@ 6:mulligan:i,number 7:update_server_message 7:shutdown_server:s,reason:i,minutes -8:ban_from_server:s,user_name:i,minutes \ No newline at end of file +8:ban_from_server:s,user_name:i,minutes:s,reason \ No newline at end of file diff --git a/common/protocol_items.h b/common/protocol_items.h index 810357a8..efeb7f93 100644 --- a/common/protocol_items.h +++ b/common/protocol_items.h @@ -735,9 +735,10 @@ public: class Command_BanFromServer : public ModeratorCommand { Q_OBJECT public: - Command_BanFromServer(const QString &_userName = QString(), int _minutes = -1); + Command_BanFromServer(const QString &_userName = QString(), int _minutes = -1, const QString &_reason = QString()); QString getUserName() const { return static_cast(itemMap.value("user_name"))->getData(); }; int getMinutes() const { return static_cast(itemMap.value("minutes"))->getData(); }; + QString getReason() const { return static_cast(itemMap.value("reason"))->getData(); }; static SerializableItem *newItem() { return new Command_BanFromServer; } int getItemId() const { return ItemId_Command_BanFromServer; } }; diff --git a/common/server.cpp b/common/server.cpp index e4c68ff9..07f7c7cf 100644 --- a/common/server.cpp +++ b/common/server.cpp @@ -52,7 +52,7 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString QMutexLocker locker(&serverMutex); if (name.size() > 35) name = name.left(35); - AuthenticationResult authState = checkUserPassword(name, password); + AuthenticationResult authState = checkUserPassword(session, name, password); if (authState == PasswordWrong) return authState; diff --git a/common/server.h b/common/server.h index 1c35f5a1..d2f15e76 100644 --- a/common/server.h +++ b/common/server.h @@ -43,7 +43,6 @@ public: virtual QMap getBuddyList(const QString &name) = 0; virtual QMap getIgnoreList(const QString &name) = 0; - virtual bool getUserBanned(Server_ProtocolHandler * /*client*/, const QString & /*userName*/) const { return false; } protected: void prepareDestroy(); QList clients; @@ -51,7 +50,7 @@ protected: QMap rooms; virtual bool userExists(const QString &user) = 0; - virtual AuthenticationResult checkUserPassword(const QString &user, const QString &password) = 0; + virtual AuthenticationResult checkUserPassword(Server_ProtocolHandler *handler, const QString &user, const QString &password) = 0; virtual ServerInfo_User *getUserData(const QString &name) = 0; int getUsersCount() const; int getGamesCount() const; diff --git a/common/server_protocolhandler.cpp b/common/server_protocolhandler.cpp index b929edb6..de50435a 100644 --- a/common/server_protocolhandler.cpp +++ b/common/server_protocolhandler.cpp @@ -280,8 +280,6 @@ ResponseCode Server_ProtocolHandler::cmdLogin(Command_Login *cmd, CommandContain QString userName = cmd->getUsername().simplified(); if (userName.isEmpty() || (userInfo != 0)) return RespContextError; - if (server->getUserBanned(this, userName)) - return RespWrongPassword; authState = server->loginUser(this, userName, cmd->getPassword()); if (authState == PasswordWrong) return RespWrongPassword; diff --git a/servatrice/servatrice.sql b/servatrice/servatrice.sql index 06effa01..7bd64c58 100644 --- a/servatrice/servatrice.sql +++ b/servatrice/servatrice.sql @@ -111,7 +111,6 @@ CREATE TABLE IF NOT EXISTS `cockatrice_users` ( `avatar_bmp` blob NOT NULL, `registrationDate` datetime NOT NULL, `active` tinyint(1) NOT NULL, - `banned` tinyint(1) NOT NULL, `token` char(32) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) @@ -149,3 +148,12 @@ CREATE TABLE `cockatrice_buddylist` ( KEY `id_user2` (`id_user2`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `cockatrice_bans` ( + `id_user` int(7) unsigned zerofill NOT NULL, + `id_admin` int(7) unsigned zerofill NOT NULL, + `time_from` datetime NOT NULL, + `minutes` int(6) NOT NULL, + `reason` text NOT NULL, + KEY `id_user` (`id_user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + diff --git a/servatrice/src/servatrice.cpp b/servatrice/src/servatrice.cpp index fffc1cec..1bb126e5 100644 --- a/servatrice/src/servatrice.cpp +++ b/servatrice/src/servatrice.cpp @@ -169,25 +169,32 @@ bool Servatrice::execSqlQuery(QSqlQuery &query) return false; } -AuthenticationResult Servatrice::checkUserPassword(const QString &user, const QString &password) +AuthenticationResult Servatrice::checkUserPassword(Server_ProtocolHandler *handler, const QString &user, const QString &password) { + serverMutex.lock(); + QHostAddress address = static_cast(handler)->getPeerAddress(); + for (int i = 0; i < addressBanList.size(); ++i) + if (address == addressBanList[i].first) + return PasswordWrong; + serverMutex.unlock(); + QMutexLocker locker(&dbMutex); const QString method = settings->value("authentication/method").toString(); if (method == "none") return UnknownUser; else if (method == "sql") { checkSql(); - + QSqlQuery query; - query.prepare("select banned, password from " + dbPrefix + "_users where name = :name and active = 1"); + query.prepare("select a.password, timediff(now(), date_add(b.time_from, interval b.minutes minute)) < 0, b.minutes <=> 0 from " + dbPrefix + "_users a left join " + dbPrefix + "_bans b on b.id_user = a.id and b.time_from = (select max(c.time_from) from " + dbPrefix + "_bans c where c.id_user = a.id) where a.name = :name and a.active = 1"); query.bindValue(":name", user); if (!execSqlQuery(query)) return PasswordWrong; if (query.next()) { - if (query.value(0).toInt()) + if (query.value(1).toInt() || query.value(2).toInt()) return PasswordWrong; - if (query.value(1).toString() == password) + if (query.value(0).toString() == password) return PasswordRight; else return PasswordWrong; @@ -325,19 +332,6 @@ QMap Servatrice::getIgnoreList(const QString &name) return result; } -bool Servatrice::getUserBanned(Server_ProtocolHandler *client, const QString &userName) const -{ - QMutexLocker locker(&serverMutex); - QHostAddress address = static_cast(client)->getPeerAddress(); - for (int i = 0; i < addressBanList.size(); ++i) - if (address == addressBanList[i].first) - return true; - for (int i = 0; i < nameBanList.size(); ++i) - if (userName == nameBanList[i].first) - return true; - return false; -} - void Servatrice::updateBanTimer() { QMutexLocker locker(&serverMutex); @@ -346,11 +340,6 @@ void Servatrice::updateBanTimer() addressBanList.removeAt(i); else ++i; - for (int i = 0; i < nameBanList.size(); ) - if (--(nameBanList[i].second) <= 0) - nameBanList.removeAt(i); - else - ++i; } void Servatrice::updateLoginMessage() diff --git a/servatrice/src/servatrice.h b/servatrice/src/servatrice.h index 1a3d1d09..5a2fb1b8 100644 --- a/servatrice/src/servatrice.h +++ b/servatrice/src/servatrice.h @@ -74,13 +74,11 @@ public: int getUsersWithAddress(const QHostAddress &address) const; QMap getBuddyList(const QString &name); QMap getIgnoreList(const QString &name); - bool getUserBanned(Server_ProtocolHandler *client, const QString &userName) const; void addAddressBan(const QHostAddress &address, int minutes) { addressBanList.append(QPair(address, minutes)); } - void addNameBan(const QString &name, int minutes) { nameBanList.append(QPair(name, minutes)); } void scheduleShutdown(const QString &reason, int minutes); protected: bool userExists(const QString &user); - AuthenticationResult checkUserPassword(const QString &user, const QString &password); + AuthenticationResult checkUserPassword(Server_ProtocolHandler *handler, const QString &user, const QString &password); private: QTimer *pingClock, *statusUpdateClock, *banTimeoutClock; QTcpServer *tcpServer; @@ -90,7 +88,6 @@ private: int serverId; int uptime; QList > addressBanList; - QList > nameBanList; int maxGameInactivityTime, maxPlayerInactivityTime; int maxUsersPerAddress, messageCountingInterval, maxMessageCountPerInterval, maxMessageSizePerInterval, maxGamesPerUser; ServerInfo_User *evalUserQueryResult(const QSqlQuery &query, bool complete); diff --git a/servatrice/src/serversocketinterface.cpp b/servatrice/src/serversocketinterface.cpp index 769e6588..895fcee2 100644 --- a/servatrice/src/serversocketinterface.cpp +++ b/servatrice/src/serversocketinterface.cpp @@ -488,14 +488,14 @@ ResponseCode ServerSocketInterface::cmdBanFromServer(Command_BanFromServer *cmd, ServerSocketInterface *user = static_cast(server->getUsers().value(userName)); if (user->getUserInfo()->getUserLevel() & ServerInfo_User::IsRegistered) { // Registered users can be banned by name. - if (minutes == 0) { - QMutexLocker locker(&servatrice->dbMutex); - QSqlQuery query; - query.prepare("update " + servatrice->getDbPrefix() + "_users set banned=1 where name = :name"); - query.bindValue(":name", userName); - servatrice->execSqlQuery(query); - } else - servatrice->addNameBan(userName, minutes); + QMutexLocker locker(&servatrice->dbMutex); + QSqlQuery query; + query.prepare("insert into " + servatrice->getDbPrefix() + "_bans (id_user, id_admin, time_from, minutes, reason) values(:id_user, :id_admin, NOW(), :minutes, :reason)"); + query.bindValue(":id_user", getUserIdInDB(userName)); + query.bindValue(":id_admin", getUserIdInDB(userInfo->getName())); + query.bindValue(":minutes", minutes); + query.bindValue(":reason", cmd->getReason()); + servatrice->execSqlQuery(query); } else { // Unregistered users must be banned by IP address. // Indefinite address bans are not reasonable -> default to 30 minutes.