blob: f19d98ff2cd5a746f648ef99e819ccd89b9de667 [file] [log] [blame]
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2013, Regents of the University of California
* Yingdi Yu
*
* BSD license, See the LICENSE file for more information
*
* Author: Yingdi Yu <yingdi@cs.ucla.edu>
*/
#include "set-alias-dialog.hpp"
#include "ui_set-alias-dialog.h"
namespace chronos {
SetAliasDialog::SetAliasDialog(QWidget* parent)
: QDialog(parent)
, ui(new Ui::SetAliasDialog)
{
ui->setupUi(this);
connect(ui->okButton, SIGNAL(clicked()),
this, SLOT(onOkClicked()));
connect(ui->cancelButton, SIGNAL(clicked()),
this, SLOT(onCancelClicked()));
}
SetAliasDialog::~SetAliasDialog()
{
delete ui;
}
void
SetAliasDialog::onOkClicked()
{
emit aliasChanged(m_targetIdentity, ui->aliasInput->text());
this->close();
}
void
SetAliasDialog::onCancelClicked()
{
this->close();
}
void
SetAliasDialog::setTargetIdentity(const QString& targetIdentity, const QString& alias)
{
m_targetIdentity = targetIdentity;
QString msg = QString("Set alias for %1:").arg(targetIdentity);
ui->introLabel->setText(msg);
ui->aliasInput->setText(alias);
}
} // namespace chronos
#if WAF
#include "set-alias-dialog.moc"
// #include "set-alias-dialog.cpp.moc"
#endif