mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 17:28:41 -04:00
experimental fix against early closing crash on CreateCircleDialog
This commit is contained in:
parent
04fd7f17ca
commit
5f15414e65
2 changed files with 32 additions and 4 deletions
|
@ -51,6 +51,9 @@
|
||||||
CreateCircleDialog::CreateCircleDialog()
|
CreateCircleDialog::CreateCircleDialog()
|
||||||
: QDialog(NULL, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint)
|
: QDialog(NULL, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint)
|
||||||
{
|
{
|
||||||
|
mIdentitiesLoading = false;
|
||||||
|
mCloseAfterIdentitiesLoaded = false;
|
||||||
|
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
|
@ -112,11 +115,22 @@ CreateCircleDialog::CreateCircleDialog()
|
||||||
QObject::connect(ui.radioButton_Public, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
QObject::connect(ui.radioButton_Public, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
||||||
QObject::connect(ui.radioButton_Self, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
QObject::connect(ui.radioButton_Self, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
||||||
QObject::connect(ui.radioButton_Restricted, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
QObject::connect(ui.radioButton_Restricted, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateCircleDialog::~CreateCircleDialog()
|
CreateCircleDialog::~CreateCircleDialog()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void CreateCircleDialog::closeEvent(QCloseEvent *e)
|
||||||
|
{
|
||||||
|
if(mIdentitiesLoading)
|
||||||
|
{
|
||||||
|
mCloseAfterIdentitiesLoaded = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
QDialog::closeEvent(e);
|
||||||
|
}
|
||||||
|
|
||||||
void CreateCircleDialog::editExistingId(const RsGxsGroupId &circleId, const bool &clearList /*= true*/,bool readonly)
|
void CreateCircleDialog::editExistingId(const RsGxsGroupId &circleId, const bool &clearList /*= true*/,bool readonly)
|
||||||
{
|
{
|
||||||
|
@ -700,6 +714,8 @@ void CreateCircleDialog::loadIdentities()
|
||||||
{
|
{
|
||||||
std::cerr << "Loading identities..." << std::endl;
|
std::cerr << "Loading identities..." << std::endl;
|
||||||
|
|
||||||
|
mIdentitiesLoading = true;
|
||||||
|
|
||||||
RsThread::async([this]()
|
RsThread::async([this]()
|
||||||
{
|
{
|
||||||
std::list<RsGroupMetaData> ids_meta;
|
std::list<RsGroupMetaData> ids_meta;
|
||||||
|
@ -735,6 +751,12 @@ void CreateCircleDialog::loadIdentities()
|
||||||
fillIdentitiesList(*id_groups);
|
fillIdentitiesList(*id_groups);
|
||||||
|
|
||||||
delete id_groups;
|
delete id_groups;
|
||||||
|
|
||||||
|
mIdentitiesLoading = false;
|
||||||
|
|
||||||
|
if(mCloseAfterIdentitiesLoaded)
|
||||||
|
close();
|
||||||
|
|
||||||
}, this );
|
}, this );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ public:
|
||||||
void addCircle(const RsGxsCircleDetails &cirDetails);
|
void addCircle(const RsGxsCircleDetails &cirDetails);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void addMember();
|
void addMember();
|
||||||
void removeMember();
|
void removeMember();
|
||||||
|
|
||||||
|
@ -60,6 +61,9 @@ private slots:
|
||||||
void IdListCustomPopupMenu( QPoint point );
|
void IdListCustomPopupMenu( QPoint point );
|
||||||
void MembershipListCustomPopupMenu( QPoint point);
|
void MembershipListCustomPopupMenu( QPoint point);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void closeEvent(QCloseEvent *) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void updateCircleGUI();
|
void updateCircleGUI();
|
||||||
|
@ -70,6 +74,8 @@ private:
|
||||||
bool mIsExistingCircle;
|
bool mIsExistingCircle;
|
||||||
bool mIsExternalCircle;
|
bool mIsExternalCircle;
|
||||||
bool mReadOnly;
|
bool mReadOnly;
|
||||||
|
bool mIdentitiesLoading;
|
||||||
|
bool mCloseAfterIdentitiesLoaded;
|
||||||
|
|
||||||
void loadCircle(const RsGxsGroupId& groupId);
|
void loadCircle(const RsGxsGroupId& groupId);
|
||||||
void loadIdentities();
|
void loadIdentities();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue