From 9c34f196fa0b0ccf750cc045d8d1fabe35b17e91 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 4 Jun 2015 00:18:25 -0300 Subject: Fix the message buttons in dive_site_edit Some button management operations where unnecessary. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 198d7f6a0..06475aae0 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -13,11 +13,6 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo { ui.setupUi(this); ui.diveSiteMessage->setCloseButtonVisible(false); - ui.diveSiteMessage->show(); - - // create the three buttons and only show the close button for now - closeAction = new QAction(tr("Close"), this); - connect(closeAction, SIGNAL(triggered(bool)), this, SLOT(rejectChanges())); acceptAction = new QAction(tr("Apply changes"), this); connect(acceptAction, SIGNAL(triggered(bool)), this, SLOT(acceptChanges())); @@ -26,7 +21,8 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo connect(rejectAction, SIGNAL(triggered(bool)), this, SLOT(rejectChanges())); ui.diveSiteMessage->setText(tr("Dive site management")); - ui.diveSiteMessage->addAction(closeAction); + ui.diveSiteMessage->addAction(acceptAction); + ui.diveSiteMessage->addAction(rejectAction); connect(this, SIGNAL(startFilterDiveSite(uint32_t)), MultiFilterSortModel::instance(), SLOT(startFilterDiveSite(uint32_t))); connect(this, SIGNAL(stopFilterDiveSite()), MultiFilterSortModel::instance(), SLOT(stopFilterDiveSite())); @@ -153,10 +149,6 @@ void LocationInformationWidget::resetState() MainWindow::instance()->dive_list()->setEnabled(true); MainWindow::instance()->setEnabledToolbar(true); ui.diveSiteMessage->setText(tr("Dive site management")); - ui.diveSiteMessage->addAction(closeAction); - ui.diveSiteMessage->removeAction(acceptAction); - ui.diveSiteMessage->removeAction(rejectAction); - ui.diveSiteMessage->setCloseButtonVisible(false); } void LocationInformationWidget::enableEdition() @@ -164,10 +156,6 @@ void LocationInformationWidget::enableEdition() MainWindow::instance()->dive_list()->setEnabled(false); MainWindow::instance()->setEnabledToolbar(false); ui.diveSiteMessage->setText(tr("You are editing a dive site")); - ui.diveSiteMessage->removeAction(closeAction); - ui.diveSiteMessage->addAction(acceptAction); - ui.diveSiteMessage->addAction(rejectAction); - ui.diveSiteMessage->setCloseButtonVisible(false); if (!currentDs) { displayed_dive.dive_site_uuid = create_dive_site(NULL); currentDs = get_dive_site_by_uuid(displayed_dive.dive_site_uuid); -- cgit v1.2.3-70-g09d2