Clang script (#3085)

This commit is contained in:
Zach H 2018-02-06 08:45:13 -05:00 committed by GitHub
parent fcfb2b12b7
commit 35159ef61a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 2098 additions and 2054 deletions

18
clangify.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
# This script will run clang-format on all non-3rd-party C++/Header files.
set -e
if hash clang-format 2>/dev/null; then
find . \( -name "*.cpp" -o -name "*.h" \) \
-not -path "./cockatrice/src/qt-json/*" \
-not -path "./servatrice/src/smtp/*" \
-not -path "./common/sfmt/*" \
-not -path "./oracle/src/zip/*" \
-not -path "./build*/*" \
-exec clang-format -style=file -i {} \;
echo "Repository properly formatted"
else
echo "Please install clang-format to use this program"
fi

View file

@ -1,23 +1,28 @@
#include <QTextEdit>
#include <QDateTime>
#include <QScrollBar>
#include <QMouseEvent>
#include <QDesktopServices>
#include <QApplication>
#include "chatview.h" #include "chatview.h"
#include "user_level.h"
#include "../user_context_menu.h"
#include "../pixmapgenerator.h" #include "../pixmapgenerator.h"
#include "../settingscache.h" #include "../settingscache.h"
#include "../tab_userlists.h"
#include "../soundengine.h" #include "../soundengine.h"
#include "../tab_userlists.h"
#include "../user_context_menu.h"
#include "user_level.h"
#include <QApplication>
#include <QDateTime>
#include <QDesktopServices>
#include <QMouseEvent>
#include <QScrollBar>
#include <QTextEdit>
const QColor DEFAULT_MENTION_COLOR = QColor(194, 31, 47); const QColor DEFAULT_MENTION_COLOR = QColor(194, 31, 47);
const QColor OTHER_USER_COLOR = QColor(0, 65, 255); // dark blue const QColor OTHER_USER_COLOR = QColor(0, 65, 255); // dark blue
const QString SERVER_MESSAGE_COLOR = "#851515"; const QString SERVER_MESSAGE_COLOR = "#851515";
ChatView::ChatView(const TabSupervisor *_tabSupervisor, const UserlistProxy *_userlistProxy, TabGame *_game, bool _showTimestamps, QWidget *parent) ChatView::ChatView(const TabSupervisor *_tabSupervisor,
: QTextBrowser(parent), tabSupervisor(_tabSupervisor), game(_game), userlistProxy(_userlistProxy), evenNumber(true), showTimestamps(_showTimestamps), hoveredItemType(HoveredNothing) const UserlistProxy *_userlistProxy,
TabGame *_game,
bool _showTimestamps,
QWidget *parent)
: QTextBrowser(parent), tabSupervisor(_tabSupervisor), game(_game), userlistProxy(_userlistProxy), evenNumber(true),
showTimestamps(_showTimestamps), hoveredItemType(HoveredNothing)
{ {
document()->setDefaultStyleSheet("a { text-decoration: none; color: blue; }"); document()->setDefaultStyleSheet("a { text-decoration: none; color: blue; }");
userContextMenu = new UserContextMenu(tabSupervisor, this, game); userContextMenu = new UserContextMenu(tabSupervisor, this, game);
@ -75,7 +80,8 @@ void ChatView::appendHtmlServerMessage(const QString &html, bool optionalIsBold,
{ {
bool atBottom = verticalScrollBar()->value() >= verticalScrollBar()->maximum(); bool atBottom = verticalScrollBar()->value() >= verticalScrollBar()->maximum();
QString htmlText = "<font color=" + ((optionalFontColor.size() > 0) ? optionalFontColor : SERVER_MESSAGE_COLOR) + ">" + QDateTime::currentDateTime().toString("[hh:mm:ss] ")+ html + "</font>"; QString htmlText = "<font color=" + ((optionalFontColor.size() > 0) ? optionalFontColor : SERVER_MESSAGE_COLOR) +
">" + QDateTime::currentDateTime().toString("[hh:mm:ss] ") + html + "</font>";
if (optionalIsBold) if (optionalIsBold)
htmlText = "<b>" + htmlText + "</b>"; htmlText = "<b>" + htmlText + "</b>";
@ -117,7 +123,12 @@ void ChatView::appendUrlTag(QTextCursor &cursor, QString url)
cursor.setCharFormat(oldFormat); cursor.setCharFormat(oldFormat);
} }
void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType, QString sender, UserLevelFlags userLevel, QString UserPrivLevel, bool playerBold) void ChatView::appendMessage(QString message,
RoomMessageTypeFlags messageType,
QString sender,
UserLevelFlags userLevel,
QString UserPrivLevel,
bool playerBold)
{ {
bool atBottom = verticalScrollBar()->value() >= verticalScrollBar()->maximum(); bool atBottom = verticalScrollBar()->value() >= verticalScrollBar()->maximum();
bool sameSender = (sender == lastSender) && !lastSender.isEmpty(); bool sameSender = (sender == lastSender) && !lastSender.isEmpty();
@ -153,7 +164,8 @@ void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType,
if (!sender.isEmpty()) { if (!sender.isEmpty()) {
const int pixelSize = QFontInfo(cursor.charFormat().font()).pixelSize(); const int pixelSize = QFontInfo(cursor.charFormat().font()).pixelSize();
bool isBuddy = userlistProxy->isUserBuddy(sender); bool isBuddy = userlistProxy->isUserBuddy(sender);
cursor.insertImage(UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, isBuddy, UserPrivLevel).toImage()); cursor.insertImage(
UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, isBuddy, UserPrivLevel).toImage());
cursor.insertText(" "); cursor.insertText(" ");
} }
cursor.setCharFormat(senderFormat); cursor.setCharFormat(senderFormat);
@ -190,16 +202,14 @@ void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType,
highlightedWords = settingsCache->getHighlightWords().split(' ', QString::SkipEmptyParts); highlightedWords = settingsCache->getHighlightWords().split(' ', QString::SkipEmptyParts);
// parse the message // parse the message
while (message.size()) while (message.size()) {
{
QChar c = message.at(0); QChar c = message.at(0);
switch(c.toLatin1()) switch (c.toLatin1()) {
{
case '[': case '[':
checkTag(cursor, message); checkTag(cursor, message);
break; break;
case '@': case '@':
if(mentionEnabled) { if (mentionEnabled) {
checkMention(cursor, message, sender, userLevel); checkMention(cursor, message, sender, userLevel);
} else { } else {
cursor.insertText(c, defaultFormat); cursor.insertText(c, defaultFormat);
@ -211,7 +221,7 @@ void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType,
message = message.mid(1); message = message.mid(1);
break; break;
default: default:
if(c.isLetterOrNumber()) { if (c.isLetterOrNumber()) {
checkWord(cursor, message); checkWord(cursor, message);
} else { } else {
cursor.insertText(c, defaultFormat); cursor.insertText(c, defaultFormat);
@ -225,11 +235,9 @@ void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType,
verticalScrollBar()->setValue(verticalScrollBar()->maximum()); verticalScrollBar()->setValue(verticalScrollBar()->maximum());
} }
void ChatView::checkTag(QTextCursor &cursor, QString &message) void ChatView::checkTag(QTextCursor &cursor, QString &message)
{ {
if (message.startsWith("[card]")) if (message.startsWith("[card]")) {
{
message = message.mid(6); message = message.mid(6);
int closeTagIndex = message.indexOf("[/card]"); int closeTagIndex = message.indexOf("[/card]");
QString cardName = message.left(closeTagIndex); QString cardName = message.left(closeTagIndex);
@ -242,8 +250,7 @@ void ChatView::checkTag(QTextCursor &cursor, QString &message)
return; return;
} }
if (message.startsWith("[[")) if (message.startsWith("[[")) {
{
message = message.mid(2); message = message.mid(2);
int closeTagIndex = message.indexOf("]]"); int closeTagIndex = message.indexOf("]]");
QString cardName = message.left(closeTagIndex); QString cardName = message.left(closeTagIndex);
@ -256,8 +263,7 @@ void ChatView::checkTag(QTextCursor &cursor, QString &message)
return; return;
} }
if (message.startsWith("[url]")) if (message.startsWith("[url]")) {
{
message = message.mid(5); message = message.mid(5);
int closeTagIndex = message.indexOf("[/url]"); int closeTagIndex = message.indexOf("[/url]");
QString url = message.left(closeTagIndex); QString url = message.left(closeTagIndex);
@ -282,8 +288,7 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, QString &send
QString fullMentionUpToSpaceOrEnd = (firstSpace == -1) ? message.mid(1) : message.mid(1, firstSpace - 1); QString fullMentionUpToSpaceOrEnd = (firstSpace == -1) ? message.mid(1) : message.mid(1, firstSpace - 1);
QString mentionIntact = fullMentionUpToSpaceOrEnd; QString mentionIntact = fullMentionUpToSpaceOrEnd;
while (fullMentionUpToSpaceOrEnd.size()) while (fullMentionUpToSpaceOrEnd.size()) {
{
const ServerInfo_User *onlineUser = userlistProxy->getOnlineUser(fullMentionUpToSpaceOrEnd); const ServerInfo_User *onlineUser = userlistProxy->getOnlineUser(fullMentionUpToSpaceOrEnd);
if (onlineUser) // Is there a user online named this? if (onlineUser) // Is there a user online named this?
{ {
@ -292,13 +297,15 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, QString &send
// You have received a valid mention!! // You have received a valid mention!!
soundEngine->playSound("chat_mention"); soundEngine->playSound("chat_mention");
mentionFormat.setBackground(QBrush(getCustomMentionColor())); mentionFormat.setBackground(QBrush(getCustomMentionColor()));
mentionFormat.setForeground(settingsCache->getChatMentionForeground() ? QBrush(Qt::white) : QBrush(Qt::black)); mentionFormat.setForeground(settingsCache->getChatMentionForeground() ? QBrush(Qt::white)
: QBrush(Qt::black));
cursor.insertText(mention, mentionFormat); cursor.insertText(mention, mentionFormat);
message = message.mid(mention.size()); message = message.mid(mention.size());
showSystemPopup(sender); showSystemPopup(sender);
} else { } else {
QString correctUserName = QString::fromStdString(onlineUser->name()); QString correctUserName = QString::fromStdString(onlineUser->name());
mentionFormatOtherUser.setAnchorHref("user://" + QString::number(onlineUser->user_level()) + "_" + correctUserName); mentionFormatOtherUser.setAnchorHref("user://" + QString::number(onlineUser->user_level()) + "_" +
correctUserName);
cursor.insertText("@" + correctUserName, mentionFormatOtherUser); cursor.insertText("@" + correctUserName, mentionFormatOtherUser);
message = message.mid(correctUserName.size() + 1); message = message.mid(correctUserName.size() + 1);
@ -312,7 +319,8 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, QString &send
// Moderator Sending Global Message // Moderator Sending Global Message
soundEngine->playSound("all_mention"); soundEngine->playSound("all_mention");
mentionFormat.setBackground(QBrush(getCustomMentionColor())); mentionFormat.setBackground(QBrush(getCustomMentionColor()));
mentionFormat.setForeground(settingsCache->getChatMentionForeground() ? QBrush(Qt::white) : QBrush(Qt::black)); mentionFormat.setForeground(settingsCache->getChatMentionForeground() ? QBrush(Qt::white)
: QBrush(Qt::black));
cursor.insertText("@" + fullMentionUpToSpaceOrEnd, mentionFormat); cursor.insertText("@" + fullMentionUpToSpaceOrEnd, mentionFormat);
message = message.mid(fullMentionUpToSpaceOrEnd.size() + 1); message = message.mid(fullMentionUpToSpaceOrEnd.size() + 1);
showSystemPopup(sender); showSystemPopup(sender);
@ -321,8 +329,8 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, QString &send
return; return;
} }
if (fullMentionUpToSpaceOrEnd.right(1).indexOf(notALetterOrNumber) == -1 || fullMentionUpToSpaceOrEnd.size() < 2) if (fullMentionUpToSpaceOrEnd.right(1).indexOf(notALetterOrNumber) == -1 ||
{ fullMentionUpToSpaceOrEnd.size() < 2) {
cursor.insertText("@" + mentionIntact, defaultFormat); cursor.insertText("@" + mentionIntact, defaultFormat);
message = message.mid(mentionIntact.size() + 1); message = message.mid(mentionIntact.size() + 1);
cursor.setCharFormat(defaultFormat); cursor.setCharFormat(defaultFormat);
@ -345,11 +353,9 @@ void ChatView::checkWord(QTextCursor &cursor, QString &message)
// check urls // check urls
if (fullWordUpToSpaceOrEnd.startsWith("http://", Qt::CaseInsensitive) || if (fullWordUpToSpaceOrEnd.startsWith("http://", Qt::CaseInsensitive) ||
fullWordUpToSpaceOrEnd.startsWith("https://", Qt::CaseInsensitive) || fullWordUpToSpaceOrEnd.startsWith("https://", Qt::CaseInsensitive) ||
fullWordUpToSpaceOrEnd.startsWith("www.", Qt::CaseInsensitive)) fullWordUpToSpaceOrEnd.startsWith("www.", Qt::CaseInsensitive)) {
{
QUrl qUrl(fullWordUpToSpaceOrEnd); QUrl qUrl(fullWordUpToSpaceOrEnd);
if (qUrl.isValid()) if (qUrl.isValid()) {
{
appendUrlTag(cursor, fullWordUpToSpaceOrEnd); appendUrlTag(cursor, fullWordUpToSpaceOrEnd);
cursor.insertText(rest, defaultFormat); cursor.insertText(rest, defaultFormat);
return; return;
@ -357,13 +363,12 @@ void ChatView::checkWord(QTextCursor &cursor, QString &message)
} }
// check word mentions // check word mentions
foreach (QString word, highlightedWords) foreach (QString word, highlightedWords) {
{ if (fullWordUpToSpaceOrEnd.compare(word, Qt::CaseInsensitive) == 0) {
if (fullWordUpToSpaceOrEnd.compare(word, Qt::CaseInsensitive) == 0)
{
// You have received a valid mention of custom word!! // You have received a valid mention of custom word!!
highlightFormat.setBackground(QBrush(getCustomHighlightColor())); highlightFormat.setBackground(QBrush(getCustomHighlightColor()));
highlightFormat.setForeground(settingsCache->getChatHighlightForeground() ? QBrush(Qt::white) : QBrush(Qt::black)); highlightFormat.setForeground(settingsCache->getChatHighlightForeground() ? QBrush(Qt::white)
: QBrush(Qt::black));
cursor.insertText(fullWordUpToSpaceOrEnd, highlightFormat); cursor.insertText(fullWordUpToSpaceOrEnd, highlightFormat);
cursor.insertText(rest, defaultFormat); cursor.insertText(rest, defaultFormat);
QApplication::alert(this); QApplication::alert(this);
@ -380,8 +385,7 @@ QString ChatView::extractNextWord(QString &message, QString &rest)
// get the first next space and extract the word // get the first next space and extract the word
QString word; QString word;
int firstSpace = message.indexOf(' '); int firstSpace = message.indexOf(' ');
if(firstSpace == -1) if (firstSpace == -1) {
{
word = message; word = message;
message.clear(); message.clear();
} else { } else {
@ -390,10 +394,8 @@ QString ChatView::extractNextWord(QString &message, QString &rest)
} }
// remove any punctuation from the end and pass it separately // remove any punctuation from the end and pass it separately
for (int len = word.size() - 1; len >= 0; --len) for (int len = word.size() - 1; len >= 0; --len) {
{ if (word.at(len).isLetterOrNumber()) {
if(word.at(len).isLetterOrNumber())
{
rest = word.mid(len + 1); rest = word.mid(len + 1);
return word.mid(0, len + 1); return word.mid(0, len + 1);
} }
@ -403,7 +405,6 @@ QString ChatView::extractNextWord(QString &message, QString &rest)
return QString(); return QString();
} }
bool ChatView::isModeratorSendingGlobal(QFlags<ServerInfo_User::UserLevelFlag> userLevelFlag, QString message) bool ChatView::isModeratorSendingGlobal(QFlags<ServerInfo_User::UserLevelFlag> userLevelFlag, QString message)
{ {
int userLevel = QString::number(userLevelFlag).toInt(); int userLevel = QString::number(userLevelFlag).toInt();
@ -411,17 +412,17 @@ bool ChatView::isModeratorSendingGlobal(QFlags<ServerInfo_User::UserLevelFlag> u
QStringList getAttentionList; QStringList getAttentionList;
getAttentionList << "/all"; // Send a message to all users getAttentionList << "/all"; // Send a message to all users
return (getAttentionList.contains(message) return (getAttentionList.contains(message) &&
&& (userLevel & ServerInfo_User::IsModerator (userLevel & ServerInfo_User::IsModerator || userLevel & ServerInfo_User::IsAdmin));
|| userLevel & ServerInfo_User::IsAdmin));
} }
void ChatView::actMessageClicked() { void ChatView::actMessageClicked()
{
emit messageClickedSignal(); emit messageClickedSignal();
} }
void ChatView::showSystemPopup(QString &sender) { void ChatView::showSystemPopup(QString &sender)
{
QApplication::alert(this); QApplication::alert(this);
if (settingsCache->getShowMentionPopup()) { if (settingsCache->getShowMentionPopup()) {
QString ref = sender.left(sender.length() - 2); QString ref = sender.left(sender.length() - 2);
@ -429,19 +430,22 @@ void ChatView::showSystemPopup(QString &sender) {
} }
} }
QColor ChatView::getCustomMentionColor() { QColor ChatView::getCustomMentionColor()
{
QColor customColor; QColor customColor;
customColor.setNamedColor("#" + settingsCache->getChatMentionColor()); customColor.setNamedColor("#" + settingsCache->getChatMentionColor());
return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR; return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR;
} }
QColor ChatView::getCustomHighlightColor() { QColor ChatView::getCustomHighlightColor()
{
QColor customColor; QColor customColor;
customColor.setNamedColor("#" + settingsCache->getChatHighlightColor()); customColor.setNamedColor("#" + settingsCache->getChatHighlightColor());
return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR; return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR;
} }
void ChatView::clearChat() { void ChatView::clearChat()
{
document()->clear(); document()->clear();
lastSender = ""; lastSender = "";
} }
@ -509,13 +513,13 @@ void ChatView::mousePressEvent(QMouseEvent *event)
if (event->button() != Qt::MidButton) { if (event->button() != Qt::MidButton) {
const int delimiterIndex = hoveredContent.indexOf("_"); const int delimiterIndex = hoveredContent.indexOf("_");
const QString userName = hoveredContent.mid(delimiterIndex + 1); const QString userName = hoveredContent.mid(delimiterIndex + 1);
switch(event->button()) { switch (event->button()) {
case Qt::RightButton :{ case Qt::RightButton: {
UserLevelFlags userLevel(hoveredContent.left(delimiterIndex).toInt()); UserLevelFlags userLevel(hoveredContent.left(delimiterIndex).toInt());
userContextMenu->showContextMenu(event->globalPos(), userName, userLevel); userContextMenu->showContextMenu(event->globalPos(), userName, userLevel);
break; break;
} }
case Qt::LeftButton :{ case Qt::LeftButton: {
if (event->modifiers() == Qt::ControlModifier) { if (event->modifiers() == Qt::ControlModifier) {
emit openMessageDialog(userName, true); emit openMessageDialog(userName, true);
} else } else

View file

@ -1,30 +1,38 @@
#ifndef CHATVIEW_H #ifndef CHATVIEW_H
#define CHATVIEW_H #define CHATVIEW_H
#include <QTextBrowser>
#include <QTextFragment>
#include <QTextCursor>
#include <QColor>
#include <QAction>
#include "../userlist.h"
#include "user_level.h"
#include "room_message_type.h"
#include "../tab_supervisor.h" #include "../tab_supervisor.h"
#include "../userlist.h"
#include "room_message_type.h"
#include "user_level.h"
#include "userlistProxy.h" #include "userlistProxy.h"
#include <QAction>
#include <QColor>
#include <QTextBrowser>
#include <QTextCursor>
#include <QTextFragment>
class QTextTable; class QTextTable;
class QMouseEvent; class QMouseEvent;
class UserContextMenu; class UserContextMenu;
class TabGame; class TabGame;
class ChatView : public QTextBrowser { class ChatView : public QTextBrowser
{
Q_OBJECT Q_OBJECT
protected: protected:
const TabSupervisor * const tabSupervisor; const TabSupervisor *const tabSupervisor;
TabGame * const game; TabGame *const game;
private: private:
enum HoveredItemType { HoveredNothing, HoveredUrl, HoveredCard, HoveredUser }; enum HoveredItemType
const UserlistProxy * const userlistProxy; {
HoveredNothing,
HoveredUrl,
HoveredCard,
HoveredUser
};
const UserlistProxy *const userlistProxy;
UserContextMenu *userContextMenu; UserContextMenu *userContextMenu;
QString lastSender; QString lastSender;
QString userName; QString userName;
@ -54,13 +62,25 @@ private:
private slots: private slots:
void openLink(const QUrl &link); void openLink(const QUrl &link);
void actMessageClicked(); void actMessageClicked();
public: public:
ChatView(const TabSupervisor *_tabSupervisor, const UserlistProxy *_userlistProxy, TabGame *_game, bool _showTimestamps, QWidget *parent = 0); ChatView(const TabSupervisor *_tabSupervisor,
const UserlistProxy *_userlistProxy,
TabGame *_game,
bool _showTimestamps,
QWidget *parent = 0);
void retranslateUi(); void retranslateUi();
void appendHtml(const QString &html); void appendHtml(const QString &html);
void appendHtmlServerMessage(const QString &html, bool optionalIsBold = false, QString optionalFontColor = QString()); void
void appendMessage(QString message, RoomMessageTypeFlags messageType = 0, QString sender = QString(), UserLevelFlags userLevel = UserLevelFlags(), QString UserPrivLevel = "NONE", bool playerBold = false); appendHtmlServerMessage(const QString &html, bool optionalIsBold = false, QString optionalFontColor = QString());
void appendMessage(QString message,
RoomMessageTypeFlags messageType = 0,
QString sender = QString(),
UserLevelFlags userLevel = UserLevelFlags(),
QString UserPrivLevel = "NONE",
bool playerBold = false);
void clearChat(); void clearChat();
protected: protected:
void enterEvent(QEvent *event); void enterEvent(QEvent *event);
void leaveEvent(QEvent *event); void leaveEvent(QEvent *event);

View file

@ -8,13 +8,14 @@ class ServerInfo_User;
* Responsible for providing a bare-bones minimal interface into userlist information, * Responsible for providing a bare-bones minimal interface into userlist information,
* including your current connection to the server as well as buddy/ignore/alluser lists. * including your current connection to the server as well as buddy/ignore/alluser lists.
*/ */
class UserlistProxy { class UserlistProxy
{
public: public:
virtual bool isOwnUserRegistered() const = 0; virtual bool isOwnUserRegistered() const = 0;
virtual QString getOwnUsername() const = 0; virtual QString getOwnUsername() const = 0;
virtual bool isUserBuddy(const QString &userName) const = 0; virtual bool isUserBuddy(const QString &userName) const = 0;
virtual bool isUserIgnored(const QString &userName) const = 0; virtual bool isUserIgnored(const QString &userName) const = 0;
virtual const ServerInfo_User* getOnlineUser(const QString &userName) const = 0; // Can return nullptr virtual const ServerInfo_User *getOnlineUser(const QString &userName) const = 0; // Can return nullptr
}; };
#endif //COCKATRICE_USERLISTPROXY_H #endif // COCKATRICE_USERLISTPROXY_H

View file

@ -1,10 +1,10 @@
#include "sequenceedit.h" #include "sequenceedit.h"
#include "../settingscache.h" #include "../settingscache.h"
#include <QEvent>
#include <QHBoxLayout>
#include <QKeyEvent>
#include <QLineEdit> #include <QLineEdit>
#include <QPushButton> #include <QPushButton>
#include <QHBoxLayout>
#include <QEvent>
#include <QKeyEvent>
#include <QToolTip> #include <QToolTip>
#include <utility> #include <utility>
@ -32,14 +32,14 @@ SequenceEdit::SequenceEdit(QString _shorcutName, QWidget *parent) : QWidget(pare
defaultButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); defaultButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
auto *layout = new QHBoxLayout(this); auto *layout = new QHBoxLayout(this);
layout->setContentsMargins(0,0,0,0); layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(1); layout->setSpacing(1);
layout->addWidget(lineEdit); layout->addWidget(lineEdit);
layout->addWidget(clearButton); layout->addWidget(clearButton);
layout->addWidget(defaultButton); layout->addWidget(defaultButton);
connect(clearButton,SIGNAL(clicked()),this,SLOT(removeLastShortcut())); connect(clearButton, SIGNAL(clicked()), this, SLOT(removeLastShortcut()));
connect(defaultButton,SIGNAL(clicked()),this,SLOT(restoreDefault())); connect(defaultButton, SIGNAL(clicked()), this, SLOT(restoreDefault()));
lineEdit->installEventFilter(this); lineEdit->installEventFilter(this);
lineEdit->setText(settingsCache->shortcuts().getShortcutString(shorcutName)); lineEdit->setText(settingsCache->shortcuts().getShortcutString(shorcutName));
@ -53,15 +53,11 @@ QString SequenceEdit::getSecuence()
void SequenceEdit::removeLastShortcut() void SequenceEdit::removeLastShortcut()
{ {
QString secuences = lineEdit->text(); QString secuences = lineEdit->text();
if (!secuences.isEmpty()) if (!secuences.isEmpty()) {
{ if (secuences.lastIndexOf(";") > 0) {
if (secuences.lastIndexOf(";") > 0)
{
QString valid = secuences.left(secuences.lastIndexOf(";")); QString valid = secuences.left(secuences.lastIndexOf(";"));
lineEdit->setText(valid); lineEdit->setText(valid);
} } else {
else
{
lineEdit->clear(); lineEdit->clear();
} }
@ -85,18 +81,14 @@ void SequenceEdit::clear()
this->lineEdit->setText(""); this->lineEdit->setText("");
} }
bool SequenceEdit::eventFilter(QObject *, QEvent * event) bool SequenceEdit::eventFilter(QObject *, QEvent *event)
{ {
if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
{
auto *keyEvent = reinterpret_cast<QKeyEvent *>(event); auto *keyEvent = reinterpret_cast<QKeyEvent *>(event);
if (event->type() == QEvent::KeyPress && !keyEvent->isAutoRepeat()) if (event->type() == QEvent::KeyPress && !keyEvent->isAutoRepeat()) {
{
processKey(keyEvent); processKey(keyEvent);
} } else if (event->type() == QEvent::KeyRelease && !keyEvent->isAutoRepeat()) {
else if (event->type() == QEvent::KeyRelease && !keyEvent->isAutoRepeat())
{
finishShortcut(); finishShortcut();
} }
@ -105,19 +97,17 @@ bool SequenceEdit::eventFilter(QObject *, QEvent * event)
return false; return false;
} }
void SequenceEdit::processKey(QKeyEvent* e) void SequenceEdit::processKey(QKeyEvent *e)
{ {
int key = e->key(); int key = e->key();
if (key != Qt::Key_Control && key != Qt::Key_Shift && key != Qt::Key_Meta && key != Qt::Key_Alt) if (key != Qt::Key_Control && key != Qt::Key_Shift && key != Qt::Key_Meta && key != Qt::Key_Alt) {
{
valid = true; valid = true;
key |= translateModifiers(e->modifiers(), e->text()); key |= translateModifiers(e->modifiers(), e->text());
} }
keys = key; keys = key;
currentKey++; currentKey++;
if (currentKey >= key) if (currentKey >= key) {
{
finishShortcut(); finishShortcut();
} }
} }
@ -127,26 +117,20 @@ int SequenceEdit::translateModifiers(Qt::KeyboardModifiers state, const QString
int result = 0; int result = 0;
// The shift modifier only counts when it is not used to type a symbol // The shift modifier only counts when it is not used to type a symbol
// that is only reachable using the shift key anyway // that is only reachable using the shift key anyway
if ((state & Qt::ShiftModifier) && (text.isEmpty() || if ((state & Qt::ShiftModifier) &&
!text.at(0).isPrint() || (text.isEmpty() || !text.at(0).isPrint() || text.at(0).isLetterOrNumber() || text.at(0).isSpace())) {
text.at(0).isLetterOrNumber() ||
text.at(0).isSpace()))
{
result |= Qt::SHIFT; result |= Qt::SHIFT;
} }
if (state & Qt::ControlModifier) if (state & Qt::ControlModifier) {
{
result |= Qt::CTRL; result |= Qt::CTRL;
} }
if (state & Qt::MetaModifier) if (state & Qt::MetaModifier) {
{
result |= Qt::META; result |= Qt::META;
} }
if (state & Qt::AltModifier) if (state & Qt::AltModifier) {
{
result |= Qt::ALT; result |= Qt::ALT;
} }
@ -156,23 +140,17 @@ int SequenceEdit::translateModifiers(Qt::KeyboardModifiers state, const QString
void SequenceEdit::finishShortcut() void SequenceEdit::finishShortcut()
{ {
QKeySequence secuence(keys); QKeySequence secuence(keys);
if (!secuence.isEmpty() && valid) if (!secuence.isEmpty() && valid) {
{
QString secuenceString = secuence.toString(); QString secuenceString = secuence.toString();
if (settingsCache->shortcuts().isValid(shorcutName,secuenceString)) if (settingsCache->shortcuts().isValid(shorcutName, secuenceString)) {
{ if (!lineEdit->text().isEmpty()) {
if (!lineEdit->text().isEmpty()) if (lineEdit->text().contains(secuenceString)) {
{
if (lineEdit->text().contains(secuenceString))
{
return; return;
} }
lineEdit->setText(lineEdit->text() + ";"); lineEdit->setText(lineEdit->text() + ";");
} }
lineEdit->setText(lineEdit->text() + secuenceString); lineEdit->setText(lineEdit->text() + secuenceString);
} } else {
else
{
QToolTip::showText(lineEdit->mapToGlobal(QPoint()), tr("Shortcut already in use")); QToolTip::showText(lineEdit->mapToGlobal(QPoint()), tr("Shortcut already in use"));
} }
} }
@ -185,5 +163,5 @@ void SequenceEdit::finishShortcut()
void SequenceEdit::updateSettings() void SequenceEdit::updateSettings()
{ {
settingsCache->shortcuts().setShortcuts(shorcutName,lineEdit->text()); settingsCache->shortcuts().setShortcuts(shorcutName, lineEdit->text());
} }

View file

@ -1,8 +1,8 @@
#ifndef SECUENCEEDIT_H #ifndef SECUENCEEDIT_H
#define SECUENCEEDIT_H #define SECUENCEEDIT_H
#include <QWidget>
#include <QKeySequence> #include <QKeySequence>
#include <QWidget>
class QLineEdit; class QLineEdit;
class QPushButton; class QPushButton;
@ -11,20 +11,20 @@ class QEvent;
class SequenceEdit : public QWidget class SequenceEdit : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
SequenceEdit(QString _shorcutName, QWidget *parent = nullptr); SequenceEdit(QString _shorcutName, QWidget *parent = nullptr);
QString getSecuence(); QString getSecuence();
void refreshShortcut(); void refreshShortcut();
void clear(); void clear();
private slots: private slots:
void removeLastShortcut(); void removeLastShortcut();
void restoreDefault(); void restoreDefault();
protected: protected:
bool eventFilter(QObject *, QEvent *event); bool eventFilter(QObject *, QEvent *event);
private: private:
QString shorcutName; QString shorcutName;
QLineEdit *lineEdit; QLineEdit *lineEdit;
QPushButton *clearButton; QPushButton *clearButton;

View file

@ -7,10 +7,10 @@
ShortcutsTab::ShortcutsTab() : ui(new Ui::shortcutsTab) ShortcutsTab::ShortcutsTab() : ui(new Ui::shortcutsTab)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->btnResetAll,SIGNAL(clicked()),this,SLOT(resetShortcuts())); connect(ui->btnResetAll, SIGNAL(clicked()), this, SLOT(resetShortcuts()));
connect(ui->btnClearAll,SIGNAL(clicked()),this,SLOT(clearShortcuts())); connect(ui->btnClearAll, SIGNAL(clicked()), this, SLOT(clearShortcuts()));
connect(&settingsCache->shortcuts(),SIGNAL(allShortCutsReset()),this,SLOT(refreshEdits())); connect(&settingsCache->shortcuts(), SIGNAL(allShortCutsReset()), this, SLOT(refreshEdits()));
connect(&settingsCache->shortcuts(),SIGNAL(allShortCutsClear()),this,SLOT(afterClear())); connect(&settingsCache->shortcuts(), SIGNAL(allShortCutsClear()), this, SLOT(afterClear()));
} }
void ShortcutsTab::retranslateUi() void ShortcutsTab::retranslateUi()
@ -25,36 +25,32 @@ ShortcutsTab::~ShortcutsTab()
void ShortcutsTab::resetShortcuts() void ShortcutsTab::resetShortcuts()
{ {
if (QMessageBox::question(this,tr("Restore all default shortcuts"), if (QMessageBox::question(this, tr("Restore all default shortcuts"),
tr("Do you really want to restore all default shortcuts?")) == QMessageBox::Yes) tr("Do you really want to restore all default shortcuts?")) == QMessageBox::Yes) {
{
settingsCache->shortcuts().resetAllShortcuts(); settingsCache->shortcuts().resetAllShortcuts();
} }
} }
void ShortcutsTab::refreshEdits() void ShortcutsTab::refreshEdits()
{ {
QList<SequenceEdit*> edits = this->findChildren<SequenceEdit*>(); QList<SequenceEdit *> edits = this->findChildren<SequenceEdit *>();
for (auto edit : edits) for (auto edit : edits) {
{
edit->refreshShortcut(); edit->refreshShortcut();
} }
} }
void ShortcutsTab::clearShortcuts() void ShortcutsTab::clearShortcuts()
{ {
if (QMessageBox::question(this,tr("Clear all default shortcuts"), if (QMessageBox::question(this, tr("Clear all default shortcuts"),
tr("Do you really want to clear all shortcuts?")) == QMessageBox::Yes) tr("Do you really want to clear all shortcuts?")) == QMessageBox::Yes) {
{
settingsCache->shortcuts().clearAllShortcuts(); settingsCache->shortcuts().clearAllShortcuts();
} }
} }
void ShortcutsTab::afterClear() void ShortcutsTab::afterClear()
{ {
QList<SequenceEdit*> edits = this->findChildren<SequenceEdit*>(); QList<SequenceEdit *> edits = this->findChildren<SequenceEdit *>();
for (auto edit : edits) for (auto edit : edits) {
{
edit->clear(); edit->clear();
} }
} }

View file

@ -7,24 +7,24 @@
namespace Ui namespace Ui
{ {
class shortcutsTab; class shortcutsTab;
} }
class ShortcutsTab : public AbstractSettingsPage class ShortcutsTab : public AbstractSettingsPage
{ {
Q_OBJECT Q_OBJECT
public: public:
ShortcutsTab(); ShortcutsTab();
void retranslateUi(); void retranslateUi();
~ShortcutsTab(); ~ShortcutsTab();
private slots: private slots:
void resetShortcuts(); void resetShortcuts();
void refreshEdits(); void refreshEdits();
void clearShortcuts(); void clearShortcuts();
void afterClear(); void afterClear();
private: private:
Ui::shortcutsTab *ui; Ui::shortcutsTab *ui;
}; };

View file

@ -1,7 +1,7 @@
#ifndef UI_SHORTCUTSTAB_H #ifndef UI_SHORTCUTSTAB_H
#define UI_SHORTCUTSTAB_H #define UI_SHORTCUTSTAB_H
#include <QtCore/QVariant> #include "sequenceedit.h"
#include <QAction> #include <QAction>
#include <QApplication> #include <QApplication>
#include <QButtonGroup> #include <QButtonGroup>
@ -15,7 +15,7 @@
#include <QTabWidget> #include <QTabWidget>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QWidget> #include <QWidget>
#include "sequenceedit.h" #include <QtCore/QVariant>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -23,7 +23,7 @@ QT_BEGIN_NAMESPACE
class Ui_shortcutsTab class Ui_shortcutsTab
{ {
public: public:
QGridLayout *gridLayout_9; QGridLayout *gridLayout_9;
QTabWidget *tabWidget; QTabWidget *tabWidget;
QWidget *tab; QWidget *tab;
@ -138,7 +138,7 @@ class Ui_shortcutsTab
QLabel *lbl_Player_aDecCStorm; QLabel *lbl_Player_aDecCStorm;
SequenceEdit *Player_aDecCStorm; SequenceEdit *Player_aDecCStorm;
QGroupBox *groupBox_counterW;//W Counter QGroupBox *groupBox_counterW; // W Counter
QGridLayout *gridLayout_W; QGridLayout *gridLayout_W;
QLabel *lbl_Player_aSetCW; QLabel *lbl_Player_aSetCW;
SequenceEdit *Player_aSetCW; SequenceEdit *Player_aSetCW;
@ -147,7 +147,7 @@ class Ui_shortcutsTab
QLabel *lbl_Player_aDecCW; QLabel *lbl_Player_aDecCW;
SequenceEdit *Player_aDecCW; SequenceEdit *Player_aDecCW;
QGroupBox *groupBox_counterU;//U Counter QGroupBox *groupBox_counterU; // U Counter
QGridLayout *gridLayout_U; QGridLayout *gridLayout_U;
QLabel *lbl_Player_aSetCU; QLabel *lbl_Player_aSetCU;
SequenceEdit *Player_aSetCU; SequenceEdit *Player_aSetCU;
@ -156,7 +156,7 @@ class Ui_shortcutsTab
QLabel *lbl_Player_aDecCU; QLabel *lbl_Player_aDecCU;
SequenceEdit *Player_aDecCU; SequenceEdit *Player_aDecCU;
QGroupBox *groupBox_counterB;//B Counter QGroupBox *groupBox_counterB; // B Counter
QGridLayout *gridLayout_B; QGridLayout *gridLayout_B;
QLabel *lbl_Player_aSetCB; QLabel *lbl_Player_aSetCB;
SequenceEdit *Player_aSetCB; SequenceEdit *Player_aSetCB;
@ -165,7 +165,7 @@ class Ui_shortcutsTab
QLabel *lbl_Player_aDecCB; QLabel *lbl_Player_aDecCB;
SequenceEdit *Player_aDecCB; SequenceEdit *Player_aDecCB;
QGroupBox *groupBox_counterR;//R Counter QGroupBox *groupBox_counterR; // R Counter
QGridLayout *gridLayout_R; QGridLayout *gridLayout_R;
QLabel *lbl_Player_aSetCR; QLabel *lbl_Player_aSetCR;
SequenceEdit *Player_aSetCR; SequenceEdit *Player_aSetCR;
@ -174,7 +174,7 @@ class Ui_shortcutsTab
QLabel *lbl_Player_aDecCR; QLabel *lbl_Player_aDecCR;
SequenceEdit *Player_aDecCR; SequenceEdit *Player_aDecCR;
QGroupBox *groupBox_counterG;//G Counter QGroupBox *groupBox_counterG; // G Counter
QGridLayout *gridLayout_G; QGridLayout *gridLayout_G;
QLabel *lbl_Player_aSetCG; QLabel *lbl_Player_aSetCG;
SequenceEdit *Player_aSetCG; SequenceEdit *Player_aSetCG;
@ -183,7 +183,7 @@ class Ui_shortcutsTab
QLabel *lbl_Player_aDecCG; QLabel *lbl_Player_aDecCG;
SequenceEdit *Player_aDecCG; SequenceEdit *Player_aDecCG;
QGroupBox *groupBox_counterX;//X Counter QGroupBox *groupBox_counterX; // X Counter
QGridLayout *gridLayout_X; QGridLayout *gridLayout_X;
QLabel *lbl_Player_aSetCX; QLabel *lbl_Player_aSetCX;
SequenceEdit *Player_aSetCX; SequenceEdit *Player_aSetCX;
@ -340,7 +340,7 @@ class Ui_shortcutsTab
QLabel *lbl_Player_aAlwaysRevealTopCard; QLabel *lbl_Player_aAlwaysRevealTopCard;
SequenceEdit *Player_aAlwaysRevealTopCard; SequenceEdit *Player_aAlwaysRevealTopCard;
QSpacerItem *verticalSpacer_3; QSpacerItem *verticalSpacer_3;
QWidget * tab_4; QWidget *tab_4;
QLabel *faqLabel; QLabel *faqLabel;
QPushButton *btnResetAll; QPushButton *btnResetAll;
QPushButton *btnClearAll; QPushButton *btnClearAll;
@ -367,7 +367,7 @@ class Ui_shortcutsTab
gridLayout_2->addWidget(lbl_MainWindow_aDeckEditor, 1, 0, 1, 1); gridLayout_2->addWidget(lbl_MainWindow_aDeckEditor, 1, 0, 1, 1);
MainWindow_aDeckEditor = new SequenceEdit("MainWindow/aDeckEditor",groupBox); MainWindow_aDeckEditor = new SequenceEdit("MainWindow/aDeckEditor", groupBox);
MainWindow_aDeckEditor->setObjectName("MainWindow_aDeckEditor"); MainWindow_aDeckEditor->setObjectName("MainWindow_aDeckEditor");
gridLayout_2->addWidget(MainWindow_aDeckEditor, 1, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aDeckEditor, 1, 1, 1, 2);
@ -377,7 +377,7 @@ class Ui_shortcutsTab
gridLayout_2->addWidget(lbl_MainWindow_aSinglePlayer, 2, 0, 1, 1); gridLayout_2->addWidget(lbl_MainWindow_aSinglePlayer, 2, 0, 1, 1);
MainWindow_aSinglePlayer = new SequenceEdit("MainWindow/aSinglePlayer",groupBox); MainWindow_aSinglePlayer = new SequenceEdit("MainWindow/aSinglePlayer", groupBox);
MainWindow_aSinglePlayer->setObjectName("MainWindow_aSinglePlayer"); MainWindow_aSinglePlayer->setObjectName("MainWindow_aSinglePlayer");
gridLayout_2->addWidget(MainWindow_aSinglePlayer, 2, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aSinglePlayer, 2, 1, 1, 2);
@ -392,7 +392,7 @@ class Ui_shortcutsTab
gridLayout_2->addWidget(lbl_MainWindow_aConnect, 6, 0, 1, 1); gridLayout_2->addWidget(lbl_MainWindow_aConnect, 6, 0, 1, 1);
MainWindow_aConnect = new SequenceEdit("MainWindow/aConnect",groupBox); MainWindow_aConnect = new SequenceEdit("MainWindow/aConnect", groupBox);
MainWindow_aConnect->setObjectName("MainWindow_aConnect"); MainWindow_aConnect->setObjectName("MainWindow_aConnect");
gridLayout_2->addWidget(MainWindow_aConnect, 6, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aConnect, 6, 1, 1, 2);
@ -407,7 +407,7 @@ class Ui_shortcutsTab
gridLayout_2->addWidget(lbl_MainWindow_aFullScreen, 9, 0, 1, 1); gridLayout_2->addWidget(lbl_MainWindow_aFullScreen, 9, 0, 1, 1);
MainWindow_aFullScreen = new SequenceEdit("MainWindow/aFullScreen",groupBox); MainWindow_aFullScreen = new SequenceEdit("MainWindow/aFullScreen", groupBox);
MainWindow_aFullScreen->setObjectName("MainWindow_aFullScreen"); MainWindow_aFullScreen->setObjectName("MainWindow_aFullScreen");
gridLayout_2->addWidget(MainWindow_aFullScreen, 9, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aFullScreen, 9, 1, 1, 2);
@ -417,7 +417,7 @@ class Ui_shortcutsTab
gridLayout_2->addWidget(lbl_MainWindow_aSettings, 11, 0, 1, 1); gridLayout_2->addWidget(lbl_MainWindow_aSettings, 11, 0, 1, 1);
MainWindow_aRegister = new SequenceEdit("MainWindow/aRegister",groupBox); MainWindow_aRegister = new SequenceEdit("MainWindow/aRegister", groupBox);
MainWindow_aRegister->setObjectName("MainWindow_aRegister"); MainWindow_aRegister->setObjectName("MainWindow_aRegister");
gridLayout_2->addWidget(MainWindow_aRegister, 10, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aRegister, 10, 1, 1, 2);
@ -427,22 +427,22 @@ class Ui_shortcutsTab
gridLayout_2->addWidget(lbl_MainWindow_aCheckCardUpdates, 0, 0, 1, 1); gridLayout_2->addWidget(lbl_MainWindow_aCheckCardUpdates, 0, 0, 1, 1);
MainWindow_aSettings = new SequenceEdit("MainWindow/aSettings",groupBox); MainWindow_aSettings = new SequenceEdit("MainWindow/aSettings", groupBox);
MainWindow_aSettings->setObjectName("MainWindow_aSettings"); MainWindow_aSettings->setObjectName("MainWindow_aSettings");
gridLayout_2->addWidget(MainWindow_aSettings, 11, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aSettings, 11, 1, 1, 2);
MainWindow_aCheckCardUpdates = new SequenceEdit("MainWindow/aCheckCardUpdates",groupBox); MainWindow_aCheckCardUpdates = new SequenceEdit("MainWindow/aCheckCardUpdates", groupBox);
MainWindow_aCheckCardUpdates->setObjectName("MainWindow_aCheckCardUpdates"); MainWindow_aCheckCardUpdates->setObjectName("MainWindow_aCheckCardUpdates");
gridLayout_2->addWidget(MainWindow_aCheckCardUpdates, 0, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aCheckCardUpdates, 0, 1, 1, 2);
MainWindow_aWatchReplay = new SequenceEdit("MainWindow/aWatchReplay",groupBox); MainWindow_aWatchReplay = new SequenceEdit("MainWindow/aWatchReplay", groupBox);
MainWindow_aWatchReplay->setObjectName("MainWindow_aWatchReplay"); MainWindow_aWatchReplay->setObjectName("MainWindow_aWatchReplay");
gridLayout_2->addWidget(MainWindow_aWatchReplay, 4, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aWatchReplay, 4, 1, 1, 2);
MainWindow_aDisconnect = new SequenceEdit("MainWindow/aDisconnect",groupBox); MainWindow_aDisconnect = new SequenceEdit("MainWindow/aDisconnect", groupBox);
MainWindow_aDisconnect->setObjectName("MainWindow_aDisconnect"); MainWindow_aDisconnect->setObjectName("MainWindow_aDisconnect");
gridLayout_2->addWidget(MainWindow_aDisconnect, 7, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aDisconnect, 7, 1, 1, 2);
@ -457,7 +457,7 @@ class Ui_shortcutsTab
gridLayout_2->addWidget(lbl_MainWindow_aExit, 8, 0, 1, 1); gridLayout_2->addWidget(lbl_MainWindow_aExit, 8, 0, 1, 1);
MainWindow_aExit = new SequenceEdit("MainWindow/aExit",groupBox); MainWindow_aExit = new SequenceEdit("MainWindow/aExit", groupBox);
MainWindow_aExit->setObjectName("MainWindow_aExit"); MainWindow_aExit->setObjectName("MainWindow_aExit");
gridLayout_2->addWidget(MainWindow_aExit, 8, 1, 1, 2); gridLayout_2->addWidget(MainWindow_aExit, 8, 1, 1, 2);
@ -473,7 +473,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aAnalyzeDeck, 0, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aAnalyzeDeck, 0, 0, 1, 1);
TabDeckEditor_aAnalyzeDeck = new SequenceEdit("TabDeckEditor/aAnalyzeDeck",groupBox_2); TabDeckEditor_aAnalyzeDeck = new SequenceEdit("TabDeckEditor/aAnalyzeDeck", groupBox_2);
TabDeckEditor_aAnalyzeDeck->setObjectName("TabDeckEditor_aAnalyzeDeck"); TabDeckEditor_aAnalyzeDeck->setObjectName("TabDeckEditor_aAnalyzeDeck");
gridLayout->addWidget(TabDeckEditor_aAnalyzeDeck, 0, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aAnalyzeDeck, 0, 1, 1, 1);
@ -483,7 +483,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aLoadDeckFromClipboard, 0, 2, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aLoadDeckFromClipboard, 0, 2, 1, 1);
TabDeckEditor_aLoadDeckFromClipboard = new SequenceEdit("TabDeckEditor/aLoadDeckFromClipboard",groupBox_2); TabDeckEditor_aLoadDeckFromClipboard = new SequenceEdit("TabDeckEditor/aLoadDeckFromClipboard", groupBox_2);
TabDeckEditor_aLoadDeckFromClipboard->setObjectName("TabDeckEditor_aLoadDeckFromClipboard"); TabDeckEditor_aLoadDeckFromClipboard->setObjectName("TabDeckEditor_aLoadDeckFromClipboard");
gridLayout->addWidget(TabDeckEditor_aLoadDeckFromClipboard, 0, 3, 1, 1); gridLayout->addWidget(TabDeckEditor_aLoadDeckFromClipboard, 0, 3, 1, 1);
@ -493,7 +493,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aClearFilterAll, 1, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aClearFilterAll, 1, 0, 1, 1);
TabDeckEditor_aClearFilterAll = new SequenceEdit("TabDeckEditor/aClearFilterAll",groupBox_2); TabDeckEditor_aClearFilterAll = new SequenceEdit("TabDeckEditor/aClearFilterAll", groupBox_2);
TabDeckEditor_aClearFilterAll->setObjectName("TabDeckEditor_aClearFilterAll"); TabDeckEditor_aClearFilterAll->setObjectName("TabDeckEditor_aClearFilterAll");
gridLayout->addWidget(TabDeckEditor_aClearFilterAll, 1, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aClearFilterAll, 1, 1, 1, 1);
@ -503,7 +503,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aNewDeck, 1, 2, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aNewDeck, 1, 2, 1, 1);
TabDeckEditor_aNewDeck = new SequenceEdit("TabDeckEditor/aNewDeck",groupBox_2); TabDeckEditor_aNewDeck = new SequenceEdit("TabDeckEditor/aNewDeck", groupBox_2);
TabDeckEditor_aNewDeck->setObjectName("TabDeckEditor_aNewDeck"); TabDeckEditor_aNewDeck->setObjectName("TabDeckEditor_aNewDeck");
gridLayout->addWidget(TabDeckEditor_aNewDeck, 1, 3, 1, 1); gridLayout->addWidget(TabDeckEditor_aNewDeck, 1, 3, 1, 1);
@ -513,7 +513,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aClearFilterOne, 2, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aClearFilterOne, 2, 0, 1, 1);
TabDeckEditor_aClearFilterOne = new SequenceEdit("TabDeckEditor/aClearFilterOne",groupBox_2); TabDeckEditor_aClearFilterOne = new SequenceEdit("TabDeckEditor/aClearFilterOne", groupBox_2);
TabDeckEditor_aClearFilterOne->setObjectName("TabDeckEditor_aClearFilterOne"); TabDeckEditor_aClearFilterOne->setObjectName("TabDeckEditor_aClearFilterOne");
gridLayout->addWidget(TabDeckEditor_aClearFilterOne, 2, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aClearFilterOne, 2, 1, 1, 1);
@ -523,7 +523,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aOpenCustomFolder, 2, 2, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aOpenCustomFolder, 2, 2, 1, 1);
TabDeckEditor_aOpenCustomFolder = new SequenceEdit("TabDeckEditor/aOpenCustomFolder",groupBox_2); TabDeckEditor_aOpenCustomFolder = new SequenceEdit("TabDeckEditor/aOpenCustomFolder", groupBox_2);
TabDeckEditor_aOpenCustomFolder->setObjectName("TabDeckEditor_aOpenCustomFolder"); TabDeckEditor_aOpenCustomFolder->setObjectName("TabDeckEditor_aOpenCustomFolder");
gridLayout->addWidget(TabDeckEditor_aOpenCustomFolder, 2, 3, 1, 1); gridLayout->addWidget(TabDeckEditor_aOpenCustomFolder, 2, 3, 1, 1);
@ -533,7 +533,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aClose, 3, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aClose, 3, 0, 1, 1);
TabDeckEditor_aClose = new SequenceEdit("TabDeckEditor/aClose",groupBox_2); TabDeckEditor_aClose = new SequenceEdit("TabDeckEditor/aClose", groupBox_2);
TabDeckEditor_aClose->setObjectName("TabDeckEditor_aClose"); TabDeckEditor_aClose->setObjectName("TabDeckEditor_aClose");
gridLayout->addWidget(TabDeckEditor_aClose, 3, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aClose, 3, 1, 1, 1);
@ -543,7 +543,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aPrintDeck, 3, 2, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aPrintDeck, 3, 2, 1, 1);
TabDeckEditor_aPrintDeck = new SequenceEdit("TabDeckEditor/aPrintDeck",groupBox_2); TabDeckEditor_aPrintDeck = new SequenceEdit("TabDeckEditor/aPrintDeck", groupBox_2);
TabDeckEditor_aPrintDeck->setObjectName("TabDeckEditor_aPrintDeck"); TabDeckEditor_aPrintDeck->setObjectName("TabDeckEditor_aPrintDeck");
gridLayout->addWidget(TabDeckEditor_aPrintDeck, 3, 3, 1, 1); gridLayout->addWidget(TabDeckEditor_aPrintDeck, 3, 3, 1, 1);
@ -553,7 +553,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aManageSets, 4, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aManageSets, 4, 0, 1, 1);
TabDeckEditor_aManageSets = new SequenceEdit("TabDeckEditor/aManageSets",groupBox_2); TabDeckEditor_aManageSets = new SequenceEdit("TabDeckEditor/aManageSets", groupBox_2);
TabDeckEditor_aManageSets->setObjectName("TabDeckEditor_aManageSets"); TabDeckEditor_aManageSets->setObjectName("TabDeckEditor_aManageSets");
gridLayout->addWidget(TabDeckEditor_aManageSets, 4, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aManageSets, 4, 1, 1, 1);
@ -563,7 +563,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aRemoveCard, 4, 2, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aRemoveCard, 4, 2, 1, 1);
TabDeckEditor_aRemoveCard = new SequenceEdit("TabDeckEditor/aRemoveCard",groupBox_2); TabDeckEditor_aRemoveCard = new SequenceEdit("TabDeckEditor/aRemoveCard", groupBox_2);
TabDeckEditor_aRemoveCard->setObjectName("TabDeckEditor_aRemoveCard"); TabDeckEditor_aRemoveCard->setObjectName("TabDeckEditor_aRemoveCard");
gridLayout->addWidget(TabDeckEditor_aRemoveCard, 4, 3, 1, 1); gridLayout->addWidget(TabDeckEditor_aRemoveCard, 4, 3, 1, 1);
@ -573,7 +573,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aEditTokens, 5, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aEditTokens, 5, 0, 1, 1);
TabDeckEditor_aEditTokens = new SequenceEdit("TabDeckEditor/aEditTokens",groupBox_2); TabDeckEditor_aEditTokens = new SequenceEdit("TabDeckEditor/aEditTokens", groupBox_2);
TabDeckEditor_aEditTokens->setObjectName("TabDeckEditor_aEditTokens"); TabDeckEditor_aEditTokens->setObjectName("TabDeckEditor_aEditTokens");
gridLayout->addWidget(TabDeckEditor_aEditTokens, 5, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aEditTokens, 5, 1, 1, 1);
@ -583,7 +583,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aResetLayout, 5, 2, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aResetLayout, 5, 2, 1, 1);
TabDeckEditor_aResetLayout = new SequenceEdit("TabDeckEditor/aResetLayout",groupBox_2); TabDeckEditor_aResetLayout = new SequenceEdit("TabDeckEditor/aResetLayout", groupBox_2);
TabDeckEditor_aResetLayout->setObjectName("TabDeckEditor_aResetLayout"); TabDeckEditor_aResetLayout->setObjectName("TabDeckEditor_aResetLayout");
gridLayout->addWidget(TabDeckEditor_aResetLayout, 5, 3, 1, 1); gridLayout->addWidget(TabDeckEditor_aResetLayout, 5, 3, 1, 1);
@ -593,7 +593,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aIncrement, 6, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aIncrement, 6, 0, 1, 1);
TabDeckEditor_aIncrement = new SequenceEdit("TabDeckEditor/aIncrement",groupBox_2); TabDeckEditor_aIncrement = new SequenceEdit("TabDeckEditor/aIncrement", groupBox_2);
TabDeckEditor_aIncrement->setObjectName("TabDeckEditor_aIncrement"); TabDeckEditor_aIncrement->setObjectName("TabDeckEditor_aIncrement");
gridLayout->addWidget(TabDeckEditor_aIncrement, 6, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aIncrement, 6, 1, 1, 1);
@ -603,7 +603,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aSaveDeck, 6, 2, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aSaveDeck, 6, 2, 1, 1);
TabDeckEditor_aSaveDeck = new SequenceEdit("TabDeckEditor/aSaveDeck",groupBox_2); TabDeckEditor_aSaveDeck = new SequenceEdit("TabDeckEditor/aSaveDeck", groupBox_2);
TabDeckEditor_aSaveDeck->setObjectName("TabDeckEditor_aSaveDeck"); TabDeckEditor_aSaveDeck->setObjectName("TabDeckEditor_aSaveDeck");
gridLayout->addWidget(TabDeckEditor_aSaveDeck, 6, 3, 1, 1); gridLayout->addWidget(TabDeckEditor_aSaveDeck, 6, 3, 1, 1);
@ -613,7 +613,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aDecrement, 7, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aDecrement, 7, 0, 1, 1);
TabDeckEditor_aDecrement = new SequenceEdit("TabDeckEditor/aDecrement",groupBox_2); TabDeckEditor_aDecrement = new SequenceEdit("TabDeckEditor/aDecrement", groupBox_2);
TabDeckEditor_aDecrement->setObjectName("TabDeckEditor_aDecrement"); TabDeckEditor_aDecrement->setObjectName("TabDeckEditor_aDecrement");
gridLayout->addWidget(TabDeckEditor_aDecrement, 7, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aDecrement, 7, 1, 1, 1);
@ -623,7 +623,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aSaveDeckAs, 7, 2, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aSaveDeckAs, 7, 2, 1, 1);
TabDeckEditor_aSaveDeckAs = new SequenceEdit("TabDeckEditor/aSaveDeckAs",groupBox_2); TabDeckEditor_aSaveDeckAs = new SequenceEdit("TabDeckEditor/aSaveDeckAs", groupBox_2);
TabDeckEditor_aSaveDeckAs->setObjectName("TabDeckEditor_aSaveDeckAs"); TabDeckEditor_aSaveDeckAs->setObjectName("TabDeckEditor_aSaveDeckAs");
gridLayout->addWidget(TabDeckEditor_aSaveDeckAs, 7, 3, 1, 1); gridLayout->addWidget(TabDeckEditor_aSaveDeckAs, 7, 3, 1, 1);
@ -633,7 +633,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aLoadDeck, 8, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aLoadDeck, 8, 0, 1, 1);
TabDeckEditor_aLoadDeck = new SequenceEdit("TabDeckEditor/aLoadDeck",groupBox_2); TabDeckEditor_aLoadDeck = new SequenceEdit("TabDeckEditor/aLoadDeck", groupBox_2);
TabDeckEditor_aLoadDeck->setObjectName("TabDeckEditor_aLoadDeck"); TabDeckEditor_aLoadDeck->setObjectName("TabDeckEditor_aLoadDeck");
gridLayout->addWidget(TabDeckEditor_aLoadDeck, 8, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aLoadDeck, 8, 1, 1, 1);
@ -648,7 +648,7 @@ class Ui_shortcutsTab
gridLayout->addWidget(lbl_TabDeckEditor_aSaveDeckToClipboardRaw, 9, 2, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aSaveDeckToClipboardRaw, 9, 2, 1, 1);
TabDeckEditor_aSaveDeckToClipboard = new SequenceEdit("TabDeckEditor/aSaveDeckToClipboard",groupBox_2); TabDeckEditor_aSaveDeckToClipboard = new SequenceEdit("TabDeckEditor/aSaveDeckToClipboard", groupBox_2);
TabDeckEditor_aSaveDeckToClipboard->setObjectName("TabDeckEditor_aSaveDeckToClipboard"); TabDeckEditor_aSaveDeckToClipboard->setObjectName("TabDeckEditor_aSaveDeckToClipboard");
gridLayout->addWidget(TabDeckEditor_aSaveDeckToClipboard, 8, 3, 1, 1); gridLayout->addWidget(TabDeckEditor_aSaveDeckToClipboard, 8, 3, 1, 1);
@ -664,7 +664,7 @@ class Ui_shortcutsTab
// TODO: MOVE THIS SHIT // TODO: MOVE THIS SHIT
gridLayout->addWidget(lbl_TabDeckEditor_aExportDeckDecklist, 9, 0, 1, 1); gridLayout->addWidget(lbl_TabDeckEditor_aExportDeckDecklist, 9, 0, 1, 1);
TabDeckEditor_aExportDeckDecklist = new SequenceEdit("TabDeckEditor/aExportDeckDecklist",groupBox_2); TabDeckEditor_aExportDeckDecklist = new SequenceEdit("TabDeckEditor/aExportDeckDecklist", groupBox_2);
TabDeckEditor_aExportDeckDecklist->setObjectName("TabDeckEditor_aExportDeckDecklist"); TabDeckEditor_aExportDeckDecklist->setObjectName("TabDeckEditor_aExportDeckDecklist");
gridLayout->addWidget(TabDeckEditor_aExportDeckDecklist, 9, 1, 1, 1); gridLayout->addWidget(TabDeckEditor_aExportDeckDecklist, 9, 1, 1, 1);
@ -684,7 +684,7 @@ class Ui_shortcutsTab
gridLayout_4->addWidget(lbl_abstractCounter_sSet, 0, 0, 1, 1); gridLayout_4->addWidget(lbl_abstractCounter_sSet, 0, 0, 1, 1);
abstractCounter_aSet = new SequenceEdit("Player/aSet",groupBox_4); abstractCounter_aSet = new SequenceEdit("Player/aSet", groupBox_4);
abstractCounter_aSet->setObjectName("abstractCounter_aSet"); abstractCounter_aSet->setObjectName("abstractCounter_aSet");
gridLayout_4->addWidget(abstractCounter_aSet, 0, 1, 1, 1); gridLayout_4->addWidget(abstractCounter_aSet, 0, 1, 1, 1);
@ -694,7 +694,7 @@ class Ui_shortcutsTab
gridLayout_4->addWidget(lbl_abstractCounter_aInc, 1, 0, 1, 1); gridLayout_4->addWidget(lbl_abstractCounter_aInc, 1, 0, 1, 1);
abstractCounter_Inc = new SequenceEdit("Player/aInc",groupBox_4); abstractCounter_Inc = new SequenceEdit("Player/aInc", groupBox_4);
abstractCounter_Inc->setObjectName("abstractCounter_Inc"); abstractCounter_Inc->setObjectName("abstractCounter_Inc");
gridLayout_4->addWidget(abstractCounter_Inc, 1, 1, 1, 1); gridLayout_4->addWidget(abstractCounter_Inc, 1, 1, 1, 1);
@ -704,7 +704,7 @@ class Ui_shortcutsTab
gridLayout_4->addWidget(lbl_abstractCounter_aDec, 2, 0, 1, 1); gridLayout_4->addWidget(lbl_abstractCounter_aDec, 2, 0, 1, 1);
abstractCounter_aDec = new SequenceEdit("Player/aDec",groupBox_4); abstractCounter_aDec = new SequenceEdit("Player/aDec", groupBox_4);
abstractCounter_aDec->setObjectName("abstractCounter_aDec"); abstractCounter_aDec->setObjectName("abstractCounter_aDec");
gridLayout_4->addWidget(abstractCounter_aDec, 2, 1, 1, 1); gridLayout_4->addWidget(abstractCounter_aDec, 2, 1, 1, 1);
@ -720,7 +720,7 @@ class Ui_shortcutsTab
gridLayout_6->addWidget(lbl_Player_aSCRed, 0, 0, 1, 1); gridLayout_6->addWidget(lbl_Player_aSCRed, 0, 0, 1, 1);
Player_aSCRed = new SequenceEdit("Player/aSCRed",groupBox_5); Player_aSCRed = new SequenceEdit("Player/aSCRed", groupBox_5);
Player_aSCRed->setObjectName("Player_aSCRed"); Player_aSCRed->setObjectName("Player_aSCRed");
gridLayout_6->addWidget(Player_aSCRed, 0, 1, 1, 1); gridLayout_6->addWidget(Player_aSCRed, 0, 1, 1, 1);
@ -730,7 +730,7 @@ class Ui_shortcutsTab
gridLayout_6->addWidget(lbl_Player_aCCRed, 1, 0, 1, 1); gridLayout_6->addWidget(lbl_Player_aCCRed, 1, 0, 1, 1);
Player_aCCRed = new SequenceEdit("Player/aCCRed",groupBox_5); Player_aCCRed = new SequenceEdit("Player/aCCRed", groupBox_5);
Player_aCCRed->setObjectName("Player_aCCRed"); Player_aCCRed->setObjectName("Player_aCCRed");
gridLayout_6->addWidget(Player_aCCRed, 1, 1, 1, 1); gridLayout_6->addWidget(Player_aCCRed, 1, 1, 1, 1);
@ -740,7 +740,7 @@ class Ui_shortcutsTab
gridLayout_6->addWidget(lbl_Player_aRCRed, 2, 0, 1, 1); gridLayout_6->addWidget(lbl_Player_aRCRed, 2, 0, 1, 1);
Player_aRCRed = new SequenceEdit("Player/aRCRed",groupBox_5); Player_aRCRed = new SequenceEdit("Player/aRCRed", groupBox_5);
Player_aRCRed->setObjectName("Player_aRCRed"); Player_aRCRed->setObjectName("Player_aRCRed");
gridLayout_6->addWidget(Player_aRCRed, 2, 1, 1, 1); gridLayout_6->addWidget(Player_aRCRed, 2, 1, 1, 1);
@ -756,7 +756,7 @@ class Ui_shortcutsTab
gridLayout_7->addWidget(lbl_Player_aSCGreen, 0, 0, 1, 1); gridLayout_7->addWidget(lbl_Player_aSCGreen, 0, 0, 1, 1);
Player_aSCGreen = new SequenceEdit("Player/aSCGreen",groupBox_6); Player_aSCGreen = new SequenceEdit("Player/aSCGreen", groupBox_6);
Player_aSCGreen->setObjectName("Player_aSCGreen"); Player_aSCGreen->setObjectName("Player_aSCGreen");
gridLayout_7->addWidget(Player_aSCGreen, 0, 1, 1, 1); gridLayout_7->addWidget(Player_aSCGreen, 0, 1, 1, 1);
@ -766,7 +766,7 @@ class Ui_shortcutsTab
gridLayout_7->addWidget(lbl_Player_aCCGreen, 1, 0, 1, 1); gridLayout_7->addWidget(lbl_Player_aCCGreen, 1, 0, 1, 1);
Player_aCCGreen = new SequenceEdit("Player/aCCGreen",groupBox_6); Player_aCCGreen = new SequenceEdit("Player/aCCGreen", groupBox_6);
Player_aCCGreen->setObjectName("Player_aCCGreen"); Player_aCCGreen->setObjectName("Player_aCCGreen");
gridLayout_7->addWidget(Player_aCCGreen, 1, 1, 1, 1); gridLayout_7->addWidget(Player_aCCGreen, 1, 1, 1, 1);
@ -776,7 +776,7 @@ class Ui_shortcutsTab
gridLayout_7->addWidget(lbl_Player_aRCGreen, 2, 0, 1, 1); gridLayout_7->addWidget(lbl_Player_aRCGreen, 2, 0, 1, 1);
Player_aRCGreen = new SequenceEdit("Player/aRCGreen",groupBox_6); Player_aRCGreen = new SequenceEdit("Player/aRCGreen", groupBox_6);
Player_aRCGreen->setObjectName("Player_aRCGreen"); Player_aRCGreen->setObjectName("Player_aRCGreen");
gridLayout_7->addWidget(Player_aRCGreen, 2, 1, 1, 1); gridLayout_7->addWidget(Player_aRCGreen, 2, 1, 1, 1);
@ -792,7 +792,7 @@ class Ui_shortcutsTab
gridLayout_8->addWidget(lbl_Player_aSCYellow, 0, 0, 1, 1); gridLayout_8->addWidget(lbl_Player_aSCYellow, 0, 0, 1, 1);
Player_aSCYellow = new SequenceEdit("Player/aSCYellow",groupBox_7); Player_aSCYellow = new SequenceEdit("Player/aSCYellow", groupBox_7);
Player_aSCYellow->setObjectName("Player_aSCYellow"); Player_aSCYellow->setObjectName("Player_aSCYellow");
gridLayout_8->addWidget(Player_aSCYellow, 0, 1, 1, 1); gridLayout_8->addWidget(Player_aSCYellow, 0, 1, 1, 1);
@ -802,7 +802,7 @@ class Ui_shortcutsTab
gridLayout_8->addWidget(lbl_Player_aCCYellow, 1, 0, 1, 1); gridLayout_8->addWidget(lbl_Player_aCCYellow, 1, 0, 1, 1);
Player_aCCYellow = new SequenceEdit("Player/aCCYellow",groupBox_7); Player_aCCYellow = new SequenceEdit("Player/aCCYellow", groupBox_7);
Player_aCCYellow->setObjectName("Player_aCCYellow"); Player_aCCYellow->setObjectName("Player_aCCYellow");
gridLayout_8->addWidget(Player_aCCYellow, 1, 1, 1, 1); gridLayout_8->addWidget(Player_aCCYellow, 1, 1, 1, 1);
@ -812,7 +812,7 @@ class Ui_shortcutsTab
gridLayout_8->addWidget(lbl_Player_aRCYellow, 2, 0, 1, 1); gridLayout_8->addWidget(lbl_Player_aRCYellow, 2, 0, 1, 1);
Player_aRCYellow = new SequenceEdit("Player/aRCYellow",groupBox_7); Player_aRCYellow = new SequenceEdit("Player/aRCYellow", groupBox_7);
Player_aRCYellow->setObjectName("Player_aRCYellow"); Player_aRCYellow->setObjectName("Player_aRCYellow");
gridLayout_8->addWidget(Player_aRCYellow, 2, 1, 1, 1); gridLayout_8->addWidget(Player_aRCYellow, 2, 1, 1, 1);
@ -1025,12 +1025,12 @@ class Ui_shortcutsTab
groupBox_12->setObjectName("groupBox_12"); groupBox_12->setObjectName("groupBox_12");
gridLayout_12 = new QGridLayout(groupBox_12); gridLayout_12 = new QGridLayout(groupBox_12);
gridLayout_12->setObjectName("gridLayout_12"); gridLayout_12->setObjectName("gridLayout_12");
Player_aDecPT = new SequenceEdit("Player/aDecPT",groupBox_12); Player_aDecPT = new SequenceEdit("Player/aDecPT", groupBox_12);
Player_aDecPT->setObjectName("Player_aDecPT"); Player_aDecPT->setObjectName("Player_aDecPT");
gridLayout_12->addWidget(Player_aDecPT, 2, 1, 1, 1); gridLayout_12->addWidget(Player_aDecPT, 2, 1, 1, 1);
Player_aIncPT = new SequenceEdit("Player/aIncPT",groupBox_12); Player_aIncPT = new SequenceEdit("Player/aIncPT", groupBox_12);
Player_aIncPT->setObjectName("Player_aIncPT"); Player_aIncPT->setObjectName("Player_aIncPT");
gridLayout_12->addWidget(Player_aIncPT, 1, 1, 1, 1); gridLayout_12->addWidget(Player_aIncPT, 1, 1, 1, 1);
@ -1045,7 +1045,7 @@ class Ui_shortcutsTab
gridLayout_12->addWidget(lbl_Player_aDecPT, 2, 0, 1, 1); gridLayout_12->addWidget(lbl_Player_aDecPT, 2, 0, 1, 1);
Player_aSetPT = new SequenceEdit("Player/aSetPT",groupBox_12); Player_aSetPT = new SequenceEdit("Player/aSetPT", groupBox_12);
Player_aSetPT->setObjectName("Player_aSetPT"); Player_aSetPT->setObjectName("Player_aSetPT");
gridLayout_12->addWidget(Player_aSetPT, 0, 1, 1, 1); gridLayout_12->addWidget(Player_aSetPT, 0, 1, 1, 1);
@ -1066,7 +1066,7 @@ class Ui_shortcutsTab
gridLayout_11->addWidget(lbl_Player_aDecT, 1, 0, 1, 1); gridLayout_11->addWidget(lbl_Player_aDecT, 1, 0, 1, 1);
Player_aDecT = new SequenceEdit("Player/aDecT",groupBox_11); Player_aDecT = new SequenceEdit("Player/aDecT", groupBox_11);
Player_aDecT->setObjectName("Player_aDecT"); Player_aDecT->setObjectName("Player_aDecT");
gridLayout_11->addWidget(Player_aDecT, 1, 1, 1, 1); gridLayout_11->addWidget(Player_aDecT, 1, 1, 1, 1);
@ -1076,7 +1076,7 @@ class Ui_shortcutsTab
gridLayout_11->addWidget(lbl_Player_aIncT, 0, 0, 1, 1); gridLayout_11->addWidget(lbl_Player_aIncT, 0, 0, 1, 1);
Player_aIncT = new SequenceEdit("Player/aIncT",groupBox_11); Player_aIncT = new SequenceEdit("Player/aIncT", groupBox_11);
Player_aIncT->setObjectName("Player_aIncT"); Player_aIncT->setObjectName("Player_aIncT");
gridLayout_11->addWidget(Player_aIncT, 0, 1, 1, 1); gridLayout_11->addWidget(Player_aIncT, 0, 1, 1, 1);
@ -1092,12 +1092,12 @@ class Ui_shortcutsTab
gridLayout_10->addWidget(lbl_Player_aDecP, 1, 0, 1, 1); gridLayout_10->addWidget(lbl_Player_aDecP, 1, 0, 1, 1);
Player_aDecP = new SequenceEdit("Player/aDecP",groupBox_10); Player_aDecP = new SequenceEdit("Player/aDecP", groupBox_10);
Player_aDecP->setObjectName("Player_aDecP"); Player_aDecP->setObjectName("Player_aDecP");
gridLayout_10->addWidget(Player_aDecP, 1, 1, 1, 1); gridLayout_10->addWidget(Player_aDecP, 1, 1, 1, 1);
Player_IncP = new SequenceEdit("Player/IncP",groupBox_10); Player_IncP = new SequenceEdit("Player/IncP", groupBox_10);
Player_IncP->setObjectName("Player_IncP"); Player_IncP->setObjectName("Player_IncP");
gridLayout_10->addWidget(Player_IncP, 0, 1, 1, 1); gridLayout_10->addWidget(Player_IncP, 0, 1, 1, 1);
@ -1120,7 +1120,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase0, 0, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase0, 0, 0, 1, 1);
TabGame_phase0 = new SequenceEdit("Player/phase0",groupBox_8); TabGame_phase0 = new SequenceEdit("Player/phase0", groupBox_8);
TabGame_phase0->setObjectName("TabGame_phase0"); TabGame_phase0->setObjectName("TabGame_phase0");
gridLayout_5->addWidget(TabGame_phase0, 0, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase0, 0, 1, 1, 1);
@ -1130,7 +1130,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase1, 1, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase1, 1, 0, 1, 1);
TabGame_phase1 = new SequenceEdit("Player/phase1",groupBox_8); TabGame_phase1 = new SequenceEdit("Player/phase1", groupBox_8);
TabGame_phase1->setObjectName("TabGame_phase1"); TabGame_phase1->setObjectName("TabGame_phase1");
gridLayout_5->addWidget(TabGame_phase1, 1, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase1, 1, 1, 1, 1);
@ -1140,7 +1140,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase2, 2, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase2, 2, 0, 1, 1);
TabGame_phase2 = new SequenceEdit("Player/phase2",groupBox_8); TabGame_phase2 = new SequenceEdit("Player/phase2", groupBox_8);
TabGame_phase2->setObjectName("TabGame_phase2"); TabGame_phase2->setObjectName("TabGame_phase2");
gridLayout_5->addWidget(TabGame_phase2, 2, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase2, 2, 1, 1, 1);
@ -1150,7 +1150,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase3, 3, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase3, 3, 0, 1, 1);
TabGame_phase3 = new SequenceEdit("Player/phase3",groupBox_8); TabGame_phase3 = new SequenceEdit("Player/phase3", groupBox_8);
TabGame_phase3->setObjectName("TabGame_phase3"); TabGame_phase3->setObjectName("TabGame_phase3");
gridLayout_5->addWidget(TabGame_phase3, 3, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase3, 3, 1, 1, 1);
@ -1160,7 +1160,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase4, 4, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase4, 4, 0, 1, 1);
TabGame_phase4 = new SequenceEdit("Player/phase4",groupBox_8); TabGame_phase4 = new SequenceEdit("Player/phase4", groupBox_8);
TabGame_phase4->setObjectName("TabGame_phase4"); TabGame_phase4->setObjectName("TabGame_phase4");
gridLayout_5->addWidget(TabGame_phase4, 4, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase4, 4, 1, 1, 1);
@ -1170,7 +1170,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase5, 5, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase5, 5, 0, 1, 1);
TabGame_phase5 = new SequenceEdit("Player/phase5",groupBox_8); TabGame_phase5 = new SequenceEdit("Player/phase5", groupBox_8);
TabGame_phase5->setObjectName("TabGame_phase5"); TabGame_phase5->setObjectName("TabGame_phase5");
gridLayout_5->addWidget(TabGame_phase5, 5, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase5, 5, 1, 1, 1);
@ -1185,7 +1185,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase7, 7, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase7, 7, 0, 1, 1);
TabGame_phase6 = new SequenceEdit("Player/phase6",groupBox_8); TabGame_phase6 = new SequenceEdit("Player/phase6", groupBox_8);
TabGame_phase6->setObjectName("TabGame_phase6"); TabGame_phase6->setObjectName("TabGame_phase6");
gridLayout_5->addWidget(TabGame_phase6, 6, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase6, 6, 1, 1, 1);
@ -1195,7 +1195,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase8, 8, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase8, 8, 0, 1, 1);
TabGame_phase7 = new SequenceEdit("Player/phase7",groupBox_8); TabGame_phase7 = new SequenceEdit("Player/phase7", groupBox_8);
TabGame_phase7->setObjectName("TabGame_phase7"); TabGame_phase7->setObjectName("TabGame_phase7");
gridLayout_5->addWidget(TabGame_phase7, 7, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase7, 7, 1, 1, 1);
@ -1205,7 +1205,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase9, 9, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase9, 9, 0, 1, 1);
TabGame_phase8 = new SequenceEdit("Player/phase8",groupBox_8); TabGame_phase8 = new SequenceEdit("Player/phase8", groupBox_8);
TabGame_phase8->setObjectName("TabGame_phase8"); TabGame_phase8->setObjectName("TabGame_phase8");
gridLayout_5->addWidget(TabGame_phase8, 8, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase8, 8, 1, 1, 1);
@ -1215,7 +1215,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_phase10, 10, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_phase10, 10, 0, 1, 1);
TabGame_phase9 = new SequenceEdit("Player/phase9",groupBox_8); TabGame_phase9 = new SequenceEdit("Player/phase9", groupBox_8);
TabGame_phase9->setObjectName("TabGame_phase9"); TabGame_phase9->setObjectName("TabGame_phase9");
gridLayout_5->addWidget(TabGame_phase9, 9, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase9, 9, 1, 1, 1);
@ -1225,7 +1225,7 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_aNextPhase, 11, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_aNextPhase, 11, 0, 1, 1);
TabGame_phase10 = new SequenceEdit("Player/phase10",groupBox_8); TabGame_phase10 = new SequenceEdit("Player/phase10", groupBox_8);
TabGame_phase10->setObjectName("TabGame_phase10"); TabGame_phase10->setObjectName("TabGame_phase10");
gridLayout_5->addWidget(TabGame_phase10, 10, 1, 1, 1); gridLayout_5->addWidget(TabGame_phase10, 10, 1, 1, 1);
@ -1235,12 +1235,12 @@ class Ui_shortcutsTab
gridLayout_5->addWidget(lbl_TabGame_aNextTurn, 12, 0, 1, 1); gridLayout_5->addWidget(lbl_TabGame_aNextTurn, 12, 0, 1, 1);
TabGame_aNextPhase = new SequenceEdit("Player/aNextPhase",groupBox_8); TabGame_aNextPhase = new SequenceEdit("Player/aNextPhase", groupBox_8);
TabGame_aNextPhase->setObjectName("TabGame_aNextPhase"); TabGame_aNextPhase->setObjectName("TabGame_aNextPhase");
gridLayout_5->addWidget(TabGame_aNextPhase, 11, 1, 1, 1); gridLayout_5->addWidget(TabGame_aNextPhase, 11, 1, 1, 1);
TabGame_aNextTurn = new SequenceEdit("Player/aNextTurn",groupBox_8); TabGame_aNextTurn = new SequenceEdit("Player/aNextTurn", groupBox_8);
TabGame_aNextTurn->setObjectName("TabGame_aNextTurn"); TabGame_aNextTurn->setObjectName("TabGame_aNextTurn");
gridLayout_5->addWidget(TabGame_aNextTurn, 12, 1, 1, 1); gridLayout_5->addWidget(TabGame_aNextTurn, 12, 1, 1, 1);
@ -1256,7 +1256,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aTap, 0, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aTap, 0, 0, 1, 1);
Player_aTap = new SequenceEdit("Player/aTap",groupBox_13); Player_aTap = new SequenceEdit("Player/aTap", groupBox_13);
Player_aTap->setObjectName("Player_aTap"); Player_aTap->setObjectName("Player_aTap");
gridLayout_13->addWidget(Player_aTap, 0, 1, 1, 1); gridLayout_13->addWidget(Player_aTap, 0, 1, 1, 1);
@ -1266,7 +1266,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aUntapAll, 2, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aUntapAll, 2, 0, 1, 1);
Player_aUntapAll = new SequenceEdit("Player/aUntapAll",groupBox_13); Player_aUntapAll = new SequenceEdit("Player/aUntapAll", groupBox_13);
Player_aUntapAll->setObjectName("Player_aUntapAll"); Player_aUntapAll->setObjectName("Player_aUntapAll");
gridLayout_13->addWidget(Player_aUntapAll, 2, 1, 1, 1); gridLayout_13->addWidget(Player_aUntapAll, 2, 1, 1, 1);
@ -1276,7 +1276,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aDoesntUntap, 3, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aDoesntUntap, 3, 0, 1, 1);
Player_aDoesntUntap = new SequenceEdit("Player/aDoesntUntap",groupBox_13); Player_aDoesntUntap = new SequenceEdit("Player/aDoesntUntap", groupBox_13);
Player_aDoesntUntap->setObjectName("Player_aDoesntUntap"); Player_aDoesntUntap->setObjectName("Player_aDoesntUntap");
gridLayout_13->addWidget(Player_aDoesntUntap, 3, 1, 1, 1); gridLayout_13->addWidget(Player_aDoesntUntap, 3, 1, 1, 1);
@ -1286,7 +1286,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aFlip, 4, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aFlip, 4, 0, 1, 1);
Player_aFlip = new SequenceEdit("Player/aFlip",groupBox_13); Player_aFlip = new SequenceEdit("Player/aFlip", groupBox_13);
Player_aFlip->setObjectName("Player_aFlip"); Player_aFlip->setObjectName("Player_aFlip");
gridLayout_13->addWidget(Player_aFlip, 4, 1, 1, 1); gridLayout_13->addWidget(Player_aFlip, 4, 1, 1, 1);
@ -1296,7 +1296,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aPeek, 5, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aPeek, 5, 0, 1, 1);
Player_aPeek = new SequenceEdit("Player/aPeek",groupBox_13); Player_aPeek = new SequenceEdit("Player/aPeek", groupBox_13);
Player_aPeek->setObjectName("Player_aPeek"); Player_aPeek->setObjectName("Player_aPeek");
gridLayout_13->addWidget(Player_aPeek, 5, 1, 1, 1); gridLayout_13->addWidget(Player_aPeek, 5, 1, 1, 1);
@ -1306,7 +1306,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aPlay, 6, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aPlay, 6, 0, 1, 1);
Player_aPlay = new SequenceEdit("Player/aPlay",groupBox_13); Player_aPlay = new SequenceEdit("Player/aPlay", groupBox_13);
Player_aPlay->setObjectName("Player_aPlay"); Player_aPlay->setObjectName("Player_aPlay");
gridLayout_13->addWidget(Player_aPlay, 6, 1, 1, 1); gridLayout_13->addWidget(Player_aPlay, 6, 1, 1, 1);
@ -1316,7 +1316,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aAttach, 7, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aAttach, 7, 0, 1, 1);
Player_aAttach = new SequenceEdit("Player/aAttach",groupBox_13); Player_aAttach = new SequenceEdit("Player/aAttach", groupBox_13);
Player_aAttach->setObjectName("Player_aAttach"); Player_aAttach->setObjectName("Player_aAttach");
gridLayout_13->addWidget(Player_aAttach, 7, 1, 1, 1); gridLayout_13->addWidget(Player_aAttach, 7, 1, 1, 1);
@ -1326,7 +1326,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aUnattach, 8, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aUnattach, 8, 0, 1, 1);
Player_aUnattach = new SequenceEdit("Player/aUnattach",groupBox_13); Player_aUnattach = new SequenceEdit("Player/aUnattach", groupBox_13);
Player_aUnattach->setObjectName("Player_aUnattach"); Player_aUnattach->setObjectName("Player_aUnattach");
gridLayout_13->addWidget(Player_aUnattach, 8, 1, 1, 1); gridLayout_13->addWidget(Player_aUnattach, 8, 1, 1, 1);
@ -1336,7 +1336,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aClone, 9, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aClone, 9, 0, 1, 1);
Player_aClone = new SequenceEdit("Player/aClone",groupBox_13); Player_aClone = new SequenceEdit("Player/aClone", groupBox_13);
Player_aClone->setObjectName("Player_aClone"); Player_aClone->setObjectName("Player_aClone");
gridLayout_13->addWidget(Player_aClone, 9, 1, 1, 1); gridLayout_13->addWidget(Player_aClone, 9, 1, 1, 1);
@ -1346,7 +1346,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aCreateToken, 10, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aCreateToken, 10, 0, 1, 1);
Player_aCreateToken = new SequenceEdit("Player/aCreateToken",groupBox_13); Player_aCreateToken = new SequenceEdit("Player/aCreateToken", groupBox_13);
Player_aCreateToken->setObjectName("Player_aCreateToken"); Player_aCreateToken->setObjectName("Player_aCreateToken");
gridLayout_13->addWidget(Player_aCreateToken, 10, 1, 1, 1); gridLayout_13->addWidget(Player_aCreateToken, 10, 1, 1, 1);
@ -1356,7 +1356,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aCreateRelatedTokens, 11, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aCreateRelatedTokens, 11, 0, 1, 1);
Player_aCreateRelatedTokens = new SequenceEdit("Player/aCreateRelatedTokens",groupBox_13); Player_aCreateRelatedTokens = new SequenceEdit("Player/aCreateRelatedTokens", groupBox_13);
Player_aCreateRelatedTokens->setObjectName("Player_aCreateRelatedTokens"); Player_aCreateRelatedTokens->setObjectName("Player_aCreateRelatedTokens");
gridLayout_13->addWidget(Player_aCreateRelatedTokens, 11, 1, 1, 1); gridLayout_13->addWidget(Player_aCreateRelatedTokens, 11, 1, 1, 1);
@ -1366,7 +1366,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aCreateAnotherToken, 12, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aCreateAnotherToken, 12, 0, 1, 1);
Player_aCreateAnotherToken = new SequenceEdit("Player/aCreateAnotherToken",groupBox_13); Player_aCreateAnotherToken = new SequenceEdit("Player/aCreateAnotherToken", groupBox_13);
Player_aCreateAnotherToken->setObjectName("Player_aCreateAnotherToken"); Player_aCreateAnotherToken->setObjectName("Player_aCreateAnotherToken");
gridLayout_13->addWidget(Player_aCreateAnotherToken, 12, 1, 1, 1); gridLayout_13->addWidget(Player_aCreateAnotherToken, 12, 1, 1, 1);
@ -1376,7 +1376,7 @@ class Ui_shortcutsTab
gridLayout_13->addWidget(lbl_Player_aSetAnnotation, 13, 0, 1, 1); gridLayout_13->addWidget(lbl_Player_aSetAnnotation, 13, 0, 1, 1);
Player_aSetAnnotation = new SequenceEdit("Player/aSetAnnotation",groupBox_13); Player_aSetAnnotation = new SequenceEdit("Player/aSetAnnotation", groupBox_13);
Player_aSetAnnotation->setObjectName("Player_aSetAnnotation"); Player_aSetAnnotation->setObjectName("Player_aSetAnnotation");
gridLayout_13->addWidget(Player_aSetAnnotation, 13, 1, 1, 1); gridLayout_13->addWidget(Player_aSetAnnotation, 13, 1, 1, 1);
@ -1401,7 +1401,7 @@ class Ui_shortcutsTab
gridLayout_15->addWidget(lbl_Player_aMoveToBottomLibrary, 0, 0, 1, 1); gridLayout_15->addWidget(lbl_Player_aMoveToBottomLibrary, 0, 0, 1, 1);
Player_aMoveToBottomLibrary = new SequenceEdit("Player/aMoveToBottomLibrary",groupBox_15); Player_aMoveToBottomLibrary = new SequenceEdit("Player/aMoveToBottomLibrary", groupBox_15);
Player_aMoveToBottomLibrary->setObjectName("Player_aMoveToBottomLibrary"); Player_aMoveToBottomLibrary->setObjectName("Player_aMoveToBottomLibrary");
gridLayout_15->addWidget(Player_aMoveToBottomLibrary, 0, 1, 1, 1); gridLayout_15->addWidget(Player_aMoveToBottomLibrary, 0, 1, 1, 1);
@ -1411,7 +1411,7 @@ class Ui_shortcutsTab
gridLayout_15->addWidget(lbl_Player_aMoveToTopLibrary, 1, 0, 1, 1); gridLayout_15->addWidget(lbl_Player_aMoveToTopLibrary, 1, 0, 1, 1);
Player_aMoveToTopLibrary = new SequenceEdit("Player/aMoveToTopLibrary",groupBox_15); Player_aMoveToTopLibrary = new SequenceEdit("Player/aMoveToTopLibrary", groupBox_15);
Player_aMoveToTopLibrary->setObjectName("Player_aMoveToTopLibrary"); Player_aMoveToTopLibrary->setObjectName("Player_aMoveToTopLibrary");
gridLayout_15->addWidget(Player_aMoveToTopLibrary, 1, 1, 1, 1); gridLayout_15->addWidget(Player_aMoveToTopLibrary, 1, 1, 1, 1);
@ -1421,7 +1421,7 @@ class Ui_shortcutsTab
gridLayout_15->addWidget(lbl_Player_aMoveToGraveyard, 2, 0, 1, 1); gridLayout_15->addWidget(lbl_Player_aMoveToGraveyard, 2, 0, 1, 1);
Player_aMoveToGraveyard = new SequenceEdit("Player/aMoveToGraveyard",groupBox_15); Player_aMoveToGraveyard = new SequenceEdit("Player/aMoveToGraveyard", groupBox_15);
Player_aMoveToGraveyard->setObjectName("Player_aMoveToGraveyard"); Player_aMoveToGraveyard->setObjectName("Player_aMoveToGraveyard");
gridLayout_15->addWidget(Player_aMoveToGraveyard, 2, 1, 1, 1); gridLayout_15->addWidget(Player_aMoveToGraveyard, 2, 1, 1, 1);
@ -1431,7 +1431,7 @@ class Ui_shortcutsTab
gridLayout_15->addWidget(lbl_Player_aMoveToExile, 3, 0, 1, 1); gridLayout_15->addWidget(lbl_Player_aMoveToExile, 3, 0, 1, 1);
Player_aMoveToExile = new SequenceEdit("Player/aMoveToExile",groupBox_15); Player_aMoveToExile = new SequenceEdit("Player/aMoveToExile", groupBox_15);
Player_aMoveToExile->setObjectName("Player_aMoveToExile"); Player_aMoveToExile->setObjectName("Player_aMoveToExile");
gridLayout_15->addWidget(Player_aMoveToExile, 3, 1, 1, 1); gridLayout_15->addWidget(Player_aMoveToExile, 3, 1, 1, 1);
@ -1441,7 +1441,7 @@ class Ui_shortcutsTab
gridLayout_15->addWidget(lbl_Player_aMoveToHand, 4, 0, 1, 1); gridLayout_15->addWidget(lbl_Player_aMoveToHand, 4, 0, 1, 1);
Player_aMoveToHand = new SequenceEdit("Player/aMoveToHand",groupBox_15); Player_aMoveToHand = new SequenceEdit("Player/aMoveToHand", groupBox_15);
Player_aMoveToHand->setObjectName("Player_aMoveToHand"); Player_aMoveToHand->setObjectName("Player_aMoveToHand");
gridLayout_15->addWidget(Player_aMoveToHand, 4, 1, 1, 1); gridLayout_15->addWidget(Player_aMoveToHand, 4, 1, 1, 1);
@ -1457,7 +1457,7 @@ class Ui_shortcutsTab
gridLayout_16->addWidget(lbl_Player_aViewGraveyard, 0, 0, 1, 1); gridLayout_16->addWidget(lbl_Player_aViewGraveyard, 0, 0, 1, 1);
Player_aViewGraveyard = new SequenceEdit("Player/aViewGraveyard",groupBox_16); Player_aViewGraveyard = new SequenceEdit("Player/aViewGraveyard", groupBox_16);
Player_aViewGraveyard->setObjectName("Player_aViewGraveyard"); Player_aViewGraveyard->setObjectName("Player_aViewGraveyard");
gridLayout_16->addWidget(Player_aViewGraveyard, 0, 1, 1, 1); gridLayout_16->addWidget(Player_aViewGraveyard, 0, 1, 1, 1);
@ -1467,7 +1467,7 @@ class Ui_shortcutsTab
gridLayout_16->addWidget(lbl_Player_aViewLibrary, 1, 0, 1, 1); gridLayout_16->addWidget(lbl_Player_aViewLibrary, 1, 0, 1, 1);
Player_aViewLibrary = new SequenceEdit("Player/aViewLibrary",groupBox_16); Player_aViewLibrary = new SequenceEdit("Player/aViewLibrary", groupBox_16);
Player_aViewLibrary->setObjectName("Player_aViewLibrary"); Player_aViewLibrary->setObjectName("Player_aViewLibrary");
gridLayout_16->addWidget(Player_aViewLibrary, 1, 1, 1, 1); gridLayout_16->addWidget(Player_aViewLibrary, 1, 1, 1, 1);
@ -1477,7 +1477,7 @@ class Ui_shortcutsTab
gridLayout_16->addWidget(lbl_Player_aViewTopCards, 2, 0, 1, 1); gridLayout_16->addWidget(lbl_Player_aViewTopCards, 2, 0, 1, 1);
Player_aViewTopCards = new SequenceEdit("Player/aViewTopCards",groupBox_16); Player_aViewTopCards = new SequenceEdit("Player/aViewTopCards", groupBox_16);
Player_aViewTopCards->setObjectName("Player_aViewTopCards"); Player_aViewTopCards->setObjectName("Player_aViewTopCards");
gridLayout_16->addWidget(Player_aViewTopCards, 2, 1, 1, 1); gridLayout_16->addWidget(Player_aViewTopCards, 2, 1, 1, 1);
@ -1487,7 +1487,7 @@ class Ui_shortcutsTab
gridLayout_16->addWidget(lbl_Player_aViewSideboard, 3, 0, 1, 1); gridLayout_16->addWidget(lbl_Player_aViewSideboard, 3, 0, 1, 1);
Player_aViewSideboard = new SequenceEdit("Player/aViewSideboard",groupBox_16); Player_aViewSideboard = new SequenceEdit("Player/aViewSideboard", groupBox_16);
Player_aViewSideboard->setObjectName("Player_aViewSideboard"); Player_aViewSideboard->setObjectName("Player_aViewSideboard");
gridLayout_16->addWidget(Player_aViewSideboard, 3, 1, 1, 1); gridLayout_16->addWidget(Player_aViewSideboard, 3, 1, 1, 1);
@ -1497,7 +1497,7 @@ class Ui_shortcutsTab
gridLayout_16->addWidget(lbl_Player_aViewRfg, 4, 0, 1, 1); gridLayout_16->addWidget(lbl_Player_aViewRfg, 4, 0, 1, 1);
Player_aViewRfg = new SequenceEdit("Player/aViewRfg",groupBox_16); Player_aViewRfg = new SequenceEdit("Player/aViewRfg", groupBox_16);
Player_aViewRfg->setObjectName("Player_aViewRfg"); Player_aViewRfg->setObjectName("Player_aViewRfg");
gridLayout_16->addWidget(Player_aViewRfg, 4, 1, 1, 1); gridLayout_16->addWidget(Player_aViewRfg, 4, 1, 1, 1);
@ -1507,7 +1507,7 @@ class Ui_shortcutsTab
gridLayout_16->addWidget(lbl_GameView_aCloseMostRecentZoneView, 5, 0, 1, 1); gridLayout_16->addWidget(lbl_GameView_aCloseMostRecentZoneView, 5, 0, 1, 1);
GameView_aCloseMostRecentZoneView = new SequenceEdit("Player/aCloseMostRecentZoneView",groupBox_16); GameView_aCloseMostRecentZoneView = new SequenceEdit("Player/aCloseMostRecentZoneView", groupBox_16);
GameView_aCloseMostRecentZoneView->setObjectName("GameView_aCloseMostRecentZoneView"); GameView_aCloseMostRecentZoneView->setObjectName("GameView_aCloseMostRecentZoneView");
gridLayout_16->addWidget(GameView_aCloseMostRecentZoneView, 5, 1, 1, 1); gridLayout_16->addWidget(GameView_aCloseMostRecentZoneView, 5, 1, 1, 1);
@ -1518,12 +1518,12 @@ class Ui_shortcutsTab
groupBox_17->setObjectName("groupBox_17"); groupBox_17->setObjectName("groupBox_17");
gridLayout_18 = new QGridLayout(groupBox_17); gridLayout_18 = new QGridLayout(groupBox_17);
gridLayout_18->setObjectName("gridLayout_18"); gridLayout_18->setObjectName("gridLayout_18");
DeckViewContainer_loadRemoteButton = new SequenceEdit("DeckViewContainer/loadRemoteButton",groupBox_17); DeckViewContainer_loadRemoteButton = new SequenceEdit("DeckViewContainer/loadRemoteButton", groupBox_17);
DeckViewContainer_loadRemoteButton->setObjectName("DeckViewContainer_loadRemoteButton"); DeckViewContainer_loadRemoteButton->setObjectName("DeckViewContainer_loadRemoteButton");
gridLayout_18->addWidget(DeckViewContainer_loadRemoteButton, 2, 1, 1, 1); gridLayout_18->addWidget(DeckViewContainer_loadRemoteButton, 2, 1, 1, 1);
DeckViewContainer_loadLocalButton = new SequenceEdit("DeckViewContainer/loadLocalButton",groupBox_17); DeckViewContainer_loadLocalButton = new SequenceEdit("DeckViewContainer/loadLocalButton", groupBox_17);
DeckViewContainer_loadLocalButton->setObjectName("DeckViewContainer_loadLocalButton"); DeckViewContainer_loadLocalButton->setObjectName("DeckViewContainer_loadLocalButton");
gridLayout_18->addWidget(DeckViewContainer_loadLocalButton, 0, 1, 1, 1); gridLayout_18->addWidget(DeckViewContainer_loadLocalButton, 0, 1, 1, 1);
@ -1549,7 +1549,7 @@ class Ui_shortcutsTab
gridLayout_19->addWidget(lbl_Player_aDrawArrow, 0, 0, 1, 1); gridLayout_19->addWidget(lbl_Player_aDrawArrow, 0, 0, 1, 1);
Player_aDrawArrow = new SequenceEdit("Player/aDrawArrow",groupBox_18); Player_aDrawArrow = new SequenceEdit("Player/aDrawArrow", groupBox_18);
Player_aDrawArrow->setObjectName("Player_aDrawArrow"); Player_aDrawArrow->setObjectName("Player_aDrawArrow");
gridLayout_19->addWidget(Player_aDrawArrow, 0, 1, 1, 1); gridLayout_19->addWidget(Player_aDrawArrow, 0, 1, 1, 1);
@ -1559,7 +1559,7 @@ class Ui_shortcutsTab
gridLayout_19->addWidget(lbl_TabGame_aLeaveGame, 0, 2, 1, 1); gridLayout_19->addWidget(lbl_TabGame_aLeaveGame, 0, 2, 1, 1);
TabGame_aLeaveGame = new SequenceEdit("Player/aLeaveGame",groupBox_18); TabGame_aLeaveGame = new SequenceEdit("Player/aLeaveGame", groupBox_18);
TabGame_aLeaveGame->setObjectName("TabGame_aLeaveGame"); TabGame_aLeaveGame->setObjectName("TabGame_aLeaveGame");
gridLayout_19->addWidget(TabGame_aLeaveGame, 0, 3, 1, 1); gridLayout_19->addWidget(TabGame_aLeaveGame, 0, 3, 1, 1);
@ -1569,7 +1569,7 @@ class Ui_shortcutsTab
gridLayout_19->addWidget(lbl_TabGame_aRemoveLocalArrows, 1, 0, 1, 1); gridLayout_19->addWidget(lbl_TabGame_aRemoveLocalArrows, 1, 0, 1, 1);
TabGame_aRemoveLocalArrows = new SequenceEdit("Player/aRemoveLocalArrows",groupBox_18); TabGame_aRemoveLocalArrows = new SequenceEdit("Player/aRemoveLocalArrows", groupBox_18);
TabGame_aRemoveLocalArrows->setObjectName("TabGame_aRemoveLocalArrows"); TabGame_aRemoveLocalArrows->setObjectName("TabGame_aRemoveLocalArrows");
gridLayout_19->addWidget(TabGame_aRemoveLocalArrows, 1, 1, 1, 1); gridLayout_19->addWidget(TabGame_aRemoveLocalArrows, 1, 1, 1, 1);
@ -1579,7 +1579,7 @@ class Ui_shortcutsTab
gridLayout_19->addWidget(lbl_TabGame_aConcede, 1, 2, 1, 1); gridLayout_19->addWidget(lbl_TabGame_aConcede, 1, 2, 1, 1);
TabGame_aConcede = new SequenceEdit("Player/aConcede",groupBox_18); TabGame_aConcede = new SequenceEdit("Player/aConcede", groupBox_18);
TabGame_aConcede->setObjectName("TabGame_aConcede"); TabGame_aConcede->setObjectName("TabGame_aConcede");
gridLayout_19->addWidget(TabGame_aConcede, 1, 3, 1, 1); gridLayout_19->addWidget(TabGame_aConcede, 1, 3, 1, 1);
@ -1589,7 +1589,7 @@ class Ui_shortcutsTab
gridLayout_19->addWidget(lbl_Player_aRollDie, 2, 0, 1, 1); gridLayout_19->addWidget(lbl_Player_aRollDie, 2, 0, 1, 1);
Player_aRollDie = new SequenceEdit("Player/aRollDie",groupBox_18); Player_aRollDie = new SequenceEdit("Player/aRollDie", groupBox_18);
Player_aRollDie->setObjectName("Player_aRollDie"); Player_aRollDie->setObjectName("Player_aRollDie");
gridLayout_19->addWidget(Player_aRollDie, 2, 1, 1, 1); gridLayout_19->addWidget(Player_aRollDie, 2, 1, 1, 1);
@ -1599,7 +1599,7 @@ class Ui_shortcutsTab
gridLayout_19->addWidget(lbl_TabGame_aRotateViewCW, 2, 2, 1, 1); gridLayout_19->addWidget(lbl_TabGame_aRotateViewCW, 2, 2, 1, 1);
TabGame_aRotateViewCW = new SequenceEdit("Player/aRotateViewCW",groupBox_18); TabGame_aRotateViewCW = new SequenceEdit("Player/aRotateViewCW", groupBox_18);
TabGame_aRotateViewCW->setObjectName("TabGame_aRotateViewCW"); TabGame_aRotateViewCW->setObjectName("TabGame_aRotateViewCW");
gridLayout_19->addWidget(TabGame_aRotateViewCW, 2, 3, 1, 1); gridLayout_19->addWidget(TabGame_aRotateViewCW, 2, 3, 1, 1);
@ -1609,7 +1609,7 @@ class Ui_shortcutsTab
gridLayout_19->addWidget(lbl_Player_aShuffle, 3, 0, 1, 1); gridLayout_19->addWidget(lbl_Player_aShuffle, 3, 0, 1, 1);
Player_aShuffle = new SequenceEdit("Player/aShuffle",groupBox_18); Player_aShuffle = new SequenceEdit("Player/aShuffle", groupBox_18);
Player_aShuffle->setObjectName("Player_aShuffle"); Player_aShuffle->setObjectName("Player_aShuffle");
gridLayout_19->addWidget(Player_aShuffle, 3, 1, 1, 1); gridLayout_19->addWidget(Player_aShuffle, 3, 1, 1, 1);
@ -1619,7 +1619,7 @@ class Ui_shortcutsTab
gridLayout_19->addWidget(lbl_TabGame_aRotateViewCCW, 3, 2, 1, 1); gridLayout_19->addWidget(lbl_TabGame_aRotateViewCCW, 3, 2, 1, 1);
TabGame_aRotateViewCCW = new SequenceEdit("Player/aRotateViewCCW",groupBox_18); TabGame_aRotateViewCCW = new SequenceEdit("Player/aRotateViewCCW", groupBox_18);
TabGame_aRotateViewCCW->setObjectName("TabGame_aRotateViewCCW"); TabGame_aRotateViewCCW->setObjectName("TabGame_aRotateViewCCW");
gridLayout_19->addWidget(TabGame_aRotateViewCCW, 3, 3, 1, 1); gridLayout_19->addWidget(TabGame_aRotateViewCCW, 3, 3, 1, 1);
@ -1635,7 +1635,7 @@ class Ui_shortcutsTab
gridLayout_14->addWidget(lbl_Player_aMulligan, 4, 0, 1, 1); gridLayout_14->addWidget(lbl_Player_aMulligan, 4, 0, 1, 1);
Player_aMulligan = new SequenceEdit("Player/aMulligan",groupBox_14); Player_aMulligan = new SequenceEdit("Player/aMulligan", groupBox_14);
Player_aMulligan->setObjectName("Player_aMulligan"); Player_aMulligan->setObjectName("Player_aMulligan");
gridLayout_14->addWidget(Player_aMulligan, 4, 1, 1, 1); gridLayout_14->addWidget(Player_aMulligan, 4, 1, 1, 1);
@ -1645,7 +1645,7 @@ class Ui_shortcutsTab
gridLayout_14->addWidget(lbl_Player_aDrawCard, 0, 0, 1, 1); gridLayout_14->addWidget(lbl_Player_aDrawCard, 0, 0, 1, 1);
Player_aDrawCard = new SequenceEdit("Player/aDrawCard",groupBox_14); Player_aDrawCard = new SequenceEdit("Player/aDrawCard", groupBox_14);
Player_aDrawCard->setObjectName("Player_aDrawCard"); Player_aDrawCard->setObjectName("Player_aDrawCard");
gridLayout_14->addWidget(Player_aDrawCard, 0, 1, 1, 1); gridLayout_14->addWidget(Player_aDrawCard, 0, 1, 1, 1);
@ -1655,7 +1655,7 @@ class Ui_shortcutsTab
gridLayout_14->addWidget(lbl_Player_aDrawCards, 1, 0, 1, 1); gridLayout_14->addWidget(lbl_Player_aDrawCards, 1, 0, 1, 1);
Player_aDrawCards = new SequenceEdit("Player/aDrawCards",groupBox_14); Player_aDrawCards = new SequenceEdit("Player/aDrawCards", groupBox_14);
Player_aDrawCards->setObjectName("Player_aDrawCards"); Player_aDrawCards->setObjectName("Player_aDrawCards");
gridLayout_14->addWidget(Player_aDrawCards, 1, 1, 1, 1); gridLayout_14->addWidget(Player_aDrawCards, 1, 1, 1, 1);
@ -1665,7 +1665,7 @@ class Ui_shortcutsTab
gridLayout_14->addWidget(lbl_Player_aUndoDraw, 2, 0, 1, 1); gridLayout_14->addWidget(lbl_Player_aUndoDraw, 2, 0, 1, 1);
Player_aUndoDraw = new SequenceEdit("Player/aUndoDraw",groupBox_14); Player_aUndoDraw = new SequenceEdit("Player/aUndoDraw", groupBox_14);
Player_aUndoDraw->setObjectName("Player_aUndoDraw"); Player_aUndoDraw->setObjectName("Player_aUndoDraw");
gridLayout_14->addWidget(Player_aUndoDraw, 2, 1, 1, 1); gridLayout_14->addWidget(Player_aUndoDraw, 2, 1, 1, 1);
@ -1675,7 +1675,7 @@ class Ui_shortcutsTab
gridLayout_14->addWidget(lbl_Player_aAlwaysRevealTopCard, 3, 0, 1, 1); gridLayout_14->addWidget(lbl_Player_aAlwaysRevealTopCard, 3, 0, 1, 1);
Player_aAlwaysRevealTopCard = new SequenceEdit("Player/aAlwaysRevealTopCard",groupBox_14); Player_aAlwaysRevealTopCard = new SequenceEdit("Player/aAlwaysRevealTopCard", groupBox_14);
Player_aAlwaysRevealTopCard->setObjectName("Player_aAlwaysRevealTopCard"); Player_aAlwaysRevealTopCard->setObjectName("Player_aAlwaysRevealTopCard");
gridLayout_14->addWidget(Player_aAlwaysRevealTopCard, 3, 1, 1, 1); gridLayout_14->addWidget(Player_aAlwaysRevealTopCard, 3, 1, 1, 1);
@ -1684,9 +1684,9 @@ class Ui_shortcutsTab
gridLayout_20->addItem(verticalSpacer_3, 2, 1, 1, 1); gridLayout_20->addItem(verticalSpacer_3, 2, 1, 1, 1);
tabWidget->addTab(tab_3, QString()); tabWidget->addTab(tab_3, QString());
tab_4 = new QWidget(tabWidget); tab_4 = new QWidget(tabWidget);
QGridLayout* grid = new QGridLayout(tab_4); QGridLayout *grid = new QGridLayout(tab_4);
grid->addWidget(groupBox_3); grid->addWidget(groupBox_3);
grid->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding),1,0); grid->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding), 1, 0);
tabWidget->addTab(tab_4, QString()); tabWidget->addTab(tab_4, QString());
@ -1705,8 +1705,8 @@ class Ui_shortcutsTab
buttonsLayout->addWidget(btnResetAll); buttonsLayout->addWidget(btnResetAll);
gridLayout_9->addWidget(tabWidget, 0, 0, 1, 2); gridLayout_9->addWidget(tabWidget, 0, 0, 1, 2);
gridLayout_9->addWidget(faqLabel,1,0,1,1); gridLayout_9->addWidget(faqLabel, 1, 0, 1, 1);
gridLayout_9->addLayout(buttonsLayout,1,1,1,1,Qt::AlignRight); gridLayout_9->addLayout(buttonsLayout, 1, 1, 1, 1, Qt::AlignRight);
tabWidget->setCurrentIndex(0); tabWidget->setCurrentIndex(0);
grid->setSpacing(3); grid->setSpacing(3);
@ -1752,11 +1752,13 @@ class Ui_shortcutsTab
lbl_MainWindow_aExit->setText(QApplication::translate("shortcutsTab", "Exit", 0)); lbl_MainWindow_aExit->setText(QApplication::translate("shortcutsTab", "Exit", 0));
groupBox_2->setTitle(QApplication::translate("shortcutsTab", "Deck Editor", 0)); groupBox_2->setTitle(QApplication::translate("shortcutsTab", "Deck Editor", 0));
lbl_TabDeckEditor_aAnalyzeDeck->setText(QApplication::translate("shortcutsTab", "Analyze deck", 0)); lbl_TabDeckEditor_aAnalyzeDeck->setText(QApplication::translate("shortcutsTab", "Analyze deck", 0));
lbl_TabDeckEditor_aLoadDeckFromClipboard->setText(QApplication::translate("shortcutsTab", "Load deck (clipboard)", 0)); lbl_TabDeckEditor_aLoadDeckFromClipboard->setText(
QApplication::translate("shortcutsTab", "Load deck (clipboard)", 0));
lbl_TabDeckEditor_aClearFilterAll->setText(QApplication::translate("shortcutsTab", "Clear all filters", 0)); lbl_TabDeckEditor_aClearFilterAll->setText(QApplication::translate("shortcutsTab", "Clear all filters", 0));
lbl_TabDeckEditor_aNewDeck->setText(QApplication::translate("shortcutsTab", "New deck", 0)); lbl_TabDeckEditor_aNewDeck->setText(QApplication::translate("shortcutsTab", "New deck", 0));
lbl_TabDeckEditor_aClearFilterOne->setText(QApplication::translate("shortcutsTab", "Clear selected filter", 0)); lbl_TabDeckEditor_aClearFilterOne->setText(QApplication::translate("shortcutsTab", "Clear selected filter", 0));
lbl_TabDeckEditor_aOpenCustomFolder->setText(QApplication::translate("shortcutsTab", "Open custom pic folder", 0)); lbl_TabDeckEditor_aOpenCustomFolder->setText(
QApplication::translate("shortcutsTab", "Open custom pic folder", 0));
lbl_TabDeckEditor_aClose->setText(QApplication::translate("shortcutsTab", "Close", 0)); lbl_TabDeckEditor_aClose->setText(QApplication::translate("shortcutsTab", "Close", 0));
lbl_TabDeckEditor_aPrintDeck->setText(QApplication::translate("shortcutsTab", "Print deck", 0)); lbl_TabDeckEditor_aPrintDeck->setText(QApplication::translate("shortcutsTab", "Print deck", 0));
lbl_TabDeckEditor_aManageSets->setText(QApplication::translate("shortcutsTab", "Manage sets", 0)); lbl_TabDeckEditor_aManageSets->setText(QApplication::translate("shortcutsTab", "Manage sets", 0));
@ -1770,7 +1772,8 @@ class Ui_shortcutsTab
lbl_TabDeckEditor_aSaveDeckAs->setText(QApplication::translate("shortcutsTab", "Save deck as", 0)); lbl_TabDeckEditor_aSaveDeckAs->setText(QApplication::translate("shortcutsTab", "Save deck as", 0));
lbl_TabDeckEditor_aLoadDeck->setText(QApplication::translate("shortcutsTab", "Load deck", 0)); lbl_TabDeckEditor_aLoadDeck->setText(QApplication::translate("shortcutsTab", "Load deck", 0));
lbl_TabDeckEditor_aSaveDeckToClipboard->setText(QApplication::translate("shortcutsTab", "Save deck (clip)", 0)); lbl_TabDeckEditor_aSaveDeckToClipboard->setText(QApplication::translate("shortcutsTab", "Save deck (clip)", 0));
lbl_TabDeckEditor_aSaveDeckToClipboardRaw->setText(QApplication::translate("shortcutsTab", "Save deck (clip; no annotations)", 0)); lbl_TabDeckEditor_aSaveDeckToClipboardRaw->setText(
QApplication::translate("shortcutsTab", "Save deck (clip; no annotations)", 0));
groupBox_3->setTitle(QApplication::translate("shortcutsTab", "Counters", 0)); groupBox_3->setTitle(QApplication::translate("shortcutsTab", "Counters", 0));
groupBox_4->setTitle(QApplication::translate("shortcutsTab", "Life", 0)); groupBox_4->setTitle(QApplication::translate("shortcutsTab", "Life", 0));
lbl_abstractCounter_sSet->setText(QApplication::translate("shortcutsTab", "Set", 0)); lbl_abstractCounter_sSet->setText(QApplication::translate("shortcutsTab", "Set", 0));
@ -1821,7 +1824,8 @@ class Ui_shortcutsTab
lbl_Player_aSCYellow->setText(QApplication::translate("shortcutsTab", "Set", 0)); lbl_Player_aSCYellow->setText(QApplication::translate("shortcutsTab", "Set", 0));
lbl_Player_aCCYellow->setText(QApplication::translate("shortcutsTab", "Add", 0)); lbl_Player_aCCYellow->setText(QApplication::translate("shortcutsTab", "Add", 0));
lbl_Player_aRCYellow->setText(QApplication::translate("shortcutsTab", "Remove", 0)); lbl_Player_aRCYellow->setText(QApplication::translate("shortcutsTab", "Remove", 0));
tabWidget->setTabText(tabWidget->indexOf(tab), QApplication::translate("shortcutsTab", "Main Window | Deck Editor", 0)); tabWidget->setTabText(tabWidget->indexOf(tab),
QApplication::translate("shortcutsTab", "Main Window | Deck Editor", 0));
groupBox_9->setTitle(QApplication::translate("shortcutsTab", "Power / Toughness", 0)); groupBox_9->setTitle(QApplication::translate("shortcutsTab", "Power / Toughness", 0));
groupBox_12->setTitle(QApplication::translate("shortcutsTab", "Power and Toughness", 0)); groupBox_12->setTitle(QApplication::translate("shortcutsTab", "Power and Toughness", 0));
lbl_Player_aIncPT->setText(QApplication::translate("shortcutsTab", "Add (+1/+1)", 0)); lbl_Player_aIncPT->setText(QApplication::translate("shortcutsTab", "Add (+1/+1)", 0));
@ -1858,10 +1862,12 @@ class Ui_shortcutsTab
lbl_Player_aUnattach->setText(QApplication::translate("shortcutsTab", "Unattach card", 0)); lbl_Player_aUnattach->setText(QApplication::translate("shortcutsTab", "Unattach card", 0));
lbl_Player_aClone->setText(QApplication::translate("shortcutsTab", "Clone card", 0)); lbl_Player_aClone->setText(QApplication::translate("shortcutsTab", "Clone card", 0));
lbl_Player_aCreateToken->setText(QApplication::translate("shortcutsTab", "Create token", 0)); lbl_Player_aCreateToken->setText(QApplication::translate("shortcutsTab", "Create token", 0));
lbl_Player_aCreateRelatedTokens->setText(QApplication::translate("shortcutsTab", "Create all related tokens", 0)); lbl_Player_aCreateRelatedTokens->setText(
QApplication::translate("shortcutsTab", "Create all related tokens", 0));
lbl_Player_aCreateAnotherToken->setText(QApplication::translate("shortcutsTab", "Create another token", 0)); lbl_Player_aCreateAnotherToken->setText(QApplication::translate("shortcutsTab", "Create another token", 0));
lbl_Player_aSetAnnotation->setText(QApplication::translate("shortcutsTab", "Set annotation", 0)); lbl_Player_aSetAnnotation->setText(QApplication::translate("shortcutsTab", "Set annotation", 0));
tabWidget->setTabText(tabWidget->indexOf(tab_2), QApplication::translate("shortcutsTab", "Phases | P/T | Playing Area", 0)); tabWidget->setTabText(tabWidget->indexOf(tab_2),
QApplication::translate("shortcutsTab", "Phases | P/T | Playing Area", 0));
groupBox_15->setTitle(QApplication::translate("shortcutsTab", "Move card to", 0)); groupBox_15->setTitle(QApplication::translate("shortcutsTab", "Move card to", 0));
lbl_Player_aMoveToBottomLibrary->setText(QApplication::translate("shortcutsTab", "Bottom library", 0)); lbl_Player_aMoveToBottomLibrary->setText(QApplication::translate("shortcutsTab", "Bottom library", 0));
lbl_Player_aMoveToTopLibrary->setText(QApplication::translate("shortcutsTab", "Top library", 0)); lbl_Player_aMoveToTopLibrary->setText(QApplication::translate("shortcutsTab", "Top library", 0));
@ -1893,17 +1899,22 @@ class Ui_shortcutsTab
lbl_Player_aDrawCards->setText(QApplication::translate("shortcutsTab", "Draw cards", 0)); lbl_Player_aDrawCards->setText(QApplication::translate("shortcutsTab", "Draw cards", 0));
lbl_Player_aUndoDraw->setText(QApplication::translate("shortcutsTab", "Undo draw", 0)); lbl_Player_aUndoDraw->setText(QApplication::translate("shortcutsTab", "Undo draw", 0));
lbl_Player_aAlwaysRevealTopCard->setText(QApplication::translate("shortcutsTab", "Always reveal top card", 0)); lbl_Player_aAlwaysRevealTopCard->setText(QApplication::translate("shortcutsTab", "Always reveal top card", 0));
tabWidget->setTabText(tabWidget->indexOf(tab_3), QApplication::translate("shortcutsTab", "Draw | Move | View | Gameplay", 0)); tabWidget->setTabText(tabWidget->indexOf(tab_3),
tabWidget->setTabText(tabWidget->indexOf(tab_4), QApplication::translate("shortcutsTab","Counters", 0)); QApplication::translate("shortcutsTab", "Draw | Move | View | Gameplay", 0));
faqLabel->setText(QString("<a href='%1'>%2</a>").arg(WIKI).arg(QApplication::translate("shortcutsTab","How to set custom shortcuts",0))); tabWidget->setTabText(tabWidget->indexOf(tab_4), QApplication::translate("shortcutsTab", "Counters", 0));
btnResetAll->setText(QApplication::translate("shortcutsTab","Restore all default shortcuts",0)); faqLabel->setText(QString("<a href='%1'>%2</a>")
btnClearAll->setText(QApplication::translate("shortcutsTab","Clear all shortcuts",0)); .arg(WIKI)
.arg(QApplication::translate("shortcutsTab", "How to set custom shortcuts", 0)));
btnResetAll->setText(QApplication::translate("shortcutsTab", "Restore all default shortcuts", 0));
btnClearAll->setText(QApplication::translate("shortcutsTab", "Clear all shortcuts", 0));
} // retranslateUi } // retranslateUi
}; };
namespace Ui namespace Ui
{ {
class shortcutsTab: public Ui_shortcutsTab {}; class shortcutsTab : public Ui_shortcutsTab
{
};
} // namespace Ui } // namespace Ui
QT_END_NAMESPACE QT_END_NAMESPACE

View file

@ -1,8 +1,8 @@
#include "carddatabasesettings.h" #include "carddatabasesettings.h"
CardDatabaseSettings::CardDatabaseSettings(QString settingPath, QObject *parent) : SettingsManager(settingPath+"cardDatabase.ini", parent) CardDatabaseSettings::CardDatabaseSettings(QString settingPath, QObject *parent)
: SettingsManager(settingPath + "cardDatabase.ini", parent)
{ {
} }
void CardDatabaseSettings::setSortKey(QString shortName, unsigned int sortKey) void CardDatabaseSettings::setSortKey(QString shortName, unsigned int sortKey)

View file

@ -4,13 +4,14 @@
#include "settingsmanager.h" #include "settingsmanager.h"
#include <QObject> #include <QObject>
#include <QVariant>
#include <QSettings> #include <QSettings>
#include <QVariant>
class CardDatabaseSettings : public SettingsManager class CardDatabaseSettings : public SettingsManager
{ {
Q_OBJECT Q_OBJECT
friend class SettingsCache; friend class SettingsCache;
public: public:
void setSortKey(QString shortName, unsigned int sortKey); void setSortKey(QString shortName, unsigned int sortKey);
void setEnabled(QString shortName, bool enabled); void setEnabled(QString shortName, bool enabled);
@ -25,7 +26,7 @@ public slots:
private: private:
explicit CardDatabaseSettings(QString settingPath, QObject *parent = nullptr); explicit CardDatabaseSettings(QString settingPath, QObject *parent = nullptr);
CardDatabaseSettings( const CardDatabaseSettings& /*other*/ ); CardDatabaseSettings(const CardDatabaseSettings & /*other*/);
}; };
#endif // CARDDATABASESETTINGS_H #endif // CARDDATABASESETTINGS_H

View file

@ -2,7 +2,7 @@
#include <QCryptographicHash> #include <QCryptographicHash>
GameFiltersSettings::GameFiltersSettings(QString settingPath, QObject *parent) GameFiltersSettings::GameFiltersSettings(QString settingPath, QObject *parent)
: SettingsManager(settingPath+"gamefilters.ini", parent) : SettingsManager(settingPath + "gamefilters.ini", parent)
{ {
} }
@ -28,72 +28,70 @@ bool GameFiltersSettings::isShowBuddiesOnlyGames()
void GameFiltersSettings::setUnavailableGamesVisible(bool enabled) void GameFiltersSettings::setUnavailableGamesVisible(bool enabled)
{ {
setValue(enabled, "unavailable_games_visible","filter_games"); setValue(enabled, "unavailable_games_visible", "filter_games");
} }
bool GameFiltersSettings::isUnavailableGamesVisible() bool GameFiltersSettings::isUnavailableGamesVisible()
{ {
QVariant previous = getValue("unavailable_games_visible","filter_games"); QVariant previous = getValue("unavailable_games_visible", "filter_games");
return previous == QVariant() ? false : previous.toBool(); return previous == QVariant() ? false : previous.toBool();
} }
void GameFiltersSettings::setShowPasswordProtectedGames(bool show) void GameFiltersSettings::setShowPasswordProtectedGames(bool show)
{ {
setValue(show, "show_password_protected_games","filter_games"); setValue(show, "show_password_protected_games", "filter_games");
} }
bool GameFiltersSettings::isShowPasswordProtectedGames() bool GameFiltersSettings::isShowPasswordProtectedGames()
{ {
QVariant previous = getValue("show_password_protected_games","filter_games"); QVariant previous = getValue("show_password_protected_games", "filter_games");
return previous == QVariant() ? true : previous.toBool(); return previous == QVariant() ? true : previous.toBool();
} }
void GameFiltersSettings::setGameNameFilter(QString gameName) void GameFiltersSettings::setGameNameFilter(QString gameName)
{ {
setValue(gameName, "game_name_filter","filter_games"); setValue(gameName, "game_name_filter", "filter_games");
} }
QString GameFiltersSettings::getGameNameFilter() QString GameFiltersSettings::getGameNameFilter()
{ {
return getValue("game_name_filter","filter_games").toString(); return getValue("game_name_filter", "filter_games").toString();
} }
void GameFiltersSettings::setMinPlayers(int min) void GameFiltersSettings::setMinPlayers(int min)
{ {
setValue(min, "min_players","filter_games"); setValue(min, "min_players", "filter_games");
} }
int GameFiltersSettings::getMinPlayers() int GameFiltersSettings::getMinPlayers()
{ {
QVariant previous = getValue("min_players","filter_games"); QVariant previous = getValue("min_players", "filter_games");
return previous == QVariant() ? 1 : previous.toInt(); return previous == QVariant() ? 1 : previous.toInt();
} }
void GameFiltersSettings::setMaxPlayers(int max) void GameFiltersSettings::setMaxPlayers(int max)
{ {
setValue(max, "max_players","filter_games"); setValue(max, "max_players", "filter_games");
} }
int GameFiltersSettings::getMaxPlayers() int GameFiltersSettings::getMaxPlayers()
{ {
QVariant previous = getValue("max_players","filter_games"); QVariant previous = getValue("max_players", "filter_games");
return previous == QVariant() ? 99 : previous.toInt(); return previous == QVariant() ? 99 : previous.toInt();
} }
void GameFiltersSettings::setGameTypeEnabled(QString gametype, bool enabled) void GameFiltersSettings::setGameTypeEnabled(QString gametype, bool enabled)
{ {
setValue(enabled, "game_type/"+hashGameType(gametype),"filter_games"); setValue(enabled, "game_type/" + hashGameType(gametype), "filter_games");
} }
void GameFiltersSettings::setGameHashedTypeEnabled(QString gametypeHASHED, bool enabled) void GameFiltersSettings::setGameHashedTypeEnabled(QString gametypeHASHED, bool enabled)
{ {
setValue(enabled, gametypeHASHED,"filter_games"); setValue(enabled, gametypeHASHED, "filter_games");
} }
bool GameFiltersSettings::isGameTypeEnabled(QString gametype) bool GameFiltersSettings::isGameTypeEnabled(QString gametype)
{ {
QVariant previous = getValue("game_type/"+hashGameType(gametype),"filter_games"); QVariant previous = getValue("game_type/" + hashGameType(gametype), "filter_games");
return previous == QVariant() ? false : previous.toBool(); return previous == QVariant() ? false : previous.toBool();
} }

View file

@ -7,6 +7,7 @@ class GameFiltersSettings : public SettingsManager
{ {
Q_OBJECT Q_OBJECT
friend class SettingsCache; friend class SettingsCache;
public: public:
bool isShowBuddiesOnlyGames(); bool isShowBuddiesOnlyGames();
bool isUnavailableGamesVisible(); bool isUnavailableGamesVisible();
@ -29,8 +30,8 @@ signals:
public slots: public slots:
private: private:
explicit GameFiltersSettings(QString settingPath,QObject *parent = nullptr); explicit GameFiltersSettings(QString settingPath, QObject *parent = nullptr);
GameFiltersSettings( const GameFiltersSettings& /*other*/ ); GameFiltersSettings(const GameFiltersSettings & /*other*/);
QString hashGameType(const QString &gameType) const; QString hashGameType(const QString &gameType) const;
}; };

View file

@ -1,7 +1,7 @@
#include "layoutssettings.h" #include "layoutssettings.h"
LayoutsSettings::LayoutsSettings(QString settingPath, QObject *parent) LayoutsSettings::LayoutsSettings(QString settingPath, QObject *parent)
: SettingsManager(settingPath+"layouts.ini", parent) : SettingsManager(settingPath + "layouts.ini", parent)
{ {
} }
@ -12,7 +12,7 @@ const QByteArray LayoutsSettings::getDeckEditorLayoutState()
void LayoutsSettings::setDeckEditorLayoutState(const QByteArray &value) void LayoutsSettings::setDeckEditorLayoutState(const QByteArray &value)
{ {
setValue(value,"layouts/deckEditor_state"); setValue(value, "layouts/deckEditor_state");
} }
const QByteArray LayoutsSettings::getDeckEditorGeometry() const QByteArray LayoutsSettings::getDeckEditorGeometry()
@ -22,40 +22,40 @@ const QByteArray LayoutsSettings::getDeckEditorGeometry()
void LayoutsSettings::setDeckEditorGeometry(const QByteArray &value) void LayoutsSettings::setDeckEditorGeometry(const QByteArray &value)
{ {
setValue(value,"layouts/deckEditor_geometry"); setValue(value, "layouts/deckEditor_geometry");
} }
const QSize LayoutsSettings::getDeckEditorCardSize() const QSize LayoutsSettings::getDeckEditorCardSize()
{ {
QVariant previous = getValue("layouts/deckEditor_CardSize"); QVariant previous = getValue("layouts/deckEditor_CardSize");
return previous == QVariant() ? QSize(250,500) : previous.toSize(); return previous == QVariant() ? QSize(250, 500) : previous.toSize();
} }
void LayoutsSettings::setDeckEditorCardSize(const QSize &value) void LayoutsSettings::setDeckEditorCardSize(const QSize &value)
{ {
setValue(value,"layouts/deckEditor_CardSize"); setValue(value, "layouts/deckEditor_CardSize");
} }
const QSize LayoutsSettings::getDeckEditorDeckSize() const QSize LayoutsSettings::getDeckEditorDeckSize()
{ {
QVariant previous = getValue("layouts/deckEditor_DeckSize"); QVariant previous = getValue("layouts/deckEditor_DeckSize");
return previous == QVariant() ? QSize(250,360) : previous.toSize(); return previous == QVariant() ? QSize(250, 360) : previous.toSize();
} }
void LayoutsSettings::setDeckEditorDeckSize(const QSize &value) void LayoutsSettings::setDeckEditorDeckSize(const QSize &value)
{ {
setValue(value,"layouts/deckEditor_DeckSize"); setValue(value, "layouts/deckEditor_DeckSize");
} }
const QSize LayoutsSettings::getDeckEditorFilterSize() const QSize LayoutsSettings::getDeckEditorFilterSize()
{ {
QVariant previous = getValue("layouts/deckEditor_FilterSize"); QVariant previous = getValue("layouts/deckEditor_FilterSize");
return previous == QVariant() ? QSize(250,250) : previous.toSize(); return previous == QVariant() ? QSize(250, 250) : previous.toSize();
} }
void LayoutsSettings::setDeckEditorFilterSize(const QSize &value) void LayoutsSettings::setDeckEditorFilterSize(const QSize &value)
{ {
setValue(value,"layouts/deckEditor_FilterSize"); setValue(value, "layouts/deckEditor_FilterSize");
} }
const QByteArray LayoutsSettings::getDeckEditorDbHeaderState() const QByteArray LayoutsSettings::getDeckEditorDbHeaderState()
@ -65,17 +65,17 @@ const QByteArray LayoutsSettings::getDeckEditorDbHeaderState()
void LayoutsSettings::setDeckEditorDbHeaderState(const QByteArray &value) void LayoutsSettings::setDeckEditorDbHeaderState(const QByteArray &value)
{ {
setValue(value,"layouts/deckEditorDbHeader_state"); setValue(value, "layouts/deckEditorDbHeader_state");
} }
void LayoutsSettings::setGamePlayAreaGeometry(const QByteArray &value) void LayoutsSettings::setGamePlayAreaGeometry(const QByteArray &value)
{ {
setValue(value,"layouts/gameplayarea_geometry"); setValue(value, "layouts/gameplayarea_geometry");
} }
void LayoutsSettings::setGamePlayAreaState(const QByteArray &value) void LayoutsSettings::setGamePlayAreaState(const QByteArray &value)
{ {
setValue(value,"layouts/gameplayarea_state"); setValue(value, "layouts/gameplayarea_state");
} }
const QByteArray LayoutsSettings::getGamePlayAreaLayoutState() const QByteArray LayoutsSettings::getGamePlayAreaLayoutState()
@ -91,44 +91,44 @@ const QByteArray LayoutsSettings::getGamePlayAreaGeometry()
const QSize LayoutsSettings::getGameCardInfoSize() const QSize LayoutsSettings::getGameCardInfoSize()
{ {
QVariant previous = getValue("layouts/gameplayarea_CardInfoSize"); QVariant previous = getValue("layouts/gameplayarea_CardInfoSize");
return previous == QVariant() ? QSize(250,360) : previous.toSize(); return previous == QVariant() ? QSize(250, 360) : previous.toSize();
} }
void LayoutsSettings::setGameCardInfoSize(const QSize &value) void LayoutsSettings::setGameCardInfoSize(const QSize &value)
{ {
setValue(value,"layouts/gameplayarea_CardInfoSize"); setValue(value, "layouts/gameplayarea_CardInfoSize");
} }
const QSize LayoutsSettings::getGameMessageLayoutSize() const QSize LayoutsSettings::getGameMessageLayoutSize()
{ {
QVariant previous = getValue("layouts/gameplayarea_MessageLayoutSize"); QVariant previous = getValue("layouts/gameplayarea_MessageLayoutSize");
return previous == QVariant() ? QSize(250,250) : previous.toSize(); return previous == QVariant() ? QSize(250, 250) : previous.toSize();
} }
void LayoutsSettings::setGameMessageLayoutSize(const QSize &value) void LayoutsSettings::setGameMessageLayoutSize(const QSize &value)
{ {
setValue(value,"layouts/gameplayarea_MessageLayoutSize"); setValue(value, "layouts/gameplayarea_MessageLayoutSize");
} }
const QSize LayoutsSettings::getGamePlayerListSize() const QSize LayoutsSettings::getGamePlayerListSize()
{ {
QVariant previous = getValue("layouts/gameplayarea_PlayerListSize"); QVariant previous = getValue("layouts/gameplayarea_PlayerListSize");
return previous == QVariant() ? QSize(250,50) : previous.toSize(); return previous == QVariant() ? QSize(250, 50) : previous.toSize();
} }
void LayoutsSettings::setGamePlayerListSize(const QSize &value) void LayoutsSettings::setGamePlayerListSize(const QSize &value)
{ {
setValue(value,"layouts/gameplayarea_PlayerListSize"); setValue(value, "layouts/gameplayarea_PlayerListSize");
} }
void LayoutsSettings::setReplayPlayAreaGeometry(const QByteArray &value) void LayoutsSettings::setReplayPlayAreaGeometry(const QByteArray &value)
{ {
setValue(value,"layouts/replayplayarea_geometry"); setValue(value, "layouts/replayplayarea_geometry");
} }
void LayoutsSettings::setReplayPlayAreaState(const QByteArray &value) void LayoutsSettings::setReplayPlayAreaState(const QByteArray &value)
{ {
setValue(value,"layouts/replayplayarea_state"); setValue(value, "layouts/replayplayarea_state");
} }
const QByteArray LayoutsSettings::getReplayPlayAreaLayoutState() const QByteArray LayoutsSettings::getReplayPlayAreaLayoutState()
@ -144,43 +144,43 @@ const QByteArray LayoutsSettings::getReplayPlayAreaGeometry()
const QSize LayoutsSettings::getReplayCardInfoSize() const QSize LayoutsSettings::getReplayCardInfoSize()
{ {
QVariant previous = getValue("layouts/replayplayarea_CardInfoSize"); QVariant previous = getValue("layouts/replayplayarea_CardInfoSize");
return previous == QVariant() ? QSize(250,360) : previous.toSize(); return previous == QVariant() ? QSize(250, 360) : previous.toSize();
} }
void LayoutsSettings::setReplayCardInfoSize(const QSize &value) void LayoutsSettings::setReplayCardInfoSize(const QSize &value)
{ {
setValue(value,"layouts/replayplayarea_CardInfoSize"); setValue(value, "layouts/replayplayarea_CardInfoSize");
} }
const QSize LayoutsSettings::getReplayMessageLayoutSize() const QSize LayoutsSettings::getReplayMessageLayoutSize()
{ {
QVariant previous = getValue("layouts/replayplayarea_MessageLayoutSize"); QVariant previous = getValue("layouts/replayplayarea_MessageLayoutSize");
return previous == QVariant() ? QSize(250,200) : previous.toSize(); return previous == QVariant() ? QSize(250, 200) : previous.toSize();
} }
void LayoutsSettings::setReplayMessageLayoutSize(const QSize &value) void LayoutsSettings::setReplayMessageLayoutSize(const QSize &value)
{ {
setValue(value,"layouts/replayplayarea_MessageLayoutSize"); setValue(value, "layouts/replayplayarea_MessageLayoutSize");
} }
const QSize LayoutsSettings::getReplayPlayerListSize() const QSize LayoutsSettings::getReplayPlayerListSize()
{ {
QVariant previous = getValue("layouts/replayplayarea_PlayerListSize"); QVariant previous = getValue("layouts/replayplayarea_PlayerListSize");
return previous == QVariant() ? QSize(250,50) : previous.toSize(); return previous == QVariant() ? QSize(250, 50) : previous.toSize();
} }
void LayoutsSettings::setReplayPlayerListSize(const QSize &value) void LayoutsSettings::setReplayPlayerListSize(const QSize &value)
{ {
setValue(value,"layouts/replayplayarea_PlayerListSize"); setValue(value, "layouts/replayplayarea_PlayerListSize");
} }
const QSize LayoutsSettings::getReplayReplaySize() const QSize LayoutsSettings::getReplayReplaySize()
{ {
QVariant previous = getValue("layouts/replayplayarea_ReplaySize"); QVariant previous = getValue("layouts/replayplayarea_ReplaySize");
return previous == QVariant() ? QSize(900,100) : previous.toSize(); return previous == QVariant() ? QSize(900, 100) : previous.toSize();
} }
void LayoutsSettings::setReplayReplaySize(const QSize &value) void LayoutsSettings::setReplayReplaySize(const QSize &value)
{ {
setValue(value,"layouts/replayplayarea_ReplaySize"); setValue(value, "layouts/replayplayarea_ReplaySize");
} }

View file

@ -8,6 +8,7 @@ class LayoutsSettings : public SettingsManager
{ {
Q_OBJECT Q_OBJECT
friend class SettingsCache; friend class SettingsCache;
public: public:
void setDeckEditorLayoutState(const QByteArray &value); void setDeckEditorLayoutState(const QByteArray &value);
void setDeckEditorGeometry(const QByteArray &value); void setDeckEditorGeometry(const QByteArray &value);
@ -53,8 +54,8 @@ signals:
public slots: public slots:
private: private:
explicit LayoutsSettings(QString settingPath,QObject *parent = nullptr); explicit LayoutsSettings(QString settingPath, QObject *parent = nullptr);
LayoutsSettings( const LayoutsSettings& /*other*/ ); LayoutsSettings(const LayoutsSettings & /*other*/);
}; };
#endif // LAYOUTSSETTINGS_H #endif // LAYOUTSSETTINGS_H

View file

@ -1,13 +1,13 @@
#include "messagesettings.h" #include "messagesettings.h"
MessageSettings::MessageSettings(QString settingPath, QObject *parent) MessageSettings::MessageSettings(QString settingPath, QObject *parent)
: SettingsManager(settingPath+"messages.ini",parent) : SettingsManager(settingPath + "messages.ini", parent)
{ {
} }
QString MessageSettings::getMessageAt(int index) QString MessageSettings::getMessageAt(int index)
{ {
return getValue(QString("msg%1").arg(index),"messages").toString(); return getValue(QString("msg%1").arg(index), "messages").toString();
} }
int MessageSettings::getCount() int MessageSettings::getCount()
@ -17,10 +17,10 @@ int MessageSettings::getCount()
void MessageSettings::setCount(int count) void MessageSettings::setCount(int count)
{ {
setValue(count,"count","messages"); setValue(count, "count", "messages");
} }
void MessageSettings::setMessageAt(int index, QString message) void MessageSettings::setMessageAt(int index, QString message)
{ {
setValue(message,QString("msg%1").arg(index),"messages"); setValue(message, QString("msg%1").arg(index), "messages");
} }

View file

@ -20,7 +20,7 @@ public slots:
private: private:
explicit MessageSettings(QString settingPath, QObject *parent = nullptr); explicit MessageSettings(QString settingPath, QObject *parent = nullptr);
MessageSettings( const MessageSettings& /*other*/ ); MessageSettings(const MessageSettings & /*other*/);
}; };
#endif // MESSAGESETTINGS_H #endif // MESSAGESETTINGS_H

View file

@ -2,7 +2,7 @@
#include <QDebug> #include <QDebug>
ServersSettings::ServersSettings(QString settingPath, QObject *parent) ServersSettings::ServersSettings(QString settingPath, QObject *parent)
: SettingsManager(settingPath+"servers.ini", parent) : SettingsManager(settingPath + "servers.ini", parent)
{ {
} }
@ -175,7 +175,12 @@ bool ServersSettings::getClearDebugLogStatus(bool abDefaultValue)
return cbFlushLog == QVariant() ? abDefaultValue : cbFlushLog.toBool(); return cbFlushLog == QVariant() ? abDefaultValue : cbFlushLog.toBool();
} }
void ServersSettings::addNewServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword) void ServersSettings::addNewServer(QString saveName,
QString serv,
QString port,
QString username,
QString password,
bool savePassword)
{ {
if (updateExistingServer(saveName, serv, port, username, password, savePassword)) if (updateExistingServer(saveName, serv, port, username, password, savePassword))
return; return;
@ -189,17 +194,19 @@ void ServersSettings::addNewServer(QString saveName, QString serv, QString port,
setValue(savePassword, QString("savePassword%1").arg(index), "server", "server_details"); setValue(savePassword, QString("savePassword%1").arg(index), "server", "server_details");
setValue(index, "totalServers", "server", "server_details"); setValue(index, "totalServers", "server", "server_details");
setValue(password, QString("password%1").arg(index), "server", "server_details"); setValue(password, QString("password%1").arg(index), "server", "server_details");
} }
bool ServersSettings::updateExistingServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword) bool ServersSettings::updateExistingServer(QString saveName,
QString serv,
QString port,
QString username,
QString password,
bool savePassword)
{ {
int size = getValue("totalServers", "server", "server_details").toInt() + 1; int size = getValue("totalServers", "server", "server_details").toInt() + 1;
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++) {
{ if (saveName == getValue(QString("saveName%1").arg(i), "server", "server_details").toString()) {
if (saveName == getValue(QString("saveName%1").arg(i), "server", "server_details").toString())
{
setValue(serv, QString("server%1").arg(i), "server", "server_details"); setValue(serv, QString("server%1").arg(i), "server", "server_details");
setValue(port, QString("port%1").arg(i), "server", "server_details"); setValue(port, QString("port%1").arg(i), "server", "server_details");
setValue(username, QString("username%1").arg(i), "server", "server_details"); setValue(username, QString("username%1").arg(i), "server", "server_details");

View file

@ -37,8 +37,14 @@ public:
void setFPPort(QString port); void setFPPort(QString port);
void setSavePassword(int save); void setSavePassword(int save);
void setFPPlayerName(QString playerName); void setFPPlayerName(QString playerName);
void addNewServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword); void
bool updateExistingServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword); addNewServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword);
bool updateExistingServer(QString saveName,
QString serv,
QString port,
QString username,
QString password,
bool savePassword);
void setClearDebugLogStatus(bool abIsChecked); void setClearDebugLogStatus(bool abIsChecked);
bool getClearDebugLogStatus(bool abDefaultValue); bool getClearDebugLogStatus(bool abDefaultValue);
@ -47,8 +53,8 @@ signals:
public slots: public slots:
private: private:
explicit ServersSettings(QString settingPath,QObject *parent = nullptr); explicit ServersSettings(QString settingPath, QObject *parent = nullptr);
ServersSettings( const ServersSettings& /*other*/ ); ServersSettings(const ServersSettings & /*other*/);
}; };
#endif // SERVERSSETTINGS_H #endif // SERVERSSETTINGS_H

View file

@ -1,56 +1,48 @@
#include "settingsmanager.h" #include "settingsmanager.h"
SettingsManager::SettingsManager(QString settingPath, QObject *parent) : QObject(parent), settings(settingPath, QSettings::IniFormat) SettingsManager::SettingsManager(QString settingPath, QObject *parent)
: QObject(parent), settings(settingPath, QSettings::IniFormat)
{ {
} }
void SettingsManager::setValue(QVariant value, QString name, QString group, QString subGroup) void SettingsManager::setValue(QVariant value, QString name, QString group, QString subGroup)
{ {
if (!group.isEmpty()) if (!group.isEmpty()) {
{
settings.beginGroup(group); settings.beginGroup(group);
} }
if (!subGroup.isEmpty()) if (!subGroup.isEmpty()) {
{
settings.beginGroup(subGroup); settings.beginGroup(subGroup);
} }
settings.setValue(name, value); settings.setValue(name, value);
if (!subGroup.isEmpty()) if (!subGroup.isEmpty()) {
{
settings.endGroup(); settings.endGroup();
} }
if (!group.isEmpty()) if (!group.isEmpty()) {
{
settings.endGroup(); settings.endGroup();
} }
} }
QVariant SettingsManager::getValue(QString name, QString group, QString subGroup) QVariant SettingsManager::getValue(QString name, QString group, QString subGroup)
{ {
if (!group.isEmpty()) if (!group.isEmpty()) {
{
settings.beginGroup(group); settings.beginGroup(group);
} }
if (!subGroup.isEmpty()) if (!subGroup.isEmpty()) {
{
settings.beginGroup(subGroup); settings.beginGroup(subGroup);
} }
QVariant value = settings.value(name); QVariant value = settings.value(name);
if (!subGroup.isEmpty()) if (!subGroup.isEmpty()) {
{
settings.endGroup(); settings.endGroup();
} }
if (!group.isEmpty()) if (!group.isEmpty()) {
{
settings.endGroup(); settings.endGroup();
} }

View file

@ -2,28 +2,62 @@
#include "carddatabase_test.h" #include "carddatabase_test.h"
void CardDatabaseSettings::setSortKey(QString /* shortName */, unsigned int /* sortKey */) { }; void CardDatabaseSettings::setSortKey(QString /* shortName */, unsigned int /* sortKey */){};
void CardDatabaseSettings::setEnabled(QString /* shortName */, bool /* enabled */) { }; void CardDatabaseSettings::setEnabled(QString /* shortName */, bool /* enabled */){};
void CardDatabaseSettings::setIsKnown(QString /* shortName */, bool /* isknown */) { }; void CardDatabaseSettings::setIsKnown(QString /* shortName */, bool /* isknown */){};
unsigned int CardDatabaseSettings::getSortKey(QString /* shortName */) { return 0; }; unsigned int CardDatabaseSettings::getSortKey(QString /* shortName */)
bool CardDatabaseSettings::isEnabled(QString /* shortName */) { return true; }; {
bool CardDatabaseSettings::isKnown(QString /* shortName */) { return true; }; return 0;
};
bool CardDatabaseSettings::isEnabled(QString /* shortName */)
{
return true;
};
bool CardDatabaseSettings::isKnown(QString /* shortName */)
{
return true;
};
SettingsCache::SettingsCache() { cardDatabaseSettings = new CardDatabaseSettings(); }; SettingsCache::SettingsCache()
SettingsCache::~SettingsCache() { delete cardDatabaseSettings; }; {
QString SettingsCache::getCustomCardDatabasePath() const { return QString("%1/customsets/").arg(CARDDB_DATADIR); } cardDatabaseSettings = new CardDatabaseSettings();
QString SettingsCache::getCardDatabasePath() const { return QString("%1/cards.xml").arg(CARDDB_DATADIR); } };
QString SettingsCache::getTokenDatabasePath() const { return QString("%1/tokens.xml").arg(CARDDB_DATADIR); } SettingsCache::~SettingsCache()
QString SettingsCache::getSpoilerCardDatabasePath() const { return QString("%1/spoiler.xml").arg(CARDDB_DATADIR); } {
CardDatabaseSettings& SettingsCache::cardDatabase() const { return *cardDatabaseSettings; } delete cardDatabaseSettings;
};
QString SettingsCache::getCustomCardDatabasePath() const
{
return QString("%1/customsets/").arg(CARDDB_DATADIR);
}
QString SettingsCache::getCardDatabasePath() const
{
return QString("%1/cards.xml").arg(CARDDB_DATADIR);
}
QString SettingsCache::getTokenDatabasePath() const
{
return QString("%1/tokens.xml").arg(CARDDB_DATADIR);
}
QString SettingsCache::getSpoilerCardDatabasePath() const
{
return QString("%1/spoiler.xml").arg(CARDDB_DATADIR);
}
CardDatabaseSettings &SettingsCache::cardDatabase() const
{
return *cardDatabaseSettings;
}
SettingsCache *settingsCache; SettingsCache *settingsCache;
void PictureLoader::clearPixmapCache(CardInfoPtr /* card */) { } void PictureLoader::clearPixmapCache(CardInfoPtr /* card */)
{
}
namespace { namespace
{
TEST(CardDatabaseTest, LoadXml) { TEST(CardDatabaseTest, LoadXml)
{
settingsCache = new SettingsCache; settingsCache = new SettingsCache;
CardDatabase *db = new CardDatabase; CardDatabase *db = new CardDatabase;
@ -49,10 +83,11 @@ namespace {
ASSERT_EQ(0, db->getAllColors().size()) << "Colors not empty after clear"; ASSERT_EQ(0, db->getAllColors().size()) << "Colors not empty after clear";
ASSERT_EQ(0, db->getAllMainCardTypes().size()) << "Types not empty after clear"; ASSERT_EQ(0, db->getAllMainCardTypes().size()) << "Types not empty after clear";
ASSERT_EQ(NotLoaded, db->getLoadStatus()) << "Incorrect status after clear"; ASSERT_EQ(NotLoaded, db->getLoadStatus()) << "Incorrect status after clear";
}
} }
} // namespace
int main(int argc, char **argv) { int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }

View file

@ -22,10 +22,12 @@ public:
bool isKnown(QString shortName); bool isKnown(QString shortName);
}; };
class SettingsCache: public QObject { class SettingsCache : public QObject
{
Q_OBJECT Q_OBJECT
private: private:
CardDatabaseSettings *cardDatabaseSettings; CardDatabaseSettings *cardDatabaseSettings;
public: public:
SettingsCache(); SettingsCache();
~SettingsCache(); ~SettingsCache();
@ -33,14 +35,14 @@ public:
QString getCardDatabasePath() const; QString getCardDatabasePath() const;
QString getTokenDatabasePath() const; QString getTokenDatabasePath() const;
QString getSpoilerCardDatabasePath() const; QString getSpoilerCardDatabasePath() const;
CardDatabaseSettings& cardDatabase() const; CardDatabaseSettings &cardDatabase() const;
signals: signals:
void cardDatabasePathChanged(); void cardDatabasePathChanged();
}; };
#define PICTURELOADER_H #define PICTURELOADER_H
class PictureLoader { class PictureLoader
{
void clearPixmapCache(CardInfoPtr card); void clearPixmapCache(CardInfoPtr card);
}; };

View file

@ -1,16 +1,19 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
namespace { namespace
class FooTest : public ::testing::Test { {
class FooTest : public ::testing::Test
{
};
}; TEST(DummyTest, Works)
{
TEST(DummyTest, Works) {
ASSERT_EQ(1, 1) << "One is not equal to one"; ASSERT_EQ(1, 1) << "One is not equal to one";
}
} }
} // namespace
int main(int argc, char **argv) { int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }

View file

@ -1,10 +1,11 @@
#include "gtest/gtest.h"
#include "loading_from_clipboard_test.h" #include "loading_from_clipboard_test.h"
#include <QTextStream>
#include "../../common/decklist.h" #include "../../common/decklist.h"
#include "gtest/gtest.h"
#include <QTextStream>
DeckList *fromClipboard(QString *clipboard); DeckList *fromClipboard(QString *clipboard);
DeckList *fromClipboard(QString *clipboard) { DeckList *fromClipboard(QString *clipboard)
{
DeckList *deckList = new DeckList; DeckList *deckList = new DeckList;
QTextStream *stream = new QTextStream(clipboard); QTextStream *stream = new QTextStream(clipboard);
deckList->loadFromStream_Plain(*stream); deckList->loadFromStream_Plain(*stream);
@ -13,13 +14,17 @@ DeckList *fromClipboard(QString *clipboard) {
using CardRows = QMap<QString, int>; using CardRows = QMap<QString, int>;
struct DecklistBuilder { struct DecklistBuilder
{
CardRows actualMainboard; CardRows actualMainboard;
CardRows actualSideboard; CardRows actualSideboard;
explicit DecklistBuilder() : actualMainboard({}), actualSideboard({}) {} explicit DecklistBuilder() : actualMainboard({}), actualSideboard({})
{
}
void operator()(const InnerDecklistNode *innerDecklistNode, const DecklistCardNode *card) { void operator()(const InnerDecklistNode *innerDecklistNode, const DecklistCardNode *card)
{
if (innerDecklistNode->getName() == DECK_ZONE_MAIN) { if (innerDecklistNode->getName() == DECK_ZONE_MAIN) {
actualMainboard[card->getName()] += card->getNumber(); actualMainboard[card->getName()] += card->getNumber();
} else if (innerDecklistNode->getName() == DECK_ZONE_SIDE) { } else if (innerDecklistNode->getName() == DECK_ZONE_SIDE) {
@ -29,55 +34,53 @@ struct DecklistBuilder {
} }
} }
CardRows mainboard() { CardRows mainboard()
{
return actualMainboard; return actualMainboard;
} }
CardRows sideboard() { CardRows sideboard()
{
return actualSideboard; return actualSideboard;
} }
}; };
namespace { namespace
TEST(LoadingFromClipboardTest, EmptyDeck) {
{ TEST(LoadingFromClipboardTest, EmptyDeck)
{
DeckList *deckList = fromClipboard(new QString("")); DeckList *deckList = fromClipboard(new QString(""));
ASSERT_TRUE(deckList->getCardList().isEmpty()); ASSERT_TRUE(deckList->getCardList().isEmpty());
} }
TEST(LoadingFromClipboardTest, EmptySideboard) { TEST(LoadingFromClipboardTest, EmptySideboard)
{
DeckList *deckList = fromClipboard(new QString("Sideboard")); DeckList *deckList = fromClipboard(new QString("Sideboard"));
ASSERT_TRUE(deckList->getCardList().isEmpty()); ASSERT_TRUE(deckList->getCardList().isEmpty());
} }
TEST(LoadingFromClipboardTest, QuantityPrefixed) { TEST(LoadingFromClipboardTest, QuantityPrefixed)
QString *clipboard = new QString( {
"1 Mountain\n" QString *clipboard = new QString("1 Mountain\n"
"2x Island\n" "2x Island\n"
"3X FOREST\n" "3X FOREST\n");
);
DeckList *deckList = fromClipboard(clipboard); DeckList *deckList = fromClipboard(clipboard);
DecklistBuilder decklistBuilder = DecklistBuilder(); DecklistBuilder decklistBuilder = DecklistBuilder();
deckList->forEachCard(decklistBuilder); deckList->forEachCard(decklistBuilder);
CardRows expectedMainboard = CardRows({ CardRows expectedMainboard = CardRows({{"mountain", 1}, {"island", 2}, {"forest", 3}});
{"mountain", 1},
{"island", 2},
{"forest", 3}
});
CardRows expectedSideboard = CardRows({}); CardRows expectedSideboard = CardRows({});
ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard()); ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard());
ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard()); ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard());
} }
TEST(LoadingFromClipboardTest, CommentsAreIgnored) { TEST(LoadingFromClipboardTest, CommentsAreIgnored)
QString *clipboard = new QString( {
"//1 Mountain\n" QString *clipboard = new QString("//1 Mountain\n"
"//2x Island\n" "//2x Island\n"
"//SB:2x Island\n" "//SB:2x Island\n");
);
DeckList *deckList = fromClipboard(clipboard); DeckList *deckList = fromClipboard(clipboard);
@ -89,132 +92,108 @@ namespace {
ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard()); ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard());
ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard()); ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard());
} }
TEST(LoadingFromClipboardTest, SideboardPrefix) { TEST(LoadingFromClipboardTest, SideboardPrefix)
QString *clipboard = new QString( {
"1 Mountain\n" QString *clipboard = new QString("1 Mountain\n"
"SB: 1 Mountain\n" "SB: 1 Mountain\n"
"SB: 2x Island\n" "SB: 2x Island\n");
);
DeckList *deckList = fromClipboard(clipboard); DeckList *deckList = fromClipboard(clipboard);
DecklistBuilder decklistBuilder = DecklistBuilder(); DecklistBuilder decklistBuilder = DecklistBuilder();
deckList->forEachCard(decklistBuilder); deckList->forEachCard(decklistBuilder);
CardRows expectedMainboard = CardRows({ CardRows expectedMainboard = CardRows({{"mountain", 1}});
{"mountain", 1} CardRows expectedSideboard = CardRows({{"mountain", 1}, {"island", 2}});
});
CardRows expectedSideboard = CardRows({
{"mountain", 1},
{"island", 2}
});
ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard()); ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard());
ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard()); ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard());
} }
TEST(LoadingFromClipboardTest, UnknownCardsAreNotDiscarded) { TEST(LoadingFromClipboardTest, UnknownCardsAreNotDiscarded)
QString *clipboard = new QString( {
"1 CardThatDoesNotExistInCardsXml\n" QString *clipboard = new QString("1 CardThatDoesNotExistInCardsXml\n");
);
DeckList *deckList = fromClipboard(clipboard); DeckList *deckList = fromClipboard(clipboard);
DecklistBuilder decklistBuilder = DecklistBuilder(); DecklistBuilder decklistBuilder = DecklistBuilder();
deckList->forEachCard(decklistBuilder); deckList->forEachCard(decklistBuilder);
CardRows expectedMainboard = CardRows({ CardRows expectedMainboard = CardRows({{"cardthatdoesnotexistincardsxml", 1}});
{"cardthatdoesnotexistincardsxml", 1}
});
CardRows expectedSideboard = CardRows({}); CardRows expectedSideboard = CardRows({});
ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard()); ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard());
ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard()); ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard());
} }
TEST(LoadingFromClipboardTest, RemoveBlankEntriesFromBeginningAndEnd) { TEST(LoadingFromClipboardTest, RemoveBlankEntriesFromBeginningAndEnd)
QString *clipboard = new QString( {
"\n" QString *clipboard = new QString("\n"
"\n" "\n"
"\n" "\n"
"1x Algae Gharial\n" "1x Algae Gharial\n"
"3x CardThatDoesNotExistInCardsXml\n" "3x CardThatDoesNotExistInCardsXml\n"
"2x Phelddagrif\n" "2x Phelddagrif\n"
"\n" "\n"
"\n" "\n");
);
DeckList *deckList = fromClipboard(clipboard); DeckList *deckList = fromClipboard(clipboard);
DecklistBuilder decklistBuilder = DecklistBuilder(); DecklistBuilder decklistBuilder = DecklistBuilder();
deckList->forEachCard(decklistBuilder); deckList->forEachCard(decklistBuilder);
CardRows expectedMainboard = CardRows({ CardRows expectedMainboard =
{"algae gharial", 1}, CardRows({{"algae gharial", 1}, {"cardthatdoesnotexistincardsxml", 3}, {"phelddagrif", 2}});
{"cardthatdoesnotexistincardsxml", 3},
{"phelddagrif", 2}
});
CardRows expectedSideboard = CardRows({}); CardRows expectedSideboard = CardRows({});
ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard()); ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard());
ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard()); ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard());
} }
TEST(LoadingFromClipboardTest, UseFirstBlankIfOnlyOneBlankToSplitSideboard) { TEST(LoadingFromClipboardTest, UseFirstBlankIfOnlyOneBlankToSplitSideboard)
QString *clipboard = new QString( {
"1x Algae Gharial\n" QString *clipboard = new QString("1x Algae Gharial\n"
"3x CardThatDoesNotExistInCardsXml\n" "3x CardThatDoesNotExistInCardsXml\n"
"\n" "\n"
"2x Phelddagrif\n" "2x Phelddagrif\n");
);
DeckList *deckList = fromClipboard(clipboard); DeckList *deckList = fromClipboard(clipboard);
DecklistBuilder decklistBuilder = DecklistBuilder(); DecklistBuilder decklistBuilder = DecklistBuilder();
deckList->forEachCard(decklistBuilder); deckList->forEachCard(decklistBuilder);
CardRows expectedMainboard = CardRows({ CardRows expectedMainboard = CardRows({{"algae gharial", 1}, {"cardthatdoesnotexistincardsxml", 3}});
{"algae gharial", 1}, CardRows expectedSideboard = CardRows({{"phelddagrif", 2}});
{"cardthatdoesnotexistincardsxml", 3}
});
CardRows expectedSideboard = CardRows({
{"phelddagrif", 2}
});
ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard()); ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard());
ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard()); ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard());
} }
TEST(LoadingFromClipboardTest, IfMultipleScatteredBlanksAllMainBoard) { TEST(LoadingFromClipboardTest, IfMultipleScatteredBlanksAllMainBoard)
QString *clipboard = new QString( {
"1x Algae Gharial\n" QString *clipboard = new QString("1x Algae Gharial\n"
"3x CardThatDoesNotExistInCardsXml\n" "3x CardThatDoesNotExistInCardsXml\n"
"\n" "\n"
"2x Phelddagrif\n" "2x Phelddagrif\n"
"\n" "\n"
"3 Giant Growth\n" "3 Giant Growth\n");
);
DeckList *deckList = fromClipboard(clipboard); DeckList *deckList = fromClipboard(clipboard);
DecklistBuilder decklistBuilder = DecklistBuilder(); DecklistBuilder decklistBuilder = DecklistBuilder();
deckList->forEachCard(decklistBuilder); deckList->forEachCard(decklistBuilder);
CardRows expectedMainboard = CardRows({ CardRows expectedMainboard = CardRows(
{"algae gharial", 1}, {{"algae gharial", 1}, {"cardthatdoesnotexistincardsxml", 3}, {"phelddagrif", 2}, {"giant growth", 3}});
{"cardthatdoesnotexistincardsxml", 3},
{"phelddagrif", 2},
{"giant growth", 3}
});
CardRows expectedSideboard = CardRows({}); CardRows expectedSideboard = CardRows({});
ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard()); ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard());
ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard()); ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard());
} }
TEST(LoadingFromClipboardTest, LotsOfStuffInBulkTesting) { TEST(LoadingFromClipboardTest, LotsOfStuffInBulkTesting)
QString *clipboard = new QString( {
"\n" QString *clipboard = new QString("\n"
"\n" "\n"
"\n" "\n"
"1x test1\n" "1x test1\n"
@ -233,35 +212,26 @@ namespace {
"\n" "\n"
"\n" "\n"
"\n" "\n"
"\n" "\n");
);
DeckList *deckList = fromClipboard(clipboard); DeckList *deckList = fromClipboard(clipboard);
DecklistBuilder decklistBuilder = DecklistBuilder(); DecklistBuilder decklistBuilder = DecklistBuilder();
deckList->forEachCard(decklistBuilder); deckList->forEachCard(decklistBuilder);
CardRows expectedMainboard = CardRows({ CardRows expectedMainboard = CardRows({{"test1", 1}, {"test2", 2}, {"test3", 3}, {"test4", 4}, {"testnovaluemb", 1}
{"test1", 1},
{"test2", 2},
{"test3", 3},
{"test4", 4},
{"testnovaluemb", 1}
}); });
CardRows expectedSideboard = CardRows({ CardRows expectedSideboard = CardRows({{"testsb", 10}, {"test5", 5}, {"test6", 6}, {"testnovaluesb", 1}
{"testsb", 10},
{"test5", 5},
{"test6", 6},
{"testnovaluesb", 1}
}); });
ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard()); ASSERT_EQ(expectedMainboard, decklistBuilder.mainboard());
ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard()); ASSERT_EQ(expectedSideboard, decklistBuilder.sideboard());
}
} }
} // namespace
int main(int argc, char **argv) { int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }