1/*
2 * Copyright (C) 2015 by nocteau
3 * Copyright (C) 2015 by Daniel Molkentin <danimo@owncloud.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16#include "ui_addcertificatedialog.h"
17#include "addcertificatedialog.h"
18#include <QFileDialog>
19#include <QLineEdit>
20
21
22namespace OCC {
23AddCertificateDialog::AddCertificateDialog(QWidget *parent)
24 : QDialog(parent)
25 , ui(new Ui::AddCertificateDialog)
26{
27 ui->setupUi(this);
28 ui->labelErrorCertif->setText("");
29}
30
31AddCertificateDialog::~AddCertificateDialog()
32{
33 delete ui;
34}
35
36void AddCertificateDialog::on_pushButtonBrowseCertificate_clicked()
37{
38 QString fileName = QFileDialog::getOpenFileName(this, tr("Select a certificate"), "", tr("Certificate files (*.p12 *.pfx)"));
39 ui->lineEditCertificatePath->setText(fileName);
40}
41
42QString AddCertificateDialog::getCertificatePath()
43{
44 return ui->lineEditCertificatePath->text();
45}
46
47QString AddCertificateDialog::getCertificatePasswd()
48{
49 return ui->lineEditPWDCertificate->text();
50}
51
52void AddCertificateDialog::showErrorMessage(const QString message)
53{
54 ui->labelErrorCertif->setText(message);
55}
56
57void AddCertificateDialog::reinit()
58{
59 ui->labelErrorCertif->clear();
60 ui->lineEditCertificatePath->clear();
61 ui->lineEditPWDCertificate->clear();
62}
63}
64