automatically save and restore gametable geometry (including fullscreen)
This commit is contained in:
@@ -48,7 +48,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
|||||||
myQtToolsInterface = CreateQtToolsWrapper();
|
myQtToolsInterface = CreateQtToolsWrapper();
|
||||||
|
|
||||||
// !!!! Revisionsnummer der Configdefaults !!!!!
|
// !!!! Revisionsnummer der Configdefaults !!!!!
|
||||||
configRev = 62;
|
configRev = 63;
|
||||||
|
|
||||||
//standard defaults
|
//standard defaults
|
||||||
logOnOffDefault = "1";
|
logOnOffDefault = "1";
|
||||||
@@ -250,7 +250,9 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
|||||||
configList.push_back(ConfigInfo("DisableBackToLobbyWarning", CONFIG_TYPE_INT, "0"));
|
configList.push_back(ConfigInfo("DisableBackToLobbyWarning", CONFIG_TYPE_INT, "0"));
|
||||||
configList.push_back(ConfigInfo("DlgGameLobbyGameListSortingSection", CONFIG_TYPE_INT, "2"));
|
configList.push_back(ConfigInfo("DlgGameLobbyGameListSortingSection", CONFIG_TYPE_INT, "2"));
|
||||||
configList.push_back(ConfigInfo("DlgGameLobbyGameListSortingOrder", CONFIG_TYPE_INT, "1"));
|
configList.push_back(ConfigInfo("DlgGameLobbyGameListSortingOrder", CONFIG_TYPE_INT, "1"));
|
||||||
|
configList.push_back(ConfigInfo("GameTableFullScreenSave", CONFIG_TYPE_INT, "0"));
|
||||||
|
configList.push_back(ConfigInfo("GameTableHeightSave", CONFIG_TYPE_INT, "600"));
|
||||||
|
configList.push_back(ConfigInfo("GameTableWidthSave", CONFIG_TYPE_INT, "1024"));
|
||||||
|
|
||||||
//fill tempList firstTime
|
//fill tempList firstTime
|
||||||
configBufferList = configList;
|
configBufferList = configList;
|
||||||
|
|||||||
@@ -2770,6 +2770,9 @@ void gameTableImpl::localGameModification() {
|
|||||||
|
|
||||||
//clear log
|
//clear log
|
||||||
textBrowser_Log->clear();
|
textBrowser_Log->clear();
|
||||||
|
|
||||||
|
//restore saved windows geometry
|
||||||
|
restoreGameTableGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameTableImpl::networkGameModification() {
|
void gameTableImpl::networkGameModification() {
|
||||||
@@ -2804,6 +2807,9 @@ void gameTableImpl::networkGameModification() {
|
|||||||
|
|
||||||
//clear log
|
//clear log
|
||||||
textBrowser_Log->clear();
|
textBrowser_Log->clear();
|
||||||
|
|
||||||
|
//restore saved windows geometry
|
||||||
|
restoreGameTableGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameTableImpl::mouseOverFlipCards(bool front) {
|
void gameTableImpl::mouseOverFlipCards(bool front) {
|
||||||
@@ -2909,6 +2915,7 @@ void gameTableImpl::closeGameTable() {
|
|||||||
myStartWindow->getSession()->terminateNetworkClient();
|
myStartWindow->getSession()->terminateNetworkClient();
|
||||||
stopTimer();
|
stopTimer();
|
||||||
if (myStartWindow->getMyServerGuiInterface().get()) myStartWindow->getMyServerGuiInterface()->getSession()->terminateNetworkServer();
|
if (myStartWindow->getMyServerGuiInterface().get()) myStartWindow->getMyServerGuiInterface()->getSession()->terminateNetworkServer();
|
||||||
|
saveGameTableGeometry();
|
||||||
myStartWindow->show();
|
myStartWindow->show();
|
||||||
this->hide();
|
this->hide();
|
||||||
}
|
}
|
||||||
@@ -2916,6 +2923,7 @@ void gameTableImpl::closeGameTable() {
|
|||||||
else {
|
else {
|
||||||
myStartWindow->getSession()->terminateNetworkClient();
|
myStartWindow->getSession()->terminateNetworkClient();
|
||||||
stopTimer();
|
stopTimer();
|
||||||
|
saveGameTableGeometry();
|
||||||
myStartWindow->show();
|
myStartWindow->show();
|
||||||
this->hide();
|
this->hide();
|
||||||
}
|
}
|
||||||
@@ -3234,3 +3242,30 @@ void gameTableImpl::refreshGameTableStyle()
|
|||||||
|
|
||||||
label_Handranking->setPixmap(myGameTableStyle->getHandRanking());
|
label_Handranking->setPixmap(myGameTableStyle->getHandRanking());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gameTableImpl::saveGameTableGeometry()
|
||||||
|
{
|
||||||
|
if(this->isFullScreen()) {
|
||||||
|
myConfig->writeConfigInt("GameTableFullScreenSave", 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myConfig->writeConfigInt("GameTableFullScreenSave", 0);
|
||||||
|
myConfig->writeConfigInt("GameTableHeightSave", this->height());
|
||||||
|
myConfig->writeConfigInt("GameTableWidthSave", this->width());
|
||||||
|
}
|
||||||
|
myConfig->writeBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void gameTableImpl::restoreGameTableGeometry()
|
||||||
|
{
|
||||||
|
if(myConfig->readConfigInt("GameTableFullScreenSave")) {
|
||||||
|
if(actionFullScreen->isEnabled()) this->showFullScreen();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//resize only if style size allow this and if NOT fixed windows size
|
||||||
|
if(!myGameTableStyle->getIfFixedWindowSize().toInt() && myConfig->readConfigInt("GameTableHeightSave") <= myGameTableStyle->getMaximumWindowHeight().toInt() && myConfig->readConfigInt("GameTableHeightSave") >= myGameTableStyle->getMinimumWindowHeight().toInt() && myConfig->readConfigInt("GameTableWidthSave") <= myGameTableStyle->getMaximumWindowWidth().toInt() && myConfig->readConfigInt("GameTableWidthSave") >= myGameTableStyle->getMinimumWindowWidth().toInt()){
|
||||||
|
|
||||||
|
this->resize(myConfig->readConfigInt("GameTableWidthSave"), myConfig->readConfigInt("GameTableHeightSave"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -297,6 +297,8 @@ public slots:
|
|||||||
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
||||||
|
|
||||||
void refreshGameTableStyle();
|
void refreshGameTableStyle();
|
||||||
|
void saveGameTableGeometry();
|
||||||
|
void restoreGameTableGeometry();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -219,6 +219,9 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
|||||||
}
|
}
|
||||||
wrongItems.clear();
|
wrongItems.clear();
|
||||||
|
|
||||||
|
// INFOS
|
||||||
|
if(StyleDescription == "") { wrongItems << "StyleDescription"; }
|
||||||
|
// WINDOWS SETTINGS
|
||||||
if(IfFixedWindowSize == "") { wrongItems << "IfFixedWindowSize"; }
|
if(IfFixedWindowSize == "") { wrongItems << "IfFixedWindowSize"; }
|
||||||
if(FixedWindowWidth == "") { wrongItems << "FixedWindowWidth"; }
|
if(FixedWindowWidth == "") { wrongItems << "FixedWindowWidth"; }
|
||||||
if(FixedWindowHeight == "") { wrongItems << "FixedWindowHeight"; }
|
if(FixedWindowHeight == "") { wrongItems << "FixedWindowHeight"; }
|
||||||
@@ -226,6 +229,7 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
|||||||
if(MinimumWindowHeight == "") { wrongItems << "MinimumWindowHeight"; }
|
if(MinimumWindowHeight == "") { wrongItems << "MinimumWindowHeight"; }
|
||||||
if(MaximumWindowWidth == "") { wrongItems << "MaximumWindowWidth"; }
|
if(MaximumWindowWidth == "") { wrongItems << "MaximumWindowWidth"; }
|
||||||
if(MaximumWindowHeight == "") { wrongItems << "MaximumWindowHeight"; }
|
if(MaximumWindowHeight == "") { wrongItems << "MaximumWindowHeight"; }
|
||||||
|
// PICS
|
||||||
if(ActionAllIn == "") { wrongItems << "ActionAllIn"; }
|
if(ActionAllIn == "") { wrongItems << "ActionAllIn"; }
|
||||||
if(ActionRaise == "") { wrongItems << "ActionRaise"; }
|
if(ActionRaise == "") { wrongItems << "ActionRaise"; }
|
||||||
if(ActionBet == "") { wrongItems << "ActionBet"; }
|
if(ActionBet == "") { wrongItems << "ActionBet"; }
|
||||||
@@ -268,6 +272,7 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
|||||||
if(Table == "") { wrongItems << "Table"; }
|
if(Table == "") { wrongItems << "Table"; }
|
||||||
if(HandRanking == "") { wrongItems << "HandRanking"; }
|
if(HandRanking == "") { wrongItems << "HandRanking"; }
|
||||||
if(ToolBoxBackground == "") { wrongItems << "ToolBoxBackground"; }
|
if(ToolBoxBackground == "") { wrongItems << "ToolBoxBackground"; }
|
||||||
|
// COLORS
|
||||||
if(FKeyIndicatorColor == "") { wrongItems << "FKeyIndicatorColor"; }
|
if(FKeyIndicatorColor == "") { wrongItems << "FKeyIndicatorColor"; }
|
||||||
if(ChanceLabelPossibleColor == "") { wrongItems << "ChanceLabelPossibleColor"; }
|
if(ChanceLabelPossibleColor == "") { wrongItems << "ChanceLabelPossibleColor"; }
|
||||||
if(ChanceLabelImpossibleColor == "") { wrongItems << "ChanceLabelImpossibleColor"; }
|
if(ChanceLabelImpossibleColor == "") { wrongItems << "ChanceLabelImpossibleColor"; }
|
||||||
@@ -319,6 +324,7 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
|||||||
if(BetSpeedSliderGrooveBorderColor == "") { wrongItems << "BetSpeedSliderGrooveBorderColor"; }
|
if(BetSpeedSliderGrooveBorderColor == "") { wrongItems << "BetSpeedSliderGrooveBorderColor"; }
|
||||||
if(BetSpeedSliderHandleBgColor == "") { wrongItems << "BetSpeedSliderHandleBgColor"; }
|
if(BetSpeedSliderHandleBgColor == "") { wrongItems << "BetSpeedSliderHandleBgColor"; }
|
||||||
if(BetSpeedSliderHandleBorderColor == "") { wrongItems << "BetSpeedSliderHandleBorderColor"; }
|
if(BetSpeedSliderHandleBorderColor == "") { wrongItems << "BetSpeedSliderHandleBorderColor"; }
|
||||||
|
// SIZE
|
||||||
if(ChatLogTextSize == "") { wrongItems << "ChatLogTextSize"; }
|
if(ChatLogTextSize == "") { wrongItems << "ChatLogTextSize"; }
|
||||||
|
|
||||||
//if one or more items are wrong or left show detailed error message
|
//if one or more items are wrong or left show detailed error message
|
||||||
@@ -555,6 +561,8 @@ void GameTableStyleReader::setWindowsGeometry(gameTableImpl *gt)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gt->actionFullScreen->setDisabled(TRUE);
|
gt->actionFullScreen->setDisabled(TRUE);
|
||||||
|
if(gt->isFullScreen())
|
||||||
|
gt->showNormal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -570,6 +578,8 @@ void GameTableStyleReader::setWindowsGeometry(gameTableImpl *gt)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gt->actionFullScreen->setDisabled(TRUE);
|
gt->actionFullScreen->setDisabled(TRUE);
|
||||||
|
if(gt->isFullScreen())
|
||||||
|
gt->showNormal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,13 +47,24 @@ public:
|
|||||||
QString getSmallBlindPuck() const { return SmallBlindPuck; }
|
QString getSmallBlindPuck() const { return SmallBlindPuck; }
|
||||||
QString getBigBlindPuck() const { return BigBlindPuck; }
|
QString getBigBlindPuck() const { return BigBlindPuck; }
|
||||||
QString getHandRanking() const { return HandRanking; }
|
QString getHandRanking() const { return HandRanking; }
|
||||||
|
QString getActionPic(int);
|
||||||
|
|
||||||
QString getFKeyIndicatorColor() const { return FKeyIndicatorColor; }
|
QString getFKeyIndicatorColor() const { return FKeyIndicatorColor; }
|
||||||
QString getChanceLabelImpossibleColor() const { return ChanceLabelImpossibleColor; }
|
QString getChanceLabelImpossibleColor() const { return ChanceLabelImpossibleColor; }
|
||||||
QString getChanceLabelPossibleColor() const { return ChanceLabelPossibleColor; }
|
QString getChanceLabelPossibleColor() const { return ChanceLabelPossibleColor; }
|
||||||
QString getChatLogTextColor() const { return ChatLogTextColor; }
|
QString getChatLogTextColor() const { return ChatLogTextColor; }
|
||||||
QString getChatTextNickNotifyColor() const { return ChatTextNickNotifyColor; }
|
QString getChatTextNickNotifyColor() const { return ChatTextNickNotifyColor; }
|
||||||
|
QString getLogWinnerMainPotColor() const { return LogWinnerMainPotColor; }
|
||||||
|
QString getLogWinnerSidePotColor() const { return LogWinnerSidePotColor; }
|
||||||
|
QString getLogPlayerSitsOutColor() const { return LogPlayerSitsOutColor; }
|
||||||
|
QString getLogNewGameAdminColor() const { return LogNewGameAdminColor; }
|
||||||
|
QString getBreakLobbyButtonBgColor() const { return BreakLobbyButtonBgColor; }
|
||||||
|
|
||||||
QString getActionPic(int);
|
QString getMinimumWindowWidth() const { return MinimumWindowWidth; }
|
||||||
|
QString getMinimumWindowHeight() const { return MinimumWindowHeight; }
|
||||||
|
QString getMaximumWindowWidth() const { return MaximumWindowWidth; }
|
||||||
|
QString getMaximumWindowHeight() const { return MaximumWindowHeight; }
|
||||||
|
QString getIfFixedWindowSize() const { return IfFixedWindowSize; }
|
||||||
|
|
||||||
bool getFallBack() const { return fallBack; }
|
bool getFallBack() const { return fallBack; }
|
||||||
|
|
||||||
@@ -88,12 +99,6 @@ public:
|
|||||||
void setButtonsStyle(MyActionButton*, MyActionButton*, MyActionButton*, MyActionButton*, int);
|
void setButtonsStyle(MyActionButton*, MyActionButton*, MyActionButton*, MyActionButton*, int);
|
||||||
void setAwayRadioButtonsStyle(QRadioButton*);
|
void setAwayRadioButtonsStyle(QRadioButton*);
|
||||||
|
|
||||||
QString getLogWinnerMainPotColor() const { return LogWinnerMainPotColor; }
|
|
||||||
QString getLogWinnerSidePotColor() const { return LogWinnerSidePotColor; }
|
|
||||||
QString getLogPlayerSitsOutColor() const { return LogPlayerSitsOutColor; }
|
|
||||||
QString getLogNewGameAdminColor() const { return LogNewGameAdminColor; }
|
|
||||||
QString getBreakLobbyButtonBgColor() const { return BreakLobbyButtonBgColor; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//style values
|
//style values
|
||||||
// INFOS
|
// INFOS
|
||||||
|
|||||||
Reference in New Issue
Block a user