Merge remote-tracking branch 'origin/master' into show-password-games-by-default
This commit is contained in:
commit
86b92a25de
21 changed files with 216 additions and 165 deletions
|
@ -16,7 +16,7 @@ InstallDir "$PROGRAMFILES\Cockatrice"
|
|||
!define MUI_HEADERIMAGE_UNBITMAP "${NSIS_SOURCE_PATH}\cmake\headerimage.bmp"
|
||||
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Cockatrice.$\r$\n$\r$\nClick Next to continue."
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR/oracle.exe"
|
||||
!define MUI_FINISHPAGE_RUN_TEXT "Run "Oracle" now to update your card database"
|
||||
!define MUI_FINISHPAGE_RUN_TEXT "Run 'Oracle' now to update your card database"
|
||||
!define MUI_FINISHPAGE_RUN_PARAMETERS "-dlsets"
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
|
|
|
@ -31,12 +31,14 @@
|
|||
<file>resources/icon_view.svg</file>
|
||||
<file>resources/hr.jpg</file>
|
||||
<file alias="resources/appicon.svg">resources/cockatrice.svg</file>
|
||||
|
||||
<file>resources/add_to_sideboard.svg</file>
|
||||
<file>resources/decrement.svg</file>
|
||||
<file>resources/increment.svg</file>
|
||||
<file>resources/remove_row.svg</file>
|
||||
<file>resources/arrow_left_green.svg</file>
|
||||
<file>resources/arrow_right_green.svg</file>
|
||||
|
||||
<file>resources/icon_ready_start.svg</file>
|
||||
<file>resources/icon_not_ready_start.svg</file>
|
||||
<file>resources/icon_conceded.svg</file>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
@ -13,9 +14,9 @@
|
|||
height="64"
|
||||
id="svg2646"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.46"
|
||||
inkscape:version="0.48.5 r10040"
|
||||
version="1.0"
|
||||
sodipodi:docname="decrement.svg"
|
||||
sodipodi:docname="deck_editor_decrement.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape">
|
||||
<defs
|
||||
id="defs2648">
|
||||
|
@ -161,15 +162,16 @@
|
|||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.625"
|
||||
inkscape:cx="-58.636066"
|
||||
inkscape:cy="34.091284"
|
||||
inkscape:cx="26.34754"
|
||||
inkscape:cy="29.107677"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer2"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1272"
|
||||
inkscape:window-height="723"
|
||||
inkscape:window-width="1445"
|
||||
inkscape:window-height="893"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="25" />
|
||||
inkscape:window-y="25"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata2651">
|
||||
<rdf:RDF>
|
||||
|
@ -192,7 +194,7 @@
|
|||
inkscape:label="Pfeil"
|
||||
style="display:inline">
|
||||
<rect
|
||||
style="fill:#96ff96;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
|
||||
style="fill:#ff7672;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
|
||||
id="rect3548"
|
||||
width="14.386732"
|
||||
height="59.259636"
|
||||
|
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.2 KiB |
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
@ -13,9 +14,9 @@
|
|||
height="64"
|
||||
id="svg2646"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.46"
|
||||
inkscape:version="0.48.5 r10040"
|
||||
version="1.0"
|
||||
sodipodi:docname="remove_row.svg"
|
||||
sodipodi:docname="deck_editor_remove_row.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape">
|
||||
<defs
|
||||
id="defs2648">
|
||||
|
@ -316,15 +317,16 @@
|
|||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.625"
|
||||
inkscape:cx="-50.74814"
|
||||
inkscape:cy="31.784541"
|
||||
inkscape:cx="-27.27273"
|
||||
inkscape:cy="30.210771"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer2"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1272"
|
||||
inkscape:window-height="723"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="25" />
|
||||
inkscape:window-y="25"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata2651">
|
||||
<rdf:RDF>
|
||||
|
@ -347,7 +349,7 @@
|
|||
inkscape:label="Pfeil"
|
||||
style="display:inline">
|
||||
<path
|
||||
style="fill:#96ff96;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
|
||||
style="fill:#ff7672;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
|
||||
d="M 6.433227,14.50946 L 23.923767,32 L 6.433227,49.490541 L 14.50946,57.566773 L 32,40.076233 L 49.490541,57.566773 L 57.566773,49.490541 L 40.076233,32 L 57.566773,14.50946 L 49.490541,6.433227 L 32,23.923767 L 14.50946,6.433227 L 6.433227,14.50946 z"
|
||||
id="rect3548" />
|
||||
</g>
|
||||
|
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
@ -32,7 +32,7 @@ void DeckStatsInterface::queryFinished(QNetworkReply *reply)
|
|||
QString data(reply->readAll());
|
||||
reply->deleteLater();
|
||||
|
||||
QRegExp rx("id=\"deckstats_deck_url\" value=\"([^\"]+)\"");
|
||||
QRegExp rx("<meta property=\"og:url\" content=\"([^\"]+)\"/>");
|
||||
if (!rx.indexIn(data)) {
|
||||
QMessageBox::critical(0, tr("Error"), tr("The reply from the server could not be parsed."));
|
||||
deleteLater();
|
||||
|
@ -53,11 +53,13 @@ void DeckStatsInterface::getAnalyzeRequestData(DeckList *deck, QByteArray *data)
|
|||
#if QT_VERSION < 0x050000
|
||||
QUrl params;
|
||||
params.addQueryItem("deck", deckWithoutTokens.writeToString_Plain());
|
||||
params.addQueryItem("decktitle", deck->getName());
|
||||
data->append(params.encodedQuery());
|
||||
#else
|
||||
QUrl params;
|
||||
QUrlQuery urlQuery;
|
||||
urlQuery.addQueryItem("deck", deckWithoutTokens.writeToString_Plain());
|
||||
urlQuery.addQueryItem("decktitle", deck->getName());
|
||||
params.setQuery(urlQuery);
|
||||
data->append(params.query(QUrl::EncodeReserved));
|
||||
#endif
|
||||
|
|
|
@ -160,7 +160,7 @@ DlgCreateGame::DlgCreateGame(const ServerInfo_Game &gameInfo, const QMap<int, QS
|
|||
void DlgCreateGame::actOK()
|
||||
{
|
||||
Command_CreateGame cmd;
|
||||
cmd.set_description(descriptionEdit->text().toStdString());
|
||||
cmd.set_description(descriptionEdit->text().simplified().toStdString());
|
||||
cmd.set_password(passwordEdit->text().toStdString());
|
||||
cmd.set_max_players(maxPlayersEdit->value());
|
||||
cmd.set_only_buddies(onlyBuddiesCheckBox->isChecked());
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "pb/serverinfo_game.pb.h"
|
||||
#include "pb/response.pb.h"
|
||||
|
||||
GameSelector::GameSelector(AbstractClient *_client, const TabSupervisor *_tabSupervisor, TabRoom *_room, const QMap<int, QString> &_rooms, const QMap<int, GameTypeMap> &_gameTypes, QWidget *parent)
|
||||
GameSelector::GameSelector(AbstractClient *_client, const TabSupervisor *_tabSupervisor, TabRoom *_room, const QMap<int, QString> &_rooms, const QMap<int, GameTypeMap> &_gameTypes, const bool restoresettings, QWidget *parent)
|
||||
: QGroupBox(parent), client(_client), tabSupervisor(_tabSupervisor), room(_room)
|
||||
{
|
||||
gameListView = new QTreeView;
|
||||
|
@ -36,7 +36,8 @@ GameSelector::GameSelector(AbstractClient *_client, const TabSupervisor *_tabSup
|
|||
if (room)
|
||||
gameTypeMap = gameListModel->getGameTypes().value(room->getRoomId());
|
||||
|
||||
gameListProxyModel->loadFilterParameters(gameTypeMap);
|
||||
if (restoresettings)
|
||||
gameListProxyModel->loadFilterParameters(gameTypeMap);
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
gameListView->header()->setResizeMode(0, QHeaderView::ResizeToContents);
|
||||
|
|
|
@ -36,7 +36,7 @@ private:
|
|||
QPushButton *filterButton, *clearFilterButton, *createButton, *joinButton, *spectateButton;
|
||||
GameTypeMap gameTypeMap;
|
||||
public:
|
||||
GameSelector(AbstractClient *_client, const TabSupervisor *_tabSupervisor, TabRoom *_room, const QMap<int, QString> &_rooms, const QMap<int, GameTypeMap> &_gameTypes, QWidget *parent = 0);
|
||||
GameSelector(AbstractClient *_client, const TabSupervisor *_tabSupervisor, TabRoom *_room, const QMap<int, QString> &_rooms, const QMap<int, GameTypeMap> &_gameTypes, const bool restoresettings, QWidget *parent = 0);
|
||||
void retranslateUi();
|
||||
void processGameInfo(const ServerInfo_Game &info);
|
||||
};
|
||||
|
|
|
@ -298,7 +298,6 @@ void GamesProxyModel::loadFilterParameters(const QMap<int, QString> &allGameType
|
|||
unavailableGamesVisible = settings.value("unavailable_games_visible", false).toBool();
|
||||
passwordProtectedGamesHidden = settings.value("password_protected_games_hidden", false).toBool();
|
||||
gameNameFilter = settings.value("game_name_filter", "").toString();
|
||||
creatorNameFilter = settings.value("creator_name_filter", "").toString();
|
||||
maxPlayersFilterMin = settings.value("min_players", 1).toInt();
|
||||
maxPlayersFilterMax = settings.value("max_players", DEFAULT_MAX_PLAYERS_MAX).toInt();
|
||||
|
||||
|
@ -324,7 +323,6 @@ void GamesProxyModel::saveFilterParameters(const QMap<int, QString> &allGameType
|
|||
passwordProtectedGamesHidden
|
||||
);
|
||||
settings.setValue("game_name_filter", gameNameFilter);
|
||||
settings.setValue("creator_name_filter", creatorNameFilter);
|
||||
|
||||
QMapIterator<int, QString> gameTypeIterator(allGameTypes);
|
||||
while (gameTypeIterator.hasNext()) {
|
||||
|
|
|
@ -46,7 +46,7 @@ SettingsCache::SettingsCache()
|
|||
tapAnimation = settings->value("cards/tapanimation", true).toBool();
|
||||
chatMention = settings->value("chat/mention", true).toBool();
|
||||
chatMentionForeground = settings->value("chat/mentionforeground", true).toBool();
|
||||
chatMentionColor = settings->value("chat/mentioncolor", "C21F2F").toString();
|
||||
chatMentionColor = settings->value("chat/mentioncolor", "A6120D").toString();
|
||||
|
||||
zoneViewSortByName = settings->value("zoneview/sortbyname", true).toBool();
|
||||
zoneViewSortByType = settings->value("zoneview/sortbytype", true).toBool();
|
||||
|
|
|
@ -276,8 +276,8 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
|
|||
deckEditToolBar->addAction(aAddCard);
|
||||
deckEditToolBar->addAction(aAddCardToSideboard);
|
||||
deckEditToolBar->addAction(aRemoveCard);
|
||||
deckEditToolBar->addAction(aIncrement);
|
||||
deckEditToolBar->addAction(aDecrement);
|
||||
deckEditToolBar->addAction(aIncrement);
|
||||
deckEditToolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
|
||||
retranslateUi();
|
||||
|
|
|
@ -885,6 +885,7 @@ void TabGame::startGame(bool resuming)
|
|||
gameInfo.set_started(true);
|
||||
static_cast<GameScene *>(gameView->scene())->rearrange();
|
||||
gameView->show();
|
||||
sayEdit->setFocus();
|
||||
}
|
||||
|
||||
void TabGame::stopGame()
|
||||
|
|
|
@ -18,6 +18,7 @@ TabMessage::TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, c
|
|||
chatView = new ChatView(tabSupervisor, 0, true);
|
||||
connect(chatView, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString)));
|
||||
connect(chatView, SIGNAL(deleteCardInfoPopup(QString)), this, SLOT(deleteCardInfoPopup(QString)));
|
||||
connect(chatView, SIGNAL(addMentionTag(QString)), this, SLOT(addMentionTag(QString)));
|
||||
sayEdit = new QLineEdit;
|
||||
connect(sayEdit, SIGNAL(returnPressed()), this, SLOT(sendMessage()));
|
||||
|
||||
|
@ -43,6 +44,11 @@ TabMessage::~TabMessage()
|
|||
delete otherUserInfo;
|
||||
}
|
||||
|
||||
void TabMessage::addMentionTag(QString mentionTag) {
|
||||
sayEdit->insert(mentionTag + " ");
|
||||
sayEdit->setFocus();
|
||||
}
|
||||
|
||||
void TabMessage::retranslateUi()
|
||||
{
|
||||
messageMenu->setTitle(tr("Personal &talk"));
|
||||
|
|
|
@ -29,6 +29,7 @@ private slots:
|
|||
void sendMessage();
|
||||
void actLeave();
|
||||
void messageSent(const Response &response);
|
||||
void addMentionTag(QString mentionTag);
|
||||
public:
|
||||
TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User &_ownUserInfo, const ServerInfo_User &_otherUserInfo);
|
||||
~TabMessage();
|
||||
|
|
|
@ -37,7 +37,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerI
|
|||
|
||||
QMap<int, GameTypeMap> tempMap;
|
||||
tempMap.insert(info.room_id(), gameTypes);
|
||||
gameSelector = new GameSelector(client, tabSupervisor, this, QMap<int, QString>(), tempMap);
|
||||
gameSelector = new GameSelector(client, tabSupervisor, this, QMap<int, QString>(), tempMap, true);
|
||||
userList = new UserList(tabSupervisor, client, UserList::RoomList);
|
||||
connect(userList, SIGNAL(openMessageDialog(const QString &, bool)), this, SIGNAL(openMessageDialog(const QString &, bool)));
|
||||
|
||||
|
|
|
@ -371,7 +371,16 @@ TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus
|
|||
otherUser = twi->getUserInfo();
|
||||
else
|
||||
otherUser.set_name(receiverName.toStdString());
|
||||
TabMessage *tab = new TabMessage(this, client, *userInfo, otherUser);
|
||||
|
||||
TabMessage *tab;
|
||||
tab = messageTabs.value(QString::fromStdString(otherUser.name()));
|
||||
if (tab) {
|
||||
if (focus)
|
||||
setCurrentWidget(tab);
|
||||
return tab;
|
||||
}
|
||||
|
||||
tab = new TabMessage(this, client, *userInfo, otherUser);
|
||||
connect(tab, SIGNAL(talkClosing(TabMessage *)), this, SLOT(talkLeft(TabMessage *)));
|
||||
int tabIndex = myAddTab(tab);
|
||||
addCloseButtonToTab(tab, tabIndex);
|
||||
|
|
|
@ -68,7 +68,7 @@ void UserContextMenu::gamesOfUserReceived(const Response &resp, const CommandCon
|
|||
gameTypeMap.insert(roomInfo.room_id(), tempMap);
|
||||
}
|
||||
|
||||
GameSelector *selector = new GameSelector(client, tabSupervisor, 0, roomMap, gameTypeMap);
|
||||
GameSelector *selector = new GameSelector(client, tabSupervisor, 0, roomMap, gameTypeMap, false);
|
||||
const int gameListSize = response.game_list_size();
|
||||
for (int i = 0; i < gameListSize; ++i)
|
||||
selector->processGameInfo(response.game_list(i));
|
||||
|
|
|
@ -67,8 +67,18 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user)
|
|||
realNameLabel2.setText(QString::fromStdString(user.real_name()));
|
||||
genderLabel2.setPixmap(GenderPixmapGenerator::generatePixmap(15, user.gender()));
|
||||
QString country = QString::fromStdString(user.country());
|
||||
countryLabel2.setPixmap(CountryPixmapGenerator::generatePixmap(15, country));
|
||||
countryLabel3.setText(QString("(%1)").arg(country.toUpper()));
|
||||
|
||||
if (country.length() != 0)
|
||||
{
|
||||
countryLabel2.setPixmap(CountryPixmapGenerator::generatePixmap(15, country));
|
||||
countryLabel3.setText(QString("(%1)").arg(country.toUpper()));
|
||||
}
|
||||
else
|
||||
{
|
||||
countryLabel2.setText("");
|
||||
countryLabel3.setText("");
|
||||
}
|
||||
|
||||
userLevelLabel2.setPixmap(UserLevelPixmapGenerator::generatePixmap(15, userLevel, false));
|
||||
QString userLevelText;
|
||||
if (userLevel.testFlag(ServerInfo_User::IsAdmin))
|
||||
|
|
|
@ -56,7 +56,6 @@ Server_Game::Server_Game(const ServerInfo_User &_creatorInfo, int _gameId, const
|
|||
gameStarted(false),
|
||||
gameClosed(false),
|
||||
gameId(_gameId),
|
||||
description(_description),
|
||||
password(_password),
|
||||
maxPlayers(_maxPlayers),
|
||||
gameTypes(_gameTypes),
|
||||
|
@ -77,6 +76,7 @@ Server_Game::Server_Game(const ServerInfo_User &_creatorInfo, int _gameId, const
|
|||
{
|
||||
currentReplay = new GameReplay;
|
||||
currentReplay->set_replay_id(room->getServer()->getDatabaseInterface()->getNextReplayId());
|
||||
description = _description.simplified();
|
||||
|
||||
connect(this, SIGNAL(sigStartGameIfReady()), this, SLOT(doStartGameIfReady()), Qt::QueuedConnection);
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "settingscache.h"
|
||||
#include <QSocketNotifier>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <QTextStream>
|
||||
#include <QDateTime>
|
||||
#include <iostream>
|
||||
|
@ -26,8 +28,23 @@ ServerLogger::~ServerLogger()
|
|||
void ServerLogger::startLog(const QString &logFileName)
|
||||
{
|
||||
if (!logFileName.isEmpty()) {
|
||||
QFileInfo fi(logFileName);
|
||||
QDir fileDir(fi.path());
|
||||
if (!fileDir.exists() && !fileDir.mkpath(fileDir.absolutePath())) {
|
||||
std::cerr << "ERROR: logfile folder doesn't exist and i can't create it." << std::endl;
|
||||
logFile = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
logFile = new QFile(logFileName, this);
|
||||
logFile->open(QIODevice::Append);
|
||||
if(!logFile->open(QIODevice::Append)) {
|
||||
std::cerr << "ERROR: can't open() logfile." << std::endl;
|
||||
delete logFile;
|
||||
logFile = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
::socketpair(AF_UNIX, SOCK_STREAM, 0, sigHupFD);
|
||||
|
||||
|
|
|
@ -9,4 +9,4 @@ if [[ $TRAVIS_OS_NAME == "osx" && $QT4 == 0 ]]; then
|
|||
prefix="-DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.4.0/"
|
||||
fi
|
||||
cmake .. -DWITH_SERVER=1 -DWITH_QT4=$QT4 $prefix
|
||||
make
|
||||
make -j2
|
||||
|
|
Loading…
Reference in a new issue