From 995192c5fb6bd890741ef2da873da4befd2120c4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 21 Nov 2013 04:23:10 -0800 Subject: Work around QMessageBox not showing its title on Mac This is a bit hacky and simply adds the title to the message text when compiling on a Mac, but hopefully this will be enough. Signed-off-by: Dirk Hohndel --- qt-ui/divecomputermanagementdialog.cpp | 4 ++-- qt-ui/diveplanner.cpp | 4 ++-- qt-ui/downloadfromdivecomputer.cpp | 2 +- qt-ui/models.cpp | 8 ++++---- qt-ui/profilegraphics.cpp | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/divecomputermanagementdialog.cpp b/qt-ui/divecomputermanagementdialog.cpp index 510756e42..883c8e9a7 100644 --- a/qt-ui/divecomputermanagementdialog.cpp +++ b/qt-ui/divecomputermanagementdialog.cpp @@ -42,9 +42,9 @@ void DiveComputerManagementDialog::tryRemove(const QModelIndex& index) return; QMessageBox::StandardButton response = QMessageBox::question( - this, + this, TITLE_OR_TEXT( tr("Remove the selected Dive Computer?"), - tr("Are you sure that you want to \n remove the selected dive computer?"), + tr("Are you sure that you want to \n remove the selected dive computer?")), QMessageBox::Ok | QMessageBox::Cancel ); diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 7be7263b8..0c17488e4 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1272,8 +1272,8 @@ struct diveplan DivePlannerPointsModel::getDiveplan() void DivePlannerPointsModel::cancelPlan() { if (mode == PLAN && rowCount()) { - if (QMessageBox::warning(mainWindow(), tr("Discard the Plan?"), - tr("You are about to discard your plan."), + if (QMessageBox::warning(mainWindow(), TITLE_OR_TEXT(tr("Discard the Plan?"), + tr("You are about to discard your plan.")), QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Discard) != QMessageBox::Discard) { return; } diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index be9c8e337..e7f655203 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -137,7 +137,7 @@ void DownloadFromDCWidget::updateState(states state) // got an error else if (state == ERROR) { - QMessageBox::critical(this, tr("Error"), this->thread->error, QMessageBox::Ok); + QMessageBox::critical(this, TITLE_OR_TEXT(tr("Error"), this->thread->error), QMessageBox::Ok); markChildrenAsEnabled(); ui.progressBar->hide(); diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index f837c03c6..16ba80a56 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -385,10 +385,10 @@ void CylindersModel::remove(const QModelIndex& index) } cylinder_t *cyl = ¤t->cylinder[index.row()]; if (DivePlannerPointsModel::instance()->tankInUse(cyl->gasmix.o2.permille, cyl->gasmix.he.permille)) { - QMessageBox::warning(mainWindow(), - tr("Cylinder cannot be removed"), - tr("This gas in use. Only cylinders that are not used in the dive can be removed."), - QMessageBox::Ok); + QMessageBox::warning(mainWindow(), TITLE_OR_TEXT( + tr("Cylinder cannot be removed"), + tr("This gas in use. Only cylinders that are not used in the dive can be removed.")), + QMessageBox::Ok); return; } beginRemoveRows(QModelIndex(), index.row(), index.row()); // yah, know, ugly. diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index e0e759dd4..7a5630799 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -182,9 +182,9 @@ void ProfileGraphicsView::hideEvents() EventItem *item = static_cast(action->data().value()); struct event *event = item->ev; - if (QMessageBox::question(mainWindow(), + if (QMessageBox::question(mainWindow(), TITLE_OR_TEXT( tr("Hide events"), - tr("Hide all %1 events?").arg(event->name), + tr("Hide all %1 events?").arg(event->name)), QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok){ if (event->name) { for (int i = 0; i < evn_used; i++) { @@ -204,11 +204,11 @@ void ProfileGraphicsView::removeEvent() EventItem *item = static_cast(action->data().value()); struct event *event = item->ev; - if (QMessageBox::question(mainWindow(), + if (QMessageBox::question(mainWindow(), TITLE_OR_TEXT( tr("Remove the selected event?"), tr("%1 @ %2:%3").arg(event->name) .arg(event->time.seconds / 60) - .arg(event->time.seconds % 60, 2, 10, QChar('0')), + .arg(event->time.seconds % 60, 2, 10, QChar('0'))), QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok){ struct event **ep = ¤t_dc->events; while (ep && *ep != event) -- cgit v1.2.3-70-g09d2