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>
This commit is contained in:
Tomaz Canabrava 2015-06-26 20:54:48 -03:00 committed by Dirk Hohndel
parent 4426cf706f
commit fd31e7792e
3 changed files with 16 additions and 14 deletions

View file

@ -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;
}

View file

@ -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) {

View file

@ -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>