Replace mainWindow() with MainWindow::instance()

C++ style of accessing single instance class object.

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Boris Barbulovski 2014-02-12 15:22:54 +01:00 committed by Dirk Hohndel
parent cc37d2e94a
commit c86822c2f4
18 changed files with 104 additions and 96 deletions

View file

@ -371,7 +371,7 @@ void DivePlannerGraphics::decreaseDepth()
Q_FOREACH(DiveHandler *d, handles) {
if (depthLine->valueAt(d->pos()) > depthLine->maximum() - M_OR_FT(10,30)) {
QMessageBox::warning(mainWindow(),
QMessageBox::warning(MainWindow::instance(),
tr("Handler Position Error"),
tr("One or more of your stops will be lost with this operations, \n"
"Please, remove them first."));
@ -979,9 +979,9 @@ DivePlannerWidget::DivePlannerWidget(QWidget* parent, Qt::WindowFlags f): QWidge
// Creating the plan
connect(ui.buttonBox, SIGNAL(accepted()), plannerModel, SLOT(createPlan()));
connect(ui.buttonBox, SIGNAL(rejected()), plannerModel, SLOT(cancelPlan()));
connect(plannerModel, SIGNAL(planCreated()), mainWindow(), SLOT(showProfile()));
connect(plannerModel, SIGNAL(planCreated()), mainWindow(), SLOT(refreshDisplay()));
connect(plannerModel, SIGNAL(planCanceled()), mainWindow(), SLOT(showProfile()));
connect(plannerModel, SIGNAL(planCreated()), MainWindow::instance(), SLOT(showProfile()));
connect(plannerModel, SIGNAL(planCreated()), MainWindow::instance(), SLOT(refreshDisplay()));
connect(plannerModel, SIGNAL(planCanceled()), MainWindow::instance(), SLOT(showProfile()));
/* set defaults. */
ui.startTime->setTime( QTime(1, 0) );
@ -1298,7 +1298,7 @@ struct diveplan DivePlannerPointsModel::getDiveplan()
void DivePlannerPointsModel::cancelPlan()
{
if (mode == PLAN && rowCount()) {
if (QMessageBox::warning(mainWindow(), TITLE_OR_TEXT(tr("Discard the Plan?"),
if (QMessageBox::warning(MainWindow::instance(), TITLE_OR_TEXT(tr("Discard the Plan?"),
tr("You are about to discard your plan.")),
QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Discard) != QMessageBox::Discard) {
return;