/** Default constructor */ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), mOnlyGenerateIdentity(onlyGenerateIdentity) { /* Invoke Qt Designer generated QObject setup routine */ ui.setupUi(this); connect(ui.new_gpg_key_checkbox, SIGNAL(clicked()), this, SLOT(newGPGKeyGenUiSetup())); connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson())); connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity())); connect(ui.exportIdentity_PB, SIGNAL(clicked()), this, SLOT(exportIdentity())); //ui.genName->setFocus(Qt::OtherFocusReason); #if QT_VERSION >= 0x040700 ui.email_input->setPlaceholderText(tr("[Optional] Visible to your friends, and friends of friends.")) ; ui.location_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...")) ; ui.name_input->setPlaceholderText(tr("[Required] Visible to your friends, and friends of friends.")); ui.password_input->setPlaceholderText(tr("[Required] This password protects your PGP key.")); #endif /* get all available pgp private certificates.... * mark last one as default. */ init(); }
void GenCertDialog::init() { std::cerr << "Finding PGPUsers" << std::endl; ui.genPGPuser->clear() ; std::list<RsPgpId> pgpIds; std::list<RsPgpId>::iterator it; bool foundGPGKeys = false; if (!mOnlyGenerateIdentity) { if (RsAccounts::GetPGPLogins(pgpIds)) { for(it = pgpIds.begin(); it != pgpIds.end(); ++it) { QVariant userData(QString::fromStdString( (*it).toStdString() )); std::string name, email; RsAccounts::GetPGPLoginDetails(*it, name, email); std::cerr << "Adding PGPUser: "******" id: " << *it << std::endl; QString gid = QString::fromStdString( (*it).toStdString()).right(8) ; ui.genPGPuser->addItem(QString::fromUtf8(name.c_str()) + " <" + QString::fromUtf8(email.c_str()) + "> (" + gid + ")", userData); foundGPGKeys = true; } } } if (foundGPGKeys) { ui.no_gpg_key_label->hide(); ui.new_gpg_key_checkbox->setChecked(false); setWindowTitle(tr("Create new node")); ui.genButton2->setText(tr("Generate new node")); ui.headerFrame->setHeaderText(tr("Create a new node")); genNewGPGKey = false; } else { ui.no_gpg_key_label->setVisible(!mOnlyGenerateIdentity); ui.new_gpg_key_checkbox->setChecked(true); ui.new_gpg_key_checkbox->setEnabled(true); setWindowTitle(tr("Create new Identity")); ui.genButton2->setText(tr("Generate new Identity")); ui.headerFrame->setHeaderText(tr("Create a new Identity")); genNewGPGKey = true; } QString text; /*= ui.header_label->text() + "\n";*/ text += tr("You can create a new identity with this form."); if (mOnlyGenerateIdentity) { ui.new_gpg_key_checkbox->setChecked(true); ui.new_gpg_key_checkbox->hide(); ui.genprofileinfo_label->hide(); } else { text += "\n"; text += tr("Alternatively you can use an existing identity. Just uncheck \"Create a new identity\""); } ui.header_label->setText(text); newGPGKeyGenUiSetup(); updateUiSetup(); }
/** Default constructor */ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), mOnlyGenerateIdentity(onlyGenerateIdentity) { /* Invoke Qt Designer generated QObject setup routine */ ui.setupUi(this); ui.headerFrame->setHeaderImage(QPixmap(":/images/contact_new128.png")); ui.headerFrame->setHeaderText(tr("Create a new Identity")); connect(ui.new_gpg_key_checkbox, SIGNAL(clicked()), this, SLOT(newGPGKeyGenUiSetup())); connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson())); connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity())); connect(ui.exportIdentity_PB, SIGNAL(clicked()), this, SLOT(exportIdentity())); //ui.genName->setFocus(Qt::OtherFocusReason); // QObject *obj = QCoreApplication::eventFilter() ; // std::cerr << "Event filter : " << obj << std::endl; // QCoreApplication::instance()->setEventFilter(MyEventFilter) ; entropy_timer = new QTimer ; entropy_timer->start(20) ; QObject::connect(entropy_timer,SIGNAL(timeout()),this,SLOT(grabMouse())) ; // EntropyCollectorWidget *ecw = new EntropyCollectorWidget(ui.entropy_bar,this) ; // ecw->resize(size()) ; // ecw->move(0,0) ; // // QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect ; // effect->setOpacity(0.2) ; // ecw->setGraphicsEffect(effect) ; //ecw->setBackgroundColor(QColor::fromRGB(1,1,1)) ; // ecw->show() ; ui.entropy_bar->setValue(0) ; #if QT_VERSION >= 0x040700 ui.email_input->setPlaceholderText(tr("[Optional] Visible to your friends, and friends of friends.")) ; ui.location_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...")) ; ui.name_input->setPlaceholderText(tr("[Required] Visible to your friends, and friends of friends.")); ui.password_input->setPlaceholderText(tr("[Required] This password protects your PGP key.")); ui.password_input_2->setPlaceholderText(tr("[Required] Type the same password again here.")); #endif ui.location_input->setToolTip(tr("Put a meaningful location. ex : home, laptop, etc. \nThis field will be used to differentiate different installations with\nthe same identity (PGP key).")) ; ui.email_input->hide() ; ui.email_label->hide() ; /* get all available pgp private certificates.... * mark last one as default. */ init(); }
void GenCertDialog::init() { std::cerr << "Finding PGPUsers" << std::endl; ui.genPGPuser->clear() ; std::list<std::string> pgpIds; std::list<std::string>::iterator it; bool foundGPGKeys = false; if (!mOnlyGenerateIdentity) { if (RsInit::GetPGPLogins(pgpIds)) { for(it = pgpIds.begin(); it != pgpIds.end(); it++) { QVariant userData(QString::fromStdString(*it)); std::string name, email; RsInit::GetPGPLoginDetails(*it, name, email); std::cerr << "Adding PGPUser: "******" id: " << *it << std::endl; QString gid = QString::fromStdString(*it).right(8) ; ui.genPGPuser->addItem(QString::fromUtf8(name.c_str()) + " <" + QString::fromUtf8(email.c_str()) + "> (" + gid + ")", userData); foundGPGKeys = true; } } } if (foundGPGKeys) { ui.no_gpg_key_label->hide(); ui.new_gpg_key_checkbox->setChecked(false); setWindowTitle(tr("Create new Location")); ui.genButton->setText(tr("Generate new Location")); ui.headerFrame->setHeaderText(tr("Create a new Location")); genNewGPGKey = false; } else { ui.no_gpg_key_label->setVisible(!mOnlyGenerateIdentity); ui.new_gpg_key_checkbox->setChecked(true); ui.new_gpg_key_checkbox->setEnabled(true); setWindowTitle(tr("Create new Identity")); ui.genButton->setText(tr("Generate new Identity")); ui.headerFrame->setHeaderText(tr("Create a new Identity")); genNewGPGKey = true; } QString text = ui.header_label->text() + "\n"; if (mOnlyGenerateIdentity) { ui.new_gpg_key_checkbox->setChecked(true); ui.new_gpg_key_checkbox->hide(); ui.genprofileinfo_label->hide(); text += tr("You can create a new identity with this form."); } else { text += tr("You can use an existing identity (i.e. a PGP key pair), from the list below, or create a new one with this form."); } ui.header_label->setText(text); newGPGKeyGenUiSetup(); }
/** Default constructor */ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), mOnlyGenerateIdentity(onlyGenerateIdentity) { /* Invoke Qt Designer generated QObject setup routine */ ui.setupUi(this); ui.headerFrame->setHeaderImage(QPixmap(":/images/contact_new128.png")); ui.headerFrame->setHeaderText(tr("Create a new profile")); connect(ui.new_gpg_key_checkbox, SIGNAL(clicked()), this, SLOT(newGPGKeyGenUiSetup())); connect(ui.adv_checkbox, SIGNAL(clicked()), this, SLOT(updateUiSetup())); connect(ui.hidden_checkbox, SIGNAL(clicked()), this, SLOT(updateUiSetup())); connect(ui.genButton2, SIGNAL(clicked()), this, SLOT(genPerson())); connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity())); connect(ui.exportIdentity_PB, SIGNAL(clicked()), this, SLOT(exportIdentity())); //ui.genName->setFocus(Qt::OtherFocusReason); // QObject *obj = QCoreApplication::eventFilter() ; // std::cerr << "Event filter : " << obj << std::endl; // QCoreApplication::instance()->setEventFilter(MyEventFilter) ; entropy_timer = new QTimer ; entropy_timer->start(20) ; QObject::connect(entropy_timer,SIGNAL(timeout()),this,SLOT(grabMouse())) ; // EntropyCollectorWidget *ecw = new EntropyCollectorWidget(ui.entropy_bar,this) ; // ecw->resize(size()) ; // ecw->move(0,0) ; // // QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect ; // effect->setOpacity(0.2) ; // ecw->setGraphicsEffect(effect) ; //ecw->setBackgroundColor(QColor::fromRGB(1,1,1)) ; // ecw->show() ; ui.entropy_bar->setValue(0) ; // make sure that QVariant always takes an 'int' otherwise the program will crash! ui.keylength_comboBox->addItem("default (2048 bits, recommended)", QVariant(2048)); ui.keylength_comboBox->addItem("high (3072 bits)", QVariant(3072)); ui.keylength_comboBox->addItem("insane (4096 bits)", QVariant(4096)); #if QT_VERSION >= 0x040700 ui.email_input->setPlaceholderText(tr("[Optional] Visible to your friends, and friends of friends.")) ; ui.node_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...")) ; ui.hiddenaddr_input->setPlaceholderText(tr("[Required] Tor/I2P address - Examples: xa76giaf6ifda7ri63i263.onion (obtained by you from Tor)")) ; ui.name_input->setPlaceholderText(tr("[Required] Visible to your friends, and friends of friends.")); ui.password_input->setPlaceholderText(tr("[Required] This password protects your private PGP key.")); ui.password_input_2->setPlaceholderText(tr("[Required] Type the same password again here.")); #endif ui.node_input->setToolTip(tr("Enter a meaningful node description. e.g. : home, laptop, etc. \nThis field will be used to differentiate different installations with\nthe same profile (PGP key pair).")) ; ui.email_input->hide() ; ui.email_label->hide() ; /* get all available pgp private certificates.... * mark last one as default. */ init(); }