diff options
-rw-r--r-- | qt-ui/maintab.cpp | 19 | ||||
-rw-r--r-- | qt-ui/maintab.h | 1 |
2 files changed, 9 insertions, 11 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index c48b89a6c..b0fd62041 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -448,6 +448,12 @@ void MainTab::acceptChanges() } editMode = NONE; + resetPallete(); + mainWindow()->refreshDisplay(); +} + +void MainTab::resetPallete() +{ QPalette p; ui->buddy->setPalette(p); ui->notes->setPalette(p); @@ -458,9 +464,9 @@ void MainTab::acceptChanges() ui->airtemp->setPalette(p); ui->watertemp->setPalette(p); ui->dateTimeEdit->setPalette(p); - mainWindow()->refreshDisplay(); } + #define EDIT_TEXT2(what, text) \ textByteArray = text.toLocal8Bit(); \ free(what);\ @@ -537,16 +543,7 @@ void MainTab::rejectChanges() ui->notesButtonBox->hide(); ui->equipmentButtonBox->hide(); notesBackup.clear(); - QPalette p; - ui->buddy->setPalette(p); - ui->notes->setPalette(p); - ui->location->setPalette(p); - ui->coordinates->setPalette(p); - ui->divemaster->setPalette(p); - ui->suit->setPalette(p); - ui->airtemp->setPalette(p); - ui->watertemp->setPalette(p); - ui->dateTimeEdit->setPalette(p); + resetPallete(); if (editMode == ADD) { // more clean up updateDiveInfo(selected_dive); diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h index af2ecc07c..5450c2d0e 100644 --- a/qt-ui/maintab.h +++ b/qt-ui/maintab.h @@ -94,6 +94,7 @@ private: enum { NONE, DIVE, TRIP, ADD } editMode; Completers completers; void enableEdition(); + void resetPallete(); }; #endif |