forget to add this

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4242 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2011-06-08 20:19:56 +00:00
parent ccb9699f81
commit 67fcb01573
9 changed files with 2312 additions and 0 deletions

View File

@ -0,0 +1,124 @@
/****************************************************************
* 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 "AddLinksDialog.h"
#include "../../retroshare-gui/src/gui/RetroShareLink.h"
#include <retroshare/rsrank.h>
#include <QMessageBox>
/* Images for context menu icons */
#define IMAGE_EXPORTFRIEND ":/images/exportpeers_16x16.png"
#define IMAGE_GREAT ":/images/filerating5.png"
#define IMAGE_GOOD ":/images/filerating4.png"
#define IMAGE_OK ":/images/filerating3.png"
#define IMAGE_SUX ":/images/filerating2.png"
#define IMAGE_BADLINK ":/images/filerating1.png"
/** Constructor */
AddLinksDialog::AddLinksDialog(QString url, QWidget *parent)
: QDialog(parent)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
/* add button */
connect(ui.addLinkButton, SIGNAL(clicked()), this, SLOT(addLinkComment()));
connect(ui.closepushButton, SIGNAL(clicked()), this, SLOT(close()));
connect( ui.anonBox, SIGNAL( stateChanged ( int ) ), this, SLOT( load ( void ) ) );
ui.linkLineEdit->setText(url);
RetroShareLink link(url);
if(link.valid() && link.type() == RetroShareLink::TYPE_FILE)
ui.titleLineEdit->setText(link.name());
else
ui.titleLineEdit->setText("New File");
load();
/* Hide platform specific features */
#ifdef Q_WS_WIN
#endif
}
int AddLinksDialog::IndexToScore(int index)
{
if ((index == -1) || (index > 4))
return 0;
int score = 2 - index;
return score;
}
void AddLinksDialog::addLinkComment()
{
/* get the title / link / comment */
QString title = ui.titleLineEdit->text();
QString link = ui.linkLineEdit->text();
QString comment = ui.linkTextEdit->toPlainText();
int32_t score = AddLinksDialog::IndexToScore(ui.scoreBox->currentIndex());
if ((link == "") || (title == ""))
{
QMessageBox::warning(NULL, tr("Add Link Failure"), tr("Missing Link and/or Title"), QMessageBox::Ok);
/* can't do anything */
return;
}
/* add it either way */
if (ui.anonBox->isChecked())
{
rsRanks->anonRankMsg("", link.toStdWString(), title.toStdWString());
}
else
{
rsRanks->newRankMsg(link.toStdWString(),
title.toStdWString(),
comment.toStdWString(), score);
}
close();
}
void AddLinksDialog::load()
{
if (ui.anonBox->isChecked())
{
/* disable comment + score */
ui.scoreBox->setEnabled(false);
ui.linkTextEdit->setEnabled(false);
/* done! */
return;
}
else
{
/* enable comment + score */
ui.scoreBox->setEnabled(true);
ui.linkTextEdit->setEnabled(true);
}
}

View File

@ -0,0 +1,48 @@
/****************************************************************
* RetroShare GUI 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 _ADDLINKS_DIALOG_H
#define _ADDLINKS_DIALOG_H
#include "ui_AddLinksDialog.h"
class AddLinksDialog : public QDialog
{
Q_OBJECT
public:
/** Default Constructor */
AddLinksDialog(QString url, QWidget *parent = 0);
/** Default Destructor */
static int IndexToScore(int index);
public slots:
void addLinkComment();
void load();
private:
/** Qt Designer generated object */
Ui::AddLinksDialog ui;
};
#endif

View File

@ -0,0 +1,289 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AddLinksDialog</class>
<widget class="QDialog" name="AddLinksDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>614</width>
<height>415</height>
</rect>
</property>
<property name="windowTitle">
<string>Add Link</string>
</property>
<property name="windowIcon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0" colspan="4">
<widget class="QFrame" name="frame">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>52</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{background-image: url(:/images/connect/connectFriendBanner.png);}
</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="linksiconlabel">
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../retroshare-gui/src/gui/images.qrc">:/images/irkick.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DejaVu Sans'; font-size:18pt; font-weight:600; color:#ffffff;&quot;&gt;Add Link to Cloud&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="4">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="1">
<widget class="QPushButton" name="closepushButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="addLinkButton">
<property name="text">
<string>Add Link</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>375</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Add a new Link</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="spacing">
<number>1</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Title:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Url:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLineEdit" name="titleLineEdit"/>
</item>
<item>
<widget class="QLineEdit" name="linkLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_3">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>40</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame_3{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="anonBox">
<property name="text">
<string>Add Anonymous Link</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="scoreBox">
<item>
<property name="text">
<string>+2 Great!</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating5.png</normaloff>:/images/filerating5.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>+1 Good</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating4.png</normaloff>:/images/filerating4.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>0 Okay</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating3.png</normaloff>:/images/filerating3.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>-1 Sux</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating2.png</normaloff>:/images/filerating2.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>-2 Bad Link</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating1.png</normaloff>:/images/filerating1.png</iconset>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>299</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QTextEdit" name="linkTextEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../../retroshare-gui/src/gui/images.qrc"/>
<include location="images.qrc"/>
</resources>
<connections/>
</ui>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
/****************************************************************
* RetroShare GUI 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 _LINKS_DIALOG_H
#define _LINKS_DIALOG_H
#include "ui_LinksDialog.h"
class LinksDialog : public QWidget
{
Q_OBJECT
public:
/** Default Constructor */
LinksDialog(QWidget *parent = 0);
/** Default Destructor */
void insertExample();
private slots:
/** Create the context popup menu and it's submenus */
void linkTreeWidgetCostumPopupMenu( QPoint point );
void voteup_anon();
void voteup_score(int score);
void voteup_p2();
void voteup_p1();
void voteup_p0();
void voteup_m1();
void voteup_m2();
void downloadSelected();
void changedSortRank( int index );
void changedSortPeriod( int index );
void changedSortFrom( int index );
void changedSortTop( int index );
void updateLinks();
void addLinkComment( void );
void toggleWindows( void );
void openLink ( QTreeWidgetItem * item, int column );
void changedItem(QTreeWidgetItem *curr, QTreeWidgetItem *prev);
void checkAnon();
void checkUpdate();
void anchorClicked (const QUrl &);
void addNewLink();
private:
void updateComments(std::string rid, std::string pid);
int mStart; /* start of rank list */
std::string mLinkId;
/* Worker Functions */
/* (1) Update Display */
/* (2) Utility Fns */
QTreeWidgetItem *getCurrentLine();
QTreeWidget *exampletreeWidget;
/** Qt Designer generated object */
Ui::LinksDialog ui;
};
#endif

View File

@ -0,0 +1,588 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LinksDialog</class>
<widget class="QWidget" name="LinksDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>738</width>
<height>583</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QGridLayout">
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="1" column="0" colspan="3">
<widget class="QSplitter" name="msgSplitter">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QGridLayout">
<item row="0" column="0" colspan="13">
<widget class="QTreeWidget" name="linkTreeWidget">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<column>
<property name="text">
<string>Title / Comment</string>
</property>
</column>
<column>
<property name="text">
<string>Score</string>
</property>
</column>
<column>
<property name="text">
<string>Peer / Link</string>
</property>
</column>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="expandButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/edit_remove24.png</normaloff>:/images/edit_remove24.png</iconset>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Sort by</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QComboBox" name="rankComboBox">
<item>
<property name="text">
<string>Combo</string>
</property>
</item>
<item>
<property name="text">
<string>Time</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/kalarm.png</normaloff>:/images/kalarm.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Ranking</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/records.png</normaloff>:/images/records.png</iconset>
</property>
</item>
</widget>
</item>
<item row="3" column="4">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="5">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>In last</string>
</property>
</widget>
</item>
<item row="3" column="6">
<widget class="QComboBox" name="periodComboBox">
<item>
<property name="text">
<string>Month</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/view_calendar_month.png</normaloff>:/images/view_calendar_month.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Week</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/view_calendar_week.png</normaloff>:/images/view_calendar_week.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Day</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/view_calendar_day.png</normaloff>:/images/view_calendar_day.png</iconset>
</property>
</item>
</widget>
</item>
<item row="3" column="7">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="8">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>From</string>
</property>
</widget>
</item>
<item row="3" column="9">
<widget class="QComboBox" name="fromComboBox">
<item>
<property name="text">
<string>All Peers</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/user/friends24.png</normaloff>:/images/user/friends24.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Own Links</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/user/identity16.png</normaloff>:/images/user/identity16.png</iconset>
</property>
</item>
</widget>
</item>
<item row="3" column="10">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="11">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Show</string>
</property>
</widget>
</item>
<item row="3" column="12">
<widget class="QComboBox" name="topComboBox">
<item>
<property name="text">
<string>Top 100</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/records.png</normaloff>:/images/records.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>101-200</string>
</property>
</item>
<item>
<property name="text">
<string>201-300</string>
</property>
</item>
<item>
<property name="text">
<string>301-400</string>
</property>
</item>
<item>
<property name="text">
<string>401-500</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom 100</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1" colspan="12">
<widget class="QTextBrowser" name="linklabel">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QTextBrowser{border: 2px solid #CCCCCC;
border-radius: 10px;
background: white;}</string>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Link:</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_1">
<layout class="QVBoxLayout">
<item>
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>311</width>
<height>32</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="anonBox">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Add Anonymous Link</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string>Add Link/Comment</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Title:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="titleLineEdit">
<property name="styleSheet">
<string notr="true">QLineEdit{border: 2px solid #CCCCCC;
border-radius: 10px;
background: white;}</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Score:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="scoreBox">
<item>
<property name="text">
<string>+2 Great!</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating5.png</normaloff>:/images/filerating5.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>+1 Good</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating4.png</normaloff>:/images/filerating4.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>0 Okay</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating3.png</normaloff>:/images/filerating3.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>-1 Sux</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating2.png</normaloff>:/images/filerating2.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>-2 Bad Link</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/filerating1.png</normaloff>:/images/filerating1.png</iconset>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Url:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="linkLineEdit">
<property name="styleSheet">
<string notr="true">QLineEdit{border: 2px solid #CCCCCC;
border-radius: 10px;
background: white;}</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="linkTextEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QTextEdit{border: 2px solid #CCCCCC;
border-radius: 10px;
background: white;}</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QFrame" name="frame">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_1">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="linksiconlabel">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../retroshare-gui/src/gui/images.qrc">:/images/irkick.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Links Cloud&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>596</width>
<height>15</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="pushButton">
<property name="styleSheet">
<string notr="true">QPushButton:hover {
border: 1px solid #CCCCCC;
}</string>
</property>
<property name="text">
<string>Add new link</string>
</property>
<property name="icon">
<iconset resource="../../retroshare-gui/src/gui/images.qrc">
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../../retroshare-gui/src/gui/images.qrc"/>
<include location="images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,32 @@
//#include <QApplication>
//#include <QString>
//#include <QPushButton>
#include "LinksPlugin.h"
#include "LinksDialog.h"
QString
LinksPlugin::pluginDescription() const
{
QString res;
res = "Links Cloud plugin" ;
return res;
}
QString
LinksPlugin::pluginName() const
{
return "Links Cloud" ;
}
QWidget*
LinksPlugin::pluginWidget(QWidget * parent )
{
LinksDialog* window = new LinksDialog(parent);
return window;
}
Q_EXPORT_PLUGIN2(linkscloud_plugin, LinksPlugin)

View File

@ -0,0 +1,27 @@
#ifndef _LC_PLUGIN_H_
#define _LC_PLUGIN_H_
#include <QObject>
#include <QString>
#include <QWidget>
#include <PluginInterface.h>
#include <QDebug>
class LinksPlugin: public QObject, public PluginInterface
{
Q_OBJECT
Q_INTERFACES(PluginInterface)
public slots:
virtual QString pluginDescription() const ;
virtual QString pluginName() const ;
virtual QWidget* pluginWidget(QWidget * parent = 0) ;
};
#endif

View File

@ -0,0 +1,58 @@
#=== this part is common (similar) for all plugin projects =====================
TEMPLATE = lib
CONFIG += plugin release
# this is directory, where PluginInterface.h is located
INCLUDEPATH += ../
# and, the result (*.so or *.dll) should appear in this directory
DESTDIR = ../bin
OBJECTS_DIR = temp/obj
RCC_DIR = temp/qrc
UI_DIR = temp/ui
MOC_DIR = temp/moc
# the name of the result file;
TARGET = $$qtLibraryTarget(linkscloud_plugin)
HEADERS += ../PluginInterface.h \
LinksPlugin.h
SOURCES += LinksPlugin.cpp
#===============================================================================
INCLUDEPATH += ../../libretroshare/src/
#=== and here are definitions, specific for this program =======================
DEPENDPATH += . \
HEADERS += LinksDialog.h \
AddLinksDialog.h
FORMS += LinksDialog.ui \
AddLinksDialog.ui
SOURCES += LinksDialog.cpp \
AddLinksDialog.cpp
RESOURCES += ../../retroshare-gui/src/gui/images.qrc
#===============================================================================
win32 {
#LIBS += ../../libretroshare/src/lib/libretroshare.a
#LIBS += -L"../../../../lib"
#LIBS += -lssl -lcrypto -lgpgme -lpthreadGC2d -lminiupnpc -lz
#LIBS += -luuid -lole32 -liphlpapi -lcrypt32-cygwin -lgdi32
#LIBS += -lole32 -lwinmm
DEFINES += WINDOWS_SYS
#GPG_ERROR_DIR = ../../../../libgpg-error-1.7
#GPGME_DIR = ../../../../gpgme-1.1.8
#INCLUDEPATH += . $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src
}