blob: ae75a2bf1a9c3e4d8db4b813b793ada3fa73b5e6 [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 chronochat {
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 chronochat
#if WAF
#include "set-alias-dialog.moc"
// #include "set-alias-dialog.cpp.moc"
#endif