diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-06-17 12:42:52 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-06-17 12:42:52 -0700 |
commit | 9d611ba279f0d279f5e0818e5043417bfa52c02c (patch) | |
tree | 7bcbba0e48af833428633fb6040ddcc1ef29365e /qt-ui/divecomputermanagementdialog.cpp | |
parent | cb50d6bf6cc52b9c42af9dd514bbe07fa9eff767 (diff) | |
download | subsurface-9d611ba279f0d279f5e0818e5043417bfa52c02c.tar.gz |
Improve the initial size of the device name editing dialog
This is not "automagic" as I had hoped but appears to give a good
starting point.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divecomputermanagementdialog.cpp')
-rw-r--r-- | qt-ui/divecomputermanagementdialog.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/qt-ui/divecomputermanagementdialog.cpp b/qt-ui/divecomputermanagementdialog.cpp index 7a96b4c63..4d9770a4d 100644 --- a/qt-ui/divecomputermanagementdialog.cpp +++ b/qt-ui/divecomputermanagementdialog.cpp @@ -11,7 +11,6 @@ DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget* parent, Qt:: model = new DiveComputerModel(); ui->tableView->setModel(model); connect(ui->tableView, SIGNAL(clicked(QModelIndex)), this, SLOT(tryRemove(QModelIndex))); - ui->tableView->setColumnWidth(DiveComputerModel::REMOVE, 22); } DiveComputerManagementDialog* DiveComputerManagementDialog::instance() @@ -23,6 +22,9 @@ DiveComputerManagementDialog* DiveComputerManagementDialog::instance() void DiveComputerManagementDialog::update() { model->update(); + ui->tableView->resizeColumnsToContents(); + ui->tableView->setColumnWidth(DiveComputerModel::REMOVE, 22); + layout()->activate(); } void DiveComputerManagementDialog::tryRemove(const QModelIndex& index) @@ -30,14 +32,14 @@ void DiveComputerManagementDialog::tryRemove(const QModelIndex& index) if (index.column() != DiveComputerModel::REMOVE){ return; } - + QMessageBox::StandardButton response = QMessageBox::question( - this, - tr("Remove the selected Dive Computer?"), + this, + tr("Remove the selected Dive Computer?"), tr("Are you sure that you want to \n remove the selected dive computer?"), QMessageBox::Ok | QMessageBox::Cancel ); - + if (response == QMessageBox::Ok){ model->remove(index); } |