select GxsIds as default list to chose msg destination from

This commit is contained in:
csoler 2018-10-03 15:25:53 +02:00
parent 83a987936d
commit 81fc3b7921
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
4 changed files with 13 additions and 2 deletions

View File

@ -377,6 +377,7 @@ struct RsIdentity : RsGxsIfaceHelper
virtual bool setAsRegularContact(const RsGxsId& id,bool is_a_contact) = 0 ;
virtual bool isARegularContact(const RsGxsId& id) = 0 ;
virtual uint32_t nbRegularContacts() =0;
virtual bool serialiseIdentityToMemory( const RsGxsId& id,
std::string& radix_string ) = 0;

View File

@ -224,7 +224,13 @@ uint32_t p3IdService::idAuthenPolicy()
return policy;
}
bool p3IdService::isARegularContact(const RsGxsId& id)
uint32_t p3IdService::nbRegularContacts()
{
RsStackMutex stack(mIdMtx);
return mContacts.size();
}
bool p3IdService::isARegularContact(const RsGxsId& id)
{
RsStackMutex stack(mIdMtx);
return mContacts.find(id) != mContacts.end() ;

View File

@ -281,6 +281,7 @@ public:
virtual bool setAsRegularContact(const RsGxsId& id,bool is_a_contact) ;
virtual bool isARegularContact(const RsGxsId& id) ;
virtual uint32_t nbRegularContacts() ;
virtual time_t getLastUsageTS(const RsGxsId &id) ;
/**************** RsGixs Implementation ***************/

View File

@ -268,7 +268,10 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
ui.filterComboBox->addItem(tr("Friend Nodes"));
ui.filterComboBox->addItem(tr("All people"));
ui.filterComboBox->addItem(tr("My contacts"));
ui.filterComboBox->setCurrentIndex(3);
ui.filterComboBox->setCurrentIndex(2);
if(rsIdentity->nbRegularContacts() > 0)
ui.filterComboBox->setCurrentIndex(3);
connect(ui.comboStyle, SIGNAL(activated(int)),this, SLOT(changeFormatType(int)));
connect(ui.comboFont, SIGNAL(activated(const QString &)), this, SLOT(textFamily(const QString &)));