mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-21 21:04:32 -04:00
made the passwd dialog call Qt-independent (thanks to notifyBase)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1793 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9df3b567e7
commit
7c1288411a
6 changed files with 25 additions and 10 deletions
|
@ -48,6 +48,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
rsiface = NULL;
|
||||
|
||||
NotifyQt *notify = new NotifyQt();
|
||||
createRsIface(*notify);
|
||||
createRsControl(*rsiface, *notify);
|
||||
|
||||
/* RetroShare Core Objects */
|
||||
RsInit::InitRsConfig();
|
||||
bool okStart = RsInit::InitRetroShare(argc, argv);
|
||||
|
@ -118,10 +122,6 @@ int main(int argc, char *argv[])
|
|||
RsInit::LoadCertificates(false);
|
||||
}
|
||||
|
||||
NotifyQt *notify = new NotifyQt();
|
||||
createRsIface(*notify);
|
||||
createRsControl(*rsiface, *notify);
|
||||
|
||||
rsicontrol->StartupRetroShare();
|
||||
|
||||
MainWindow *w = new MainWindow;
|
||||
|
@ -145,6 +145,7 @@ int main(int argc, char *argv[])
|
|||
QObject::connect(notify,SIGNAL(configChanged()) ,w->messagesDialog ,SLOT(displayConfig() )) ;
|
||||
|
||||
QObject::connect(notify,SIGNAL(chatStatusChanged(const QString&,const QString&,bool)),w->peersDialog,SLOT(updatePeerStatusString(const QString&,const QString&,bool)));
|
||||
QObject::connect(notify,SIGNAL(peerHasNewCustomStateString(const QString&)),w->peersDialog,SLOT(updatePeersCustomStateString(const QString&)));
|
||||
QObject::connect(notify,SIGNAL(peerHasNewAvatar(const QString&)),w->peersDialog,SLOT(updatePeersAvatar(const QString&)));
|
||||
QObject::connect(notify,SIGNAL(ownAvatarChanged()),w->peersDialog,SLOT(updateAvatar()));
|
||||
QObject::connect(notify,SIGNAL(ownStatusMessageChanged()),w->peersDialog,SLOT(loadmypersonalstatus()));
|
||||
|
|
|
@ -44,6 +44,13 @@ void NotifyQt::notifyOwnAvatarChanged()
|
|||
emit ownAvatarChanged() ;
|
||||
}
|
||||
|
||||
std::string NotifyQt::askForPassword(const std::string& window_title,const std::string& text)
|
||||
{
|
||||
return QInputDialog::getText(NULL, QString::fromStdString(window_title),
|
||||
QString::fromStdString(text), QLineEdit::Password,
|
||||
NULL, NULL).toStdString();
|
||||
}
|
||||
|
||||
void NotifyQt::notifyOwnStatusMessageChanged()
|
||||
{
|
||||
std::cerr << "Notifyqt:: notified that own avatar changed" << std::endl ;
|
||||
|
|
|
@ -40,6 +40,7 @@ class NotifyQt: public QObject, public NotifyBase
|
|||
virtual void notifyPeerHasNewAvatar(std::string peer_id) ;
|
||||
virtual void notifyOwnAvatarChanged() ;
|
||||
virtual void notifyOwnStatusMessageChanged() ;
|
||||
virtual std::string askForPassword(const std::string& window_title,const std::string& text) ;
|
||||
|
||||
signals:
|
||||
// It's beneficial to send info to the GUI using signals, because signals are thread-safe
|
||||
|
|
|
@ -207,6 +207,8 @@ class NotifyBase
|
|||
virtual void notifyPeerHasNewAvatar(std::string peer_id) { (void)peer_id; }
|
||||
virtual void notifyOwnAvatarChanged() {}
|
||||
virtual void notifyOwnStatusMessageChanged() {}
|
||||
|
||||
virtual std::string askForPassword(const std::string& window_title,const std::string& text) {}
|
||||
};
|
||||
|
||||
const int NOTIFY_LIST_NEIGHBOURS = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue