├── images ├── dice.png └── irkick.png ├── gui ├── images │ ├── hot_24.png │ ├── hot_32.png │ ├── hot_48.png │ ├── hot_64.png │ ├── new_24.png │ ├── new_32.png │ ├── new_48.png │ ├── new_64.png │ ├── hot_128.png │ ├── hot_256.png │ ├── new_128.png │ ├── meshDemoc_128.png │ ├── meshDemoc_16.png │ ├── meshDemoc_24.png │ ├── meshDemoc_256.png │ ├── meshDemoc_32.png │ ├── meshDemoc_48.png │ ├── meshDemoc_64.png │ ├── meshDemoc_32_new.png │ ├── meshDemoc_add_24.png │ ├── meshDemoc_add_32.png │ ├── meshDemoc_add_48.png │ ├── meshDemoc_add_64.png │ ├── meshDemoc_add_128.png │ └── meshDemoc_add_256.png ├── MeshDemoc_images.qrc ├── MeshDemocUserNotify.h ├── MeshDemocGroupDialog.h ├── MeshDemocCreatePostDialog.h ├── MeshDemocUserNotify.cpp ├── MeshDemocItem.h ├── MeshDemocDialog.h ├── MeshDemocCreatePostDialog.cpp ├── MeshDemocListWidget.h ├── MeshDemocGroupDialog.cpp ├── MeshDemocDialog.cpp ├── MeshDemocCreatePostDialog.ui ├── MeshDemocListWidget.ui └── MeshDemocItem.cpp ├── lang ├── MeshDemoc_cs.qm ├── MeshDemoc_da.qm ├── MeshDemoc_de.qm ├── MeshDemoc_el.qm ├── MeshDemoc_en.qm ├── MeshDemoc_es.qm ├── MeshDemoc_fi.qm ├── MeshDemoc_fr.qm ├── MeshDemoc_hu.qm ├── MeshDemoc_it.qm ├── MeshDemoc_ko.qm ├── MeshDemoc_nl.qm ├── MeshDemoc_pl.qm ├── MeshDemoc_ru.qm ├── MeshDemoc_sv.qm ├── MeshDemoc_tr.qm ├── MeshDemoc_ja_JP.qm ├── MeshDemoc_zh_CN.qm ├── MeshDemoc_lang.qrc ├── MeshDemoc_da.ts ├── MeshDemoc_ja_JP.ts ├── MeshDemoc_zh_CN.ts ├── MeshDemoc_ru.ts ├── MeshDemoc_ko.ts ├── MeshDemoc_pl.ts ├── MeshDemoc_sv.ts └── MeshDemoc_cs.ts ├── README.md ├── topjcdialog.cpp ├── topjcdialog.h ├── MeshDemocPlugin.h ├── topjcdialog.ui ├── serialiser ├── rsmeshDemocitems.h └── rsmeshDemocitems.cc ├── MeshDemoc.pro ├── services ├── p3meshDemoc.h └── p3meshDemoc.cc ├── interface ├── rsmeshDemocVEG.h └── rsmeshDemoc.h └── MeshDemocPlugin.cpp /images/dice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/images/dice.png -------------------------------------------------------------------------------- /images/irkick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/images/irkick.png -------------------------------------------------------------------------------- /gui/images/hot_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/hot_24.png -------------------------------------------------------------------------------- /gui/images/hot_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/hot_32.png -------------------------------------------------------------------------------- /gui/images/hot_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/hot_48.png -------------------------------------------------------------------------------- /gui/images/hot_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/hot_64.png -------------------------------------------------------------------------------- /gui/images/new_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/new_24.png -------------------------------------------------------------------------------- /gui/images/new_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/new_32.png -------------------------------------------------------------------------------- /gui/images/new_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/new_48.png -------------------------------------------------------------------------------- /gui/images/new_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/new_64.png -------------------------------------------------------------------------------- /lang/MeshDemoc_cs.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_cs.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_da.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_da.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_de.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_de.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_el.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_el.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_en.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_en.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_es.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_es.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_fi.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_fi.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_fr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_fr.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_hu.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_hu.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_it.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_it.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_ko.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_ko.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_nl.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_nl.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_pl.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_pl.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_ru.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_ru.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_sv.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_sv.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_tr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_tr.qm -------------------------------------------------------------------------------- /gui/images/hot_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/hot_128.png -------------------------------------------------------------------------------- /gui/images/hot_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/hot_256.png -------------------------------------------------------------------------------- /gui/images/new_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/new_128.png -------------------------------------------------------------------------------- /lang/MeshDemoc_ja_JP.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_ja_JP.qm -------------------------------------------------------------------------------- /lang/MeshDemoc_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/lang/MeshDemoc_zh_CN.qm -------------------------------------------------------------------------------- /gui/images/meshDemoc_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_128.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_16.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_24.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_256.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_32.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_48.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_64.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_32_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_32_new.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_add_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_add_24.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_add_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_add_32.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_add_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_add_48.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_add_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_add_64.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_add_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_add_128.png -------------------------------------------------------------------------------- /gui/images/meshDemoc_add_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chozabu/MeshDemoc/master/gui/images/meshDemoc_add_256.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #MeshDemoc for Retroshare 2 | 3 | This is a clone of the internal service "Posted" from retroshare 4 | 5 | http://retroshare.org 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /topjcdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "topjcdialog.h" 2 | #include "ui_topjcdialog.h" 3 | 4 | /** Constructor 5 | LinksDialog::LinksDialog(RsPeers *peers, RsFiles *files, QWidget *parent) 6 | : MainPage(parent), mPeers(peers), mFiles(files) 7 | { 8 | 9 | }**/ 10 | 11 | TopJCDialog::TopJCDialog(QWidget *parent) : 12 | MainPage(parent), 13 | ui(new Ui::TopJCDialog) 14 | { 15 | ui->setupUi(this); 16 | } 17 | 18 | TopJCDialog::~TopJCDialog() 19 | { 20 | delete ui; 21 | } 22 | -------------------------------------------------------------------------------- /topjcdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef TOPJCDIALOG_H 2 | #define TOPJCDIALOG_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | #include 10 | 11 | namespace Ui { 12 | class TopJCDialog; 13 | } 14 | 15 | class TopJCDialog : public MainPage 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit TopJCDialog(QWidget *parent = 0); 21 | ~TopJCDialog(); 22 | 23 | private: 24 | Ui::TopJCDialog *ui; 25 | }; 26 | 27 | #endif // TOPJCDIALOG_H 28 | -------------------------------------------------------------------------------- /gui/MeshDemoc_images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/meshDemoc_16.png 4 | images/meshDemoc_24.png 5 | images/meshDemoc_32.png 6 | images/meshDemoc_48.png 7 | images/meshDemoc_64.png 8 | images/meshDemoc_add_24.png 9 | images/meshDemoc_add_32.png 10 | images/meshDemoc_add_64.png 11 | images/hot_24.png 12 | images/new_24.png 13 | images/meshDemoc_32_new.png 14 | 15 | 16 | -------------------------------------------------------------------------------- /lang/MeshDemoc_lang.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | MeshDemoc_cs.qm 4 | MeshDemoc_da.qm 5 | MeshDemoc_de.qm 6 | MeshDemoc_el.qm 7 | MeshDemoc_en.qm 8 | MeshDemoc_es.qm 9 | MeshDemoc_fi.qm 10 | MeshDemoc_fr.qm 11 | MeshDemoc_hu.qm 12 | MeshDemoc_it.qm 13 | MeshDemoc_ja_JP.qm 14 | MeshDemoc_ko.qm 15 | MeshDemoc_nl.qm 16 | MeshDemoc_pl.qm 17 | MeshDemoc_ru.qm 18 | MeshDemoc_sv.qm 19 | MeshDemoc_tr.qm 20 | MeshDemoc_zh_CN.qm 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /MeshDemocPlugin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class MeshDemocPlugin: public RsPlugin 7 | { 8 | public: 9 | MeshDemocPlugin() ; 10 | virtual ~MeshDemocPlugin() {} 11 | 12 | virtual RsCacheService *rs_cache_service() const ; 13 | //virtual RsPQIService * rs_pqi_service() const; 14 | 15 | virtual MainPage *qt_page() const ; 16 | virtual QIcon *qt_icon() const ; 17 | //virtual uint16_t rs_service_id() const { return RS_SERVICE_TYPE_RANK ; } 18 | virtual QTranslator *qt_translator(QApplication *app, const QString& languageCode, const QString& externalDir) const; 19 | 20 | virtual void getPluginVersion(int& major, int& minor, int &build, int& svn_rev) const ; 21 | virtual void setPlugInHandler(RsPluginHandler *pgHandler); 22 | 23 | virtual std::string configurationFileName() const { return std::string() ; } 24 | 25 | virtual std::string getShortPluginDescription() const ; 26 | virtual std::string getPluginName() const; 27 | virtual void setInterfaces(RsPlugInInterfaces& interfaces); 28 | private: 29 | mutable RsPluginHandler *mPlugInHandler; 30 | mutable RsFiles* mFiles; 31 | mutable RsPeers* mPeers; 32 | mutable MainPage* mainpage ; 33 | mutable QIcon* mIcon ; 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /gui/MeshDemocUserNotify.h: -------------------------------------------------------------------------------- 1 | /**************************************************************** 2 | * RetroShare is distributed under the following license: 3 | * 4 | * Copyright (C) 2014 RetroShare Team 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; either version 2 9 | * of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | ****************************************************************/ 21 | 22 | #ifndef MESH_DEMOCUSERNOTIFY_H 23 | #define MESH_DEMOCUSERNOTIFY_H 24 | 25 | #include "gui/gxs/GxsUserNotify.h" 26 | 27 | class MeshDemocUserNotify : public GxsUserNotify 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | MeshDemocUserNotify(RsGxsIfaceHelper *ifaceImpl, QObject *parent = 0); 33 | 34 | virtual bool hasSetting(QString *name, QString *group); 35 | 36 | private: 37 | virtual QIcon getIcon(); 38 | virtual QIcon getMainIcon(bool hasNew); 39 | virtual void iconClicked(); 40 | }; 41 | 42 | #endif // MESH_DEMOCUSERNOTIFY_H 43 | -------------------------------------------------------------------------------- /topjcdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | TopJCDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 70 20 | 90 21 | 256 22 | 192 23 | 24 | 25 | 26 | 27 | 28 | 29 | 80 30 | 40 31 | 241 32 | 41 33 | 34 | 35 | 36 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 37 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 38 | p, li { white-space: pre-wrap; } 39 | </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> 40 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hello Retro<img src=":/images/irkick.png" /></p></body></html> 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /gui/MeshDemocGroupDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Retroshare MeshDemoc 3 | * 4 | * Copyright 2012-2013 by Robert Fernie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License Version 2.1 as published by the Free Software Foundation. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | * USA. 19 | * 20 | * Please report all bugs and problems to "retroshare@lunamutt.com". 21 | * 22 | */ 23 | 24 | #ifndef _MESH_DEMOC_GROUP_DIALOG_H 25 | #define _MESH_DEMOC_GROUP_DIALOG_H 26 | 27 | #include "gui/gxs/GxsGroupDialog.h" 28 | #include 29 | 30 | class MeshDemocGroupDialog : public GxsGroupDialog 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | MeshDemocGroupDialog(TokenQueue *tokenQueue, QWidget *parent); 36 | MeshDemocGroupDialog(TokenQueue *tokenExternalQueue, RsTokenService *tokenService, Mode mode, RsGxsGroupId groupId, QWidget *parent); 37 | 38 | protected: 39 | virtual void initUi(); 40 | virtual QPixmap serviceImage(); 41 | virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta); 42 | virtual bool service_loadGroup(uint32_t token, Mode mode, RsGroupMetaData& groupMetaData, QString &description); 43 | virtual bool service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /gui/MeshDemocCreatePostDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Retroshare MeshDemoc 3 | * 4 | * Copyright 2012-2013 by Robert Fernie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License Version 2.1 as published by the Free Software Foundation. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | * USA. 19 | * 20 | * Please report all bugs and problems to "retroshare@lunamutt.com". 21 | * 22 | */ 23 | 24 | #ifndef MESH_DEMOCCREATEPOSTDIALOG_H 25 | #define MESH_DEMOCCREATEPOSTDIALOG_H 26 | 27 | #include 28 | #include "interface/rsmeshDemoc.h" 29 | 30 | class TokenQueue; 31 | 32 | namespace Ui { 33 | class MeshDemocCreatePostDialog; 34 | } 35 | 36 | class MeshDemocCreatePostDialog : public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | /*! 42 | * @param tokenQ parent callee token 43 | * @param meshDemoc 44 | */ 45 | explicit MeshDemocCreatePostDialog(TokenQueue* tokenQ, RsMeshDemoc* meshDemoc, const RsGxsGroupId& grpId, QWidget *parent = 0); 46 | ~MeshDemocCreatePostDialog(); 47 | 48 | private slots: 49 | void createPost(); 50 | 51 | private: 52 | QString mLink; 53 | QString mNotes; 54 | TokenQueue* mTokenQueue; 55 | RsMeshDemoc* mMeshDemoc; 56 | RsGxsGroupId mGrpId; 57 | 58 | Ui::MeshDemocCreatePostDialog *ui; 59 | }; 60 | 61 | #endif // MESH_DEMOCCREATEPOSTDIALOG_H 62 | -------------------------------------------------------------------------------- /gui/MeshDemocUserNotify.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************** 2 | * RetroShare is distributed under the following license: 3 | * 4 | * Copyright (C) 2014 RetroShare Team 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; either version 2 9 | * of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | ****************************************************************/ 21 | 22 | #include "MeshDemocUserNotify.h" 23 | #include "gui/MainWindow.h" 24 | 25 | MeshDemocUserNotify::MeshDemocUserNotify(RsGxsIfaceHelper *ifaceImpl, QObject *parent) : 26 | GxsUserNotify(ifaceImpl, parent) 27 | { 28 | } 29 | 30 | bool MeshDemocUserNotify::hasSetting(QString *name, QString *group) 31 | { 32 | if (name) *name = tr("MeshDemoc"); 33 | if (group) *group = "MeshDemoc"; 34 | 35 | return true; 36 | } 37 | 38 | QIcon MeshDemocUserNotify::getIcon() 39 | { 40 | return QIcon(":/images/meshDemoc_32.png"); 41 | } 42 | 43 | QIcon MeshDemocUserNotify::getMainIcon(bool hasNew) 44 | { 45 | return hasNew ? QIcon(":/images/meshDemoc_32_new.png") : QIcon(":/images/meshDemoc_32.png"); 46 | } 47 | 48 | void MeshDemocUserNotify::iconClicked() 49 | { 50 | MainWindow::showWindow(MainWindow::Posted); 51 | } 52 | -------------------------------------------------------------------------------- /serialiser/rsmeshDemocitems.h: -------------------------------------------------------------------------------- 1 | #ifndef RSMESH_DEMOCITEMS_H 2 | #define RSMESH_DEMOCITEMS_H 3 | 4 | #include "serialiser/rsserviceids.h" 5 | #include "serialiser/rsserial.h" 6 | //#include "serialiser/rstlvtypes.h" 7 | 8 | #include "serialiser/rsgxscommentitems.h" 9 | 10 | #include "serialiser/rsgxsitems.h" 11 | #include "interface/rsmeshDemoc.h" 12 | 13 | const uint16_t RS_SERVICE_GXS_TYPE_MESH_DEMOC = 0x0216; 14 | 15 | const uint8_t RS_PKT_SUBTYPE_MESH_DEMOC_GRP_ITEM = 0x02; 16 | const uint8_t RS_PKT_SUBTYPE_MESH_DEMOC_POST_ITEM = 0x03; 17 | 18 | class RsGxsMeshDemocGroupItem : public RsGxsGrpItem 19 | { 20 | public: 21 | RsGxsMeshDemocGroupItem() : RsGxsGrpItem(RS_SERVICE_GXS_TYPE_MESH_DEMOC, 22 | RS_PKT_SUBTYPE_MESH_DEMOC_GRP_ITEM) { return; } 23 | virtual ~RsGxsMeshDemocGroupItem() { return; } 24 | 25 | void clear(); 26 | std::ostream &print(std::ostream &out, uint16_t indent = 0); 27 | 28 | RsMeshDemocGroup mGroup; 29 | }; 30 | 31 | class RsGxsMeshDemocPostItem : public RsGxsMsgItem 32 | { 33 | public: 34 | RsGxsMeshDemocPostItem() : RsGxsMsgItem(RS_SERVICE_GXS_TYPE_MESH_DEMOC, 35 | RS_PKT_SUBTYPE_MESH_DEMOC_POST_ITEM) {return ; } 36 | virtual ~RsGxsMeshDemocPostItem() { return; } 37 | 38 | void clear(); 39 | std::ostream &print(std::ostream &out, uint16_t indent = 0); 40 | 41 | RsMeshDemocPost mPost; 42 | }; 43 | 44 | class RsGxsMeshDemocSerialiser : public RsGxsCommentSerialiser 45 | { 46 | 47 | public: 48 | 49 | RsGxsMeshDemocSerialiser() 50 | :RsGxsCommentSerialiser(RS_SERVICE_GXS_TYPE_MESH_DEMOC) 51 | { return; } 52 | 53 | virtual ~RsGxsMeshDemocSerialiser() { return; } 54 | 55 | uint32_t size(RsItem *item); 56 | bool serialise(RsItem *item, void *data, uint32_t *size); 57 | RsItem* deserialise(void *data, uint32_t *size); 58 | 59 | private: 60 | 61 | uint32_t sizeGxsMeshDemocGroupItem(RsGxsMeshDemocGroupItem* item); 62 | bool serialiseGxsMeshDemocGroupItem(RsGxsMeshDemocGroupItem* item, void* data, uint32_t *size); 63 | RsGxsMeshDemocGroupItem* deserialiseGxsMeshDemocGroupItem(void *data, uint32_t *size); 64 | 65 | uint32_t sizeGxsMeshDemocPostItem(RsGxsMeshDemocPostItem* item); 66 | bool serialiseGxsMeshDemocPostItem(RsGxsMeshDemocPostItem* item, void* data, uint32_t *size); 67 | RsGxsMeshDemocPostItem* deserialiseGxsMeshDemocPostItem(void *data, uint32_t *size); 68 | }; 69 | 70 | 71 | #endif // RSMESH_DEMOCITEMS_H 72 | -------------------------------------------------------------------------------- /MeshDemoc.pro: -------------------------------------------------------------------------------- 1 | !include("../Common/retroshare_plugin.pri"): error("Could not include file ../Common/retroshare_plugin.pri") 2 | 3 | CONFIG += qt uic qrc resources 4 | QT += network xml script 5 | INCLUDEPATH += ../../retroshare-gui/src/retroshare-gui/ 6 | INCLUDEPATH += ../../retroshare-gui/src/temp/ui/ 7 | 8 | greaterThan(QT_MAJOR_VERSION, 4) { 9 | # Qt 5 10 | QT += widgets 11 | } 12 | DEFINES *= NO_SQLCIPHER 13 | SOURCES = topjcdialog.cpp \ 14 | gui/MeshDemocCreatePostDialog.cpp \ 15 | gui/MeshDemocDialog.cpp \ 16 | gui/MeshDemocGroupDialog.cpp \ 17 | gui/MeshDemocItem.cpp \ 18 | gui/MeshDemocListWidget.cpp \ 19 | gui/MeshDemocUserNotify.cpp \ 20 | services/p3meshDemoc.cc \ 21 | serialiser/rsmeshDemocitems.cc \ 22 | MeshDemocPlugin.cpp 23 | HEADERS = topjcdialog.h \ 24 | gui/MeshDemocCreatePostDialog.h \ 25 | gui/MeshDemocDialog.h \ 26 | gui/MeshDemocGroupDialog.h \ 27 | gui/MeshDemocItem.h \ 28 | gui/MeshDemocListWidget.h \ 29 | gui/MeshDemocUserNotify.h \ 30 | interface/rsmeshDemoc.h \ 31 | interface/rsmeshDemocVEG.h \ 32 | services/p3meshDemoc.h \ 33 | serialiser/rsmeshDemocitems.h \ 34 | MeshDemocPlugin.h 35 | FORMS = \ 36 | topjcdialog.ui \ 37 | gui/MeshDemocCreatePostDialog.ui \ 38 | gui/MeshDemocItem.ui \ 39 | gui/MeshDemocListWidget.ui 40 | 41 | TARGET = MeshDemoc 42 | 43 | RESOURCES = MeshDemoc_images.qrc lang/MeshDemoc_lang.qrc \ 44 | gui/MeshDemoc_images.qrc 45 | 46 | TRANSLATIONS += \ 47 | lang/MeshDemoc_cs.ts \ 48 | lang/MeshDemoc_da.ts \ 49 | lang/MeshDemoc_de.ts \ 50 | lang/MeshDemoc_el.ts \ 51 | lang/MeshDemoc_en.ts \ 52 | lang/MeshDemoc_es.ts \ 53 | lang/MeshDemoc_fi.ts \ 54 | lang/MeshDemoc_fr.ts \ 55 | lang/MeshDemoc_hu.ts \ 56 | lang/MeshDemoc_it.ts \ 57 | lang/MeshDemoc_ja_JP.ts \ 58 | lang/MeshDemoc_ko.ts \ 59 | lang/MeshDemoc_nl.ts \ 60 | lang/MeshDemoc_pl.ts \ 61 | lang/MeshDemoc_ru.ts \ 62 | lang/MeshDemoc_sv.ts \ 63 | lang/MeshDemoc_tr.ts \ 64 | lang/MeshDemoc_zh_CN.ts 65 | 66 | OTHER_FILES += \ 67 | testit.sh 68 | -------------------------------------------------------------------------------- /gui/MeshDemocItem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Retroshare MeshDemoc Plugin. 3 | * 4 | * Copyright 2012-2012 by Robert Fernie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License Version 2.1 as published by the Free Software Foundation. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | * USA. 19 | * 20 | * Please report all bugs and problems to "retroshare@lunamutt.com". 21 | * 22 | */ 23 | 24 | #ifndef MRK_MESH_DEMOC_MESH_DEMOC_ITEM_H 25 | #define MRK_MESH_DEMOC_MESH_DEMOC_ITEM_H 26 | 27 | #include 28 | 29 | #include 30 | #include "gui/gxs/GxsFeedItem.h" 31 | 32 | namespace Ui { 33 | class MeshDemocItem; 34 | } 35 | 36 | class RsMeshDemocPost; 37 | 38 | class MeshDemocItem : public GxsFeedItem 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | MeshDemocItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate); 44 | MeshDemocItem(FeedHolder *parent, uint32_t feedId, const RsMeshDemocGroup &group, const RsMeshDemocPost &post, bool isHome, bool autoUpdate); 45 | MeshDemocItem(FeedHolder *parent, uint32_t feedId, const RsMeshDemocPost &post, bool isHome, bool autoUpdate); 46 | virtual ~MeshDemocItem(); 47 | 48 | bool setGroup(const RsMeshDemocGroup& group, bool doFill = true); 49 | bool setPost(const RsMeshDemocPost& post, bool doFill = true); 50 | 51 | const RsMeshDemocPost &getPost() const; 52 | RsMeshDemocPost &post(); 53 | 54 | protected: 55 | /* FeedItem */ 56 | virtual void doExpand(bool /*open*/) {} 57 | 58 | private slots: 59 | void loadComments(); 60 | void makeUpVote(); 61 | void makeDownVote(); 62 | void readToggled(bool checked); 63 | void readAndClearItem(); 64 | 65 | signals: 66 | void vote(const RsGxsGrpMsgIdPair& msgId, bool up); 67 | 68 | protected: 69 | /* GxsGroupFeedItem */ 70 | virtual QString groupName(); 71 | virtual void loadGroup(const uint32_t &token); 72 | virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_UNKNOWN; } 73 | 74 | /* GxsFeedItem */ 75 | virtual void loadMessage(const uint32_t &token); 76 | virtual QString messageName(); 77 | 78 | private: 79 | void setup(); 80 | void fill(); 81 | void setReadStatus(bool isNew, bool isUnread); 82 | 83 | private: 84 | bool mInFill; 85 | 86 | RsMeshDemocGroup mGroup; 87 | RsMeshDemocPost mPost; 88 | 89 | /** Qt Designer generated object */ 90 | Ui::MeshDemocItem *ui; 91 | }; 92 | 93 | Q_DECLARE_METATYPE(RsMeshDemocPost) 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /gui/MeshDemocDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Retroshare MeshDemoc Dialog 3 | * 4 | * Copyright 2012-2012 by Robert Fernie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License Version 2.1 as published by the Free Software Foundation. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | * USA. 19 | * 20 | * Please report all bugs and problems to "retroshare@lunamutt.com". 21 | * 22 | */ 23 | 24 | #ifndef MRK_MESH_DEMOC_DIALOG_H 25 | #define MRK_MESH_DEMOC_DIALOG_H 26 | 27 | #include "gui/gxs/GxsGroupFrameDialog.h" 28 | 29 | #define IMAGE_MESH_DEMOC ":/images/meshDemoc_32.png" 30 | 31 | class MeshDemocDialog : public GxsGroupFrameDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | /** Default Constructor */ 37 | MeshDemocDialog(QWidget *parent = 0); 38 | /** Default Destructor */ 39 | ~MeshDemocDialog(); 40 | 41 | virtual QIcon iconPixmap() const { return QIcon(IMAGE_MESH_DEMOC) ; } //MainPage 42 | virtual QString pageName() const { return tr("MeshDemoc") ; } //MainPage 43 | virtual QString helpText() const { return ""; } //MainPage 44 | 45 | virtual UserNotify *getUserNotify(QObject *parent); 46 | 47 | //virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req); 48 | 49 | protected: 50 | virtual QString getHelpString() const ; 51 | virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_UNKNOWN; } 52 | virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Posted; } 53 | virtual void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata); 54 | 55 | private: 56 | /* GxsGroupFrameDialog */ 57 | virtual QString text(TextType type); 58 | virtual QString icon(IconType type); 59 | virtual QString settingsGroupName() { return "MeshDemocDialog"; } 60 | virtual GxsGroupDialog *createNewGroupDialog(TokenQueue *tokenQueue); 61 | virtual GxsGroupDialog *createGroupDialog(TokenQueue *tokenQueue, RsTokenService *tokenService, GxsGroupDialog::Mode mode, RsGxsGroupId groupId); 62 | virtual int shareKeyType(); 63 | virtual GxsMessageFrameWidget *createMessageFrameWidget(const RsGxsGroupId &groupId); 64 | virtual RsGxsCommentService *getCommentService(); 65 | virtual QWidget *createCommentHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId); 66 | virtual uint32_t requestGroupSummaryType() { return GXS_REQUEST_TYPE_GROUP_DATA; } // request complete group data 67 | virtual void loadGroupSummaryToken(const uint32_t &token, std::list &groupInfo, RsUserdata* &userdata); 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /gui/MeshDemocCreatePostDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Retroshare MeshDemoc 3 | * 4 | * Copyright 2012-2013 by Robert Fernie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License Version 2.1 as published by the Free Software Foundation. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | * USA. 19 | * 20 | * Please report all bugs and problems to "retroshare@lunamutt.com". 21 | * 22 | */ 23 | 24 | #include 25 | #include "MeshDemocCreatePostDialog.h" 26 | #include "ui_MeshDemocCreatePostDialog.h" 27 | 28 | #include "util/TokenQueue.h" 29 | 30 | #include 31 | 32 | MeshDemocCreatePostDialog::MeshDemocCreatePostDialog(TokenQueue* tokenQ, RsMeshDemoc *meshDemoc, const RsGxsGroupId& grpId, QWidget *parent): 33 | QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), 34 | mTokenQueue(tokenQ), mMeshDemoc(meshDemoc), mGrpId(grpId), 35 | ui(new Ui::MeshDemocCreatePostDialog) 36 | { 37 | ui->setupUi(this); 38 | 39 | connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost())); 40 | connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); 41 | 42 | ui->headerFrame->setHeaderImage(QPixmap(":/images/meshDemoc_64.png")); 43 | ui->headerFrame->setHeaderText(tr("Submit a new Post")); 44 | 45 | setAttribute ( Qt::WA_DeleteOnClose, true ); 46 | 47 | /* fill in the available OwnIds for signing */ 48 | ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, RsGxsId()); 49 | } 50 | 51 | MeshDemocCreatePostDialog::~MeshDemocCreatePostDialog() 52 | { 53 | delete ui; 54 | } 55 | 56 | void MeshDemocCreatePostDialog::createPost() 57 | { 58 | RsGxsId authorId; 59 | switch (ui->idChooser->getChosenId(authorId)) { 60 | case GxsIdChooser::KnowId: 61 | case GxsIdChooser::UnKnowId: 62 | break; 63 | case GxsIdChooser::NoId: 64 | case GxsIdChooser::None: 65 | default: 66 | std::cerr << "MeshDemocCreatePostDialog::createPost() ERROR GETTING AuthorId!, Post Failed"; 67 | std::cerr << std::endl; 68 | 69 | QMessageBox::warning(this, tr("RetroShare"),tr("Please create or choose a Signing Id first"), QMessageBox::Ok, QMessageBox::Ok); 70 | 71 | return; 72 | }//switch (ui->idChooser->getChosenId(authorId)) 73 | 74 | RsMeshDemocPost post; 75 | post.mMeta.mGroupId = mGrpId; 76 | post.mLink = std::string(ui->linkEdit->text().toUtf8()); 77 | post.mNotes = std::string(ui->notesTextEdit->toPlainText().toUtf8()); 78 | post.mMeta.mMsgName = std::string(ui->titleEdit->text().toUtf8()); 79 | post.mMeta.mAuthorId = authorId; 80 | 81 | if(ui->titleEdit->text().isEmpty()) { 82 | /* error message */ 83 | QMessageBox::warning(this, "RetroShare", tr("Please add a Title"), QMessageBox::Ok, QMessageBox::Ok); 84 | return; //Don't add a empty title!! 85 | }//if(ui->titleEdit->text().isEmpty()) 86 | 87 | uint32_t token; 88 | mMeshDemoc->createPost(token, post); 89 | // mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, TOKEN_USER_TYPE_POST); 90 | 91 | accept(); 92 | } 93 | -------------------------------------------------------------------------------- /gui/MeshDemocListWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Retroshare MeshDemoc List 3 | * 4 | * Copyright 2012-2012 by Robert Fernie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License Version 2.1 as published by the Free Software Foundation. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | * USA. 19 | * 20 | * Please report all bugs and problems to "retroshare@lunamutt.com". 21 | * 22 | */ 23 | 24 | #ifndef MESH_DEMOC_LIST_WIDGET_H 25 | #define MESH_DEMOC_LIST_WIDGET_H 26 | 27 | #include 28 | 29 | #include "gui/gxs/GxsMessageFramePostWidget.h" 30 | #include "gui/feeds/FeedHolder.h" 31 | 32 | class RsMeshDemocGroup; 33 | class RsMeshDemocPost; 34 | class MeshDemocItem; 35 | 36 | namespace Ui { 37 | class MeshDemocListWidget; 38 | } 39 | 40 | class MeshDemocListWidget : public GxsMessageFramePostWidget, public FeedHolder 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | MeshDemocListWidget(const RsGxsGroupId &meshDemocId, QWidget *parent = 0); 46 | ~MeshDemocListWidget(); 47 | 48 | /* GxsMessageFrameWidget */ 49 | virtual QIcon groupIcon(); 50 | 51 | /* FeedHolder */ 52 | virtual QScrollArea *getScrollArea(); 53 | virtual void deleteFeedItem(QWidget *item, uint32_t type); 54 | virtual void openChat(const RsPeerId& peerId); 55 | virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title); 56 | 57 | /* GXS functions */ 58 | virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req); 59 | 60 | protected: 61 | /* GxsMessageFramePostWidget */ 62 | virtual bool insertGroupData(const uint32_t &token, RsGroupMetaData &metaData); 63 | virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread); 64 | virtual void insertPosts(const uint32_t &token); 65 | virtual void insertRelatedPosts(const uint32_t &token); 66 | virtual void clearPosts(); 67 | virtual bool navigatePostItem(const RsGxsMessageId& msgId); 68 | 69 | /* GxsMessageFrameWidget */ 70 | virtual void setAllMessagesReadDo(bool read, uint32_t &token); 71 | 72 | private slots: 73 | void newPost(); 74 | 75 | void submitVote(const RsGxsGrpMsgIdPair& msgId, bool up); 76 | 77 | void getRankings(); 78 | 79 | void subscribeGroup(bool subscribe); 80 | 81 | void showNext(); 82 | void showPrev(); 83 | 84 | private: 85 | void processSettings(bool load); 86 | void updateShowText(); 87 | 88 | /*! 89 | * Only removes it from layout 90 | */ 91 | void shallowClearPosts(); 92 | 93 | void loadPost(const RsMeshDemocPost &post); 94 | 95 | void insertMeshDemocDetails(const RsMeshDemocGroup &group); 96 | 97 | // subscribe/unsubscribe ack. 98 | // void acknowledgeSubscribeChange(const uint32_t &token); 99 | 100 | // votes 101 | void acknowledgeVoteMsg(const uint32_t& token); 102 | void loadVoteData(const uint32_t &token); 103 | 104 | // ranking 105 | //void loadRankings(const uint32_t& token); 106 | //void applyRanking(const MeshDemocRanking& ranks); 107 | void applyRanking(); 108 | 109 | private: 110 | int mSortMethod; 111 | int mLastSortMethod; 112 | int mPostIndex; 113 | int mPostShow; 114 | 115 | uint32_t mTokenTypeVote; 116 | 117 | QMap mPosts; 118 | QList mPostItems; 119 | 120 | /* UI - from Designer */ 121 | Ui::MeshDemocListWidget *ui; 122 | }; 123 | 124 | #endif 125 | -------------------------------------------------------------------------------- /services/p3meshDemoc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libretroshare/src/services: p3meshDemoc.h 3 | * 4 | * GxsChannel interface for RetroShare. 5 | * 6 | * Copyright 2012-2013 by Robert Fernie. 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Library General Public 10 | * License Version 2.1 as published by the Free Software Foundation. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 20 | * USA. 21 | * 22 | * Please report all bugs and problems to "retroshare@lunamutt.com". 23 | * 24 | */ 25 | 26 | #ifndef P3_MESH_DEMOC_SERVICE_HEADER 27 | #define P3_MESH_DEMOC_SERVICE_HEADER 28 | 29 | 30 | #include "interface/rsmeshDemoc.h" 31 | #include "services/p3postbase.h" 32 | 33 | #include 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | /* 40 | * 41 | */ 42 | 43 | const uint16_t RS_SERVICE_TYPE_MESH_DEMOC = 0xf555; 44 | 45 | class p3MeshDemoc: public p3PostBase, public RsMeshDemoc 46 | { 47 | public: 48 | 49 | p3MeshDemoc(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs); 50 | virtual RsServiceInfo getServiceInfo(); 51 | 52 | protected: 53 | 54 | virtual void notifyChanges(std::vector& changes) 55 | { 56 | return p3PostBase::notifyChanges(changes); 57 | } 58 | 59 | public: 60 | 61 | virtual void receiveHelperChanges(std::vector& changes) 62 | { 63 | return RsGxsIfaceHelper::receiveChanges(changes); 64 | } 65 | 66 | // MeshDemoc Specific DataTypes. 67 | virtual bool getGroupData(const uint32_t &token, std::vector &groups); 68 | virtual bool getPostData(const uint32_t &token, std::vector &posts); 69 | virtual bool getRelatedPosts(const uint32_t &token, std::vector &posts); 70 | 71 | virtual bool createGroup(uint32_t &token, RsMeshDemocGroup &group); 72 | virtual bool createPost(uint32_t &token, RsMeshDemocPost &post); 73 | 74 | virtual bool updateGroup(uint32_t &token, RsMeshDemocGroup &group); 75 | virtual bool groupShareKeys(const RsGxsGroupId &group, const std::set& peers); 76 | 77 | ////////////////////////////////////////////////////////////////////////////// 78 | // WRAPPERS due to the separate Interface. 79 | 80 | virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) 81 | { 82 | return p3PostBase::setMessageReadStatus(token, msgId, read); 83 | } 84 | 85 | 86 | /* Comment service - Provide RsGxsCommentService - redirect to p3GxsCommentService */ 87 | virtual bool getCommentData(const uint32_t &token, std::vector &msgs) 88 | { 89 | return mCommentService->getGxsCommentData(token, msgs); 90 | } 91 | 92 | virtual bool getRelatedComments(const uint32_t &token, std::vector &msgs) 93 | { 94 | return mCommentService->getGxsRelatedComments(token, msgs); 95 | } 96 | 97 | virtual bool createComment(uint32_t &token, RsGxsComment &msg) 98 | { 99 | return mCommentService->createGxsComment(token, msg); 100 | } 101 | 102 | virtual bool createVote(uint32_t &token, RsGxsVote &msg) 103 | { 104 | return mCommentService->createGxsVote(token, msg); 105 | } 106 | 107 | virtual bool acknowledgeComment(const uint32_t& token, std::pair& msgId) 108 | { 109 | return acknowledgeMsg(token, msgId); 110 | } 111 | 112 | virtual bool acknowledgeVote(const uint32_t& token, std::pair& msgId) 113 | { 114 | if (mCommentService->acknowledgeVote(token, msgId)) 115 | { 116 | return true; 117 | } 118 | return acknowledgeMsg(token, msgId); 119 | } 120 | }; 121 | 122 | #endif 123 | -------------------------------------------------------------------------------- /interface/rsmeshDemocVEG.h: -------------------------------------------------------------------------------- 1 | #ifndef RETROSHARE_MESH_DEMOC_GUI_INTERFACE_H 2 | #define RETROSHARE_MESH_DEMOC_GUI_INTERFACE_H 3 | 4 | /* 5 | * libretroshare/src/retroshare: rsmeshDemoc.h 6 | * 7 | * RetroShare C++ Interface. 8 | * 9 | * Copyright 2008-2012 by Robert Fernie. 10 | * 11 | * This library is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Library General Public 13 | * License Version 2 as published by the Free Software Foundation. 14 | * 15 | * This library is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Library General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Library General Public 21 | * License along with this library; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | * USA. 24 | * 25 | * Please report all bugs and problems to "retroshare@lunamutt.com". 26 | * 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | /* The Main Interface Class - for information about your Peers */ 35 | class RsMeshDemocVEG; 36 | extern RsMeshDemocVEG *rsMeshDemocVEG; 37 | 38 | 39 | class RsMeshDemocGroup 40 | { 41 | public: 42 | RsGroupMetaData mMeta; 43 | RsMeshDemocGroup() { return; } 44 | }; 45 | 46 | class RsMeshDemocMsg 47 | { 48 | public: 49 | RsMeshDemocMsg(uint32_t t) 50 | :meshDemocType(t) { return; } 51 | 52 | RsMsgMetaData mMeta; 53 | uint32_t meshDemocType; 54 | }; 55 | 56 | #define RSMESH_DEMOC_MSGTYPE_POST 0x0001 57 | #define RSMESH_DEMOC_MSGTYPE_VOTE 0x0002 58 | #define RSMESH_DEMOC_MSGTYPE_COMMENT 0x0004 59 | 60 | #define RSMESH_DEMOC_PERIOD_YEAR 1 61 | #define RSMESH_DEMOC_PERIOD_MONTH 2 62 | #define RSMESH_DEMOC_PERIOD_WEEK 3 63 | #define RSMESH_DEMOC_PERIOD_DAY 4 64 | #define RSMESH_DEMOC_PERIOD_HOUR 5 65 | 66 | #define RSMESH_DEMOC_VIEWMODE_LATEST 1 67 | #define RSMESH_DEMOC_VIEWMODE_TOP 2 68 | #define RSMESH_DEMOC_VIEWMODE_HOT 3 69 | #define RSMESH_DEMOC_VIEWMODE_COMMENTS 4 70 | 71 | 72 | class RsMeshDemocPost: public RsMeshDemocMsg 73 | { 74 | public: 75 | RsMeshDemocPost(): RsMeshDemocMsg(RSMESH_DEMOC_MSGTYPE_POST) 76 | { 77 | mMeta.mMsgFlags = RSMESH_DEMOC_MSGTYPE_POST; 78 | return; 79 | } 80 | 81 | std::string mLink; 82 | std::string mNotes; 83 | }; 84 | 85 | 86 | class RsMeshDemocVote: public RsMeshDemocMsg 87 | { 88 | public: 89 | RsMeshDemocVote(): RsMeshDemocMsg(RSMESH_DEMOC_MSGTYPE_VOTE) 90 | { 91 | mMeta.mMsgFlags = RSMESH_DEMOC_MSGTYPE_VOTE; 92 | return; 93 | } 94 | }; 95 | 96 | 97 | class RsMeshDemocComment: public RsMeshDemocMsg 98 | { 99 | public: 100 | RsMeshDemocComment(): RsMeshDemocMsg(RSMESH_DEMOC_MSGTYPE_COMMENT) 101 | { 102 | mMeta.mMsgFlags = RSMESH_DEMOC_MSGTYPE_COMMENT; 103 | return; 104 | } 105 | 106 | std::string mComment; 107 | }; 108 | 109 | 110 | std::ostream &operator<<(std::ostream &out, const RsMeshDemocGroup &group); 111 | std::ostream &operator<<(std::ostream &out, const RsMeshDemocPost &post); 112 | std::ostream &operator<<(std::ostream &out, const RsMeshDemocVote &vote); 113 | std::ostream &operator<<(std::ostream &out, const RsMeshDemocComment &comment); 114 | 115 | 116 | class RsMeshDemocVEG: public RsTokenServiceVEG 117 | { 118 | public: 119 | 120 | RsMeshDemocVEG() { return; } 121 | virtual ~RsMeshDemocVEG() { return; } 122 | 123 | /* Specific Service Data */ 124 | virtual bool getGroup(const uint32_t &token, RsMeshDemocGroup &group) = 0; 125 | virtual bool getPost(const uint32_t &token, RsMeshDemocPost &post) = 0; 126 | virtual bool getComment(const uint32_t &token, RsMeshDemocComment &comment) = 0; 127 | 128 | virtual bool submitGroup(uint32_t &token, RsMeshDemocGroup &group, bool isNew) = 0; 129 | virtual bool submitPost(uint32_t &token, RsMeshDemocPost &post, bool isNew) = 0; 130 | virtual bool submitVote(uint32_t &token, RsMeshDemocVote &vote, bool isNew) = 0; 131 | virtual bool submitComment(uint32_t &token, RsMeshDemocComment &comment, bool isNew) = 0; 132 | 133 | // Special Ranking Request. 134 | virtual bool requestRanking(uint32_t &token, std::string groupId) = 0; 135 | virtual bool getRankedPost(const uint32_t &token, RsMeshDemocPost &post) = 0; 136 | 137 | virtual bool extractMeshDemocCache(const std::string &str, uint32_t &votes, uint32_t &comments) = 0; 138 | 139 | 140 | // Control Ranking Calculations. 141 | virtual bool setViewMode(uint32_t mode) = 0; 142 | virtual bool setViewPeriod(uint32_t period) = 0; 143 | virtual bool setViewRange(uint32_t first, uint32_t count) = 0; 144 | 145 | // exposed for testing... 146 | virtual float calcPostScore(const RsMsgMetaData &meta) = 0; 147 | 148 | }; 149 | 150 | 151 | #endif 152 | -------------------------------------------------------------------------------- /interface/rsmeshDemoc.h: -------------------------------------------------------------------------------- 1 | #ifndef RETROSHARE_GXS_RSMESH_DEMOC_GUI_INTERFACE_H 2 | #define RETROSHARE_GXS_RSMESH_DEMOC_GUI_INTERFACE_H 3 | 4 | /* 5 | * libretroshare/src/retroshare: rsmeshDemoc.h 6 | * 7 | * RetroShare C++ Interface. 8 | * 9 | * Copyright 2008-2012 by Robert Fernie, Christopher Evi-Parker 10 | * 11 | * This library is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Library General Public 13 | * License Version 2.1 as published by the Free Software Foundation. 14 | * 15 | * This library is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Library General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Library General Public 21 | * License along with this library; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | * USA. 24 | * 25 | * Please report all bugs and problems to "retroshare@lunamutt.com". 26 | * 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include "retroshare/rstokenservice.h" 34 | #include "retroshare/rsgxsifacehelper.h" 35 | #include "retroshare/rsgxscommon.h" 36 | 37 | /* The Main Interface Class - for information about your MeshDemoc */ 38 | class RsMeshDemoc; 39 | extern RsMeshDemoc *rsMeshDemoc; 40 | 41 | class RsMeshDemocPost; 42 | class RsMeshDemocGroup 43 | { 44 | public: 45 | RsMeshDemocGroup() { return; } 46 | 47 | RsGroupMetaData mMeta; 48 | std::string mDescription; 49 | }; 50 | 51 | 52 | //#define RSMESH_DEMOC_MSGTYPE_POST 0x0001 53 | //#define RSMESH_DEMOC_MSGTYPE_VOTE 0x0002 54 | //#define RSMESH_DEMOC_MSGTYPE_COMMENT 0x0004 55 | 56 | #define RSMESH_DEMOC_PERIOD_YEAR 1 57 | #define RSMESH_DEMOC_PERIOD_MONTH 2 58 | #define RSMESH_DEMOC_PERIOD_WEEK 3 59 | #define RSMESH_DEMOC_PERIOD_DAY 4 60 | #define RSMESH_DEMOC_PERIOD_HOUR 5 61 | 62 | #define RSMESH_DEMOC_VIEWMODE_LATEST 1 63 | #define RSMESH_DEMOC_VIEWMODE_TOP 2 64 | #define RSMESH_DEMOC_VIEWMODE_HOT 3 65 | #define RSMESH_DEMOC_VIEWMODE_COMMENTS 4 66 | 67 | 68 | std::ostream &operator<<(std::ostream &out, const RsMeshDemocGroup &group); 69 | std::ostream &operator<<(std::ostream &out, const RsMeshDemocPost &post); 70 | 71 | 72 | class RsMeshDemoc : public RsGxsIfaceHelper, public RsGxsCommentService 73 | { 74 | public: 75 | 76 | enum RankType {TopRankType, HotRankType, NewRankType }; 77 | 78 | //static const uint32_t FLAG_MSGTYPE_POST; 79 | //static const uint32_t FLAG_MSGTYPE_MASK; 80 | 81 | RsMeshDemoc(RsGxsIface* gxs) : RsGxsIfaceHelper(gxs) { return; } 82 | virtual ~RsMeshDemoc() { return; } 83 | 84 | /* Specific Service Data */ 85 | virtual bool getGroupData(const uint32_t &token, std::vector &groups) = 0; 86 | virtual bool getPostData(const uint32_t &token, std::vector &posts) = 0; 87 | virtual bool getRelatedPosts(const uint32_t &token, std::vector &posts) = 0; 88 | 89 | /* From RsGxsCommentService */ 90 | //virtual bool getCommentData(const uint32_t &token, std::vector &comments) = 0; 91 | //virtual bool getRelatedComments(const uint32_t &token, std::vector &comments) = 0; 92 | //virtual bool createComment(uint32_t &token, RsGxsComment &comment) = 0; 93 | //virtual bool createVote(uint32_t &token, RsGxsVote &vote) = 0; 94 | 95 | ////////////////////////////////////////////////////////////////////////////// 96 | virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; 97 | 98 | virtual bool createGroup(uint32_t &token, RsMeshDemocGroup &group) = 0; 99 | virtual bool createPost(uint32_t &token, RsMeshDemocPost &post) = 0; 100 | 101 | virtual bool updateGroup(uint32_t &token, RsMeshDemocGroup &group) = 0; 102 | 103 | virtual bool groupShareKeys(const RsGxsGroupId& group,const std::set& peers) = 0 ; 104 | }; 105 | 106 | 107 | 108 | class RsMeshDemocPost 109 | { 110 | public: 111 | RsMeshDemocPost() 112 | { 113 | //mMeta.mMsgFlags = RsMeshDemoc::FLAG_MSGTYPE_POST; 114 | mUpVotes = 0; 115 | mDownVotes = 0; 116 | mComments = 0; 117 | mHaveVoted = false; 118 | 119 | mHotScore = 0; 120 | mTopScore = 0; 121 | mNewScore = 0; 122 | } 123 | 124 | bool calculateScores(time_t ref_time); 125 | 126 | RsMsgMetaData mMeta; 127 | std::string mLink; 128 | std::string mNotes; 129 | 130 | bool mHaveVoted; 131 | 132 | // Calculated. 133 | uint32_t mUpVotes; 134 | uint32_t mDownVotes; 135 | uint32_t mComments; 136 | 137 | 138 | // and Calculated Scores:??? 139 | double mHotScore; 140 | double mTopScore; 141 | double mNewScore; 142 | }; 143 | 144 | 145 | #endif // RETROSHARE_GXS_RSMESH_DEMOC_GUI_INTERFACE_H 146 | -------------------------------------------------------------------------------- /gui/MeshDemocGroupDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Retroshare MeshDemoc 3 | * 4 | * Copyright 2012-2013 by Robert Fernie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License Version 2.1 as published by the Free Software Foundation. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | * USA. 19 | * 20 | * Please report all bugs and problems to "retroshare@lunamutt.com". 21 | * 22 | */ 23 | 24 | #include "MeshDemocGroupDialog.h" 25 | 26 | #include 27 | #include 28 | 29 | const uint32_t MeshDemocCreateEnabledFlags = ( 30 | GXS_GROUP_FLAGS_NAME | 31 | // GXS_GROUP_FLAGS_ICON | 32 | GXS_GROUP_FLAGS_DESCRIPTION | 33 | GXS_GROUP_FLAGS_DISTRIBUTION | 34 | // GXS_GROUP_FLAGS_PUBLISHSIGN | 35 | GXS_GROUP_FLAGS_SHAREKEYS | 36 | // GXS_GROUP_FLAGS_PERSONALSIGN | 37 | // GXS_GROUP_FLAGS_COMMENTS | 38 | 0); 39 | 40 | uint32_t MeshDemocCreateDefaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC | 41 | //GXS_GROUP_DEFAULTS_DISTRIB_GROUP | 42 | //GXS_GROUP_DEFAULTS_DISTRIB_LOCAL | 43 | 44 | GXS_GROUP_DEFAULTS_PUBLISH_OPEN | 45 | //GXS_GROUP_DEFAULTS_PUBLISH_THREADS | 46 | //GXS_GROUP_DEFAULTS_PUBLISH_REQUIRED | 47 | //GXS_GROUP_DEFAULTS_PUBLISH_ENCRYPTED | 48 | 49 | //GXS_GROUP_DEFAULTS_PERSONAL_GPG | 50 | GXS_GROUP_DEFAULTS_PERSONAL_REQUIRED | 51 | //GXS_GROUP_DEFAULTS_PERSONAL_IFNOPUB | 52 | 53 | //GXS_GROUP_DEFAULTS_COMMENTS_YES | 54 | GXS_GROUP_DEFAULTS_COMMENTS_NO | 55 | 0); 56 | 57 | uint32_t MeshDemocEditEnabledFlags = MeshDemocCreateEnabledFlags; 58 | uint32_t MeshDemocEditDefaultsFlags = MeshDemocCreateDefaultsFlags; 59 | 60 | MeshDemocGroupDialog::MeshDemocGroupDialog(TokenQueue *tokenQueue, QWidget *parent) 61 | : GxsGroupDialog(tokenQueue, MeshDemocCreateEnabledFlags, MeshDemocCreateDefaultsFlags, parent) 62 | { 63 | } 64 | 65 | MeshDemocGroupDialog::MeshDemocGroupDialog(TokenQueue *tokenExternalQueue, RsTokenService *tokenService, Mode mode, RsGxsGroupId groupId, QWidget *parent) 66 | : GxsGroupDialog(tokenExternalQueue, tokenService, mode, groupId, MeshDemocEditEnabledFlags, MeshDemocEditDefaultsFlags, parent) 67 | { 68 | } 69 | 70 | void MeshDemocGroupDialog::initUi() 71 | { 72 | switch (mode()) 73 | { 74 | case MODE_CREATE: 75 | setUiText(UITYPE_SERVICE_HEADER, tr("Create New Topic")); 76 | setUiText(UITYPE_BUTTONBOX_OK, tr("Create")); 77 | break; 78 | case MODE_SHOW: 79 | setUiText(UITYPE_SERVICE_HEADER, tr("MeshDemoc Topic")); 80 | break; 81 | case MODE_EDIT: 82 | setUiText(UITYPE_SERVICE_HEADER, tr("Edit Topic")); 83 | setUiText(UITYPE_BUTTONBOX_OK, tr("Update Topic")); 84 | break; 85 | } 86 | 87 | setUiText(UITYPE_KEY_SHARE_CHECKBOX, tr("Add Topic Admins")); 88 | setUiText(UITYPE_CONTACTS_DOCK, tr("Select Topic Admins")); 89 | } 90 | 91 | QPixmap MeshDemocGroupDialog::serviceImage() 92 | { 93 | return QPixmap(":/images/meshDemoc_add_64.png"); 94 | } 95 | 96 | bool MeshDemocGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta) 97 | { 98 | // Specific Function. 99 | RsMeshDemocGroup grp; 100 | grp.mMeta = meta; 101 | grp.mDescription = getDescription().toStdString(); 102 | std::cerr << "MeshDemocGroupDialog::service_CreateGroup() storing to Queue"; 103 | std::cerr << std::endl; 104 | 105 | rsMeshDemoc->createGroup(token, grp); 106 | 107 | return true; 108 | } 109 | 110 | bool MeshDemocGroupDialog::service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta) 111 | { 112 | RsMeshDemocGroup grp; 113 | grp.mMeta = editedMeta; 114 | grp.mDescription = getDescription().toUtf8().constData(); 115 | 116 | std::cerr << "MeshDemocGroupDialog::service_EditGroup() submitting changes"; 117 | std::cerr << std::endl; 118 | 119 | rsMeshDemoc->updateGroup(token, grp); 120 | return true; 121 | } 122 | 123 | bool MeshDemocGroupDialog::service_loadGroup(uint32_t token, Mode /*mode*/, RsGroupMetaData& groupMetaData, QString &description) 124 | { 125 | std::cerr << "MeshDemocGroupDialog::service_loadGroup(" << token << ")"; 126 | std::cerr << std::endl; 127 | 128 | std::vector groups; 129 | if (!rsMeshDemoc->getGroupData(token, groups)) 130 | { 131 | std::cerr << "MeshDemocGroupDialog::service_loadGroup() Error getting GroupData"; 132 | std::cerr << std::endl; 133 | return false; 134 | } 135 | 136 | if (groups.size() != 1) 137 | { 138 | std::cerr << "MeshDemocGroupDialog::service_loadGroup() Error Group.size() != 1"; 139 | std::cerr << std::endl; 140 | return false; 141 | } 142 | 143 | std::cerr << "MeshDemocGroupDialog::service_loadGroup() Unfinished Loading"; 144 | std::cerr << std::endl; 145 | 146 | groupMetaData = groups[0].mMeta; 147 | description = QString::fromUtf8(groups[0].mDescription.c_str()); 148 | 149 | return true; 150 | } 151 | -------------------------------------------------------------------------------- /MeshDemocPlugin.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "MeshDemocPlugin.h" 7 | #include "gui/MeshDemocDialog.h" 8 | //#include "LinksDialog.h" 9 | #include "topjcdialog.h" 10 | #include 11 | 12 | #include "services/p3meshDemoc.h" 13 | #include "gxs/rsdataservice.h" 14 | #include "gxs/rsgxsnetservice.h" 15 | 16 | #include "rsserver/p3face.h" 17 | 18 | //static void *inited = new MeshDemocPlugin(); 19 | 20 | //inited->rs_cache_service(); 21 | 22 | extern "C" { 23 | void *RETROSHARE_PLUGIN_provide() 24 | { 25 | static MeshDemocPlugin *p = new MeshDemocPlugin() ; 26 | 27 | return (void*)p ; 28 | } 29 | 30 | // This symbol contains the svn revision number grabbed from the executable. 31 | // It will be tested by RS to load the plugin automatically, since it is safe to load plugins 32 | // with same revision numbers, assuming that the revision numbers are up-to-date. 33 | // 34 | uint32_t RETROSHARE_PLUGIN_revision = RS_REVISION_NUMBER ; 35 | 36 | // This symbol contains the svn revision number grabbed from the executable. 37 | // It will be tested by RS to load the plugin automatically, since it is safe to load plugins 38 | // with same revision numbers, assuming that the revision numbers are up-to-date. 39 | // 40 | uint32_t RETROSHARE_PLUGIN_api = RS_PLUGIN_API_VERSION ; 41 | } 42 | 43 | #define IMAGE_LINKS ":/images/dice.png" 44 | 45 | void MeshDemocPlugin::getPluginVersion(int& major, int& minor, int &build, int& svn_rev) const 46 | { 47 | major = RS_MAJOR_VERSION; 48 | minor = RS_MINOR_VERSION; 49 | build = RS_BUILD_NUMBER; 50 | svn_rev = RS_REVISION_NUMBER; 51 | } 52 | 53 | MeshDemocPlugin::MeshDemocPlugin() 54 | { 55 | //mRanking = NULL ; 56 | mainpage = NULL ; 57 | mIcon = NULL ; 58 | mPlugInHandler = NULL; 59 | mPeers = NULL; 60 | mFiles = NULL; 61 | } 62 | 63 | void MeshDemocPlugin::setInterfaces(RsPlugInInterfaces &interfaces){ 64 | 65 | mPeers = interfaces.mPeers; 66 | mFiles = interfaces.mFiles; 67 | 68 | /*std::cerr << "Starting p3WallService" << std::endl; 69 | std::string dataDir = interfaces.mGxsDir + "rssocialnet_v0"; 70 | RsDirUtil::checkCreateDirectory(dataDir); 71 | wall_ds = new RsDataService(dataDir, "wall_db", 72 | RsWall::RS_SERVICE_TYPE_WALL, NULL, "todo: encrypt db with secure password"); 73 | wall = new RsWall::p3WallService(wall_ds, NULL, interfaces.mGxsIdService, interfaces.mIdentity); 74 | wall_ns = new RsGxsNetService( 75 | RsWall::RS_SERVICE_TYPE_WALL, wall_ds, interfaces.mRsNxsNetMgr, 76 | wall, wall->getServiceInfo(), 77 | interfaces.mGxsIdService, interfaces.mGxsCirlces, interfaces.mPgpAuxUtils, 78 | true // group auto sync 79 | ); 80 | RsWall::rsWall = wall;*/ 81 | 82 | std::cerr << "Starting MeshDemoc service" << std::endl; 83 | std::string dataDir = interfaces.mGxsDir + "meshDemoc"; 84 | RsDirUtil::checkCreateDirectory(dataDir); 85 | RsGeneralDataService* wall_ds; 86 | wall_ds = new RsDataService(dataDir, "meshDemoc_db", 87 | RS_SERVICE_TYPE_MESH_DEMOC, NULL, "todo: encrypt db with secure password"); 88 | //wall = new RsWall::p3WallService(wall_ds, NULL, interfaces.mGxsIdService, interfaces.mIdentity); 89 | p3MeshDemoc *mMeshDemoc = new p3MeshDemoc(wall_ds, NULL, interfaces.mGxsIdService); 90 | //mMeshDemoc = new p3MeshDemoc(wall_ds, NULL, interfaces.mGxsIdService); 91 | RsGxsNetService *wall_ns = new RsGxsNetService( 92 | RS_SERVICE_TYPE_MESH_DEMOC, wall_ds, interfaces.mRsNxsNetMgr, 93 | mMeshDemoc, mMeshDemoc->getServiceInfo(), 94 | interfaces.mGxsIdService, interfaces.mGxsCirlces, interfaces.mPgpAuxUtils, 95 | true // group auto sync 96 | ); 97 | rsMeshDemoc = mMeshDemoc; 98 | mMeshDemoc->start(); 99 | wall_ns->start(); 100 | 101 | //mConfigMgr->addConfiguration("posted.cfg", wall_ns); 102 | //RsServer:: 103 | //RsServer::startServiceThread(mMeshDemoc); 104 | //RsServer::startServiceThread(wall_ns); 105 | } 106 | 107 | MainPage *MeshDemocPlugin::qt_page() const 108 | { 109 | if(mainpage == NULL) 110 | mainpage = new MeshDemocDialog(); 111 | 112 | return mainpage ; 113 | } 114 | 115 | RsCacheService *MeshDemocPlugin::rs_cache_service() const 116 | { 117 | /*if(mRanking == NULL) 118 | { 119 | mRanking = new p3Ranking(mPlugInHandler) ; // , 3600 * 24 * 30 * 6); // 6 Months 120 | rsRanks = mRanking ; 121 | } 122 | 123 | return mRanking ;*/ 124 | return NULL; 125 | } 126 | 127 | void MeshDemocPlugin::setPlugInHandler(RsPluginHandler *pgHandler){ 128 | mPlugInHandler = pgHandler; 129 | 130 | } 131 | 132 | QIcon *MeshDemocPlugin::qt_icon() const 133 | { 134 | if(mIcon == NULL) 135 | { 136 | Q_INIT_RESOURCE(MeshDemoc_images) ; 137 | 138 | mIcon = new QIcon(IMAGE_LINKS) ; 139 | } 140 | 141 | return mIcon ; 142 | } 143 | 144 | std::string MeshDemocPlugin::getShortPluginDescription() const 145 | { 146 | return "infosoon";//QApplication::translate("MeshDemocPlugin", "This plugin provides a set of cached links, and a voting system to promote them.").toUtf8().constData(); 147 | } 148 | 149 | std::string MeshDemocPlugin::getPluginName() const 150 | { 151 | return "MeshDemoc";//QApplication::translate("MeshDemocPlugin", "MeshDemoc").toUtf8().constData(); 152 | } 153 | 154 | QTranslator* MeshDemocPlugin::qt_translator(QApplication */*app*/, const QString& languageCode, const QString& externalDir) const 155 | { 156 | if (languageCode == "en") { 157 | return NULL; 158 | } 159 | 160 | QTranslator* translator = new QTranslator(); 161 | 162 | if (translator->load(externalDir + "/MeshDemoc_" + languageCode + ".qm")) { 163 | return translator; 164 | } else if (translator->load(":/lang/MeshDemoc_" + languageCode + ".qm")) { 165 | return translator; 166 | } 167 | 168 | delete(translator); 169 | return NULL; 170 | } 171 | -------------------------------------------------------------------------------- /gui/MeshDemocDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Retroshare MeshDemoc Dialog 3 | * 4 | * Copyright 2012-2012 by Robert Fernie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License Version 2.1 as published by the Free Software Foundation. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | * USA. 19 | * 20 | * Please report all bugs and problems to "retroshare@lunamutt.com". 21 | * 22 | */ 23 | 24 | #include "MeshDemocDialog.h" 25 | #include "MeshDemocItem.h" 26 | #include "MeshDemocGroupDialog.h" 27 | #include "MeshDemocListWidget.h" 28 | #include "MeshDemocUserNotify.h" 29 | #include "gui/gxs/GxsGroupShareKey.h" 30 | #include "gui/settings/rsharesettings.h" 31 | #include "gui/common/GroupTreeWidget.h" 32 | 33 | #include 34 | 35 | class MeshDemocGroupInfoData : public RsUserdata 36 | { 37 | public: 38 | MeshDemocGroupInfoData() : RsUserdata() {} 39 | 40 | public: 41 | QMap mDescription; 42 | }; 43 | 44 | /** Constructor */ 45 | MeshDemocDialog::MeshDemocDialog(QWidget *parent) 46 | : GxsGroupFrameDialog(rsMeshDemoc, parent) 47 | { 48 | } 49 | 50 | MeshDemocDialog::~MeshDemocDialog() 51 | { 52 | } 53 | 54 | UserNotify *MeshDemocDialog::getUserNotify(QObject *parent) 55 | { 56 | return new MeshDemocUserNotify(rsMeshDemoc, parent); 57 | } 58 | 59 | /*void MeshDemocDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req) 60 | { 61 | }*/ 62 | 63 | QString MeshDemocDialog::getHelpString() const 64 | { 65 | QString hlp_str = tr("

  MeshDemoc

\ 66 |

The meshDemoc service allows you to share internet links, that spread among Retroshare nodes like forums and \ 67 | channels

\ 68 |

Links can be commented by subscribed users. A promotion system also gives the opportunity to \ 69 | enlight important links.

\ 70 |

There is no restriction on which links are shared. Be careful when clicking on them.

\ 71 |

MeshDemoc links get deleted after %1 months.

\ 72 | ").arg(QString::number(rsMeshDemoc->getStoragePeriod())); 73 | 74 | return hlp_str ; 75 | } 76 | 77 | QString MeshDemocDialog::text(TextType type) 78 | { 79 | switch (type) { 80 | case TEXT_NAME: 81 | return tr("MeshDemoc Links"); 82 | case TEXT_NEW: 83 | return tr("Create Topic"); 84 | case TEXT_TODO: 85 | return "Open points:
    " 86 | "
  • Subreddits/tag to posts support" 87 | "
  • Picture Support" 88 | "
  • Navigate channel link" 89 | "
"; 90 | 91 | case TEXT_YOUR_GROUP: 92 | return tr("My Topics"); 93 | case TEXT_SUBSCRIBED_GROUP: 94 | return tr("Subscribed Topics"); 95 | case TEXT_POPULAR_GROUP: 96 | return tr("Popular Topics"); 97 | case TEXT_OTHER_GROUP: 98 | return tr("Other Topics"); 99 | } 100 | 101 | return ""; 102 | } 103 | 104 | QString MeshDemocDialog::icon(IconType type) 105 | { 106 | switch (type) { 107 | case ICON_NAME: 108 | return ":/images/meshDemoc_24.png"; 109 | case ICON_NEW: 110 | return ":/images/meshDemoc_add_24.png"; 111 | case ICON_YOUR_GROUP: 112 | return ":/images/folder16.png"; 113 | case ICON_SUBSCRIBED_GROUP: 114 | return ":/images/folder_red.png"; 115 | case ICON_POPULAR_GROUP: 116 | return ":/images/folder_green.png"; 117 | case ICON_OTHER_GROUP: 118 | return ":/images/folder_yellow.png"; 119 | case ICON_DEFAULT: 120 | return ""; 121 | } 122 | 123 | return ""; 124 | } 125 | 126 | GxsGroupDialog *MeshDemocDialog::createNewGroupDialog(TokenQueue *tokenQueue) 127 | { 128 | return new MeshDemocGroupDialog(tokenQueue, this); 129 | } 130 | 131 | GxsGroupDialog *MeshDemocDialog::createGroupDialog(TokenQueue *tokenQueue, RsTokenService *tokenService, GxsGroupDialog::Mode mode, RsGxsGroupId groupId) 132 | { 133 | return new MeshDemocGroupDialog(tokenQueue, tokenService, mode, groupId, this); 134 | } 135 | 136 | int MeshDemocDialog::shareKeyType() 137 | { 138 | return POSTED_KEY_SHARE; 139 | //return MESH_DEMOC_KEY_SHARE; 140 | } 141 | 142 | GxsMessageFrameWidget *MeshDemocDialog::createMessageFrameWidget(const RsGxsGroupId &groupId) 143 | { 144 | return new MeshDemocListWidget(groupId); 145 | } 146 | 147 | RsGxsCommentService *MeshDemocDialog::getCommentService() 148 | { 149 | return rsMeshDemoc; 150 | } 151 | 152 | QWidget *MeshDemocDialog::createCommentHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId) 153 | { 154 | return new MeshDemocItem(NULL, 0, grpId, msgId, true, false); 155 | } 156 | 157 | void MeshDemocDialog::loadGroupSummaryToken(const uint32_t &token, std::list &groupInfo, RsUserdata *&userdata) 158 | { 159 | std::cout << "meshdemoc: === loadGroupSummaryToken === \n"; 160 | std::vector groups; 161 | rsMeshDemoc->getGroupData(token, groups); 162 | 163 | /* Save groups to fill description */ 164 | MeshDemocGroupInfoData *meshDemocData = new MeshDemocGroupInfoData; 165 | int groupnum = groups.size(); 166 | if (groupnum > 0){ 167 | int a =0; 168 | }else { 169 | 170 | std::cout << "meshdemoc: no groups found \n"; 171 | } 172 | 173 | userdata = meshDemocData; 174 | 175 | std::vector::iterator groupIt; 176 | for (groupIt = groups.begin(); groupIt != groups.end(); ++groupIt) { 177 | RsMeshDemocGroup &group = *groupIt; 178 | groupInfo.push_back(group.mMeta); 179 | 180 | if (!group.mDescription.empty()) { 181 | meshDemocData->mDescription[group.mMeta.mGroupId] = QString::fromUtf8(group.mDescription.c_str()); 182 | } 183 | } 184 | } 185 | 186 | void MeshDemocDialog::groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata) 187 | { 188 | GxsGroupFrameDialog::groupInfoToGroupItemInfo(groupInfo, groupItemInfo, userdata); 189 | 190 | const MeshDemocGroupInfoData *meshDemocData = dynamic_cast(userdata); 191 | if (!meshDemocData) { 192 | std::cerr << "MeshDemocDialog::groupInfoToGroupItemInfo() Failed to cast data to MeshDemocGroupInfoData"; 193 | std::cerr << std::endl; 194 | return; 195 | } 196 | 197 | QMap::const_iterator descriptionIt = meshDemocData->mDescription.find(groupInfo.mGroupId); 198 | if (descriptionIt != meshDemocData->mDescription.end()) { 199 | groupItemInfo.description = descriptionIt.value(); 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /gui/MeshDemocCreatePostDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MeshDemocCreatePostDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 575 10 | 371 11 | 12 | 13 | 14 | Submit Post 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 0 22 | 23 | 24 | 25 | 26 | QFrame::NoFrame 27 | 28 | 29 | QFrame::Plain 30 | 31 | 32 | 33 | 34 | 35 | 36 | QFrame::StyledPanel 37 | 38 | 39 | QFrame::Raised 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 255 51 | 255 52 | 255 53 | 54 | 55 | 56 | 57 | 58 | 59 | 255 60 | 255 61 | 178 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 255 71 | 255 72 | 255 73 | 74 | 75 | 76 | 77 | 78 | 79 | 255 80 | 255 81 | 178 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 255 91 | 255 92 | 178 93 | 94 | 95 | 96 | 97 | 98 | 99 | 255 100 | 255 101 | 178 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | true 110 | 111 | 112 | QFrame::Box 113 | 114 | 115 | You are submitting a link. The key to a successful submission is interesting content and a descriptive title. 116 | 117 | 118 | true 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | Title 131 | 132 | 133 | 134 | 135 | 136 | 137 | Link 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | Qt::Horizontal 152 | 153 | 154 | QSizePolicy::MinimumExpanding 155 | 156 | 157 | 158 | 78 159 | 17 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | Signed by: 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | Notes 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | Qt::Horizontal 194 | 195 | 196 | 197 | 40 198 | 20 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | Submit 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 0 215 | 0 216 | 217 | 218 | 219 | Qt::Horizontal 220 | 221 | 222 | QDialogButtonBox::Cancel 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | HeaderFrame 234 | QFrame 235 |
gui/common/HeaderFrame.h
236 | 1 237 |
238 | 239 | GxsIdChooser 240 | QComboBox 241 |
gui/gxs/GxsIdChooser.h
242 |
243 | 244 | StyledLabel 245 | QLabel 246 |
gui/common/StyledLabel.h
247 |
248 |
249 | 250 | 251 | 252 | 253 | 254 | buttonBox 255 | rejected() 256 | MeshDemocCreatePostDialog 257 | reject() 258 | 259 | 260 | 316 261 | 260 262 | 263 | 264 | 286 265 | 274 266 | 267 | 268 | 269 | 270 |
271 | -------------------------------------------------------------------------------- /gui/MeshDemocListWidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MeshDemocListWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 761 10 | 428 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 22 | 23 | 6 24 | 25 | 26 | 6 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 6 35 | 36 | 37 | 6 38 | 39 | 40 | 0 41 | 42 | 43 | 6 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | 52 | 0 53 | 0 54 | 55 | 56 | 57 | Subscribe 58 | 59 | 60 | true 61 | 62 | 63 | 64 | 65 | 66 | 67 | Submit a new Post 68 | 69 | 70 | 71 | :/images/meshDemoc_24.png:/images/meshDemoc_24.png 72 | 73 | 74 | Qt::ToolButtonTextBesideIcon 75 | 76 | 77 | true 78 | 79 | 80 | 81 | 82 | 83 | 84 | Qt::Horizontal 85 | 86 | 87 | 88 | 40 89 | 20 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | Hot 98 | 99 | 100 | 101 | 102 | 103 | 104 | :/images/hot_24.png:/images/hot_24.png 105 | 106 | 107 | 108 | 24 109 | 24 110 | 111 | 112 | 113 | true 114 | 115 | 116 | true 117 | 118 | 119 | 120 | 121 | 122 | 123 | New 124 | 125 | 126 | 127 | 128 | 129 | 130 | :/images/new_24.png:/images/new_24.png 131 | 132 | 133 | 134 | 24 135 | 24 136 | 137 | 138 | 139 | true 140 | 141 | 142 | true 143 | 144 | 145 | 146 | 147 | 148 | 149 | Top 150 | 151 | 152 | 153 | 154 | 155 | 156 | :/images/vote_up.png:/images/vote_up.png 157 | 158 | 159 | 160 | 24 161 | 24 162 | 163 | 164 | 165 | true 166 | 167 | 168 | false 169 | 170 | 171 | true 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | Today 180 | 181 | 182 | 183 | 184 | Yesterday 185 | 186 | 187 | 188 | 189 | This Week 190 | 191 | 192 | 193 | 194 | This Month 195 | 196 | 197 | 198 | 199 | This Year 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | Previous 208 | 209 | 210 | 211 | 212 | 213 | 214 | :/images/arrow-left.png:/images/arrow-left.png 215 | 216 | 217 | 218 | 219 | 220 | 221 | 1-10 222 | 223 | 224 | 225 | 226 | 227 | 228 | Next 229 | 230 | 231 | 232 | 233 | 234 | 235 | :/images/arrow-right.png:/images/arrow-right.png 236 | 237 | 238 | 239 | 240 | 241 | 242 | Qt::Horizontal 243 | 244 | 245 | 246 | 40 247 | 20 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | true 262 | 263 | 264 | 265 | 266 | 0 267 | 0 268 | 759 269 | 16 270 | 271 | 272 | 273 | 274 | 0 275 | 0 276 | 277 | 278 | 279 | 280 | 0 281 | 282 | 283 | 0 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | GxsIdChooser 294 | QComboBox 295 |
gui/gxs/GxsIdChooser.h
296 |
297 | 298 | SubscribeToolButton 299 | QToolButton 300 |
gui/common/SubscribeToolButton.h
301 |
302 |
303 | 304 | 305 | 306 | 307 | 308 |
309 | -------------------------------------------------------------------------------- /services/p3meshDemoc.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * libretroshare/src/services p3meshDemoc.cc 3 | * 4 | * MeshDemoc interface for RetroShare. 5 | * 6 | * Copyright 2012-2012 by Robert Fernie. 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Library General Public 10 | * License Version 2.1 as published by the Free Software Foundation. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 20 | * USA. 21 | * 22 | * Please report all bugs and problems to "retroshare@lunamutt.com". 23 | * 24 | */ 25 | 26 | #include "services/p3meshDemoc.h" 27 | #include "serialiser/rsmeshDemocitems.h" 28 | 29 | #include 30 | 31 | /**** 32 | * #define MESH_DEMOC_DEBUG 1 33 | ****/ 34 | 35 | 36 | RsMeshDemoc *rsMeshDemoc = NULL; 37 | 38 | /********************************************************************************/ 39 | /******************* Startup / Tick ******************************************/ 40 | /********************************************************************************/ 41 | 42 | p3MeshDemoc::p3MeshDemoc(RsGeneralDataService *gds, RsNetworkExchangeService *nes, RsGixs* gixs) 43 | :p3PostBase(gds, nes, gixs, new RsGxsMeshDemocSerialiser(), RS_SERVICE_GXS_TYPE_MESH_DEMOC), 44 | RsMeshDemoc(this) 45 | { 46 | return; 47 | } 48 | 49 | 50 | const std::string GXS_MESH_DEMOC_APP_NAME = "gxsmeshDemoc"; 51 | const uint16_t GXS_MESH_DEMOC_APP_MAJOR_VERSION = 1; 52 | const uint16_t GXS_MESH_DEMOC_APP_MINOR_VERSION = 0; 53 | const uint16_t GXS_MESH_DEMOC_MIN_MAJOR_VERSION = 1; 54 | const uint16_t GXS_MESH_DEMOC_MIN_MINOR_VERSION = 0; 55 | 56 | RsServiceInfo p3MeshDemoc::getServiceInfo() 57 | { 58 | return RsServiceInfo(RS_SERVICE_GXS_TYPE_MESH_DEMOC, 59 | GXS_MESH_DEMOC_APP_NAME, 60 | GXS_MESH_DEMOC_APP_MAJOR_VERSION, 61 | GXS_MESH_DEMOC_APP_MINOR_VERSION, 62 | GXS_MESH_DEMOC_MIN_MAJOR_VERSION, 63 | GXS_MESH_DEMOC_MIN_MINOR_VERSION); 64 | } 65 | 66 | bool p3MeshDemoc::groupShareKeys(const RsGxsGroupId& groupId,const std::set& peers) 67 | { 68 | RsGenExchange::shareGroupPublishKey(groupId,peers) ; 69 | return true ; 70 | } 71 | 72 | bool p3MeshDemoc::getGroupData(const uint32_t &token, std::vector &groups) 73 | { 74 | std::vector grpData; 75 | bool ok = RsGenExchange::getGroupData(token, grpData); 76 | 77 | std::cout << "p3MeshDemoc::getGroupData OK " << ok << std::endl; 78 | if(ok) 79 | { 80 | std::vector::iterator vit = grpData.begin(); 81 | 82 | 83 | std::cout << "p3MeshDemoc::getGroupData len " << grpData.size() << std::endl; 84 | 85 | for(; vit != grpData.end(); ++vit) 86 | { 87 | RsGxsMeshDemocGroupItem* item = dynamic_cast(*vit); 88 | if (item) 89 | { 90 | RsMeshDemocGroup grp = item->mGroup; 91 | item->mGroup.mMeta = item->meta; 92 | grp.mMeta = item->mGroup.mMeta; 93 | std::cout << "p3MeshDemoc::getGroupData " << grp.mMeta.mGroupName << std::endl; 94 | delete item; 95 | groups.push_back(grp); 96 | } 97 | else 98 | { 99 | std::cerr << "Not a RsGxsMeshDemocGroupItem, deleting!" << std::endl; 100 | delete *vit; 101 | } 102 | } 103 | } 104 | return ok; 105 | } 106 | 107 | bool p3MeshDemoc::getPostData(const uint32_t &token, std::vector &msgs) 108 | { 109 | GxsMsgDataMap msgData; 110 | bool ok = RsGenExchange::getMsgData(token, msgData); 111 | time_t now = time(NULL); 112 | 113 | if(ok) 114 | { 115 | GxsMsgDataMap::iterator mit = msgData.begin(); 116 | 117 | for(; mit != msgData.end(); ++mit) 118 | { 119 | RsGxsGroupId grpId = mit->first; 120 | std::vector& msgItems = mit->second; 121 | std::vector::iterator vit = msgItems.begin(); 122 | 123 | for(; vit != msgItems.end(); ++vit) 124 | { 125 | RsGxsMeshDemocPostItem* item = dynamic_cast(*vit); 126 | 127 | if(item) 128 | { 129 | RsMeshDemocPost msg = item->mPost; 130 | msg.mMeta = item->meta; 131 | msg.calculateScores(now); 132 | 133 | msgs.push_back(msg); 134 | delete item; 135 | } 136 | else 137 | { 138 | std::cerr << "Not a MeshDemocPostItem, deleting!" << std::endl; 139 | delete *vit; 140 | } 141 | } 142 | } 143 | } 144 | 145 | return ok; 146 | } 147 | 148 | 149 | bool p3MeshDemoc::getRelatedPosts(const uint32_t &token, std::vector &msgs) 150 | { 151 | GxsMsgRelatedDataMap msgData; 152 | bool ok = RsGenExchange::getMsgRelatedData(token, msgData); 153 | time_t now = time(NULL); 154 | 155 | if(ok) 156 | { 157 | GxsMsgRelatedDataMap::iterator mit = msgData.begin(); 158 | 159 | for(; mit != msgData.end(); ++mit) 160 | { 161 | std::vector& msgItems = mit->second; 162 | std::vector::iterator vit = msgItems.begin(); 163 | 164 | for(; vit != msgItems.end(); ++vit) 165 | { 166 | RsGxsMeshDemocPostItem* item = dynamic_cast(*vit); 167 | 168 | if(item) 169 | { 170 | RsMeshDemocPost msg = item->mPost; 171 | msg.mMeta = item->meta; 172 | msg.calculateScores(now); 173 | 174 | msgs.push_back(msg); 175 | delete item; 176 | } 177 | else 178 | { 179 | std::cerr << "Not a MeshDemocPostItem, deleting!" << std::endl; 180 | delete *vit; 181 | } 182 | } 183 | } 184 | } 185 | 186 | return ok; 187 | } 188 | 189 | 190 | /********************************************************************************************/ 191 | /********************************************************************************************/ 192 | /********************************************************************************************/ 193 | 194 | /* Switched from having explicit Ranking calculations to calculating the set of scores 195 | * on each RsMeshDemocPost item. 196 | * 197 | * TODO: move this function to be part of RsMeshDemocPost - then the GUI 198 | * can reuse is as necessary. 199 | * 200 | */ 201 | 202 | bool RsMeshDemocPost::calculateScores(time_t ref_time) 203 | { 204 | /* so we want to calculate all the scores for this Post. */ 205 | 206 | PostStats stats; 207 | extractPostCache(mMeta.mServiceString, stats); 208 | 209 | mUpVotes = stats.up_votes; 210 | mDownVotes = stats.down_votes; 211 | mComments = stats.comments; 212 | mHaveVoted = (mMeta.mMsgStatus & GXS_SERV::GXS_MSG_STATUS_VOTE_MASK); 213 | 214 | time_t age_secs = ref_time - mMeta.mPublishTs; 215 | #define MESH_DEMOC_AGESHIFT (2.0) 216 | #define MESH_DEMOC_AGEFACTOR (3600.0) 217 | 218 | mTopScore = ((int) mUpVotes - (int) mDownVotes); 219 | if (mTopScore > 0) 220 | { 221 | // score drops with time. 222 | mHotScore = mTopScore / pow(MESH_DEMOC_AGESHIFT + age_secs / MESH_DEMOC_AGEFACTOR, 1.5); 223 | } 224 | else 225 | { 226 | // gets more negative with time. 227 | mHotScore = mTopScore * pow(MESH_DEMOC_AGESHIFT + age_secs / MESH_DEMOC_AGEFACTOR, 1.5); 228 | } 229 | mNewScore = -age_secs; 230 | 231 | return true; 232 | } 233 | 234 | /********************************************************************************************/ 235 | /********************************************************************************************/ 236 | #include 237 | #include 238 | #include 239 | bool p3MeshDemoc::createGroup(uint32_t &token, RsMeshDemocGroup &group) 240 | { 241 | std::cerr << "p3MeshDemoc::createGroup()" << std::endl; 242 | 243 | RsGxsMeshDemocGroupItem* grpItem = new RsGxsMeshDemocGroupItem(); 244 | grpItem->mGroup = group; 245 | grpItem->meta = group.mMeta; 246 | grpItem->print(std::cerr); 247 | RsGenExchange::publishGroup(token, grpItem); 248 | 249 | 250 | /*bool ok = true; 251 | time_t start = time(NULL); 252 | while((RsGenExchange::getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) 253 | &&(RsGenExchange::getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_FAILED) 254 | &&((time(NULL) < (start+10))) 255 | ) 256 | { 257 | #ifdef WINDOWS_SYS 258 | Sleep(500); 259 | #else 260 | usleep(500*1000) ; 261 | #endif 262 | } 263 | 264 | if(RsGenExchange::getTokenService()->requestStatus(token) == RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) 265 | { 266 | std::vector grps; 267 | ok &= mRsIdentity->getGroupData(token, grps); 268 | for(std::vector::iterator vit = grps.begin(); vit != grps.end(); vit++) 269 | { 270 | RsGxsIdGroup& grp = *vit; 271 | KeyValueReference id("id", grp.mMeta.mGroupId); 272 | KeyValueReference pgp_id("pgp_id",grp.mPgpId ); 273 | // not very happy about this, i think the flags should stay hidden in rsidentities 274 | bool own = (grp.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN); 275 | bool pgp_linked = (grp.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID); 276 | resp.mDataStream.getStreamToMember() 277 | << id 278 | << pgp_id 279 | << makeKeyValueReference("name", grp.mMeta.mGroupName) 280 | << makeKeyValueReference("own", own) 281 | << makeKeyValueReference("pgp_linked", pgp_linked); 282 | } 283 | }*/ 284 | return true; 285 | } 286 | 287 | 288 | bool p3MeshDemoc::updateGroup(uint32_t &token, RsMeshDemocGroup &group) 289 | { 290 | std::cerr << "p3MeshDemoc::updateGroup()" << std::endl; 291 | 292 | RsGxsMeshDemocGroupItem* grpItem = new RsGxsMeshDemocGroupItem(); 293 | grpItem->mGroup = group; 294 | grpItem->meta = group.mMeta; 295 | 296 | RsGenExchange::updateGroup(token, grpItem); 297 | return true; 298 | } 299 | 300 | 301 | bool p3MeshDemoc::createPost(uint32_t &token, RsMeshDemocPost &msg) 302 | { 303 | std::cerr << "p3MeshDemoc::createPost() GroupId: " << msg.mMeta.mGroupId; 304 | std::cerr << std::endl; 305 | 306 | RsGxsMeshDemocPostItem* msgItem = new RsGxsMeshDemocPostItem(); 307 | msgItem->mPost = msg; 308 | msgItem->meta = msg.mMeta; 309 | 310 | RsGenExchange::publishMsg(token, msgItem); 311 | return true; 312 | } 313 | 314 | /********************************************************************************************/ 315 | -------------------------------------------------------------------------------- /gui/MeshDemocItem.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Retroshare MeshDemoc Plugin. 3 | * 4 | * Copyright 2012-2012 by Robert Fernie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License Version 2.1 as published by the Free Software Foundation. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | * USA. 19 | * 20 | * Please report all bugs and problems to "retroshare@lunamutt.com". 21 | * 22 | */ 23 | 24 | #include 25 | 26 | #include "rshare.h" 27 | #include "MeshDemocItem.h" 28 | #include "gui/feeds/FeedHolder.h" 29 | #include "ui_MeshDemocItem.h" 30 | 31 | #include 32 | 33 | #include 34 | 35 | #define COLOR_NORMAL QColor(248, 248, 248) 36 | #define COLOR_NEW QColor(220, 236, 253) 37 | 38 | /** Constructor */ 39 | 40 | MeshDemocItem::MeshDemocItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate) : 41 | GxsFeedItem(feedHolder, feedId, groupId, messageId, isHome, rsMeshDemoc, autoUpdate) 42 | { 43 | setup(); 44 | 45 | requestGroup(); 46 | requestMessage(); 47 | } 48 | 49 | MeshDemocItem::MeshDemocItem(FeedHolder *feedHolder, uint32_t feedId, const RsMeshDemocGroup &group, const RsMeshDemocPost &post, bool isHome, bool autoUpdate) : 50 | GxsFeedItem(feedHolder, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsMeshDemoc, autoUpdate) 51 | { 52 | setup(); 53 | 54 | setGroup(group, false); 55 | setPost(post); 56 | } 57 | 58 | MeshDemocItem::MeshDemocItem(FeedHolder *feedHolder, uint32_t feedId, const RsMeshDemocPost &post, bool isHome, bool autoUpdate) : 59 | GxsFeedItem(feedHolder, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsMeshDemoc, autoUpdate) 60 | { 61 | setup(); 62 | 63 | requestGroup(); 64 | setPost(post); 65 | } 66 | 67 | MeshDemocItem::~MeshDemocItem() 68 | { 69 | delete(ui); 70 | } 71 | 72 | void MeshDemocItem::setup() 73 | { 74 | /* Invoke the Qt Designer generated object setup routine */ 75 | ui = new Ui::MeshDemocItem; 76 | ui->setupUi(this); 77 | 78 | setAttribute(Qt::WA_DeleteOnClose, true); 79 | 80 | mInFill = false; 81 | 82 | /* clear ui */ 83 | ui->titleLabel->setText(tr("Loading")); 84 | ui->dateLabel->clear(); 85 | ui->fromLabel->clear(); 86 | ui->siteLabel->clear(); 87 | 88 | /* general ones */ 89 | connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(removeItem())); 90 | 91 | /* specific */ 92 | connect(ui->readAndClearButton, SIGNAL(clicked()), this, SLOT(readAndClearItem())); 93 | 94 | connect(ui->commentButton, SIGNAL( clicked()), this, SLOT(loadComments())); 95 | connect(ui->voteUpButton, SIGNAL(clicked()), this, SLOT(makeUpVote())); 96 | connect(ui->voteDownButton, SIGNAL(clicked()), this, SLOT( makeDownVote())); 97 | 98 | connect(ui->readButton, SIGNAL(toggled(bool)), this, SLOT(readToggled(bool))); 99 | 100 | ui->clearButton->hide(); 101 | ui->readAndClearButton->hide(); 102 | 103 | ui->frame_notes->hide(); 104 | } 105 | 106 | bool MeshDemocItem::setGroup(const RsMeshDemocGroup &group, bool doFill) 107 | { 108 | if (groupId() != group.mMeta.mGroupId) { 109 | std::cerr << "MeshDemocItem::setGroup() - Wrong id, cannot set post"; 110 | std::cerr << std::endl; 111 | return false; 112 | } 113 | 114 | mGroup = group; 115 | 116 | if (doFill) { 117 | fill(); 118 | } 119 | 120 | return true; 121 | } 122 | 123 | bool MeshDemocItem::setPost(const RsMeshDemocPost &post, bool doFill) 124 | { 125 | if (groupId() != post.mMeta.mGroupId || messageId() != post.mMeta.mMsgId) { 126 | std::cerr << "MeshDemocItem::setPost() - Wrong id, cannot set post"; 127 | std::cerr << std::endl; 128 | return false; 129 | } 130 | 131 | mPost = post; 132 | 133 | if (doFill) { 134 | fill(); 135 | } 136 | 137 | return true; 138 | } 139 | 140 | void MeshDemocItem::loadGroup(const uint32_t &token) 141 | { 142 | std::vector groups; 143 | if (!rsMeshDemoc->getGroupData(token, groups)) 144 | { 145 | std::cerr << "MeshDemocItem::loadGroup() ERROR getting data"; 146 | std::cerr << std::endl; 147 | return; 148 | } 149 | 150 | if (groups.size() != 1) 151 | { 152 | std::cerr << "MeshDemocItem::loadGroup() Wrong number of Items"; 153 | std::cerr << std::endl; 154 | return; 155 | } 156 | 157 | setGroup(groups[0]); 158 | } 159 | 160 | void MeshDemocItem::loadMessage(const uint32_t &token) 161 | { 162 | std::vector posts; 163 | if (!rsMeshDemoc->getPostData(token, posts)) 164 | { 165 | std::cerr << "GxsChannelPostItem::loadMessage() ERROR getting data"; 166 | std::cerr << std::endl; 167 | return; 168 | } 169 | 170 | if (posts.size() != 1) 171 | { 172 | std::cerr << "GxsChannelPostItem::loadMessage() Wrong number of Items"; 173 | std::cerr << std::endl; 174 | return; 175 | } 176 | 177 | setPost(posts[0]); 178 | } 179 | 180 | void MeshDemocItem::fill() 181 | { 182 | if (isLoading()) { 183 | /* Wait for all requests */ 184 | return; 185 | } 186 | 187 | mInFill = true; 188 | 189 | QDateTime qtime; 190 | qtime.setTime_t(mPost.mMeta.mPublishTs); 191 | QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy"); 192 | ui->dateLabel->setText(timestamp); 193 | ui->fromLabel->setId(mPost.mMeta.mAuthorId); 194 | 195 | // Use QUrl to check/parse our URL 196 | // The only combination that seems to work: load as EncodedUrl, extract toEncoded(). 197 | QByteArray urlarray(mPost.mLink.c_str()); 198 | QUrl url = QUrl::fromEncoded(urlarray.trimmed()); 199 | QString urlstr = "Invalid Link"; 200 | QString sitestr = "Invalid Link"; 201 | bool urlOkay = url.isValid(); 202 | if (urlOkay) 203 | { 204 | QString scheme = url.scheme(); 205 | if ((scheme != "https") 206 | && (scheme != "http") 207 | && (scheme != "ftp") 208 | && (scheme != "retroshare")) 209 | { 210 | urlOkay = false; 211 | sitestr = "Invalid Link Scheme"; 212 | } 213 | } 214 | 215 | if (urlOkay) 216 | { 217 | urlstr = QString(" "); 220 | urlstr += messageName(); 221 | urlstr += QString(" "); 222 | 223 | QString siteurl = url.scheme() + "://" + url.host(); 224 | sitestr = QString(" %2 ").arg(siteurl).arg(siteurl); 225 | } 226 | 227 | ui->titleLabel->setText(urlstr); 228 | ui->siteLabel->setText(sitestr); 229 | 230 | //QString score = "Hot" + QString::number(post.mHotScore); 231 | //score += " Top" + QString::number(post.mTopScore); 232 | //score += " New" + QString::number(post.mNewScore); 233 | 234 | QString score = QString::number(mPost.mTopScore); 235 | 236 | ui->scoreLabel->setText(score); 237 | 238 | // FIX THIS UP LATER. 239 | ui->notes->setText(QString::fromUtf8(mPost.mNotes.c_str())); 240 | // differences between Feed or Top of Comment. 241 | if (mFeedHolder) 242 | { 243 | // feed. 244 | ui->frame_notes->hide(); 245 | //frame_comment->show(); 246 | ui->commentButton->show(); 247 | 248 | if (mPost.mComments) 249 | { 250 | QString commentText = QString::number(mPost.mComments); 251 | commentText += " "; 252 | commentText += tr("Comments"); 253 | ui->commentButton->setText(commentText); 254 | } 255 | else 256 | { 257 | ui->commentButton->setText(tr("Comment")); 258 | } 259 | 260 | setReadStatus(IS_MSG_NEW(mPost.mMeta.mMsgStatus), IS_MSG_UNREAD(mPost.mMeta.mMsgStatus) || IS_MSG_NEW(mPost.mMeta.mMsgStatus)); 261 | } 262 | else 263 | { 264 | // no feed. 265 | if(ui->notes->text().isEmpty()) 266 | { 267 | ui->frame_notes->hide(); 268 | } 269 | else 270 | { 271 | ui->frame_notes->show(); 272 | } 273 | //frame_comment->hide(); 274 | ui->commentButton->hide(); 275 | 276 | ui->readButton->hide(); 277 | ui->newLabel->hide(); 278 | } 279 | 280 | if (mIsHome) 281 | { 282 | ui->clearButton->hide(); 283 | ui->readAndClearButton->hide(); 284 | } 285 | else 286 | { 287 | ui->clearButton->show(); 288 | ui->readAndClearButton->show(); 289 | } 290 | 291 | // disable voting buttons - if they have already voted. 292 | if (mPost.mMeta.mMsgStatus & GXS_SERV::GXS_MSG_STATUS_VOTE_MASK) 293 | { 294 | ui->voteUpButton->setEnabled(false); 295 | ui->voteDownButton->setEnabled(false); 296 | } 297 | 298 | uint32_t up, down, nComments; 299 | 300 | #if 0 301 | bool ok = rsMeshDemoc->retrieveScores(mPost.mMeta.mServiceString, up, down, nComments); 302 | 303 | if(ok) 304 | { 305 | int32_t vote = up - down; 306 | scoreLabel->setText(QString::number(vote)); 307 | 308 | numCommentsLabel->setText("

# Comments: " 312 | + QString::number(nComments) + "

"); 313 | } 314 | #endif 315 | 316 | mInFill = false; 317 | 318 | emit sizeChanged(this); 319 | } 320 | 321 | const RsMeshDemocPost &MeshDemocItem::getPost() const 322 | { 323 | return mPost; 324 | } 325 | 326 | RsMeshDemocPost &MeshDemocItem::post() 327 | { 328 | return mPost; 329 | } 330 | 331 | QString MeshDemocItem::groupName() 332 | { 333 | return QString::fromUtf8(mGroup.mMeta.mGroupName.c_str()); 334 | } 335 | 336 | QString MeshDemocItem::messageName() 337 | { 338 | return QString::fromUtf8(mPost.mMeta.mMsgName.c_str()); 339 | } 340 | 341 | void MeshDemocItem::makeDownVote() 342 | { 343 | RsGxsGrpMsgIdPair msgId; 344 | msgId.first = mPost.mMeta.mGroupId; 345 | msgId.second = mPost.mMeta.mMsgId; 346 | 347 | ui->voteUpButton->setEnabled(false); 348 | ui->voteDownButton->setEnabled(false); 349 | 350 | emit vote(msgId, false); 351 | } 352 | 353 | void MeshDemocItem::makeUpVote() 354 | { 355 | RsGxsGrpMsgIdPair msgId; 356 | msgId.first = mPost.mMeta.mGroupId; 357 | msgId.second = mPost.mMeta.mMsgId; 358 | 359 | ui->voteUpButton->setEnabled(false); 360 | ui->voteDownButton->setEnabled(false); 361 | 362 | emit vote(msgId, true); 363 | } 364 | 365 | void MeshDemocItem::loadComments() 366 | { 367 | std::cerr << "MeshDemocItem::loadComments()"; 368 | std::cerr << std::endl; 369 | 370 | if (mFeedHolder) 371 | { 372 | QString title = QString::fromUtf8(mPost.mMeta.mMsgName.c_str()); 373 | mFeedHolder->openComments(0, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, title); 374 | } 375 | } 376 | 377 | void MeshDemocItem::setReadStatus(bool isNew, bool isUnread) 378 | { 379 | if (isUnread) 380 | { 381 | ui->readButton->setChecked(true); 382 | ui->readButton->setIcon(QIcon(":/images/message-state-unread.png")); 383 | } 384 | else 385 | { 386 | ui->readButton->setChecked(false); 387 | ui->readButton->setIcon(QIcon(":/images/message-state-read.png")); 388 | } 389 | 390 | ui->newLabel->setVisible(isNew); 391 | 392 | /* unpolish widget to clear the stylesheet's palette cache */ 393 | ui->frame->style()->unpolish(ui->frame); 394 | 395 | QPalette palette = ui->frame->palette(); 396 | palette.setColor(ui->frame->backgroundRole(), isNew ? COLOR_NEW : COLOR_NORMAL); // QScrollArea 397 | palette.setColor(QPalette::Base, isNew ? COLOR_NEW : COLOR_NORMAL); // QTreeWidget 398 | ui->frame->setPalette(palette); 399 | 400 | ui->frame->setProperty("new", isNew); 401 | Rshare::refreshStyleSheet(ui->frame, false); 402 | } 403 | 404 | void MeshDemocItem::readToggled(bool checked) 405 | { 406 | if (mInFill) { 407 | return; 408 | } 409 | 410 | RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId()); 411 | 412 | uint32_t token; 413 | rsMeshDemoc->setMessageReadStatus(token, msgPair, !checked); 414 | 415 | setReadStatus(false, checked); 416 | } 417 | 418 | void MeshDemocItem::readAndClearItem() 419 | { 420 | #ifdef DEBUG_ITEM 421 | std::cerr << "MeshDemocItem::readAndClearItem()"; 422 | std::cerr << std::endl; 423 | #endif 424 | 425 | readToggled(false); 426 | removeItem(); 427 | } 428 | -------------------------------------------------------------------------------- /lang/MeshDemoc_da.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddLinksDialog 4 | 5 | 6 | 7 | Add Link 8 | 9 | 10 | 11 | 12 | Cancel 13 | Annuller 14 | 15 | 16 | 17 | Add a new Link 18 | 19 | 20 | 21 | 22 | Title: 23 | 24 | 25 | 26 | 27 | Url: 28 | 29 | 30 | 31 | 32 | Add Anonymous Link 33 | 34 | 35 | 36 | 37 | +2 Great! 38 | 39 | 40 | 41 | 42 | +1 Good 43 | 44 | 45 | 46 | 47 | 0 Okay 48 | 49 | 50 | 51 | 52 | -1 Sux 53 | 54 | 55 | 56 | 57 | -2 Bad Link 58 | 59 | 60 | 61 | 62 | Add Link to Cloud 63 | 64 | 65 | 66 | 67 | New Link 68 | 69 | 70 | 71 | 72 | Add Link Failure 73 | 74 | 75 | 76 | 77 | Missing Link and/or Title 78 | 79 | 80 | 81 | 82 | LinksCloudPlugin 83 | 84 | 85 | This plugin provides a set of cached links, and a voting system to promote them. 86 | 87 | 88 | 89 | 90 | LinksCloud 91 | 92 | 93 | 94 | 95 | LinksDialog 96 | 97 | 98 | Title / Comment 99 | 100 | 101 | 102 | 103 | Score 104 | 105 | 106 | 107 | 108 | Peer / Link 109 | 110 | 111 | 112 | 113 | Sort by 114 | 115 | 116 | 117 | 118 | Combo 119 | 120 | 121 | 122 | 123 | Time 124 | 125 | 126 | 127 | 128 | Ranking 129 | 130 | 131 | 132 | 133 | In last 134 | 135 | 136 | 137 | 138 | Month 139 | 140 | 141 | 142 | 143 | Week 144 | 145 | 146 | 147 | 148 | Day 149 | 150 | 151 | 152 | 153 | From 154 | 155 | 156 | 157 | 158 | All Peers 159 | 160 | 161 | 162 | 163 | Own Links 164 | 165 | 166 | 167 | 168 | Show 169 | 170 | 171 | 172 | 173 | Top 100 174 | 175 | 176 | 177 | 178 | 101-200 179 | 180 | 181 | 182 | 183 | 201-300 184 | 185 | 186 | 187 | 188 | 301-400 189 | 190 | 191 | 192 | 193 | 401-500 194 | 195 | 196 | 197 | 198 | Bottom 100 199 | 200 | 201 | 202 | 203 | Link: 204 | 205 | 206 | 207 | 208 | Add Anonymous Link 209 | 210 | 211 | 212 | 213 | Add Link/Comment 214 | 215 | 216 | 217 | 218 | Title: 219 | 220 | 221 | 222 | 223 | Score: 224 | 225 | 226 | 227 | 228 | 229 | +2 Great! 230 | 231 | 232 | 233 | 234 | 235 | +1 Good 236 | 237 | 238 | 239 | 240 | 241 | 0 Okay 242 | 243 | 244 | 245 | 246 | 247 | -1 Sux 248 | 249 | 250 | 251 | 252 | 253 | -2 Bad Link 254 | 255 | 256 | 257 | 258 | Url: 259 | 260 | 261 | 262 | 263 | Links Cloud 264 | 265 | 266 | 267 | 268 | Add new link 269 | 270 | 271 | 272 | 273 | Share Link Anonymously 274 | 275 | 276 | 277 | 278 | Vote on Link 279 | 280 | 281 | 282 | 283 | Download 284 | 285 | 286 | 287 | 288 | 289 | 290 | Add Link Failure 291 | 292 | 293 | 294 | 295 | Missing Link and/or Title 296 | 297 | 298 | 299 | 300 | Missing Link Data 301 | 302 | 303 | 304 | 305 | Missing Comment 306 | 307 | 308 | 309 | 310 | Link Title Not Changed 311 | 312 | 313 | 314 | 315 | Do you want to continue? 316 | 317 | 318 | 319 | 320 | Expand 321 | 322 | 323 | 324 | 325 | Hide 326 | 327 | 328 | 329 | -------------------------------------------------------------------------------- /lang/MeshDemoc_ja_JP.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddLinksDialog 4 | 5 | 6 | 7 | Add Link 8 | 9 | 10 | 11 | 12 | Cancel 13 | キャンセル 14 | 15 | 16 | 17 | Add a new Link 18 | 19 | 20 | 21 | 22 | Title: 23 | 24 | 25 | 26 | 27 | Url: 28 | 29 | 30 | 31 | 32 | Add Anonymous Link 33 | 34 | 35 | 36 | 37 | +2 Great! 38 | 39 | 40 | 41 | 42 | +1 Good 43 | 44 | 45 | 46 | 47 | 0 Okay 48 | 49 | 50 | 51 | 52 | -1 Sux 53 | 54 | 55 | 56 | 57 | -2 Bad Link 58 | 59 | 60 | 61 | 62 | Add Link to Cloud 63 | 64 | 65 | 66 | 67 | New Link 68 | 69 | 70 | 71 | 72 | Add Link Failure 73 | 74 | 75 | 76 | 77 | Missing Link and/or Title 78 | 79 | 80 | 81 | 82 | LinksCloudPlugin 83 | 84 | 85 | This plugin provides a set of cached links, and a voting system to promote them. 86 | 87 | 88 | 89 | 90 | LinksCloud 91 | 92 | 93 | 94 | 95 | LinksDialog 96 | 97 | 98 | Title / Comment 99 | 100 | 101 | 102 | 103 | Score 104 | 105 | 106 | 107 | 108 | Peer / Link 109 | 110 | 111 | 112 | 113 | Sort by 114 | 115 | 116 | 117 | 118 | Combo 119 | 120 | 121 | 122 | 123 | Time 124 | 125 | 126 | 127 | 128 | Ranking 129 | 130 | 131 | 132 | 133 | In last 134 | 135 | 136 | 137 | 138 | Month 139 | 140 | 141 | 142 | 143 | Week 144 | 145 | 146 | 147 | 148 | Day 149 | 150 | 151 | 152 | 153 | From 154 | 155 | 156 | 157 | 158 | All Peers 159 | 160 | 161 | 162 | 163 | Own Links 164 | 165 | 166 | 167 | 168 | Show 169 | 170 | 171 | 172 | 173 | Top 100 174 | 175 | 176 | 177 | 178 | 101-200 179 | 180 | 181 | 182 | 183 | 201-300 184 | 185 | 186 | 187 | 188 | 301-400 189 | 190 | 191 | 192 | 193 | 401-500 194 | 195 | 196 | 197 | 198 | Bottom 100 199 | 200 | 201 | 202 | 203 | Link: 204 | 205 | 206 | 207 | 208 | Add Anonymous Link 209 | 210 | 211 | 212 | 213 | Add Link/Comment 214 | 215 | 216 | 217 | 218 | Title: 219 | 220 | 221 | 222 | 223 | Score: 224 | 225 | 226 | 227 | 228 | 229 | +2 Great! 230 | 231 | 232 | 233 | 234 | 235 | +1 Good 236 | 237 | 238 | 239 | 240 | 241 | 0 Okay 242 | 243 | 244 | 245 | 246 | 247 | -1 Sux 248 | 249 | 250 | 251 | 252 | 253 | -2 Bad Link 254 | 255 | 256 | 257 | 258 | Url: 259 | 260 | 261 | 262 | 263 | Links Cloud 264 | 265 | 266 | 267 | 268 | Add new link 269 | 270 | 271 | 272 | 273 | Share Link Anonymously 274 | 275 | 276 | 277 | 278 | Vote on Link 279 | 280 | 281 | 282 | 283 | Download 284 | ダウンロード 285 | 286 | 287 | 288 | 289 | 290 | Add Link Failure 291 | 292 | 293 | 294 | 295 | Missing Link and/or Title 296 | 297 | 298 | 299 | 300 | Missing Link Data 301 | 302 | 303 | 304 | 305 | Missing Comment 306 | 307 | 308 | 309 | 310 | Link Title Not Changed 311 | 312 | 313 | 314 | 315 | Do you want to continue? 316 | 317 | 318 | 319 | 320 | Expand 321 | 展開 322 | 323 | 324 | 325 | Hide 326 | 非表示 327 | 328 | 329 | -------------------------------------------------------------------------------- /lang/MeshDemoc_zh_CN.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddLinksDialog 4 | 5 | 6 | 7 | Add Link 8 | 添加链接 9 | 10 | 11 | 12 | Cancel 13 | 取消 14 | 15 | 16 | 17 | Add a new Link 18 | 添加一个新的链接 19 | 20 | 21 | 22 | Title: 23 | 标题: 24 | 25 | 26 | 27 | Url: 28 | 网址: 29 | 30 | 31 | 32 | Add Anonymous Link 33 | 添加匿名链接 34 | 35 | 36 | 37 | +2 Great! 38 | +2 真棒! 39 | 40 | 41 | 42 | +1 Good 43 | +1 不错 44 | 45 | 46 | 47 | 0 Okay 48 | 0 还行 49 | 50 | 51 | 52 | -1 Sux 53 | -1 差 54 | 55 | 56 | 57 | -2 Bad Link 58 | -2 很差 59 | 60 | 61 | 62 | Add Link to Cloud 63 | 添加链接到云端 64 | 65 | 66 | 67 | New Link 68 | 新链接 69 | 70 | 71 | 72 | Add Link Failure 73 | 添加链接失败 74 | 75 | 76 | 77 | Missing Link and/or Title 78 | 丢失链接和(或)标题 79 | 80 | 81 | 82 | LinksCloudPlugin 83 | 84 | 85 | This plugin provides a set of cached links, and a voting system to promote them. 86 | 这个插件提供一些缓存链接,和一个给这些链接评分的投票系统。 87 | 88 | 89 | 90 | LinksCloud 91 | LinksCloud 92 | 93 | 94 | 95 | LinksDialog 96 | 97 | 98 | Title / Comment 99 | 标题/评论 100 | 101 | 102 | 103 | Score 104 | 得分 105 | 106 | 107 | 108 | Peer / Link 109 | 节点 / 链接 110 | 111 | 112 | 113 | Sort by 114 | 排序方式 115 | 116 | 117 | 118 | Combo 119 | 综合 120 | 121 | 122 | 123 | Time 124 | 时间 125 | 126 | 127 | 128 | Ranking 129 | 排行 130 | 131 | 132 | 133 | In last 134 | 前一 135 | 136 | 137 | 138 | Month 139 | 个月 140 | 141 | 142 | 143 | Week 144 | 145 | 146 | 147 | 148 | Day 149 | 150 | 151 | 152 | 153 | From 154 | 来自 155 | 156 | 157 | 158 | All Peers 159 | 所有节点 160 | 161 | 162 | 163 | Own Links 164 | 自己的链接 165 | 166 | 167 | 168 | Show 169 | 显示 170 | 171 | 172 | 173 | Top 100 174 | 前100 175 | 176 | 177 | 178 | 101-200 179 | 101-200 180 | 181 | 182 | 183 | 201-300 184 | 201-300 185 | 186 | 187 | 188 | 301-400 189 | 301-400 190 | 191 | 192 | 193 | 401-500 194 | 401-500 195 | 196 | 197 | 198 | Bottom 100 199 | 后100 200 | 201 | 202 | 203 | Link: 204 | 链接: 205 | 206 | 207 | 208 | Add Anonymous Link 209 | 添加匿名链接 210 | 211 | 212 | 213 | Add Link/Comment 214 | 添加链接/评论 215 | 216 | 217 | 218 | Title: 219 | 标题: 220 | 221 | 222 | 223 | Score: 224 | 得分: 225 | 226 | 227 | 228 | 229 | +2 Great! 230 | +2 真棒! 231 | 232 | 233 | 234 | 235 | +1 Good 236 | +1 不错 237 | 238 | 239 | 240 | 241 | 0 Okay 242 | 0 还行 243 | 244 | 245 | 246 | 247 | -1 Sux 248 | -1 烂 249 | 250 | 251 | 252 | 253 | -2 Bad Link 254 | -2 很差 255 | 256 | 257 | 258 | Url: 259 | 网址: 260 | 261 | 262 | 263 | Links Cloud 264 | Links Cloud 265 | 266 | 267 | 268 | Add new link 269 | 添加新链接 270 | 271 | 272 | 273 | Share Link Anonymously 274 | 匿名分享链接 275 | 276 | 277 | 278 | Vote on Link 279 | 为链接投票 280 | 281 | 282 | 283 | Download 284 | 下载 285 | 286 | 287 | 288 | 289 | 290 | Add Link Failure 291 | 添加链接失败 292 | 293 | 294 | 295 | Missing Link and/or Title 296 | 丢失链接和(或)标题 297 | 298 | 299 | 300 | Missing Link Data 301 | 丢失链接信息 302 | 303 | 304 | 305 | Missing Comment 306 | 丢失评论 307 | 308 | 309 | 310 | Link Title Not Changed 311 | 链接名未改变 312 | 313 | 314 | 315 | Do you want to continue? 316 | 想要继续? 317 | 318 | 319 | 320 | Expand 321 | 展开 322 | 323 | 324 | 325 | Hide 326 | 隐藏 327 | 328 | 329 | -------------------------------------------------------------------------------- /serialiser/rsmeshDemocitems.cc: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * libretroshare/src/gxs: rsopsteditems.cc 4 | * 5 | * RetroShare Serialiser. 6 | * 7 | * Copyright 2012-2013 by Robert Fernie, Christopher Evi-Parker 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Library General Public 11 | * License Version 2.1 as published by the Free Software Foundation. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Library General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Library General Public 19 | * License along with this library; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | * USA. 22 | * 23 | * Please report all bugs and problems to "retroshare@lunamutt.com". 24 | * 25 | */ 26 | 27 | #include "serialiser/rsmeshDemocitems.h" 28 | #include "serialiser/rsbaseserial.h" 29 | #include "serialiser/rstlvbase.h" 30 | 31 | 32 | uint32_t RsGxsMeshDemocSerialiser::size(RsItem *item) 33 | { 34 | #ifdef MESH_DEMOC_DEBUG 35 | std::cerr << "RsGxsMeshDemocSerialiser::size()" << std::endl; 36 | #endif 37 | 38 | RsGxsMeshDemocGroupItem* pgItem = NULL; 39 | RsGxsMeshDemocPostItem* ppItem = NULL; 40 | 41 | if ((pgItem = dynamic_cast(item)) != NULL) 42 | { 43 | return sizeGxsMeshDemocGroupItem(pgItem); 44 | } 45 | else if ((ppItem = dynamic_cast(item)) != NULL) 46 | { 47 | return sizeGxsMeshDemocPostItem(ppItem); 48 | } 49 | else 50 | { 51 | return RsGxsCommentSerialiser::size(item); 52 | } 53 | } 54 | 55 | bool RsGxsMeshDemocSerialiser::serialise(RsItem *item, void *data, uint32_t *size) 56 | { 57 | #ifdef MESH_DEMOC_DEBUG 58 | std::cerr << "RsGxsMeshDemocSerialiser::serialise()" << std::endl; 59 | #endif 60 | 61 | RsGxsMeshDemocPostItem* ppItem = NULL; 62 | RsGxsMeshDemocGroupItem* pgItem = NULL; 63 | 64 | if ((pgItem = dynamic_cast(item)) != NULL) 65 | { 66 | return serialiseGxsMeshDemocGroupItem(pgItem, data, size); 67 | } 68 | else if ((ppItem = dynamic_cast(item)) != NULL) 69 | { 70 | return serialiseGxsMeshDemocPostItem(ppItem, data, size); 71 | } 72 | else 73 | { 74 | return RsGxsCommentSerialiser::serialise(item, data, size); 75 | } 76 | } 77 | 78 | RsItem* RsGxsMeshDemocSerialiser::deserialise(void *data, uint32_t *size) 79 | { 80 | #ifdef MESH_DEMOC_DEBUG 81 | std::cerr << "RsGxsMeshDemocSerialiser::deserialise()" << std::endl; 82 | #endif 83 | /* get the type and size */ 84 | uint32_t rstype = getRsItemId(data); 85 | 86 | if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || 87 | (RS_SERVICE_GXS_TYPE_MESH_DEMOC != getRsItemService(rstype))) 88 | { 89 | std::cerr << "RsGxsMeshDemocSerialiser::deserialise() ERROR Wrong Type"; 90 | std::cerr << std::endl; 91 | return NULL; /* wrong type */ 92 | } 93 | 94 | switch(getRsItemSubType(rstype)) 95 | { 96 | 97 | case RS_PKT_SUBTYPE_MESH_DEMOC_GRP_ITEM: 98 | return deserialiseGxsMeshDemocGroupItem(data, size); 99 | break; 100 | case RS_PKT_SUBTYPE_MESH_DEMOC_POST_ITEM: 101 | return deserialiseGxsMeshDemocPostItem(data, size); 102 | break; 103 | default: 104 | return RsGxsCommentSerialiser::deserialise(data, size); 105 | break; 106 | } 107 | } 108 | 109 | /*****************************************************************************************/ 110 | /*****************************************************************************************/ 111 | /*****************************************************************************************/ 112 | 113 | void RsGxsMeshDemocPostItem::clear() 114 | { 115 | mPost.mLink.clear(); 116 | mPost.mNotes.clear(); 117 | } 118 | 119 | std::ostream & RsGxsMeshDemocPostItem::print(std::ostream &out, uint16_t indent) 120 | { 121 | printRsItemBase(out, "RsGxsMeshDemocPostItem", indent); 122 | uint16_t int_Indent = indent + 2; 123 | 124 | printIndent(out, int_Indent); 125 | out << "Link: " << mPost.mLink << std::endl; 126 | printIndent(out, int_Indent); 127 | out << "Notes: " << mPost.mNotes << std::endl; 128 | 129 | printRsItemEnd(out ,"RsGxsMeshDemocPostItem", indent); 130 | return out; 131 | } 132 | 133 | uint32_t RsGxsMeshDemocSerialiser::sizeGxsMeshDemocPostItem(RsGxsMeshDemocPostItem* item) 134 | { 135 | RsMeshDemocPost& p = item->mPost; 136 | 137 | uint32_t s = 8; 138 | 139 | s += GetTlvStringSize(p.mLink); 140 | s += GetTlvStringSize(p.mNotes); 141 | 142 | return s; 143 | } 144 | 145 | bool RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocPostItem(RsGxsMeshDemocPostItem* item, void* data, uint32_t *size) 146 | { 147 | 148 | #ifdef MESH_DEMOC_DEBUG 149 | std::cerr << "RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocPostItem()" << std::endl; 150 | #endif 151 | 152 | uint32_t tlvsize = sizeGxsMeshDemocPostItem(item); 153 | uint32_t offset = 0; 154 | 155 | if(*size < tlvsize){ 156 | std::cerr << "RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocPostItem() Size too small" << std::endl; 157 | return false; 158 | } 159 | 160 | *size = tlvsize; 161 | 162 | bool ok = true; 163 | 164 | ok &= setRsItemHeader(data, tlvsize, item->PacketId(), tlvsize); 165 | 166 | /* skip the header */ 167 | offset += 8; 168 | 169 | /* RsMeshDemocPost */ 170 | 171 | ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_LINK, item->mPost.mLink); 172 | ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_MSG, item->mPost.mNotes); 173 | 174 | if(offset != tlvsize) 175 | { 176 | std::cerr << "RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocPostItem() FAIL Size Error! " << std::endl; 177 | ok = false; 178 | } 179 | 180 | #ifdef MESH_DEMOC_DEBUG 181 | if (!ok) 182 | { 183 | std::cerr << "RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocPostItem() NOK" << std::endl; 184 | } 185 | #endif 186 | 187 | return ok; 188 | } 189 | 190 | 191 | 192 | 193 | RsGxsMeshDemocPostItem* RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocPostItem(void *data, uint32_t *size) 194 | { 195 | 196 | #ifdef MESH_DEMOC_DEBUG 197 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocPostItem()" << std::endl; 198 | #endif 199 | /* get the type and size */ 200 | uint32_t rstype = getRsItemId(data); 201 | uint32_t rssize = getRsItemSize(data); 202 | 203 | uint32_t offset = 0; 204 | 205 | if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || 206 | (RS_SERVICE_GXS_TYPE_MESH_DEMOC != getRsItemService(rstype)) || 207 | (RS_PKT_SUBTYPE_MESH_DEMOC_POST_ITEM != getRsItemSubType(rstype))) 208 | { 209 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocPostItem() FAIL wrong type" << std::endl; 210 | return NULL; /* wrong type */ 211 | } 212 | 213 | if (*size < rssize) /* check size */ 214 | { 215 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocPostItem() FAIL wrong size" << std::endl; 216 | return NULL; /* not enough data */ 217 | } 218 | 219 | /* set the packet length */ 220 | *size = rssize; 221 | 222 | bool ok = true; 223 | 224 | RsGxsMeshDemocPostItem* item = new RsGxsMeshDemocPostItem(); 225 | /* skip the header */ 226 | offset += 8; 227 | 228 | ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_LINK, item->mPost.mLink); 229 | ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_MSG, item->mPost.mNotes); 230 | 231 | if (offset != rssize) 232 | { 233 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocPostItem() FAIL size mismatch" << std::endl; 234 | /* error */ 235 | delete item; 236 | return NULL; 237 | } 238 | 239 | if (!ok) 240 | { 241 | #ifdef MESH_DEMOC_DEBUG 242 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocPostItem() NOK" << std::endl; 243 | #endif 244 | delete item; 245 | return NULL; 246 | } 247 | 248 | return item; 249 | } 250 | 251 | 252 | /*****************************************************************************************/ 253 | /*****************************************************************************************/ 254 | /*****************************************************************************************/ 255 | 256 | void RsGxsMeshDemocGroupItem::clear() 257 | { 258 | mGroup.mDescription.clear(); 259 | return; 260 | } 261 | 262 | std::ostream & RsGxsMeshDemocGroupItem::print(std::ostream &out, uint16_t indent) 263 | { 264 | printRsItemBase(out, "RsGxsMeshDemocGroupItem", indent); 265 | uint16_t int_Indent = indent + 2; 266 | 267 | printIndent(out, int_Indent); 268 | out << "Description: " << mGroup.mDescription << std::endl; 269 | 270 | printRsItemEnd(out ,"RsGxsMeshDemocGroupItem", indent); 271 | return out; 272 | } 273 | 274 | 275 | uint32_t RsGxsMeshDemocSerialiser::sizeGxsMeshDemocGroupItem(RsGxsMeshDemocGroupItem* item) 276 | { 277 | RsMeshDemocGroup& g = item->mGroup; 278 | uint32_t s = 8; // header 279 | 280 | s += GetTlvStringSize(g.mDescription); 281 | 282 | return s; 283 | } 284 | 285 | bool RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocGroupItem(RsGxsMeshDemocGroupItem* item, void* data, uint32_t *size) 286 | { 287 | 288 | #ifdef MESH_DEMOC_DEBUG 289 | std::cerr << "RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocGroupItem()" << std::endl; 290 | #endif 291 | 292 | uint32_t tlvsize = sizeGxsMeshDemocGroupItem(item); 293 | uint32_t offset = 0; 294 | 295 | if(*size < tlvsize){ 296 | #ifdef MESH_DEMOC_DEBUG 297 | std::cerr << "RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocGroupItem()" << std::endl; 298 | #endif 299 | return false; 300 | } 301 | 302 | *size = tlvsize; 303 | 304 | bool ok = true; 305 | 306 | ok &= setRsItemHeader(data, tlvsize, item->PacketId(), tlvsize); 307 | 308 | /* skip the header */ 309 | offset += 8; 310 | 311 | /* MeshDemocGroupItem */ 312 | ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_DESCR, item->mGroup.mDescription); 313 | 314 | 315 | if(offset != tlvsize) 316 | { 317 | #ifdef MESH_DEMOC_DEBUG 318 | std::cerr << "RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocGroupItem() FAIL Size Error! " << std::endl; 319 | #endif 320 | ok = false; 321 | } 322 | 323 | #ifdef MESH_DEMOC_DEBUG 324 | if (!ok) 325 | { 326 | std::cerr << "RsGxsMeshDemocSerialiser::serialiseGxsMeshDemocGroupItem() NOK" << std::endl; 327 | } 328 | #endif 329 | 330 | return ok; 331 | } 332 | RsGxsMeshDemocGroupItem* RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocGroupItem(void *data, uint32_t *size) 333 | { 334 | 335 | #ifdef MESH_DEMOC_DEBUG 336 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocGroupItem()" << std::endl; 337 | #endif 338 | /* get the type and size */ 339 | uint32_t rstype = getRsItemId(data); 340 | uint32_t rssize = getRsItemSize(data); 341 | 342 | uint32_t offset = 0; 343 | 344 | 345 | if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || 346 | (RS_SERVICE_GXS_TYPE_MESH_DEMOC != getRsItemService(rstype)) || 347 | (RS_PKT_SUBTYPE_MESH_DEMOC_GRP_ITEM != getRsItemSubType(rstype))) 348 | { 349 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocGroupItem() FAIL wrong type" << std::endl; 350 | return NULL; /* wrong type */ 351 | } 352 | 353 | if (*size < rssize) /* check size */ 354 | { 355 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocGroupItem() FAIL wrong size" << std::endl; 356 | return NULL; /* not enough data */ 357 | } 358 | 359 | /* set the packet length */ 360 | *size = rssize; 361 | 362 | bool ok = true; 363 | 364 | RsGxsMeshDemocGroupItem* item = new RsGxsMeshDemocGroupItem(); 365 | /* skip the header */ 366 | offset += 8; 367 | 368 | ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_DESCR, item->mGroup.mDescription); 369 | 370 | if (offset != rssize) 371 | { 372 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocGroupItem() FAIL size mismatch" << std::endl; 373 | /* error */ 374 | delete item; 375 | return NULL; 376 | } 377 | 378 | if (!ok) 379 | { 380 | #ifdef MESH_DEMOC_DEBUG 381 | std::cerr << "RsGxsMeshDemocSerialiser::deserialiseGxsMeshDemocGroupItem() NOK" << std::endl; 382 | #endif 383 | delete item; 384 | return NULL; 385 | } 386 | 387 | return item; 388 | } 389 | 390 | -------------------------------------------------------------------------------- /lang/MeshDemoc_ru.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddLinksDialog 4 | 5 | 6 | 7 | Add Link 8 | 9 | 10 | 11 | 12 | Cancel 13 | Отмена 14 | 15 | 16 | 17 | Add a new Link 18 | 19 | 20 | 21 | 22 | Title: 23 | Заголовок: 24 | 25 | 26 | 27 | Url: 28 | 29 | 30 | 31 | 32 | Add Anonymous Link 33 | 34 | 35 | 36 | 37 | +2 Great! 38 | 39 | 40 | 41 | 42 | +1 Good 43 | 44 | 45 | 46 | 47 | 0 Okay 48 | 49 | 50 | 51 | 52 | -1 Sux 53 | 54 | 55 | 56 | 57 | -2 Bad Link 58 | 59 | 60 | 61 | 62 | Add Link to Cloud 63 | 64 | 65 | 66 | 67 | New Link 68 | 69 | 70 | 71 | 72 | Add Link Failure 73 | 74 | 75 | 76 | 77 | Missing Link and/or Title 78 | 79 | 80 | 81 | 82 | LinksCloudPlugin 83 | 84 | 85 | This plugin provides a set of cached links, and a voting system to promote them. 86 | 87 | 88 | 89 | 90 | LinksCloud 91 | 92 | 93 | 94 | 95 | LinksDialog 96 | 97 | 98 | Title / Comment 99 | Название / комментарий 100 | 101 | 102 | 103 | Score 104 | 105 | 106 | 107 | 108 | Peer / Link 109 | 110 | 111 | 112 | 113 | Sort by 114 | Сортировать по 115 | 116 | 117 | 118 | Combo 119 | 120 | 121 | 122 | 123 | Time 124 | 125 | 126 | 127 | 128 | Ranking 129 | 130 | 131 | 132 | 133 | In last 134 | 135 | 136 | 137 | 138 | Month 139 | 140 | 141 | 142 | 143 | Week 144 | 145 | 146 | 147 | 148 | Day 149 | 150 | 151 | 152 | 153 | From 154 | От 155 | 156 | 157 | 158 | All Peers 159 | 160 | 161 | 162 | 163 | Own Links 164 | 165 | 166 | 167 | 168 | Show 169 | Показать 170 | 171 | 172 | 173 | Top 100 174 | 175 | 176 | 177 | 178 | 101-200 179 | 180 | 181 | 182 | 183 | 201-300 184 | 185 | 186 | 187 | 188 | 301-400 189 | 190 | 191 | 192 | 193 | 401-500 194 | 195 | 196 | 197 | 198 | Bottom 100 199 | 200 | 201 | 202 | 203 | Link: 204 | 205 | 206 | 207 | 208 | Add Anonymous Link 209 | 210 | 211 | 212 | 213 | Add Link/Comment 214 | 215 | 216 | 217 | 218 | Title: 219 | Заголовок: 220 | 221 | 222 | 223 | Score: 224 | 225 | 226 | 227 | 228 | 229 | +2 Great! 230 | 231 | 232 | 233 | 234 | 235 | +1 Good 236 | 237 | 238 | 239 | 240 | 241 | 0 Okay 242 | 243 | 244 | 245 | 246 | 247 | -1 Sux 248 | 249 | 250 | 251 | 252 | 253 | -2 Bad Link 254 | 255 | 256 | 257 | 258 | Url: 259 | 260 | 261 | 262 | 263 | Links Cloud 264 | 265 | 266 | 267 | 268 | Add new link 269 | 270 | 271 | 272 | 273 | Share Link Anonymously 274 | 275 | 276 | 277 | 278 | Vote on Link 279 | 280 | 281 | 282 | 283 | Download 284 | Скачать 285 | 286 | 287 | 288 | 289 | 290 | Add Link Failure 291 | 292 | 293 | 294 | 295 | Missing Link and/or Title 296 | 297 | 298 | 299 | 300 | Missing Link Data 301 | 302 | 303 | 304 | 305 | Missing Comment 306 | 307 | 308 | 309 | 310 | Link Title Not Changed 311 | 312 | 313 | 314 | 315 | Do you want to continue? 316 | 317 | 318 | 319 | 320 | Expand 321 | Раскрыть 322 | 323 | 324 | 325 | Hide 326 | Скрыть 327 | 328 | 329 | -------------------------------------------------------------------------------- /lang/MeshDemoc_ko.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddLinksDialog 4 | 5 | 6 | 7 | Add Link 8 | 링크 추가 9 | 10 | 11 | 12 | Cancel 13 | 취소 14 | 15 | 16 | 17 | Add a new Link 18 | 새 링크 추가 19 | 20 | 21 | 22 | Title: 23 | 제목: 24 | 25 | 26 | 27 | Url: 28 | 주소: 29 | 30 | 31 | 32 | Add Anonymous Link 33 | 익명 링크 추가 34 | 35 | 36 | 37 | +2 Great! 38 | +2 멋져요 :D 39 | 40 | 41 | 42 | +1 Good 43 | +1 좋아요 :) 44 | 45 | 46 | 47 | 0 Okay 48 | 0 괜찮아요 : | 49 | 50 | 51 | 52 | -1 Sux 53 | -1 어우 :S 54 | 55 | 56 | 57 | -2 Bad Link 58 | -2 후졌어요 :( 59 | 60 | 61 | 62 | Add Link to Cloud 63 | 클라우드에 링크 추가 64 | 65 | 66 | 67 | New Link 68 | 새 링크 69 | 70 | 71 | 72 | Add Link Failure 73 | 잘못된 링크 추가 74 | 75 | 76 | 77 | Missing Link and/or Title 78 | 링크 또는 제목이 빠졌습니다 79 | 80 | 81 | 82 | LinksCloudPlugin 83 | 84 | 85 | This plugin provides a set of cached links, and a voting system to promote them. 86 | 이 플러그인은 캐시에 저장한 링크 모음과, 링크를 알리기 위한 투표 시스템을 제공합니다. 87 | 88 | 89 | 90 | LinksCloud 91 | 링크클라우드 92 | 93 | 94 | 95 | LinksDialog 96 | 97 | 98 | Title / Comment 99 | 제목 / 답글 100 | 101 | 102 | 103 | Score 104 | 점수 105 | 106 | 107 | 108 | Peer / Link 109 | 피어 / 링크 110 | 111 | 112 | 113 | Sort by 114 | 정렬순 115 | 116 | 117 | 118 | Combo 119 | 조합 120 | 121 | 122 | 123 | Time 124 | 시간 125 | 126 | 127 | 128 | Ranking 129 | 순위 130 | 131 | 132 | 133 | In last 134 | 최신 135 | 136 | 137 | 138 | Month 139 | 140 | 141 | 142 | 143 | Week 144 | 145 | 146 | 147 | 148 | Day 149 | 150 | 151 | 152 | 153 | From 154 | 보낸이 155 | 156 | 157 | 158 | All Peers 159 | 모든 피어 160 | 161 | 162 | 163 | Own Links 164 | 소유한 링크 165 | 166 | 167 | 168 | Show 169 | 표시 170 | 171 | 172 | 173 | Top 100 174 | 상위 100 175 | 176 | 177 | 178 | 101-200 179 | 101-200 180 | 181 | 182 | 183 | 201-300 184 | 201-300 185 | 186 | 187 | 188 | 301-400 189 | 301-400 190 | 191 | 192 | 193 | 401-500 194 | 401-500 195 | 196 | 197 | 198 | Bottom 100 199 | 하위 100 200 | 201 | 202 | 203 | Link: 204 | 링크: 205 | 206 | 207 | 208 | Add Anonymous Link 209 | 익명 링크 추가 210 | 211 | 212 | 213 | Add Link/Comment 214 | 링크/답글 추가 215 | 216 | 217 | 218 | Title: 219 | 제목: 220 | 221 | 222 | 223 | Score: 224 | 점수: 225 | 226 | 227 | 228 | 229 | +2 Great! 230 | +2 멋져요 :D 231 | 232 | 233 | 234 | 235 | +1 Good 236 | +1 좋아요 :) 237 | 238 | 239 | 240 | 241 | 0 Okay 242 | 0 괜찮아요 : | 243 | 244 | 245 | 246 | 247 | -1 Sux 248 | -1 어우 :S 249 | 250 | 251 | 252 | 253 | -2 Bad Link 254 | -2 후졌어요 :( 255 | 256 | 257 | 258 | Url: 259 | 주소: 260 | 261 | 262 | 263 | Links Cloud 264 | 링크 클라우드 265 | 266 | 267 | 268 | Add new link 269 | 새 링크 추가 270 | 271 | 272 | 273 | Share Link Anonymously 274 | 익명으로 링크 공유 275 | 276 | 277 | 278 | Vote on Link 279 | 링크에 투표 280 | 281 | 282 | 283 | Download 284 | 다운로드 285 | 286 | 287 | 288 | 289 | 290 | Add Link Failure 291 | 잘못된 링크 추가 292 | 293 | 294 | 295 | Missing Link and/or Title 296 | 링크 또는 제목이 빠졌습니다 297 | 298 | 299 | 300 | Missing Link Data 301 | 링크 데이터가 빠졌습니다 302 | 303 | 304 | 305 | Missing Comment 306 | 답글이 빠졌습니다 307 | 308 | 309 | 310 | Link Title Not Changed 311 | 링크 제목이 바뀌지 않았습니다 312 | 313 | 314 | 315 | Do you want to continue? 316 | 계속하시겠습니까? 317 | 318 | 319 | 320 | Expand 321 | 확장 322 | 323 | 324 | 325 | Hide 326 | 숨김 327 | 328 | 329 | -------------------------------------------------------------------------------- /lang/MeshDemoc_pl.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddLinksDialog 4 | 5 | 6 | 7 | Add Link 8 | Dodaj Link 9 | 10 | 11 | 12 | Cancel 13 | Anuluj 14 | 15 | 16 | 17 | Add a new Link 18 | Dodaj nowy Link 19 | 20 | 21 | 22 | Title: 23 | Tytuł: 24 | 25 | 26 | 27 | Url: 28 | Url: 29 | 30 | 31 | 32 | Add Anonymous Link 33 | Dodaj Link Anonimowy 34 | 35 | 36 | 37 | +2 Great! 38 | +2 Świetne! 39 | 40 | 41 | 42 | +1 Good 43 | +1 Dobre 44 | 45 | 46 | 47 | 0 Okay 48 | 0 W porządku 49 | 50 | 51 | 52 | -1 Sux 53 | -1 Ssie 54 | 55 | 56 | 57 | -2 Bad Link 58 | -2 Zły Link 59 | 60 | 61 | 62 | Add Link to Cloud 63 | Dodaj Link do Chmury 64 | 65 | 66 | 67 | New Link 68 | Nowy Link 69 | 70 | 71 | 72 | Add Link Failure 73 | 74 | 75 | 76 | 77 | Missing Link and/or Title 78 | Brakujący Link i/lub Tytuł 79 | 80 | 81 | 82 | LinksCloudPlugin 83 | 84 | 85 | This plugin provides a set of cached links, and a voting system to promote them. 86 | 87 | 88 | 89 | 90 | LinksCloud 91 | 92 | 93 | 94 | 95 | LinksDialog 96 | 97 | 98 | Title / Comment 99 | 100 | 101 | 102 | 103 | Score 104 | 105 | 106 | 107 | 108 | Peer / Link 109 | 110 | 111 | 112 | 113 | Sort by 114 | 115 | 116 | 117 | 118 | Combo 119 | 120 | 121 | 122 | 123 | Time 124 | Czas 125 | 126 | 127 | 128 | Ranking 129 | Ranking 130 | 131 | 132 | 133 | In last 134 | W ostatnim 135 | 136 | 137 | 138 | Month 139 | Miesiącu 140 | 141 | 142 | 143 | Week 144 | Tygodniu 145 | 146 | 147 | 148 | Day 149 | Dniu 150 | 151 | 152 | 153 | From 154 | Od 155 | 156 | 157 | 158 | All Peers 159 | 160 | 161 | 162 | 163 | Own Links 164 | Własne Linki 165 | 166 | 167 | 168 | Show 169 | Pokaż 170 | 171 | 172 | 173 | Top 100 174 | Top 100 175 | 176 | 177 | 178 | 101-200 179 | 101-200 180 | 181 | 182 | 183 | 201-300 184 | 201-300 185 | 186 | 187 | 188 | 301-400 189 | 301-400 190 | 191 | 192 | 193 | 401-500 194 | 401-500 195 | 196 | 197 | 198 | Bottom 100 199 | 200 | 201 | 202 | 203 | Link: 204 | Link: 205 | 206 | 207 | 208 | Add Anonymous Link 209 | Dodaj Link Anonimowy 210 | 211 | 212 | 213 | Add Link/Comment 214 | 215 | 216 | 217 | 218 | Title: 219 | Tytuł: 220 | 221 | 222 | 223 | Score: 224 | 225 | 226 | 227 | 228 | 229 | +2 Great! 230 | +2 Świetne! 231 | 232 | 233 | 234 | 235 | +1 Good 236 | +1 Dobre 237 | 238 | 239 | 240 | 241 | 0 Okay 242 | 0 W porządku 243 | 244 | 245 | 246 | 247 | -1 Sux 248 | -1 Ssie 249 | 250 | 251 | 252 | 253 | -2 Bad Link 254 | -2 Zły Link 255 | 256 | 257 | 258 | Url: 259 | Url: 260 | 261 | 262 | 263 | Links Cloud 264 | 265 | 266 | 267 | 268 | Add new link 269 | Dodaj nowy link 270 | 271 | 272 | 273 | Share Link Anonymously 274 | Udostępnij Link Anonimowo 275 | 276 | 277 | 278 | Vote on Link 279 | Głosuj na Link 280 | 281 | 282 | 283 | Download 284 | Pobierz 285 | 286 | 287 | 288 | 289 | 290 | Add Link Failure 291 | 292 | 293 | 294 | 295 | Missing Link and/or Title 296 | Brakujący Link i/lub Tytuł 297 | 298 | 299 | 300 | Missing Link Data 301 | 302 | 303 | 304 | 305 | Missing Comment 306 | Brakujący Komentarz 307 | 308 | 309 | 310 | Link Title Not Changed 311 | 312 | 313 | 314 | 315 | Do you want to continue? 316 | Czy chcesz kontynuować? 317 | 318 | 319 | 320 | Expand 321 | Rozwiń 322 | 323 | 324 | 325 | Hide 326 | Ukryj 327 | 328 | 329 | -------------------------------------------------------------------------------- /lang/MeshDemoc_sv.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddLinksDialog 4 | 5 | 6 | 7 | Add Link 8 | Lägg till länk 9 | 10 | 11 | 12 | Cancel 13 | Avbryt 14 | 15 | 16 | 17 | Add a new Link 18 | Lägg till ny länk 19 | 20 | 21 | 22 | Title: 23 | Titel: 24 | 25 | 26 | 27 | Url: 28 | URL: 29 | 30 | 31 | 32 | Add Anonymous Link 33 | Lägg till länk anonymt 34 | 35 | 36 | 37 | +2 Great! 38 | +2 Toppen! 39 | 40 | 41 | 42 | +1 Good 43 | +1 Bra 44 | 45 | 46 | 47 | 0 Okay 48 | 0 Okay 49 | 50 | 51 | 52 | -1 Sux 53 | -1 Suger 54 | 55 | 56 | 57 | -2 Bad Link 58 | -2 Dålig länk 59 | 60 | 61 | 62 | Add Link to Cloud 63 | Lägg till länk i molnet 64 | 65 | 66 | 67 | New Link 68 | Ny länk 69 | 70 | 71 | 72 | Add Link Failure 73 | Kunde inte lägga till länk 74 | 75 | 76 | 77 | Missing Link and/or Title 78 | Länk och/eller titel saknas 79 | 80 | 81 | 82 | LinksCloudPlugin 83 | 84 | 85 | This plugin provides a set of cached links, and a voting system to promote them. 86 | Det här tilläggsprogrammet tillför en uppsättning cachade länkar, och ett poängsystem för att klassificera dem. 87 | 88 | 89 | 90 | LinksCloud 91 | LänkMoln 92 | 93 | 94 | 95 | LinksDialog 96 | 97 | 98 | Title / Comment 99 | Titel / Kommentar 100 | 101 | 102 | 103 | Score 104 | Poäng 105 | 106 | 107 | 108 | Peer / Link 109 | Användare / Länk 110 | 111 | 112 | 113 | Sort by 114 | Sortera enligt 115 | 116 | 117 | 118 | Combo 119 | Kombo 120 | 121 | 122 | 123 | Time 124 | Tid 125 | 126 | 127 | 128 | Ranking 129 | Ranking 130 | 131 | 132 | 133 | In last 134 | Sist in 135 | 136 | 137 | 138 | Month 139 | Månad 140 | 141 | 142 | 143 | Week 144 | Vecka 145 | 146 | 147 | 148 | Day 149 | Dag 150 | 151 | 152 | 153 | From 154 | Från 155 | 156 | 157 | 158 | All Peers 159 | Alla användare 160 | 161 | 162 | 163 | Own Links 164 | Egna länkar 165 | 166 | 167 | 168 | Show 169 | Visa 170 | 171 | 172 | 173 | Top 100 174 | Topp 100 175 | 176 | 177 | 178 | 101-200 179 | 101-200 180 | 181 | 182 | 183 | 201-300 184 | 201-300 185 | 186 | 187 | 188 | 301-400 189 | 301-400 190 | 191 | 192 | 193 | 401-500 194 | 401-500 195 | 196 | 197 | 198 | Bottom 100 199 | 100 från botten 200 | 201 | 202 | 203 | Link: 204 | Länk: 205 | 206 | 207 | 208 | Add Anonymous Link 209 | Lägg till länk anonymt 210 | 211 | 212 | 213 | Add Link/Comment 214 | Lägg till länk/kommentar 215 | 216 | 217 | 218 | Title: 219 | Titel: 220 | 221 | 222 | 223 | Score: 224 | Poäng: 225 | 226 | 227 | 228 | 229 | +2 Great! 230 | +2 Toppen! 231 | 232 | 233 | 234 | 235 | +1 Good 236 | +1 Bra 237 | 238 | 239 | 240 | 241 | 0 Okay 242 | 0 Okay 243 | 244 | 245 | 246 | 247 | -1 Sux 248 | -1 Suger 249 | 250 | 251 | 252 | 253 | -2 Bad Link 254 | -2 Dålig länk 255 | 256 | 257 | 258 | Url: 259 | URL: 260 | 261 | 262 | 263 | Links Cloud 264 | Länkmoln 265 | 266 | 267 | 268 | Add new link 269 | Lägg till ny länk 270 | 271 | 272 | 273 | Share Link Anonymously 274 | Dela länk anonymt 275 | 276 | 277 | 278 | Vote on Link 279 | Rösta på länk 280 | 281 | 282 | 283 | Download 284 | Ladda ner 285 | 286 | 287 | 288 | 289 | 290 | Add Link Failure 291 | Kunde inte lägga till länk 292 | 293 | 294 | 295 | Missing Link and/or Title 296 | Länk och/eller titel saknas 297 | 298 | 299 | 300 | Missing Link Data 301 | Länkdata saknas 302 | 303 | 304 | 305 | Missing Comment 306 | Kommentar saknas 307 | 308 | 309 | 310 | Link Title Not Changed 311 | Länktitel ej ändrad 312 | 313 | 314 | 315 | Do you want to continue? 316 | Vill du fortsätta? 317 | 318 | 319 | 320 | Expand 321 | Visa 322 | 323 | 324 | 325 | Hide 326 | Dölj 327 | 328 | 329 | -------------------------------------------------------------------------------- /lang/MeshDemoc_cs.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddLinksDialog 4 | 5 | 6 | 7 | Add Link 8 | Přidat odkaz 9 | 10 | 11 | 12 | Cancel 13 | Zrušit 14 | 15 | 16 | 17 | Add a new Link 18 | Přidat nový odkaz 19 | 20 | 21 | 22 | Title: 23 | Titulek 24 | 25 | 26 | 27 | Url: 28 | Url: 29 | 30 | 31 | 32 | Add Anonymous Link 33 | Přidat anonymní odkaz 34 | 35 | 36 | 37 | +2 Great! 38 | +2 Výborný 39 | 40 | 41 | 42 | +1 Good 43 | +1 Dobrý 44 | 45 | 46 | 47 | 0 Okay 48 | 0 OK 49 | 50 | 51 | 52 | -1 Sux 53 | -1 Špatný 54 | 55 | 56 | 57 | -2 Bad Link 58 | -2 Špatný odkaz 59 | 60 | 61 | 62 | Add Link to Cloud 63 | Přidat odkaz do Cloudu 64 | 65 | 66 | 67 | New Link 68 | Nový odkaz 69 | 70 | 71 | 72 | Add Link Failure 73 | Přidání odkazu selhalo 74 | 75 | 76 | 77 | Missing Link and/or Title 78 | Chybí odkaz nebo titulek 79 | 80 | 81 | 82 | LinksCloudPlugin 83 | 84 | 85 | This plugin provides a set of cached links, and a voting system to promote them. 86 | Tento zásuvný modul poskytuje sadu mezipaměti odkazů, a hlasovací systém na jejich podporu 87 | 88 | 89 | 90 | LinksCloud 91 | LinksCloud 92 | 93 | 94 | 95 | LinksDialog 96 | 97 | 98 | Title / Comment 99 | Titulek / Komentáře 100 | 101 | 102 | 103 | Score 104 | Skóre 105 | 106 | 107 | 108 | Peer / Link 109 | Peer / Odkaz 110 | 111 | 112 | 113 | Sort by 114 | Seřadit podle 115 | 116 | 117 | 118 | Combo 119 | Dvojité 120 | 121 | 122 | 123 | Time 124 | Čas 125 | 126 | 127 | 128 | Ranking 129 | Žebříček 130 | 131 | 132 | 133 | In last 134 | Jako poslední 135 | 136 | 137 | 138 | Month 139 | Měsíc 140 | 141 | 142 | 143 | Week 144 | Týden 145 | 146 | 147 | 148 | Day 149 | Den 150 | 151 | 152 | 153 | From 154 | Od 155 | 156 | 157 | 158 | All Peers 159 | Všechny peery 160 | 161 | 162 | 163 | Own Links 164 | Naše odkazy 165 | 166 | 167 | 168 | Show 169 | Zobrazit 170 | 171 | 172 | 173 | Top 100 174 | Top 100 175 | 176 | 177 | 178 | 101-200 179 | 101-200 180 | 181 | 182 | 183 | 201-300 184 | 201-300 185 | 186 | 187 | 188 | 301-400 189 | 301-400 190 | 191 | 192 | 193 | 401-500 194 | 401-500 195 | 196 | 197 | 198 | Bottom 100 199 | Spodní 100 200 | 201 | 202 | 203 | Link: 204 | Odkaz: 205 | 206 | 207 | 208 | Add Anonymous Link 209 | Přidat anonymní odkaz 210 | 211 | 212 | 213 | Add Link/Comment 214 | Přidat odkaz / komentář 215 | 216 | 217 | 218 | Title: 219 | Titulek: 220 | 221 | 222 | 223 | Score: 224 | Skóre: 225 | 226 | 227 | 228 | 229 | +2 Great! 230 | +2 Výborný 231 | 232 | 233 | 234 | 235 | +1 Good 236 | +1 Dobrý 237 | 238 | 239 | 240 | 241 | 0 Okay 242 | 0 OK 243 | 244 | 245 | 246 | 247 | -1 Sux 248 | -1 Špatný 249 | 250 | 251 | 252 | 253 | -2 Bad Link 254 | -2 Špatný odkaz 255 | 256 | 257 | 258 | Url: 259 | Url: 260 | 261 | 262 | 263 | Links Cloud 264 | Odkazový Cloud 265 | 266 | 267 | 268 | Add new link 269 | Přidat nový odkaz 270 | 271 | 272 | 273 | Share Link Anonymously 274 | Sdílet odkaz anonymně 275 | 276 | 277 | 278 | Vote on Link 279 | Volte na odkaze 280 | 281 | 282 | 283 | Download 284 | Stáhnout 285 | 286 | 287 | 288 | 289 | 290 | Add Link Failure 291 | Přidání odkazu selhalo 292 | 293 | 294 | 295 | Missing Link and/or Title 296 | Chybí odkaz nebo titulek 297 | 298 | 299 | 300 | Missing Link Data 301 | Chybějí odkazová data 302 | 303 | 304 | 305 | Missing Comment 306 | Chybějící komentář 307 | 308 | 309 | 310 | Link Title Not Changed 311 | Nebyl zadán titulek odkazu 312 | 313 | 314 | 315 | Do you want to continue? 316 | Chcete pokračovat? 317 | 318 | 319 | 320 | Expand 321 | Rozbalit 322 | 323 | 324 | 325 | Hide 326 | Skrýt 327 | 328 | 329 | --------------------------------------------------------------------------------