From 21d62edca2b3042edd86e88912e5b43ee2d8718e Mon Sep 17 00:00:00 2001 From: electron128 Date: Sat, 9 May 2015 09:28:38 +0000 Subject: [PATCH] fixed comment voting git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8224 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp | 9 ++++++--- retroshare-gui/src/gui/gxs/GxsCommentDialog.h | 1 + retroshare-gui/src/gui/gxs/GxsIdChooser.cpp | 1 + retroshare-gui/src/gui/gxs/GxsIdChooser.h | 4 ++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp index 39e1fe046..aece38f77 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp @@ -47,9 +47,7 @@ GxsCommentDialog::GxsCommentDialog(QWidget *parent, RsTokenService *token_servic connect(ui->refreshButton, SIGNAL(clicked()), this, SLOT(refresh())); connect(ui->idChooser, SIGNAL(currentIndexChanged( int )), this, SLOT(voterSelectionChanged( int ))); - - /* force voterId through - first time */ - voterSelectionChanged( 0 ); + connect(ui->idChooser, SIGNAL(idsLoaded()), this, SLOT(idChooserReady())); } GxsCommentDialog::~GxsCommentDialog() @@ -81,6 +79,11 @@ void GxsCommentDialog::refresh() commentLoad(mGrpId, mMsgId); } +void GxsCommentDialog::idChooserReady() +{ + voterSelectionChanged(0); +} + void GxsCommentDialog::voterSelectionChanged( int index ) { std::cerr << "GxsCommentDialog::voterSelectionChanged(" << index << ")"; diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h index 53f83464f..6edeb0948 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h @@ -46,6 +46,7 @@ public: private slots: void refresh(); + void idChooserReady(); void voterSelectionChanged( int index ); private: diff --git a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp index 6dbbeb18f..7fb83f131 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp @@ -219,6 +219,7 @@ void GxsIdChooser::loadPrivateIds() setItemData(count() - 1, TYPE_CREATE_ID, ROLE_TYPE); } setDefaultItem(); + emit idsLoaded(); } mFirstLoad = false; diff --git a/retroshare-gui/src/gui/gxs/GxsIdChooser.h b/retroshare-gui/src/gui/gxs/GxsIdChooser.h index 75cd3f70f..e785fb227 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdChooser.h +++ b/retroshare-gui/src/gui/gxs/GxsIdChooser.h @@ -56,6 +56,10 @@ public: bool setChosenId(const RsGxsId &gxsId); ChosenId_Ret getChosenId(RsGxsId &gxsId); +signals: + // emitted after first load of own ids + void idsLoaded(); + protected: virtual void showEvent(QShowEvent *event); void updateDisplay(bool reset);