* 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( doubleClicked(const QModelIndex&)), this, SLOT( downloadRemoteSelected()));
connect( ui.downloadButton, SIGNAL( clicked()), this, SLOT( downloadRemoteSelected()));
/*
connect( ui.remoteDirTreeView, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
this, SLOT( checkForLocalDirRequest( QTreeWidgetItem * ) ) );
@ -203,6 +208,7 @@ void SharedFilesDialog::downloadRemoteSelected()
QItemSelectionModel *qism = ui.remoteDirTreeView->selectionModel();
model -> downloadSelected(qism->selectedIndexes());
}
@ -470,3 +476,4 @@ void SharedFilesDialog::showFrame(bool show)
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
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef _SHAREDFILESDIALOG_H
#define _SHAREDFILESDIALOG_H
#include <QFileDialog>
****************************************************************/
#ifndef _SHAREDFILESDIALOG_H
#define _SHAREDFILESDIALOG_H
#include <QFileDialog>
//#include <config/rsharesettings.h>
#include "mainpage.h"
#include "ui_SharedFilesDialog.h"
#include "mainpage.h"
#include "ui_SharedFilesDialog.h"
#include "rsiface/rstypes.h"
#include "rsiface/RemoteDirModel.h"
class SharedFilesDialog : public MainPage
{
Q_OBJECT
public:
/** Default Constructor */
SharedFilesDialog(QWidget *parent = 0);
/** Default Destructor */
class SharedFilesDialog : public MainPage
{
Q_OBJECT
public:
/** Default Constructor */
SharedFilesDialog(QWidget *parent = 0);
/** Default Destructor */
/* For handling the model updates */
void preModDirectories(bool update_local);
void ModDirectories(bool update_local);
void preModDirectories(bool update_local);
void ModDirectories(bool update_local);
private slots:
void checkUpdate();
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 shareddirtreeWidgetCostumPopupMenu( QPoint point );
void downloadRemoteSelected();
void downloadRemoteSelected();
// void addMsgRemoteSelected();
void showFrame(bool show);
// void recommendfile();
void playselectedfiles();
@ -73,31 +74,31 @@ private slots:
signals:
void playFiles(QStringList files);
private:
/** Define the popup menus for the Context menu */
private:
/** Define the popup menus for the Context menu */
QMenu* contextMnu;
QMenu* contextMnu2;
/** Defines the actions for the context menu for QTreeView */
QAction* downloadAct;
QAction* downloadAct;
QAction* addMsgAct;
/** Defines the actions for the context menu for QTreeWidget */
QAction* openfileAct;
QAction* openfileAct;
QAction* openfolderAct;
QTreeView *shareddirtreeview;
QMovie *movie;
/** Qt Designer generated object */
Ui::SharedFilesDialog ui;
/** Qt Designer generated object */
Ui::SharedFilesDialog ui;
/* RemoteDirModel */
RemoteDirModel *model;
RemoteDirModel *localModel;
};
#endif
};
#endif

View File

@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>548</width>
<height>401</height>
<height>433</height>
</rect>
</property>
<property name="sizePolicy" >
@ -488,13 +488,7 @@
<enum>Qt::NoContextMenu</enum>
</property>
<layout class="QGridLayout" >
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="0" column="0" colspan="2" >
<item row="0" column="0" colspan="3" >
<layout class="QHBoxLayout" >
<item>
<layout class="QGridLayout" >
@ -624,7 +618,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="1" column="1" >
<item row="1" column="1" colspan="2" >
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
@ -722,6 +716,44 @@ p, li { white-space: pre-wrap; }
</widget>
</widget>
</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>
</widget>
<resources>