* added doubleclick download feature

* added download Button

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@903 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-01-02 00:09:59 +00:00
parent 78fe71b2f4
commit 60244f6f7f
3 changed files with 83 additions and 43 deletions

View file

@ -73,6 +73,11 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
connect( ui.remoteDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( shareddirtreeviewCostumPopupMenu( QPoint ) ) ); connect( ui.remoteDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( shareddirtreeviewCostumPopupMenu( QPoint ) ) );
connect( ui.remoteDirTreeView, SIGNAL( doubleClicked(const QModelIndex&)), this, SLOT( downloadRemoteSelected()));
connect( ui.downloadButton, SIGNAL( clicked()), this, SLOT( downloadRemoteSelected()));
/* /*
connect( ui.remoteDirTreeView, SIGNAL( itemExpanded( QTreeWidgetItem * ) ), connect( ui.remoteDirTreeView, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
this, SLOT( checkForLocalDirRequest( QTreeWidgetItem * ) ) ); this, SLOT( checkForLocalDirRequest( QTreeWidgetItem * ) ) );
@ -203,6 +208,7 @@ void SharedFilesDialog::downloadRemoteSelected()
QItemSelectionModel *qism = ui.remoteDirTreeView->selectionModel(); QItemSelectionModel *qism = ui.remoteDirTreeView->selectionModel();
model -> downloadSelected(qism->selectedIndexes()); model -> downloadSelected(qism->selectedIndexes());
} }
@ -470,3 +476,4 @@ void SharedFilesDialog::showFrame(bool show)
ui.frameButton->setIcon(QIcon(tr(":images/show_toolbox_frame.png"))); ui.frameButton->setIcon(QIcon(tr(":images/show_toolbox_frame.png")));
} }
} }

View file

@ -17,49 +17,50 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, * Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
****************************************************************/ ****************************************************************/
#ifndef _SHAREDFILESDIALOG_H #ifndef _SHAREDFILESDIALOG_H
#define _SHAREDFILESDIALOG_H #define _SHAREDFILESDIALOG_H
#include <QFileDialog> #include <QFileDialog>
//#include <config/rsharesettings.h> //#include <config/rsharesettings.h>
#include "mainpage.h" #include "mainpage.h"
#include "ui_SharedFilesDialog.h" #include "ui_SharedFilesDialog.h"
#include "rsiface/rstypes.h" #include "rsiface/rstypes.h"
#include "rsiface/RemoteDirModel.h" #include "rsiface/RemoteDirModel.h"
class SharedFilesDialog : public MainPage class SharedFilesDialog : public MainPage
{ {
Q_OBJECT Q_OBJECT
public: public:
/** Default Constructor */ /** Default Constructor */
SharedFilesDialog(QWidget *parent = 0); SharedFilesDialog(QWidget *parent = 0);
/** Default Destructor */ /** Default Destructor */
/* For handling the model updates */ /* For handling the model updates */
void preModDirectories(bool update_local); void preModDirectories(bool update_local);
void ModDirectories(bool update_local); void ModDirectories(bool update_local);
private slots: private slots:
void checkUpdate(); void checkUpdate();
void forceCheck(); void forceCheck();
/** Create the context popup menu and it's submenus */ /** Create the context popup menu and it's submenus */
void shareddirtreeviewCostumPopupMenu( QPoint point ); void shareddirtreeviewCostumPopupMenu( QPoint point );
void shareddirtreeWidgetCostumPopupMenu( QPoint point ); void shareddirtreeWidgetCostumPopupMenu( QPoint point );
void downloadRemoteSelected(); void downloadRemoteSelected();
// void addMsgRemoteSelected(); // void addMsgRemoteSelected();
void showFrame(bool show); void showFrame(bool show);
// void recommendfile(); // void recommendfile();
void playselectedfiles(); void playselectedfiles();
@ -73,31 +74,31 @@ private slots:
signals: signals:
void playFiles(QStringList files); void playFiles(QStringList files);
private: private:
/** Define the popup menus for the Context menu */ /** Define the popup menus for the Context menu */
QMenu* contextMnu; QMenu* contextMnu;
QMenu* contextMnu2; QMenu* contextMnu2;
/** Defines the actions for the context menu for QTreeView */ /** Defines the actions for the context menu for QTreeView */
QAction* downloadAct; QAction* downloadAct;
QAction* addMsgAct; QAction* addMsgAct;
/** Defines the actions for the context menu for QTreeWidget */ /** Defines the actions for the context menu for QTreeWidget */
QAction* openfileAct; QAction* openfileAct;
QAction* openfolderAct; QAction* openfolderAct;
QTreeView *shareddirtreeview; QTreeView *shareddirtreeview;
QMovie *movie; QMovie *movie;
/** Qt Designer generated object */ /** Qt Designer generated object */
Ui::SharedFilesDialog ui; Ui::SharedFilesDialog ui;
/* RemoteDirModel */ /* RemoteDirModel */
RemoteDirModel *model; RemoteDirModel *model;
RemoteDirModel *localModel; RemoteDirModel *localModel;
}; };
#endif #endif

View file

@ -6,7 +6,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>548</width> <width>548</width>
<height>401</height> <height>433</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
@ -488,13 +488,7 @@
<enum>Qt::NoContextMenu</enum> <enum>Qt::NoContextMenu</enum>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="horizontalSpacing" > <item row="0" column="0" colspan="3" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="0" column="0" colspan="2" >
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<item> <item>
<layout class="QGridLayout" > <layout class="QGridLayout" >
@ -624,7 +618,7 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="1" > <item row="1" column="1" colspan="2" >
<widget class="QSplitter" name="splitter" > <widget class="QSplitter" name="splitter" >
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -722,6 +716,44 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="2" >
<widget class="QPushButton" name="downloadButton" >
<property name="minimumSize" >
<size>
<width>140</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
<property name="toolTip" >
<string>Download selected</string>
</property>
<property name="text" >
<string>Download</string>
</property>
<property name="icon" >
<iconset resource="images.qrc" >:/images/download16.png</iconset>
</property>
</widget>
</item>
<item row="2" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>391</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>