summaryrefslogtreecommitdiffstats
path: root/qt-ui/locationinformation.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-07-14 14:29:48 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-14 14:44:39 -0700
commit9510f40db42c60d34577f79180d929a88d261781 (patch)
treed45319b09a1999428a0a736f3d73fb8c44fae318 /qt-ui/locationinformation.cpp
parent49ab30ae8b65c3ad443a5824ae5f9554e88c7a39 (diff)
downloadsubsurface-9510f40db42c60d34577f79180d929a88d261781.tar.gz
Remove quick edit dive site widget
Voted down by common consent. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r--qt-ui/locationinformation.cpp98
1 files changed, 0 insertions, 98 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index b9d985bd7..47ceb654e 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -227,104 +227,6 @@ void LocationInformationWidget::resetPallete()
ui.diveSiteNotes->setPalette(p);
}
-SimpleDiveSiteEditDialog::SimpleDiveSiteEditDialog(QWidget *parent) :
- QDialog(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::Popup),
- ui(new Ui::SimpleDiveSiteEditDialog()), changed_dive_site(false)
-{
- ui->setupUi(this);
- ui->diveSiteDescription->installEventFilter(this);
- ui->diveSiteNotes->installEventFilter(this);
-}
-
-SimpleDiveSiteEditDialog::~SimpleDiveSiteEditDialog()
-{
- delete ui;
-}
-
-bool SimpleDiveSiteEditDialog::eventFilter(QObject *obj, QEvent *ev)
-{
- if (ev->type() != QEvent::FocusOut)
- return false;
-
- if (obj == ui->diveSiteDescription) {
- diveSiteDescription_editingFinished();
- } else if (obj == ui->diveSiteNotes) {
- diveSiteNotes_editingFinished();
- }
- return false;
-}
-
-void SimpleDiveSiteEditDialog::showEvent(QShowEvent *ev)
-{
- const int heigth = 275;
- const int width = 450;
-
- // Position.
- QDialog::showEvent(ev);
- QRect currGeometry = geometry();
- currGeometry.setX(QCursor::pos().x() + 15);
- currGeometry.setY(QCursor::pos().y() - heigth / 2);
- currGeometry.setWidth(width);
- currGeometry.setHeight(heigth);
- setGeometry(currGeometry);
- ev->accept();
-
- //Da
- ui->diveSiteName->setText(displayed_dive_site.name);
- ui->diveSiteNotes->setPlainText(displayed_dive_site.notes);
- ui->diveSiteDescription->setPlainText(displayed_dive_site.description);
-
- const char *gps_text = printGPSCoords(displayed_dive_site.latitude.udeg, displayed_dive_site.longitude.udeg);
- ui->diveSiteCoordinates->setText(QString(gps_text));
- free( (void*) gps_text);
-
- changed_dive_site = false;
-}
-
-void SimpleDiveSiteEditDialog::on_diveSiteName_editingFinished()
-{
- if (ui->diveSiteName->text() == displayed_dive_site.name)
- return;
- free(displayed_dive_site.name);
- displayed_dive_site.name = copy_string(qPrintable(ui->diveSiteName->text()));
- changed_dive_site = true;
-}
-
-void SimpleDiveSiteEditDialog::on_diveSiteCoordinates_editingFinished()
-{
- double lat, lon;
- uint32_t uLat, uLon;
-
- parseGpsText(ui->diveSiteCoordinates->text(), &lat, &lon);
- uLat = lat * 1000000;
- uLon = lon * 1000000;
-
- if (uLat == displayed_dive_site.latitude.udeg && uLon == displayed_dive_site.longitude.udeg)
- return;
-
- displayed_dive_site.latitude.udeg = uLat;
- displayed_dive_site.longitude.udeg = uLon;
- changed_dive_site = true;
-}
-
-void SimpleDiveSiteEditDialog::diveSiteDescription_editingFinished()
-{
- if (ui->diveSiteDescription->toPlainText() == displayed_dive_site.description)
- return;
- free(displayed_dive_site.description);
- displayed_dive_site.description = copy_string(qPrintable(ui->diveSiteDescription->toPlainText()));
- changed_dive_site = true;
-}
-
-void SimpleDiveSiteEditDialog::diveSiteNotes_editingFinished()
-{
- if (ui->diveSiteNotes->toPlainText() == displayed_dive_site.notes)
- return;
- free(displayed_dive_site.notes);
- displayed_dive_site.notes = copy_string(qPrintable(ui->diveSiteNotes->toPlainText()));
- changed_dive_site = true;
-}
-
bool LocationManagementEditHelper::eventFilter(QObject *obj, QEvent *ev)
{
QListView *view = qobject_cast<QListView*>(obj);