Some small fixes to cert management

This commit is contained in:
Pawel Polanski
2010-12-14 11:31:41 +01:00
parent d7e826771d
commit 75bd87e073
8 changed files with 47 additions and 13 deletions

View File

@@ -33,6 +33,9 @@
#include "s60certificateinfo.h" #include "s60certificateinfo.h"
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
CertificatePathChooser::CertificatePathChooser(QWidget *parent) : CertificatePathChooser::CertificatePathChooser(QWidget *parent) :
Utils::PathChooser(parent) Utils::PathChooser(parent)
{ {

View File

@@ -32,6 +32,9 @@
#include "utils/pathchooser.h" #include "utils/pathchooser.h"
namespace Qt4ProjectManager {
namespace Internal {
class CertificatePathChooser : public Utils::PathChooser class CertificatePathChooser : public Utils::PathChooser
{ {
Q_DISABLE_COPY(CertificatePathChooser) Q_DISABLE_COPY(CertificatePathChooser)
@@ -42,4 +45,7 @@ public:
virtual bool validatePath(const QString &path, QString *errorMessage = 0); virtual bool validatePath(const QString &path, QString *errorMessage = 0);
}; };
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // CERTIFICATEPATHCHOOSER_H #endif // CERTIFICATEPATHCHOOSER_H

View File

@@ -1,20 +1,29 @@
#include "s60certificatedetailsdialog.h" #include "s60certificatedetailsdialog.h"
#include "ui_s60certificatedetailsdialog.h" #include "ui_s60certificatedetailsdialog.h"
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
struct S60CertificateDetailsDialogPrivate
{
S60CertificateDetailsDialogPrivate(){};
Ui::S60CertificateDetailsDialog m_ui;
};
S60CertificateDetailsDialog::S60CertificateDetailsDialog(QWidget *parent) : S60CertificateDetailsDialog::S60CertificateDetailsDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::S60CertificateDetailsDialog) m_d(new S60CertificateDetailsDialogPrivate)
{ {
ui->setupUi(this); m_d->m_ui.setupUi(this);
connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(m_d->m_ui.buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
} }
S60CertificateDetailsDialog::~S60CertificateDetailsDialog() S60CertificateDetailsDialog::~S60CertificateDetailsDialog()
{ {
delete ui; delete m_d;
} }
void S60CertificateDetailsDialog::setText(const QString &text) void S60CertificateDetailsDialog::setText(const QString &text)
{ {
ui->textBrowser->setText(text); m_d->m_ui.textBrowser->setText(text);
} }

View File

@@ -3,9 +3,10 @@
#include <QDialog> #include <QDialog>
namespace Ui { struct S60CertificateDetailsDialogPrivate;
class S60CertificateDetailsDialog;
} namespace Qt4ProjectManager {
namespace Internal {
class S60CertificateDetailsDialog : public QDialog class S60CertificateDetailsDialog : public QDialog
{ {
@@ -18,7 +19,10 @@ public:
void setText(const QString &text); void setText(const QString &text);
private: private:
Ui::S60CertificateDetailsDialog *ui; S60CertificateDetailsDialogPrivate *m_d;
}; };
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // S60CERTIFICATEDETAILSDIALOG_H #endif // S60CERTIFICATEDETAILSDIALOG_H

View File

@@ -34,12 +34,11 @@
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
QT_FORWARD_DECLARE_CLASS(QString)
QT_FORWARD_DECLARE_CLASS(S60SymbianCertificate)
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
class S60SymbianCertificate;
class S60CertificateInfo : public QObject class S60CertificateInfo : public QObject
{ {
Q_OBJECT Q_OBJECT

View File

@@ -786,7 +786,9 @@ S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePack
m_ui.keyFilePath->setExpectedKind(Utils::PathChooser::File); m_ui.keyFilePath->setExpectedKind(Utils::PathChooser::File);
updateUi(); updateUi();
m_ui.certificateDetails->setEnabled(m_ui.signaturePath->isValid()); bool enableCertDetails = m_signStep->signingMode() == S60CreatePackageStep::SignCustom
&& m_ui.signaturePath->isValid();
m_ui.certificateDetails->setEnabled(enableCertDetails);
connect(m_ui.certificateDetails, SIGNAL(clicked()), connect(m_ui.certificateDetails, SIGNAL(clicked()),
this, SLOT(displayCertificateDetails())); this, SLOT(displayCertificateDetails()));
@@ -841,16 +843,19 @@ void S60CreatePackageStepConfigWidget::updateUi()
m_ui.selfSignedButton->setChecked(false); m_ui.selfSignedButton->setChecked(false);
m_ui.customCertificateButton->setChecked(true); m_ui.customCertificateButton->setChecked(true);
m_ui.notSignedButton->setChecked(false); m_ui.notSignedButton->setChecked(false);
m_ui.certificateDetails->setEnabled(m_ui.signaturePath->isValid());
break; break;
case S60CreatePackageStep::NotSigned: case S60CreatePackageStep::NotSigned:
m_ui.selfSignedButton->setChecked(false); m_ui.selfSignedButton->setChecked(false);
m_ui.customCertificateButton->setChecked(false); m_ui.customCertificateButton->setChecked(false);
m_ui.notSignedButton->setChecked(true); m_ui.notSignedButton->setChecked(true);
m_ui.certificateDetails->setEnabled(false);
break; break;
default: default:
m_ui.selfSignedButton->setChecked(true); m_ui.selfSignedButton->setChecked(true);
m_ui.customCertificateButton->setChecked(false); m_ui.customCertificateButton->setChecked(false);
m_ui.notSignedButton->setChecked(false); m_ui.notSignedButton->setChecked(false);
m_ui.certificateDetails->setEnabled(false);
break; break;
} }
bool customSigned = m_signStep->signingMode() == S60CreatePackageStep::SignCustom; bool customSigned = m_signStep->signingMode() == S60CreatePackageStep::SignCustom;

View File

@@ -46,6 +46,8 @@
#include <memory> #include <memory>
using namespace Botan; using namespace Botan;
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
namespace { namespace {
const char * const CERT_IMEI_FIELD_NAME = "1.2.826.0.1.1796587.1.1.1.1"; const char * const CERT_IMEI_FIELD_NAME = "1.2.826.0.1.1796587.1.1.1.1";

View File

@@ -35,6 +35,9 @@
class S60SymbianCertificatePrivate; class S60SymbianCertificatePrivate;
namespace Qt4ProjectManager {
namespace Internal {
class S60SymbianCertificate class S60SymbianCertificate
{ {
public: public:
@@ -63,4 +66,7 @@ protected:
QString m_errorString; QString m_errorString;
}; };
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // S60SYMBIANCERTIFICATE_H #endif // S60SYMBIANCERTIFICATE_H