Yingdi Yu | e50bcf9 | 2013-10-23 10:31:08 -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 | |
| 11 | #include "settingdialog.h" |
| 12 | #include "ui_settingdialog.h" |
| 13 | |
| 14 | using namespace std; |
| 15 | |
| 16 | SettingDialog::SettingDialog(QWidget *parent) : |
| 17 | QDialog(parent), |
| 18 | ui(new Ui::SettingDialog) |
| 19 | { |
| 20 | ui->setupUi(this); |
| 21 | } |
| 22 | |
| 23 | SettingDialog::~SettingDialog() |
| 24 | { |
| 25 | delete ui; |
| 26 | } |
| 27 | |
| 28 | void |
| 29 | setIdentity(const std::string& identity) |
| 30 | { |
| 31 | m_identity = identity; |
| 32 | ui->identityLine->setText(QString::fromUtf8(m_identity.c_str())); |
| 33 | } |
| 34 | |
| 35 | void |
| 36 | SettingDialog::onOkClicked() |
| 37 | { |
| 38 | QString text = ui->identityLine->text(); |
| 39 | string identity = text.toUtf8().constData(); |
| 40 | if(identity != m_identity) |
| 41 | { |
| 42 | m_identity = identity; |
| 43 | emit identitySet(text); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | |
| 48 | #if WAF |
| 49 | #include "settingdialog.moc" |
| 50 | #include "settingdialog.cpp.moc" |
| 51 | #endif |