Allow changing default address (fixes issue #6)

This commit is contained in:
Wladimir J. van der Laan
2011-06-21 20:34:43 +02:00
parent f5927f5b32
commit b9e80983a5
7 changed files with 74 additions and 42 deletions

View File

@@ -15,7 +15,8 @@ public:
enum ColumnIndex {
Label = 0, /* User specified label */
Address = 1 /* Bitcoin address */
Address = 1, /* Bitcoin address */
IsDefaultAddress = 2 /* Is default address? */
};
enum {
@@ -37,18 +38,25 @@ public:
/* Add an address to the model.
Returns the added address on success, and an empty string otherwise.
*/
QString addRow(const QString &type, const QString &label, const QString &address);
QString addRow(const QString &type, const QString &label, const QString &address, bool setAsDefault);
/* Set and get default address */
QString getDefaultAddress() const;
void setDefaultAddress(const QString &defaultAddress);
/* Update address list from core. Invalidates any indices.
*/
void updateList();
private:
AddressTablePriv *priv;
QStringList columns;
signals:
void defaultAddressChanged(const QString &address);
public slots:
void update();
};
#endif // ADDRESSTABLEMODEL_H