blob: 291d7e6c62c2075d9fe9d7f7d615987dffcdd90c [file] [log] [blame]
Yingdi Yuc2ab62c2013-10-23 10:31:08 -07001/* -*- 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
Zhenkai Zhu85845d22012-06-01 23:10:43 -070011#include "settingdialog.h"
Yingdi Yuc2ab62c2013-10-23 10:31:08 -070012#include "ui_settingdialog.h"
Zhenkai Zhu85845d22012-06-01 23:10:43 -070013
Yingdi Yuc2ab62c2013-10-23 10:31:08 -070014using namespace std;
15
16SettingDialog::SettingDialog(QWidget *parent) :
17 QDialog(parent),
18 ui(new Ui::SettingDialog)
Zhenkai Zhu85845d22012-06-01 23:10:43 -070019{
Yingdi Yuc2ab62c2013-10-23 10:31:08 -070020 ui->setupUi(this);
21}
Zhenkai Zhu716addc2012-06-05 20:57:41 -070022
Yingdi Yuc2ab62c2013-10-23 10:31:08 -070023SettingDialog::~SettingDialog()
24{
25 delete ui;
Zhenkai Zhu7e9b06d2012-06-02 00:44:42 -070026}
27
28void
Yingdi Yuc2ab62c2013-10-23 10:31:08 -070029setIdentity(const std::string& identity)
30{
31 m_identity = identity;
32 ui->identityLine->setText(QString::fromUtf8(m_identity.c_str()));
Zhenkai Zhu85845d22012-06-01 23:10:43 -070033}
Zhenkai Zhu56a60ce2012-06-02 12:55:07 -070034
35void
Yingdi Yuc2ab62c2013-10-23 10:31:08 -070036SettingDialog::onOkClicked()
Zhenkai Zhu56a60ce2012-06-02 12:55:07 -070037{
Yingdi Yuc2ab62c2013-10-23 10:31:08 -070038 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 }
Zhenkai Zhu56a60ce2012-06-02 12:55:07 -070045}
Alexander Afanasyevb4b92292013-07-09 13:54:59 -070046
Yingdi Yuc2ab62c2013-10-23 10:31:08 -070047
Alexander Afanasyevb4b92292013-07-09 13:54:59 -070048#if WAF
49#include "settingdialog.moc"
50#include "settingdialog.cpp.moc"
51#endif