diff --git a/.gitignore b/.gitignore index ecf9f7099..a0335faae 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,94 @@ Thumbs.db *.pro.user .kdev4 *.kdev4 +*.a +*.Release +*.Debug +*.txt +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/config/banlist.cfg.sgn +*.sgn +*.tmp +*.gpg +*.png +*.dll +*.acs +*.types +*.qss +*.wav +*.sh +*.qm +*.qm +*.cfg +*.bin +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxschannels_db +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxscircles_db +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxsforums_db +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxsid_db +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/gxstrans_db +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/gxs/posted_db +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/keys/help.dta +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/keys/ssl_passphrase.pgp +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/keys/user_cert.pem +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/keys/user_pk.pem +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/lock +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/retro.log +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/retro.log-save +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/RetroShare.conf +retroshare-gui/src/release/Data/LOC06_8bc54cead7d90f739e13788417a28bff/RSPeers.conf +retroshare-gui/src/release/Data/pgp/lock +retroshare-gui/src/release/portable +retroshare-gui/src/release/retroshare.exe +retroshare-gui/src/release/stylesheets/Bubble/history/hincoming.htm +retroshare-gui/src/release/stylesheets/Bubble/history/houtgoing.htm +retroshare-gui/src/release/stylesheets/Bubble/history/incoming.htm +retroshare-gui/src/release/stylesheets/Bubble/history/info.xml +retroshare-gui/src/release/stylesheets/Bubble/history/main.css +retroshare-gui/src/release/stylesheets/Bubble/history/ooutgoing.htm +retroshare-gui/src/release/stylesheets/Bubble/history/outgoing.htm +retroshare-gui/src/release/stylesheets/Bubble/history/system.htm +retroshare-gui/src/release/stylesheets/Bubble/history/variants/color.css +retroshare-gui/src/release/stylesheets/Bubble/history/variants/standard.css +retroshare-gui/src/release/stylesheets/Bubble/private/hincoming.htm +retroshare-gui/src/release/stylesheets/Bubble/private/houtgoing.htm +retroshare-gui/src/release/stylesheets/Bubble/private/incoming.htm +retroshare-gui/src/release/stylesheets/Bubble/private/info.xml +retroshare-gui/src/release/stylesheets/Bubble/private/main.css +retroshare-gui/src/release/stylesheets/Bubble/private/ooutgoing.htm +retroshare-gui/src/release/stylesheets/Bubble/private/outgoing.htm +retroshare-gui/src/release/stylesheets/Bubble/private/system.htm +retroshare-gui/src/release/stylesheets/Bubble/private/variants/color.css +retroshare-gui/src/release/stylesheets/Bubble/private/variants/standard.css +retroshare-gui/src/release/stylesheets/Bubble/public/hincoming.htm +retroshare-gui/src/release/stylesheets/Bubble/public/houtgoing.htm +retroshare-gui/src/release/stylesheets/Bubble/public/incoming.htm +retroshare-gui/src/release/stylesheets/Bubble/public/info.xml +retroshare-gui/src/release/stylesheets/Bubble/public/main.css +retroshare-gui/src/release/stylesheets/Bubble/public/ooutgoing.htm +retroshare-gui/src/release/stylesheets/Bubble/public/outgoing.htm +retroshare-gui/src/release/stylesheets/Bubble/public/system.htm +retroshare-gui/src/release/stylesheets/Bubble/public/variants/color.css +retroshare-gui/src/release/stylesheets/Bubble/public/variants/standard.css +retroshare-gui/src/release/stylesheets/Bubble/src/img.svg +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/hincoming.htm +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/houtgoing.htm +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/incoming.htm +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/info.xml +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/Kopie von incoming.htm +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/main.css +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/ooutgoing.htm +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/outgoing.htm +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/system.htm +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/variants/color.css +retroshare-gui/src/release/stylesheets/Bubble_Compact/private/variants/standard.css +retroshare-gui/src/release/webui/app.css +retroshare-gui/src/release/webui/app.css.map +retroshare-gui/src/release/webui/app.js +retroshare-gui/src/release/webui/app.js.map +retroshare-gui/src/release/webui/index.html +retroshare-gui/src/temp/moc/moc_predefs.h +retroshare-gui/src/temp/moc/Settings.moc +retroshare-gui/src/temp/moc/TorControl.moc +retroshare-gui/src/temp/moc/TorManager.moc +retroshare-nogui/src/release/retroshare-nogui.exe +sh.exe.stackdump +*.stash diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index c79575bad..6af6f8994 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp * + * * + * Copyright 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include @@ -33,10 +32,11 @@ #include "gui/feeds/SubFileItem.h" #include "gui/notifyqt.h" #include "gui/RetroShareLink.h" +#include "util/DateTime.h" +#include "util/qtthreadsutils.h" #include "util/HandleRichText.h" #include -#include "util/DateTime.h" #define CHAN_DEFAULT_IMAGE ":/images/channels.png" @@ -278,7 +278,6 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group) ui->infoLastPost->setText(tr("Never")); else ui->infoLastPost->setText(DateTime::formatLongDateTime(group.mMeta.mLastPost)); - QString formatDescription = QString::fromUtf8(group.mDescription.c_str()); unsigned int formatFlag = RSHTML_FORMATTEXT_EMBED_LINKS; @@ -322,7 +321,6 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group) default: std::cerr << "(EE) badly initialised group distribution ID = " << group.mMeta.mCircleType << std::endl; } - ui->infoDistribution->setText(distrib_string); @@ -643,13 +641,13 @@ bool GxsChannelPostsWidget::navigatePostItem(const RsGxsMessageId &msgId) void GxsChannelPostsWidget::subscribeGroup(bool subscribe) { - if (groupId().isNull()) { - return; - } + RsGxsGroupId grpId(groupId()); + if (grpId.isNull()) return; - uint32_t token; - rsGxsChannels->subscribeToGroup(token, groupId(), subscribe); -// mChannelQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE); + RsThread::async([=]() + { + rsGxsChannels->subscribeToChannel(grpId, subscribe); + } ); } void GxsChannelPostsWidget::setAutoDownload(bool autoDl) @@ -665,12 +663,35 @@ void GxsChannelPostsWidget::toggleAutoDownload() return; } - bool autoDownload ; - if(!rsGxsChannels->getChannelAutoDownload(grpId,autoDownload) || !rsGxsChannels->setChannelAutoDownload(grpId, !autoDownload)) + bool autoDownload; + if(!rsGxsChannels->getChannelAutoDownload(grpId, autoDownload)) { - std::cerr << "GxsChannelDialog::toggleAutoDownload() Auto Download failed to set"; - std::cerr << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " failed to get autodownload value " + << "for channel: " << grpId.toStdString() << std::endl; + return; } + + RsThread::async([this, grpId, autoDownload]() + { + if(!rsGxsChannels->setChannelAutoDownload(grpId, !autoDownload)) + { + std::cerr << __PRETTY_FUNCTION__ << " failed to set autodownload " + << "for channel: " << grpId.toStdString() << std::endl; + return; + } + + RsQThreadUtils::postToObject( [=]() + { + /* Here it goes any code you want to be executed on the Qt Gui + * thread, for example to update the data model with new information + * after a blocking call to RetroShare API complete, note that + * Qt::QueuedConnection is important! + */ + + std::cerr << __PRETTY_FUNCTION__ << " Has been executed on GUI " + << "thread but was scheduled by async thread" << std::endl; + }, this ); + }); } bool GxsChannelPostsWidget::insertGroupData(const uint32_t &token, RsGroupMetaData &metaData)