From 26afeccacba47dabc532e8cbe373126776feee4c Mon Sep 17 00:00:00 2001 From: defnax Date: Wed, 17 Mar 2010 12:52:42 +0000 Subject: [PATCH] clean up unfinished, removed not useful sources git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2572 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/RetroShare.pro | 18 +- .../src/gui/unfinished/ApplicationWindow.cpp | 11 - .../src/gui/unfinished/BlogDialog.cpp | 210 --- .../src/gui/unfinished/BlogDialog.h | 63 - .../src/gui/unfinished/BlogDialog.ui | 219 --- .../src/gui/unfinished/LibraryDialog.cpp | 132 +- .../src/gui/unfinished/LibraryDialog.h | 25 +- .../src/gui/unfinished/LibraryDialog.ui | 1603 +++++++++-------- retroshare-gui/src/gui/unfinished/MsgFeed.cpp | 332 ---- retroshare-gui/src/gui/unfinished/MsgFeed.h | 72 - retroshare-gui/src/gui/unfinished/MsgFeed.ui | 276 --- .../src/gui/unfinished/PeersFeed.cpp | 468 ----- retroshare-gui/src/gui/unfinished/PeersFeed.h | 65 - .../src/gui/unfinished/PeersFeed.ui | 135 -- .../src/gui/unfinished/TransferFeed.cpp | 336 ---- .../src/gui/unfinished/TransferFeed.h | 69 - .../src/gui/unfinished/TransferFeed.ui | 139 -- 17 files changed, 838 insertions(+), 3335 deletions(-) delete mode 100644 retroshare-gui/src/gui/unfinished/BlogDialog.cpp delete mode 100644 retroshare-gui/src/gui/unfinished/BlogDialog.h delete mode 100644 retroshare-gui/src/gui/unfinished/BlogDialog.ui delete mode 100644 retroshare-gui/src/gui/unfinished/MsgFeed.cpp delete mode 100644 retroshare-gui/src/gui/unfinished/MsgFeed.h delete mode 100644 retroshare-gui/src/gui/unfinished/MsgFeed.ui delete mode 100644 retroshare-gui/src/gui/unfinished/PeersFeed.cpp delete mode 100644 retroshare-gui/src/gui/unfinished/PeersFeed.h delete mode 100644 retroshare-gui/src/gui/unfinished/PeersFeed.ui delete mode 100644 retroshare-gui/src/gui/unfinished/TransferFeed.cpp delete mode 100644 retroshare-gui/src/gui/unfinished/TransferFeed.h delete mode 100644 retroshare-gui/src/gui/unfinished/TransferFeed.ui diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 8da523fdd..3dd331429 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -526,40 +526,28 @@ unfinished { DEPENDPATH += gui/unfinished \ HEADERS += gui/unfinished/ApplicationWindow.h \ - gui/unfinished/BlogDialog.h \ gui/unfinished/CalDialog.h \ gui/unfinished/ExampleDialog.h \ gui/unfinished/GamesDialog.h \ - gui/unfinished/MsgFeed.h \ - gui/unfinished/PeersFeed.h \ gui/unfinished/PhotoDialog.h \ gui/unfinished/PhotoShow.h \ - gui/unfinished/StatisticDialog.h \ - gui/unfinished/TransferFeed.h + gui/unfinished/StatisticDialog.h FORMS += gui/unfinished/ApplicationWindow.ui \ - gui/unfinished/BlogDialog.ui \ gui/unfinished/CalDialog.ui \ gui/unfinished/ExampleDialog.ui \ gui/unfinished/GamesDialog.ui \ - gui/unfinished/MsgFeed.ui \ - gui/unfinished/PeersFeed.ui \ gui/unfinished/PhotoDialog.ui \ gui/unfinished/PhotoShow.ui \ - gui/unfinished/StatisticDialog.ui \ - gui/unfinished/TransferFeed.ui + gui/unfinished/StatisticDialog.ui SOURCES += gui/unfinished/ApplicationWindow.cpp \ - gui/unfinished/BlogDialog.cpp \ gui/unfinished/CalDialog.cpp \ gui/unfinished/ExampleDialog.cpp \ gui/unfinished/GamesDialog.cpp \ - gui/unfinished/MsgFeed.cpp \ - gui/unfinished/PeersFeed.cpp \ gui/unfinished/PhotoDialog.cpp \ gui/unfinished/PhotoShow.cpp \ - gui/unfinished/StatisticDialog.cpp \ - gui/unfinished/TransferFeed.cpp + gui/unfinished/StatisticDialog.cpp DEFINES *= UNFINISHED } diff --git a/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp b/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp index 0c2594e04..7daf53324 100644 --- a/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp +++ b/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp @@ -37,7 +37,6 @@ #include "CalDialog.h" #include "StatisticDialog.h" - #define FONT QFont("Arial", 9) /* Images for toolbar icons */ @@ -47,20 +46,12 @@ #define IMAGE_GAMES ":/images/kgames.png" #define IMAGE_PHOTO ":/images/lphoto.png" #define IMAGE_BWGRAPH ":/images/ksysguard.png" -#define IMAGE_RSM32 ":/images/rsmessenger32.png" -#define IMAGE_RSM16 ":/images/rsmessenger16.png" #define IMAGE_CLOSE ":/images/close_normal.png" #define IMAGE_CALENDAR ":/images/calendar.png" #define IMAGE_LIBRARY ":/images/library.png" #define IMAGE_PLUGINS ":/images/extension_32.png" - -/* Keys for UI Preferences */ -#define UI_PREF_PROMPT_ON_QUIT "UIOptions/ConfirmOnQuit" -/* uncomment this for release version */ -#define RS_RELEASE_VERSION 1 - /** Constructor */ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags) : QMainWindow(parent, flags) @@ -103,8 +94,6 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags) ui.toolBar->addSeparator(); connect(grp, SIGNAL(triggered(QAction *)), ui.stackPages, SLOT(showPage(QAction *))); - /* Create and bind the messenger button */ - //addAction(new QAction(QIcon(IMAGE_SMPLAYER), tr("SMPlayer"), ui.toolBar), SLOT(showsmplayer())); } diff --git a/retroshare-gui/src/gui/unfinished/BlogDialog.cpp b/retroshare-gui/src/gui/unfinished/BlogDialog.cpp deleted file mode 100644 index db229451e..000000000 --- a/retroshare-gui/src/gui/unfinished/BlogDialog.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ -#include - -#include "BlogDialog.h" - -#include "gui/GeneralMsgDialog.h" - -#include "rsiface/rsQblog.h" -#include "rsiface/rspeers.h" //to retrieve peer/usrId info - -#include "gui/feeds/BlogMsgItem.h" - - -/** Constructor */ -BlogDialog::BlogDialog(QWidget *parent) -: MainPage (parent) -{ - /* Invoke the Qt Designer generated object setup routine */ - setupUi(this); - - connect(postButton, SIGNAL(clicked()), this, SLOT(postBlog())); - - /* mLayout -> to add widgets to */ - mLayout = new QVBoxLayout; - //mLayout->setSpacing(0); - //mLayout->setMargin(0); - - QWidget *middleWidget = new QWidget(); - middleWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); - middleWidget->setLayout(mLayout); - - QScrollArea *scrollArea = new QScrollArea; - //scrollArea->setBackgroundRole(QPalette::Dark); - scrollArea->setWidget(middleWidget); - scrollArea->setWidgetResizable(true); - scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - - QVBoxLayout *layout2 = new QVBoxLayout; - layout2->addWidget(scrollArea); - layout2->setSpacing(0); - layout2->setMargin(0); - - frame->setLayout(layout2); - - addDummyData(); - - updateBlogsStatic(); - - QTimer *timer = new QTimer(this); - timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateBlogs())); - timer->start(15631); - -} - - -void BlogDialog::updateBlogs(void) -{ - -} - - -void BlogDialog::updateBlogsStatic(void) -{ - -#if 0 - rsQblog->getFilterSwitch(); - - std::map UsrStatus; - - if(!rsQblog->getStatus(UsrStatus)) - std::cerr << "failed to get usr status" << std::endl; - - clear(); //create a clear screen - - /* retrieve usr names and populate usr list bar */ - - std::list usrList; - QString TempVar; // to convert numerics to string note: tbd find way to avoid temporary - - if (!rsPeers) - { - /* not ready yet! */ - return; - } - - if(!rsPeers->getFriendList(usrList)) - std::cerr << "failed to get friend list"; - - - usrList.push_back(rsPeers->getOwnId()); // add your id - - /* populate the blog msgs screen */ - - std::map< std::string, std::multimap > blogs; // to store blogs - - if(!rsQblog->getBlogs(blogs)) - std::cerr << "failed to get blogs" << std::endl; - - /* print usr name and their blogs to screen */ - for(std::list::iterator it = usrList.begin(); it !=usrList.end(); it++) - { - - - TempVar = rsPeers->getPeerName(*it).c_str(); // store usr name in temporary - blogText->setTextColor(QColor(255, 0, 0, 255)); - blogText->setCurrentFont(mUsrFont); // make bold for username - blogText->append("\n" + TempVar); // write usr name to screen - std::cerr << "creating usr tree" << std::endl; - - /*print blog time-posted/msgs to screen*/ - - std::multimap::reverse_iterator blogIt = blogs[*it].rbegin(); - - if(blogs[*it].empty()) - { - std::cerr << "usr blog empty!" << std::endl; - continue; - } - - for( ; blogIt != blogs[*it].rend(); blogIt++) - { - std::cerr << "now printing blogs" << std::endl; - time_t postedTime = blogIt->first; - time(&postedTime); //convert to human readable time - blogText->setTextColor(QColor(255, 0, 0, 255)); // - blogText->setCurrentFont(mUsrFont); // make bold for posted date - blogText->append("\nPosted: " + QString (ctime(&postedTime))); // print time of blog to screen - blogText->setCurrentFont(mCurrentFont); // reset the font for blog messages - blogText->setTextColor(QColor(0, 0, 0, 255)); // set back color to black - blogText->append(blogIt->second.c_str()); // print blog msg to screen - } - - } - -#endif - -} - - -void BlogDialog::addDummyData() -{ - BlogMsgItem *bm1 = new BlogMsgItem(this, 0, "peerId", "msgId", true); - BlogMsgItem *bm2 = new BlogMsgItem(this, 0, "peerId", "msgId", true); - BlogMsgItem *bm3 = new BlogMsgItem(this, 0, "peerId", "msgId", true); - BlogMsgItem *bm4 = new BlogMsgItem(this, 0, "peerId", "msgId", true); - BlogMsgItem *bm5 = new BlogMsgItem(this, 0, "peerId", "msgId", true); - - mLayout->addWidget(bm1); - mLayout->addWidget(bm2); - mLayout->addWidget(bm3); - mLayout->addWidget(bm4); - mLayout->addWidget(bm5); -} - - - -/* FeedHolder Functions (for FeedItem functionality) */ -void BlogDialog::deleteFeedItem(QWidget *item, uint32_t type) -{ - std::cerr << "BlogDialog::deleteFeedItem()"; - std::cerr << std::endl; -} - - -void BlogDialog::openChat(std::string peerId) -{ - std::cerr << "BlogDialog::openChat()"; - std::cerr << std::endl; -} - -void BlogDialog::postBlog() -{ - - openMsg(FEEDHOLDER_MSG_BLOG, "", ""); -} - -void BlogDialog::openMsg(uint32_t type, std::string grpId, std::string inReplyTo) -{ - std::cerr << "BlogDialog::openMsg()"; - std::cerr << std::endl; - GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL); - - - msgDialog->addDestination(type, grpId, inReplyTo); - - msgDialog->show(); - return; -} - - - diff --git a/retroshare-gui/src/gui/unfinished/BlogDialog.h b/retroshare-gui/src/gui/unfinished/BlogDialog.h deleted file mode 100644 index 31c353fd0..000000000 --- a/retroshare-gui/src/gui/unfinished/BlogDialog.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************** - * 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. - ****************************************************************/ - -#ifndef _BLOG_DIALOG_H -#define _BLOG_DIALOG_H - -#include "gui/mainpage.h" -#include "ui_BlogDialog.h" - -#include "gui/feeds/FeedHolder.h" -class BlogMsgItem; - - -class BlogDialog : public MainPage, public FeedHolder, private Ui::BlogDialog -{ - Q_OBJECT - -public: - /** Default Constructor */ - BlogDialog(QWidget *parent = 0); - - /* FeedHolder Functions (for FeedItem functionality) */ - virtual void deleteFeedItem(QWidget *item, uint32_t type); - virtual void openChat(std::string peerId); - virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo); - - void updateBlogsStatic(); - -private slots: - - void updateBlogs(); - void postBlog(); - -private: - void addDummyData(); - - QLayout *mLayout; - - std::map mBlogMsgItems; -}; - - - -#endif - diff --git a/retroshare-gui/src/gui/unfinished/BlogDialog.ui b/retroshare-gui/src/gui/unfinished/BlogDialog.ui deleted file mode 100644 index df1c1447b..000000000 --- a/retroshare-gui/src/gui/unfinished/BlogDialog.ui +++ /dev/null @@ -1,219 +0,0 @@ - - BlogDialog - - - - 0 - 0 - 569 - 294 - - - - Form - - - - - - - 0 - - - 0 - - - - - 6 - - - 0 - - - 6 - - - 0 - - - - - - 16 - 16 - - - - - 75 - true - - - - - - - :/images/kblogger.png - - - true - - - - - - - - 75 - true - - - - Blogs - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - - Last Month - - - - :/images/view_calendar_month.png:/images/view_calendar_month.png - - - - - Last Week - - - - :/images/view_calendar_week.png:/images/view_calendar_week.png - - - - - Last Day - - - - :/images/view_calendar_day.png:/images/view_calendar_day.png - - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - - All Users - - - - :/images/user/identity16.png:/images/user/identity16.png - - - - - Jimmy - - - - - John - - - - - Jacki - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - No Feeds - - - Post Blog - - - - :/images/mail_send.png:/images/mail_send.png - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - diff --git a/retroshare-gui/src/gui/unfinished/LibraryDialog.cpp b/retroshare-gui/src/gui/unfinished/LibraryDialog.cpp index 40b460d90..057b25404 100644 --- a/retroshare-gui/src/gui/unfinished/LibraryDialog.cpp +++ b/retroshare-gui/src/gui/unfinished/LibraryDialog.cpp @@ -23,15 +23,9 @@ #include "rshare.h" #include "LibraryDialog.h" -#include "rsiface/rsiface.h" -#include "rsiface/rspeers.h" -#include "rsiface/rsfiles.h" #include "ShareManager.h" - #include "util/RsAction.h" -#include "msgs/ChanMsgDialog.h" -#include "FindWindow.h" #include #include @@ -59,8 +53,6 @@ #define IMAGE_PROGRESS ":/images/browse-looking.gif" #define IMAGE_LIBRARY ":/images/library.png" -QString fileToFind; - /** Constructor */ LibraryDialog::LibraryDialog(QWidget *parent) @@ -68,28 +60,24 @@ LibraryDialog::LibraryDialog(QWidget *parent) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); - - PopulateList(); - - connect(ui.organizerListView, SIGNAL(rightButtonClicked(QModelIndex,QPoint)), this, SLOT(ListLibrarymenu(QModelIndex,QPoint))); - connect(ui.shareFiles_btn,SIGNAL(clicked()),this, SLOT(CallShareFilesBtn_library())); - connect(ui.tileView_btn_library,SIGNAL(clicked()),this, SLOT(CallTileViewBtn_library())); - connect(ui.showDetails_btn_library,SIGNAL(clicked()),this, SLOT(CallShowDetailsBtn_library())); - connect(ui.createAlbum_btn_library,SIGNAL(clicked()),this, SLOT(CallCreateAlbumBtn_library())); - connect(ui.deleteAlbum_btn_library,SIGNAL(clicked()),this, SLOT(CallDeleteAlbumBtn_library())); - connect(ui.find_btn_library,SIGNAL(clicked()),this, SLOT(CallFindBtn_library())); + //connect(ui.tileView_btn_library,SIGNAL(clicked()),this, SLOT(CallTileViewBtn_library())); + //connect(ui.showDetails_btn_library,SIGNAL(clicked()),this, SLOT(CallShowDetailsBtn_library())); + //connect(ui.createAlbum_btn_library,SIGNAL(clicked()),this, SLOT(CallCreateAlbumBtn_library())); + //connect(ui.deleteAlbum_btn_library,SIGNAL(clicked()),this, SLOT(CallDeleteAlbumBtn_library())); + //connect(ui.find_btn_library,SIGNAL(clicked()),this, SLOT(CallFindBtn_library())); + + //Load the library + fileSystemModelLibraryFolders.setFilter(QDir::AllDirs|QDir::NoDotAndDotDot); + fileSystemModelLibraryFolders.setRootPath(Settings.Library.Shares.join(" ")); - /* Set header resize modes and initial section sizes */ - QHeaderView * organizerheader = ui.organizertreeView->header(); - - organizerheader->resizeSection ( 0, 250 ); + ui.treeViewLibraryNavigatorFolders->setModel(&fileSystemModelLibraryFolders); - QTimer *timer = new QTimer(this); + /*QTimer *timer = new QTimer(this); timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate())); - timer->start(1000); + timer->start(1000);*/ /* Hide platform specific features */ #ifdef Q_WS_WIN @@ -98,70 +86,6 @@ LibraryDialog::LibraryDialog(QWidget *parent) } -void LibraryDialog::PopulateList() -{ - QDir DwnlFolder,ShrFolder,retroshareLib,treePath; - -#if 0 - retroshareLib.mkdir("RetroShare Library"); - DwnlFolder.mkdir("RetroShare Library/Download"); - ShrFolder.mkdir("RetroShare Library/SharedFolder"); - LibShared=treePath.currentPath(); - LibShared.append("/RetroShare Library"); -#else - LibShared=Rshare::dataDirectory(); -#endif - - QDirModel * dmodel=new QDirModel; - ui.organizertreeView->setModel(dmodel); - ui.organizertreeView->setRootIndex(dmodel->index(LibShared)); - ui.organizerListView->setModel(dmodel); - ui.organizerListView->setViewMode(QListView::ListMode); - ui.organizerListView->setWordWrap (true); - -} - - -void LibraryDialog::ListLibrarymenu(QModelIndex index,QPoint pos) -{ - ind=index; - if(index.isValid()) - { - bool indexselected=true; - QMenu rmenu(this); - rmenu.move(pos); - if(indexselected) - rmenu.addAction(QIcon(""),tr("Play"), this, SLOT(PlayFrmList())); - if(indexselected) - rmenu.addAction(QIcon(""),tr("Copy"), this, SLOT(copyFile())); - if(indexselected) - rmenu.addAction(QIcon(""),tr("Delete"), this, SLOT(DeleteFile())); - if(indexselected) - rmenu.addAction(QIcon(""),tr("Rename"), this, SLOT(RenameFile())); - rmenu.exec(); - } - else - return; -} - -void LibraryDialog::PlayFrmList() -{ - QDirModel *dmodel=new QDirModel; - QModelIndex parentIndex = dmodel->index(LibShared+"/Download"); - QModelIndex index = dmodel->index(ind.row(), 0, parentIndex); - QString text = dmodel->data(index, Qt::DisplayRole).toString(); - - filechose.clear(); - QDir dir; - filechose.append(LibShared+"/Download/"); - filechose.append(text); - if(filechose.contains("avi")|| filechose.contains("MP3")||filechose.contains("mp3")|| filechose.contains("wmv")||filechose.contains("wav")|| filechose.contains("dat")|| filechose.contains("mov")|| filechose.contains("mpeg")|| filechose.contains("mpg")) - { - player(); - } - else - QMessageBox::information(this,"Information", "Not Supported By the Player"); -} void LibraryDialog::copyFile() { @@ -175,17 +99,12 @@ void LibraryDialog::DeleteFile() void LibraryDialog::RenameFile() { - ui.organizerListView->openPersistentEditor (ind); - progtime=new QTimer(this); - progtime->start(100000); - connect(progtime, SIGNAL(timeout()), this, SLOT(StopRename())); } void LibraryDialog::StopRename() { - ui.organizerListView->closePersistentEditor(ind); - progtime->stop(); + } @@ -214,37 +133,18 @@ void LibraryDialog::CallDeleteAlbumBtn_library() //QMessageBox::information(this, tr("RetroShare"),tr("Will be Introducing this .. soon- Delete Album in Library")); } -QString LibraryDialog::filePass() -{ - fileToFind=ui.findEditmain->text(); - return fileToFind; -} - void LibraryDialog::CallFindBtn_library() { - filePass(); - FindWindow *files = new FindWindow(this); - files->show(); + } void LibraryDialog:: player() { - QString avi; - avi.append(filechose); - QStringList argu; - QString smlayer="./smplayer"; - argu<start(smlayer,argu); + } void LibraryDialog::browseFile() { - QDir dir; - QString pathseted =dir.currentPath(); - pathseted.append("/RetroShare Library/Download"); - filechose = QFileDialog::getOpenFileName(this, tr("Open File..."), - pathseted, tr("Media-Files (*.avi *.mp3 *.wmv *.wav *.dat *.mov *.mpeg);;All Files (*)")); - //movieEdit->setText(filechose); + } diff --git a/retroshare-gui/src/gui/unfinished/LibraryDialog.h b/retroshare-gui/src/gui/unfinished/LibraryDialog.h index dbf5340b4..e1754e5f8 100644 --- a/retroshare-gui/src/gui/unfinished/LibraryDialog.h +++ b/retroshare-gui/src/gui/unfinished/LibraryDialog.h @@ -39,38 +39,31 @@ public: LibraryDialog(QWidget *parent = 0); /** Default Destructor */ - QString filePass(); - QString LibShared; - QString filechose; - QModelIndex ind; private slots: void PopulateList(); void CallShareFilesBtn_library(); - void CallTileViewBtn_library(); - void CallShowDetailsBtn_library(); - void CallCreateAlbumBtn_library(); - void CallDeleteAlbumBtn_library(); + void CallTileViewBtn_library(); + void CallShowDetailsBtn_library(); + void CallCreateAlbumBtn_library(); + void CallDeleteAlbumBtn_library(); void CallFindBtn_library(); void browseFile(); void player(); - void ListLibrarymenu(QModelIndex,QPoint); - void PlayFrmList(); - void copyFile(); - void DeleteFile(); - void RenameFile(); - void StopRename(); + void PlayFrmList(); + void copyFile(); + void DeleteFile(); + void RenameFile(); + void StopRename(); signals: - void rightButtonClicked(const QModelIndex , const QPoint); private: - QTimer *progtime; /** Qt Designer generated object */ diff --git a/retroshare-gui/src/gui/unfinished/LibraryDialog.ui b/retroshare-gui/src/gui/unfinished/LibraryDialog.ui index 9c7529224..da20212c0 100644 --- a/retroshare-gui/src/gui/unfinished/LibraryDialog.ui +++ b/retroshare-gui/src/gui/unfinished/LibraryDialog.ui @@ -1,793 +1,810 @@ - - LibraryDialog - - - - 0 - 0 - 629 - 463 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 208 - 208 - 208 - - - - - - - 255 - 255 - 255 - - - - - - - 247 - 247 - 247 - - - - - - - 104 - 104 - 104 - - - - - - - 139 - 139 - 139 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 240 - 240 - 240 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 255 - - - - - - - 255 - 0 - 255 - - - - - - - 231 - 231 - 231 - - - - - - - - - 0 - 0 - 0 - - - - - - - 208 - 208 - 208 - - - - - - - 255 - 255 - 255 - - - - - - - 247 - 247 - 247 - - - - - - - 104 - 104 - 104 - - - - - - - 139 - 139 - 139 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 240 - 240 - 240 - - - - - - - 0 - 0 - 0 - - - - - - - 192 - 192 - 192 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 255 - - - - - - - 255 - 0 - 255 - - - - - - - 231 - 231 - 231 - - - - - - - - - 104 - 104 - 104 - - - - - - - 208 - 208 - 208 - - - - - - - 255 - 255 - 255 - - - - - - - 247 - 247 - 247 - - - - - - - 104 - 104 - 104 - - - - - - - 139 - 139 - 139 - - - - - - - 104 - 104 - 104 - - - - - - - 255 - 255 - 255 - - - - - - - 104 - 104 - 104 - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 255 - - - - - - - 255 - 0 - 255 - - - - - - - 231 - 231 - 231 - - - - - - - - Qt::NoContextMenu - - - - - - Library - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - - QTabWidget::Triangular - - - 0 - - - - - 0 - 0 - 201 - 385 - - - - Folder - - - - - - - - - border-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255)); - - - - All File Types - - - - :/images/FileTypeAny.png:/images/FileTypeAny.png - - - - - Application - - - - :/images/FileTypeProgram.png:/images/FileTypeProgram.png - - - - - Archive - - - - :/images/FileTypeArchive.png:/images/FileTypeArchive.png - - - - - - - - - - 0 - 0 - 201 - 385 - - - - Organizer - - - - - - - Utopia - 8 - - - - - - - - - 16777215 - 23 - - - - border-color: rgb(0, 0, 0); - - - Share Files.. - - - - :/images/add-share24.png:/images/add-share24.png - - - - 24 - 24 - - - - true - - - - - - - - - - - - 0 - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/folder_blueshared.png" /> Exploring My RetroShare Library</p></body></html> - - - :/images/folder_blueshared.png - - - - - - - - 16777215 - 24 - - - - Tile view - - - true - - - - - - - Show Details - - - true - - - - - - - Qt::DefaultContextMenu - - - QListView::Free - - - QListView::IconMode - - - false - - - - - - - - - - - - 16777215 - 24 - - - - - - - Create Album - - - - :/images/directoryadd_24x24_shadow.png:/images/directoryadd_24x24_shadow.png - - - true - - - - - - - - 16777215 - 24 - - - - - - - Delete Album - - - - :/images/directoryremove_24x24_shadow.png:/images/directoryremove_24x24_shadow.png - - - true - - - - - - - - - - - 16777215 - 24 - - - - pushButton_41:hover{ color : white;} - - - Find - - - - :/images/find.png:/images/find.png - - - true - - - - - - - - - - - - - - - - - - - - organizertreeView - doubleClicked(QModelIndex) - organizerListView - setRootIndex(QModelIndex) - - - 139 - 230 - - - 439 - 238 - - - - - + + + Form + + + + 0 + 0 + 703 + 527 + + + + Form + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + QFrame { + background-color: rgb(199, 202, 255); +} + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + 0 + + + + + 4 + + + 4 + + + 4 + + + + + + 0 + 0 + + + + + 16777215 + 25 + + + + Manage the physical folders in your library. + + + + + + Share Files + + + + :/Actions/Graphics/Actions/SharedFolders.png:/Actions/Graphics/Actions/SharedFolders.png + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + + QTabWidget::pane { /* The tab widget frame */ + border-top: 2px solid #C2C7CB; + } + + QTabWidget::tab-bar { + left: 5px; /* move to the right by 5px */ + } + + /* Style the tab using the tab sub-control. Note that + it reads QTabBar _not_ QTabWidget */ + QTabBar::tab { + background:transparent; + border: 2px solid transparent; + min-width: 8ex; + padding: 2px; + } + + QTabBar::tab:selected, QTabBar::tab:hover { + border: 1px solid rgb(78, 96, 255); + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #dadbde, stop: 1 #f6f7fa); + } + + QTabBar::tab:selected { + border: 1px solid rgb(78, 96, 255); + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #dadbde, stop: 1 #f6f7fa); + } + + + 1 + + + + + :/Actions/Graphics/Actions/OpenDownloadFolder.png:/Actions/Graphics/Actions/OpenDownloadFolder.png + + + Shares + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + QTreeView { + background-color: rgb(255, 255, 255); +} + + + false + + + + + + + + 0 + 0 + + + + QAbstractItemView { + background-color: rgb(255, 255, 255); +} + + + + + + + + + :/Actions/Graphics/Actions/Libary.png:/Actions/Graphics/Actions/Libary.png + + + Organiser + + + + 0 + + + + + + 0 + 0 + + + + QTreeWidget { + background-color: rgb(255, 255, 255); +} + + + false + + + + Organiser + + + + + All Files + + + + :/Actions/Graphics/Actions/Libary.png:/Actions/Graphics/Actions/Libary.png + + + + + Favorites + + + + :/Controls/Graphics/Controls/Favorites.png:/Controls/Graphics/Controls/Favorites.png + + + + + Ghost Files + + + + :/Controls/Graphics/Controls/GhostFiles.png:/Controls/Graphics/Controls/GhostFiles.png + + + + + My Applications + + + + :/Controls/Graphics/Controls/MyApplications.png:/Controls/Graphics/Controls/MyApplications.png + + + + All Applications + + + + + + My eBooks + + + + :/Controls/Graphics/Controls/MyeBooks.png:/Controls/Graphics/Controls/MyeBooks.png + + + + All eBooks + + + + + + My Documents + + + + :/Controls/Graphics/Controls/MyDocuments.png:/Controls/Graphics/Controls/MyDocuments.png + + + + All Documents + + + + + + My Images + + + + :/Controls/Graphics/Controls/MyImages.png:/Controls/Graphics/Controls/MyImages.png + + + + All Images + + + + + + My Music + + + + :/Controls/Graphics/Controls/MyMusic.png:/Controls/Graphics/Controls/MyMusic.png + + + + All Music + + + + + By Album + + + + + By Artist + + + + + By Genre + + + + + + My Video + + + + :/Actions/Graphics/Actions/Media.png:/Actions/Graphics/Actions/Media.png + + + + All Video + + + + + Films + + + + + Music Videos + + + + + TV Shows + + + + + + + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + 0 + + + + + 0 + + + 0 + + + + + + 0 + + + 0 + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + + 250 + 16777215 + + + + + + + + Search + + + + :/Actions/Graphics/Actions/Search.png:/Actions/Graphics/Actions/Search.png + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + + + + + + QLayout::SetDefaultConstraint + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 143 + 32 + + + + + + + + Tile View + + + + :/Controls/Graphics/Controls/TileView.png:/Controls/Graphics/Controls/TileView.png + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + Qt::NoArrow + + + + + + + Show Details + + + + :/Controls/Graphics/Controls/ShowDetails.png:/Controls/Graphics/Controls/ShowDetails.png + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + 240 + 35 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/Actions/Graphics/Actions/OpenDownloadFolder.png" /><span style=" font-size:8pt;"> </span><span style=" font-size:10pt; font-weight:600;">Exploring My Shared Folders</span></p></body></html> + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + QLayout::SetDefaultConstraint + + + 0 + + + 0 + + + + + + 240 + 35 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/Icons/Resource/Folder Libary_32.png" /><span style=" font-size:8pt;"> </span><span style=" font-size:10pt; font-weight:600;">Exploring With The Organiser</span></p></body></html> + + + + + + + Qt::Horizontal + + + + 143 + 32 + + + + + + + + Tile View + + + + :/Controls/Graphics/Controls/TileView.png:/Controls/Graphics/Controls/TileView.png + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + Show Details + + + + :/Controls/Graphics/Controls/ShowDetails.png:/Controls/Graphics/Controls/ShowDetails.png + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + 0 + 23 + + + + background-color: rgb(11, 27, 99); + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + + + + + + + + + + 0 + + + 0 + + + + + + + Create Album + + + + :/Controls/Graphics/Controls/Add.png:/Controls/Graphics/Controls/Add.png + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + Delete Album + + + + :/Controls/Graphics/Controls/Remove.png:/Controls/Graphics/Controls/Remove.png + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + + 250 + 16777215 + + + + + + + + Search + + + + :/Actions/Graphics/Actions/Search.png:/Actions/Graphics/Actions/Search.png + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + + + + + + + + + + diff --git a/retroshare-gui/src/gui/unfinished/MsgFeed.cpp b/retroshare-gui/src/gui/unfinished/MsgFeed.cpp deleted file mode 100644 index f7b6c1d72..000000000 --- a/retroshare-gui/src/gui/unfinished/MsgFeed.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ -#include - -#include - -#include "MsgFeed.h" -#include "gui/feeds/MsgItem.h" -#include "gui/GeneralMsgDialog.h" - -#include "rsiface/rsmsgs.h" -#include "rsiface/rspeers.h" - -/***** - * #define MSG_DEBUG 1 - ****/ - -/** Constructor */ -MsgFeed::MsgFeed(QWidget *parent) -: MainPage (parent) -{ - /* Invoke the Qt Designer generated object setup routine */ - setupUi(this); - - connect(boxComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateBox() ) ); - connect(peerComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateMode() ) ); - connect(sortComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateSort() ) ); - connect(msgButton, SIGNAL( clicked( ) ), this, SLOT( newMsg() ) ); - - /* mLayout -> to add widgets to */ - mLayout = new QVBoxLayout; - - QWidget *middleWidget = new QWidget(); - //middleWidget->setSizePolicy( QSizePolicy::Policy::Maximum, QSizePolicy::Policy::Minimum); - middleWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); - middleWidget->setLayout(mLayout); - - - QScrollArea *scrollArea = new QScrollArea; - //scrollArea->setBackgroundRole(QPalette::Dark); - scrollArea->setWidget(middleWidget); - scrollArea->setWidgetResizable(true); - scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - - QVBoxLayout *layout2 = new QVBoxLayout; - layout2->addWidget(scrollArea); - layout2->setSpacing(0); - layout2->setMargin(0); - - frame->setLayout(layout2); - - /* default Inbox + All */ - mMsgbox = RS_MSG_INBOX; - mPeerId = ""; - - - QTimer *timer = new QTimer(this); - timer->connect(timer, SIGNAL(timeout()), this, SLOT(updatePeerIds())); - timer->start(10000); - -} - - - - -/* FeedHolder Functions (for FeedItem functionality) */ -void MsgFeed::deleteFeedItem(QWidget *item, uint32_t type) -{ -#ifdef MSG_DEBUG - std::cerr << "MsgFeed::deleteFeedItem()"; - std::cerr << std::endl; -#endif -} - -void MsgFeed::openChat(std::string peerId) -{ -#ifdef MSG_DEBUG - std::cerr << "MsgFeed::openChat()"; - std::cerr << std::endl; -#endif -} - -void MsgFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo) -{ -#ifdef MSG_DEBUG - std::cerr << "MsgFeed::openMsg()"; - std::cerr << std::endl; -#endif - - GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL); - - - msgDialog->addDestination(type, grpId, inReplyTo); - - msgDialog->show(); - -} - -void MsgFeed::newMsg() -{ -#ifdef MSG_DEBUG - std::cerr << "MsgFeed::newMsg()"; - std::cerr << std::endl; -#endif - - GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL); - - msgDialog->setMsgType(FEEDHOLDER_MSG_MESSAGE); - - msgDialog->show(); -} - - - -void MsgFeed::updateBox() -{ - int idx = boxComboBox->currentIndex(); - switch(idx) - { - case 3: - mMsgbox = RS_MSG_SENTBOX; - break; - case 2: - mMsgbox = RS_MSG_DRAFTBOX; - break; - case 1: - mMsgbox = RS_MSG_OUTBOX; - break; - case 0: - default: - mMsgbox = RS_MSG_INBOX; - break; - } - updateMsgs(); -} - -void MsgFeed::updateMode() -{ - /* NB #defines must match GUI design for correct selection */ - - if (peerComboBox->currentIndex() >= 0) - { - QVariant qv = peerComboBox->itemData(peerComboBox->currentIndex()); - mPeerId = qv.toString().toStdString(); - } - updateMsgs(); -} - -void MsgFeed::updateSort() -{ - - -} - -void MsgFeed::updatePeerIds() -{ -#ifdef MSG_DEBUG - std::cerr << "MsgFeed::updatePeerIds()"; - std::cerr << std::endl; -#endif - - int selectIdx = 0; /* ALL */ - std::string peerId; - - if (peerComboBox->currentIndex() >= 0) - { - QVariant qv = peerComboBox->itemData(peerComboBox->currentIndex()); - peerId = qv.toString().toStdString(); - } - - peerComboBox->clear(); - peerComboBox->addItem("All Msgs", ""); - - /* add a list of friends */ - if (rsPeers) - { - std::list friends; - std::list::iterator it; - - rsPeers->getFriendList(friends); - for(it = friends.begin(); it != friends.end(); it++) - { - QString id = QString::fromStdString(*it); - QString name = QString::fromStdString(rsPeers->getPeerName(*it)); - peerComboBox->addItem(name, id); - - if (peerId == *it) - { - selectIdx = peerComboBox->count() - 1; - } - } - } - peerComboBox->setCurrentIndex(selectIdx); - - /* this will trigger updateMsgs?? */ -} - - - -void MsgFeed::updateMsgs() -{ - std::list msgs; - std::list::iterator mit; - - std::list toAdd, toRemove; - std::list::iterator it; - - std::map newmsgs; - std::map::iterator nit; - std::map::iterator iit; - - if (!rsMsgs) - { - /* not ready yet! */ - return; - } - - rsMsgs->getMessageSummaries(msgs); - - for(mit = msgs.begin(); mit != msgs.end(); ) - { - /* filter on box type */ - if (mMsgbox != (mit->msgflags & RS_MSG_BOXMASK)) - { - mit = msgs.erase(mit); - } - else - { - mit++; - } - } - - if (mPeerId != "") - { - for(mit = msgs.begin(); mit != msgs.end(); ) - { - /* filter on source */ - if (mPeerId != mit->srcId) - { - mit = msgs.erase(mit); - } - else - { - mit++; - } - } - } - - for(mit = msgs.begin(); mit != msgs.end(); mit++) - { - newmsgs[mit->msgId] = 1; - } - - nit = newmsgs.begin(); - iit = mMsgs.begin(); - - while(nit != newmsgs.end()) - { - if (iit == mMsgs.end()) - { - toAdd.push_back(nit->first); - nit++; - continue; - } - - if (nit->first == iit->first) - { - /* same - good! */ - nit++; - iit++; - continue; - } - - if (nit->first < iit->first) - { - /* must add in new item */ - toAdd.push_back(nit->first); - nit++; - } - else - { - toRemove.push_back(iit->first); - iit++; - } - } - - /* remove remaining items */ - while (iit != mMsgs.end()) - { - toRemove.push_back(iit->first); - iit++; - } - - /* remove first */ - for(it = toRemove.begin(); it != toRemove.end(); it++) - { - iit = mMsgs.find(*it); - if (iit != mMsgs.end()) - { - delete (iit->second); - mMsgs.erase(iit); - } - } - - /* add in new ones */ - for(it = toAdd.begin(); it != toAdd.end(); it++) - { - MsgItem *mi = new MsgItem(this, 0, *it, true); - mMsgs[*it] = mi; - mLayout->addWidget(mi); - } -} - - diff --git a/retroshare-gui/src/gui/unfinished/MsgFeed.h b/retroshare-gui/src/gui/unfinished/MsgFeed.h deleted file mode 100644 index bfc80cc36..000000000 --- a/retroshare-gui/src/gui/unfinished/MsgFeed.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************** - * 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. - ****************************************************************/ - -#ifndef _MSG_FEED_DIALOG_H -#define _MSG_FEED_DIALOG_H - -#include "gui/mainpage.h" -#include "ui_MsgFeed.h" - -#include "gui/feeds/FeedHolder.h" - -class MsgItem; - -class MsgFeed : public MainPage, public FeedHolder, private Ui::MsgFeed -{ - Q_OBJECT - -public: - /** Default Constructor */ - MsgFeed(QWidget *parent = 0); - /** Default Destructor */ - - /* FeedHolder Functions (for FeedItem functionality) */ -virtual void deleteFeedItem(QWidget *item, uint32_t type); -virtual void openChat(std::string peerId); -virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo); - -private slots: - - void newMsg(); - - void updateBox(); - void updateMode(); - void updateSort(); - - void updatePeerIds(); - void updateMsgs(); - -private: - - QLayout *mLayout; - - uint32_t mMsgbox; - std::string mPeerId; - uint32_t mSortMode; - std::map mMsgs; - -}; - - - -#endif - - diff --git a/retroshare-gui/src/gui/unfinished/MsgFeed.ui b/retroshare-gui/src/gui/unfinished/MsgFeed.ui deleted file mode 100644 index 07b1fa8c4..000000000 --- a/retroshare-gui/src/gui/unfinished/MsgFeed.ui +++ /dev/null @@ -1,276 +0,0 @@ - - MsgFeed - - - - 0 - 0 - 764 - 435 - - - - Form - - - - 0 - - - 0 - - - 6 - - - 0 - - - 6 - - - - - 6 - - - - - - 0 - 0 - - - - - 75 - true - - - - Msgs In: - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - Inbox - - - - - Outbox - - - - - Drafts - - - - - Sent - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - From: - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - 100 - 0 - - - - - All - - - - - - - - Qt::Horizontal - - - - 20 - 20 - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Sort By: - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - Date - - - - - Subject - - - - - Received - - - - - - - - Qt::Horizontal - - - - 81 - 28 - - - - - - - - New Msg - - - - :/images/mail_send.png:/images/mail_send.png - - - - - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - diff --git a/retroshare-gui/src/gui/unfinished/PeersFeed.cpp b/retroshare-gui/src/gui/unfinished/PeersFeed.cpp deleted file mode 100644 index 6c218a8f4..000000000 --- a/retroshare-gui/src/gui/unfinished/PeersFeed.cpp +++ /dev/null @@ -1,468 +0,0 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ -#include - -#include - -#include "PeersFeed.h" -#include "gui/feeds/PeerItem.h" - -#include "rsiface/rspeers.h" - -#include "gui/GeneralMsgDialog.h" - -const uint32_t PEERSFEED_MODE_FRIENDS = 0x0000; -const uint32_t PEERSFEED_MODE_ONLINE = 0x0001; -const uint32_t PEERSFEED_MODE_FOF = 0x0002; -const uint32_t PEERSFEED_MODE_ALL = 0x0003; - - -/***** - * #define PEERS_DEBUG 1 - ****/ - -/** Constructor */ -PeersFeed::PeersFeed(QWidget *parent) -: MainPage (parent) -{ - /* Invoke the Qt Designer generated object setup routine */ - setupUi(this); - - connect( modeComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateMode() ) ); - - /* mLayout -> to add widgets to */ - mLayout = new QVBoxLayout; - - QWidget *middleWidget = new QWidget(); - //middleWidget->setSizePolicy( QSizePolicy::Policy::Maximum, QSizePolicy::Policy::Minimum); - middleWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); - middleWidget->setLayout(mLayout); - - - QScrollArea *scrollArea = new QScrollArea; - //scrollArea->setBackgroundRole(QPalette::Dark); - scrollArea->setWidget(middleWidget); - scrollArea->setWidgetResizable(true); - scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - - QVBoxLayout *layout2 = new QVBoxLayout; - layout2->addWidget(scrollArea); - layout2->setSpacing(0); - layout2->setMargin(0); - - frame->setLayout(layout2); - - mMode = PEERSFEED_MODE_FRIENDS; - - QTimer *timer = new QTimer(this); - timer->connect(timer, SIGNAL(timeout()), this, SLOT(updatePeers())); - timer->start(1000); - -} - - - - -/* FeedHolder Functions (for FeedItem functionality) */ -void PeersFeed::deleteFeedItem(QWidget *item, uint32_t type) -{ -#ifdef PEERS_DEBUG - std::cerr << "PeersFeed::deleteFeedItem()"; - std::cerr << std::endl; -#endif -} - -void PeersFeed::openChat(std::string peerId) -{ -#ifdef PEERS_DEBUG - std::cerr << "PeersFeed::openChat()"; - std::cerr << std::endl; -#endif -} - -void PeersFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo) -{ -#ifdef PEERS_DEBUG - std::cerr << "PeersFeed::openMsg()"; - std::cerr << std::endl; -#endif - - GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL); - - - msgDialog->addDestination(type, grpId, inReplyTo); - - msgDialog->show(); - -} - -void PeersFeed::updateMode() -{ - /* NB #defines must match GUI design for correct selection */ - - mMode = modeComboBox->currentIndex(); - updatePeers(); -} - -/* get the list of peers from the RsIface. */ -void PeersFeed::updatePeers() -{ - std::list peers, toAdd, toRemove; - std::list::iterator it; - - std::map newpeers; - std::map::iterator nit; - std::map::iterator pit; - - if (!rsPeers) - { - /* not ready yet! */ - return; - } - - if (mMode == PEERSFEED_MODE_FRIENDS) - { - rsPeers->getFriendList(peers); - } - if(mMode == PEERSFEED_MODE_ONLINE) - { - rsPeers->getOnlineList(peers); - } - /*else if (mMode == PEERSFEED_MODE_ALL) - { - rsPeers->getOthersList(peers); - } - else - { - rsPeers->getOthersList(peers);*/ - /* now remove friends */ - /*for(it = peers.begin(); it != peers.end(); ) - { - if (rsPeers->isFriend(*it)) - { - it = peers.erase(it); - } - else - { - it++; - } - } - }*/ - - for(it = peers.begin(); it != peers.end(); it++) - { - newpeers[*it] = 1; - } - - nit = newpeers.begin(); - pit = mPeers.begin(); - - while(nit != newpeers.end()) - { - if (pit == mPeers.end()) - { - toAdd.push_back(nit->first); - nit++; - continue; - } - - if (nit->first == pit->first) - { - /* same - good! */ - nit++; - pit++; - continue; - } - - if (nit->first < pit->first) - { - /* must add in new item */ - toAdd.push_back(nit->first); - nit++; - } - else - { - toRemove.push_back(pit->first); - pit++; - } - } - - /* remove remaining items */ - while (pit != mPeers.end()) - { - toRemove.push_back(pit->first); - pit++; - } - - /* remove first */ - for(it = toRemove.begin(); it != toRemove.end(); it++) - { - pit = mPeers.find(*it); - if (pit != mPeers.end()) - { - delete (pit->second); - mPeers.erase(pit); - } - } - - /* add in new ones */ - for(it = toAdd.begin(); it != toAdd.end(); it++) - { - PeerItem *pi = new PeerItem(this, 0, *it, PEER_TYPE_STD, true); - mPeers[*it] = pi; - mLayout->addWidget(pi); - } -} - -// PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, fi.mId1, PEER_TYPE_STD, false); -// PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, fi.mId1, PEER_TYPE_HELLO, false); -// PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, fi.mId1, PEER_TYPE_NEW_FOF, false); - -#if 0 - -void PeersFeed::setChatDialog(ChatDialog *cd) -{ - chatDialog = cd; -} - - -/** Open a QFileDialog to browse for export a file. */ -void PeersFeed::exportfriend() -{ - QTreeWidgetItem *c = getCurrentPeer(); - std::cerr << "PeersFeed::exportfriend()" << std::endl; - if (!c) - { - std::cerr << "PeersFeed::exportfriend() Noone Selected -- sorry" << std::endl; - return; - } - - std::string id = getPeerRsCertId(c); - QString fileName = QFileDialog::getSaveFileName(this, tr("Save Certificate"), "", - tr("Certificates (*.pqi)")); - - std::string file = fileName.toStdString(); - if (file != "") - { - std::cerr << "PeersFeed::exportfriend() Saving to: " << file << std::endl; - std::cerr << std::endl; - if (rsPeers) - { - rsPeers->SaveCertificateToFile(id, file); - } - } - -} - -void PeersFeed::chatfriend() -{ - QTreeWidgetItem *i = getCurrentPeer(); - - if (!i) - return; - - std::string name = (i -> text(2)).toStdString(); - std::string id = (i -> text(7)).toStdString(); - - RsPeerDetails detail; - if (!rsPeers->getPeerDetails(id, detail)) - { - return; - } - - if (detail.state & RS_PEER_STATE_CONNECTED) - { - /* must reference ChatDialog */ - if (chatDialog) - { - chatDialog->getPrivateChat(id, name, true); - } - } - else - { - /* info dialog */ - QMessageBox::StandardButton sb = QMessageBox::question ( NULL, - "Friend Not Online", - "Your Friend is offline \nDo you want to send them a Message instead", - (QMessageBox::Yes | QMessageBox::No)); - if (sb == QMessageBox::Yes) - { - msgfriend(); - } - } - return; -} - - -void PeersFeed::msgfriend() -{ - std::cerr << "SharedFilesDialog::msgfriend()" << std::endl; - - QTreeWidgetItem *i = getCurrentPeer(); - - if (!i) - return; - - std::string status = (i -> text(1)).toStdString(); - std::string name = (i -> text(2)).toStdString(); - std::string id = (i -> text(7)).toStdString(); - - rsicontrol -> ClearInMsg(); - rsicontrol -> SetInMsg(id, true); - - /* create a message */ - ChanMsgDialog *nMsgDialog = new ChanMsgDialog(true); - - nMsgDialog->newMsg(); - nMsgDialog->show(); -} - - -QTreeWidgetItem *PeersFeed::getCurrentPeer() -{ - /* get the current, and extract the Id */ - - /* get a link to the table */ - QTreeWidget *peerWidget = ui.peertreeWidget; - QTreeWidgetItem *item = peerWidget -> currentItem(); - if (!item) - { - std::cerr << "Invalid Current Item" << std::endl; - return NULL; - } - - /* Display the columns of this item. */ - std::ostringstream out; - out << "CurrentPeerItem: " << std::endl; - - for(int i = 1; i < 6; i++) - { - QString txt = item -> text(i); - out << "\t" << i << ":" << txt.toStdString() << std::endl; - } - std::cerr << out.str(); - return item; -} - -/* So from the Peers Dialog we can call the following control Functions: - * (1) Remove Current. FriendRemove(id) - * (2) Allow/DisAllow. FriendStatus(id, accept) - * (2) Connect. FriendConnectAttempt(id, accept) - * (3) Set Address. FriendSetAddress(id, str, port) - * (4) Set Trust. FriendTrustSignature(id, bool) - * (5) Configure (GUI Only) -> 3/4 - * - * All of these rely on the finding of the current Id. - */ - - -void PeersFeed::removefriend() -{ - QTreeWidgetItem *c = getCurrentPeer(); - std::cerr << "PeersFeed::removefriend()" << std::endl; - if (!c) - { - std::cerr << "PeersFeed::removefriend() Noone Selected -- sorry" << std::endl; - return; - } - - if (rsPeers) - { - rsPeers->removeFriend(getPeerRsCertId(c)); - } -} - - -void PeersFeed::allowfriend() -{ - QTreeWidgetItem *c = getCurrentPeer(); - std::cerr << "PeersFeed::allowfriend()" << std::endl; - /* - bool accept = true; - rsServer->FriendStatus(getPeerRsCertId(c), accept); - */ -} - - -void PeersFeed::connectfriend() -{ - QTreeWidgetItem *c = getCurrentPeer(); - std::cerr << "PeersFeed::connectfriend()" << std::endl; - if (!c) - { - std::cerr << "PeersFeed::connectfriend() Noone Selected -- sorry" << std::endl; - return; - } - - if (rsPeers) - { - rsPeers->connectAttempt(getPeerRsCertId(c)); - } -} - -void PeersFeed::setaddressfriend() -{ - QTreeWidgetItem *c = getCurrentPeer(); - std::cerr << "PeersFeed::setaddressfriend()" << std::endl; - - /* need to get the input address / port */ - /* - std::string addr; - unsigned short port; - rsServer->FriendSetAddress(getPeerRsCertId(c), addr, port); - */ -} - -void PeersFeed::trustfriend() -{ - QTreeWidgetItem *c = getCurrentPeer(); - std::cerr << "PeersFeed::trustfriend()" << std::endl; - /* - bool trust = true; - rsServer->FriendTrust(getPeerRsCertId(c), trust); - */ -} - - - -/* GUI stuff -> don't do anything directly with Control */ -void PeersFeed::configurefriend() -{ - /* display Dialog */ - std::cerr << "PeersFeed::configurefriend()" << std::endl; - QTreeWidgetItem *c = getCurrentPeer(); - - - static ConfCertDialog *confdialog = new ConfCertDialog(); - - - if (!c) - return; - - /* set the Id */ - std::string id = getPeerRsCertId(c); - - confdialog -> loadId(id); - confdialog -> show(); -} - -#endif - diff --git a/retroshare-gui/src/gui/unfinished/PeersFeed.h b/retroshare-gui/src/gui/unfinished/PeersFeed.h deleted file mode 100644 index df471ce32..000000000 --- a/retroshare-gui/src/gui/unfinished/PeersFeed.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************** - * 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. - ****************************************************************/ - -#ifndef _PEERS_FEED_DIALOG_H -#define _PEERS_FEED_DIALOG_H - -#include "gui/mainpage.h" -#include "ui_PeersFeed.h" - -#include "gui/feeds/FeedHolder.h" - -class PeerItem; - -class PeersFeed : public MainPage, public FeedHolder, private Ui::PeersFeed -{ - Q_OBJECT - -public: - /** Default Constructor */ - PeersFeed(QWidget *parent = 0); - /** Default Destructor */ - - /* FeedHolder Functions (for FeedItem functionality) */ -virtual void deleteFeedItem(QWidget *item, uint32_t type); -virtual void openChat(std::string peerId); -virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo); - -private slots: - - void updatePeers(); - void updateMode(); - -private: - - QLayout *mLayout; - - /* lists of feedItems */ - uint32_t mMode; - std::map mPeers; - -}; - - - -#endif - - diff --git a/retroshare-gui/src/gui/unfinished/PeersFeed.ui b/retroshare-gui/src/gui/unfinished/PeersFeed.ui deleted file mode 100644 index ecd48054a..000000000 --- a/retroshare-gui/src/gui/unfinished/PeersFeed.ui +++ /dev/null @@ -1,135 +0,0 @@ - - PeersFeed - - - - 0 - 0 - 689 - 386 - - - - Form - - - - 0 - - - 0 - - - 6 - - - 0 - - - 6 - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Show: - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - 100 - 0 - - - - - Friends - - - - - Online Friends - - - - - Friends of Friends. - - - - - All Peers - - - - - - - - Qt::Horizontal - - - - 50 - 20 - - - - - - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - diff --git a/retroshare-gui/src/gui/unfinished/TransferFeed.cpp b/retroshare-gui/src/gui/unfinished/TransferFeed.cpp deleted file mode 100644 index 81d18a12e..000000000 --- a/retroshare-gui/src/gui/unfinished/TransferFeed.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ -#include - -#include - -#include "TransferFeed.h" -#include "gui/feeds/SubFileItem.h" -#include "gui/GeneralMsgDialog.h" - -#include "rsiface/rsfiles.h" - - -/***** - * #define TRANSFER_DEBUG 1 - ****/ - -/** Constructor */ -TransferFeed::TransferFeed(QWidget *parent) -: MainPage (parent) -{ - /* Invoke the Qt Designer generated object setup routine */ - setupUi(this); - - connect( modeComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateMode() ) ); - - { - /* mLayout -> to add widgets to */ - mDownloadsLayout = new QVBoxLayout; - - QWidget *middleWidget = new QWidget(); - //middleWidget->setSizePolicy( QSizePolicy::Policy::Maximum, QSizePolicy::Policy::Minimum); - middleWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); - middleWidget->setLayout(mDownloadsLayout); - - - QScrollArea *scrollArea = new QScrollArea; - //scrollArea->setBackgroundRole(QPalette::Dark); - scrollArea->setWidget(middleWidget); - scrollArea->setWidgetResizable(true); - scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - - QVBoxLayout *layout2 = new QVBoxLayout; - layout2->addWidget(scrollArea); - layout2->setSpacing(0); - layout2->setMargin(0); - - frameDown->setLayout(layout2); - } - - { - /* mLayout -> to add widgets to */ - mUploadsLayout = new QVBoxLayout; - - QWidget *middleWidget = new QWidget(); - //middleWidget->setSizePolicy( QSizePolicy::Policy::Maximum, QSizePolicy::Policy::Minimum); - middleWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); - middleWidget->setLayout(mUploadsLayout); - - - QScrollArea *scrollArea = new QScrollArea; - //scrollArea->setBackgroundRole(QPalette::Dark); - scrollArea->setWidget(middleWidget); - scrollArea->setWidgetResizable(true); - scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - - QVBoxLayout *layout2 = new QVBoxLayout; - layout2->addWidget(scrollArea); - layout2->setSpacing(0); - layout2->setMargin(0); - - frameUp->setLayout(layout2); - } - - QTimer *timer = new QTimer(this); - timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateAll())); - timer->start(1000); - -} - - - -/* FeedHolder Functions (for FeedItem functionality) */ -void TransferFeed::deleteFeedItem(QWidget *item, uint32_t type) -{ -#ifdef TRANSFER_DEBUG - std::cerr << "TransferFeed::deleteFeedItem()"; - std::cerr << std::endl; -#endif -} - -void TransferFeed::openChat(std::string peerId) -{ -#ifdef TRANSFER_DEBUG - std::cerr << "TransferFeed::openChat()"; - std::cerr << std::endl; -#endif -} - -void TransferFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo) -{ -#ifdef TRANSFER_DEBUG - std::cerr << "TransferFeed::openMsg()"; - std::cerr << std::endl; -#endif - - GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL); - - - msgDialog->addDestination(type, grpId, inReplyTo); - - msgDialog->show(); - -} - -void TransferFeed::updateMode() -{ - updateAll(); -} - -void TransferFeed::updateAll() -{ - updateDownloads(); - updateUploads(); -} - -void TransferFeed::updateDownloads() -{ - std::list hashes, toAdd, toRemove; - std::list::iterator it; - - std::map newhashes; - std::map::iterator nit; - std::map::iterator fit; - - if (!rsFiles) - { - /* not ready yet! */ - return; - } - - rsFiles->FileDownloads(hashes); - - for(it = hashes.begin(); it != hashes.end(); it++) - { - newhashes[*it] = 1; - } - - nit = newhashes.begin(); - fit = mDownloads.begin(); - - while(nit != newhashes.end()) - { - if (fit == mDownloads.end()) - { - toAdd.push_back(nit->first); - nit++; - continue; - } - - if (nit->first == fit->first) - { - /* same - good! */ - nit++; - fit++; - continue; - } - - if (nit->first < fit->first) - { - /* must add in new item */ - toAdd.push_back(nit->first); - nit++; - } - else - { - toRemove.push_back(fit->first); - fit++; - } - } - - /* remove remaining items */ - while (fit != mDownloads.end()) - { - toRemove.push_back(fit->first); - fit++; - } - - /* remove first */ - for(it = toRemove.begin(); it != toRemove.end(); it++) - { - fit = mDownloads.find(*it); - if (fit != mDownloads.end()) - { - delete (fit->second); - mDownloads.erase(fit); - } - } - - /* add in new ones */ - for(it = toAdd.begin(); it != toAdd.end(); it++) - { - FileInfo fi; - uint32_t hintflags = RS_FILE_HINTS_DOWNLOAD - | RS_FILE_HINTS_SPEC_ONLY; - - if (rsFiles->FileDetails(*it, hintflags, fi)) - { - // XXX HACK _ TOFIX >>>> fi.source); - - SubFileItem *sfi = new SubFileItem(*it, fi.fname, - fi.size, SFI_STATE_DOWNLOAD, ""); - - // XXX HACK _ TOFIX >>>> fi.source); - - mDownloads[*it] = sfi; - mDownloadsLayout->addWidget(sfi); - } - } -} - -void TransferFeed::updateUploads() -{ - std::list hashes, toAdd, toRemove; - std::list::iterator it; - - std::map newhashes; - std::map::iterator nit; - std::map::iterator fit; - - if (!rsFiles) - { - /* not ready yet! */ - return; - } - - rsFiles->FileUploads(hashes); - - for(it = hashes.begin(); it != hashes.end(); it++) - { - newhashes[*it] = 1; - } - - nit = newhashes.begin(); - fit = mUploads.begin(); - - while(nit != newhashes.end()) - { - if (fit == mUploads.end()) - { - toAdd.push_back(nit->first); - nit++; - continue; - } - - if (nit->first == fit->first) - { - /* same - good! */ - nit++; - fit++; - continue; - } - - if (nit->first < fit->first) - { - /* must add in new item */ - toAdd.push_back(nit->first); - nit++; - } - else - { - toRemove.push_back(fit->first); - fit++; - } - } - - /* remove remaining items */ - while (fit != mUploads.end()) - { - toRemove.push_back(fit->first); - fit++; - } - - /* remove first */ - for(it = toRemove.begin(); it != toRemove.end(); it++) - { - fit = mUploads.find(*it); - if (fit != mUploads.end()) - { - delete (fit->second); - mUploads.erase(fit); - } - } - - /* add in new ones */ - for(it = toAdd.begin(); it != toAdd.end(); it++) - { - FileInfo fi; - uint32_t hintflags = RS_FILE_HINTS_UPLOAD - | RS_FILE_HINTS_SPEC_ONLY; - - if (rsFiles->FileDetails(*it, hintflags, fi)) - { - // XXX HACK _ TOFIX >>>> fi.source); - - SubFileItem *sfi = new SubFileItem(*it, fi.fname, - fi.size, SFI_STATE_UPLOAD, ""); - - // XXX HACK _ TOFIX >>>> fi.source); - - mUploads[*it] = sfi; - mUploadsLayout->addWidget(sfi); - } - } -} - - - diff --git a/retroshare-gui/src/gui/unfinished/TransferFeed.h b/retroshare-gui/src/gui/unfinished/TransferFeed.h deleted file mode 100644 index 85ede93a7..000000000 --- a/retroshare-gui/src/gui/unfinished/TransferFeed.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************** - * 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. - ****************************************************************/ - -#ifndef _TRANSFER_FEED_DIALOG_H -#define _TRANSFER_FEED_DIALOG_H - -#include "gui/mainpage.h" -#include "ui_TransferFeed.h" - -#include "gui/feeds/FeedHolder.h" - -class SubFileItem; - -class TransferFeed : public MainPage, public FeedHolder, private Ui::TransferFeed -{ - Q_OBJECT - -public: - /** Default Constructor */ - TransferFeed(QWidget *parent = 0); - /** Default Destructor */ - - /* FeedHolder Functions (for FeedItem functionality) */ -virtual void deleteFeedItem(QWidget *item, uint32_t type); -virtual void openChat(std::string peerId); -virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo); - -private slots: - - void updateMode(); - void updateAll(); - void updateDownloads(); - void updateUploads(); - -private: - - QLayout *mDownloadsLayout; - QLayout *mUploadsLayout; - - /* lists of feedItems */ - uint32_t mMode; - std::map mDownloads; - std::map mUploads; - -}; - - - -#endif - - diff --git a/retroshare-gui/src/gui/unfinished/TransferFeed.ui b/retroshare-gui/src/gui/unfinished/TransferFeed.ui deleted file mode 100644 index 76ab24961..000000000 --- a/retroshare-gui/src/gui/unfinished/TransferFeed.ui +++ /dev/null @@ -1,139 +0,0 @@ - - TransferFeed - - - - 0 - 0 - 689 - 386 - - - - Form - - - - 0 - - - 0 - - - 6 - - - 0 - - - 6 - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Sort: - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - 100 - 0 - - - - - None - - - - - - - - Qt::Horizontal - - - - 50 - 20 - - - - - - - - - - Qt::Vertical - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - -