qt5 refactoring ...

This commit is contained in:
doitux committed 2013-08-28 10:49:03 +02:00
1 parent 1d0b9fc5f2
commit 20840a2af0
90 files changed
+1910 -3067

No files matched your search

@@ -35,7 +35,7 @@
manualBlindsOrderDialogImpl::manualBlindsOrderDialogImpl(QWidget *parent, ConfigFile *c)
: QDialog(parent), myConfig(c), settingsCorrect(TRUE)
: QDialog(parent), myConfig(c), settingsCorrect(true)
{
#ifdef __APPLE__
setWindowModality(Qt::ApplicationModal);
@@ -48,11 +48,9 @@ manualBlindsOrderDialogImpl::manualBlindsOrderDialogImpl(QWidget *parent, Config
}
void manualBlindsOrderDialogImpl::exec()
int manualBlindsOrderDialogImpl::exec()
{
QDialog::exec();
return QDialog::exec();
}
@@ -82,7 +80,7 @@ void manualBlindsOrderDialogImpl::sortBlindsList()
int i;
QList<int> tempIntList;
QStringList tempStringList;
bool ok = TRUE;
bool ok = true;
for(i=0; i<listWidget_blinds->count(); i++) {
// std::cout << listWidget_blinds->item(i)->text().toInt(&ok,10) << "\n";
@@ -48,7 +48,7 @@ class manualBlindsOrderDialogImpl: public QDialog, public Ui::manualBlindsOrderD
public:
manualBlindsOrderDialogImpl(QWidget *parent = 0, ConfigFile *c = 0);
void exec();
int exec();
public slots:
@@ -33,6 +33,9 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#endif
class MyAvatarButton : public QPushButton
{
@@ -33,6 +33,9 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#endif
class MyHPAvatarButton : public QPushButton
{
@@ -33,6 +33,9 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#endif
class MyStyleListItem : public QTreeWidgetItem
{
@@ -33,6 +33,9 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#endif
class MyAvatarListItem : public QListWidgetItem
{
@@ -36,7 +36,7 @@
selectAvatarDialogImpl::selectAvatarDialogImpl(QWidget *parent, ConfigFile *c)
: QDialog(parent), myConfig(c), settingsCorrect(TRUE), avatarDir("")
: QDialog(parent), myConfig(c), settingsCorrect(true), avatarDir("")
{
#ifdef __APPLE__
setWindowModality(Qt::ApplicationModal);
@@ -56,7 +56,7 @@ selectAvatarDialogImpl::selectAvatarDialogImpl(QWidget *parent, ConfigFile *c)
// listWidget->setFlow(QListView::TopToBottom);
// listWidget->setWrapping(true);
listWidget->setSpacing(20);
listWidget->setDragEnabled(FALSE);
listWidget->setDragEnabled(false);
listWidget->setResizeMode(QListView::Adjust);
@@ -174,14 +174,12 @@ selectAvatarDialogImpl::selectAvatarDialogImpl(QWidget *parent, ConfigFile *c)
}
void selectAvatarDialogImpl::exec()
int selectAvatarDialogImpl::exec()
{
//clear
lineEdit->setText("");
refreshAvatarView();
QDialog::exec();
return QDialog::exec();
}
void selectAvatarDialogImpl::refreshAvatarView()
@@ -217,12 +215,12 @@ void selectAvatarDialogImpl::refreshAvatarView()
void selectAvatarDialogImpl::toggleGroupBox1(bool /*toggleState*/)
{
if(groupBox->isChecked()) groupBox_2->setChecked(FALSE);
if(groupBox->isChecked()) groupBox_2->setChecked(false);
}
void selectAvatarDialogImpl::toggleGroupBox2(bool /*toggleState*/)
{
if(groupBox_2->isChecked()) groupBox->setChecked(FALSE);
if(groupBox_2->isChecked()) groupBox->setChecked(false);
}
QString selectAvatarDialogImpl::getAvatarLink()
@@ -247,15 +245,15 @@ void selectAvatarDialogImpl::isAccepted()
QList<QListWidgetItem *> myItemList = listWidget->selectedItems();
settingsCorrect = TRUE;
settingsCorrect = true;
if(groupBox->isChecked()) {
if(myItemList.size() == 0) {
MyMessageBox::warning(this, tr("Avatar File Error"),
tr("Please select an avatar from the list!"),
QMessageBox::Ok);
settingsCorrect = FALSE;
} else settingsCorrect = TRUE;;
settingsCorrect = false;
} else settingsCorrect = true;;
}
if(groupBox_2->isChecked()) {
@@ -264,13 +262,13 @@ void selectAvatarDialogImpl::isAccepted()
if(lineEditFile.size() <= 30720 ) {
externalAvatar = lineEdit->text();
settingsCorrect = TRUE;
settingsCorrect = true;
} else {
MyMessageBox::warning(this, tr("Avatar File Error"),
tr("The file size of the chosen picture is too big. (max. 30KB)\n"
"Please choose a smaller picture!"),
QMessageBox::Ok);
settingsCorrect = FALSE;
settingsCorrect = false;
externalAvatar = "";
}
@@ -279,7 +277,7 @@ void selectAvatarDialogImpl::isAccepted()
tr("The entered avatar picture doesn't exist.\n"
"Please enter an valid picture!"),
QMessageBox::Ok);
settingsCorrect = FALSE;
settingsCorrect = false;
externalAvatar = "";
}
}
@@ -292,7 +290,7 @@ void selectAvatarDialogImpl::isAccepted()
void selectAvatarDialogImpl::isRejected()
{
settingsCorrect = FALSE;
settingsCorrect = false;
}
void selectAvatarDialogImpl::setExternalAvatar()
@@ -36,7 +36,9 @@
#else
#include "ui_selectavatardialog.h"
#endif
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#endif
#include <QtCore>
#include <QtGui>
@@ -49,7 +51,7 @@ class selectAvatarDialogImpl: public QDialog, public Ui::selectAvatarDialog
public:
selectAvatarDialogImpl(QWidget *parent = 0, ConfigFile *c = 0);
void exec();
int exec();
public slots:
@@ -65,7 +65,7 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
pushButton_openLogDir->setIcon(QIcon(QPixmap(myAppDataPath+"gfx/gui/misc/fileopen16.png")));
if (myConfig->readConfigInt("CLA_NoWriteAccess")) {
groupBox_logOnOff->setDisabled(TRUE);
groupBox_logOnOff->setDisabled(true);
}
comboBox_switchLanguage->addItem(QString(tr("Afrikaans")+" "+QString::fromUtf8("(Afrikaans)")),"af");
@@ -165,7 +165,7 @@ settingsDialogImpl::~settingsDialogImpl()
void settingsDialogImpl::prepareDialog()
{
playerNickIsChanged = FALSE;
playerNickIsChanged = false;
//Player Nicks
lineEdit_HumanPlayerName->setText(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()));
@@ -247,10 +247,10 @@ void settingsDialogImpl::prepareDialog()
if(myConfig->readConfigInt("UseAvatarServer")) {
lineEdit_avatarServerAddress->setText(QString::fromUtf8(myConfig->readConfigString("AvatarServerAddress").c_str()));
checkBox_useAvatarServer->setCheckState(Qt::Checked);
lineEdit_avatarServerAddress->setEnabled(TRUE);
lineEdit_avatarServerAddress->setEnabled(true);
} else {
checkBox_useAvatarServer->setCheckState(Qt::Unchecked);
lineEdit_avatarServerAddress->setEnabled(FALSE);
lineEdit_avatarServerAddress->setEnabled(false);
}
checkBox_UseInternetGamePassword->setChecked(myConfig->readConfigInt("UseInternetGamePassword"));
if(myConfig->readConfigInt("UseInternetGamePassword")) {
@@ -261,9 +261,9 @@ void settingsDialogImpl::prepareDialog()
comboBox_internetGameType->setCurrentIndex(myConfig->readConfigInt("InternetGameType"));
lineEdit_internetGameName->setText(QString::fromUtf8(myConfig->readConfigString("InternetGameName").c_str()));
if(myConfig->readConfigInt("InternetServerConfigMode")) {
groupBox_manualServerConfig->setChecked(TRUE);
groupBox_manualServerConfig->setChecked(true);
} else {
groupBox_automaticServerConfig->setChecked(TRUE);
groupBox_automaticServerConfig->setChecked(true);
}
std::list<std::string> playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList");
@@ -379,13 +379,13 @@ void settingsDialogImpl::prepareDialog()
currentGameTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentGameTableStyle").c_str()));
if(currentGameTableStyle.getLoadedSuccessfull()) {
int i;
bool currentGameTableFound(FALSE);
bool currentGameTableFound(false);
for(i=0; i < treeWidget_gameTableStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_gameTableStyles->topLevelItem(i);
if(item->data(0, 15) == currentGameTableStyle.getCurrentFileName()) {
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
treeWidget_gameTableStyles->setCurrentItem(item);
currentGameTableFound=TRUE;
currentGameTableFound=true;
} else item->setIcon(0, QIcon());
}
if(!currentGameTableFound) {
@@ -480,13 +480,13 @@ void settingsDialogImpl::prepareDialog()
currentCardDeckStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentCardDeckStyle").c_str()));
if(currentCardDeckStyle.getLoadedSuccessfull()) {
int j;
bool currentCardDeckFound(FALSE);
bool currentCardDeckFound(false);
for(j=0; j < treeWidget_cardDeckStyles->topLevelItemCount(); j++) {
QTreeWidgetItem *item = treeWidget_cardDeckStyles->topLevelItem(j);
if(item->data(0, 15) == currentCardDeckStyle.getCurrentFileName()) {
item->setIcon(0, QIcon(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"/gfx/gui/misc/rating.png"));
treeWidget_cardDeckStyles->setCurrentItem(item);
currentCardDeckFound=TRUE;
currentCardDeckFound=true;
} else item->setIcon(0, QIcon());
}
if(!currentCardDeckFound) {
@@ -521,8 +521,8 @@ void settingsDialogImpl::prepareDialog()
radioButton_flipsideTux->setChecked(myConfig->readConfigInt("FlipsideTux"));
radioButton_flipsideOwn->setChecked(myConfig->readConfigInt("FlipsideOwn"));
if(radioButton_flipsideOwn->isChecked()) {
lineEdit_OwnFlipsideFilename->setEnabled(TRUE);
pushButton_openFlipsidePicture->setEnabled(TRUE);
lineEdit_OwnFlipsideFilename->setEnabled(true);
pushButton_openFlipsidePicture->setEnabled(true);
}
lineEdit_OwnFlipsideFilename->setText(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str()));
@@ -564,7 +564,7 @@ void settingsDialogImpl::prepareDialog()
setFirstSmallBlindMargin();
//set this AFTER switch combobox like config-settings. This IS a currentIndexChanged() ;-)
languageIsChanged = FALSE;
languageIsChanged = false;
//disable reset config button when dialog is called from ingame
if(calledIngame) {
@@ -587,7 +587,7 @@ void settingsDialogImpl::exec(bool in_game)
void settingsDialogImpl::isAccepted()
{
settingsCorrect = TRUE;
settingsCorrect = true;
// Player Nicks
//check if all player nicks are unique --> otherwise dont save
@@ -608,7 +608,7 @@ void settingsDialogImpl::isAccepted()
tr("The opponent names are not unique.\n"
"Please choose different names for each Opponent!"),
QMessageBox::Ok);
settingsCorrect = FALSE;
settingsCorrect = false;
} else {
//save nicks and avatars
myConfig->writeConfigString("MyName", lineEdit_HumanPlayerName->text().trimmed().toUtf8().constData());
@@ -689,7 +689,7 @@ void settingsDialogImpl::isAccepted()
tr("The entered server list address is not a valid URL.\n"
"Please enter a valid server list address!"),
QMessageBox::Ok);
settingsCorrect = FALSE;
settingsCorrect = false;
}
}
if(groupBox_manualServerConfig->isChecked()) {
@@ -755,7 +755,7 @@ void settingsDialogImpl::isAccepted()
tr("The entered flipside picture doesn't exist.\n"
"Please enter an valid picture!"),
QMessageBox::Ok);
settingsCorrect = FALSE;
settingsCorrect = false;
}
}
@@ -815,7 +815,7 @@ void settingsDialogImpl::isAccepted()
tr("The log file directory doesn't exist.\n"
"Please select an valid directory!"),
QMessageBox::Ok);
settingsCorrect = FALSE;
settingsCorrect = false;
}
myConfig->writeConfigInt("LogStoreDuration", spinBox_logStoreDuration->value());
@@ -1021,7 +1021,7 @@ void settingsDialogImpl::callManualBlindsOrderDialog()
myManualBlindsOrderDialog->exec();
if(myManualBlindsOrderDialog->result() == QDialog::Accepted) {
bool ok = TRUE;
bool ok = true;
int i;
myManualBlindsList.clear();
for(i=0; i<myManualBlindsOrderDialog->listWidget_blinds->count(); i++) {
@@ -1057,7 +1057,7 @@ void settingsDialogImpl::callNetManualBlindsOrderDialog()
myManualBlindsOrderDialog->exec();
if(myManualBlindsOrderDialog->result() == QDialog::Accepted) {
bool ok = TRUE;
bool ok = true;
int i;
myNetManualBlindsList.clear();
for(i=0; i<myManualBlindsOrderDialog->listWidget_blinds->count(); i++) {
@@ -1113,21 +1113,21 @@ void settingsDialogImpl::setFirstSmallBlindMargin()
void settingsDialogImpl::setLanguageChanged(int index)
{
languageIsChanged = TRUE;
languageIsChanged = true;
changedLanguageIndex = index;
}
void settingsDialogImpl::toggleGroupBoxAutomaticServerConfig(bool toggleState)
{
if(toggleState) groupBox_manualServerConfig->setChecked(FALSE);
else groupBox_manualServerConfig->setChecked(TRUE);
if(toggleState) groupBox_manualServerConfig->setChecked(false);
else groupBox_manualServerConfig->setChecked(true);
}
void settingsDialogImpl::toggleGroupBoxManualServerConfig(bool toggleState)
{
if(toggleState) groupBox_automaticServerConfig->setChecked(FALSE);
else groupBox_automaticServerConfig->setChecked(TRUE);
if(toggleState) groupBox_automaticServerConfig->setChecked(false);
else groupBox_automaticServerConfig->setChecked(true);
}
void settingsDialogImpl::showCurrentGameTableStylePreview()
@@ -1163,7 +1163,7 @@ void settingsDialogImpl::showCurrentGameTableStylePreview()
maintainerEMailString = "<b>"+MaintainerEMail+":</b> "+style.getStyleMaintainerEMail()+"<br>";
}
label_gameTableStyleInfo->setWordWrap(TRUE);
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
@@ -1171,9 +1171,9 @@ void settingsDialogImpl::showCurrentGameTableStylePreview()
//disable remove button for distributed styles
if(item->data(0, 16).toInt() == POKERTH_DISTRIBUTED_STYLE) {
pushButton_removeGameTableStyle->setDisabled(TRUE);
pushButton_removeGameTableStyle->setDisabled(true);
} else {
pushButton_removeGameTableStyle->setDisabled(FALSE);
pushButton_removeGameTableStyle->setDisabled(false);
}
}
@@ -1208,11 +1208,11 @@ void settingsDialogImpl::addGameTableStyle()
if (!fileName.isEmpty()) {
int i;
bool fileNameAlreadyFound(FALSE);
bool fileNameAlreadyFound(false);
for(i=0; i < treeWidget_gameTableStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_gameTableStyles->topLevelItem(i);
if(item->data(0, 15).toString() == fileName)
fileNameAlreadyFound = TRUE;
fileNameAlreadyFound = true;
}
if(fileNameAlreadyFound) {
@@ -1290,7 +1290,7 @@ void settingsDialogImpl::showCurrentCardDeckStylePreview()
}
#ifdef GUI_800x480
label_cardDeckStyleInfo->setWordWrap(TRUE);
label_cardDeckStyleInfo->setWordWrap(true);
#endif
label_cardDeckStyleInfo->setText("<b>"+MaintainerName+":</b> "+style.getStyleMaintainerName()+"<br>"+maintainerEMailString+"<b>"+CreateDate+":</b> "+style.getStyleCreateDate()+"");
//active the current selected item directly
@@ -1298,9 +1298,9 @@ void settingsDialogImpl::showCurrentCardDeckStylePreview()
//disable remove button for distributed styles
if(item->data(0, 16).toInt() == POKERTH_DISTRIBUTED_STYLE) {
pushButton_removeCardDeckStyle->setDisabled(TRUE);
pushButton_removeCardDeckStyle->setDisabled(true);
} else {
pushButton_removeCardDeckStyle->setDisabled(FALSE);
pushButton_removeCardDeckStyle->setDisabled(false);
}
}
}
@@ -1334,11 +1334,11 @@ void settingsDialogImpl::addCardDeckStyle()
if (!fileName.isEmpty()) {
int i;
bool fileNameAlreadyFound(FALSE);
bool fileNameAlreadyFound(false);
for(i=0; i < treeWidget_cardDeckStyles->topLevelItemCount(); i++) {
QTreeWidgetItem *item = treeWidget_cardDeckStyles->topLevelItem(i);
if(item->data(0, 15).toString() == fileName)
fileNameAlreadyFound = TRUE;
fileNameAlreadyFound = true;
}
if(fileNameAlreadyFound) {
@@ -41,6 +41,9 @@
#include <QtCore>
#include <QtGui>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#endif
#include <boost/shared_ptr.hpp>
#include <vector>
@@ -83,7 +86,7 @@ public slots:
void isAccepted();
void playerNickChanged() {
setPlayerNickIsChanged(TRUE);
setPlayerNickIsChanged(true);
};
void setFlipsidePicFileName();
void setLogDir();