2012-02-13 13:43:15 -05:00
|
|
|
/*
|
|
|
|
* Retroshare Identity.
|
|
|
|
*
|
|
|
|
* Copyright 2012-2012 by Robert Fernie.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License Version 2.1 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA.
|
|
|
|
*
|
|
|
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
#ifndef IDEDITDIALOG_H
|
|
|
|
#define IDEDITDIALOG_H
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2012-06-07 13:11:57 -04:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
2012-06-13 20:36:25 -04:00
|
|
|
#include "util/TokenQueue.h"
|
2013-10-20 05:56:12 -04:00
|
|
|
#include <retroshare/rsidentity.h>
|
2014-03-17 16:56:06 -04:00
|
|
|
#include <retroshare/rsgxsifacetypes.h>
|
2015-02-04 19:10:37 -05:00
|
|
|
#include <QDialog>
|
2012-06-13 20:36:25 -04:00
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
class UIStateHelper;
|
|
|
|
|
2015-02-04 19:10:37 -05:00
|
|
|
namespace Ui {
|
|
|
|
class IdEditDialog;
|
|
|
|
}
|
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
class IdEditDialog : public QDialog, public TokenResponse
|
2012-02-13 13:43:15 -05:00
|
|
|
{
|
2013-07-10 17:57:23 -04:00
|
|
|
Q_OBJECT
|
2012-02-13 13:43:15 -05:00
|
|
|
|
|
|
|
public:
|
|
|
|
IdEditDialog(QWidget *parent = 0);
|
2014-10-12 06:46:09 -04:00
|
|
|
~IdEditDialog();
|
2012-02-13 13:43:15 -05:00
|
|
|
|
|
|
|
void setupNewId(bool pseudo);
|
2012-06-13 20:36:25 -04:00
|
|
|
void setupExistingId(std::string keyId);
|
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2014-07-06 07:19:58 -04:00
|
|
|
std::string getLastIdName() {return mLastIdName;}
|
|
|
|
|
2012-02-13 13:43:15 -05:00
|
|
|
private slots:
|
2013-07-10 17:57:23 -04:00
|
|
|
void idTypeToggled(bool checked);
|
2013-10-20 05:56:12 -04:00
|
|
|
void submit();
|
|
|
|
|
2015-02-04 19:10:37 -05:00
|
|
|
void changeAvatar();
|
2015-01-27 11:36:27 -05:00
|
|
|
|
2015-02-04 19:10:37 -05:00
|
|
|
void addRecognTag();
|
2013-10-20 05:56:12 -04:00
|
|
|
void checkNewTag();
|
|
|
|
void rmTag1();
|
|
|
|
void rmTag2();
|
|
|
|
void rmTag3();
|
|
|
|
void rmTag4();
|
|
|
|
void rmTag5();
|
2012-02-13 13:43:15 -05:00
|
|
|
|
|
|
|
private:
|
2013-10-20 05:56:12 -04:00
|
|
|
void createId();
|
|
|
|
void updateId();
|
2012-02-13 13:43:15 -05:00
|
|
|
void updateIdType(bool pseudo);
|
2013-07-10 17:57:23 -04:00
|
|
|
void loadExistingId(uint32_t token);
|
2015-02-04 19:10:37 -05:00
|
|
|
void setAvatar(const QPixmap &avatar);
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2013-10-20 05:56:12 -04:00
|
|
|
void loadRecognTags();
|
|
|
|
// extract details.
|
2015-02-04 19:10:37 -05:00
|
|
|
bool tagDetails(const RsGxsId &id, const std::string &name, const std::string &tag, QString &desc);
|
2013-10-20 05:56:12 -04:00
|
|
|
void rmTag(int idx);
|
|
|
|
|
2012-02-13 13:43:15 -05:00
|
|
|
protected:
|
2015-02-04 19:10:37 -05:00
|
|
|
Ui::IdEditDialog *ui;
|
2013-07-10 17:57:23 -04:00
|
|
|
bool mIsNew;
|
|
|
|
UIStateHelper *mStateHelper;
|
2015-02-04 19:10:37 -05:00
|
|
|
|
2013-10-20 05:56:12 -04:00
|
|
|
RsGxsIdGroup mEditGroup;
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2012-06-13 20:36:25 -04:00
|
|
|
TokenQueue *mIdQueue;
|
2014-07-06 07:19:58 -04:00
|
|
|
std::string mLastIdName;
|
2015-02-04 19:10:37 -05:00
|
|
|
|
|
|
|
QPixmap mAvatar; // Avatar from identity (not calculated)
|
2012-02-13 13:43:15 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|