summaryrefslogtreecommitdiffstats
path: root/qt-ui/simplewidgets.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-06-17 12:59:37 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-06-17 12:59:37 -0700
commit14ccbbf6e87b69267426ae69c402c1bae70ec5d5 (patch)
treec9ec8ca478b6ac45c30c3d0263bfe9b1adfa4467 /qt-ui/simplewidgets.cpp
parent1ee894dcedfbe071d204a2d8a0276f61d7db9c2e (diff)
parentb00553919b995a0a7e81efbeacfa481eec9b857a (diff)
downloadsubsurface-14ccbbf6e87b69267426ae69c402c1bae70ec5d5.tar.gz
Merge branch 'renumberDialog' of github.com:tcanabrava/subsurface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/simplewidgets.cpp')
-rw-r--r--qt-ui/simplewidgets.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index c389a34c3..a6e01a724 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -4,6 +4,14 @@
#include <QLabel>
#include <QFormLayout>
#include <QIcon>
+#include <QAbstractButton>
+#include <QSpinBox>
+#include <QButtonGroup>
+#include <QDebug>
+
+#include "../dive.h"
+
+#include "ui_renumber.h"
class MinMaxAvgWidgetPrivate{
public:
@@ -24,7 +32,7 @@ public:
avgValue = new QLabel(owner);
minValue = new QLabel(owner);
maxValue = new QLabel(owner);
-
+
QGridLayout *formLayout = new QGridLayout();
formLayout->addWidget(maxIco, 0, 0);
formLayout->addWidget(maxValue, 0, 1);
@@ -90,3 +98,23 @@ void MinMaxAvgWidget::setMinimum(const QString& minimum)
{
d->minValue->setText(minimum);
}
+
+RenumberDialog* RenumberDialog::instance()
+{
+ static RenumberDialog* self = new RenumberDialog();
+ return self;
+}
+
+void RenumberDialog::buttonClicked(QAbstractButton* button)
+{
+ if (ui->buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole){
+ qDebug() << "Renumbering.";
+ renumber_dives(ui->spinBox->value());
+ }
+}
+
+RenumberDialog::RenumberDialog(): QDialog(), ui( new Ui::RenumberDialog())
+{
+ ui->setupUi(this);
+ connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
+}