mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-01 02:36:23 -04:00
Add Title when ask for password.
This commit is contained in:
parent
6edd7bb8e3
commit
275c47eff9
27 changed files with 95 additions and 81 deletions
|
@ -176,7 +176,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
|
|||
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.nickname_input->setPlaceholderText(tr("[Optional] Used when you write in chat lobbies, forums and channel comments."));
|
||||
ui.nickname_input->setPlaceholderText(tr("[Optional] Used when you write in chat lobbies, forums and channel comments. Can be setup later if you need one."));
|
||||
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
|
||||
|
|
|
@ -406,10 +406,10 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
|
|||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="nickname_label">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>You can have one or more identities. They are used when you write in chat lobbies, forums and channel comments. They act as the destination for distant chat and the Retroshare distant mail system.</p></body></html></string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>GXS Nickname</string>
|
||||
<string>Chatrooms/Forums Nickname</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -500,7 +500,7 @@ anonymous, you can use a fake email.</string>
|
|||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="node_label">
|
||||
<property name="text">
|
||||
<string>Node</string>
|
||||
<string>Node name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -724,17 +724,17 @@ anonymous, you can use a fake email.</string>
|
|||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>StyledLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>gui/common/StyledLabel.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>HeaderFrame</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>gui/common/HeaderFrame.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>StyledLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>gui/common/StyledLabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>new_gpg_key_checkbox</tabstop>
|
||||
|
|
|
@ -148,7 +148,7 @@ void NotifyQt::notifyOwnAvatarChanged()
|
|||
class SignatureEventData
|
||||
{
|
||||
public:
|
||||
SignatureEventData(const void *_data,int32_t _len,unsigned int _signlen)
|
||||
SignatureEventData(const void *_data,int32_t _len,unsigned int _signlen, std::string _reason)
|
||||
{
|
||||
// We need a new memory chnk because there's no guarranty _sign nor _signlen are not in the stack
|
||||
|
||||
|
@ -173,6 +173,7 @@ class SignatureEventData
|
|||
}
|
||||
len = _len ;
|
||||
memcpy(data,_data,len) ;
|
||||
reason = _reason ;
|
||||
}
|
||||
|
||||
~SignatureEventData()
|
||||
|
@ -184,7 +185,7 @@ class SignatureEventData
|
|||
|
||||
void performSignature()
|
||||
{
|
||||
if(rsPeers->gpgSignData(data,len,sign,signlen))
|
||||
if(rsPeers->gpgSignData(data,len,sign,signlen,reason))
|
||||
signature_result = SELF_SIGNATURE_RESULT_SUCCESS ;
|
||||
else
|
||||
signature_result = SELF_SIGNATURE_RESULT_FAILED ;
|
||||
|
@ -194,10 +195,11 @@ class SignatureEventData
|
|||
uint32_t len ;
|
||||
unsigned char *sign ;
|
||||
unsigned int *signlen ;
|
||||
int signature_result ; // 0=pending, 1=done, 2=failed/cancelled.
|
||||
int signature_result ; // 0=pending, 1=done, 2=failed/cancelled.
|
||||
std::string reason ;
|
||||
};
|
||||
|
||||
bool NotifyQt::askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result)
|
||||
bool NotifyQt::askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string reason /*=""*/)
|
||||
{
|
||||
{
|
||||
QMutexLocker m(&_mutex) ;
|
||||
|
@ -234,7 +236,7 @@ bool NotifyQt::askForDeferredSelfSignature(const void *data, const uint32_t len,
|
|||
//
|
||||
std::cerr << "NotifyQt:: deferred signature event requeted. Pushing into queue" << std::endl;
|
||||
|
||||
SignatureEventData *edta = new SignatureEventData(data,len,*signlen) ;
|
||||
SignatureEventData *edta = new SignatureEventData(data,len,*signlen, reason) ;
|
||||
|
||||
_deferred_signature_queue[chksum.toStdString()] = edta ;
|
||||
}
|
||||
|
@ -261,12 +263,21 @@ void NotifyQt::handleSignatureEvent()
|
|||
|
||||
|
||||
|
||||
bool NotifyQt::askForPassword(const std::string& key_details, bool prev_is_bad, std::string& password,bool& cancelled)
|
||||
bool NotifyQt::askForPassword(const std::string& title, const std::string& key_details, bool prev_is_bad, std::string& password,bool& cancelled)
|
||||
{
|
||||
RsAutoUpdatePage::lockAllEvents() ;
|
||||
|
||||
QInputDialog dialog;
|
||||
dialog.setWindowTitle(tr("PGP key passphrase"));
|
||||
if (title == "") {
|
||||
dialog.setWindowTitle(tr("PGP key passphrase"));
|
||||
} else if (title == "AuthSSLimpl::SignX509ReqWithGPG()") {
|
||||
dialog.setWindowTitle(tr("You need to sign your node's certificate."));
|
||||
} else if (title == "p3IdService::service_CreateGroup()") {
|
||||
dialog.setWindowTitle(tr("You need to sign your forum/chatrooms identity."));
|
||||
} else {
|
||||
dialog.setWindowTitle(QString::fromStdString(title));
|
||||
}
|
||||
|
||||
dialog.setLabelText((prev_is_bad ? QString("%1\n\n").arg(tr("Wrong password !")) : QString()) + QString("%1:\n %2").arg(tr("Please enter your PGP password for key"), QString::fromUtf8(key_details.c_str())));
|
||||
dialog.setTextEchoMode(QLineEdit::Password);
|
||||
dialog.setModal(true);
|
||||
|
|
|
@ -67,7 +67,7 @@ class NotifyQt: public QObject, public NotifyClient
|
|||
virtual void notifyDiscInfoChanged() ;
|
||||
virtual void notifyDownloadComplete(const std::string& fileHash);
|
||||
virtual void notifyDownloadCompleteCount(uint32_t count);
|
||||
virtual bool askForPassword(const std::string& key_details, bool prev_is_bad, std::string& password, bool &cancelled);
|
||||
virtual bool askForPassword(const std::string& title, const std::string& key_details, bool prev_is_bad, std::string& password, bool &cancelled);
|
||||
virtual bool askForPluginConfirmation(const std::string& plugin_filename, const std::string& plugin_file_hash);
|
||||
|
||||
// Queues the signature event so that it canhappen in the main GUI thread (to ask for passwd).
|
||||
|
@ -82,7 +82,7 @@ class NotifyQt: public QObject, public NotifyClient
|
|||
// 1: signature success
|
||||
// 2: signature failed. Wrong passwd, user pressed cancel, etc.
|
||||
//
|
||||
virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result) ;
|
||||
virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen, int& signature_result, std::string reason = "") ;
|
||||
|
||||
/* Notify from GUI */
|
||||
void notifyChatFontChanged();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue