diff --git a/retroshare-gui/src/gui/BlogDialog.cpp b/retroshare-gui/src/gui/BlogDialog.cpp
index 681192753..035e75b33 100644
--- a/retroshare-gui/src/gui/BlogDialog.cpp
+++ b/retroshare-gui/src/gui/BlogDialog.cpp
@@ -25,6 +25,8 @@
#include "rsiface/rsQblog.h"
#include "rsiface/rspeers.h" //to retrieve peer/usrId info
+#include "profile/ProfileView.h"
+
/** Constructor */
BlogDialog::BlogDialog(QWidget *parent)
: MainPage (parent)
@@ -38,7 +40,9 @@ BlogDialog::BlogDialog(QWidget *parent)
connect(underlineBtn, SIGNAL(clicked()), this, SLOT(setFont()));
connect(italicBtn, SIGNAL(clicked()), this, SLOT(setFont()));
connect(refreshBtn, SIGNAL(clicked()), this, SLOT(update()));
-
+
+ connect(userList, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( peerCustomPopupMenu( QPoint ) ) );
+
/* Current Font */
mCurrentFont = QFont("Comic Sans MS", 8);
@@ -48,6 +52,55 @@ BlogDialog::BlogDialog(QWidget *parent)
}
+void BlogDialog::peerCustomPopupMenu( QPoint point )
+{
+ /*
+ */
+
+ QMenu contextMnu( this );
+ QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
+
+ QAction *profileAct = new QAction( tr( "Show Profile" ), this );
+ QAction *onlyoneAct = new QAction( tr( "Show Only This Blog" ), this );
+ QAction *allAct = new QAction( tr( "Show All Blogs" ), this );
+
+ connect( profileAct , SIGNAL( triggered() ), this, SLOT( showuserprofile() ) );
+ connect( onlyoneAct , SIGNAL( triggered() ), this, SLOT( showoneblog() ) );
+ connect( allAct , SIGNAL( triggered() ), this, SLOT( showallblogs() ) );
+
+ contextMnu.clear();
+ contextMnu.addAction( profileAct );
+ contextMnu.addAction( onlyoneAct );
+ contextMnu.addAction( allAct );
+ contextMnu.exec( mevent->globalPos() );
+
+}
+
+void BlogDialog::showuserprofile()
+{
+ showprofile("");
+}
+
+void BlogDialog::showprofile(std::string id)
+{
+static ProfileView *oneProfile = new ProfileView(NULL);
+
+ oneProfile -> setPeerId(id);
+ oneProfile -> show();
+}
+
+void BlogDialog::showoneblog()
+{
+ return;
+}
+
+
+void BlogDialog::showallblogs()
+{
+ return;
+}
+
+
void BlogDialog::sendBlog()
{
QString blogMsg = lineEdit->toPlainText();
diff --git a/retroshare-gui/src/gui/BlogDialog.h b/retroshare-gui/src/gui/BlogDialog.h
index 8bdad1105..15f6c79ac 100644
--- a/retroshare-gui/src/gui/BlogDialog.h
+++ b/retroshare-gui/src/gui/BlogDialog.h
@@ -35,7 +35,7 @@ public:
/** Default Destructor */
/** Qt Designer generated object */
- Ui::BlogDialog ui;
+ //Ui::BlogDialog ui;
public slots:
void sendBlog();
@@ -44,9 +44,17 @@ public slots:
/// populates blog service with current information from core
void update();
+ void showprofile(std::string id);
private slots:
-/*nothing here yet */
+
+ /** context popup menus */
+ void peerCustomPopupMenu( QPoint point );
+
+ /* peer ContextMenu Actions */
+ void showuserprofile();
+ void showoneblog();
+ void showallblogs();
private:
diff --git a/retroshare-gui/src/gui/BlogDialog.ui b/retroshare-gui/src/gui/BlogDialog.ui
index 76ce22e09..2b665dcbe 100644
--- a/retroshare-gui/src/gui/BlogDialog.ui
+++ b/retroshare-gui/src/gui/BlogDialog.ui
@@ -5,8 +5,8 @@
0
0
- 606
- 400
+ 640
+ 454
@@ -504,551 +504,487 @@
-
-
-
- 460
- 6
- 141
- 391
-
-
-
-
- 0
- 0
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 6
-
-
- 6
-
-
-
-
-
-
- 0
- 0
-
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Expanding
-
-
-
- 41
- 20
-
-
-
-
- -
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 6
-
-
- 6
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
-
- 10
- 75
- true
-
-
-
- Users:
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- :/images/peers_16x16.png
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 20
- 0
-
-
-
-
- 0
- 0
-
-
-
- Qt::CustomContextMenu
-
-
- true
-
-
-
- User
+
+
-
+
+
+ 2
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ 0
-
-
-
-
-
-
-
-
- 1
- 4
- 451
- 221
-
-
-
-
- 0
- 0
-
-
-
-
- 2
-
-
- 0
-
-
- 0
-
- -
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 6
-
-
- 6
-
-
-
-
-
- 0
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 6
+
+
+ 6
+
+
-
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 6
+
+
+ 6
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ :/images/chat.png
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+ 75
+ true
+
+
+
+ Blog Feed:
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Qt::Horizontal
+
+
+
+ 360
+ 16
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+ Qt::DefaultContextMenu
+
+
+ false
+
+
+ true
+
+
+
+
+
+ -
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 6
+
+
+ 6
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Expanding
+
+
+
+ 41
+ 20
+
+
+
+
+ -
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 6
+
+
+ 6
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+ 75
+ true
+
+
+
+ Users:
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ :/images/peers_16x16.png
+
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 20
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+ Qt::CustomContextMenu
+
+
+ true
+
+
+
+ User
-
- 0
-
-
- 0
-
-
- 0
-
-
- 6
-
-
- 6
-
-
-
-
-
-
- 0
- 0
-
-
-
-
-
-
- :/images/chat.png
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
-
- 10
- 75
- true
-
-
-
- Blog Feed:
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Qt::Horizontal
-
-
-
- 360
- 16
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
- Qt::DefaultContextMenu
-
-
- false
-
-
- true
-
-
-
-
-
-
-
-
- 358
- 233
- 24
- 24
-
-
-
-
- 24
- 24
-
-
-
-
- 24
- 24
-
-
-
-
- 0
- 0
-
-
-
- Bold
-
-
-
-
-
- :/images/edit-bold.png
-
-
- true
-
-
-
-
-
- 392
- 233
- 24
- 24
-
-
-
-
- 24
- 24
-
-
-
-
- 24
- 24
-
-
-
-
- 0
- 0
-
-
-
- Italic
-
-
-
-
-
- :/images/edit-underline.png
-
-
- true
-
-
-
-
-
- 426
- 233
- 24
- 24
-
-
-
-
- 24
- 24
-
-
-
-
- 24
- 24
-
-
-
-
- 0
- 0
-
-
-
- Underline
-
-
-
-
-
- :/images/edit-italic.png
-
-
- true
-
-
-
-
-
- 1
- 263
- 449
- 100
-
-
-
-
- 0
- 5
-
-
-
-
- 16777215
- 100
-
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
-
-
-
- 200
- 370
- 247
- 25
-
-
-
-
- 0
- 0
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Refresh Blog
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Set Status
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Send
-
-
-
-
-
+
+
+
+
+
+ -
+
+
+
+ 24
+ 24
+
+
+
+
+ 24
+ 24
+
+
+
+
+ 0
+ 0
+
+
+
+ Bold
+
+
+
+
+
+ :/images/edit-bold.png
+
+
+ true
+
+
+
+ -
+
+
+
+ 24
+ 24
+
+
+
+
+ 24
+ 24
+
+
+
+
+ 0
+ 0
+
+
+
+ Italic
+
+
+
+
+
+ :/images/edit-underline.png
+
+
+ true
+
+
+
+ -
+
+
+
+ 24
+ 24
+
+
+
+
+ 24
+ 24
+
+
+
+
+ 0
+ 0
+
+
+
+ Underline
+
+
+
+
+
+ :/images/edit-italic.png
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 5
+
+
+
+
+ 16777215
+ 100
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Refresh Blog
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Set Status
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Send
+
+
+
+
+
+
Send
diff --git a/retroshare-gui/src/gui/profile/ProfileEdit.cpp b/retroshare-gui/src/gui/profile/ProfileEdit.cpp
new file mode 100644
index 000000000..2eb8b8559
--- /dev/null
+++ b/retroshare-gui/src/gui/profile/ProfileEdit.cpp
@@ -0,0 +1,148 @@
+/****************************************************************
+ * RetroShare is distributed under the following license:
+ *
+ * Copyright (C) 2008 Robert Fernie
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+#include "gui/profile/ProfileEdit.h"
+
+#include "rsiface/rspeers.h"
+#include "rsiface/rsQblog.h"
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+/** Constructor */
+ProfileEdit::ProfileEdit(QWidget *parent)
+: QDialog(parent)
+{
+ /* Invoke the Qt Designer generated object setup routine */
+ ui.setupUi(this);
+
+ connect( ui.profileTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( profileCustomPopupMenu( QPoint ) ) );
+
+ // connect up the buttons.
+ connect(ui.addButton, SIGNAL(clicked()), this, SLOT(profileEntryAdd()));
+ connect(ui.moveDownButton, SIGNAL(clicked()), this, SLOT(profileEntryMoveDown()));
+ connect(ui.moveUpButton, SIGNAL(clicked()), this, SLOT(profileEntryMoveUp()));
+ connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(close()));
+
+ /* Hide platform specific features */
+#ifdef Q_WS_WIN
+
+#endif
+}
+
+void ProfileEdit::profileCustomPopupMenu( QPoint point )
+{
+
+ QMenu contextMnu( this );
+ QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
+
+ QAction *removeAct = new QAction( tr( "Remove Profile Entry" ), this );
+ QAction *moveupAct = new QAction( tr( "Move Profile Entry Up" ), this );
+ QAction *movedownAct = new QAction( tr( "Move Profile Entry Down" ), this );
+
+ connect( removeAct , SIGNAL( triggered() ), this, SLOT( profileEntryRemove() ) );
+ connect( moveupAct , SIGNAL( triggered() ), this, SLOT( profileEntryMoveUp() ) );
+ connect( movedownAct , SIGNAL( triggered() ), this, SLOT( profileEntryMoveDown() ) );
+
+ contextMnu.clear();
+ contextMnu.addAction( removeAct );
+ contextMnu.addAction( moveupAct );
+ contextMnu.addAction( movedownAct );
+ contextMnu.exec( mevent->globalPos() );
+}
+
+void ProfileEdit::clear()
+{
+ return;
+}
+
+void ProfileEdit::update()
+{
+ /* load it up! */
+ std::string pId = "OwnId";
+
+ if (!rsQblog)
+ {
+ clear();
+ return;
+ }
+
+ std::list< std::pair > profile;
+ std::list< std::pair >::iterator pit;
+
+ rsQblog -> getPeerProfile(pId, profile);
+
+ QList itemList;
+ for(pit = profile.begin(); pit != profile.end(); pit++)
+ {
+ QTreeWidgetItem *item = new QTreeWidgetItem();
+ item->setText(0, QString::fromStdWString(pit->first));
+ item->setText(1, QString::fromStdWString(pit->second));
+
+ itemList.push_back(item);
+ }
+
+ ui.profileTreeWidget->clear();
+ ui.profileTreeWidget->insertTopLevelItems(0, itemList);
+
+ return;
+}
+
+/* For context Menus */
+/* for Profile */
+void ProfileEdit::profileEntryAdd()
+{
+ return;
+}
+
+void ProfileEdit::profileEntryRemove()
+{
+ return;
+}
+
+void ProfileEdit::profileEntryMoveUp()
+{
+ return;
+}
+
+void ProfileEdit::profileEntryMoveDown()
+{
+ return;
+}
+
+
+void ProfileEdit::profileEntryCustomChanged() /* check box */
+{
+ return;
+}
+
+
diff --git a/retroshare-gui/src/gui/profile/ProfileEdit.h b/retroshare-gui/src/gui/profile/ProfileEdit.h
new file mode 100644
index 000000000..49b2abede
--- /dev/null
+++ b/retroshare-gui/src/gui/profile/ProfileEdit.h
@@ -0,0 +1,67 @@
+/****************************************************************
+ * RetroShare is distributed under the following license:
+ *
+ * Copyright (C) 2008, Robert Fernie
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+
+#ifndef _PROFILE_EDIT_H
+#define _PROFILE_EDIT_H
+
+#include "ui_ProfileEdit.h"
+
+#include
+#include
+
+class ProfileEdit : public QDialog
+{
+ Q_OBJECT
+
+public:
+ /** Default Constructor */
+
+ ProfileEdit(QWidget *parent = 0);
+ /** Default Destructor */
+
+void clear();
+void update();
+
+public slots:
+
+private slots:
+
+ /** context popup menus */
+ void profileCustomPopupMenu( QPoint point );
+
+ /* for Profile */
+ void profileEntryAdd();
+ void profileEntryRemove();
+ void profileEntryMoveUp();
+ void profileEntryMoveDown();
+
+ void profileEntryCustomChanged(); /* check box */
+
+private:
+
+ /** Qt Designer generated object */
+ Ui::ProfileEdit ui;
+
+};
+
+#endif
+
diff --git a/retroshare-gui/src/gui/profile/ProfileEdit.ui b/retroshare-gui/src/gui/profile/ProfileEdit.ui
new file mode 100644
index 000000000..001f36787
--- /dev/null
+++ b/retroshare-gui/src/gui/profile/ProfileEdit.ui
@@ -0,0 +1,217 @@
+
+ ProfileEdit
+
+
+
+ 0
+ 0
+ 540
+ 469
+
+
+
+ Form
+
+
+ Qt::LeftToRight
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+
-
+
+
+
+ 75
+ true
+
+
+
+ Profile
+
+
+
+ -
+
+
+ Qt::CustomContextMenu
+
+
+ false
+
+
+
+ Category
+
+
+
+
+ Thoughts
+
+
+
+
+
+
+
+
+ -
+
+
+
+ 75
+ true
+
+
+
+ Edit Profile Category
+
+
+
+ -
+
+
-
+
+ Birthday
+
+
+ -
+
+ School
+
+
+ -
+
+ University
+
+
+ -
+
+ Phone Number
+
+
+ -
+
+ Favourite Books
+
+
+ -
+
+ Favourite Music
+
+
+ -
+
+ Favourite Films
+
+
+
+
+ -
+
+
+ Qt::RightToLeft
+
+
+ or Custom Entry
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+ -
+
+
-
+
+
+ Add Entry
+
+
+ :/images/add_24x24.png
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 71
+ 28
+
+
+
+
+ -
+
+
+ Qt::RightToLeft
+
+
+ Move
+
+
+ :/images/down.png
+
+
+
+ -
+
+
+ Move
+
+
+ :/images/up.png
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 71
+ 28
+
+
+
+
+ -
+
+
+ Qt::RightToLeft
+
+
+ Close Editor
+
+
+ :/images/close_normal.png
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/retroshare-gui/src/gui/profile/ProfileView.cpp b/retroshare-gui/src/gui/profile/ProfileView.cpp
new file mode 100644
index 000000000..9345e9d39
--- /dev/null
+++ b/retroshare-gui/src/gui/profile/ProfileView.cpp
@@ -0,0 +1,289 @@
+/****************************************************************
+ * RetroShare is distributed under the following license:
+ *
+ * Copyright (C) 2008 Robert Fernie
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+#include "gui/profile/ProfileView.h"
+#include "gui/profile/ProfileEdit.h"
+
+#include "rsiface/rspeers.h"
+#include "rsiface/rsQblog.h"
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+/** Constructor */
+ProfileView::ProfileView(QWidget *parent)
+: QDialog(parent)
+{
+ /* Invoke the Qt Designer generated object setup routine */
+ ui.setupUi(this);
+
+ connect( ui.photoLabel, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( imageCustomPopupMenu( QPoint ) ) );
+ connect( ui.profileTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( profileCustomPopupMenu( QPoint ) ) );
+ connect( ui.fileTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( fileCustomPopupMenu( QPoint ) ) );
+ //
+
+ // connect up the buttons.
+ connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(closeView()));
+
+ /* Hide platform specific features */
+#ifdef Q_WS_WIN
+
+#endif
+}
+
+/** context popup menus */
+void ProfileView::imageCustomPopupMenu( QPoint point )
+{
+ if (!mIsOwnId)
+ {
+ return;
+ }
+
+ QMenu contextMnu( this );
+ QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
+
+ QAction *clearImageAct = new QAction( tr( "Clear Photo" ), this );
+ QAction *changeImageAct = new QAction( tr( "Change Photo" ), this );
+
+ connect( clearImageAct , SIGNAL( triggered() ), this, SLOT( clearimage() ) );
+ connect( changeImageAct , SIGNAL( triggered() ), this, SLOT( selectimagefile() ) );
+
+ contextMnu.clear();
+ contextMnu.addAction( clearImageAct );
+ contextMnu.addAction( changeImageAct );
+ contextMnu.exec( mevent->globalPos() );
+}
+
+
+void ProfileView::profileCustomPopupMenu( QPoint point )
+{
+ if (!mIsOwnId)
+ {
+ return;
+ }
+
+ QMenu contextMnu( this );
+ QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
+
+ QAction *editAct = new QAction( tr( "Edit Profile" ), this );
+
+ connect( editAct , SIGNAL( triggered() ), this, SLOT( profileEdit() ) );
+
+ contextMnu.clear();
+ contextMnu.addAction( editAct );
+ contextMnu.exec( mevent->globalPos() );
+}
+
+void ProfileView::fileCustomPopupMenu( QPoint point )
+{
+
+ QMenu contextMnu( this );
+ QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
+
+ QAction *downloadAct = NULL;
+ QAction *downloadAllAct = NULL;
+ QAction *removeAct = NULL;
+ QAction *clearAct = NULL;
+
+ contextMnu.clear();
+
+ if (mIsOwnId)
+ {
+ removeAct = new QAction( tr( "Remove Favourite" ), this );
+ clearAct = new QAction( tr( "Clear Favourites" ), this );
+ connect( removeAct , SIGNAL( triggered() ), this, SLOT( fileRemove() ) );
+ connect( clearAct , SIGNAL( triggered() ), this, SLOT( filesClear() ) );
+
+ contextMnu.addAction( clearAct );
+ contextMnu.addAction( removeAct );
+ }
+ else
+ {
+ downloadAct = new QAction( tr( "Download File" ), this );
+ downloadAllAct = new QAction( tr( "Download All" ), this );
+ connect( downloadAct , SIGNAL( triggered() ), this, SLOT( fileDownload() ) );
+ connect( downloadAllAct , SIGNAL( triggered() ), this, SLOT( filesDownloadAll() ) );
+
+ contextMnu.addAction( downloadAct );
+ contextMnu.addAction( downloadAllAct );
+ }
+
+ contextMnu.exec( mevent->globalPos() );
+}
+
+
+void ProfileView::setPeerId(std::string id)
+{
+ pId = id;
+ update();
+}
+
+
+void ProfileView::expand()
+{
+ return;
+}
+
+
+void ProfileView::closeView()
+{
+ close();
+ return;
+}
+
+
+void ProfileView::clear()
+{
+ return;
+}
+
+void ProfileView::update()
+{
+ /* load it up! */
+
+ /* if id bad -> clear */
+
+ //if (ownId)
+ //{
+ // isOwnId = true;
+ //}
+
+ mIsOwnId = true; /* switche on context menues */
+
+ if (!rsQblog)
+ {
+ clear();
+ return;
+ }
+
+ uint32_t PostTs;
+ std::wstring BlogPost;
+ std::list< std::pair > profile;
+ std::list< std::pair >::iterator pit;
+ std::list files;
+ std::list::iterator fit;
+
+ rsQblog -> getPeerLatestBlog(pId, PostTs, BlogPost);
+ rsQblog -> getPeerProfile(pId, profile);
+ rsQblog -> getPeerFavourites(pId, files);
+
+ ui.idLineEdit->setText(QString::fromStdString(pId));
+ ui.nameLineEdit->setText(QString::fromStdString("username"));
+ {
+ std::ostringstream out;
+ out << PostTs;
+ ui.timeLineEdit->setText(QString::fromStdString(out.str()));
+ }
+ ui.postTextEdit->setHtml(QString::fromStdWString(BlogPost));
+
+ QList itemList;
+ for(pit = profile.begin(); pit != profile.end(); pit++)
+ {
+ QTreeWidgetItem *item = new QTreeWidgetItem();
+ item->setText(0, QString::fromStdWString(pit->first));
+ item->setText(1, QString::fromStdWString(pit->second));
+
+ itemList.push_back(item);
+ }
+
+ ui.profileTreeWidget->clear();
+ ui.profileTreeWidget->insertTopLevelItems(0, itemList);
+
+ QList fileList;
+ for(fit = files.begin(); fit != files.end(); fit++)
+ {
+ QTreeWidgetItem *item = new QTreeWidgetItem();
+ item->setText(0, QString::fromStdString(fit->fname));
+ {
+ std::ostringstream out;
+ out << fit-> size;
+ item->setText(1, QString::fromStdString(out.str()));
+ }
+ item->setText(2, QString::fromStdString(fit->hash));
+
+ fileList.push_back(item);
+ }
+
+ ui.fileTreeWidget->clear();
+ ui.fileTreeWidget->insertTopLevelItems(0, fileList);
+
+ return;
+}
+
+/* For context Menus */
+/* Image Context Menu */
+void ProfileView::selectimagefile()
+{
+ return;
+}
+
+void ProfileView::clearimage()
+{
+ return;
+}
+
+
+/* for Profile */
+void ProfileView::profileEdit()
+{
+static ProfileEdit *edit = new ProfileEdit(NULL);
+ edit->update();
+ edit->show();
+
+ return;
+}
+
+/* for Favourite Files */
+void ProfileView::fileDownload()
+{
+ return;
+}
+
+void ProfileView::filesDownloadAll()
+{
+ return;
+}
+
+
+void ProfileView::fileRemove()
+{
+ return;
+}
+
+void ProfileView::filesClear()
+{
+ return;
+}
+
+/* add must be done from Shared Files */
+
+
diff --git a/retroshare-gui/src/gui/profile/ProfileView.h b/retroshare-gui/src/gui/profile/ProfileView.h
new file mode 100644
index 000000000..f82e5ae76
--- /dev/null
+++ b/retroshare-gui/src/gui/profile/ProfileView.h
@@ -0,0 +1,86 @@
+/****************************************************************
+ * RetroShare is distributed under the following license:
+ *
+ * Copyright (C) 2007, RetroShare Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ ****************************************************************/
+
+
+#ifndef _PROFILE_VIEW_H
+#define _PROFILE_VIEW_H
+
+#include "ui_ProfileView.h"
+
+#include
+#include
+
+class ProfileView : public QDialog
+{
+ Q_OBJECT
+
+public:
+ /** Default Constructor */
+
+ ProfileView(QWidget *parent = 0);
+ /** Default Destructor */
+
+void setPeerId(std::string id);
+
+void clear();
+void update();
+
+public slots:
+
+private slots:
+
+ /** context popup menus */
+ void imageCustomPopupMenu( QPoint point );
+ void profileCustomPopupMenu( QPoint point );
+ void fileCustomPopupMenu( QPoint point );
+
+ /* For context Menus */
+ /* Image Context Menu */
+ void selectimagefile();
+ void clearimage();
+
+ /* for Profile */
+ void profileEdit();
+
+ /* for Favourite Files */
+ void fileRemove();
+ void filesClear();
+ void fileDownload();
+ void filesDownloadAll();
+ /* add must be done from Shared Files */
+
+
+ /* expand / close */
+ void expand();
+ void closeView();
+
+private:
+ std::string pId;
+ bool mIsOwnId;
+
+
+ /** Qt Designer generated object */
+ Ui::ProfileView ui;
+
+};
+
+#endif
+
diff --git a/retroshare-gui/src/gui/profile/ProfileView.ui b/retroshare-gui/src/gui/profile/ProfileView.ui
new file mode 100644
index 000000000..3be45b51d
--- /dev/null
+++ b/retroshare-gui/src/gui/profile/ProfileView.ui
@@ -0,0 +1,248 @@
+
+ ProfileView
+
+
+
+ 0
+ 0
+ 590
+ 574
+
+
+
+ Form
+
+
+ Qt::LeftToRight
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+
-
+
+
-
+
+
+ Rs ID
+
+
+
+ -
+
+
+ true
+
+
+
+
+
+ -
+
+
-
+
+
+ Name
+
+
+
+ -
+
+
+ true
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 128
+ 128
+
+
+
+
+ 128
+ 128
+
+
+
+ Qt::CustomContextMenu
+
+
+
+
+
+ :/images/ddeny.png
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+ Last Post:
+
+
+
+ -
+
+
+ true
+
+
+
+
+
+ -
+
+
+
+ 16777215
+ 128
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+ 75
+ true
+
+
+
+ Profile
+
+
+
+ -
+
+
+ Qt::CustomContextMenu
+
+
+ false
+
+
+
+ Category
+
+
+
+
+ Thoughts
+
+
+
+
+
+
+
+
+ -
+
+
+
+ 75
+ true
+
+
+
+ Favourite Files
+
+
+
+ -
+
+
+ Qt::CustomContextMenu
+
+
+
+ Name
+
+
+
+
+ Size
+
+
+
+
+ Hash
+
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 241
+ 28
+
+
+
+
+ -
+
+
+ Qt::RightToLeft
+
+
+ Close Profile
+
+
+ :/images/close_normal.png
+
+
+
+
+
+
+
+
+
+