Correctly remove the Close button from most message widgets

The only time we want the close button is when showing an error at the
bottom of the main window.

In the other cases (maintab, globe) we need to explicitly hide it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-08-04 22:45:17 -07:00
parent eca96ee8b7
commit 78fee70450
3 changed files with 6 additions and 1 deletions

View file

@ -287,6 +287,7 @@ void GlobeGPS::prepareForGetDiveCoordinates()
messageWidget->setMessageType(KMessageWidget::Warning);
messageWidget->setText(QObject::tr("Move the map and double-click to set the dive location"));
messageWidget->setWordWrap(true);
messageWidget->setCloseButtonVisible(false);
messageWidget->animatedShow();
editingDiveLocation = true;
if (!dive_has_gps_location(current_dive))

View file

@ -61,7 +61,7 @@ void KMessageWidgetPrivate::init(KMessageWidget *q_ptr)
closeButton = new QToolButton(content);
closeButton->setAutoRaise(true);
closeButton->setDefaultAction(closeAction);
closeButton->setVisible(false);
q->setMessageType(KMessageWidget::Information);
}

View file

@ -227,6 +227,10 @@ void MainTab::closeMessage()
void MainTab::displayMessage(QString str)
{
ui.diveNotesMessage->setCloseButtonVisible(false);
ui.diveEquipmentMessage->setCloseButtonVisible(false);
ui.diveInfoMessage->setCloseButtonVisible(false);
ui.diveStatisticsMessage->setCloseButtonVisible(false);
ui.diveNotesMessage->setText(str);
ui.diveNotesMessage->animatedShow();
ui.diveEquipmentMessage->setText(str);