chat improvements
This commit is contained in:
parent
b113b78e7c
commit
74ae1c41fc
3 changed files with 83 additions and 82 deletions
|
@ -6,6 +6,7 @@ ChannelWidget::ChannelWidget(Client *_client, const QString &_name, bool readOnl
|
|||
: QWidget(parent), client(_client), name(_name), virtualChannel(_virtualChannel)
|
||||
{
|
||||
playerList = new QListWidget;
|
||||
playerList->setFixedWidth(100);
|
||||
|
||||
textEdit = new QTextEdit;
|
||||
textEdit->setReadOnly(true);
|
||||
|
@ -22,7 +23,6 @@ ChannelWidget::ChannelWidget(Client *_client, const QString &_name, bool readOnl
|
|||
QHBoxLayout *hbox = new QHBoxLayout;
|
||||
hbox->addLayout(vbox);
|
||||
hbox->addWidget(playerList);
|
||||
playerList->setFixedWidth(100);
|
||||
|
||||
setLayout(hbox);
|
||||
}
|
||||
|
@ -76,6 +76,8 @@ ChatWidget::ChatWidget(Client *_client, QWidget *parent)
|
|||
: QWidget(parent), client(_client)
|
||||
{
|
||||
channelList = new QTreeWidget;
|
||||
channelList->setRootIsDecorated(false);
|
||||
channelList->setFixedWidth(200);
|
||||
|
||||
joinButton = new QPushButton;
|
||||
connect(joinButton, SIGNAL(clicked()), this, SLOT(joinClicked()));
|
||||
|
@ -103,8 +105,8 @@ void ChatWidget::retranslateUi()
|
|||
QTreeWidgetItem *header = channelList->headerItem();
|
||||
Q_ASSERT(header != 0);
|
||||
header->setText(0, tr("Channel"));
|
||||
header->setText(1, tr("Description"));
|
||||
header->setText(2, tr("Players"));
|
||||
header->setText(1, tr("Players"));
|
||||
header->setTextAlignment(1, Qt::AlignRight);
|
||||
}
|
||||
|
||||
void ChatWidget::enableChat()
|
||||
|
@ -136,12 +138,17 @@ void ChatWidget::chatEvent(const ChatEventData &data)
|
|||
for (int i = 0; i < channelList->topLevelItemCount(); ++i) {
|
||||
QTreeWidgetItem *twi = channelList->topLevelItem(i);
|
||||
if (twi->text(0) == msg[0]) {
|
||||
twi->setText(1, msg[1]);
|
||||
twi->setText(2, msg[2]);
|
||||
twi->setToolTip(0, msg[1]);
|
||||
twi->setText(1, msg[2]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
channelList->addTopLevelItem(new QTreeWidgetItem(QStringList() << msg[0] << msg[1] << msg[2]));
|
||||
QTreeWidgetItem *twi = new QTreeWidgetItem(QStringList() << msg[0] << msg[2]);
|
||||
twi->setTextAlignment(1, Qt::AlignRight);
|
||||
twi->setToolTip(0, msg[1]);
|
||||
channelList->addTopLevelItem(twi);
|
||||
channelList->resizeColumnToContents(0);
|
||||
channelList->resizeColumnToContents(1);
|
||||
if (msg[3] == "1")
|
||||
joinChannel(msg[0]);
|
||||
break;
|
||||
|
|
|
@ -55,22 +55,22 @@
|
|||
<context>
|
||||
<name>CardInfoWidget</name>
|
||||
<message>
|
||||
<location filename="../src/cardinfowidget.cpp" line="93"/>
|
||||
<location filename="../src/cardinfowidget.cpp" line="94"/>
|
||||
<source>Name:</source>
|
||||
<translation>Name:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/cardinfowidget.cpp" line="94"/>
|
||||
<location filename="../src/cardinfowidget.cpp" line="95"/>
|
||||
<source>Mana cost:</source>
|
||||
<translation>Manakosten:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/cardinfowidget.cpp" line="95"/>
|
||||
<location filename="../src/cardinfowidget.cpp" line="96"/>
|
||||
<source>Card type:</source>
|
||||
<translation>Kartentyp:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/cardinfowidget.cpp" line="96"/>
|
||||
<location filename="../src/cardinfowidget.cpp" line="97"/>
|
||||
<source>P / T:</source>
|
||||
<translation>S/W:</translation>
|
||||
</message>
|
||||
|
@ -86,12 +86,12 @@
|
|||
<context>
|
||||
<name>ChannelWidget</name>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="36"/>
|
||||
<location filename="../src/chatwidget.cpp" line="46"/>
|
||||
<source>%1 has joined the channel.</source>
|
||||
<translation>%1hat den Raum betreten.</translation>
|
||||
<translation>%1 hat den Raum betreten.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="47"/>
|
||||
<location filename="../src/chatwidget.cpp" line="57"/>
|
||||
<source>%1 has left the channel.</source>
|
||||
<translation>%1 hat den Raum verlassen.</translation>
|
||||
</message>
|
||||
|
@ -99,22 +99,21 @@
|
|||
<context>
|
||||
<name>ChatWidget</name>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="86"/>
|
||||
<location filename="../src/chatwidget.cpp" line="103"/>
|
||||
<source>Joi&n</source>
|
||||
<translation>Teil&nehmen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="90"/>
|
||||
<location filename="../src/chatwidget.cpp" line="107"/>
|
||||
<source>Channel</source>
|
||||
<translation>Raum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="91"/>
|
||||
<source>Description</source>
|
||||
<translation>Beschreibung</translation>
|
||||
<translation type="obsolete">Beschreibung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="92"/>
|
||||
<location filename="../src/chatwidget.cpp" line="108"/>
|
||||
<source>Players</source>
|
||||
<translation>Spielerzahl</translation>
|
||||
</message>
|
||||
|
@ -572,32 +571,32 @@
|
|||
<context>
|
||||
<name>GameSelector</name>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="101"/>
|
||||
<location filename="../src/gameselector.cpp" line="94"/>
|
||||
<source>C&reate</source>
|
||||
<translation>Spiel e&rstellen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="102"/>
|
||||
<location filename="../src/gameselector.cpp" line="95"/>
|
||||
<source>&Join</source>
|
||||
<translation>&Teilnehmen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="59"/>
|
||||
<location filename="../src/gameselector.cpp" line="53"/>
|
||||
<source>Error</source>
|
||||
<translation>Fehler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="59"/>
|
||||
<location filename="../src/gameselector.cpp" line="53"/>
|
||||
<source>XXX</source>
|
||||
<translation>XXX</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="73"/>
|
||||
<location filename="../src/gameselector.cpp" line="67"/>
|
||||
<source>Join game</source>
|
||||
<translation>Spiel beitreten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="73"/>
|
||||
<location filename="../src/gameselector.cpp" line="67"/>
|
||||
<source>Password:</source>
|
||||
<translation>Passwort:</translation>
|
||||
</message>
|
||||
|
@ -695,97 +694,97 @@
|
|||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="191"/>
|
||||
<location filename="../src/window_main.cpp" line="193"/>
|
||||
<source>Error</source>
|
||||
<translation>Fehler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="191"/>
|
||||
<location filename="../src/window_main.cpp" line="193"/>
|
||||
<source>Server timeout</source>
|
||||
<translation>Server Zeitüberschreitung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="198"/>
|
||||
<location filename="../src/window_main.cpp" line="200"/>
|
||||
<source>&Connect...</source>
|
||||
<translation>&Verbinden...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="199"/>
|
||||
<location filename="../src/window_main.cpp" line="201"/>
|
||||
<source>&Disconnect</source>
|
||||
<translation>Verbindung &trennen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="200"/>
|
||||
<location filename="../src/window_main.cpp" line="202"/>
|
||||
<source>&Restart game...</source>
|
||||
<translation>Spiel neu sta&rten...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="201"/>
|
||||
<location filename="../src/window_main.cpp" line="203"/>
|
||||
<source>F2</source>
|
||||
<translation>F2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="202"/>
|
||||
<location filename="../src/window_main.cpp" line="204"/>
|
||||
<source>&Leave game</source>
|
||||
<translation>Spiel ver&lassen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="203"/>
|
||||
<location filename="../src/window_main.cpp" line="205"/>
|
||||
<source>&Deck editor</source>
|
||||
<translation>&Deck-Editor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="204"/>
|
||||
<location filename="../src/window_main.cpp" line="206"/>
|
||||
<source>&Full screen</source>
|
||||
<translation>&Vollbild</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="205"/>
|
||||
<location filename="../src/window_main.cpp" line="207"/>
|
||||
<source>Ctrl+F</source>
|
||||
<translation>Ctrl+F</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="206"/>
|
||||
<location filename="../src/window_main.cpp" line="208"/>
|
||||
<source>&Settings...</source>
|
||||
<translation>&Einstellungen...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="207"/>
|
||||
<location filename="../src/window_main.cpp" line="209"/>
|
||||
<source>&Exit</source>
|
||||
<translation>&Beenden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="208"/>
|
||||
<location filename="../src/window_main.cpp" line="210"/>
|
||||
<source>Close most recent zone view</source>
|
||||
<translation>Letzte Zonenansicht schließen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="209"/>
|
||||
<location filename="../src/window_main.cpp" line="211"/>
|
||||
<source>Esc</source>
|
||||
<translation>Esc</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="211"/>
|
||||
<location filename="../src/window_main.cpp" line="213"/>
|
||||
<source>&Game</source>
|
||||
<translation>Spi&el</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="212"/>
|
||||
<location filename="../src/window_main.cpp" line="214"/>
|
||||
<source>&Actions</source>
|
||||
<translation>&Aktionen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="213"/>
|
||||
<location filename="../src/window_main.cpp" line="215"/>
|
||||
<source>&Card</source>
|
||||
<translation>&Karte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="215"/>
|
||||
<location filename="../src/window_main.cpp" line="217"/>
|
||||
<source>&Say:</source>
|
||||
<translation>&Sagen:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="196"/>
|
||||
<location filename="../src/window_main.cpp" line="198"/>
|
||||
<source>Cockatrice</source>
|
||||
<translation>Cockatrice</translation>
|
||||
</message>
|
||||
|
|
|
@ -32,22 +32,22 @@
|
|||
<context>
|
||||
<name>CardInfoWidget</name>
|
||||
<message>
|
||||
<location filename="../src/cardinfowidget.cpp" line="93"/>
|
||||
<location filename="../src/cardinfowidget.cpp" line="94"/>
|
||||
<source>Name:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/cardinfowidget.cpp" line="94"/>
|
||||
<location filename="../src/cardinfowidget.cpp" line="95"/>
|
||||
<source>Mana cost:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/cardinfowidget.cpp" line="95"/>
|
||||
<location filename="../src/cardinfowidget.cpp" line="96"/>
|
||||
<source>Card type:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/cardinfowidget.cpp" line="96"/>
|
||||
<location filename="../src/cardinfowidget.cpp" line="97"/>
|
||||
<source>P / T:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -55,12 +55,12 @@
|
|||
<context>
|
||||
<name>ChannelWidget</name>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="36"/>
|
||||
<location filename="../src/chatwidget.cpp" line="46"/>
|
||||
<source>%1 has joined the channel.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="47"/>
|
||||
<location filename="../src/chatwidget.cpp" line="57"/>
|
||||
<source>%1 has left the channel.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -68,22 +68,17 @@
|
|||
<context>
|
||||
<name>ChatWidget</name>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="86"/>
|
||||
<location filename="../src/chatwidget.cpp" line="103"/>
|
||||
<source>Joi&n</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="90"/>
|
||||
<location filename="../src/chatwidget.cpp" line="107"/>
|
||||
<source>Channel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="91"/>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/chatwidget.cpp" line="92"/>
|
||||
<location filename="../src/chatwidget.cpp" line="108"/>
|
||||
<source>Players</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -478,32 +473,32 @@
|
|||
<context>
|
||||
<name>GameSelector</name>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="101"/>
|
||||
<location filename="../src/gameselector.cpp" line="94"/>
|
||||
<source>C&reate</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="102"/>
|
||||
<location filename="../src/gameselector.cpp" line="95"/>
|
||||
<source>&Join</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="59"/>
|
||||
<location filename="../src/gameselector.cpp" line="53"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="59"/>
|
||||
<location filename="../src/gameselector.cpp" line="53"/>
|
||||
<source>XXX</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="73"/>
|
||||
<location filename="../src/gameselector.cpp" line="67"/>
|
||||
<source>Join game</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gameselector.cpp" line="73"/>
|
||||
<location filename="../src/gameselector.cpp" line="67"/>
|
||||
<source>Password:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -601,97 +596,97 @@
|
|||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="191"/>
|
||||
<location filename="../src/window_main.cpp" line="193"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="191"/>
|
||||
<location filename="../src/window_main.cpp" line="193"/>
|
||||
<source>Server timeout</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="198"/>
|
||||
<location filename="../src/window_main.cpp" line="200"/>
|
||||
<source>&Connect...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="199"/>
|
||||
<location filename="../src/window_main.cpp" line="201"/>
|
||||
<source>&Disconnect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="200"/>
|
||||
<location filename="../src/window_main.cpp" line="202"/>
|
||||
<source>&Restart game...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="201"/>
|
||||
<location filename="../src/window_main.cpp" line="203"/>
|
||||
<source>F2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="202"/>
|
||||
<location filename="../src/window_main.cpp" line="204"/>
|
||||
<source>&Leave game</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="203"/>
|
||||
<location filename="../src/window_main.cpp" line="205"/>
|
||||
<source>&Deck editor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="204"/>
|
||||
<location filename="../src/window_main.cpp" line="206"/>
|
||||
<source>&Full screen</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="205"/>
|
||||
<location filename="../src/window_main.cpp" line="207"/>
|
||||
<source>Ctrl+F</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="206"/>
|
||||
<location filename="../src/window_main.cpp" line="208"/>
|
||||
<source>&Settings...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="207"/>
|
||||
<location filename="../src/window_main.cpp" line="209"/>
|
||||
<source>&Exit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="208"/>
|
||||
<location filename="../src/window_main.cpp" line="210"/>
|
||||
<source>Close most recent zone view</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="209"/>
|
||||
<location filename="../src/window_main.cpp" line="211"/>
|
||||
<source>Esc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="211"/>
|
||||
<location filename="../src/window_main.cpp" line="213"/>
|
||||
<source>&Game</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="212"/>
|
||||
<location filename="../src/window_main.cpp" line="214"/>
|
||||
<source>&Actions</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="213"/>
|
||||
<location filename="../src/window_main.cpp" line="215"/>
|
||||
<source>&Card</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="215"/>
|
||||
<location filename="../src/window_main.cpp" line="217"/>
|
||||
<source>&Say:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/window_main.cpp" line="196"/>
|
||||
<location filename="../src/window_main.cpp" line="198"/>
|
||||
<source>Cockatrice</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
Loading…
Reference in a new issue