Populate the Vendor && Dive computer information.

This uses the QStringListModel to populate the items
of the QComboBoxes. I used a QHash to hold every Computer
of a particular Vendor. so, products[vendor] gives me
the full list of products from each vendor.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-05-20 17:58:06 -03:00
parent a542b25bde
commit f4acbb02e4
5 changed files with 94 additions and 21 deletions

View file

@ -1,7 +1,9 @@
#ifndef DOWNLOADFROMDIVECOMPUTER_H
#define DOWNLOADFROMDIVECOMPUTER_H
#include <QDialog>
#include <QThread>
#include <QHash>
namespace Ui{
class DownloadFromDiveComputer;
@ -29,6 +31,7 @@ private:
device_data_t *data;
};
class QStringListModel;
class DownloadFromDCWidget : public QDialog{
Q_OBJECT
public:
@ -37,10 +40,19 @@ public:
public slots:
void on_ok_clicked();
void on_cancel_clicked();
void on_vendor_currentIndexChanged(const QString& vendor);
private:
Ui::DownloadFromDiveComputer *ui;
InterfaceThread *thread;
bool downloading;
QStringList vendorList;
QHash<QString, QStringList> productList;
QStringListModel *vendorModel;
QStringListModel *productModel;
void fill_computer_list();
};
#endif