You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

editaddressdialog.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright (c) 2011-2015 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_QT_EDITADDRESSDIALOG_H
  5. #define STARWELS_QT_EDITADDRESSDIALOG_H
  6. #include <QDialog>
  7. class AddressTableModel;
  8. namespace Ui {
  9. class EditAddressDialog;
  10. }
  11. QT_BEGIN_NAMESPACE
  12. class QDataWidgetMapper;
  13. QT_END_NAMESPACE
  14. /** Dialog for editing an address and associated information.
  15. */
  16. class EditAddressDialog : public QDialog
  17. {
  18. Q_OBJECT
  19. public:
  20. enum Mode {
  21. NewReceivingAddress,
  22. NewSendingAddress,
  23. EditReceivingAddress,
  24. EditSendingAddress
  25. };
  26. explicit EditAddressDialog(Mode mode, QWidget *parent);
  27. ~EditAddressDialog();
  28. void setModel(AddressTableModel *model);
  29. void loadRow(int row);
  30. QString getAddress() const;
  31. void setAddress(const QString &address);
  32. public Q_SLOTS:
  33. void accept();
  34. private:
  35. bool saveCurrentRow();
  36. Ui::EditAddressDialog *ui;
  37. QDataWidgetMapper *mapper;
  38. Mode mode;
  39. AddressTableModel *model;
  40. QString address;
  41. };
  42. #endif // STARWELS_QT_EDITADDRESSDIALOG_H