fix >= 0.7.1 update problems with PokerTH distributed default styles
This commit is contained in:
@@ -47,6 +47,8 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
|||||||
|
|
||||||
myQtToolsInterface = CreateQtToolsWrapper();
|
myQtToolsInterface = CreateQtToolsWrapper();
|
||||||
|
|
||||||
|
myConfigState = OK;
|
||||||
|
|
||||||
// !!!! Revisionsnummer der Configdefaults !!!!!
|
// !!!! Revisionsnummer der Configdefaults !!!!!
|
||||||
configRev = 83;
|
configRev = 83;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
enum ConfigState { NONEXISTING, OLD };
|
enum ConfigState { NONEXISTING, OLD, OK };
|
||||||
enum ConfigType { CONFIG_TYPE_INT, CONFIG_TYPE_STRING, CONFIG_TYPE_INT_LIST, CONFIG_TYPE_STRING_LIST };
|
enum ConfigType { CONFIG_TYPE_INT, CONFIG_TYPE_STRING, CONFIG_TYPE_INT_LIST, CONFIG_TYPE_STRING_LIST };
|
||||||
|
|
||||||
class QtToolsInterface;
|
class QtToolsInterface;
|
||||||
@@ -40,6 +40,7 @@ public:
|
|||||||
void writeBuffer() const;
|
void writeBuffer() const;
|
||||||
|
|
||||||
void updateConfig(ConfigState);
|
void updateConfig(ConfigState);
|
||||||
|
ConfigState getConfigState() const { return myConfigState; }
|
||||||
|
|
||||||
std::string readConfigString(std::string varName) const;
|
std::string readConfigString(std::string varName) const;
|
||||||
std::list<std::string> readConfigStringList(std::string varName) const;
|
std::list<std::string> readConfigStringList(std::string varName) const;
|
||||||
|
|||||||
@@ -35,5 +35,7 @@ Replay::Replay() : replaySqliteLogDb(0)
|
|||||||
Replay::~Replay()
|
Replay::~Replay()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
replaySqliteLogDb->close();
|
||||||
delete replaySqliteLogDb;
|
delete replaySqliteLogDb;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -659,7 +659,7 @@ void gameTableImpl::applySettings(settingsDialogImpl* mySettingsDialog) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
refreshGameTableStyle();
|
refreshGameTableStyle();
|
||||||
qDebug() << "table: " << myGameTableStyle->getStyleDescription() << myGameTableStyle->getState();
|
// qDebug() << "table: " << myGameTableStyle->getStyleDescription() << myGameTableStyle->getState();
|
||||||
if(this->isVisible() && myGameTableStyle->getState() != GT_STYLE_OK) myGameTableStyle->showErrorMessage();
|
if(this->isVisible() && myGameTableStyle->getState() != GT_STYLE_OK) myGameTableStyle->showErrorMessage();
|
||||||
|
|
||||||
//blind buttons refresh
|
//blind buttons refresh
|
||||||
|
|||||||
@@ -191,14 +191,16 @@ Log::Log(gameTableImpl* w, ConfigFile *c) : myW(w), myConfig(c), myLogDir(0), my
|
|||||||
|
|
||||||
Log::~Log()
|
Log::~Log()
|
||||||
{
|
{
|
||||||
|
qDebug() << "close log";
|
||||||
|
|
||||||
// Datenbank schließen
|
// Datenbank schließe
|
||||||
mySqliteLogDb->close();
|
mySqliteLogDb->close();
|
||||||
|
|
||||||
delete myConfig;
|
delete myConfig;
|
||||||
delete myLogDir;
|
delete myLogDir;
|
||||||
delete myHtmlLogFile;
|
delete myHtmlLogFile;
|
||||||
delete mySqliteLogDb;
|
delete mySqliteLogDb;
|
||||||
|
|
||||||
myConfig = 0;
|
myConfig = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ GuiWrapper::GuiWrapper(ConfigFile *c, startWindowImpl *s) : myLog(NULL), myW(NUL
|
|||||||
|
|
||||||
GuiWrapper::~GuiWrapper()
|
GuiWrapper::~GuiWrapper()
|
||||||
{
|
{
|
||||||
|
delete myLog;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiWrapper::initGui(int speed) { myW->signalInitGui(speed); }
|
void GuiWrapper::initGui(int speed) { myW->signalInitGui(speed); }
|
||||||
|
|||||||
@@ -127,8 +127,8 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void settingsDialogImpl::exec() {
|
void settingsDialogImpl::prepareDialog()
|
||||||
|
{
|
||||||
playerNickIsChanged = FALSE;
|
playerNickIsChanged = FALSE;
|
||||||
|
|
||||||
//Player Nicks
|
//Player Nicks
|
||||||
@@ -442,7 +442,6 @@ void settingsDialogImpl::exec() {
|
|||||||
|
|
||||||
refreshLogFileList();
|
refreshLogFileList();
|
||||||
|
|
||||||
|
|
||||||
bool tmpHasIpv6 = socket_has_ipv6();
|
bool tmpHasIpv6 = socket_has_ipv6();
|
||||||
bool tmpHasSctp = socket_has_sctp();
|
bool tmpHasSctp = socket_has_sctp();
|
||||||
checkBox_useIpv6->setEnabled(tmpHasIpv6);
|
checkBox_useIpv6->setEnabled(tmpHasIpv6);
|
||||||
@@ -468,7 +467,11 @@ void settingsDialogImpl::exec() {
|
|||||||
|
|
||||||
//set this AFTER switch combobox like config-settings. This IS a currentIndexChanged() ;-)
|
//set this AFTER switch combobox like config-settings. This IS a currentIndexChanged() ;-)
|
||||||
languageIsChanged = FALSE;
|
languageIsChanged = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void settingsDialogImpl::exec() {
|
||||||
|
|
||||||
|
prepareDialog();
|
||||||
QDialog::exec();
|
QDialog::exec();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -983,6 +986,7 @@ void settingsDialogImpl::showCurrentGameTableStylePreview()
|
|||||||
QString MinimumSize = tr("Minimum Size");
|
QString MinimumSize = tr("Minimum Size");
|
||||||
QString MaximumSize = tr("Maximum Size");
|
QString MaximumSize = tr("Maximum Size");
|
||||||
QString FixedSize = tr("Fixed Size");
|
QString FixedSize = tr("Fixed Size");
|
||||||
|
QString State = tr("State");
|
||||||
|
|
||||||
QString windowsSubString;
|
QString windowsSubString;
|
||||||
if(style.getIfFixedWindowSize().toInt()) {
|
if(style.getIfFixedWindowSize().toInt()) {
|
||||||
@@ -997,7 +1001,8 @@ void settingsDialogImpl::showCurrentGameTableStylePreview()
|
|||||||
maintainerEMailString = "<b>"+MaintainerEMail+":</b> "+style.getStyleMaintainerEMail()+"<br>";
|
maintainerEMailString = "<b>"+MaintainerEMail+":</b> "+style.getStyleMaintainerEMail()+"<br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
label_gameTableStyleInfo->setText("<b>"+MaintainerName+":</b> "+style.getStyleMaintainerName()+"<br>"+maintainerEMailString+"<b>"+CreateDate+":</b> "+style.getStyleCreateDate()+"<br>"+windowsSubString);
|
label_gameTableStyleInfo->setWordWrap(TRUE);
|
||||||
|
label_gameTableStyleInfo->setText("<b>"+MaintainerName+":</b> "+style.getStyleMaintainerName()+"<br>"+maintainerEMailString+"<b>"+CreateDate+":</b> "+style.getStyleCreateDate()+"<br>"+windowsSubString+"<br><b>"+State+": </b>"+style.getMyStateToolTipInfo());
|
||||||
|
|
||||||
//active the current selected item directly
|
//active the current selected item directly
|
||||||
setSelectedGameTableStyleActivated();
|
setSelectedGameTableStyleActivated();
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ class settingsDialogImpl: public QDialog, public Ui::settingsDialog {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
settingsDialogImpl(QWidget *parent = 0, ConfigFile *c = 0, selectAvatarDialogImpl *s = 0);
|
settingsDialogImpl(QWidget *parent = 0, ConfigFile *c = 0, selectAvatarDialogImpl *s = 0);
|
||||||
|
|
||||||
|
void prepareDialog();
|
||||||
void exec();
|
void exec();
|
||||||
|
|
||||||
void setPlayerNickIsChanged(bool theValue){ playerNickIsChanged = theValue;}
|
void setPlayerNickIsChanged(bool theValue){ playerNickIsChanged = theValue;}
|
||||||
|
|||||||
@@ -166,6 +166,27 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
|
|||||||
|
|
||||||
this->show();
|
this->show();
|
||||||
|
|
||||||
|
//update HACKS
|
||||||
|
if(!checkForFirstStartAfterUpdated().isEmpty()) {
|
||||||
|
qDebug() << checkForFirstStartAfterUpdated();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
startWindowImpl::~startWindowImpl()
|
||||||
|
{
|
||||||
|
delete myNewGameDialog;
|
||||||
|
delete mySelectAvatarDialog;
|
||||||
|
delete mySettingsDialog;
|
||||||
|
delete myChangeHumanPlayerNameDialog;
|
||||||
|
delete myJoinNetworkGameDialog;
|
||||||
|
delete myConnectToServerDialog;
|
||||||
|
delete myStartNetworkGameDialog;
|
||||||
|
delete myCreateNetworkGameDialog;
|
||||||
|
delete myAboutPokerthDialog;
|
||||||
|
delete myGameLobbyDialog;
|
||||||
|
delete myTimeoutDialog;
|
||||||
|
delete myServerListDialog;
|
||||||
|
delete myInternetGameLoginDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
void startWindowImpl::callNewGameDialog() {
|
void startWindowImpl::callNewGameDialog() {
|
||||||
@@ -897,3 +918,21 @@ QStringList startWindowImpl::getPlayerNicksList() {
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString startWindowImpl::checkForFirstStartAfterUpdated()
|
||||||
|
{
|
||||||
|
if(myConfig->getConfigState() == OLD) {
|
||||||
|
|
||||||
|
if(POKERTH_VERSION_MAJOR == 0 && POKERTH_VERSION_MINOR == 80) {
|
||||||
|
//version 0.8 HACK
|
||||||
|
//to avoid old PokerTH distributed styles pathes in settings which leads to error message like "outdated" prepare settings dialog (fallback will correct this issue) and save settings
|
||||||
|
mySettingsDialog->prepareDialog();
|
||||||
|
mySettingsDialog->isAccepted();
|
||||||
|
myGuiInterface->getMyW()->applySettings(mySettingsDialog);
|
||||||
|
}
|
||||||
|
return QString("Update old config to version %1").arg(QString::number(POKERTH_VERSION_MAJOR)+"."+QString::number(POKERTH_VERSION_MINOR));
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ class startWindowImpl: public QMainWindow, public Ui::startWindow {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
startWindowImpl(ConfigFile *c =0);
|
startWindowImpl(ConfigFile *c =0);
|
||||||
|
~startWindowImpl();
|
||||||
|
|
||||||
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
|
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
|
||||||
boost::shared_ptr<Session> getSession() { assert(mySession.get()); return mySession; }
|
boost::shared_ptr<Session> getSession() { assert(mySession.get()); return mySession; }
|
||||||
@@ -123,6 +124,8 @@ public slots:
|
|||||||
void networkStart(boost::shared_ptr<Game> game);
|
void networkStart(boost::shared_ptr<Game> game);
|
||||||
QStringList getPlayerNicksList();
|
QStringList getPlayerNicksList();
|
||||||
|
|
||||||
|
QString checkForFirstStartAfterUpdated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
|
|
||||||
|
|||||||
@@ -606,10 +606,10 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
|||||||
if(ChatLogTextSize == "") { ChatLogTextSize = getFallBackFieldContent("ChatLogTextSize", 0); leftItems << "ChatLogTextSize"; }
|
if(ChatLogTextSize == "") { ChatLogTextSize = getFallBackFieldContent("ChatLogTextSize", 0); leftItems << "ChatLogTextSize"; }
|
||||||
|
|
||||||
//set loadedSuccessfull TRUE if everything works
|
//set loadedSuccessfull TRUE if everything works
|
||||||
qDebug() << "leftitem is empty: " << leftItems.isEmpty() << "pics left is empty: " << itemPicsLeft.isEmpty() << "stylefileversion is: " << PokerTHStyleFileVersion;
|
// qDebug() << "leftitem is empty: " << leftItems.isEmpty() << "pics left is empty: " << itemPicsLeft.isEmpty() << "stylefileversion is: " << PokerTHStyleFileVersion;
|
||||||
if(leftItems.isEmpty() && itemPicsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_GT_STYLE_FILE_VERSION) {
|
if(leftItems.isEmpty() && itemPicsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_GT_STYLE_FILE_VERSION) {
|
||||||
myState = GT_STYLE_OK;
|
myState = GT_STYLE_OK;
|
||||||
qDebug() << "myState of: " << StyleDescription << "is now: " << myState;
|
// qDebug() << "myState of: " << StyleDescription << "is now: " << myState;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//check for style file version
|
//check for style file version
|
||||||
@@ -624,7 +624,7 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
|||||||
if(!itemPicsLeft.isEmpty() && myW != 0) myState = GT_STYLE_PICTURES_MISSING;
|
if(!itemPicsLeft.isEmpty() && myW != 0) myState = GT_STYLE_PICTURES_MISSING;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "myState of: " << StyleDescription << "is now: " << myState;
|
// qDebug() << "myState of: " << StyleDescription << "is now: " << myState;
|
||||||
}
|
}
|
||||||
loadedSuccessfull = 1;
|
loadedSuccessfull = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user