fixed serialisation bug and added new GUI bits

This commit is contained in:
csoler 2015-11-25 18:08:53 -05:00
parent 3fbbc57a1f
commit bca89c63c6
4 changed files with 1234 additions and 1150 deletions

View File

@ -102,7 +102,7 @@ uint32_t RsGxsIdLocalInfoItem::serial_size()
s += 4 ; // number of items s += 4 ; // number of items
s += mTimeStamps.size() * (RsGxsId::SIZE_IN_BYTES + 8) ; s += mTimeStamps.size() * (RsGxsId::SIZE_IN_BYTES + 8) ;
s += 4 ; // number of contacts s += 4 ; // number of contacts
s += mContacts.size() * (RsGxsId::SIZE_IN_BYTES + 8) ; s += mContacts.size() * RsGxsId::SIZE_IN_BYTES ;
return s; return s;
} }

View File

@ -271,6 +271,7 @@ bool p3IdService::loadList(std::list<RsItem*>& items)
for(std::map<RsGxsId,time_t>::const_iterator it2 = lii->mTimeStamps.begin();it2!=lii->mTimeStamps.end();++it2) for(std::map<RsGxsId,time_t>::const_iterator it2 = lii->mTimeStamps.begin();it2!=lii->mTimeStamps.end();++it2)
mKeysTS.insert(*it2) ; mKeysTS.insert(*it2) ;
std::cerr << "p3IdService::loadList(): read " << lii->mContacts.size() << " contacts." << std::endl;
mContacts = lii->mContacts ; mContacts = lii->mContacts ;
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,106 +1,113 @@
/* /*
* Retroshare Identity. * Retroshare Identity.
* *
* Copyright 2012-2012 by Robert Fernie. * Copyright 2012-2012 by Robert Fernie.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation. * License Version 2.1 as published by the Free Software Foundation.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details. * Library General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA. * USA.
* *
* Please report all bugs and problems to "retroshare@lunamutt.com". * Please report all bugs and problems to "retroshare@lunamutt.com".
* *
*/ */
#ifndef IDENTITYDIALOG_H #ifndef IDENTITYDIALOG_H
#define IDENTITYDIALOG_H #define IDENTITYDIALOG_H
#include "gui/gxs/RsGxsUpdateBroadcastPage.h" #include "gui/gxs/RsGxsUpdateBroadcastPage.h"
#include <retroshare/rsidentity.h> #include <retroshare/rsidentity.h>
#include "util/TokenQueue.h" #include "util/TokenQueue.h"
#define IMAGE_IDDIALOG ":/icons/friends_128.png" #define IMAGE_IDDIALOG ":/icons/friends_128.png"
namespace Ui { namespace Ui {
class IdDialog; class IdDialog;
} }
class UIStateHelper; class UIStateHelper;
class QTreeWidgetItem; class QTreeWidgetItem;
class IdDialog : public RsGxsUpdateBroadcastPage, public TokenResponse class IdDialog : public RsGxsUpdateBroadcastPage, public TokenResponse
{ {
Q_OBJECT Q_OBJECT
public: public:
IdDialog(QWidget *parent = 0); IdDialog(QWidget *parent = 0);
~IdDialog(); ~IdDialog();
virtual QIcon iconPixmap() const { return QIcon(IMAGE_IDDIALOG) ; } //MainPage virtual QIcon iconPixmap() const { return QIcon(IMAGE_IDDIALOG) ; } //MainPage
virtual QString pageName() const { return tr("People") ; } //MainPage virtual QString pageName() const { return tr("People") ; } //MainPage
virtual QString helpText() const { return ""; } //MainPage virtual QString helpText() const { return ""; } //MainPage
void loadRequest(const TokenQueue *queue, const TokenRequest &req); void loadRequest(const TokenQueue *queue, const TokenRequest &req);
protected: protected:
virtual void updateDisplay(bool complete); virtual void updateDisplay(bool complete);
private slots: private slots:
void filterComboBoxChanged(); void filterComboBoxChanged();
void filterChanged(const QString &text); void filterChanged(const QString &text);
void addIdentity(); void addIdentity();
void removeIdentity(); void removeIdentity();
void editIdentity(); void editIdentity();
void chatIdentity(); void chatIdentity();
void sendMsg(); void sendMsg();
void updateSelection(); void updateSelection();
void todo(); void todo();
void modifyReputation(); void modifyReputation();
/** Create the context popup menu and it's submenus */ /** Create the context popup menu and it's submenus */
void IdListCustomPopupMenu( QPoint point ); void IdListCustomPopupMenu( QPoint point );
private: void addtoContacts();
void processSettings(bool load); void removefromContacts();
void requestIdDetails();
void insertIdDetails(uint32_t token); private:
void processSettings(bool load);
void requestIdList();
void requestIdData(std::list<RsGxsGroupId> &ids); void requestIdDetails();
bool fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item, const RsPgpId &ownPgpId, int accept); void insertIdDetails(uint32_t token);
void insertIdList(uint32_t token);
void filterIds(); void requestIdList();
void requestIdData(std::list<RsGxsGroupId> &ids);
void requestRepList(); bool fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item, const RsPgpId &ownPgpId, int accept);
void insertRepList(uint32_t token); void insertIdList(uint32_t token);
void filterIds();
void requestIdEdit(std::string &id);
void showIdEdit(uint32_t token); void requestRepList();
void insertRepList(uint32_t token);
private:
TokenQueue *mIdQueue; void requestIdEdit(std::string &id);
UIStateHelper *mStateHelper; void showIdEdit(uint32_t token);
RsGxsGroupId mId; private:
TokenQueue *mIdQueue;
/* UI - Designer */ UIStateHelper *mStateHelper;
Ui::IdDialog *ui;
}; RsGxsGroupId mId;
#endif QTreeWidgetItem *contactsItem;
QTreeWidgetItem *allItem;
/* UI - Designer */
Ui::IdDialog *ui;
};
#endif