mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-10 14:25:50 -05:00
Merge branch 'master' into jsonapi
This commit is contained in:
commit
047ae7f723
260 changed files with 1737 additions and 1178 deletions
|
|
@ -76,6 +76,7 @@
|
|||
#define IMAGE_COLLOPEN ":/images/library.png"
|
||||
#define IMAGE_EDITSHARE ":/images/edit_16.png"
|
||||
#define IMAGE_MYFILES ":/icons/svg/folders1.svg"
|
||||
#define IMAGE_REMOVE ":/images/deletemail24.png"
|
||||
|
||||
/*define viewType_CB value */
|
||||
#define VIEW_TYPE_TREE 0
|
||||
|
|
@ -229,6 +230,9 @@ SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareD
|
|||
sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links" ), this );
|
||||
connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) );
|
||||
|
||||
removeExtraFileAct = new QAction(QIcon(IMAGE_REMOVE), tr( "Stop sharing this file" ), this );
|
||||
connect( removeExtraFileAct , SIGNAL( triggered() ), this, SLOT( removeExtraFile() ) );
|
||||
|
||||
collCreateAct= new QAction(QIcon(IMAGE_COLLCREATE), tr("Create Collection..."), this) ;
|
||||
connect(collCreateAct,SIGNAL(triggered()),this,SLOT(collCreate())) ;
|
||||
collModifAct= new QAction(QIcon(IMAGE_COLLMODIF), tr("Modify Collection..."), this) ;
|
||||
|
|
@ -1093,7 +1097,7 @@ void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
|
|||
|
||||
currentFile = model->data(midx, RetroshareDirModel::FileNameRole).toString() ;
|
||||
int type = model->getType(midx) ;
|
||||
if (type != DIR_TYPE_DIR && type != DIR_TYPE_FILE) return;
|
||||
if (type != DIR_TYPE_DIR && type != DIR_TYPE_FILE && type != DIR_TYPE_EXTRA_FILE) return;
|
||||
|
||||
QMenu contextMnu(this) ;
|
||||
|
||||
|
|
@ -1127,58 +1131,71 @@ void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
|
|||
contextMnu.addMenu(&collectionMenu) ;
|
||||
contextMnu.addSeparator() ;//------------------------------------
|
||||
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to..."), this, SLOT(recommendFilesToMsg())) ;
|
||||
break;
|
||||
|
||||
case DIR_TYPE_EXTRA_FILE:
|
||||
contextMnu.addAction(openfileAct) ;
|
||||
contextMnu.addSeparator() ;//------------------------------------
|
||||
contextMnu.addAction(copylinkAct) ;
|
||||
contextMnu.addAction(sendlinkAct) ;
|
||||
contextMnu.addAction(removeExtraFileAct) ;
|
||||
|
||||
break ;
|
||||
|
||||
default :
|
||||
return ;
|
||||
}
|
||||
|
||||
GxsChannelDialog *channelDialog = dynamic_cast<GxsChannelDialog*>(MainWindow::getPage(MainWindow::Channels));
|
||||
QMenu shareChannelMenu(tr("Share on channel...")) ; // added here because the shareChannelMenu QMenu object is deleted afterwards
|
||||
|
||||
if(channelDialog != NULL)
|
||||
{
|
||||
shareChannelMenu.setIcon(QIcon(IMAGE_CHANNEL));
|
||||
|
||||
std::map<RsGxsGroupId,RsGroupMetaData> grp_metas ;
|
||||
channelDialog->getGroupList(grp_metas) ;
|
||||
|
||||
std::vector<std::pair<std::string,RsGxsGroupId> > grplist ; // I dont use a std::map because two or more channels may have the same name.
|
||||
|
||||
for(auto it(grp_metas.begin());it!=grp_metas.end();++it)
|
||||
if(IS_GROUP_PUBLISHER((*it).second.mSubscribeFlags) && IS_GROUP_SUBSCRIBED((*it).second.mSubscribeFlags))
|
||||
grplist.push_back(std::make_pair((*it).second.mGroupName, (*it).second.mGroupId));
|
||||
|
||||
std::sort(grplist.begin(),grplist.end(),ChannelCompare()) ;
|
||||
|
||||
for(auto it(grplist.begin());it!=grplist.end();++it)
|
||||
shareChannelMenu.addAction(QString::fromUtf8((*it).first.c_str()), this, SLOT(shareOnChannel()))->setData(QString::fromStdString((*it).second.toStdString())) ;
|
||||
|
||||
contextMnu.addMenu(&shareChannelMenu) ;
|
||||
}
|
||||
|
||||
GxsForumsDialog *forumsDialog = dynamic_cast<GxsForumsDialog*>(MainWindow::getPage(MainWindow::Forums));
|
||||
QMenu shareForumMenu(tr("Share on forum...")) ; // added here because the shareChannelMenu QMenu object is deleted afterwards
|
||||
|
||||
if(forumsDialog != NULL)
|
||||
if(type != DIR_TYPE_EXTRA_FILE)
|
||||
{
|
||||
shareForumMenu.setIcon(QIcon(IMAGE_FORUMS));
|
||||
GxsChannelDialog *channelDialog = dynamic_cast<GxsChannelDialog*>(MainWindow::getPage(MainWindow::Channels));
|
||||
|
||||
std::map<RsGxsGroupId,RsGroupMetaData> grp_metas ;
|
||||
forumsDialog->getGroupList(grp_metas) ;
|
||||
if(channelDialog != NULL)
|
||||
{
|
||||
shareChannelMenu.setIcon(QIcon(IMAGE_CHANNEL));
|
||||
|
||||
std::vector<std::pair<std::string,RsGxsGroupId> > grplist ; // I dont use a std::map because two or more channels may have the same name.
|
||||
std::map<RsGxsGroupId,RsGroupMetaData> grp_metas ;
|
||||
channelDialog->getGroupList(grp_metas) ;
|
||||
|
||||
for(auto it(grp_metas.begin());it!=grp_metas.end();++it)
|
||||
if(IS_GROUP_SUBSCRIBED((*it).second.mSubscribeFlags))
|
||||
grplist.push_back(std::make_pair((*it).second.mGroupName, (*it).second.mGroupId));
|
||||
std::vector<std::pair<std::string,RsGxsGroupId> > grplist ; // I dont use a std::map because two or more channels may have the same name.
|
||||
|
||||
std::sort(grplist.begin(),grplist.end(),ChannelCompare()) ;
|
||||
for(auto it(grp_metas.begin());it!=grp_metas.end();++it)
|
||||
if(IS_GROUP_PUBLISHER((*it).second.mSubscribeFlags) && IS_GROUP_SUBSCRIBED((*it).second.mSubscribeFlags))
|
||||
grplist.push_back(std::make_pair((*it).second.mGroupName, (*it).second.mGroupId));
|
||||
|
||||
for(auto it(grplist.begin());it!=grplist.end();++it)
|
||||
shareForumMenu.addAction(QString::fromUtf8((*it).first.c_str()), this, SLOT(shareInForum()))->setData(QString::fromStdString((*it).second.toStdString())) ;
|
||||
std::sort(grplist.begin(),grplist.end(),ChannelCompare()) ;
|
||||
|
||||
contextMnu.addMenu(&shareForumMenu) ;
|
||||
for(auto it(grplist.begin());it!=grplist.end();++it)
|
||||
shareChannelMenu.addAction(QString::fromUtf8((*it).first.c_str()), this, SLOT(shareOnChannel()))->setData(QString::fromStdString((*it).second.toStdString())) ;
|
||||
|
||||
contextMnu.addMenu(&shareChannelMenu) ;
|
||||
}
|
||||
|
||||
GxsForumsDialog *forumsDialog = dynamic_cast<GxsForumsDialog*>(MainWindow::getPage(MainWindow::Forums));
|
||||
|
||||
if(forumsDialog != NULL)
|
||||
{
|
||||
shareForumMenu.setIcon(QIcon(IMAGE_FORUMS));
|
||||
|
||||
std::map<RsGxsGroupId,RsGroupMetaData> grp_metas ;
|
||||
forumsDialog->getGroupList(grp_metas) ;
|
||||
|
||||
std::vector<std::pair<std::string,RsGxsGroupId> > grplist ; // I dont use a std::map because two or more channels may have the same name.
|
||||
|
||||
for(auto it(grp_metas.begin());it!=grp_metas.end();++it)
|
||||
if(IS_GROUP_SUBSCRIBED((*it).second.mSubscribeFlags))
|
||||
grplist.push_back(std::make_pair((*it).second.mGroupName, (*it).second.mGroupId));
|
||||
|
||||
std::sort(grplist.begin(),grplist.end(),ChannelCompare()) ;
|
||||
|
||||
for(auto it(grplist.begin());it!=grplist.end();++it)
|
||||
shareForumMenu.addAction(QString::fromUtf8((*it).first.c_str()), this, SLOT(shareInForum()))->setData(QString::fromStdString((*it).second.toStdString())) ;
|
||||
|
||||
contextMnu.addMenu(&shareForumMenu) ;
|
||||
}
|
||||
}
|
||||
|
||||
contextMnu.exec(QCursor::pos()) ;
|
||||
|
|
@ -1564,6 +1581,20 @@ void SharedFilesDialog::FilterItems()
|
|||
#endif
|
||||
}
|
||||
|
||||
void SharedFilesDialog::removeExtraFile()
|
||||
{
|
||||
std::list<DirDetails> files_info ;
|
||||
|
||||
model->getFileInfoFromIndexList(getSelected(),files_info);
|
||||
|
||||
for(auto it(files_info.begin());it!=files_info.end();++it)
|
||||
{
|
||||
std::cerr << "removing file " << (*it).name << ", hash = " << (*it).hash << std::endl;
|
||||
|
||||
rsFiles->ExtraFileRemove((*it).hash);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEPRECATED_CODE
|
||||
bool SharedFilesDialog::flat_FilterItem(const QModelIndex &index, const QString &text, int /*level*/)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ private slots:
|
|||
void copyLink();
|
||||
void copyLinkhtml();
|
||||
void sendLinkTo();
|
||||
void removeExtraFile();
|
||||
|
||||
void collCreate();
|
||||
void collModif();
|
||||
|
|
@ -122,6 +123,7 @@ protected:
|
|||
QAction* sendlinkAct;
|
||||
QAction* sendchatlinkAct;
|
||||
QAction* copylinkhtmlAct;
|
||||
QAction* removeExtraFileAct;
|
||||
|
||||
QAction *collCreateAct;
|
||||
QAction *collModifAct;
|
||||
|
|
|
|||
|
|
@ -826,6 +826,9 @@ TransfersDialog::TransfersDialog(QWidget *parent)
|
|||
QHeaderView *qhvDLList = ui.downloadList->header();
|
||||
qhvDLList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(qhvDLList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(downloadListHeaderCustomPopupMenu(QPoint)));
|
||||
QHeaderView *qhvULList = ui.uploadsList->header();
|
||||
qhvULList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(qhvULList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(uploadsListHeaderCustomPopupMenu(QPoint)));
|
||||
|
||||
// Why disable autoscroll ?
|
||||
// With disabled autoscroll, the treeview doesn't scroll with cursor move
|
||||
|
|
@ -1006,7 +1009,7 @@ TransfersDialog::TransfersDialog(QWidget *parent)
|
|||
collOpenAct = new QAction(QIcon(IMAGE_COLLOPEN), tr( "Download from collection file..." ), this );
|
||||
connect(collOpenAct, SIGNAL(triggered()), this, SLOT(collOpen()));
|
||||
|
||||
/** Setup the actions for the header context menu */
|
||||
/** Setup the actions for the download header context menu */
|
||||
showDLSizeAct= new QAction(tr("Size"),this);
|
||||
showDLSizeAct->setCheckable(true); showDLSizeAct->setToolTip(tr("Show Size Column"));
|
||||
connect(showDLSizeAct,SIGNAL(triggered(bool)),this,SLOT(setShowDLSizeColumn(bool))) ;
|
||||
|
|
@ -1044,6 +1047,26 @@ TransfersDialog::TransfersDialog(QWidget *parent)
|
|||
showDLPath->setCheckable(true); showDLPath->setToolTip(tr("Show Path Column"));
|
||||
connect(showDLPath,SIGNAL(triggered(bool)),this,SLOT(setShowDLPath(bool))) ;
|
||||
|
||||
/** Setup the actions for the upload header context menu */
|
||||
showULPeerAct= new QAction(tr("Peer"),this);
|
||||
showULPeerAct->setCheckable(true); showULPeerAct->setToolTip(tr("Show Peer Column"));
|
||||
connect(showULPeerAct,SIGNAL(triggered(bool)),this,SLOT(setShowULPeerColumn(bool))) ;
|
||||
showULSizeAct= new QAction(tr("Size"),this);
|
||||
showULSizeAct->setCheckable(true); showULSizeAct->setToolTip(tr("Show Peer Column"));
|
||||
connect(showULSizeAct,SIGNAL(triggered(bool)),this,SLOT(setShowULSizeColumn(bool))) ;
|
||||
showULTransferredAct= new QAction(tr("Transferred"),this);
|
||||
showULTransferredAct->setCheckable(true); showULTransferredAct->setToolTip(tr("Show Transferred Column"));
|
||||
connect(showULTransferredAct,SIGNAL(triggered(bool)),this,SLOT(setShowULTransferredColumn(bool))) ;
|
||||
showULSpeedAct= new QAction(tr("Speed"),this);
|
||||
showULSpeedAct->setCheckable(true); showULSpeedAct->setToolTip(tr("Show Speed Column"));
|
||||
connect(showULSpeedAct,SIGNAL(triggered(bool)),this,SLOT(setShowULSpeedColumn(bool))) ;
|
||||
showULProgressAct= new QAction(tr("Progress"),this);
|
||||
showULProgressAct->setCheckable(true); showULProgressAct->setToolTip(tr("Show Progress Column"));
|
||||
connect(showULProgressAct,SIGNAL(triggered(bool)),this,SLOT(setShowULProgressColumn(bool))) ;
|
||||
showULHashAct= new QAction(tr("Hash"),this);
|
||||
showULHashAct->setCheckable(true); showULHashAct->setToolTip(tr("Show Hash Column"));
|
||||
connect(showULHashAct,SIGNAL(triggered(bool)),this,SLOT(setShowULHashColumn(bool))) ;
|
||||
|
||||
/** Setup the actions for the upload context menu */
|
||||
ulOpenFolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
|
||||
connect(ulOpenFolderAct, SIGNAL(triggered()), this, SLOT(ulOpenFolder()));
|
||||
|
|
@ -1420,6 +1443,29 @@ void TransfersDialog::uploadsListCustomPopupMenu( QPoint /*point*/ )
|
|||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void TransfersDialog::uploadsListHeaderCustomPopupMenu( QPoint /*point*/ )
|
||||
{
|
||||
std::cerr << "TransfersDialog::uploadsListHeaderCustomPopupMenu()" << std::endl;
|
||||
QMenu contextMnu( this );
|
||||
|
||||
showULPeerAct->setChecked(!ui.uploadsList->isColumnHidden(COLUMN_UPEER));
|
||||
showULSizeAct->setChecked(!ui.uploadsList->isColumnHidden(COLUMN_USIZE));
|
||||
showULTransferredAct->setChecked(!ui.uploadsList->isColumnHidden(COLUMN_UTRANSFERRED));
|
||||
showULSpeedAct->setChecked(!ui.uploadsList->isColumnHidden(COLUMN_ULSPEED));
|
||||
showULProgressAct->setChecked(!ui.uploadsList->isColumnHidden(COLUMN_UPROGRESS));
|
||||
showULHashAct->setChecked(!ui.uploadsList->isColumnHidden(COLUMN_UHASH));
|
||||
|
||||
QMenu *menu = contextMnu.addMenu(tr("Columns"));
|
||||
menu->addAction(showULPeerAct);
|
||||
menu->addAction(showULSizeAct);
|
||||
menu->addAction(showULTransferredAct);
|
||||
menu->addAction(showULSpeedAct);
|
||||
menu->addAction(showULProgressAct);
|
||||
menu->addAction(showULHashAct);
|
||||
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void TransfersDialog::chooseDestinationDirectory()
|
||||
{
|
||||
QString dest_dir = QFileDialog::getExistingDirectory(this,tr("Choose directory")) ;
|
||||
|
|
@ -2791,6 +2837,13 @@ void TransfersDialog::setShowDLIDColumn (bool show) { ui.downloadList->
|
|||
void TransfersDialog::setShowDLLastDLColumn (bool show) { ui.downloadList->setColumnHidden(COLUMN_LASTDL, !show); }
|
||||
void TransfersDialog::setShowDLPath (bool show) { ui.downloadList->setColumnHidden(COLUMN_PATH, !show); }
|
||||
|
||||
void TransfersDialog::setShowULPeerColumn (bool show) { ui.uploadsList->setColumnHidden(COLUMN_UPEER, !show); }
|
||||
void TransfersDialog::setShowULSizeColumn (bool show) { ui.uploadsList->setColumnHidden(COLUMN_USIZE, !show); }
|
||||
void TransfersDialog::setShowULTransferredColumn(bool show) { ui.uploadsList->setColumnHidden(COLUMN_UTRANSFERRED, !show); }
|
||||
void TransfersDialog::setShowULSpeedColumn (bool show) { ui.uploadsList->setColumnHidden(COLUMN_ULSPEED, !show); }
|
||||
void TransfersDialog::setShowULProgressColumn (bool show) { ui.uploadsList->setColumnHidden(COLUMN_UPROGRESS, !show); }
|
||||
void TransfersDialog::setShowULHashColumn (bool show) { ui.uploadsList->setColumnHidden(COLUMN_UHASH, !show); }
|
||||
|
||||
void TransfersDialog::expandAllDL()
|
||||
{
|
||||
ui.downloadList->expandAll();
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ private slots:
|
|||
void downloadListCustomPopupMenu( QPoint point );
|
||||
void downloadListHeaderCustomPopupMenu( QPoint point );
|
||||
void uploadsListCustomPopupMenu( QPoint point );
|
||||
void uploadsListHeaderCustomPopupMenu (QPoint point );
|
||||
|
||||
void cancel();
|
||||
void forceCheck();
|
||||
|
|
@ -158,6 +159,13 @@ private slots:
|
|||
void setShowDLLastDLColumn(bool show);
|
||||
void setShowDLPath(bool show);
|
||||
|
||||
void setShowULPeerColumn(bool show);
|
||||
void setShowULSizeColumn(bool show);
|
||||
void setShowULTransferredColumn(bool show);
|
||||
void setShowULSpeedColumn(bool show);
|
||||
void setShowULProgressColumn(bool show);
|
||||
void setShowULHashColumn(bool show);
|
||||
|
||||
void filterChanged(const QString &text);
|
||||
|
||||
signals:
|
||||
|
|
@ -217,7 +225,7 @@ private:
|
|||
QAction *collViewAct;
|
||||
QAction *collOpenAct;
|
||||
|
||||
/** Defines the actions for the header context menu */
|
||||
/** Defines the actions for the header context menu in download */
|
||||
QAction* showDLSizeAct;
|
||||
QAction* showDLCompleteAct;
|
||||
QAction* showDLDLSpeedAct;
|
||||
|
|
@ -235,6 +243,14 @@ private:
|
|||
QAction* ulOpenFolderAct;
|
||||
QAction* ulCopyLinkAct;
|
||||
|
||||
/** Defines the actions for the header context menu in upload*/
|
||||
QAction* showULPeerAct;
|
||||
QAction* showULSizeAct;
|
||||
QAction* showULTransferredAct;
|
||||
QAction* showULSpeedAct;
|
||||
QAction* showULProgressAct;
|
||||
QAction* showULHashAct;
|
||||
|
||||
bool m_bProcessSettings;
|
||||
void processSettings(bool bLoad);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#include "retroshare-gui/RsAutoUpdatePage.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/QtVersion.h"
|
||||
#include "util/rstime.h"
|
||||
|
||||
#include "retroshare/rsgxsflags.h"
|
||||
#include "retroshare/rsmsgs.h"
|
||||
|
|
@ -1944,11 +1945,11 @@ void IdDialog::insertIdDetails(uint32_t token)
|
|||
rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),det) ;
|
||||
|
||||
QString usage_txt ;
|
||||
std::map<time_t,RsIdentityUsage> rmap ;
|
||||
for(std::map<RsIdentityUsage,time_t>::const_iterator it(det.mUseCases.begin());it!=det.mUseCases.end();++it)
|
||||
rmap.insert(std::make_pair(it->second,it->first)) ;
|
||||
std::map<rstime_t,RsIdentityUsage> rmap;
|
||||
for(auto it(det.mUseCases.begin()); it!=det.mUseCases.end(); ++it)
|
||||
rmap.insert(std::make_pair(it->second,it->first));
|
||||
|
||||
for(std::map<time_t,RsIdentityUsage>::const_iterator it(rmap.begin());it!=rmap.end();++it)
|
||||
for(auto it(rmap.begin()); it!=rmap.end(); ++it)
|
||||
usage_txt += QString("<b>")+ getHumanReadableDuration(now - data.mLastUsageTS) + "</b> \t: " + createUsageString(it->second) + "<br/>" ;
|
||||
|
||||
if(usage_txt.isNull())
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ bool TreeStyle_RDM::hasChildren(const QModelIndex &parent) const
|
|||
return false;
|
||||
}
|
||||
|
||||
if (details.type == DIR_TYPE_FILE)
|
||||
if (details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE)
|
||||
{
|
||||
#ifdef RDM_DEBUG
|
||||
std::cerr << "lookup FILE -> false";
|
||||
|
|
@ -220,7 +220,7 @@ int TreeStyle_RDM::rowCount(const QModelIndex &parent) const
|
|||
#endif
|
||||
return 0;
|
||||
}
|
||||
if (details.type == DIR_TYPE_FILE)
|
||||
if (details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE)
|
||||
{
|
||||
#ifdef RDM_DEBUG
|
||||
std::cerr << "lookup FILE: 0";
|
||||
|
|
@ -425,7 +425,7 @@ QVariant RetroshareDirModel::decorationRole(const DirDetails& details,int coln)
|
|||
else
|
||||
return QIcon(categoryIcon);
|
||||
}
|
||||
else if (details.type == DIR_TYPE_FILE) /* File */
|
||||
else if (details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE) /* File */
|
||||
{
|
||||
// extensions predefined
|
||||
if(details.hash.isNull())
|
||||
|
|
@ -457,13 +457,12 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
|
|||
QString res ;
|
||||
|
||||
if(RemoteMode)
|
||||
{
|
||||
res = QString::fromUtf8(rsPeers->getPeerName(details.id).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
res = tr("My files");
|
||||
}
|
||||
else if(details.id == rsPeers->getOwnId())
|
||||
res = tr("My files");
|
||||
else
|
||||
res = tr("Temporary shared files");
|
||||
|
||||
return res ;
|
||||
}
|
||||
case COLUMN_FILENB: {
|
||||
|
|
@ -471,8 +470,10 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
|
|||
|
||||
if(RemoteMode)
|
||||
rsFiles->getSharedDirStatistics(details.id,stats) ;
|
||||
else
|
||||
else if(details.id == rsPeers->getOwnId())
|
||||
rsFiles->getSharedDirStatistics(rsPeers->getOwnId(),stats) ;
|
||||
else
|
||||
stats.total_number_of_files = details.count;
|
||||
|
||||
if(stats.total_number_of_files > 0)
|
||||
{
|
||||
|
|
@ -488,8 +489,10 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
|
|||
|
||||
if(RemoteMode)
|
||||
rsFiles->getSharedDirStatistics(details.id,stats) ;
|
||||
else
|
||||
else if(details.id == rsPeers->getOwnId())
|
||||
rsFiles->getSharedDirStatistics(rsPeers->getOwnId(),stats) ;
|
||||
else
|
||||
return QString();
|
||||
|
||||
if(stats.total_shared_size > 0)
|
||||
return misc::friendlyUnit(stats.total_shared_size) ;
|
||||
|
|
@ -499,6 +502,8 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
|
|||
case COLUMN_AGE:
|
||||
if(!isNewerThanEpoque(details.max_mtime))
|
||||
return QString();
|
||||
else if(details.id != rsPeers->getOwnId())
|
||||
return QString();
|
||||
else
|
||||
return misc::timeRelativeToNow(details.max_mtime);
|
||||
|
||||
|
|
@ -506,7 +511,7 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
|
|||
return QString() ;
|
||||
}
|
||||
}
|
||||
else if (details.type == DIR_TYPE_FILE) /* File */
|
||||
else if (details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE) /* File */
|
||||
{
|
||||
switch(coln)
|
||||
{
|
||||
|
|
@ -517,7 +522,7 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
|
|||
case COLUMN_SIZE:
|
||||
return misc::friendlyUnit(details.count);
|
||||
case COLUMN_AGE:
|
||||
return misc::timeRelativeToNow(details.max_mtime);
|
||||
return (details.type == DIR_TYPE_FILE)?(misc::timeRelativeToNow(details.max_mtime)):QString();
|
||||
case COLUMN_FRIEND_ACCESS:
|
||||
return QVariant();
|
||||
case COLUMN_WN_VISU_DIR:
|
||||
|
|
@ -598,7 +603,7 @@ QString FlatStyle_RDM::computeDirectoryPath(const DirDetails& details) const
|
|||
|
||||
QVariant FlatStyle_RDM::displayRole(const DirDetails& details,int coln) const
|
||||
{
|
||||
if (details.type == DIR_TYPE_FILE) /* File */
|
||||
if (details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE) /* File */
|
||||
switch(coln)
|
||||
{
|
||||
case COLUMN_NAME: return QString::fromUtf8(details.name.c_str());
|
||||
|
|
@ -654,7 +659,7 @@ QVariant TreeStyle_RDM::sortRole(const QModelIndex& /*index*/,const DirDetails&
|
|||
return QString();
|
||||
}
|
||||
}
|
||||
else if (details.type == DIR_TYPE_FILE) /* File */
|
||||
else if (details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE) /* File */
|
||||
{
|
||||
switch(coln)
|
||||
{
|
||||
|
|
@ -707,7 +712,7 @@ QVariant FlatStyle_RDM::sortRole(const QModelIndex& /*index*/,const DirDetails&
|
|||
* Dir : name, (0) count, (0) path, (0) ts
|
||||
*/
|
||||
|
||||
if (details.type == DIR_TYPE_FILE) /* File */
|
||||
if (details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE) /* File */
|
||||
{
|
||||
switch(coln)
|
||||
{
|
||||
|
|
@ -769,7 +774,7 @@ QVariant RetroshareDirModel::data(const QModelIndex &index, int role) const
|
|||
|
||||
if (role == Qt::TextColorRole)
|
||||
{
|
||||
if(details.type == DIR_TYPE_FILE && details.hash.isNull())
|
||||
if((details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE) && details.hash.isNull())
|
||||
return QVariant(QColor(Qt::green)) ;
|
||||
else if(ageIndicator != IND_ALWAYS && details.max_mtime + ageIndicator < time(NULL))
|
||||
return QVariant(QColor(Qt::gray)) ;
|
||||
|
|
@ -796,7 +801,7 @@ QVariant RetroshareDirModel::data(const QModelIndex &index, int role) const
|
|||
return decorationRole(details,coln) ;
|
||||
|
||||
if(role == Qt::ToolTipRole)
|
||||
if(!isNewerThanEpoque(details.max_mtime))
|
||||
if(!isNewerThanEpoque(details.max_mtime) && details.type == DIR_TYPE_PERSON)
|
||||
return tr("This node hasn't sent any directory information yet.") ;
|
||||
|
||||
/*****************
|
||||
|
|
@ -1083,6 +1088,7 @@ Qt::ItemFlags RetroshareDirModel::flags( const QModelIndex & index ) const
|
|||
case DIR_TYPE_PERSON: return isNewerThanEpoque(details.max_mtime)? (Qt::ItemIsEnabled):(Qt::NoItemFlags) ;
|
||||
case DIR_TYPE_DIR: return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
||||
case DIR_TYPE_FILE: return Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled;
|
||||
case DIR_TYPE_EXTRA_FILE: return Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled;
|
||||
}
|
||||
|
||||
return Qt::ItemIsSelectable;
|
||||
|
|
@ -1400,7 +1406,7 @@ void RetroshareDirModel::openSelected(const QModelIndexList &qmil)
|
|||
|
||||
QDir dir(QString::fromUtf8((*it).path.c_str()));
|
||||
QString dest;
|
||||
if ((*it).type & DIR_TYPE_FILE) {
|
||||
if ((*it).type & DIR_TYPE_FILE || (*it).type & DIR_TYPE_EXTRA_FILE) {
|
||||
dest = dir.absoluteFilePath(QString::fromUtf8(it->name.c_str()));
|
||||
} else if ((*it).type & DIR_TYPE_DIR) {
|
||||
dest = dir.absolutePath();
|
||||
|
|
@ -1509,7 +1515,7 @@ void RetroshareDirModel::filterItems(const std::list<std::string>& keywords,uint
|
|||
mFilteredPointers.insert(p) ;
|
||||
++found ;
|
||||
|
||||
while(det.type == DIR_TYPE_FILE || det.type == DIR_TYPE_DIR)
|
||||
while(det.type == DIR_TYPE_FILE || det.type == DIR_TYPE_EXTRA_FILE || det.type == DIR_TYPE_DIR)
|
||||
{
|
||||
p = det.parent ;
|
||||
rsFiles->RequestDirDetails( p, det, flags);
|
||||
|
|
@ -1555,7 +1561,7 @@ QMimeData * RetroshareDirModel::mimeData ( const QModelIndexList & indexes ) con
|
|||
std::cerr << "Path: " << details.path << std::endl;
|
||||
#endif
|
||||
|
||||
if (details.type != DIR_TYPE_FILE)
|
||||
if (details.type != DIR_TYPE_FILE && details.type != DIR_TYPE_EXTRA_FILE)
|
||||
{
|
||||
#ifdef RDM_DEBUG
|
||||
std::cerr << "RetroshareDirModel::mimeData() Not File" << std::endl;
|
||||
|
|
@ -1657,7 +1663,7 @@ void FlatStyle_RDM::updateRefs()
|
|||
|
||||
if (requestDirDetails(ref, RemoteMode,details))
|
||||
{
|
||||
if(details.type == DIR_TYPE_FILE) // only push files, not directories nor persons.
|
||||
if(details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE) // only push files, not directories nor persons.
|
||||
_ref_entries.push_back(ref) ;
|
||||
#ifdef RDM_DEBUG
|
||||
std::cerr << "FlatStyle_RDM::postMods(): adding ref " << ref << std::endl;
|
||||
|
|
@ -1683,6 +1689,9 @@ void FlatStyle_RDM::updateRefs()
|
|||
std::cerr << "reference tab contains " << std::dec << _ref_entries.size() << " files" << std::endl;
|
||||
}
|
||||
|
||||
if(_ref_stack.empty())
|
||||
_needs_update = false ;
|
||||
|
||||
RetroshareDirModel::postMods() ;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ void ChatLobbyDialog::updateParticipantsList()
|
|||
delete ui.participantsList->takeTopLevelItem(index);
|
||||
}
|
||||
|
||||
for (std::map<RsGxsId,time_t>::const_iterator it2(linfo.gxs_ids.begin()); it2 != linfo.gxs_ids.end(); ++it2)
|
||||
for (auto it2(linfo.gxs_ids.begin()); it2 != linfo.gxs_ids.end(); ++it2)
|
||||
{
|
||||
QString participant = QString::fromUtf8( (it2->first).toStdString().c_str() );
|
||||
|
||||
|
|
|
|||
|
|
@ -792,7 +792,7 @@ void ChatWidget::completeNickname(bool reverse)
|
|||
std::list<QString> participants;
|
||||
RsIdentityDetails details ;
|
||||
|
||||
for ( std::map<RsGxsId,time_t>::const_iterator it = lobby.gxs_ids.begin(); it != lobby.gxs_ids.end(); ++it)
|
||||
for (auto it = lobby.gxs_ids.begin(); it != lobby.gxs_ids.end(); ++it)
|
||||
{
|
||||
if(rsIdentity->getIdDetails(it->first,details))
|
||||
participants.push_front(QString::fromUtf8(details.mNickname.c_str()));
|
||||
|
|
@ -859,7 +859,7 @@ QAbstractItemModel *ChatWidget::modelFromPeers()
|
|||
// Get participants list
|
||||
QStringList participants;
|
||||
|
||||
for (std::map<RsGxsId,time_t>::const_iterator it = lobby.gxs_ids.begin(); it != lobby.gxs_ids.end(); ++it)
|
||||
for (auto it = lobby.gxs_ids.begin(); it != lobby.gxs_ids.end(); ++it)
|
||||
{
|
||||
RsIdentityDetails details ;
|
||||
rsIdentity->getIdDetails(it->first,details) ;
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ void SubFileItem::cancel()
|
|||
if (((mType == SFI_TYPE_ATTACH) || (mType == SFI_TYPE_CHANNEL)) && (mFlag & SFI_FLAG_CREATE))
|
||||
{
|
||||
hide();
|
||||
rsFiles->ExtraFileRemove(FileHash(), RS_FILE_REQ_ANONYMOUS_ROUTING | RS_FILE_REQ_EXTRA);
|
||||
rsFiles->ExtraFileRemove(FileHash());//, RS_FILE_REQ_ANONYMOUS_ROUTING | RS_FILE_REQ_EXTRA);
|
||||
mPath = "";
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -268,7 +268,10 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
|
|||
ui.filterComboBox->addItem(tr("Friend Nodes"));
|
||||
ui.filterComboBox->addItem(tr("All people"));
|
||||
ui.filterComboBox->addItem(tr("My contacts"));
|
||||
ui.filterComboBox->setCurrentIndex(3);
|
||||
ui.filterComboBox->setCurrentIndex(2);
|
||||
|
||||
if(rsIdentity->nbRegularContacts() > 0)
|
||||
ui.filterComboBox->setCurrentIndex(3);
|
||||
|
||||
connect(ui.comboStyle, SIGNAL(activated(int)),this, SLOT(changeFormatType(int)));
|
||||
connect(ui.comboFont, SIGNAL(activated(const QString &)), this, SLOT(textFamily(const QString &)));
|
||||
|
|
@ -1172,6 +1175,17 @@ MessageComposer *MessageComposer::replyMsg(const std::string &msgId, bool all)
|
|||
if(!msgInfo.rspeerid_srcId.isNull()) msgComposer->addRecipient(MessageComposer::TO, msgInfo.rspeerid_srcId);
|
||||
if(!msgInfo.rsgxsid_srcId.isNull()) msgComposer->addRecipient(MessageComposer::TO, msgInfo.rsgxsid_srcId);
|
||||
|
||||
// make sure the current ID is among the ones the msg was actually sent to.
|
||||
for(auto it(msgInfo.rsgxsid_msgto.begin());it!=msgInfo.rsgxsid_msgto.end();++it)
|
||||
if(rsIdentity->isOwnId(*it))
|
||||
{
|
||||
msgComposer->ui.respond_to_CB->setDefaultId(*it) ;
|
||||
break ;
|
||||
}
|
||||
// Note: another solution is to do
|
||||
// msgComposer->ui.respond_to_CB->setIdConstraintSet(msgInfo.rsgxsid_msgto); // always choose one of the destinations to originate the response!
|
||||
// but that prevent any use of IDs tht are not in the destination set to be chosen to author the msg.
|
||||
|
||||
if (all)
|
||||
{
|
||||
RsPeerId ownId = rsPeers->getOwnId();
|
||||
|
|
|
|||
|
|
@ -51,8 +51,9 @@ QIcon MessageUserNotify::getMainIcon(bool hasNew)
|
|||
|
||||
unsigned int MessageUserNotify::getNewCount()
|
||||
{
|
||||
unsigned int newInboxCount = 0;
|
||||
rsMail->getMessageCount(NULL, &newInboxCount, NULL, NULL, NULL, NULL);
|
||||
uint32_t newInboxCount = 0;
|
||||
uint32_t a, b, c, d, e; // dummies
|
||||
rsMail->getMessageCount(a, newInboxCount, b, c, d, e);
|
||||
|
||||
return newInboxCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ void GxsTransportStatistics::updateContent()
|
|||
groupTreeWidget->addTopLevelItem(item);
|
||||
groupTreeWidget->setItemExpanded(item,openned_groups.find(it->first) != openned_groups.end());
|
||||
|
||||
QString msg_time_string = (stat.last_publish_TS>0)?QString(" (Last msg: %1)").arg(QDateTime::fromTime_t(stat.last_publish_TS).toString()):"" ;
|
||||
QString msg_time_string = (stat.last_publish_TS>0)?QString(" (Last msg: %1)").arg(QDateTime::fromTime_t((uint)stat.last_publish_TS).toString()):"" ;
|
||||
|
||||
item->setData(COL_GROUP_NUM_MSGS, Qt::DisplayRole, QString::number(stat.mNumMsgs) + msg_time_string) ;
|
||||
item->setData(COL_GROUP_GRP_ID, Qt::DisplayRole, QString::fromStdString(it->first.toStdString())) ;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "RsAutoUpdatePage.h"
|
||||
#include "ui_GxsTransportStatistics.h"
|
||||
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
||||
#include "util/rstime.h"
|
||||
|
||||
class GxsTransportStatisticsWidget ;
|
||||
class UIStateHelper;
|
||||
|
|
@ -55,7 +56,7 @@ public:
|
|||
bool subscribed ;
|
||||
int popularity ;
|
||||
|
||||
time_t last_publish_TS;
|
||||
rstime_t last_publish_TS;
|
||||
|
||||
std::map<RsGxsMessageId,RsMsgMetaData> messages_metas ;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ libresapihttpserver {
|
|||
HEADERS *= gui/settings/WebuiPage.h
|
||||
SOURCES *= gui/settings/WebuiPage.cpp
|
||||
FORMS *= gui/settings/WebuiPage.ui
|
||||
} else {
|
||||
!include("../../libretroshare/src/use_libretroshare.pri"):error("Including")
|
||||
}
|
||||
|
||||
rs_jsonapi {
|
||||
|
|
@ -23,7 +25,6 @@ rs_jsonapi {
|
|||
FORMS *= gui/settings/JsonApiPage.ui
|
||||
}
|
||||
|
||||
!include("../../libretroshare/src/use_libretroshare.pri"):error("Including")
|
||||
|
||||
FORMS += TorControl/TorControlWindow.ui
|
||||
SOURCES += TorControl/TorControlWindow.cpp
|
||||
|
|
@ -283,25 +284,24 @@ wikipoos {
|
|||
# Tor controller
|
||||
|
||||
HEADERS += TorControl/AddOnionCommand.h \
|
||||
TorControl/AuthenticateCommand.h \
|
||||
TorControl/GetConfCommand.h \
|
||||
TorControl/HiddenService.h \
|
||||
TorControl/ProtocolInfoCommand.h \
|
||||
TorControl/SetConfCommand.h \
|
||||
TorControl/TorControlCommand.h \
|
||||
TorControl/TorControl.h \
|
||||
TorControl/TorControlSocket.h \
|
||||
TorControl/TorManager.h \
|
||||
TorControl/TorProcess.h \
|
||||
TorControl/TorProcess_p.h \
|
||||
TorControl/TorSocket.h \
|
||||
TorControl/Useful.h \
|
||||
TorControl/CryptoKey.h \
|
||||
TorControl/PendingOperation.h \
|
||||
TorControl/SecureRNG.h \
|
||||
TorControl/Settings.h \
|
||||
TorControl/StrUtil.h \
|
||||
TorControl/TorProcess_p.h
|
||||
TorControl/AuthenticateCommand.h \
|
||||
TorControl/CryptoKey.h \
|
||||
TorControl/GetConfCommand.h \
|
||||
TorControl/HiddenService.h \
|
||||
TorControl/PendingOperation.h \
|
||||
TorControl/ProtocolInfoCommand.h \
|
||||
TorControl/SecureRNG.h \
|
||||
TorControl/SetConfCommand.h \
|
||||
TorControl/Settings.h \
|
||||
TorControl/StrUtil.h \
|
||||
TorControl/TorControl.h \
|
||||
TorControl/TorControlCommand.h \
|
||||
TorControl/TorControlSocket.h \
|
||||
TorControl/TorManager.h \
|
||||
TorControl/TorProcess.h \
|
||||
TorControl/TorProcess_p.h \
|
||||
TorControl/TorSocket.h \
|
||||
TorControl/Useful.h
|
||||
|
||||
SOURCES += TorControl/AddOnionCommand.cpp \
|
||||
TorControl/AuthenticateCommand.cpp \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue