diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-06-26 20:54:48 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-26 18:50:23 -0700 |
commit | fd31e7792e73a89b7dfdd8125466b0b4a819c55f (patch) | |
tree | beec128f7e9e0510033503bae18c2450d5e31d76 | |
parent | 4426cf706f296541b199705eb2ee015c64deb530 (diff) | |
download | subsurface-fd31e7792e73a89b7dfdd8125466b0b4a819c55f.tar.gz |
Dive site rewrite: change the default sizes of the dialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/locationinformation.cpp | 16 | ||||
-rw-r--r-- | qt-ui/maintab.cpp | 2 | ||||
-rw-r--r-- | qt-ui/simpledivesiteedit.ui | 12 |
3 files changed, 16 insertions, 14 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index f50834660..50b3ccb1e 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -241,8 +241,8 @@ SimpleDiveSiteEditDialog::~SimpleDiveSiteEditDialog() void SimpleDiveSiteEditDialog::showEvent(QShowEvent *ev) { - const int heigth = 190; - const int width = 280; + const int heigth = 275; + const int width = 450; // Position. QDialog::showEvent(ev); @@ -256,8 +256,8 @@ void SimpleDiveSiteEditDialog::showEvent(QShowEvent *ev) //Da ui->diveSiteName->setText(displayed_dive_site.name); - ui->diveSiteNotes->setText(displayed_dive_site.notes); - ui->diveSiteDescription->setText(displayed_dive_site.description); + 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)); @@ -294,18 +294,18 @@ void SimpleDiveSiteEditDialog::on_diveSiteCoordinates_editingFinished() void SimpleDiveSiteEditDialog::on_diveSiteDescription_editingFinished() { - if (ui->diveSiteDescription->text() == displayed_dive_site.description) + if (ui->diveSiteDescription->toPlainText() == displayed_dive_site.description) return; free(displayed_dive_site.description); - displayed_dive_site.description = copy_string(qPrintable(ui->diveSiteDescription->text())); + displayed_dive_site.description = copy_string(qPrintable(ui->diveSiteDescription->toPlainText())); changed_dive_site = true; } void SimpleDiveSiteEditDialog::on_diveSiteNotes_editingFinished() { - if (ui->diveSiteNotes->text() == displayed_dive_site.notes) + if (ui->diveSiteNotes->toPlainText() == displayed_dive_site.notes) return; free(displayed_dive_site.notes); - displayed_dive_site.notes = copy_string(qPrintable(ui->diveSiteNotes->text())); + displayed_dive_site.notes = copy_string(qPrintable(ui->diveSiteNotes->toPlainText())); changed_dive_site = true; } diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 8bb2892ad..b960ebb03 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -240,6 +240,8 @@ void MainTab::setCurrentLocationIndex() void MainTab::showDiveSiteSimpleEdit() { + if (ui.location->text().isEmpty()) + return; SimpleDiveSiteEditDialog dlg(this); dlg.exec(); if (dlg.changed_dive_site) { diff --git a/qt-ui/simpledivesiteedit.ui b/qt-ui/simpledivesiteedit.ui index 120e3293f..a7903d00e 100644 --- a/qt-ui/simpledivesiteedit.ui +++ b/qt-ui/simpledivesiteedit.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>280</width> - <height>190</height> + <width>449</width> + <height>274</height> </rect> </property> <property name="windowTitle"> @@ -41,9 +41,6 @@ </property> </widget> </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="diveSiteDescription"/> - </item> <item row="3" column="0"> <widget class="QLabel" name="label_4"> <property name="text"> @@ -51,8 +48,11 @@ </property> </widget> </item> + <item row="2" column="1"> + <widget class="QPlainTextEdit" name="diveSiteDescription"/> + </item> <item row="3" column="1"> - <widget class="QLineEdit" name="diveSiteNotes"/> + <widget class="QPlainTextEdit" name="diveSiteNotes"/> </item> </layout> </widget> |