Commit 4b0f5d970bc0b7f8de34acd99bc1bc281494b362
| |   |
| #include <QFileDialog> |
|
| 1 | 3 | #include "addressbook.h" |
| 2 | 4 | #include "ui_addressbook.h" |
| 3 | 5 | |
| … | … | |
| 33 | 33 | SLOT(removeContact())); |
| 34 | 34 | connect(ui->findButton, SIGNAL(clicked()), this, |
| 35 | 35 | SLOT(findContact())); |
| //! [connectSlots] |
| connect(ui->loadButton, SIGNAL(clicked()), this, |
| SLOT(loadFromFile())); |
| connect(ui->saveButton, SIGNAL(clicked()), this, |
| SLOT(saveToFile())); |
| //! [connectSlots] |
| 36 | 42 | |
| 37 | 43 | setWindowTitle(tr("Simple Address Book")); |
| 38 | 44 | } |
| … | … | |
| 300 | 300 | |
| 301 | 301 | //! [loadFromFile part3] |
| 302 | 302 | if (contacts.isEmpty()) { |
| QMessagebox::information(this, tr("No contacts in file"), |
| QMessageBox::information(this, tr("No contacts in file"), |
| 304 | 304 | tr("The file you are attempting to open contains no contacts.")); |
| 305 | 305 | } else { |
| 306 | 306 | QMap<QString, QString>::iterator i = contacts.begin(); |
| |   |
| #include <QFileDialog> |
| #include <QTextStream> |
|
| 1 | 4 | #include "addressbook.h" |
| 2 | 5 | #include "ui_addressbook.h" |
| 3 | 6 | |
| … | … | |
| 351 | 351 | out << "END;VCARD" << "\n"; |
| 352 | 352 | |
| 353 | 353 | QMessageBox::information(this, tr("Export Successful"), |
| tr("\%1\" has been exported as a vCard.").arg(name)); |
| tr("\"%1\" has been exported as a vCard.").arg(name)); |
| 355 | 355 | } |