* Added two new Services to RS GUI.

- The Wire, this is not at all functional yet - just a gui shell.
	- Identity, Basics of the GUI complete. talks via rsIdentity to the backend.
 * Fixed the Photo Drag and Drop under Linux.
 * Resurrected the Application Window - for Unfinished Service.
 * Moved Photos, Wire, Identity & Wiki to the Unfinished Window.
 * Added "Experimental Services" option in Settings -> though this is not yet saved / used.
 * changed #ifdef UNFINISHED -> #ifdef UNFINISHED_FD for bits in FriendList, which didn't compile.
 * removed old Unfinished Applications from Window.




git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-new_cache_system@4933 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2012-02-13 18:43:15 +00:00
parent 459b51e814
commit 1eb82bd676
22 changed files with 3653 additions and 46 deletions

View File

@ -1,5 +1,8 @@
CONFIG += qt gui uic qrc resources uitools idle bitdht CONFIG += qt gui uic qrc resources uitools idle bitdht
CONFIG += photoshare wikipoos CONFIG += photoshare wikipoos
CONFIG += thewire
CONFIG += identities
CONFIG += unfinished
QT += network xml script QT += network xml script
@ -731,31 +734,34 @@ HEADERS += gui/unfinished/ApplicationWindow.h \
gui/unfinished/CalDialog.h \ gui/unfinished/CalDialog.h \
gui/unfinished/ExampleDialog.h \ gui/unfinished/ExampleDialog.h \
gui/unfinished/GamesDialog.h \ gui/unfinished/GamesDialog.h \
gui/unfinished/PhotoDialog.h \
gui/unfinished/PhotoShow.h \ # gui/unfinished/profile/ProfileView.h \
gui/unfinished/StatisticDialog.h \ # gui/unfinished/profile/ProfileEdit.h
gui/unfinished/profile/ProfileView.h \ # gui/unfinished/StatisticDialog.h \
gui/unfinished/profile/ProfileEdit.h # gui/unfinished/PhotoDialog.h \
# gui/unfinished/PhotoShow.h \
FORMS += gui/unfinished/ApplicationWindow.ui \ FORMS += gui/unfinished/ApplicationWindow.ui \
gui/unfinished/CalDialog.ui \ gui/unfinished/CalDialog.ui \
gui/unfinished/ExampleDialog.ui \ gui/unfinished/ExampleDialog.ui \
gui/unfinished/GamesDialog.ui \ gui/unfinished/GamesDialog.ui \
gui/unfinished/PhotoDialog.ui \
gui/unfinished/PhotoShow.ui \ # gui/unfinished/profile/ProfileView.ui \
gui/unfinished/StatisticDialog.ui \ # gui/unfinished/profile/ProfileEdit.ui
gui/unfinished/profile/ProfileView.ui \ # gui/unfinished/StatisticDialog.ui \
gui/unfinished/profile/ProfileEdit.ui # gui/unfinished/PhotoDialog.ui \
# gui/unfinished/PhotoShow.ui \
SOURCES += gui/unfinished/ApplicationWindow.cpp \ SOURCES += gui/unfinished/ApplicationWindow.cpp \
gui/unfinished/CalDialog.cpp \ gui/unfinished/CalDialog.cpp \
gui/unfinished/ExampleDialog.cpp \ gui/unfinished/ExampleDialog.cpp \
gui/unfinished/GamesDialog.cpp \ gui/unfinished/GamesDialog.cpp \
gui/unfinished/PhotoDialog.cpp \
gui/unfinished/PhotoShow.cpp \ # gui/unfinished/profile/ProfileView.cpp \
gui/unfinished/StatisticDialog.cpp \ # gui/unfinished/profile/ProfileEdit.cpp
gui/unfinished/profile/ProfileView.cpp \ # gui/unfinished/StatisticDialog.cpp \
gui/unfinished/profile/ProfileEdit.cpp # gui/unfinished/PhotoDialog.cpp \
# gui/unfinished/PhotoShow.cpp \
DEFINES *= UNFINISHED DEFINES *= UNFINISHED
} }
@ -887,3 +893,33 @@ wikipoos {
} }
thewire {
HEADERS += gui/TheWire/PulseItem.h \
gui/TheWire/WireDialog.h \
gui/TheWire/PulseAddDialog.h \
FORMS += gui/TheWire/PulseItem.ui \
gui/TheWire/WireDialog.ui \
gui/TheWire/PulseAddDialog.ui \
SOURCES += gui/TheWire/PulseItem.cpp \
gui/TheWire/WireDialog.cpp \
gui/TheWire/PulseAddDialog.cpp \
}
identities {
HEADERS += gui/Identity/IdDialog.h \
gui/Identity/IdEditDialog.h \
FORMS += gui/Identity/IdDialog.ui \
gui/Identity/IdEditDialog.ui \
SOURCES += gui/Identity/IdDialog.cpp \
gui/Identity/IdEditDialog.cpp \
}

View File

@ -0,0 +1,631 @@
/*
* 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".
*
*/
#include "IdDialog.h"
#include <retroshare/rspeers.h>
#include <retroshare/rsidentity.h>
#include <iostream>
#include <sstream>
#include <QTimer>
/******
* #define ID_DEBUG 1
*****/
/****************************************************************
*/
#define RSID_COL_NICKNAME 0
#define RSID_COL_KEYID 1
#define RSID_COL_IDTYPE 2
/** Constructor */
IdDialog::IdDialog(QWidget *parent)
: MainPage(parent)
{
ui.setupUi(this);
mEditDialog = NULL;
//mPulseSelected = NULL;
ui.radioButton_ListAll->setChecked(true);
connect( ui.pushButton_NewId, SIGNAL(clicked()), this, SLOT(OpenOrShowAddDialog()));
connect( ui.pushButton_EditId, SIGNAL(clicked()), this, SLOT(OpenOrShowEditDialog()));
connect( ui.treeWidget_IdList, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelection()));
connect( ui.radioButton_ListYourself, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );
connect( ui.radioButton_ListFriends, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );
connect( ui.radioButton_ListOthers, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );
connect( ui.radioButton_ListPseudo, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );
connect( ui.radioButton_ListAll, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );
QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
timer->start(1000);
rsIdentity->generateDummyData();
}
void IdDialog::ListTypeToggled(bool checked)
{
if (checked)
{
insertIdList();
}
}
void IdDialog::updateSelection()
{
/* */
QTreeWidgetItem *item = ui.treeWidget_IdList->currentItem();
if (!item)
{
/* blank it all - and fix buttons */
ui.lineEdit_Nickname->setText("");
ui.lineEdit_KeyId->setText("");
ui.lineEdit_GpgHash->setText("");
ui.lineEdit_GpgId->setText("");
ui.lineEdit_GpgName->setText("");
ui.lineEdit_GpgEmail->setText("");
ui.pushButton_Reputation->setEnabled(false);
ui.pushButton_Delete->setEnabled(false);
ui.pushButton_EditId->setEnabled(false);
ui.pushButton_NewId->setEnabled(true);
}
else
{
/* get details from libretroshare */
RsIdData data;
if (!rsIdentity->getIdentity(item->text(RSID_COL_KEYID).toStdString(), data))
{
ui.lineEdit_KeyId->setText("ERROR GETTING KEY!");
return;
}
/* get GPG Details from rsPeers */
std::string gpgid = rsPeers->getGPGOwnId();
RsPeerDetails details;
rsPeers->getPeerDetails(gpgid, details);
ui.lineEdit_Nickname->setText(QString::fromStdString(data.mNickname));
ui.lineEdit_KeyId->setText(QString::fromStdString(data.mKeyId));
ui.lineEdit_GpgHash->setText(QString::fromStdString(data.mGpgIdHash));
ui.lineEdit_GpgId->setText(QString::fromStdString(data.mGpgId));
ui.lineEdit_GpgName->setText(QString::fromStdString(data.mGpgName));
ui.lineEdit_GpgEmail->setText(QString::fromStdString(data.mGpgEmail));
if (data.mIdType & RSID_RELATION_YOURSELF)
{
ui.radioButton_IdYourself->setChecked(true);
}
else if (data.mIdType & RSID_TYPE_PSEUDONYM)
{
ui.radioButton_IdPseudo->setChecked(true);
}
else if (data.mIdType & RSID_RELATION_FRIEND)
{
ui.radioButton_IdFriend->setChecked(true);
}
else if (data.mIdType & RSID_RELATION_FOF)
{
ui.radioButton_IdFOF->setChecked(true);
}
else
{
ui.radioButton_IdOther->setChecked(true);
}
ui.pushButton_NewId->setEnabled(true);
if (data.mIdType & RSID_RELATION_YOURSELF)
{
ui.pushButton_Reputation->setEnabled(false);
ui.pushButton_Delete->setEnabled(true);
ui.pushButton_EditId->setEnabled(true);
}
else
{
ui.pushButton_Reputation->setEnabled(true);
ui.pushButton_Delete->setEnabled(false);
ui.pushButton_EditId->setEnabled(false);
}
}
}
#if 0
void IdDialog::notifySelection(PulseItem *item, int ptype)
{
std::cerr << "IdDialog::notifySelection() from : " << ptype << " " << item;
std::cerr << std::endl;
notifyPulseSelection(item);
switch(ptype)
{
default:
case PHOTO_ITEM_TYPE_ALBUM:
notifyAlbumSelection(item);
break;
case PHOTO_ITEM_TYPE_PHOTO:
notifyPhotoSelection(item);
break;
}
}
void IdDialog::notifyPulseSelection(PulseItem *item)
{
std::cerr << "IdDialog::notifyPulseSelection() from : " << item;
std::cerr << std::endl;
if (mPulseSelected)
{
std::cerr << "IdDialog::notifyPulseSelection() unselecting old one : " << mPulseSelected;
std::cerr << std::endl;
mPulseSelected->setSelected(false);
}
mPulseSelected = item;
}
#endif
void IdDialog::checkUpdate()
{
/* update */
if (!rsIdentity)
return;
if (rsIdentity->updated())
{
insertIdList();
}
return;
}
/*************** New Photo Dialog ***************/
void IdDialog::OpenOrShowAddDialog()
{
if (!mEditDialog)
{
mEditDialog = new IdEditDialog(NULL);
}
bool pseudo = false;
mEditDialog->setupNewId(pseudo);
mEditDialog->show();
}
void IdDialog::OpenOrShowEditDialog()
{
if (!mEditDialog)
{
mEditDialog = new IdEditDialog(NULL);
}
/* */
QTreeWidgetItem *item = ui.treeWidget_IdList->currentItem();
if (!item)
{
std::cerr << "IdDialog::OpenOrShowEditDialog() Invalid item";
std::cerr << std::endl;
return;
}
std::string keyId = item->text(RSID_COL_KEYID).toStdString();
mEditDialog->setupExistingId(keyId);
mEditDialog->show();
}
bool IdDialog::matchesAlbumFilter(const RsPhotoAlbum &album)
{
return true;
}
double IdDialog::AlbumScore(const RsPhotoAlbum &album)
{
return 1;
}
bool IdDialog::matchesPhotoFilter(const RsPhotoPhoto &photo)
{
return true;
}
double IdDialog::PhotoScore(const RsPhotoPhoto &photo)
{
return 1;
}
bool IdDialog::FilterNSortAlbums(const std::list<std::string> &albumIds, std::list<std::string> &filteredAlbumIds, int count)
{
#if 0
std::multimap<double, std::string> sortedAlbums;
std::multimap<double, std::string>::iterator sit;
std::list<std::string>::const_iterator it;
for(it = albumIds.begin(); it != albumIds.end(); it++)
{
RsPhotoAlbum album;
rsPhoto->getAlbum(*it, album);
if (matchesAlbumFilter(album))
{
double score = AlbumScore(album);
sortedAlbums.insert(std::make_pair(score, *it));
}
}
int i;
for (sit = sortedAlbums.begin(), i = 0; (sit != sortedAlbums.end()) && (i < count); sit++, i++)
{
filteredAlbumIds.push_back(sit->second);
}
#endif
return true;
}
bool IdDialog::FilterNSortPhotos(const std::list<std::string> &photoIds, std::list<std::string> &filteredPhotoIds, int count)
{
#if 0
std::multimap<double, std::string> sortedPhotos;
std::multimap<double, std::string>::iterator sit;
std::list<std::string>::const_iterator it;
int i = 0;
for(it = photoIds.begin(); it != photoIds.end(); it++, i++)
{
RsPhotoPhoto photo;
rsPhoto->getPhoto(*it, photo);
if (matchesPhotoFilter(photo))
{
double score = i; //PhotoScore(album);
sortedPhotos.insert(std::make_pair(score, *it));
}
}
for (sit = sortedPhotos.begin(), i = 0; (sit != sortedPhotos.end()) && (i < count); sit++, i++)
{
filteredPhotoIds.push_back(sit->second);
}
#endif
return true;
}
void IdDialog::insertIdList()
{
QTreeWidget *tree = ui.treeWidget_IdList;
tree->clear();
std::list<std::string> ids;
std::list<std::string>::iterator it;
bool acceptAll = ui.radioButton_ListAll->isChecked();
bool acceptPseudo = ui.radioButton_ListPseudo->isChecked();
bool acceptYourself = ui.radioButton_ListYourself->isChecked();
bool acceptFriends = ui.radioButton_ListFriends->isChecked();
bool acceptOthers = ui.radioButton_ListOthers->isChecked();
rsIdentity->getIdentityList(ids);
for(it = ids.begin(); it != ids.end(); it++)
{
RsIdData data;
if (!rsIdentity->getIdentity(*it, data))
{
continue;
}
/* do filtering */
bool ok = false;
if (acceptAll)
{
ok = true;
}
else if (data.mIdType & RSID_TYPE_PSEUDONYM)
{
if (acceptPseudo)
{
ok = true;
}
if ((data.mIdType & RSID_RELATION_YOURSELF) && (acceptYourself))
{
ok = true;
}
}
else
{
if (data.mIdType & RSID_RELATION_YOURSELF)
{
if (acceptYourself)
{
ok = true;
}
}
else if (data.mIdType & (RSID_RELATION_FRIEND | RSID_RELATION_FOF))
{
if (acceptFriends)
{
ok = true;
}
}
else
{
if (acceptOthers)
{
ok = true;
}
}
}
if (!ok)
{
continue;
}
QTreeWidgetItem *item = new QTreeWidgetItem(NULL);
item->setText(RSID_COL_NICKNAME, QString::fromStdString(data.mNickname));
item->setText(RSID_COL_KEYID, QString::fromStdString(data.mKeyId));
item->setText(RSID_COL_IDTYPE, QString::fromStdString(rsIdTypeToString(data.mIdType)));
tree->addTopLevelItem(item);
}
// fix up buttons.
updateSelection();
}
void IdDialog::insertPhotosForSelectedAlbum()
{
#if 0
std::cerr << "IdDialog::insertPhotosForSelectedAlbum()";
std::cerr << std::endl;
clearPhotos();
std::list<std::string> albumIds;
if (mAlbumSelected)
{
albumIds.push_back(mAlbumSelected->mDetails.mAlbumId);
std::cerr << "IdDialog::insertPhotosForSelectedAlbum() AlbumId: " << mAlbumSelected->mDetails.mAlbumId;
std::cerr << std::endl;
}
insertPhotosForAlbum(albumIds);
#endif
}
void IdDialog::addAlbum(const std::string &id)
{
#if 0
RsPhotoAlbum album;
rsPhoto->getAlbum(id, album);
RsPhotoThumbnail thumbnail;
rsPhoto->getAlbumThumbnail(id, thumbnail);
std::cerr << " IdDialog::addAlbum() AlbumId: " << album.mAlbumId << std::endl;
PulseItem *item = new PulseItem(this, album, thumbnail);
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
alayout->addWidget(item);
#endif
}
void IdDialog::clearAlbums()
{
#if 0
std::cerr << "IdDialog::clearAlbums()" << std::endl;
std::list<PulseItem *> photoItems;
std::list<PulseItem *>::iterator pit;
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
int count = alayout->count();
for(int i = 0; i < count; i++)
{
QLayoutItem *litem = alayout->itemAt(i);
if (!litem)
{
std::cerr << "IdDialog::clearAlbums() missing litem";
std::cerr << std::endl;
continue;
}
PulseItem *item = dynamic_cast<PulseItem *>(litem->widget());
if (item)
{
std::cerr << "IdDialog::clearAlbums() item: " << item;
std::cerr << std::endl;
photoItems.push_back(item);
}
else
{
std::cerr << "IdDialog::clearAlbums() Found Child, which is not a PulseItem???";
std::cerr << std::endl;
}
}
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
{
PulseItem *item = *pit;
alayout->removeWidget(item);
delete item;
}
mAlbumSelected = NULL;
#endif
}
void IdDialog::clearPhotos()
{
#if 0
std::cerr << "IdDialog::clearPhotos()" << std::endl;
std::list<PulseItem *> photoItems;
std::list<PulseItem *>::iterator pit;
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
int count = alayout->count();
for(int i = 0; i < count; i++)
{
QLayoutItem *litem = alayout->itemAt(i);
if (!litem)
{
std::cerr << "IdDialog::clearPhotos() missing litem";
std::cerr << std::endl;
continue;
}
PulseItem *item = dynamic_cast<PulseItem *>(litem->widget());
if (item)
{
std::cerr << "IdDialog::clearPhotos() item: " << item;
std::cerr << std::endl;
photoItems.push_back(item);
}
else
{
std::cerr << "IdDialog::clearPhotos() Found Child, which is not a PulseItem???";
std::cerr << std::endl;
}
}
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
{
PulseItem *item = *pit;
alayout->removeWidget(item);
delete item;
}
mPhotoSelected = NULL;
#endif
}
void IdDialog::insertPhotosForAlbum(const std::list<std::string> &albumIds)
{
#if 0
/* clear it all */
clearPhotos();
//ui.photoLayout->clear();
/* create a list of albums */
std::list<std::string> ids;
std::list<std::string> photoIds;
std::list<std::string> filteredPhotoIds;
std::list<std::string>::const_iterator it;
for(it = albumIds.begin(); it != albumIds.end(); it++)
{
rsPhoto->getPhotoList(*it, photoIds);
}
/* Filter Albums */ /* Sort Albums */
#define MAX_PHOTOS 50
int count = MAX_PHOTOS;
FilterNSortPhotos(photoIds, filteredPhotoIds, MAX_PHOTOS);
for(it = filteredPhotoIds.begin(); it != filteredPhotoIds.end(); it++)
{
addPhoto(*it);
}
#endif
}
void IdDialog::addPhoto(const std::string &id)
{
#if 0
RsPhotoPhoto photo;
rsPhoto->getPhoto(id,photo);
RsPhotoThumbnail thumbnail;
rsPhoto->getPhotoThumbnail(id, thumbnail);
std::cerr << "IdDialog::addPhoto() AlbumId: " << photo.mAlbumId;
std::cerr << " PhotoId: " << photo.mId;
std::cerr << std::endl;
PulseItem *item = new PulseItem(this, photo, thumbnail);
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
alayout->addWidget(item);
#endif
}
#if 0
void IdDialog::deletePulseItem(PulseItem *item, uint32_t type)
{
return;
}
#endif

View File

@ -0,0 +1,91 @@
/*
* 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".
*
*/
#ifndef MRK_IDENTITY_DIALOG_H
#define MRK_IDENTITY_DIALOG_H
#include "gui/mainpage.h"
#include "ui_IdDialog.h"
#include <retroshare/rsphoto.h>
#include <map>
#include "gui/Identity/IdEditDialog.h"
//#include "gui/TheWire/PulseAddDialog.h"
class IdDialog : public MainPage
{
Q_OBJECT
public:
IdDialog(QWidget *parent = 0);
private slots:
void ListTypeToggled(bool checked);
void checkUpdate();
void OpenOrShowAddDialog();
void OpenOrShowEditDialog();
void updateSelection();
private:
void insertIdList();
/* TODO: These functions must be filled in for proper filtering to work
* and tied to the GUI input
*/
bool matchesAlbumFilter(const RsPhotoAlbum &album);
double AlbumScore(const RsPhotoAlbum &album);
bool matchesPhotoFilter(const RsPhotoPhoto &photo);
double PhotoScore(const RsPhotoPhoto &photo);
/* Grunt work of setting up the GUI */
bool FilterNSortAlbums(const std::list<std::string> &albumIds, std::list<std::string> &filteredAlbumIds, int count);
bool FilterNSortPhotos(const std::list<std::string> &photoIds, std::list<std::string> &filteredPhotoIds, int count);
void insertAlbums();
void insertPhotosForAlbum(const std::list<std::string> &albumIds);
void insertPhotosForSelectedAlbum();
void addAlbum(const std::string &id);
void addPhoto(const std::string &id);
void clearAlbums();
void clearPhotos();
IdEditDialog *mEditDialog;
//PulseItem *mPulseSelected;
/* UI - from Designer */
Ui::IdDialog ui;
};
#endif

View File

@ -0,0 +1,365 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>IdDialog</class>
<widget class="QWidget" name="IdDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>744</width>
<height>647</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" rowspan="3">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Showing:</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QRadioButton" name="radioButton_ListYourself">
<property name="text">
<string>Yourself</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_ListFriends">
<property name="text">
<string>Friends / Friends of Friends</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_ListOthers">
<property name="text">
<string>Others</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_ListPseudo">
<property name="text">
<string>Pseudonyms</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_ListAll">
<property name="text">
<string>All</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout"/>
</item>
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="text">
<string>filter</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTreeWidget" name="treeWidget_IdList">
<column>
<property name="text">
<string>Nickname</string>
</property>
</column>
<column>
<property name="text">
<string>KeyId</string>
</property>
</column>
<column>
<property name="text">
<string>Type</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="pushButton_Delete">
<property name="text">
<string>Delete ID</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_Reputation">
<property name="text">
<string>Edit Reputation</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_EditId">
<property name="text">
<string>Edit ID</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_NewId">
<property name="text">
<string>New ID</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Identity Type</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Nickname</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Nickname">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2" rowspan="6">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QRadioButton" name="radioButton_IdYourself">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Yourself</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_IdFriend">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Friend</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_IdFOF">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Friend of Friend</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_IdOther">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Other</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_IdPseudo">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Pseudonym</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Key ID</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_KeyId">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>GPG Name</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_GpgName">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>GPG Email</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEdit_GpgEmail">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_GpgHash">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_GpgId">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>GPG Id</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>GPG Hash</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Reputation</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Your Rating</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBox"/>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Overall Rating</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="lineEdit_3"/>
</item>
<item row="1" column="0" colspan="4">
<widget class="QListWidget" name="listWidget"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../LinksCloud/images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,227 @@
/*
* 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".
*
*/
#include "gui/Identity/IdEditDialog.h"
#include <retroshare/rsidentity.h>
#include <retroshare/rspeers.h>
#include <iostream>
/** Constructor */
IdEditDialog::IdEditDialog(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
connect(ui.radioButton_GpgId, SIGNAL( toggled( bool ) ), this, SLOT( IdTypeToggled( bool ) ) );
connect(ui.radioButton_Pseudo, SIGNAL( toggled( bool ) ), this, SLOT( IdTypeToggled( bool ) ) );
connect(ui.pushButton_Update, SIGNAL( clicked( void ) ), this, SLOT( updateId( void ) ) );
connect(ui.pushButton_Cancel, SIGNAL( clicked( void ) ), this, SLOT( cancelId( void ) ) );
}
void IdEditDialog::setupNewId(bool pseudo)
{
ui.checkBox_NewId->setChecked(true);
ui.checkBox_NewId->setEnabled(false);
ui.lineEdit_KeyId->setText("To Be Generated");
ui.lineEdit_Nickname->setText("");
ui.radioButton_GpgId->setEnabled(true);
ui.radioButton_Pseudo->setEnabled(true);
if (pseudo)
{
ui.radioButton_Pseudo->setChecked(true);
}
else
{
ui.radioButton_GpgId->setChecked(true);
}
// force - incase it wasn't triggered.
IdTypeToggled(true);
return;
}
void IdEditDialog::IdTypeToggled(bool checked)
{
if (checked)
{
bool pseudo = ui.radioButton_Pseudo->isChecked();
updateIdType(pseudo);
}
}
void IdEditDialog::updateIdType(bool pseudo)
{
if (pseudo)
{
ui.lineEdit_GpgHash->setText("N/A");
ui.lineEdit_GpgId->setText("N/A");
ui.lineEdit_GpgName->setText("N/A");
ui.lineEdit_GpgEmail->setText("N/A");
}
else
{
/* get GPG Details from rsPeers */
std::string gpgid = rsPeers->getGPGOwnId();
RsPeerDetails details;
rsPeers->getPeerDetails(gpgid, details);
ui.lineEdit_GpgId->setText(QString::fromStdString(gpgid));
ui.lineEdit_GpgHash->setText("To Be Generated");
ui.lineEdit_GpgName->setText(QString::fromStdString(details.name));
ui.lineEdit_GpgEmail->setText(QString::fromStdString(details.email));
}
return;
}
void IdEditDialog::setupExistingId(std::string keyId)
{
ui.checkBox_NewId->setChecked(false);
ui.checkBox_NewId->setEnabled(false);
ui.radioButton_GpgId->setEnabled(false);
ui.radioButton_Pseudo->setEnabled(false);
RsIdData data;
if (!rsIdentity->getIdentity(keyId, data))
{
ui.lineEdit_KeyId->setText("ERROR KEYID INVALID");
ui.lineEdit_Nickname->setText("");
ui.lineEdit_GpgHash->setText("N/A");
ui.lineEdit_GpgId->setText("N/A");
ui.lineEdit_GpgName->setText("N/A");
ui.lineEdit_GpgEmail->setText("N/A");
return;
}
bool pseudo = (data.mIdType & RSID_TYPE_PSEUDONYM);
if (pseudo)
{
ui.radioButton_Pseudo->setChecked(true);
}
else
{
ui.radioButton_GpgId->setChecked(true);
}
// DOES THIS TRIGGER ALREADY???
// force - incase it wasn't triggered.
IdTypeToggled(true);
ui.lineEdit_Nickname->setText(QString::fromStdString(data.mNickname));
ui.lineEdit_KeyId->setText(QString::fromStdString(data.mKeyId));
if (pseudo)
{
ui.lineEdit_GpgHash->setText("N/A");
ui.lineEdit_GpgId->setText("N/A");
ui.lineEdit_GpgName->setText("N/A");
ui.lineEdit_GpgEmail->setText("N/A");
}
else
{
ui.lineEdit_GpgHash->setText(QString::fromStdString(data.mGpgIdHash));
if (data.mGpgIdKnown)
{
ui.lineEdit_GpgId->setText(QString::fromStdString(data.mGpgId));
ui.lineEdit_GpgName->setText(QString::fromStdString(data.mGpgName));
ui.lineEdit_GpgEmail->setText(QString::fromStdString(data.mGpgEmail));
}
else
{
ui.lineEdit_GpgId->setText("EXIST Unknown");
ui.lineEdit_GpgName->setText("Unknown");
ui.lineEdit_GpgEmail->setText("Unknown");
}
}
return;
}
void IdEditDialog::updateId()
{
RsIdData rid;
// Must set, Nickname, KeyId(if existing), mIdType, GpgId.
rid.mNickname = ui.lineEdit_Nickname->text().toStdString();
if (rid.mNickname.size() < 2)
{
std::cerr << "IdEditDialog::updateId() Nickname too short";
std::cerr << std::endl;
return;
}
rid.mIdType = RSID_RELATION_YOURSELF;
if (ui.checkBox_NewId->isChecked())
{
rid.mKeyId = "";
}
else
{
rid.mKeyId = ui.lineEdit_KeyId->text().toStdString();
}
if (ui.radioButton_GpgId->isChecked())
{
rid.mIdType |= RSID_TYPE_REALID;
rid.mGpgId = ui.lineEdit_GpgId->text().toStdString();
rid.mGpgIdHash = ui.lineEdit_GpgHash->text().toStdString();
rid.mGpgName = ui.lineEdit_GpgName->text().toStdString();
rid.mGpgEmail = ui.lineEdit_GpgEmail->text().toStdString();
}
else
{
rid.mIdType |= RSID_TYPE_PSEUDONYM;
rid.mGpgId = "";
rid.mGpgIdHash = "";
rid.mGpgName = "";
rid.mGpgEmail = "";
}
rsIdentity->updateIdentity(rid);
hide();
return;
}
void IdEditDialog::cancelId()
{
hide();
return;
}
void IdEditDialog::clearDialog()
{
return;
}

View File

@ -0,0 +1,56 @@
/*
* 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".
*
*/
#ifndef MRK_ID_EDIT_DIALOG_H
#define MRK_ID_EDIT_DIALOG_H
#include "ui_IdEditDialog.h"
class IdEditDialog : public QWidget
{
Q_OBJECT
public:
IdEditDialog(QWidget *parent = 0);
void setupNewId(bool pseudo);
void setupExistingId(std::string keyId);
private slots:
void IdTypeToggled(bool checked);
void updateId();
void cancelId();
private:
void updateIdType(bool pseudo);
void clearDialog();
protected:
Ui::IdEditDialog ui;
};
#endif

View File

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>IdEditDialog</class>
<widget class="QWidget" name="IdEditDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>557</width>
<height>229</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Nickname</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Nickname"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Key ID</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_KeyId"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>GPG Name</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_GpgName"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>GPG Email</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEdit_GpgEmail"/>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_GpgHash"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>GPG Hash</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_GpgId"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>GPG Id</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="checkBox_NewId">
<property name="text">
<string>New Identity</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QRadioButton" name="radioButton_GpgId">
<property name="text">
<string>Gpg Assocated ID</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_Pseudo">
<property name="text">
<string>Pseudonym</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton_Cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>288</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_Update">
<property name="text">
<string>Create/Update ID</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../LinksCloud/images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -58,8 +58,8 @@
#include "RetroShareLink.h" #include "RetroShareLink.h"
// New Cache Classes - // New Cache Classes -
#include "gui/PhotoShare/PhotoDialog.h" //#include "gui/PhotoShare/PhotoDialog.h"
#include "gui/WikiPoos/WikiDialog.h" //#include "gui/WikiPoos/WikiDialog.h"
#ifdef UNFINISHED #ifdef UNFINISHED
#include "unfinished/ApplicationWindow.h" #include "unfinished/ApplicationWindow.h"
@ -320,6 +320,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
} }
#endif #endif
#if 0
// New Cache Classes - // New Cache Classes -
MainPage *photoPage = NULL; MainPage *photoPage = NULL;
ui.stackPages->add(photoPage = new PhotoDialog(ui.stackPages), ui.stackPages->add(photoPage = new PhotoDialog(ui.stackPages),
@ -329,6 +330,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
MainPage *wikiPage = NULL; MainPage *wikiPage = NULL;
ui.stackPages->add(wikiPage = new WikiDialog(ui.stackPages), ui.stackPages->add(wikiPage = new WikiDialog(ui.stackPages),
createPageAction(QIcon(IMG_HELP), tr("WikiPoos"), grp)); createPageAction(QIcon(IMG_HELP), tr("WikiPoos"), grp));
#endif
@ -1164,6 +1166,9 @@ void MainWindow::showDhtWindow()
#ifdef UNFINISHED #ifdef UNFINISHED
void MainWindow::showApplWindow() void MainWindow::showApplWindow()
{ {
std::cerr << "MainWindow::showApplWindow()";
std::cerr << std::endl;
applicationWindow->show(); applicationWindow->show();
} }
#endif #endif

View File

@ -561,13 +561,27 @@ void PhotoDrop::dragEnterEvent(QDragEnterEvent *event)
std::cerr << "PhotoDrop::dragEnterEvent()"; std::cerr << "PhotoDrop::dragEnterEvent()";
std::cerr << std::endl; std::cerr << std::endl;
//if (event->mimeData()->hasFormat("image/x-photo-item"))
#if 0
const QStringList& formats = event->mimeData()->formats();
std::cerr << "dragEnterEvent() Formats" << std::endl;
QStringList::const_iterator it;
for (it = formats.begin(); it != formats.end(); ++it) {
std::cerr << "Format: " << (*it).toStdString();
std::cerr << std::endl;
}
#endif
if (event->mimeData()->hasUrls()) if (event->mimeData()->hasUrls())
{ {
std::cerr << "PhotoDrop::dragEnterEvent() Accepting";
std::cerr << std::endl;
event->accept(); event->accept();
} }
else else
{ {
std::cerr << "PhotoDrop::dragEnterEvent() Ignoring";
std::cerr << std::endl;
event->ignore(); event->ignore();
} }
} }
@ -589,8 +603,8 @@ void PhotoDrop::dragMoveEvent(QDragMoveEvent *event)
std::cerr << "PhotoDrop::dragMoveEvent()"; std::cerr << "PhotoDrop::dragMoveEvent()";
std::cerr << std::endl; std::cerr << std::endl;
//event->accept(); event->accept();
event->ignore(); //event->ignore();
} }
void PhotoDrop::dropEvent(QDropEvent *event) void PhotoDrop::dropEvent(QDropEvent *event)
@ -621,6 +635,8 @@ void PhotoDrop::dropEvent(QDropEvent *event)
} }
else else
{ {
std::cerr << "PhotoDrop::dropEvent Ignoring";
std::cerr << std::endl;
event->ignore(); event->ignore();
} }

View File

@ -0,0 +1,210 @@
/*
* Retroshare Photo Plugin.
*
* 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".
*
*/
#include "gui/TheWire/PulseAddDialog.h"
#include "gui/PhotoShare/PhotoDetailsDialog.h"
#include "gui/PhotoShare/PhotoDrop.h"
#include <iostream>
/** Constructor */
PulseAddDialog::PulseAddDialog(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
connect(ui.pushButton_Post, SIGNAL( clicked( void ) ), this, SLOT( postPulse( void ) ) );
connect(ui.pushButton_AddURL, SIGNAL( clicked( void ) ), this, SLOT( addURL( void ) ) );
connect(ui.pushButton_AddTo, SIGNAL( clicked( void ) ), this, SLOT( addTo( void ) ) );
connect(ui.pushButton_Cancel, SIGNAL( clicked( void ) ), this, SLOT( cancelPulse( void ) ) );
#if 0
connect(ui.scrollAreaWidgetContents, SIGNAL( buttonStatus( uint32_t ) ), this, SLOT( updateMoveButtons( uint32_t ) ) );
connect(ui.pushButton_ShiftRight, SIGNAL( clicked( void ) ), ui.scrollAreaWidgetContents, SLOT( moveRight( void ) ) );
connect(ui.pushButton_EditPhotoDetails, SIGNAL( clicked( void ) ), this, SLOT( showPhotoDetails( void ) ) );
connect(ui.pushButton_Publish, SIGNAL( clicked( void ) ), this, SLOT( publishAlbum( void ) ) );
#endif
mPhotoDetails = NULL;
}
void PulseAddDialog::addURL()
{
std::cerr << "PulseAddDialog::addURL()";
std::cerr << std::endl;
return;
}
void PulseAddDialog::addTo()
{
std::cerr << "PulseAddDialog::addTo()";
std::cerr << std::endl;
return;
}
void PulseAddDialog::cancelPulse()
{
std::cerr << "PulseAddDialog::cancelPulse()";
std::cerr << std::endl;
clearDialog();
hide();
return;
}
void PulseAddDialog::updateMoveButtons(uint32_t status)
{
std::cerr << "PulseAddDialog::updateMoveButtons(" << status << ")";
std::cerr << std::endl;
#if 0
switch(status)
{
case PHOTO_SHIFT_NO_BUTTONS:
ui.pushButton_ShiftLeft->setEnabled(false);
ui.pushButton_ShiftRight->setEnabled(false);
break;
case PHOTO_SHIFT_LEFT_ONLY:
ui.pushButton_ShiftLeft->setEnabled(true);
ui.pushButton_ShiftRight->setEnabled(false);
break;
case PHOTO_SHIFT_RIGHT_ONLY:
ui.pushButton_ShiftLeft->setEnabled(false);
ui.pushButton_ShiftRight->setEnabled(true);
break;
case PHOTO_SHIFT_BOTH:
ui.pushButton_ShiftLeft->setEnabled(true);
ui.pushButton_ShiftRight->setEnabled(true);
break;
}
#endif
}
void PulseAddDialog::showPhotoDetails()
{
#if 0
std::cerr << "PulseAddDialog::showPhotoDetails()";
std::cerr << std::endl;
if (!mPhotoDetails)
{
mPhotoDetails = new PhotoDetailsDialog(NULL);
}
PhotoItem *item = ui.scrollAreaWidgetContents->getSelectedPhotoItem();
mPhotoDetails->setPhotoItem(item);
mPhotoDetails->show();
#endif
}
void PulseAddDialog::postPulse()
{
std::cerr << "PulseAddDialog::postPulse()";
std::cerr << std::endl;
#if 0
/* we need to iterate through each photoItem, and extract the details */
RsPhotoAlbum album;
RsPhotoThumbnail albumThumb;
album.mShareOptions.mShareType = 0;
album.mShareOptions.mShareGroupId = "unknown";
album.mShareOptions.mPublishKey = "unknown";
album.mShareOptions.mCommentMode = 0;
album.mShareOptions.mResizeMode = 0;
album.mTitle = ui.lineEdit_Title->text().toStdString();
album.mCategory = "Unknown";
album.mCaption = ui.lineEdit_Caption->text().toStdString();
album.mWhere = ui.lineEdit_Where->text().toStdString();
album.mWhen = ui.lineEdit_When->text().toStdString();
if (rsPhoto->submitAlbumDetails(album, albumThumb))
{
/* now have path and album id */
int photoCount = ui.scrollAreaWidgetContents->getPhotoCount();
for(int i = 0; i < photoCount; i++)
{
RsPhotoPhoto photo;
RsPhotoThumbnail thumbnail;
PhotoItem *item = ui.scrollAreaWidgetContents->getPhotoIdx(i);
photo = item->mDetails;
item->getPhotoThumbnail(thumbnail);
photo.mAlbumId = album.mAlbumId;
photo.mOrder = i;
/* scale photo if needed */
if (album.mShareOptions.mResizeMode)
{
/* */
}
/* save image to album path */
photo.path = "unknown";
rsPhoto->submitPhoto(photo, thumbnail);
}
}
#endif
clearDialog();
hide();
}
void PulseAddDialog::clearDialog()
{
ui.textEdit_Pulse->setPlainText("");
#if 0
ui.lineEdit_Title->setText(QString("title"));
ui.lineEdit_Caption->setText(QString("Caption"));
ui.lineEdit_Where->setText(QString("Where"));
ui.lineEdit_When->setText(QString("When"));
ui.scrollAreaWidgetContents->clearPhotos();
#endif
}

View File

@ -0,0 +1,58 @@
/*
* Retroshare Photo Plugin.
*
* 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".
*
*/
#ifndef MRK_PULSE_ADD_DIALOG_H
#define MRK_PULSE_ADD_DIALOG_H
#include "ui_PulseAddDialog.h"
#include <inttypes.h>
class PhotoDetailsDialog;
class PulseAddDialog : public QWidget
{
Q_OBJECT
public:
PulseAddDialog(QWidget *parent = 0);
private slots:
void showPhotoDetails();
void updateMoveButtons(uint32_t status);
void addURL();
void addTo();
void postPulse();
void cancelPulse();
void clearDialog();
protected:
PhotoDetailsDialog *mPhotoDetails;
Ui::PulseAddDialog ui;
};
#endif

View File

@ -0,0 +1,288 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PulseAddDialog</class>
<widget class="QWidget" name="PulseAddDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>720</width>
<height>586</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" rowspan="3">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QFrame" name="frame">
<property name="maximumSize">
<size>
<width>160</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>156</width>
<height>184</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Post From:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Account 1</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<property name="text">
<string>Account 2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_3">
<property name="text">
<string>Account 3</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QScrollArea" name="scrollArea_3">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>158</width>
<height>372</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="pushButton_AddTo">
<property name="text">
<string>Add to Pulse</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_3">
<property name="text">
<string>filter</string>
</property>
</widget>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>138</width>
<height>286</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="checkBox_5">
<property name="text">
<string>Account 1</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_6">
<property name="text">
<string>Account 2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_7">
<property name="text">
<string>Account 3</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>70</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
<item row="0" column="1" colspan="3">
<widget class="QTextEdit" name="textEdit_Pulse"/>
</item>
<item row="1" column="1" colspan="3">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>URL Adder</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>331</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_AddURL">
<property name="text">
<string>Add to Pulse</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Display As</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>URL</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="pushButton_Cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="2" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>298</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="3">
<widget class="QPushButton" name="pushButton_Post">
<property name="text">
<string>Post Pulse to Wire</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../LinksCloud/images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,255 @@
/*
* Retroshare Photo Plugin.
*
* 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".
*
*/
#include <QDateTime>
#include <QMessageBox>
#include <QMouseEvent>
#include <QBuffer>
#include "PulseItem.h"
#include <retroshare/rsphoto.h>
#include <algorithm>
#include <iostream>
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
PulseItem::PulseItem(PulseHolder *parent, const RsPhotoAlbum &album, const RsPhotoThumbnail &thumbnail)
:QWidget(NULL), mParent(parent), mType(PHOTO_ITEM_TYPE_ALBUM)
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
mDetails = *( (RsPhotoPhoto *) &(album));
updateAlbumText(album);
updateImage(thumbnail);
setSelected(false);
}
PulseItem::PulseItem(PulseHolder *parent, const RsPhotoPhoto &photo, const RsPhotoThumbnail &thumbnail)
:QWidget(NULL), mParent(parent), mType(PHOTO_ITEM_TYPE_PHOTO)
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
mDetails = *( (RsPhotoPhoto *) &(photo));
updatePhotoText(photo);
updateImage(thumbnail);
setSelected(false);
}
PulseItem::PulseItem(PulseHolder *parent, std::string path) // for new photos.
:QWidget(NULL), mParent(parent), mType(PHOTO_ITEM_TYPE_NEW)
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
#if 0
QString dummyString("dummytext");
titleLabel->setText(QString("NEW PHOTO"));
fromBoldLabel->setText(QString("From:"));
fromLabel->setText(QString("Ourselves"));
statusBoldLabel->setText(QString("Status:"));
statusLabel->setText(QString("new photo"));
dateBoldLabel->setText(QString("Date:"));
dateLabel->setText(QString("now"));
int width = 120;
int height = 120;
//QPixmap qtn = QPixmap(QString::fromStdString(path)).scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
QPixmap qtn = QPixmap(QString::fromStdString(path)).scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation);
imgLabel->setPixmap(qtn);
setSelected(false);
#endif
}
void PulseItem::updateAlbumText(const RsPhotoAlbum &album)
{
#if 0
QString dummyString("dummytext");
titleLabel->setText(QString("TITLE"));
fromBoldLabel->setText(QString("From:"));
fromLabel->setText(QString("Unknown"));
statusBoldLabel->setText(QString("Status:"));
statusLabel->setText(QString("new photo"));
dateBoldLabel->setText(QString("Date:"));
dateLabel->setText(QString("now"));
//QDateTime qtime;
//qtime.setTime_t(msg.ts);
//QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
//timestamplabel->setText(timestamp);
dateBoldLabel->setText(dummyString);
dateLabel->setText(dummyString);
#endif
}
void PulseItem::updatePhotoText(const RsPhotoPhoto &photo)
{
#if 0
QString dummyString("dummytext");
titleLabel->setText(QString("TITLE"));
fromBoldLabel->setText(QString("From:"));
fromLabel->setText(QString("Unknown"));
statusBoldLabel->setText(QString("Status:"));
statusLabel->setText(QString("new photo"));
dateBoldLabel->setText(QString("Date:"));
dateLabel->setText(QString("now"));
#endif
}
void PulseItem::updateImage(const RsPhotoThumbnail &thumbnail)
{
#if 0
if (thumbnail.data != NULL)
{
QPixmap qtn;
qtn.loadFromData(thumbnail.data, thumbnail.size, thumbnail.type.c_str());
imgLabel->setPixmap(qtn);
}
#endif
}
bool PulseItem::getPhotoThumbnail(RsPhotoThumbnail &nail)
{
#if 0
const QPixmap *tmppix = imgLabel->pixmap();
QByteArray ba;
QBuffer buffer(&ba);
if(!tmppix->isNull())
{
// send chan image
buffer.open(QIODevice::WriteOnly);
tmppix->save(&buffer, "PNG"); // writes image into ba in PNG format
RsPhotoThumbnail tmpnail;
tmpnail.data = (uint8_t *) ba.data();
tmpnail.size = ba.size();
nail.copyFrom(tmpnail);
return true;
}
nail.data = NULL;
nail.size = 0;
#endif
return false;
}
void PulseItem::removeItem()
{
#if 0
#ifdef DEBUG_ITEM
std::cerr << "PulseItem::removeItem()";
std::cerr << std::endl;
#endif
hide();
if (mParent)
{
mParent->deletePulseItem(this, mType);
}
#endif
}
void PulseItem::setSelected(bool on)
{
#if 0
mSelected = on;
if (mSelected)
{
mParent->notifySelection(this, mType);
frame->setStyleSheet("QFrame#frame{border: 2px solid #55CC55;\nbackground: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #55EE55, stop: 1 #CCCCCC);\nborder-radius: 10px}");
}
else
{
frame->setStyleSheet("QFrame#frame{border: 2px solid #CCCCCC;\nbackground: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEEEEE, stop: 1 #CCCCCC);\nborder-radius: 10px}");
}
update();
#endif
}
bool PulseItem::isSelected()
{
return mSelected;
}
void PulseItem::mousePressEvent(QMouseEvent *event)
{
/* We can be very cunning here?
* grab out position.
* flag ourselves as selected.
* then pass the mousePressEvent up for handling by the parent
*/
QPoint pos = event->pos();
std::cerr << "PulseItem::mousePressEvent(" << pos.x() << ", " << pos.y() << ")";
std::cerr << std::endl;
setSelected(true);
QWidget::mousePressEvent(event);
}
const QPixmap *PulseItem::getPixmap()
{
#if 0
return imgLabel->pixmap();
#endif
return NULL;
}

View File

@ -0,0 +1,86 @@
/*
* Retroshare Photo Plugin.
*
* 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".
*
*/
#ifndef MRK_PULSE_ITEM_H
#define MRK_PULSE_ITEM_H
#include "ui_PulseItem.h"
#include <retroshare/rsphoto.h>
class PulseItem;
class PulseHolder
{
public:
virtual void deletePulseItem(PulseItem *, uint32_t ptype) = 0;
virtual void notifySelection(PulseItem *item, int ptype) = 0;
};
#define PHOTO_ITEM_TYPE_ALBUM 0x0001
#define PHOTO_ITEM_TYPE_PHOTO 0x0002
#define PHOTO_ITEM_TYPE_NEW 0x0003
class PulseItem : public QWidget, private Ui::PulseItem
{
Q_OBJECT
public:
PulseItem(PulseHolder *parent, const RsPhotoAlbum &album, const RsPhotoThumbnail &thumbnail);
PulseItem(PulseHolder *parent, const RsPhotoPhoto &photo, const RsPhotoThumbnail &thumbnail);
PulseItem(PulseHolder *parent, std::string url); // for new photos.
bool getPhotoThumbnail(RsPhotoThumbnail &nail);
void removeItem();
void setSelected(bool on);
bool isSelected();
const QPixmap *getPixmap();
// details are public - so that can be easily edited.
RsPhotoPhoto mDetails;
//private slots:
protected:
void mousePressEvent(QMouseEvent *event);
private:
void updateAlbumText(const RsPhotoAlbum &album);
void updatePhotoText(const RsPhotoPhoto &photo);
void updateImage(const RsPhotoThumbnail &thumbnail);
PulseHolder *mParent;
uint32_t mType;
bool mSelected;
};
#endif

View File

@ -0,0 +1,214 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PulseItem</class>
<widget class="QWidget" name="PulseItem">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>615</width>
<height>232</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{border: 2px solid #CCCCCC;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" rowspan="2">
<widget class="QLabel" name="imgLabel">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QLabel#label{border: 2px solid black;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/images/konversation.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="_3">
<item>
<widget class="QLabel" name="fromBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>From</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fromLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string notr="true">Signed by</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2">
<layout class="QHBoxLayout" name="_4">
<item>
<widget class="QLabel" name="dateBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Date</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dateLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string notr="true">You eyes only</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1" rowspan="3" colspan="2">
<widget class="QTextBrowser" name="textBrowser"/>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>48</width>
<height>75</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QToolButton" name="toolButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_2">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_3">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../../retroshare-gui/src/gui/images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,460 @@
/*
* Retroshare Photo Plugin.
*
* 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".
*
*/
#include "WireDialog.h"
#include <retroshare/rspeers.h>
#include <retroshare/rsphoto.h>
#include <iostream>
#include <sstream>
#include <QTimer>
/******
* #define PHOTO_DEBUG 1
*****/
/****************************************************************
* New Photo Display Widget.
*
* This has two 'lists'.
* Top list shows Albums.
* Lower list is photos from the selected Album.
*
* Notes:
* Each Item will be an AlbumItem, which contains a thumbnail & random details.
* We will limit Items to < 100. With a 'Filter to see more message.
*
* Thumbnails will come from Service.
* Option to Share albums / pictures onward (if permissions allow).
* Option to Download the albums to a specified directory. (is this required if sharing an album?)
*
* Will introduce a FullScreen SlideShow later... first get basics happening.
*/
/** Constructor */
WireDialog::WireDialog(QWidget *parent)
: MainPage(parent)
{
ui.setupUi(this);
mAddDialog = NULL;
mPulseSelected = NULL;
connect( ui.pushButton_Post, SIGNAL(clicked()), this, SLOT(OpenOrShowPulseAddDialog()));
//connect( ui.pushButton_Accounts, SIGNAL(clicked()), this, SLOT(OpenOrShowAccountDialog()));
QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
timer->start(1000);
}
void WireDialog::notifySelection(PulseItem *item, int ptype)
{
std::cerr << "WireDialog::notifySelection() from : " << ptype << " " << item;
std::cerr << std::endl;
notifyPulseSelection(item);
#if 0
switch(ptype)
{
default:
case PHOTO_ITEM_TYPE_ALBUM:
notifyAlbumSelection(item);
break;
case PHOTO_ITEM_TYPE_PHOTO:
notifyPhotoSelection(item);
break;
}
#endif
}
void WireDialog::notifyPulseSelection(PulseItem *item)
{
std::cerr << "WireDialog::notifyPulseSelection() from : " << item;
std::cerr << std::endl;
if (mPulseSelected)
{
std::cerr << "WireDialog::notifyPulseSelection() unselecting old one : " << mPulseSelected;
std::cerr << std::endl;
mPulseSelected->setSelected(false);
}
mPulseSelected = item;
}
void WireDialog::checkUpdate()
{
#if 0
/* update */
if (!rsWire)
return;
if (rsWire->updated())
{
insertAlbums();
}
#endif
return;
}
/*************** New Photo Dialog ***************/
void WireDialog::OpenOrShowPulseAddDialog()
{
if (mAddDialog)
{
mAddDialog->show();
}
else
{
mAddDialog = new PulseAddDialog(NULL);
mAddDialog->show();
}
}
bool WireDialog::matchesAlbumFilter(const RsPhotoAlbum &album)
{
return true;
}
double WireDialog::AlbumScore(const RsPhotoAlbum &album)
{
return 1;
}
bool WireDialog::matchesPhotoFilter(const RsPhotoPhoto &photo)
{
return true;
}
double WireDialog::PhotoScore(const RsPhotoPhoto &photo)
{
return 1;
}
bool WireDialog::FilterNSortAlbums(const std::list<std::string> &albumIds, std::list<std::string> &filteredAlbumIds, int count)
{
#if 0
std::multimap<double, std::string> sortedAlbums;
std::multimap<double, std::string>::iterator sit;
std::list<std::string>::const_iterator it;
for(it = albumIds.begin(); it != albumIds.end(); it++)
{
RsPhotoAlbum album;
rsPhoto->getAlbum(*it, album);
if (matchesAlbumFilter(album))
{
double score = AlbumScore(album);
sortedAlbums.insert(std::make_pair(score, *it));
}
}
int i;
for (sit = sortedAlbums.begin(), i = 0; (sit != sortedAlbums.end()) && (i < count); sit++, i++)
{
filteredAlbumIds.push_back(sit->second);
}
#endif
return true;
}
bool WireDialog::FilterNSortPhotos(const std::list<std::string> &photoIds, std::list<std::string> &filteredPhotoIds, int count)
{
#if 0
std::multimap<double, std::string> sortedPhotos;
std::multimap<double, std::string>::iterator sit;
std::list<std::string>::const_iterator it;
int i = 0;
for(it = photoIds.begin(); it != photoIds.end(); it++, i++)
{
RsPhotoPhoto photo;
rsPhoto->getPhoto(*it, photo);
if (matchesPhotoFilter(photo))
{
double score = i; //PhotoScore(album);
sortedPhotos.insert(std::make_pair(score, *it));
}
}
for (sit = sortedPhotos.begin(), i = 0; (sit != sortedPhotos.end()) && (i < count); sit++, i++)
{
filteredPhotoIds.push_back(sit->second);
}
#endif
return true;
}
void WireDialog::insertAlbums()
{
#if 0
/* clear it all */
clearAlbums();
//ui.albumLayout->clear();
/* create a list of albums */
std::list<std::string> albumIds;
std::list<std::string> filteredAlbumIds;
std::list<std::string>::iterator it;
rsPhoto->getAlbumList(albumIds);
/* Filter Albums */ /* Sort Albums */
#define MAX_ALBUMS 50
int count = MAX_ALBUMS;
FilterNSortAlbums(albumIds, filteredAlbumIds, count);
for(it = filteredAlbumIds.begin(); it != filteredAlbumIds.end(); it++)
{
addAlbum(*it);
}
insertPhotosForAlbum(filteredAlbumIds);
#endif
}
void WireDialog::insertPhotosForSelectedAlbum()
{
#if 0
std::cerr << "WireDialog::insertPhotosForSelectedAlbum()";
std::cerr << std::endl;
clearPhotos();
std::list<std::string> albumIds;
if (mAlbumSelected)
{
albumIds.push_back(mAlbumSelected->mDetails.mAlbumId);
std::cerr << "WireDialog::insertPhotosForSelectedAlbum() AlbumId: " << mAlbumSelected->mDetails.mAlbumId;
std::cerr << std::endl;
}
insertPhotosForAlbum(albumIds);
#endif
}
void WireDialog::addAlbum(const std::string &id)
{
#if 0
RsPhotoAlbum album;
rsPhoto->getAlbum(id, album);
RsPhotoThumbnail thumbnail;
rsPhoto->getAlbumThumbnail(id, thumbnail);
std::cerr << " WireDialog::addAlbum() AlbumId: " << album.mAlbumId << std::endl;
PulseItem *item = new PulseItem(this, album, thumbnail);
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
alayout->addWidget(item);
#endif
}
void WireDialog::clearAlbums()
{
#if 0
std::cerr << "WireDialog::clearAlbums()" << std::endl;
std::list<PulseItem *> photoItems;
std::list<PulseItem *>::iterator pit;
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
int count = alayout->count();
for(int i = 0; i < count; i++)
{
QLayoutItem *litem = alayout->itemAt(i);
if (!litem)
{
std::cerr << "WireDialog::clearAlbums() missing litem";
std::cerr << std::endl;
continue;
}
PulseItem *item = dynamic_cast<PulseItem *>(litem->widget());
if (item)
{
std::cerr << "WireDialog::clearAlbums() item: " << item;
std::cerr << std::endl;
photoItems.push_back(item);
}
else
{
std::cerr << "WireDialog::clearAlbums() Found Child, which is not a PulseItem???";
std::cerr << std::endl;
}
}
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
{
PulseItem *item = *pit;
alayout->removeWidget(item);
delete item;
}
mAlbumSelected = NULL;
#endif
}
void WireDialog::clearPhotos()
{
#if 0
std::cerr << "WireDialog::clearPhotos()" << std::endl;
std::list<PulseItem *> photoItems;
std::list<PulseItem *>::iterator pit;
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
int count = alayout->count();
for(int i = 0; i < count; i++)
{
QLayoutItem *litem = alayout->itemAt(i);
if (!litem)
{
std::cerr << "WireDialog::clearPhotos() missing litem";
std::cerr << std::endl;
continue;
}
PulseItem *item = dynamic_cast<PulseItem *>(litem->widget());
if (item)
{
std::cerr << "WireDialog::clearPhotos() item: " << item;
std::cerr << std::endl;
photoItems.push_back(item);
}
else
{
std::cerr << "WireDialog::clearPhotos() Found Child, which is not a PulseItem???";
std::cerr << std::endl;
}
}
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
{
PulseItem *item = *pit;
alayout->removeWidget(item);
delete item;
}
mPhotoSelected = NULL;
#endif
}
void WireDialog::insertPhotosForAlbum(const std::list<std::string> &albumIds)
{
#if 0
/* clear it all */
clearPhotos();
//ui.photoLayout->clear();
/* create a list of albums */
std::list<std::string> ids;
std::list<std::string> photoIds;
std::list<std::string> filteredPhotoIds;
std::list<std::string>::const_iterator it;
for(it = albumIds.begin(); it != albumIds.end(); it++)
{
rsPhoto->getPhotoList(*it, photoIds);
}
/* Filter Albums */ /* Sort Albums */
#define MAX_PHOTOS 50
int count = MAX_PHOTOS;
FilterNSortPhotos(photoIds, filteredPhotoIds, MAX_PHOTOS);
for(it = filteredPhotoIds.begin(); it != filteredPhotoIds.end(); it++)
{
addPhoto(*it);
}
#endif
}
void WireDialog::addPhoto(const std::string &id)
{
#if 0
RsPhotoPhoto photo;
rsPhoto->getPhoto(id,photo);
RsPhotoThumbnail thumbnail;
rsPhoto->getPhotoThumbnail(id, thumbnail);
std::cerr << "WireDialog::addPhoto() AlbumId: " << photo.mAlbumId;
std::cerr << " PhotoId: " << photo.mId;
std::cerr << std::endl;
PulseItem *item = new PulseItem(this, photo, thumbnail);
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
alayout->addWidget(item);
#endif
}
void WireDialog::deletePulseItem(PulseItem *item, uint32_t type)
{
return;
}

View File

@ -0,0 +1,91 @@
/*
* Retroshare Photo Plugin.
*
* 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".
*
*/
#ifndef MRK_WIRE_DIALOG_H
#define MRK_WIRE_DIALOG_H
#include "gui/mainpage.h"
#include "ui_WireDialog.h"
#include <retroshare/rsphoto.h>
#include <map>
#include "gui/TheWire/PulseItem.h"
#include "gui/TheWire/PulseAddDialog.h"
class WireDialog : public MainPage, public PulseHolder
{
Q_OBJECT
public:
WireDialog(QWidget *parent = 0);
virtual void deletePulseItem(PulseItem *, uint32_t type);
virtual void notifySelection(PulseItem *item, int ptype);
void notifyPulseSelection(PulseItem *item);
private slots:
void checkUpdate();
void OpenOrShowPulseAddDialog();
private:
/* TODO: These functions must be filled in for proper filtering to work
* and tied to the GUI input
*/
bool matchesAlbumFilter(const RsPhotoAlbum &album);
double AlbumScore(const RsPhotoAlbum &album);
bool matchesPhotoFilter(const RsPhotoPhoto &photo);
double PhotoScore(const RsPhotoPhoto &photo);
/* Grunt work of setting up the GUI */
bool FilterNSortAlbums(const std::list<std::string> &albumIds, std::list<std::string> &filteredAlbumIds, int count);
bool FilterNSortPhotos(const std::list<std::string> &photoIds, std::list<std::string> &filteredPhotoIds, int count);
void insertAlbums();
void insertPhotosForAlbum(const std::list<std::string> &albumIds);
void insertPhotosForSelectedAlbum();
void addAlbum(const std::string &id);
void addPhoto(const std::string &id);
void clearAlbums();
void clearPhotos();
PulseAddDialog *mAddDialog;
PulseItem *mPulseSelected;
/* UI - from Designer */
Ui::WireDialog ui;
};
#endif

View File

@ -0,0 +1,321 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WireDialog</class>
<widget class="QWidget" name="WireDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>726</width>
<height>557</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" rowspan="3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>TimeRange</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox">
<item>
<property name="text">
<string>All</string>
</property>
</item>
<item>
<property name="text">
<string>Last Month</string>
</property>
</item>
<item>
<property name="text">
<string>Last Week</string>
</property>
</item>
<item>
<property name="text">
<string>Today</string>
</property>
</item>
<item>
<property name="text">
<string>New</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="comboBox_2">
<item>
<property name="text">
<string>from</string>
</property>
</item>
<item>
<property name="text">
<string>until</string>
</property>
</item>
</widget>
</item>
<item row="0" column="3" colspan="2">
<widget class="QDateTimeEdit" name="dateTimeEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Search/Filter</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="checkBox_9">
<property name="text">
<string>Network Wide</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_Accounts">
<property name="text">
<string>Manage Accounts</string>
</property>
</widget>
</item>
<item row="2" column="1" rowspan="2">
<widget class="QFrame" name="frame">
<property name="maximumSize">
<size>
<width>160</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_2">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>156</width>
<height>469</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Showing:</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QRadioButton" name="radioButton">
<property name="text">
<string>Yourself</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_2">
<property name="text">
<string>Friends</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_3">
<property name="text">
<string>Following</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_4">
<property name="text">
<string>All</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_5">
<property name="text">
<string>Custom</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Account 1</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<property name="text">
<string>Account 2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_3">
<property name="text">
<string>Account 3</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_4">
<property name="text">
<string>CheckBox</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_5">
<property name="text">
<string>CheckBox</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_6">
<property name="text">
<string>CheckBox</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_7">
<property name="text">
<string>CheckBox</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_8">
<property name="text">
<string>CheckBox</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>116</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<height>465</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QWidget#scrollAreaWidgetContents{border: none;}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_Post">
<property name="text">
<string>Post Pulse to Wire</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../LinksCloud/images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -40,7 +40,7 @@
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
#include "gui/RetroShareLink.h" #include "gui/RetroShareLink.h"
#include "gui/RsAutoUpdatePage.h" #include "gui/RsAutoUpdatePage.h"
#ifdef UNFINISHED #ifdef UNFINISHED_FD
#include "gui/unfinished/profile/ProfileView.h" #include "gui/unfinished/profile/ProfileView.h"
#endif #endif
#include "RSTreeWidgetItem.h" #include "RSTreeWidgetItem.h"
@ -1310,7 +1310,7 @@ QTreeWidgetItem *FriendList::getCurrentPeer() const
return item; return item;
} }
#ifdef UNFINISHED #ifdef UNFINISHED_FD
/* GUI stuff -> don't do anything directly with Control */ /* GUI stuff -> don't do anything directly with Control */
void FriendsDialog::viewprofile() void FriendsDialog::viewprofile()
{ {

View File

@ -112,7 +112,7 @@ private slots:
void msgfriend(); void msgfriend();
void recommendfriend(); void recommendfriend();
void removefriend(); void removefriend();
#ifdef UNFINISHED #ifdef UNFINISHED_FD
void viewprofile(); void viewprofile();
#endif #endif

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>397</width> <width>411</width>
<height>400</height> <height>400</height>
</rect> </rect>
</property> </property>
@ -561,17 +561,21 @@
<property name="title"> <property name="title">
<string>For Advanced Users </string> <string>For Advanced Users </string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="verticalSpacing"> <item>
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QCheckBox" name="checkAdvanced"> <widget class="QCheckBox" name="checkAdvanced">
<property name="text"> <property name="text">
<string>Enable Advanced Mode (Restart Required)</string> <string>Enable Advanced Mode (Restart Required)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="checkAdvanced_2">
<property name="text">
<string>Enable Experimental Features (Restart Required)</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -32,10 +32,15 @@
#include <retroshare/rsiface.h> #include <retroshare/rsiface.h>
#include "GamesDialog.h" #include "gui/PhotoShare/PhotoDialog.h"
#include "PhotoDialog.h" #include "gui/WikiPoos/WikiDialog.h"
#include "CalDialog.h" #include "gui/TheWire/WireDialog.h"
#include "StatisticDialog.h" #include "gui/Identity/IdDialog.h"
//#include "GamesDialog.h"
//#include "CalDialog.h"
//#include "PhotoDialog.h"
//#include "StatisticDialog.h"
#define FONT QFont("Arial", 9) #define FONT QFont("Arial", 9)
@ -61,7 +66,7 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
setWindowTitle(tr("RetroShare")); setWindowTitle(tr("RetroShare"));
Settings->loadWidgetInformation(this); //Settings->loadWidgetInformation(this);
// Setting icons // Setting icons
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png"))); this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
@ -70,23 +75,38 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
/* Create the config pages and actions */ /* Create the config pages and actions */
QActionGroup *grp = new QActionGroup(this); QActionGroup *grp = new QActionGroup(this);
StatisticDialog *statisticDialog = NULL; //StatisticDialog *statisticDialog = NULL;
ui.stackPages->add(statisticDialog = new StatisticDialog(ui.stackPages), //ui.stackPages->add(statisticDialog = new StatisticDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_STATISTIC), tr("Statistics"), grp)); // createPageAction(QIcon(IMAGE_STATISTIC), tr("Statistics"), grp));
//PhotoDialog *photoDialog = NULL;
//ui.stackPages->add(photoDialog = new PhotoDialog(ui.stackPages),
// createPageAction(QIcon(IMAGE_PHOTO), tr("Photo View"), grp));
//GamesDialog *gamesDialog = NULL;
//ui.stackPages->add(gamesDialog = new GamesDialog(ui.stackPages),
// createPageAction(QIcon(IMAGE_GAMES), tr("Games Launcher"), grp));
//CalDialog *calDialog = NULL;
//ui.stackPages->add(calDialog = new CalDialog(ui.stackPages),
// createPageAction(QIcon(IMAGE_CALENDAR), tr("Shared Calendars"), grp));
IdDialog *idDialog = NULL;
ui.stackPages->add(idDialog = new IdDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_LIBRARY), tr("Identities"), grp));
PhotoDialog *photoDialog = NULL; PhotoDialog *photoDialog = NULL;
ui.stackPages->add(photoDialog = new PhotoDialog(ui.stackPages), ui.stackPages->add(photoDialog = new PhotoDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_PHOTO), tr("Photo View"), grp)); createPageAction(QIcon(IMAGE_PHOTO), tr("Photo View"), grp));
GamesDialog *gamesDialog = NULL; WikiDialog *wikiDialog = NULL;
ui.stackPages->add(gamesDialog = new GamesDialog(ui.stackPages), ui.stackPages->add(wikiDialog = new WikiDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_GAMES), tr("Games Launcher"), grp)); createPageAction(QIcon(IMAGE_LIBRARY), tr("Wiki Pages"), grp));
CalDialog *calDialog = NULL;
ui.stackPages->add(calDialog = new CalDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_CALENDAR), tr("Shared Calendars"), grp));
WireDialog *wireDialog = NULL;
ui.stackPages->add(wireDialog = new WireDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_BWGRAPH), tr("The Wire"), grp));
/* Create the toolbar */ /* Create the toolbar */
ui.toolBar->addActions(grp->actions()); ui.toolBar->addActions(grp->actions());
@ -154,7 +174,7 @@ void ApplicationWindow::createActions()
void ApplicationWindow::closeEvent(QCloseEvent *e) void ApplicationWindow::closeEvent(QCloseEvent *e)
{ {
Settings->saveWidgetInformation(this); //Settings->saveWidgetInformation(this);
hide(); hide();
e->ignore(); e->ignore();