X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Freceivefiledlg.cpp;fp=src%2Fqtui%2Freceivefiledlg.cpp;h=e736421ea4c04b929bd7c7ea7c455d3e0fddc4a0;hp=0000000000000000000000000000000000000000;hb=e4a23f68789db8aa7dddeebed35f4ff6a90ffa8c;hpb=f5bb6544096b45cde4642e821654c48e26a9f79c diff --git a/src/qtui/receivefiledlg.cpp b/src/qtui/receivefiledlg.cpp new file mode 100644 index 00000000..e736421e --- /dev/null +++ b/src/qtui/receivefiledlg.cpp @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2005-2013 by the Quassel Project * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) version 3. * + * * + * 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include +#include + +#include "receivefiledlg.h" + +#include "transfer.h" + +ReceiveFileDlg::ReceiveFileDlg(const Transfer *transfer, QWidget *parent) + : QDialog(parent), + _transfer(transfer) +{ + setAttribute(Qt::WA_DeleteOnClose); + ui.setupUi(this); + + QString label = tr("%1 wants to send you a file:
%2 (%3 bytes)").arg(transfer->nick(), transfer->fileName()).arg(transfer->fileSize()); + ui.infoText->setText(label); +} + + +void ReceiveFileDlg::on_buttonBox_clicked(QAbstractButton *button) +{ + if (ui.buttonBox->standardButton(button) == QDialogButtonBox::Save) { + QString name = QFileDialog::getSaveFileName(this, QString(), QDir::currentPath() + "/" + _transfer->fileName()); + _transfer->accept(name); + } + +}