Crash fixes (bug #0000006). Also cleaned up some includes to speed up compilation.
This commit is contained in:
parent
8fea71782d
commit
62bf2572a9
22 changed files with 208 additions and 41 deletions
|
@ -1,5 +1,9 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QtGui>
|
#include <QPainter>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QGraphicsScene>
|
||||||
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include "carditem.h"
|
#include "carditem.h"
|
||||||
#include "carddragitem.h"
|
#include "carddragitem.h"
|
||||||
#include "carddatabase.h"
|
#include "carddatabase.h"
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#include <QtGui>
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
#include <QDebug>
|
||||||
#include "cardzone.h"
|
#include "cardzone.h"
|
||||||
#include "carditem.h"
|
#include "carditem.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
|
@ -14,7 +17,7 @@ CardZone::CardZone(Player *_p, const QString &_name, bool _hasCardAttr, bool _is
|
||||||
|
|
||||||
CardZone::~CardZone()
|
CardZone::~CardZone()
|
||||||
{
|
{
|
||||||
qDebug(QString("CardZone destructor: %1").arg(name).toLatin1());
|
qDebug() << "CardZone destructor: " << name;
|
||||||
delete view;
|
delete view;
|
||||||
clearContents();
|
clearContents();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +37,7 @@ void CardZone::clearContents()
|
||||||
for (int j = 0; j < attachedCards.size(); ++j)
|
for (int j = 0; j < attachedCards.size(); ++j)
|
||||||
attachedCards[j]->setParentItem(attachedCards[j]->getZone());
|
attachedCards[j]->setParentItem(attachedCards[j]->getZone());
|
||||||
|
|
||||||
delete cards.at(i);
|
player->deleteCard(cards.at(i));
|
||||||
}
|
}
|
||||||
cards.clear();
|
cards.clear();
|
||||||
emit cardCountChanged();
|
emit cardCountChanged();
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
#include "counter.h"
|
#include "counter.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "protocol_items.h"
|
#include "protocol_items.h"
|
||||||
#include <QtGui>
|
#include <QPainter>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
|
||||||
Counter::Counter(Player *_player, int _id, const QString &_name, QColor _color, int _radius, int _value, QGraphicsItem *parent)
|
Counter::Counter(Player *_player, int _id, const QString &_name, QColor _color, int _radius, int _value, QGraphicsItem *parent)
|
||||||
: QGraphicsItem(parent), player(_player), id(_id), name(_name), color(_color), radius(_radius), value(_value), aDec(0), aInc(0)
|
: QGraphicsItem(parent), player(_player), id(_id), name(_name), color(_color), radius(_radius), value(_value), aDec(0), aInc(0), dialogSemaphore(false), deleteAfterDialog(false)
|
||||||
{
|
{
|
||||||
if (radius > Player::counterAreaWidth / 2)
|
if (radius > Player::counterAreaWidth / 2)
|
||||||
radius = Player::counterAreaWidth / 2;
|
radius = Player::counterAreaWidth / 2;
|
||||||
|
@ -38,6 +41,14 @@ Counter::~Counter()
|
||||||
delete menu;
|
delete menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Counter::delCounter()
|
||||||
|
{
|
||||||
|
if (dialogSemaphore)
|
||||||
|
deleteAfterDialog = true;
|
||||||
|
else
|
||||||
|
deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
void Counter::retranslateUi()
|
void Counter::retranslateUi()
|
||||||
{
|
{
|
||||||
if (menu) {
|
if (menu) {
|
||||||
|
@ -112,7 +123,13 @@ void Counter::incrementCounter()
|
||||||
void Counter::setCounter()
|
void Counter::setCounter()
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
|
dialogSemaphore = true;
|
||||||
int newValue = QInputDialog::getInteger(0, tr("Set counter"), tr("New value for counter '%1':").arg(name), value, 0, 2000000000, 1, &ok);
|
int newValue = QInputDialog::getInteger(0, tr("Set counter"), tr("New value for counter '%1':").arg(name), value, 0, 2000000000, 1, &ok);
|
||||||
|
if (deleteAfterDialog) {
|
||||||
|
deleteLater();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dialogSemaphore = false;
|
||||||
if (ok)
|
if (ok)
|
||||||
player->sendGameCommand(new Command_SetCounter(-1, id, newValue));
|
player->sendGameCommand(new Command_SetCounter(-1, id, newValue));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ private:
|
||||||
|
|
||||||
QAction *aSet, *aDec, *aInc;
|
QAction *aSet, *aDec, *aInc;
|
||||||
QMenu *menu;
|
QMenu *menu;
|
||||||
|
bool dialogSemaphore, deleteAfterDialog;
|
||||||
private slots:
|
private slots:
|
||||||
void incrementCounter();
|
void incrementCounter();
|
||||||
void setCounter();
|
void setCounter();
|
||||||
|
@ -37,6 +38,7 @@ public:
|
||||||
QString getName() const { return name; }
|
QString getName() const { return name; }
|
||||||
int getValue() const { return value; }
|
int getValue() const { return value; }
|
||||||
void setValue(int _value);
|
void setValue(int _value);
|
||||||
|
void delCounter();
|
||||||
|
|
||||||
void setShortcutsActive();
|
void setShortcutsActive();
|
||||||
void setShortcutsInactive();
|
void setShortcutsInactive();
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#include <QtGui>
|
#include <QApplication>
|
||||||
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include "deckview.h"
|
#include "deckview.h"
|
||||||
#include "decklist.h"
|
#include "decklist.h"
|
||||||
#include "carddatabase.h"
|
#include "carddatabase.h"
|
||||||
|
#include "settingscache.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
DeckViewCardDragItem::DeckViewCardDragItem(DeckViewCard *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag)
|
DeckViewCardDragItem::DeckViewCardDragItem(DeckViewCard *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag)
|
||||||
|
@ -117,8 +119,7 @@ void DeckViewCard::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
DeckViewCardContainer::DeckViewCardContainer(const QString &_name)
|
DeckViewCardContainer::DeckViewCardContainer(const QString &_name)
|
||||||
: QGraphicsItem(), name(_name), width(0), height(0), maxWidth(0)
|
: QGraphicsItem(), name(_name), width(0), height(0), maxWidth(0)
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QString bgPath = settingsCache->getTableBgPath();
|
||||||
QString bgPath = settings.value("zonebg/table").toString();
|
|
||||||
if (!bgPath.isEmpty())
|
if (!bgPath.isEmpty())
|
||||||
bgPixmap.load(bgPath);
|
bgPixmap.load(bgPath);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
#include <QtGui>
|
#include <QSettings>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QGridLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
#include "dlg_connect.h"
|
#include "dlg_connect.h"
|
||||||
|
|
||||||
DlgConnect::DlgConnect(QWidget *parent)
|
DlgConnect::DlgConnect(QWidget *parent)
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
#include <QtGui>
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QComboBox>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QGridLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QVBoxLayout>
|
||||||
#include "dlg_create_token.h"
|
#include "dlg_create_token.h"
|
||||||
|
|
||||||
DlgCreateToken::DlgCreateToken(QWidget *parent)
|
DlgCreateToken::DlgCreateToken(QWidget *parent)
|
||||||
|
|
|
@ -1,4 +1,13 @@
|
||||||
#include <QtGui>
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QGridLayout>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QSpinBox>
|
||||||
|
#include <QGroupBox>
|
||||||
|
#include <QMessageBox>
|
||||||
#include "dlg_creategame.h"
|
#include "dlg_creategame.h"
|
||||||
#include "protocol_items.h"
|
#include "protocol_items.h"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,21 @@
|
||||||
#include <QtGui>
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QComboBox>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QGroupBox>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QGridLayout>
|
||||||
|
#include <QListWidget>
|
||||||
|
#include <QStackedWidget>
|
||||||
|
#include <QCloseEvent>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <QTranslator>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QSettings>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QInputDialog>
|
||||||
#include "carddatabase.h"
|
#include "carddatabase.h"
|
||||||
#include "dlg_settings.h"
|
#include "dlg_settings.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#include <QtGui>
|
#include <QPainter>
|
||||||
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
#include <QApplication>
|
||||||
#include "pilezone.h"
|
#include "pilezone.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "carddragitem.h"
|
#include "carddragitem.h"
|
||||||
|
@ -20,7 +22,6 @@ QRectF PileZone::boundingRect() const
|
||||||
|
|
||||||
void PileZone::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void PileZone::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
qDebug("PileZone::paint");
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
painter->save();
|
painter->save();
|
||||||
cards.at(0)->paint(painter, option, widget);
|
cards.at(0)->paint(painter, option, widget);
|
||||||
|
@ -51,7 +52,6 @@ void PileZone::handleDropEvent(int cardId, CardZone *startZone, const QPoint &/*
|
||||||
|
|
||||||
void PileZone::reorganizeCards()
|
void PileZone::reorganizeCards()
|
||||||
{
|
{
|
||||||
qDebug(QString("PileZone: reorganize, x=%1, y=%2, w=%3, h=%4").arg(boundingRect().x()).arg(boundingRect().y()).arg(boundingRect().width()).arg(boundingRect().height()).toLatin1());
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
Player::Player(const QString &_name, int _id, bool _local, TabGame *_parent)
|
Player::Player(const QString &_name, int _id, bool _local, TabGame *_parent)
|
||||||
: QObject(_parent), defaultNumberTopCards(3), lastTokenDestroy(true), name(_name), id(_id), active(false), local(_local), mirrored(false)
|
: QObject(_parent), shortcutsActive(false), defaultNumberTopCards(3), lastTokenDestroy(true), name(_name), id(_id), active(false), local(_local), mirrored(false), dialogSemaphore(false)
|
||||||
{
|
{
|
||||||
setCacheMode(DeviceCoordinateCache);
|
setCacheMode(DeviceCoordinateCache);
|
||||||
|
|
||||||
|
@ -332,6 +332,8 @@ void Player::retranslateUi()
|
||||||
|
|
||||||
void Player::setShortcutsActive()
|
void Player::setShortcutsActive()
|
||||||
{
|
{
|
||||||
|
shortcutsActive = true;
|
||||||
|
|
||||||
aViewLibrary->setShortcut(tr("F3"));
|
aViewLibrary->setShortcut(tr("F3"));
|
||||||
aViewTopCards->setShortcut(tr("Ctrl+W"));
|
aViewTopCards->setShortcut(tr("Ctrl+W"));
|
||||||
aViewGraveyard->setShortcut(tr("F4"));
|
aViewGraveyard->setShortcut(tr("F4"));
|
||||||
|
@ -351,6 +353,8 @@ void Player::setShortcutsActive()
|
||||||
|
|
||||||
void Player::setShortcutsInactive()
|
void Player::setShortcutsInactive()
|
||||||
{
|
{
|
||||||
|
shortcutsActive = false;
|
||||||
|
|
||||||
aViewLibrary->setShortcut(QKeySequence());
|
aViewLibrary->setShortcut(QKeySequence());
|
||||||
aViewTopCards->setShortcut(QKeySequence());
|
aViewTopCards->setShortcut(QKeySequence());
|
||||||
aViewGraveyard->setShortcut(QKeySequence());
|
aViewGraveyard->setShortcut(QKeySequence());
|
||||||
|
@ -880,6 +884,14 @@ void Player::addCard(CardItem *c)
|
||||||
emit newCardAdded(c);
|
emit newCardAdded(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::deleteCard(CardItem *c)
|
||||||
|
{
|
||||||
|
if (dialogSemaphore)
|
||||||
|
cardsToDelete.append(c);
|
||||||
|
else
|
||||||
|
delete c;
|
||||||
|
}
|
||||||
|
|
||||||
void Player::addZone(CardZone *z)
|
void Player::addZone(CardZone *z)
|
||||||
{
|
{
|
||||||
zones.insert(z->getName(), z);
|
zones.insert(z->getName(), z);
|
||||||
|
@ -896,6 +908,8 @@ Counter *Player::addCounter(int counterId, const QString &name, QColor color, in
|
||||||
counters.insert(counterId, c);
|
counters.insert(counterId, c);
|
||||||
if (countersMenu)
|
if (countersMenu)
|
||||||
countersMenu->addMenu(c->getMenu());
|
countersMenu->addMenu(c->getMenu());
|
||||||
|
if (shortcutsActive)
|
||||||
|
c->setShortcutsActive();
|
||||||
rearrangeCounters();
|
rearrangeCounters();
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -906,7 +920,7 @@ void Player::delCounter(int counterId)
|
||||||
if (!c)
|
if (!c)
|
||||||
return;
|
return;
|
||||||
counters.remove(counterId);
|
counters.remove(counterId);
|
||||||
delete c;
|
c->delCounter();
|
||||||
rearrangeCounters();
|
rearrangeCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -914,7 +928,7 @@ void Player::clearCounters()
|
||||||
{
|
{
|
||||||
QMapIterator<int, Counter *> counterIterator(counters);
|
QMapIterator<int, Counter *> counterIterator(counters);
|
||||||
while (counterIterator.hasNext())
|
while (counterIterator.hasNext())
|
||||||
delete counterIterator.next().value();
|
counterIterator.next().value()->delCounter();
|
||||||
counters.clear();
|
counters.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1016,6 +1030,18 @@ void Player::sendCommandContainer(CommandContainer *cont)
|
||||||
static_cast<TabGame *>(parent())->sendCommandContainer(cont, id);
|
static_cast<TabGame *>(parent())->sendCommandContainer(cont, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Player::clearCardsToDelete()
|
||||||
|
{
|
||||||
|
if (cardsToDelete.isEmpty())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (int i = 0; i < cardsToDelete.size(); ++i)
|
||||||
|
cardsToDelete[i]->deleteLater();
|
||||||
|
cardsToDelete.clear();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void Player::cardMenuAction()
|
void Player::cardMenuAction()
|
||||||
{
|
{
|
||||||
QAction *a = static_cast<QAction *>(sender());
|
QAction *a = static_cast<QAction *>(sender());
|
||||||
|
@ -1073,13 +1099,17 @@ void Player::actSetPT()
|
||||||
oldPT = card->getPT();
|
oldPT = card->getPT();
|
||||||
}
|
}
|
||||||
bool ok;
|
bool ok;
|
||||||
|
dialogSemaphore = true;
|
||||||
QString pt = QInputDialog::getText(0, tr("Set power/toughness"), tr("Please enter the new PT:"), QLineEdit::Normal, oldPT, &ok);
|
QString pt = QInputDialog::getText(0, tr("Set power/toughness"), tr("Please enter the new PT:"), QLineEdit::Normal, oldPT, &ok);
|
||||||
|
dialogSemaphore = false;
|
||||||
|
if (clearCardsToDelete())
|
||||||
|
return;
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
i.toFront();
|
QListIterator<QGraphicsItem *> j(scene()->selectedItems());
|
||||||
while (i.hasNext()) {
|
while (j.hasNext()) {
|
||||||
CardItem *card = static_cast<CardItem *>(i.next());
|
CardItem *card = static_cast<CardItem *>(j.next());
|
||||||
sendGameCommand(new Command_SetCardAttr(-1, card->getZone()->getName(), card->getId(), "pt", pt));
|
sendGameCommand(new Command_SetCardAttr(-1, card->getZone()->getName(), card->getId(), "pt", pt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1095,7 +1125,11 @@ void Player::actSetAnnotation()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
|
dialogSemaphore = true;
|
||||||
QString annotation = QInputDialog::getText(0, tr("Set annotation"), tr("Please enter the new annotation:"), QLineEdit::Normal, oldAnnotation, &ok);
|
QString annotation = QInputDialog::getText(0, tr("Set annotation"), tr("Please enter the new annotation:"), QLineEdit::Normal, oldAnnotation, &ok);
|
||||||
|
dialogSemaphore = false;
|
||||||
|
if (clearCardsToDelete())
|
||||||
|
return;
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1147,7 +1181,11 @@ void Player::actCardCounterTrigger()
|
||||||
}
|
}
|
||||||
case 11: {
|
case 11: {
|
||||||
bool ok;
|
bool ok;
|
||||||
|
dialogSemaphore = true;
|
||||||
int number = QInputDialog::getInteger(0, tr("Set counters"), tr("Number:"), 0, 0, MAX_COUNTERS_ON_CARD, 1, &ok);
|
int number = QInputDialog::getInteger(0, tr("Set counters"), tr("Number:"), 0, 0, MAX_COUNTERS_ON_CARD, 1, &ok);
|
||||||
|
dialogSemaphore = false;
|
||||||
|
if (clearCardsToDelete())
|
||||||
|
return;
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,7 @@ private:
|
||||||
*aUntapAll, *aRollDie, *aCreateToken, *aCreateAnotherToken,
|
*aUntapAll, *aRollDie, *aCreateToken, *aCreateAnotherToken,
|
||||||
*aCardMenu;
|
*aCardMenu;
|
||||||
|
|
||||||
|
bool shortcutsActive;
|
||||||
int defaultNumberTopCards;
|
int defaultNumberTopCards;
|
||||||
QString lastTokenName, lastTokenColor, lastTokenPT, lastTokenAnnotation;
|
QString lastTokenName, lastTokenColor, lastTokenPT, lastTokenAnnotation;
|
||||||
bool lastTokenDestroy;
|
bool lastTokenDestroy;
|
||||||
|
@ -115,6 +116,10 @@ private:
|
||||||
bool local;
|
bool local;
|
||||||
bool mirrored;
|
bool mirrored;
|
||||||
|
|
||||||
|
bool dialogSemaphore;
|
||||||
|
bool clearCardsToDelete();
|
||||||
|
QList<CardItem *> cardsToDelete;
|
||||||
|
|
||||||
QMap<QString, CardZone *> zones;
|
QMap<QString, CardZone *> zones;
|
||||||
TableZone *table;
|
TableZone *table;
|
||||||
HandZone *hand;
|
HandZone *hand;
|
||||||
|
@ -157,6 +162,7 @@ public:
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
|
|
||||||
void addCard(CardItem *c);
|
void addCard(CardItem *c);
|
||||||
|
void deleteCard(CardItem *c);
|
||||||
void addZone(CardZone *z);
|
void addZone(CardZone *z);
|
||||||
|
|
||||||
Counter *addCounter(ServerInfo_Counter *counter);
|
Counter *addCounter(ServerInfo_Counter *counter);
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#include <QtGui>
|
#include <QListWidget>
|
||||||
|
#include <QTextEdit>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
#include "tab_chatchannel.h"
|
#include "tab_chatchannel.h"
|
||||||
#include "abstractclient.h"
|
#include "abstractclient.h"
|
||||||
#include "protocol_items.h"
|
#include "protocol_items.h"
|
||||||
|
|
|
@ -1,17 +1,27 @@
|
||||||
#include <QtGui>
|
#include <QTreeView>
|
||||||
|
#include <QFileSystemModel>
|
||||||
|
#include <QSortFilterProxyModel>
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QGroupBox>
|
||||||
|
#include <QHeaderView>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QInputDialog>
|
||||||
#include "tab_deck_storage.h"
|
#include "tab_deck_storage.h"
|
||||||
#include "remotedecklist_treewidget.h"
|
#include "remotedecklist_treewidget.h"
|
||||||
#include "abstractclient.h"
|
#include "abstractclient.h"
|
||||||
#include "decklist.h"
|
#include "decklist.h"
|
||||||
#include "protocol_items.h"
|
#include "protocol_items.h"
|
||||||
#include "window_deckeditor.h"
|
#include "window_deckeditor.h"
|
||||||
|
#include "settingscache.h"
|
||||||
|
|
||||||
TabDeckStorage::TabDeckStorage(AbstractClient *_client)
|
TabDeckStorage::TabDeckStorage(AbstractClient *_client)
|
||||||
: Tab(), client(_client)
|
: Tab(), client(_client)
|
||||||
{
|
{
|
||||||
localDirModel = new QFileSystemModel(this);
|
localDirModel = new QFileSystemModel(this);
|
||||||
QSettings settings;
|
localDirModel->setRootPath(settingsCache->getDeckPath());
|
||||||
localDirModel->setRootPath(settings.value("paths/decks").toString());
|
|
||||||
|
|
||||||
sortFilter = new QSortFilterProxyModel(this);
|
sortFilter = new QSortFilterProxyModel(this);
|
||||||
sortFilter->setSourceModel(localDirModel);
|
sortFilter->setSourceModel(localDirModel);
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
#include <QtGui>
|
#include <QLabel>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QFileDialog>
|
||||||
#include "tab_game.h"
|
#include "tab_game.h"
|
||||||
#include "cardinfowidget.h"
|
#include "cardinfowidget.h"
|
||||||
#include "playerlistwidget.h"
|
#include "playerlistwidget.h"
|
||||||
|
@ -18,6 +23,7 @@
|
||||||
#include "carditem.h"
|
#include "carditem.h"
|
||||||
#include "arrowitem.h"
|
#include "arrowitem.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "settingscache.h"
|
||||||
|
|
||||||
ReadyStartButton::ReadyStartButton(QWidget *parent)
|
ReadyStartButton::ReadyStartButton(QWidget *parent)
|
||||||
: QPushButton(parent), readyStart(false)
|
: QPushButton(parent), readyStart(false)
|
||||||
|
@ -88,8 +94,7 @@ void DeckViewContainer::setButtonsVisible(bool _visible)
|
||||||
void DeckViewContainer::loadLocalDeck()
|
void DeckViewContainer::loadLocalDeck()
|
||||||
{
|
{
|
||||||
QFileDialog dialog(this, tr("Load deck"));
|
QFileDialog dialog(this, tr("Load deck"));
|
||||||
QSettings settings;
|
dialog.setDirectory(settingsCache->getDeckPath());
|
||||||
dialog.setDirectory(settings.value("paths/decks").toString());
|
|
||||||
dialog.setNameFilters(DeckList::fileNameFilters);
|
dialog.setNameFilters(DeckList::fileNameFilters);
|
||||||
if (!dialog.exec())
|
if (!dialog.exec())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
#include <QtGui>
|
#include <QTreeView>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QTreeWidget>
|
||||||
|
#include <QTextEdit>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QHeaderView>
|
||||||
|
#include <QInputDialog>
|
||||||
#include "tab_server.h"
|
#include "tab_server.h"
|
||||||
#include "gamesmodel.h"
|
#include "gamesmodel.h"
|
||||||
#include "dlg_creategame.h"
|
#include "dlg_creategame.h"
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#include <QtGui>
|
#include <QPainter>
|
||||||
|
#include <QSet>
|
||||||
|
#include <QGraphicsScene>
|
||||||
|
#include <math.h>
|
||||||
#include "tablezone.h"
|
#include "tablezone.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "protocol_items.h"
|
#include "protocol_items.h"
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#include <QtGui>
|
#include <QLabel>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QTreeView>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <QTextEdit>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QCloseEvent>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QMenuBar>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QPrintPreviewDialog>
|
||||||
|
#include <QHeaderView>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QClipboard>
|
||||||
|
#include <QTextStream>
|
||||||
#include "window_deckeditor.h"
|
#include "window_deckeditor.h"
|
||||||
#include "window_sets.h"
|
#include "window_sets.h"
|
||||||
#include "carddatabase.h"
|
#include "carddatabase.h"
|
||||||
|
@ -9,6 +26,7 @@
|
||||||
#include "dlg_cardsearch.h"
|
#include "dlg_cardsearch.h"
|
||||||
#include "dlg_load_deck_from_clipboard.h"
|
#include "dlg_load_deck_from_clipboard.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "settingscache.h"
|
||||||
|
|
||||||
void SearchLineEdit::keyPressEvent(QKeyEvent *event)
|
void SearchLineEdit::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
|
@ -270,8 +288,7 @@ void WndDeckEditor::actLoadDeck()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QFileDialog dialog(this, tr("Load deck"));
|
QFileDialog dialog(this, tr("Load deck"));
|
||||||
QSettings settings;
|
dialog.setDirectory(settingsCache->getDeckPath());
|
||||||
dialog.setDirectory(settings.value("paths/decks").toString());
|
|
||||||
dialog.setNameFilters(DeckList::fileNameFilters);
|
dialog.setNameFilters(DeckList::fileNameFilters);
|
||||||
if (!dialog.exec())
|
if (!dialog.exec())
|
||||||
return;
|
return;
|
||||||
|
@ -299,8 +316,7 @@ bool WndDeckEditor::actSaveDeck()
|
||||||
bool WndDeckEditor::actSaveDeckAs()
|
bool WndDeckEditor::actSaveDeckAs()
|
||||||
{
|
{
|
||||||
QFileDialog dialog(this, tr("Save deck"));
|
QFileDialog dialog(this, tr("Save deck"));
|
||||||
QSettings settings;
|
dialog.setDirectory(settingsCache->getDeckPath());
|
||||||
dialog.setDirectory(settings.value("paths/decks").toString());
|
|
||||||
dialog.setAcceptMode(QFileDialog::AcceptSave);
|
dialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||||
dialog.setConfirmOverwrite(true);
|
dialog.setConfirmOverwrite(true);
|
||||||
dialog.setDefaultSuffix("cod");
|
dialog.setDefaultSuffix("cod");
|
||||||
|
|
|
@ -17,7 +17,13 @@
|
||||||
* Free Software Foundation, Inc., *
|
* Free Software Foundation, Inc., *
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include <QtGui>
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QCloseEvent>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QMenuBar>
|
||||||
|
#include <QPixmapCache>
|
||||||
|
#include <QInputDialog>
|
||||||
|
|
||||||
#include "window_main.h"
|
#include "window_main.h"
|
||||||
#include "dlg_connect.h"
|
#include "dlg_connect.h"
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#include "window_sets.h"
|
#include "window_sets.h"
|
||||||
#include "setsmodel.h"
|
#include "setsmodel.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <QtGui>
|
#include <QTreeView>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
|
||||||
WndSets::WndSets(QWidget *parent)
|
WndSets::WndSets(QWidget *parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#include <QtGui>
|
#include <QGraphicsLinearLayout>
|
||||||
|
#include <QGraphicsProxyWidget>
|
||||||
|
#include <QCheckBox>
|
||||||
#include "zoneviewwidget.h"
|
#include "zoneviewwidget.h"
|
||||||
#include "carditem.h"
|
#include "carditem.h"
|
||||||
#include "zoneviewzone.h"
|
#include "zoneviewzone.h"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include <QtGui>
|
#include <math.h>
|
||||||
|
#include <QDebug>
|
||||||
#include "zoneviewzone.h"
|
#include "zoneviewzone.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "protocol_items.h"
|
#include "protocol_items.h"
|
||||||
|
|
Loading…
Reference in a new issue