blob: 24fb6a8f549ae5edec21c8e68a37066b31da4d38 [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 Yu348f5ea2014-03-01 14:47:25 -080015SetAliasDialog::SetAliasDialog(QWidget *parent)
16 : QDialog(parent)
17 , ui(new Ui::SetAliasDialog)
18{
19 ui->setupUi(this);
20
21 connect(ui->okButton, SIGNAL(clicked()),
22 this, SLOT(onOkClicked()));
23 connect(ui->cancelButton, SIGNAL(clicked()),
24 this, SLOT(onCancelClicked()));
25}
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()
41{
42 this->close();
43}
44
45void
46SetAliasDialog::setTargetIdentity(const QString& targetIdentity, const QString& alias)
47{
48 m_targetIdentity = targetIdentity;
49 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