deck editor is tab, replay viewer is tab, deck editor shown by default, cache window geometry between sessions, 'open this deck in deck editor' open in game
This commit is contained in:
parent
3edecf98c3
commit
cc516823d7
13 changed files with 518 additions and 309 deletions
|
@ -24,7 +24,7 @@ bool MessageLogWidget::isFemale(Player *player) const
|
||||||
|
|
||||||
bool MessageLogWidget::userIsFemale() const
|
bool MessageLogWidget::userIsFemale() const
|
||||||
{
|
{
|
||||||
return (tabSupervisor && tabSupervisor->getUserInfo()->gender() & ServerInfo_User::Female);
|
return (tabSupervisor && tabSupervisor->getUserInfo() && (tabSupervisor->getUserInfo()->gender() & ServerInfo_User::Female));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageLogWidget::logGameJoined(int gameId)
|
void MessageLogWidget::logGameJoined(int gameId)
|
||||||
|
|
|
@ -205,6 +205,9 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_pare
|
||||||
aAlwaysRevealTopCard = new QAction(this);
|
aAlwaysRevealTopCard = new QAction(this);
|
||||||
aAlwaysRevealTopCard->setCheckable(true);
|
aAlwaysRevealTopCard->setCheckable(true);
|
||||||
connect(aAlwaysRevealTopCard, SIGNAL(triggered()), this, SLOT(actAlwaysRevealTopCard()));
|
connect(aAlwaysRevealTopCard, SIGNAL(triggered()), this, SLOT(actAlwaysRevealTopCard()));
|
||||||
|
aOpenDeckInDeckEditor = new QAction(this);
|
||||||
|
aOpenDeckInDeckEditor->setEnabled(false);
|
||||||
|
connect(aOpenDeckInDeckEditor, SIGNAL(triggered()), this, SLOT(actOpenDeckInDeckEditor()));
|
||||||
}
|
}
|
||||||
|
|
||||||
aViewGraveyard = new QAction(this);
|
aViewGraveyard = new QAction(this);
|
||||||
|
@ -262,6 +265,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_pare
|
||||||
playerLists.append(mRevealLibrary = libraryMenu->addMenu(QString()));
|
playerLists.append(mRevealLibrary = libraryMenu->addMenu(QString()));
|
||||||
playerLists.append(mRevealTopCard = libraryMenu->addMenu(QString()));
|
playerLists.append(mRevealTopCard = libraryMenu->addMenu(QString()));
|
||||||
libraryMenu->addAction(aAlwaysRevealTopCard);
|
libraryMenu->addAction(aAlwaysRevealTopCard);
|
||||||
|
libraryMenu->addAction(aOpenDeckInDeckEditor);
|
||||||
libraryMenu->addSeparator();
|
libraryMenu->addSeparator();
|
||||||
libraryMenu->addAction(aMoveTopCardsToGrave);
|
libraryMenu->addAction(aMoveTopCardsToGrave);
|
||||||
libraryMenu->addAction(aMoveTopCardsToExile);
|
libraryMenu->addAction(aMoveTopCardsToExile);
|
||||||
|
@ -595,6 +599,7 @@ void Player::retranslateUi()
|
||||||
mRevealLibrary->setTitle(tr("Reveal &library to"));
|
mRevealLibrary->setTitle(tr("Reveal &library to"));
|
||||||
mRevealTopCard->setTitle(tr("Reveal t&op card to"));
|
mRevealTopCard->setTitle(tr("Reveal t&op card to"));
|
||||||
aAlwaysRevealTopCard->setText(tr("&Always reveal top card"));
|
aAlwaysRevealTopCard->setText(tr("&Always reveal top card"));
|
||||||
|
aOpenDeckInDeckEditor->setText(tr("O&pen deck in deck editor"));
|
||||||
aViewSideboard->setText(tr("&View sideboard"));
|
aViewSideboard->setText(tr("&View sideboard"));
|
||||||
aDrawCard->setText(tr("&Draw card"));
|
aDrawCard->setText(tr("&Draw card"));
|
||||||
aDrawCards->setText(tr("D&raw cards..."));
|
aDrawCards->setText(tr("D&raw cards..."));
|
||||||
|
@ -744,6 +749,7 @@ void Player::initSayMenu()
|
||||||
void Player::setDeck(DeckList *_deck)
|
void Player::setDeck(DeckList *_deck)
|
||||||
{
|
{
|
||||||
deck = _deck;
|
deck = _deck;
|
||||||
|
aOpenDeckInDeckEditor->setEnabled(deck);
|
||||||
|
|
||||||
createPredefinedTokenMenu->clear();
|
createPredefinedTokenMenu->clear();
|
||||||
predefinedTokens.clear();
|
predefinedTokens.clear();
|
||||||
|
@ -783,6 +789,11 @@ void Player::actAlwaysRevealTopCard()
|
||||||
sendGameCommand(cmd);
|
sendGameCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::actOpenDeckInDeckEditor()
|
||||||
|
{
|
||||||
|
emit openDeckEditor(new DeckList(deck));
|
||||||
|
}
|
||||||
|
|
||||||
void Player::actViewGraveyard()
|
void Player::actViewGraveyard()
|
||||||
{
|
{
|
||||||
static_cast<GameScene *>(scene())->toggleZoneView(this, "grave", -1);
|
static_cast<GameScene *>(scene())->toggleZoneView(this, "grave", -1);
|
||||||
|
|
|
@ -77,6 +77,7 @@ public:
|
||||||
class Player : public QObject, public QGraphicsItem {
|
class Player : public QObject, public QGraphicsItem {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
signals:
|
signals:
|
||||||
|
void openDeckEditor(DeckList *deck);
|
||||||
void newCardAdded(AbstractCardItem *card);
|
void newCardAdded(AbstractCardItem *card);
|
||||||
// Log events
|
// Log events
|
||||||
void logSay(Player *player, QString message);
|
void logSay(Player *player, QString message);
|
||||||
|
@ -134,6 +135,7 @@ private slots:
|
||||||
void updateBoundingRect();
|
void updateBoundingRect();
|
||||||
void rearrangeZones();
|
void rearrangeZones();
|
||||||
|
|
||||||
|
void actOpenDeckInDeckEditor();
|
||||||
void actCreatePredefinedToken();
|
void actCreatePredefinedToken();
|
||||||
void cardMenuAction();
|
void cardMenuAction();
|
||||||
void actCardCounterTrigger();
|
void actCardCounterTrigger();
|
||||||
|
@ -161,7 +163,7 @@ private:
|
||||||
QAction *aMoveHandToTopLibrary, *aMoveHandToBottomLibrary, *aMoveHandToGrave, *aMoveHandToRfg,
|
QAction *aMoveHandToTopLibrary, *aMoveHandToBottomLibrary, *aMoveHandToGrave, *aMoveHandToRfg,
|
||||||
*aMoveGraveToTopLibrary, *aMoveGraveToBottomLibrary, *aMoveGraveToHand, *aMoveGraveToRfg,
|
*aMoveGraveToTopLibrary, *aMoveGraveToBottomLibrary, *aMoveGraveToHand, *aMoveGraveToRfg,
|
||||||
*aMoveRfgToTopLibrary, *aMoveRfgToBottomLibrary, *aMoveRfgToHand, *aMoveRfgToGrave,
|
*aMoveRfgToTopLibrary, *aMoveRfgToBottomLibrary, *aMoveRfgToHand, *aMoveRfgToGrave,
|
||||||
*aViewLibrary, *aViewTopCards, *aAlwaysRevealTopCard, *aMoveTopCardsToGrave, *aMoveTopCardsToExile, *aMoveTopCardToBottom,
|
*aViewLibrary, *aViewTopCards, *aAlwaysRevealTopCard, *aOpenDeckInDeckEditor, *aMoveTopCardsToGrave, *aMoveTopCardsToExile, *aMoveTopCardToBottom,
|
||||||
*aViewGraveyard, *aViewRfg, *aViewSideboard,
|
*aViewGraveyard, *aViewRfg, *aViewSideboard,
|
||||||
*aDrawCard, *aDrawCards, *aUndoDraw, *aMulligan, *aShuffle,
|
*aDrawCard, *aDrawCards, *aUndoDraw, *aMulligan, *aShuffle,
|
||||||
*aUntapAll, *aRollDie, *aCreateToken, *aCreateAnotherToken,
|
*aUntapAll, *aRollDie, *aCreateToken, *aCreateAnotherToken,
|
||||||
|
|
|
@ -19,6 +19,7 @@ SettingsCache::SettingsCache()
|
||||||
playerBgPath = settings->value("zonebg/playerarea").toString();
|
playerBgPath = settings->value("zonebg/playerarea").toString();
|
||||||
cardBackPicturePath = settings->value("paths/cardbackpicture").toString();
|
cardBackPicturePath = settings->value("paths/cardbackpicture").toString();
|
||||||
|
|
||||||
|
mainWindowGeometry = settings->value("interface/main_window_geometry").toByteArray();
|
||||||
picDownload = settings->value("personal/picturedownload", true).toBool();
|
picDownload = settings->value("personal/picturedownload", true).toBool();
|
||||||
doubleClickToPlay = settings->value("interface/doubleclicktoplay", true).toBool();
|
doubleClickToPlay = settings->value("interface/doubleclicktoplay", true).toBool();
|
||||||
cardInfoMinimized = settings->value("interface/cardinfominimized", 0).toInt();
|
cardInfoMinimized = settings->value("interface/cardinfominimized", 0).toInt();
|
||||||
|
@ -211,3 +212,9 @@ void SettingsCache::setIgnoreUnregisteredUsers(bool _ignoreUnregisteredUsers)
|
||||||
settings->setValue("chat/ignore_unregistered", ignoreUnregisteredUsers);
|
settings->setValue("chat/ignore_unregistered", ignoreUnregisteredUsers);
|
||||||
emit ignoreUnregisteredUsersChanged();
|
emit ignoreUnregisteredUsersChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsCache::setMainWindowGeometry(const QByteArray &_mainWindowGeometry)
|
||||||
|
{
|
||||||
|
mainWindowGeometry = _mainWindowGeometry;
|
||||||
|
settings->setValue("interface/main_window_geometry", mainWindowGeometry);
|
||||||
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ signals:
|
||||||
private:
|
private:
|
||||||
QSettings *settings;
|
QSettings *settings;
|
||||||
|
|
||||||
|
QByteArray mainWindowGeometry;
|
||||||
QString customTranslationFile, lang;
|
QString customTranslationFile, lang;
|
||||||
QString deckPath, replaysPath, picsPath, cardDatabasePath;
|
QString deckPath, replaysPath, picsPath, cardDatabasePath;
|
||||||
QString handBgPath, stackBgPath, tableBgPath, playerBgPath, cardBackPicturePath;
|
QString handBgPath, stackBgPath, tableBgPath, playerBgPath, cardBackPicturePath;
|
||||||
|
@ -46,6 +47,7 @@ private:
|
||||||
bool ignoreUnregisteredUsers;
|
bool ignoreUnregisteredUsers;
|
||||||
public:
|
public:
|
||||||
SettingsCache();
|
SettingsCache();
|
||||||
|
const QByteArray &getMainWindowGeometry() const { return mainWindowGeometry; }
|
||||||
QString getCustomTranslationFile() const { return customTranslationFile; }
|
QString getCustomTranslationFile() const { return customTranslationFile; }
|
||||||
QString getLang() const { return lang; }
|
QString getLang() const { return lang; }
|
||||||
QString getDeckPath() const { return deckPath; }
|
QString getDeckPath() const { return deckPath; }
|
||||||
|
@ -73,6 +75,7 @@ public:
|
||||||
bool getPriceTagFeature() const { return priceTagFeature; }
|
bool getPriceTagFeature() const { return priceTagFeature; }
|
||||||
bool getIgnoreUnregisteredUsers() const { return ignoreUnregisteredUsers; }
|
bool getIgnoreUnregisteredUsers() const { return ignoreUnregisteredUsers; }
|
||||||
public slots:
|
public slots:
|
||||||
|
void setMainWindowGeometry(const QByteArray &_mainWindowGeometry);
|
||||||
void setCustomTranslationFile(const QString &_customTranslationFile);
|
void setCustomTranslationFile(const QString &_customTranslationFile);
|
||||||
void setLang(const QString &_lang);
|
void setLang(const QString &_lang);
|
||||||
void setDeckPath(const QString &_deckPath);
|
void setDeckPath(const QString &_deckPath);
|
||||||
|
|
|
@ -181,7 +181,7 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
|
||||||
connect(aPrintDeck, SIGNAL(triggered()), this, SLOT(actPrintDeck()));
|
connect(aPrintDeck, SIGNAL(triggered()), this, SLOT(actPrintDeck()));
|
||||||
aClose = new QAction(tr("&Close"), this);
|
aClose = new QAction(tr("&Close"), this);
|
||||||
aClose->setShortcut(tr("Ctrl+Q"));
|
aClose->setShortcut(tr("Ctrl+Q"));
|
||||||
connect(aClose, SIGNAL(triggered()), this, SLOT(close()));
|
connect(aClose, SIGNAL(triggered()), this, SLOT(closeRequest()));
|
||||||
|
|
||||||
aEditSets = new QAction(tr("&Edit sets..."), this);
|
aEditSets = new QAction(tr("&Edit sets..."), this);
|
||||||
connect(aEditSets, SIGNAL(triggered()), this, SLOT(actEditSets()));
|
connect(aEditSets, SIGNAL(triggered()), this, SLOT(actEditSets()));
|
||||||
|
@ -289,7 +289,6 @@ void TabDeckEditor::updateName(const QString &name)
|
||||||
{
|
{
|
||||||
deckModel->getDeckList()->setName(name);
|
deckModel->getDeckList()->setName(name);
|
||||||
setWindowModified(true);
|
setWindowModified(true);
|
||||||
emit tabTextChanged(this, getTabText());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabDeckEditor::updateComments()
|
void TabDeckEditor::updateComments()
|
||||||
|
@ -568,3 +567,9 @@ void TabDeckEditor::setDeck(DeckList *_deck, const QString &_lastFileName, DeckL
|
||||||
deckView->expandAll();
|
deckView->expandAll();
|
||||||
setWindowModified(false);
|
setWindowModified(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabDeckEditor::setWindowModified(bool _windowModified)
|
||||||
|
{
|
||||||
|
Tab::setWindowModified(_windowModified);
|
||||||
|
emit tabTextChanged(this, getTabText());
|
||||||
|
}
|
||||||
|
|
|
@ -90,8 +90,10 @@ public:
|
||||||
~TabDeckEditor();
|
~TabDeckEditor();
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
QString getTabText() const;
|
QString getTabText() const;
|
||||||
void closeRequest();
|
|
||||||
void setDeck(DeckList *_deck, const QString &_lastFileName = QString(), DeckList::FileFormat _lastFileFormat = DeckList::CockatriceFormat);
|
void setDeck(DeckList *_deck, const QString &_lastFileName = QString(), DeckList::FileFormat _lastFileFormat = DeckList::CockatriceFormat);
|
||||||
|
void setWindowModified(bool _windowModified);
|
||||||
|
public slots:
|
||||||
|
void closeRequest();
|
||||||
signals:
|
signals:
|
||||||
void deckEditorClosing(TabDeckEditor *tab);
|
void deckEditorClosing(TabDeckEditor *tab);
|
||||||
};
|
};
|
||||||
|
|
|
@ -734,6 +734,7 @@ Player *TabGame::addPlayer(int playerId, const ServerInfo_User &info)
|
||||||
{
|
{
|
||||||
bool local = ((clients.size() > 1) || (playerId == localPlayerId));
|
bool local = ((clients.size() > 1) || (playerId == localPlayerId));
|
||||||
Player *newPlayer = new Player(info, playerId, local, this);
|
Player *newPlayer = new Player(info, playerId, local, this);
|
||||||
|
connect(newPlayer, SIGNAL(openDeckEditor(DeckList *)), this, SIGNAL(openDeckEditor(DeckList *)));
|
||||||
scene->addPlayer(newPlayer);
|
scene->addPlayer(newPlayer);
|
||||||
|
|
||||||
connect(newPlayer, SIGNAL(newCardAdded(AbstractCardItem *)), this, SLOT(newCardAdded(AbstractCardItem *)));
|
connect(newPlayer, SIGNAL(newCardAdded(AbstractCardItem *)), this, SLOT(newCardAdded(AbstractCardItem *)));
|
||||||
|
|
|
@ -171,6 +171,7 @@ signals:
|
||||||
void containerProcessingStarted(const GameEventContext &context);
|
void containerProcessingStarted(const GameEventContext &context);
|
||||||
void containerProcessingDone();
|
void containerProcessingDone();
|
||||||
void openMessageDialog(const QString &userName, bool focus);
|
void openMessageDialog(const QString &userName, bool focus);
|
||||||
|
void openDeckEditor(DeckList *deck);
|
||||||
private slots:
|
private slots:
|
||||||
void replayNextEvent();
|
void replayNextEvent();
|
||||||
void replayFinished();
|
void replayFinished();
|
||||||
|
|
|
@ -208,12 +208,14 @@ void TabSupervisor::stop()
|
||||||
tabDeckStorage->deleteLater();
|
tabDeckStorage->deleteLater();
|
||||||
if (tabReplays)
|
if (tabReplays)
|
||||||
tabReplays->deleteLater();
|
tabReplays->deleteLater();
|
||||||
|
if (tabAdmin)
|
||||||
|
tabAdmin->deleteLater();
|
||||||
}
|
}
|
||||||
tabUserLists = 0;
|
tabUserLists = 0;
|
||||||
tabServer = 0;
|
tabServer = 0;
|
||||||
tabDeckStorage = 0;
|
tabDeckStorage = 0;
|
||||||
tabReplays = 0;
|
tabReplays = 0;
|
||||||
clear();
|
tabAdmin = 0;
|
||||||
|
|
||||||
QMapIterator<int, TabRoom *> roomIterator(roomTabs);
|
QMapIterator<int, TabRoom *> roomIterator(roomTabs);
|
||||||
while (roomIterator.hasNext())
|
while (roomIterator.hasNext())
|
||||||
|
@ -235,10 +237,6 @@ void TabSupervisor::stop()
|
||||||
messageIterator.next().value()->deleteLater();
|
messageIterator.next().value()->deleteLater();
|
||||||
messageTabs.clear();
|
messageTabs.clear();
|
||||||
|
|
||||||
QListIterator<TabDeckEditor *> deckEditorIterator(deckEditorTabs);
|
|
||||||
while (deckEditorIterator.hasNext())
|
|
||||||
deckEditorIterator.next()->deleteLater();
|
|
||||||
|
|
||||||
delete userInfo;
|
delete userInfo;
|
||||||
userInfo = 0;
|
userInfo = 0;
|
||||||
}
|
}
|
||||||
|
@ -250,7 +248,7 @@ void TabSupervisor::updatePingTime(int value, int max)
|
||||||
if (tabServer->getContentsChanged())
|
if (tabServer->getContentsChanged())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setTabIcon(0, QIcon(PingPixmapGenerator::generatePixmap(15, value, max)));
|
setTabIcon(indexOf(tabServer), QIcon(PingPixmapGenerator::generatePixmap(15, value, max)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabSupervisor::closeButtonPressed()
|
void TabSupervisor::closeButtonPressed()
|
||||||
|
@ -281,6 +279,7 @@ void TabSupervisor::gameJoined(const Event_GameJoined &event)
|
||||||
TabGame *tab = new TabGame(this, QList<AbstractClient *>() << client, event, roomGameTypes);
|
TabGame *tab = new TabGame(this, QList<AbstractClient *>() << client, event, roomGameTypes);
|
||||||
connect(tab, SIGNAL(gameClosing(TabGame *)), this, SLOT(gameLeft(TabGame *)));
|
connect(tab, SIGNAL(gameClosing(TabGame *)), this, SLOT(gameLeft(TabGame *)));
|
||||||
connect(tab, SIGNAL(openMessageDialog(const QString &, bool)), this, SLOT(addMessageTab(const QString &, bool)));
|
connect(tab, SIGNAL(openMessageDialog(const QString &, bool)), this, SLOT(addMessageTab(const QString &, bool)));
|
||||||
|
connect(tab, SIGNAL(openDeckEditor(DeckList *)), this, SLOT(addDeckEditorTab(DeckList *)));
|
||||||
int tabIndex = myAddTab(tab);
|
int tabIndex = myAddTab(tab);
|
||||||
addCloseButtonToTab(tab, tabIndex);
|
addCloseButtonToTab(tab, tabIndex);
|
||||||
gameTabs.insert(event.game_info().game_id(), tab);
|
gameTabs.insert(event.game_info().game_id(), tab);
|
||||||
|
@ -291,6 +290,7 @@ void TabSupervisor::localGameJoined(const Event_GameJoined &event)
|
||||||
{
|
{
|
||||||
TabGame *tab = new TabGame(this, localClients, event, QMap<int, QString>());
|
TabGame *tab = new TabGame(this, localClients, event, QMap<int, QString>());
|
||||||
connect(tab, SIGNAL(gameClosing(TabGame *)), this, SLOT(gameLeft(TabGame *)));
|
connect(tab, SIGNAL(gameClosing(TabGame *)), this, SLOT(gameLeft(TabGame *)));
|
||||||
|
connect(tab, SIGNAL(openDeckEditor(DeckList *)), this, SLOT(addDeckEditorTab(DeckList *)));
|
||||||
int tabIndex = myAddTab(tab);
|
int tabIndex = myAddTab(tab);
|
||||||
addCloseButtonToTab(tab, tabIndex);
|
addCloseButtonToTab(tab, tabIndex);
|
||||||
gameTabs.insert(event.game_info().game_id(), tab);
|
gameTabs.insert(event.game_info().game_id(), tab);
|
||||||
|
@ -387,6 +387,8 @@ void TabSupervisor::talkLeft(TabMessage *tab)
|
||||||
TabDeckEditor *TabSupervisor::addDeckEditorTab(DeckList *deckToOpen)
|
TabDeckEditor *TabSupervisor::addDeckEditorTab(DeckList *deckToOpen)
|
||||||
{
|
{
|
||||||
TabDeckEditor *tab = new TabDeckEditor(this);
|
TabDeckEditor *tab = new TabDeckEditor(this);
|
||||||
|
if (deckToOpen)
|
||||||
|
tab->setDeck(deckToOpen);
|
||||||
connect(tab, SIGNAL(deckEditorClosing(TabDeckEditor *)), this, SLOT(deckEditorClosed(TabDeckEditor *)));
|
connect(tab, SIGNAL(deckEditorClosing(TabDeckEditor *)), this, SLOT(deckEditorClosed(TabDeckEditor *)));
|
||||||
int tabIndex = myAddTab(tab);
|
int tabIndex = myAddTab(tab);
|
||||||
addCloseButtonToTab(tab, tabIndex);
|
addCloseButtonToTab(tab, tabIndex);
|
||||||
|
|
|
@ -76,6 +76,7 @@ signals:
|
||||||
void adminLockChanged(bool lock);
|
void adminLockChanged(bool lock);
|
||||||
public slots:
|
public slots:
|
||||||
TabDeckEditor *addDeckEditorTab(DeckList *deckToOpen);
|
TabDeckEditor *addDeckEditorTab(DeckList *deckToOpen);
|
||||||
|
void openReplay(GameReplay *replay);
|
||||||
private slots:
|
private slots:
|
||||||
void closeButtonPressed();
|
void closeButtonPressed();
|
||||||
void updateCurrent(int index);
|
void updateCurrent(int index);
|
||||||
|
@ -86,7 +87,6 @@ private slots:
|
||||||
void addRoomTab(const ServerInfo_Room &info, bool setCurrent);
|
void addRoomTab(const ServerInfo_Room &info, bool setCurrent);
|
||||||
void roomLeft(TabRoom *tab);
|
void roomLeft(TabRoom *tab);
|
||||||
TabMessage *addMessageTab(const QString &userName, bool focus);
|
TabMessage *addMessageTab(const QString &userName, bool focus);
|
||||||
void openReplay(GameReplay *replay);
|
|
||||||
void replayLeft(TabGame *tab);
|
void replayLeft(TabGame *tab);
|
||||||
void processUserLeft(const QString &userName);
|
void processUserLeft(const QString &userName);
|
||||||
void processUserJoined(const ServerInfo_User &userInfo);
|
void processUserJoined(const ServerInfo_User &userInfo);
|
||||||
|
|
|
@ -56,7 +56,7 @@ void MainWindow::updateTabMenu(const QList<QMenu *> &newMenuList)
|
||||||
menuBar()->removeAction(tabMenus[i]->menuAction());
|
menuBar()->removeAction(tabMenus[i]->menuAction());
|
||||||
tabMenus = newMenuList;
|
tabMenus = newMenuList;
|
||||||
for (int i = 0; i < tabMenus.size(); ++i)
|
for (int i = 0; i < tabMenus.size(); ++i)
|
||||||
menuBar()->insertMenu(tabMenus[i]->menuAction(), tabMenus[i]);
|
menuBar()->insertMenu(helpMenu->menuAction(), tabMenus[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::processConnectionClosedEvent(const Event_ConnectionClosed &event)
|
void MainWindow::processConnectionClosedEvent(const Event_ConnectionClosed &event)
|
||||||
|
@ -175,8 +175,7 @@ void MainWindow::actWatchReplay()
|
||||||
GameReplay *replay = new GameReplay;
|
GameReplay *replay = new GameReplay;
|
||||||
replay->ParseFromArray(buf.data(), buf.size());
|
replay->ParseFromArray(buf.data(), buf.size());
|
||||||
|
|
||||||
TabGame *replayWatcher = new TabGame(0, replay);
|
tabSupervisor->openReplay(replay);
|
||||||
replayWatcher->show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::localGameEnded()
|
void MainWindow::localGameEnded()
|
||||||
|
@ -386,6 +385,8 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
|
|
||||||
resize(900, 700);
|
resize(900, 700);
|
||||||
|
restoreGeometry(settingsCache->getMainWindowGeometry());
|
||||||
|
aFullScreen->setChecked(windowState() & Qt::WindowFullScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
|
@ -403,6 +404,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event->accept();
|
event->accept();
|
||||||
|
settingsCache->setMainWindowGeometry(saveGeometry());
|
||||||
delete tabSupervisor;
|
delete tabSupervisor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue