diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 9fde7599..1089f5df 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -62,7 +62,7 @@ using namespace std; mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) - : QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterCurrentHand(FALSE), currentGameOver(FALSE), myLastPreActionBetValue(0) + : QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterCurrentHand(FALSE), currentGameOver(FALSE), betSliderChangedByInput(FALSE), myLastPreActionBetValue(0) { int i; @@ -3719,21 +3719,26 @@ void mainWindowImpl::quitPokerTH() { void mainWindowImpl::changeLineEditBetValue(int value) { int temp; - - if(horizontalSlider_bet->maximum() <= 1000 ) { - temp = (int)((value/10)*10); - if(temp < horizontalSlider_bet->minimum()) - lineEdit_betValue->setText(QString::number(horizontalSlider_bet->minimum())); - else - lineEdit_betValue->setText(QString::number(temp)); - } - else { - temp = (int)((value/50)*50); - if(temp < horizontalSlider_bet->minimum()) - lineEdit_betValue->setText(QString::number(horizontalSlider_bet->minimum())); - else - lineEdit_betValue->setText(QString::number(temp)); - } + if(betSliderChangedByInput) { + //prevent interval cutting of lineEdit_betValue input from code below + betSliderChangedByInput = FALSE; + } + else { + if(horizontalSlider_bet->maximum() <= 1000 ) { + temp = (int)((value/10)*10); + if(temp < horizontalSlider_bet->minimum()) + lineEdit_betValue->setText(QString::number(horizontalSlider_bet->minimum())); + else + lineEdit_betValue->setText(QString::number(temp)); + } + else { + temp = (int)((value/50)*50); + if(temp < horizontalSlider_bet->minimum()) + lineEdit_betValue->setText(QString::number(horizontalSlider_bet->minimum())); + else + lineEdit_betValue->setText(QString::number(temp)); + } + } } @@ -3747,13 +3752,19 @@ void mainWindowImpl::lineEditBetValueChanged(QString valueString) { if(betValue > horizontalSlider_bet->maximum()) { // print the maximum pushButton_BetRaise->setText(betRaise + " " + QString::number(horizontalSlider_bet->maximum()) + "$"); + betSliderChangedByInput = TRUE; + horizontalSlider_bet->setValue(horizontalSlider_bet->maximum()); } else { // really print the value pushButton_BetRaise->setText(betRaise + " " + valueString + "$"); + betSliderChangedByInput = TRUE; + horizontalSlider_bet->setValue(betValue); } } else { // print the minimum pushButton_BetRaise->setText(betRaise + " " + QString::number(horizontalSlider_bet->minimum()) + "$"); + betSliderChangedByInput = TRUE; + horizontalSlider_bet->setValue(horizontalSlider_bet->minimum()); } } diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index 570fae56..12f18b7b 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -439,17 +439,15 @@ private: bool myActionIsBet; bool myActionIsRaise; - bool pushButtonBetRaiseIsChecked; bool pushButtonCallCheckIsChecked; bool pushButtonFoldIsChecked; bool pushButtonAllInIsChecked; bool myButtonsAreCheckable; - bool breakAfterCurrentHand; bool currentGameOver; - bool flipHolecardsAllInAlreadyDone; + bool betSliderChangedByInput; QColor active; QColor inactive;