Yingdi Yu | d59b593 | 2013-10-16 13:16:49 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013, Regents of the University of California |
| 4 | * Yingdi Yu |
| 5 | * |
| 6 | * BSD license, See the LICENSE file for more information |
| 7 | * |
| 8 | * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 9 | */ |
| 10 | |
Yingdi Yu | a489875 | 2013-10-15 20:31:37 -0700 | [diff] [blame] | 11 | #include "addcontactpanel.h" |
| 12 | #include "ui_addcontactpanel.h" |
| 13 | |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame^] | 14 | using namespace ndn; |
| 15 | using namespace std; |
| 16 | |
| 17 | AddContactPanel::AddContactPanel(Ptr<ContactManager> contactManager, |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 18 | QWidget *parent) |
Yingdi Yu | d59b593 | 2013-10-16 13:16:49 -0700 | [diff] [blame] | 19 | : QDialog(parent) |
| 20 | , ui(new Ui::AddContactPanel) |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 21 | , m_contactManager(contactManager) |
Yingdi Yu | a489875 | 2013-10-15 20:31:37 -0700 | [diff] [blame] | 22 | { |
Yingdi Yu | d59b593 | 2013-10-16 13:16:49 -0700 | [diff] [blame] | 23 | ui->setupUi(this); |
| 24 | |
| 25 | connect(ui->cancelButton, SIGNAL(clicked()), |
| 26 | this, SLOT(onCancelClicked())); |
| 27 | connect(ui->searchButton, SIGNAL(clicked()), |
| 28 | this, SLOT(onSearchClicked())); |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame^] | 29 | connect(&*m_contactManager, SIGNAL(contactFetched(Ptr<EndorseCertificate>)), |
| 30 | this, SLOT(selfEndorseCertificateFetched(Ptr<EndorseCertificate>))); |
Yingdi Yu | a489875 | 2013-10-15 20:31:37 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | AddContactPanel::~AddContactPanel() |
| 34 | { |
| 35 | delete ui; |
| 36 | } |
Yingdi Yu | d59b593 | 2013-10-16 13:16:49 -0700 | [diff] [blame] | 37 | |
| 38 | void |
| 39 | AddContactPanel::onCancelClicked() |
| 40 | { this->close(); } |
| 41 | |
| 42 | void |
| 43 | AddContactPanel::onSearchClicked() |
| 44 | { |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame^] | 45 | QString inputIdentity = ui->contactInput->text(); |
| 46 | m_searchIdentity = Name(inputIdentity.toUtf8().constData()); |
Yingdi Yu | d59b593 | 2013-10-16 13:16:49 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | void |
| 50 | AddContactPanel::onAddClicked() |
| 51 | { |
| 52 | } |
| 53 | |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame^] | 54 | void |
| 55 | AddContactPanel::selfEndorseCertificateFetched(Ptr<EndorseCertificate> endorseCertificate) |
| 56 | { |
| 57 | } |
| 58 | |
Yingdi Yu | d59b593 | 2013-10-16 13:16:49 -0700 | [diff] [blame] | 59 | #if WAF |
| 60 | #include "addcontactpanel.moc" |
| 61 | #include "addcontactpanel.cpp.moc" |
| 62 | #endif |