diff --git a/libretroshare/src/file_sharing/rsfilelistitems.h b/libretroshare/src/file_sharing/rsfilelistitems.h index 68a7d2d8c..20ea2f649 100644 --- a/libretroshare/src/file_sharing/rsfilelistitems.h +++ b/libretroshare/src/file_sharing/rsfilelistitems.h @@ -107,7 +107,7 @@ class RsFileListsBannedHashesItem: public RsFileListsItem public: RsFileListsBannedHashesItem() : RsFileListsItem(RS_PKT_SUBTYPE_FILELISTS_BANNED_HASHES_ITEM){} - virtual void clear(); + virtual void clear() { encrypted_hashes.clear(); } virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); std::set encrypted_hashes ;// hash of hash for each banned file. diff --git a/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp new file mode 100644 index 000000000..49981410c --- /dev/null +++ b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp @@ -0,0 +1,36 @@ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp * + * * + * Copyright 2018 by Retroshare Team * + * * + * 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 "retroshare/rsfiles.h" + +#include "BannedFilesDialog.h" + +BannedFilesDialog::BannedFilesDialog(QWidget *parent) + : QDialog(parent) +{ + ui.setupUi(this); +} + +BannedFilesDialog::~BannedFilesDialog() {} + +void BannedFilesDialog::unbanFile() +{ +#warning Code missing here +} diff --git a/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h new file mode 100644 index 000000000..a76efb7b9 --- /dev/null +++ b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h @@ -0,0 +1,46 @@ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h * + * * + * Copyright 2018 by Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ + +#pragma once + +#include "RsAutoUpdatePage.h" +#include "ui_BannedFilesDialog.h" + +class BannedFilesDialog: public QDialog +{ + Q_OBJECT + +public: + /** Default Constructor */ + BannedFilesDialog(QWidget *parent = 0); + /** Default Destructor */ + ~BannedFilesDialog(); + +private slots: + void unbanFile(); + + /** management of the adv search dialog object when switching search modes */ + //void hideEvent(QHideEvent * event); + +private: + /** Qt Designer generated object */ + Ui::BannedFilesDialog ui; +}; + diff --git a/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.ui b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.ui new file mode 100644 index 000000000..1b3833f58 --- /dev/null +++ b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.ui @@ -0,0 +1,48 @@ + + + BannedFilesDialog + + + + 0 + 0 + 923 + 810 + + + + + + + true + + + + Filename + + + + + Hash + + + + + Size + + + + + Banned since... + + + + + + + + + + + + diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp index e844f9866..f017529b1 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp @@ -26,6 +26,7 @@ #include "rshare.h" #include "SearchDialog.h" +#include "gui/FileTransfer/BannedFilesDialog.h" #include "gui/RSHumanReadableDelegate.h" #include "gui/RetroShareLink.h" #include "retroshare-gui/RsAutoUpdatePage.h" @@ -118,6 +119,7 @@ SearchDialog::SearchDialog(QWidget *parent) connect( ui.searchResultWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( searchResultWidgetCustomPopupMenu( QPoint ) ) ); connect( ui.searchSummaryWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( searchSummaryWidgetCustomPopupMenu( QPoint ) ) ); + connect( ui.showBannedFiles_TB, SIGNAL( clicked() ), this, SLOT( openBannedFiles() ) ); connect( ui.lineEdit, SIGNAL( returnPressed ( void ) ), this, SLOT( searchKeywords( void ) ) ); connect( ui.lineEdit, SIGNAL( textChanged ( const QString& ) ), this, SLOT( checkText( const QString& ) ) ); @@ -443,11 +445,17 @@ void SearchDialog::ban() rsFiles -> banFile( hash, (item->text(SR_NAME_COL)).toUtf8().constData() , (item->text(SR_SIZE_COL)).toULongLong()); - ui.searchResultWidget->takeItem(item) ; + ui.searchResultWidget->takeTopLevelItem(ui.searchResultWidget->indexOfTopLevelItem(item)) ; } } } +void SearchDialog::openBannedFiles() +{ + BannedFilesDialog d ; + d.exec(); +} + void SearchDialog::collCreate() { std::vector dirVec; diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.h b/retroshare-gui/src/gui/FileTransfer/SearchDialog.h index 968b0e725..001ae3903 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.h +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.h @@ -87,6 +87,7 @@ private slots: void recommendtofriends(); void checkText(const QString&); + void openBannedFiles(); void copyResultLink(); void copySearchLink(); void openFolderSearch(); diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui b/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui index b3df60f05..47e221bf5 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui @@ -170,6 +170,23 @@ + + + + + 0 + 0 + + + + + + + + :/icons/biohazard_red.png:/icons/biohazard_red.png + + + @@ -450,6 +467,7 @@ + diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h index 51bc205d3..f98a96daa 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h @@ -55,7 +55,8 @@ public: /* Fixed numbers for load and save the last page */ SearchTab = 0, /** Network page. */ LocalSharedFilesTab = 1, /** Network new graph. */ - RemoteSharedFilesTab = 2 /** Old group chat page. */ + RemoteSharedFilesTab = 2, /** Old group chat page. */ + DownloadTab = 3 }; @@ -108,9 +109,6 @@ private slots: void expandAllUL(); void collapseAllUL(); -// void rootdecorated(); -// void rootisnotdecorated(); - void pauseFileTransfer(); void resumeFileTransfer(); void dlOpenFolder(); diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index d973e5de8..b5b17d159 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -365,6 +365,7 @@ HEADERS += rshare.h \ gui/FileTransfer/DLListDelegate.h \ gui/FileTransfer/ULListDelegate.h \ gui/FileTransfer/TransfersDialog.h \ + gui/FileTransfer/BannedFilesDialog.h \ gui/statistics/TurtleRouterDialog.h \ gui/statistics/TurtleRouterStatistics.h \ gui/statistics/dhtgraph.h \ @@ -597,6 +598,7 @@ FORMS += gui/StartDialog.ui \ gui/FileTransfer/DetailsDialog.ui \ gui/FileTransfer/SearchDialog.ui \ gui/FileTransfer/SharedFilesDialog.ui \ + gui/FileTransfer/BannedFilesDialog.ui \ gui/MainWindow.ui \ gui/NetworkView.ui \ gui/MessengerWindow.ui \ @@ -743,6 +745,7 @@ SOURCES += main.cpp \ gui/FileTransfer/xprogressbar.cpp \ gui/FileTransfer/DetailsDialog.cpp \ gui/FileTransfer/TransferUserNotify.cpp \ + gui/FileTransfer/BannedFilesDialog.cpp \ gui/MainPage.cpp \ gui/HelpDialog.cpp \ gui/LogoBar.cpp \