2018-11-17 14:10:08 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* retroshare-gui/src/gui/profile/StatusMessage.cpp *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2009 by Retroshare Team <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2012-11-06 23:26:47 +00:00
|
|
|
|
2009-09-29 22:52:46 +00:00
|
|
|
#include "StatusMessage.h"
|
|
|
|
|
2010-08-06 09:40:23 +00:00
|
|
|
#include <retroshare/rsmsgs.h>
|
2009-09-29 22:52:46 +00:00
|
|
|
|
|
|
|
/** Default constructor */
|
2012-11-06 23:26:47 +00:00
|
|
|
StatusMessage::StatusMessage(QWidget *parent)
|
|
|
|
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
|
2009-09-29 22:52:46 +00:00
|
|
|
{
|
|
|
|
/* Invoke Qt Designer generated QObject setup routine */
|
|
|
|
ui.setupUi(this);
|
|
|
|
|
2012-10-10 10:51:53 +00:00
|
|
|
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(save()));
|
|
|
|
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
2009-09-29 22:52:46 +00:00
|
|
|
|
2012-11-06 23:26:47 +00:00
|
|
|
ui.txt_StatusMessage->setText(QString::fromUtf8(rsMsgs->getCustomStateString().c_str()));
|
2009-10-04 15:24:33 +00:00
|
|
|
}
|
|
|
|
|
2009-09-29 22:52:46 +00:00
|
|
|
/** Saves the changes on this page */
|
|
|
|
void StatusMessage::save()
|
|
|
|
{
|
2010-11-24 19:25:53 +00:00
|
|
|
rsMsgs->setCustomStateString(ui.txt_StatusMessage->text().toUtf8().constData());
|
2009-09-29 22:52:46 +00:00
|
|
|
|
2012-11-06 23:26:47 +00:00
|
|
|
accept();
|
2009-09-29 22:52:46 +00:00
|
|
|
}
|