saving GxsId for forum post creation

This commit is contained in:
csoler 2020-12-20 20:45:23 +01:00
parent 4b4b69de50
commit 646d07887c
2 changed files with 28 additions and 1 deletions

View File

@ -127,14 +127,40 @@ CreateGxsForumMsg::CreateGxsForumMsg(const RsGxsGroupId &fId, const RsGxsMessage
ui.generateCheckBox->hide(); ui.generateCheckBox->hide();
ui.generateSpinBox->hide(); ui.generateSpinBox->hide();
#endif #endif
processSettings(true);
} }
CreateGxsForumMsg::~CreateGxsForumMsg() CreateGxsForumMsg::~CreateGxsForumMsg()
{ {
processSettings(false);
delete(mForumQueue); delete(mForumQueue);
delete(mCirclesQueue); delete(mCirclesQueue);
} }
void CreateGxsForumMsg::processSettings(bool load)
{
Settings->beginGroup(QString("ForumPostsWidget"));
if (load)
{
// state of ID Chooser combobox
RsGxsId gxs_id(Settings->value("IDChooser", QString::fromStdString(RsGxsId().toStdString())).toString().toStdString());
if(!gxs_id.isNull() && rsIdentity->isOwnId(gxs_id))
ui.idChooser->setChosenId(gxs_id);
}
else
{
// state of ID Chooser combobox
RsGxsId id;
if(ui.idChooser->getChosenId(id))
Settings->setValue("IDChooser", QString::fromStdString(id.toStdString()));
}
Settings->endGroup();
}
void CreateGxsForumMsg::newMsg() void CreateGxsForumMsg::newMsg()
{ {
/* clear all */ /* clear all */

View File

@ -59,7 +59,8 @@ protected:
void closeEvent (QCloseEvent * event); void closeEvent (QCloseEvent * event);
private: private:
void loadFormInformation(); void processSettings(bool load);
void loadFormInformation();
void loadForumInfo(const uint32_t &token); void loadForumInfo(const uint32_t &token);
void loadParentMsg(const uint32_t &token); void loadParentMsg(const uint32_t &token);