summaryrefslogtreecommitdiffstats
path: root/qt-ui/subsurfacewebservices.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-24 22:30:21 -0200
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-24 22:30:21 -0200
commit5eb2cc4594ab2181ccc3b09a2540af3fb615468e (patch)
tree2b2d6257d70dfcedc10549527f7819236f5b5191 /qt-ui/subsurfacewebservices.cpp
parent695f64a23a2b9b5caeceddf802fb1c0c29401c84 (diff)
downloadsubsurface-5eb2cc4594ab2181ccc3b09a2540af3fb615468e.tar.gz
Created a 'WebService' dialog that will handle download and upload.
Created a WebService dialog that will handle download and upload from all child based webservices. Also, ported the currently - only - one webservice to use the new dialog. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r--qt-ui/subsurfacewebservices.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index f2b1b88cc..d9da69287 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -15,6 +15,26 @@
struct dive_table gps_location_table;
static bool merge_locations_into_dives(void);
+WebServices::WebServices(QWidget* parent, Qt::WindowFlags f): QDialog(parent, f)
+{
+ ui.setupUi(this);
+ connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
+ connect(ui.download, SIGNAL(clicked(bool)), this, SLOT(startDownload()));
+ ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
+
+}
+
+void WebServices::hidePassword()
+{
+ ui.password->hide();
+ ui.passLabel->hide();
+}
+
+void WebServices::hideUpload()
+{
+ ui.upload->hide();
+}
+
SubsurfaceWebServices* SubsurfaceWebServices::instance()
{
static SubsurfaceWebServices *self = new SubsurfaceWebServices();
@@ -24,12 +44,10 @@ SubsurfaceWebServices* SubsurfaceWebServices::instance()
SubsurfaceWebServices::SubsurfaceWebServices(QWidget* parent, Qt::WindowFlags f)
{
- ui.setupUi(this);
- connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
- connect(ui.download, SIGNAL(clicked(bool)), this, SLOT(startDownload()));
- ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
QSettings s;
ui.userID->setText(s.value("webservice_uid").toString());
+ hidePassword();
+ hideUpload();
}
static void clear_table(struct dive_table *table)
@@ -56,7 +74,7 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton* button)
/* store last entered uid in config */
QSettings s;
- s.setValue("webservice_uid", ui.userID->text());
+ s.setValue("subsurface_webservice_uid", ui.userID->text());
s.sync();
hide();
close();
@@ -135,11 +153,6 @@ void SubsurfaceWebServices::setStatusText(int status)
ui.status->setText(text);
}
-void SubsurfaceWebServices::runDialog()
-{
- exec();
-}
-
/* requires that there is a <download> or <error> tag under the <root> tag */
void SubsurfaceWebServices::download_dialog_traverse_xml(xmlNodePtr node, unsigned int *download_status)
{