mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Accept / Cancel location edit
Make it possible to cancel or accept the location edit and get back to the mainwindow default state. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7d66dcd12d
commit
68691c9d6d
5 changed files with 45 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <QShortcut>
|
||||
#include <QCalendarWidget>
|
||||
#include <QKeyEvent>
|
||||
#include <QAction>
|
||||
|
||||
#include "file.h"
|
||||
#include "mainwindow.h"
|
||||
|
@ -646,7 +647,34 @@ void MultiFilter::closeFilter()
|
|||
MultiFilterSortModel::instance()->clearFilter();
|
||||
hide();
|
||||
}
|
||||
#include <QDebug>
|
||||
#include <QShowEvent>
|
||||
|
||||
LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBox(parent) {
|
||||
LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBox(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
ui.diveSiteMessage->setText("You are editing the Dive Site");
|
||||
ui.diveSiteMessage->setCloseButtonVisible(false);
|
||||
|
||||
QAction *action = new QAction(tr("Apply changes"), this);
|
||||
connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));
|
||||
ui.diveSiteMessage->addAction(action);
|
||||
|
||||
action = new QAction(tr("Discard changes"), this);
|
||||
connect(action, SIGNAL(triggered(bool)), this, SLOT(rejectChanges()));
|
||||
ui.diveSiteMessage->addAction(action);
|
||||
}
|
||||
|
||||
void LocationInformationWidget::acceptChanges()
|
||||
{
|
||||
emit informationManagementEnded();
|
||||
}
|
||||
|
||||
void LocationInformationWidget::rejectChanges()
|
||||
{
|
||||
emit informationManagementEnded();
|
||||
}
|
||||
|
||||
void LocationInformationWidget::showEvent(QShowEvent *ev) {
|
||||
ui.diveSiteMessage->setCloseButtonVisible(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue