2015-02-25 19:00:27 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 by nocteau
|
|
|
|
* Copyright (C) 2015 by Daniel Molkentin <danimo@owncloud.com>
|
|
|
|
*
|
|
|
|
* 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
|
2016-10-25 12:00:07 +03:00
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2015-02-25 19:00:27 +03:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2014-11-18 18:44:14 +03:00
|
|
|
#include "ui_addcertificatedialog.h"
|
|
|
|
#include "addcertificatedialog.h"
|
|
|
|
#include <QFileDialog>
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
|
|
|
|
|
|
|
namespace OCC {
|
|
|
|
AddCertificateDialog::AddCertificateDialog(QWidget *parent) :
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::AddCertificateDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
ui->labelErrorCertif->setText("");
|
|
|
|
}
|
|
|
|
|
|
|
|
AddCertificateDialog::~AddCertificateDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AddCertificateDialog::on_pushButtonBrowseCertificate_clicked()
|
|
|
|
{
|
|
|
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Select a certificate"), "", tr("Certificate files (*.p12 *.pfx)"));
|
|
|
|
ui->lineEditCertificatePath->setText(fileName);
|
|
|
|
}
|
|
|
|
|
|
|
|
QString AddCertificateDialog::getCertificatePath()
|
|
|
|
{
|
|
|
|
return ui->lineEditCertificatePath->text();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString AddCertificateDialog::getCertificatePasswd()
|
|
|
|
{
|
|
|
|
return ui->lineEditPWDCertificate->text();
|
|
|
|
}
|
|
|
|
|
2015-01-23 22:08:14 +03:00
|
|
|
void AddCertificateDialog::showErrorMessage(const QString message)
|
2014-11-18 18:44:14 +03:00
|
|
|
{
|
|
|
|
ui->labelErrorCertif->setText(message);
|
|
|
|
}
|
|
|
|
|
2015-01-28 19:38:38 +03:00
|
|
|
void AddCertificateDialog::reinit()
|
2014-11-18 18:44:14 +03:00
|
|
|
{
|
2015-01-28 19:38:38 +03:00
|
|
|
ui->labelErrorCertif->clear();
|
|
|
|
ui->lineEditCertificatePath->clear();
|
|
|
|
ui->lineEditPWDCertificate->clear();
|
2014-11-18 18:44:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|