blob: ef21ab70a997b1d30613567e7a16d15836b3443f [file] [log] [blame]
Yingdi Yu348f5ea2014-03-01 14:47:25 -08001/* -*- 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 "set-alias-dialog.h"
12#include "ui_set-alias-dialog.h"
13
14
Yingdi Yufa0b6a02014-04-30 14:26:42 -070015SetAliasDialog::SetAliasDialog(QWidget *parent)
Yingdi Yu348f5ea2014-03-01 14:47:25 -080016 : QDialog(parent)
17 , ui(new Ui::SetAliasDialog)
18{
19 ui->setupUi(this);
20
21 connect(ui->okButton, SIGNAL(clicked()),
Yingdi Yufa0b6a02014-04-30 14:26:42 -070022 this, SLOT(onOkClicked()));
Yingdi Yu348f5ea2014-03-01 14:47:25 -080023 connect(ui->cancelButton, SIGNAL(clicked()),
Yingdi Yufa0b6a02014-04-30 14:26:42 -070024 this, SLOT(onCancelClicked()));
Yingdi Yu348f5ea2014-03-01 14:47:25 -080025}
26
27SetAliasDialog::~SetAliasDialog()
28{
29 delete ui;
30}
31
32void
33SetAliasDialog::onOkClicked()
34{
35 emit aliasChanged(m_targetIdentity, ui->aliasInput->text());
36 this->close();
37}
38
39void
40SetAliasDialog::onCancelClicked()
Yingdi Yufa0b6a02014-04-30 14:26:42 -070041{
42 this->close();
Yingdi Yu348f5ea2014-03-01 14:47:25 -080043}
44
Yingdi Yufa0b6a02014-04-30 14:26:42 -070045void
Yingdi Yu348f5ea2014-03-01 14:47:25 -080046SetAliasDialog::setTargetIdentity(const QString& targetIdentity, const QString& alias)
Yingdi Yufa0b6a02014-04-30 14:26:42 -070047{
48 m_targetIdentity = targetIdentity;
Yingdi Yu348f5ea2014-03-01 14:47:25 -080049 QString msg = QString("Set alias for %1:").arg(targetIdentity);
50 ui->introLabel->setText(msg);
51 ui->aliasInput->setText(alias);
52}
53
54
55#if WAF
56#include "set-alias-dialog.moc"
57#include "set-alias-dialog.cpp.moc"
58#endif