Esempio n. 1
0
/** 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();
}
Esempio n. 2
0
/** 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();
}
Esempio n. 3
0
/** Default constructor */
ProfileManager::ProfileManager(QWidget *parent)
	: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
	/* Invoke Qt Designer generated QObject setup routine */
	ui.setupUi(this);

	ui.headerFrame->setHeaderImage(QPixmap(":/images/contact_new128.png"));
	ui.headerFrame->setHeaderText(tr("Profile Manager"));

	connect(ui.identityTreeWidget, SIGNAL( customContextMenuRequested(QPoint)), this, SLOT( identityTreeWidgetCostumPopupMenu(QPoint)));
	connect(ui.identityTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(identityItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)));
	connect(ui.exportIdentity_PB, SIGNAL(clicked()), this, SLOT(exportIdentity()));

//	ui.exportIdentity_PB->setEnabled(false);
	fillIdentities();
}
Esempio n. 4
0
void ProfileManager::identityTreeWidgetCostumPopupMenu(QPoint)
{
	QTreeWidgetItem *item = getCurrentIdentity();

	QMenu contextMnu(this);

	QAction *action = contextMnu.addAction(QIcon(IMAGE_EXPORT), tr("Export Identity"), this, SLOT(exportIdentity()));
	action->setEnabled(item != NULL);

	contextMnu.exec(QCursor::pos());
}
Esempio n. 5
0
/** 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();
}