mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-16 10:01:14 -04:00
- separated SharedFilesDialog into two classes: remote and local, both deriving from a common
SharedFilesDialog class. As a side effect the tree view/flat view are both available in local and remote mode, as well as the file filter tool. The gui is common. Each sub-class hides whatever it does not want to show/use. - moved local and friends files into tabs of Transfers. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ImprovedGUI@6108 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8fe75acfaf
commit
174226eb21
9 changed files with 520 additions and 731 deletions
|
@ -43,7 +43,7 @@
|
|||
#include "SearchDialog.h"
|
||||
#include "TransfersDialog.h"
|
||||
#include "MessagesDialog.h"
|
||||
#include "SharedFilesDialog.h"
|
||||
//#include "SharedFilesDialog.h"
|
||||
#include "PluginsPage.h"
|
||||
#include "NewsFeed.h"
|
||||
#include "ShareManager.h"
|
||||
|
@ -255,8 +255,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
action = createPageAction(QIcon(IMAGE_TRANSFERS), tr("Transfers"), grp));
|
||||
notify.push_back(QPair<MainPage*, QAction*>(transfersDialog, action));
|
||||
|
||||
ui->stackPages->add(sharedfilesDialog = new SharedFilesDialog(ui->stackPages),
|
||||
createPageAction(QIcon(IMAGE_FILES), tr("Files"), grp));
|
||||
// ui->stackPages->add(sharedfilesDialog = new SharedFilesDialog(ui->stackPages),
|
||||
// createPageAction(QIcon(IMAGE_FILES), tr("Files"), grp));
|
||||
|
||||
ui->stackPages->add(messagesDialog = new MessagesDialog(ui->stackPages),
|
||||
action = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp));
|
||||
|
@ -800,8 +800,8 @@ void SetForegroundWindowInternal(HWND hWnd)
|
|||
case Transfers:
|
||||
Page = _instance->transfersDialog;
|
||||
break;
|
||||
case SharedDirectories:
|
||||
Page = _instance->sharedfilesDialog;
|
||||
// case SharedDirectories:
|
||||
// Page = _instance->sharedfilesDialog;
|
||||
break;
|
||||
case Messages:
|
||||
Page = _instance->messagesDialog;
|
||||
|
@ -849,9 +849,9 @@ void SetForegroundWindowInternal(HWND hWnd)
|
|||
if (page == _instance->transfersDialog) {
|
||||
return Transfers;
|
||||
}
|
||||
if (page == _instance->sharedfilesDialog) {
|
||||
return SharedDirectories;
|
||||
}
|
||||
// if (page == _instance->sharedfilesDialog) {
|
||||
// return SharedDirectories;
|
||||
// }
|
||||
if (page == _instance->messagesDialog) {
|
||||
return Messages;
|
||||
}
|
||||
|
@ -891,8 +891,8 @@ void SetForegroundWindowInternal(HWND hWnd)
|
|||
// return _instance->searchDialog;
|
||||
case Transfers:
|
||||
return _instance->transfersDialog;
|
||||
case SharedDirectories:
|
||||
return _instance->sharedfilesDialog;
|
||||
// case SharedDirectories:
|
||||
// return _instance->sharedfilesDialog;
|
||||
case Messages:
|
||||
return _instance->messagesDialog;
|
||||
#ifdef RS_USE_LINKS
|
||||
|
|
|
@ -37,137 +37,140 @@
|
|||
<item>
|
||||
<widget class="QCheckBox" name="showUnvalidKeys">
|
||||
<property name="text">
|
||||
<string>Show keys that are not validated by the PGP web of trust</string>
|
||||
<string>Show all accessible keys</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="connecttreeWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="uniformRowHeights">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="animated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerCascadingSectionResizes">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>200</number>
|
||||
</attribute>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
<widget class="QTreeWidget" name="connecttreeWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Did I authenticated peer</string>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Did I sign his PGP key</string>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Did peer authenticated me</string>
|
||||
<property name="lineWidth">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Cert Id</string>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="unvalidGPGkeyWidget">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerCascadingSectionResizes">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>200</number>
|
||||
</attribute>
|
||||
<attribute name="headerShowSortIndicator" stdset="0">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
<property name="uniformRowHeights">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Did I authenticated peer</string>
|
||||
<property name="animated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Did peer authenticated me</string>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Cert Id</string>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<attribute name="headerCascadingSectionResizes">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>200</number>
|
||||
</attribute>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Did I authenticated peer</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Did I sign his PGP key</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Did peer authenticated me</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Cert Id</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
<widget class="QTreeWidget" name="unvalidGPGkeyWidget">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerCascadingSectionResizes">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>200</number>
|
||||
</attribute>
|
||||
<attribute name="headerShowSortIndicator" stdset="0">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Did I authenticated peer</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Did peer authenticated me</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Cert Id</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -1307,8 +1307,9 @@ void FlatStyle_RDM::updateRefs()
|
|||
#endif
|
||||
_ref_stack.pop_back() ;
|
||||
DirDetails details ;
|
||||
FileSearchFlags flags = (RemoteMode)?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL;
|
||||
|
||||
if (requestDirDetails(ref, details, RS_FILE_HINTS_REMOTE))
|
||||
if (requestDirDetails(ref, details, flags))
|
||||
{
|
||||
if(details.type == DIR_TYPE_FILE) // only push files, not directories nor persons.
|
||||
_ref_entries.push_back(std::pair<void*,QString>(ref,computeDirectoryPath(details)));
|
||||
|
|
|
@ -90,36 +90,24 @@ private:
|
|||
};
|
||||
|
||||
/** Constructor */
|
||||
SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
||||
SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareDirModel *_flat_model,QWidget *parent)
|
||||
: RsAutoUpdatePage(1000,parent),model(NULL)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
connect(ui.checkButton, SIGNAL(clicked()), this, SLOT(forceCheck()));
|
||||
connect(ui.localButton, SIGNAL(toggled(bool)), this, SLOT(showFrame(bool)));
|
||||
connect(ui.remoteButton, SIGNAL(toggled(bool)), this, SLOT(showFrameRemote(bool)));
|
||||
connect(ui.splittedButton, SIGNAL(toggled(bool)), this, SLOT(showFrameSplitted(bool)));
|
||||
//== connect(ui.localButton, SIGNAL(toggled(bool)), this, SLOT(showFrame(bool)));
|
||||
//== connect(ui.remoteButton, SIGNAL(toggled(bool)), this, SLOT(showFrameRemote(bool)));
|
||||
//== connect(ui.splittedButton, SIGNAL(toggled(bool)), this, SLOT(showFrameSplitted(bool)));
|
||||
connect(ui.viewType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCurrentViewModel(int)));
|
||||
|
||||
connect( ui.localDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( sharedDirTreeWidgetContextMenu( 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.dirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( spawnCustomPopupMenu( QPoint ) ) );
|
||||
|
||||
connect(ui.indicatorCBox, SIGNAL(currentIndexChanged(int)), this, SLOT(indicatorChanged(int)));
|
||||
|
||||
/*
|
||||
connect( ui.remoteDirTreeView, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
|
||||
this, SLOT( checkForLocalDirRequest( QTreeWidgetItem * ) ) );
|
||||
|
||||
connect( ui.localDirTreeWidget, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
|
||||
this, SLOT( checkForRemoteDirRequest( QTreeWidgetItem * ) ) );
|
||||
*/
|
||||
|
||||
tree_model = new TreeStyle_RDM(true);
|
||||
flat_model = new FlatStyle_RDM(true);
|
||||
tree_model = _tree_model ;
|
||||
flat_model = _flat_model ;
|
||||
|
||||
tree_proxyModel = new SFDSortFilterProxyModel(tree_model, this);
|
||||
tree_proxyModel->setDynamicSortFilter(true);
|
||||
|
@ -135,22 +123,22 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
|||
flat_proxyModel->setSortRole(RetroshareDirModel::SortRole);
|
||||
flat_proxyModel->sort(0);
|
||||
|
||||
localModel = new TreeStyle_RDM(false);
|
||||
//== localModel = new TreeStyle_RDM(false);
|
||||
//==
|
||||
//== localProxyModel = new SFDSortFilterProxyModel(localModel, this);
|
||||
//== localProxyModel->setDynamicSortFilter(true);
|
||||
//== localProxyModel->setSourceModel(localModel);
|
||||
//== localProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
//== localProxyModel->setSortRole(RetroshareDirModel::SortRole);
|
||||
//== localProxyModel->sort(0);
|
||||
|
||||
localProxyModel = new SFDSortFilterProxyModel(localModel, this);
|
||||
localProxyModel->setDynamicSortFilter(true);
|
||||
localProxyModel->setSourceModel(localModel);
|
||||
localProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
localProxyModel->setSortRole(RetroshareDirModel::SortRole);
|
||||
localProxyModel->sort(0);
|
||||
//== ui.dirTreeView->setModel(localProxyModel);
|
||||
|
||||
ui.localDirTreeView->setModel(localProxyModel);
|
||||
//== connect( ui.dirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), localModel, SLOT( collapsed(const QModelIndex & ) ) );
|
||||
//== connect( ui.dirTreeView, SIGNAL( expanded(const QModelIndex & ) ), localModel, SLOT( expanded(const QModelIndex & ) ) );
|
||||
|
||||
connect( ui.localDirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), localModel, SLOT( collapsed(const QModelIndex & ) ) );
|
||||
connect( ui.localDirTreeView, SIGNAL( expanded(const QModelIndex & ) ), localModel, SLOT( expanded(const QModelIndex & ) ) );
|
||||
|
||||
connect( localModel, SIGNAL( layoutAboutToBeChanged() ), ui.localDirTreeView, SLOT( reset() ) );
|
||||
connect( localModel, SIGNAL( layoutChanged() ), ui.localDirTreeView, SLOT( update() ) );
|
||||
//== connect( localModel, SIGNAL( layoutAboutToBeChanged() ), ui.localDirTreeView, SLOT( reset() ) );
|
||||
//== connect( localModel, SIGNAL( layoutChanged() ), ui.localDirTreeView, SLOT( update() ) );
|
||||
|
||||
connect(ui.filterClearButton, SIGNAL(clicked()), this, SLOT(clearFilter()));
|
||||
connect(ui.filterStartButton, SIGNAL(clicked()), this, SLOT(startFilter()));
|
||||
|
@ -158,61 +146,25 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
|||
connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged()));
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
QHeaderView * l_header = ui.localDirTreeView->header () ;
|
||||
QHeaderView * header = ui.dirTreeView->header () ;
|
||||
header->setResizeMode (0, QHeaderView::Interactive);
|
||||
|
||||
l_header->resizeSection ( 0, 490 );
|
||||
l_header->resizeSection ( 1, 70 );
|
||||
l_header->resizeSection ( 2, 100 );
|
||||
l_header->resizeSection ( 3, 100 );
|
||||
l_header->resizeSection ( 4, 100 );
|
||||
header->resizeSection ( 0, 490 );
|
||||
header->resizeSection ( 1, 70 );
|
||||
header->resizeSection ( 2, 100 );
|
||||
header->resizeSection ( 3, 100 );
|
||||
header->resizeSection ( 4, 100 );
|
||||
|
||||
l_header->setStretchLastSection(false);
|
||||
// l_header->setHighlightSections(false);
|
||||
header->setStretchLastSection(false);
|
||||
|
||||
// Setup the current view model.
|
||||
//
|
||||
changeCurrentViewModel(ui.viewType_CB->currentIndex()) ;
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
QHeaderView * r_header = ui.remoteDirTreeView->header () ;
|
||||
|
||||
r_header->setResizeMode (0, QHeaderView::Interactive);
|
||||
r_header->setStretchLastSection(false);
|
||||
|
||||
// r_header->setResizeMode (1, QHeaderView::Fixed);
|
||||
// // r_header->setResizeMode (2, QHeaderView::Interactive);
|
||||
// r_header->setResizeMode (3, QHeaderView::Fixed);
|
||||
// // r_header->setResizeMode (4, QHeaderView::Interactive);
|
||||
|
||||
r_header->resizeSection ( 0, 490 );
|
||||
r_header->resizeSection ( 1, 70 );
|
||||
r_header->resizeSection ( 2, 80 );
|
||||
r_header->resizeSection ( 3, 100 );
|
||||
r_header->resizeSection ( 4, 80 );
|
||||
|
||||
// r_header->setHighlightSections(false);
|
||||
|
||||
/* Set Multi Selection */
|
||||
ui.remoteDirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
ui.localDirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
|
||||
//#ifdef RS_RELEASE_VERSION
|
||||
// ui.filterLabel->hide();
|
||||
// ui.filterPatternLineEdit->hide();
|
||||
//#endif
|
||||
|
||||
// load settings
|
||||
processSettings(true);
|
||||
|
||||
// Hide columns after loading the settings
|
||||
ui.remoteDirTreeView->setColumnHidden(3,false) ;
|
||||
ui.remoteDirTreeView->setColumnHidden(4,true) ;
|
||||
ui.localDirTreeView->setColumnHidden(4,false) ;
|
||||
ui.dirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
|
||||
#endif
|
||||
copylinklocalAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this );
|
||||
connect( copylinklocalAct , SIGNAL( triggered() ), this, SLOT( copyLinkLocal() ) );
|
||||
copylinklocalhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this );
|
||||
|
@ -235,11 +187,34 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
|||
connect(editshareAct, SIGNAL(triggered()), this, SLOT(editSharePermissions()));
|
||||
}
|
||||
|
||||
LocalSharedFilesDialog::LocalSharedFilesDialog(QWidget *parent)
|
||||
: SharedFilesDialog(new TreeStyle_RDM(false),new FlatStyle_RDM(false),parent)
|
||||
{
|
||||
// Hide columns after loading the settings
|
||||
ui.dirTreeView->setColumnHidden(4,false) ;
|
||||
ui.downloadButton->hide() ;
|
||||
|
||||
// load settings
|
||||
processSettings(true);
|
||||
}
|
||||
|
||||
RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent)
|
||||
: SharedFilesDialog(new TreeStyle_RDM(true),new FlatStyle_RDM(true),parent)
|
||||
{
|
||||
ui.dirTreeView->setColumnHidden(3,false) ;
|
||||
ui.dirTreeView->setColumnHidden(4,true) ;
|
||||
ui.checkButton->hide() ;
|
||||
|
||||
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(downloadRemoteSelected()));
|
||||
|
||||
// load settings
|
||||
processSettings(true);
|
||||
}
|
||||
|
||||
void SharedFilesDialog::hideEvent(QHideEvent *)
|
||||
{
|
||||
if(model!=NULL)
|
||||
model->setVisible(false) ;
|
||||
//std::cerr << "Hidden!"<< std::endl;
|
||||
}
|
||||
void SharedFilesDialog::showEvent(QShowEvent *)
|
||||
{
|
||||
|
@ -248,15 +223,50 @@ void SharedFilesDialog::showEvent(QShowEvent *)
|
|||
model->setVisible(true) ;
|
||||
model->update() ;
|
||||
}
|
||||
//std::cerr << "Shown!"<< std::endl;
|
||||
}
|
||||
SharedFilesDialog::~SharedFilesDialog()
|
||||
RemoteSharedFilesDialog::~RemoteSharedFilesDialog()
|
||||
{
|
||||
// save settings
|
||||
processSettings(false);
|
||||
}
|
||||
|
||||
void SharedFilesDialog::processSettings(bool bLoad)
|
||||
LocalSharedFilesDialog::~LocalSharedFilesDialog()
|
||||
{
|
||||
// save settings
|
||||
processSettings(false);
|
||||
}
|
||||
|
||||
void LocalSharedFilesDialog::processSettings(bool bLoad)
|
||||
{
|
||||
Settings->beginGroup("LocalSharedFilesDialog");
|
||||
|
||||
if (bLoad) {
|
||||
// load settings
|
||||
|
||||
// state of the trees
|
||||
ui.dirTreeView->header()->restoreState(Settings->value("LocalDirTreeView").toByteArray());
|
||||
|
||||
// state of splitter
|
||||
ui.splitter->restoreState(Settings->value("LocalSplitter").toByteArray());
|
||||
|
||||
// view type
|
||||
ui.viewType_CB->setCurrentIndex(Settings->value("LocalViewType").toInt());
|
||||
} else {
|
||||
// save settings
|
||||
|
||||
// state of trees
|
||||
Settings->setValue("LocalDirTreeView", ui.dirTreeView->header()->saveState());
|
||||
|
||||
// state of splitter
|
||||
Settings->setValue("LocalSplitter", ui.splitter->saveState());
|
||||
|
||||
// view type
|
||||
Settings->setValue("LocalViewType", ui.viewType_CB->currentIndex());
|
||||
}
|
||||
|
||||
Settings->endGroup();
|
||||
}
|
||||
void RemoteSharedFilesDialog::processSettings(bool bLoad)
|
||||
{
|
||||
Settings->beginGroup("SharedFilesDialog");
|
||||
|
||||
|
@ -264,26 +274,24 @@ void SharedFilesDialog::processSettings(bool bLoad)
|
|||
// load settings
|
||||
|
||||
// state of the trees
|
||||
ui.localDirTreeView->header()->restoreState(Settings->value("LocalDirTreeView").toByteArray());
|
||||
ui.remoteDirTreeView->header()->restoreState(Settings->value("RemoteDirTreeView").toByteArray());
|
||||
ui.dirTreeView->header()->restoreState(Settings->value("RemoteDirTreeView").toByteArray());
|
||||
|
||||
// state of splitter
|
||||
ui.splitter->restoreState(Settings->value("Splitter").toByteArray());
|
||||
ui.splitter->restoreState(Settings->value("RemoteSplitter").toByteArray());
|
||||
|
||||
// view type
|
||||
ui.viewType_CB->setCurrentIndex(Settings->value("ViewType").toInt());
|
||||
ui.viewType_CB->setCurrentIndex(Settings->value("RemoteViewType").toInt());
|
||||
} else {
|
||||
// save settings
|
||||
|
||||
// state of trees
|
||||
Settings->setValue("LocalDirTreeView", ui.localDirTreeView->header()->saveState());
|
||||
Settings->setValue("RemoteDirTreeView", ui.remoteDirTreeView->header()->saveState());
|
||||
Settings->setValue("RemoteDirTreeView", ui.dirTreeView->header()->saveState());
|
||||
|
||||
// state of splitter
|
||||
Settings->setValue("Splitter", ui.splitter->saveState());
|
||||
Settings->setValue("RemoteSplitter", ui.splitter->saveState());
|
||||
|
||||
// view type
|
||||
Settings->setValue("ViewType", ui.viewType_CB->currentIndex());
|
||||
Settings->setValue("RemoteViewType", ui.viewType_CB->currentIndex());
|
||||
}
|
||||
|
||||
Settings->endGroup();
|
||||
|
@ -291,8 +299,8 @@ void SharedFilesDialog::processSettings(bool bLoad)
|
|||
|
||||
void SharedFilesDialog::changeCurrentViewModel(int c)
|
||||
{
|
||||
disconnect( ui.remoteDirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), 0, 0 );
|
||||
disconnect( ui.remoteDirTreeView, SIGNAL( expanded(const QModelIndex & ) ), 0, 0 );
|
||||
disconnect( ui.dirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), 0, 0 );
|
||||
disconnect( ui.dirTreeView, SIGNAL( expanded(const QModelIndex & ) ), 0, 0 );
|
||||
|
||||
if(model!=NULL)
|
||||
model->setVisible(false) ;
|
||||
|
@ -301,8 +309,8 @@ void SharedFilesDialog::changeCurrentViewModel(int c)
|
|||
{
|
||||
model = tree_model ;
|
||||
proxyModel = tree_proxyModel ;
|
||||
ui.remoteDirTreeView->setColumnHidden(3,true) ;
|
||||
ui.remoteDirTreeView->setColumnHidden(4,true) ;
|
||||
ui.dirTreeView->setColumnHidden(3,true) ;
|
||||
ui.dirTreeView->setColumnHidden(4,true) ;
|
||||
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
||||
ui.filterLabel->hide();
|
||||
ui.filterPatternLineEdit->hide();
|
||||
|
@ -314,8 +322,8 @@ void SharedFilesDialog::changeCurrentViewModel(int c)
|
|||
{
|
||||
model = flat_model ;
|
||||
proxyModel = flat_proxyModel ;
|
||||
ui.remoteDirTreeView->setColumnHidden(3,false) ;
|
||||
ui.remoteDirTreeView->setColumnHidden(4,false) ;
|
||||
ui.dirTreeView->setColumnHidden(3,false) ;
|
||||
ui.dirTreeView->setColumnHidden(4,false) ;
|
||||
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
||||
ui.filterLabel->show();
|
||||
ui.filterPatternLineEdit->show();
|
||||
|
@ -328,13 +336,13 @@ void SharedFilesDialog::changeCurrentViewModel(int c)
|
|||
model->update() ;
|
||||
}
|
||||
|
||||
connect( ui.remoteDirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), model, SLOT( collapsed(const QModelIndex & ) ) );
|
||||
connect( ui.remoteDirTreeView, SIGNAL( expanded(const QModelIndex & ) ), model, SLOT( expanded(const QModelIndex & ) ) );
|
||||
connect( ui.dirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), model, SLOT( collapsed(const QModelIndex & ) ) );
|
||||
connect( ui.dirTreeView, SIGNAL( expanded(const QModelIndex & ) ), model, SLOT( expanded(const QModelIndex & ) ) );
|
||||
|
||||
ui.remoteDirTreeView->setModel(proxyModel);
|
||||
ui.remoteDirTreeView->update();
|
||||
ui.dirTreeView->setModel(proxyModel);
|
||||
ui.dirTreeView->update();
|
||||
|
||||
ui.remoteDirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ;
|
||||
ui.dirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ;
|
||||
|
||||
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
||||
if(c == 1)
|
||||
|
@ -342,16 +350,16 @@ void SharedFilesDialog::changeCurrentViewModel(int c)
|
|||
FilterItems();
|
||||
}
|
||||
|
||||
void SharedFilesDialog::checkUpdate()
|
||||
void LocalSharedFilesDialog::checkUpdate()
|
||||
{
|
||||
/* update */
|
||||
/* update */
|
||||
if (rsFiles->InDirectoryCheck())
|
||||
{
|
||||
ui.checkButton->setText(tr("Checking..."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.checkButton->setText(tr("Check files"));
|
||||
ui.checkButton->setText(tr("Check files"));
|
||||
ui.hashLabel->setPixmap(QPixmap(IMAGE_HASH_DONE));
|
||||
ui.hashLabel->setToolTip("") ;
|
||||
}
|
||||
|
@ -359,17 +367,15 @@ void SharedFilesDialog::checkUpdate()
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
void SharedFilesDialog::forceCheck()
|
||||
void LocalSharedFilesDialog::forceCheck()
|
||||
{
|
||||
rsFiles->ForceDirectoryCheck();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point )
|
||||
void RemoteSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
|
||||
{
|
||||
QModelIndex idx = ui.remoteDirTreeView->indexAt(point);
|
||||
QModelIndex idx = ui.dirTreeView->indexAt(point);
|
||||
if (!idx.isValid())
|
||||
return;
|
||||
QModelIndex midx = proxyModel->mapToSource(idx);
|
||||
|
@ -404,20 +410,9 @@ void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point )
|
|||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
QModelIndexList SharedFilesDialog::getLocalSelected()
|
||||
QModelIndexList SharedFilesDialog::getSelected()
|
||||
{
|
||||
QModelIndexList list = ui.localDirTreeView->selectionModel()->selectedIndexes();
|
||||
QModelIndexList proxyList;
|
||||
for (QModelIndexList::iterator index = list.begin(); index != list.end(); index++) {
|
||||
proxyList.append(localProxyModel->mapToSource(*index));
|
||||
}
|
||||
|
||||
return proxyList;
|
||||
}
|
||||
|
||||
QModelIndexList SharedFilesDialog::getRemoteSelected()
|
||||
{
|
||||
QModelIndexList list = ui.remoteDirTreeView->selectionModel()->selectedIndexes();
|
||||
QModelIndexList list = ui.dirTreeView->selectionModel()->selectedIndexes();
|
||||
QModelIndexList proxyList;
|
||||
for (QModelIndexList::iterator index = list.begin(); index != list.end(); index++) {
|
||||
proxyList.append(proxyModel->mapToSource(*index));
|
||||
|
@ -426,27 +421,27 @@ QModelIndexList SharedFilesDialog::getRemoteSelected()
|
|||
return proxyList;
|
||||
}
|
||||
|
||||
void SharedFilesDialog::createCollectionFile()
|
||||
void LocalSharedFilesDialog::createCollectionFile()
|
||||
{
|
||||
/* call back to the model (which does all the interfacing? */
|
||||
|
||||
std::cerr << "Creating a collection file!" << std::endl;
|
||||
QModelIndexList lst = getLocalSelected();
|
||||
localModel->createCollectionFile(this, lst);
|
||||
QModelIndexList lst = getSelected();
|
||||
model->createCollectionFile(this, lst);
|
||||
}
|
||||
|
||||
void SharedFilesDialog::downloadRemoteSelected()
|
||||
void RemoteSharedFilesDialog::downloadRemoteSelected()
|
||||
{
|
||||
/* call back to the model (which does all the interfacing? */
|
||||
|
||||
std::cerr << "Downloading Files";
|
||||
std::cerr << std::endl;
|
||||
|
||||
QModelIndexList lst = getRemoteSelected();
|
||||
QModelIndexList lst = getSelected();
|
||||
model -> downloadSelected(lst);
|
||||
}
|
||||
|
||||
void SharedFilesDialog::editSharePermissions()
|
||||
void LocalSharedFilesDialog::editSharePermissions()
|
||||
{
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
@ -468,10 +463,7 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
|
|||
{
|
||||
std::vector<DirDetails> dirVec;
|
||||
|
||||
if (remote)
|
||||
model->getDirDetailsFromSelect(lst, dirVec);
|
||||
else
|
||||
localModel->getDirDetailsFromSelect(lst, dirVec);
|
||||
model->getDirDetailsFromSelect(lst, dirVec);
|
||||
|
||||
QList<RetroShareLink> urls ;
|
||||
|
||||
|
@ -509,55 +501,24 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
|
|||
RSLinkClipboard::copyLinks(urls) ;
|
||||
}
|
||||
|
||||
void SharedFilesDialog::copyLinkRemote()
|
||||
void SharedFilesDialog::copyLink()
|
||||
{
|
||||
QModelIndexList lst = getRemoteSelected();
|
||||
copyLink (lst, true);
|
||||
}
|
||||
|
||||
void SharedFilesDialog::copyLinkLocal()
|
||||
{
|
||||
QModelIndexList lst = getLocalSelected();
|
||||
copyLink (lst, false);
|
||||
copyLink ( getSelected() , true);
|
||||
}
|
||||
|
||||
void SharedFilesDialog::copyLinkhtml( )
|
||||
{
|
||||
copyLinkLocal ();
|
||||
copyLink();
|
||||
|
||||
QString link = QApplication::clipboard()->text();
|
||||
|
||||
QClipboard *clipboard = QApplication::clipboard();
|
||||
clipboard->setText("<a href='" + link + "'> " + link + "</a>");
|
||||
|
||||
}
|
||||
|
||||
void SharedFilesDialog::sendremoteLinkTo()
|
||||
{
|
||||
copyLinkRemote ();
|
||||
|
||||
/* create a message */
|
||||
MessageComposer *nMsgDialog = MessageComposer::newMsg();
|
||||
if (nMsgDialog == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* fill it in
|
||||
* files are receommended already
|
||||
* just need to set peers
|
||||
*/
|
||||
std::cerr << "SharedFilesDialog::sendremoteLinkTo()" << std::endl;
|
||||
nMsgDialog->setTitleText(tr("RetroShare Link"));
|
||||
nMsgDialog->setMsgText(RSLinkClipboard::toHtml(), true);
|
||||
|
||||
nMsgDialog->show();
|
||||
|
||||
/* window will destroy itself! */
|
||||
}
|
||||
|
||||
void SharedFilesDialog::sendLinkTo()
|
||||
{
|
||||
copyLinkLocal ();
|
||||
copyLink();
|
||||
|
||||
/* create a message */
|
||||
MessageComposer *nMsgDialog = MessageComposer::newMsg();
|
||||
|
@ -603,7 +564,7 @@ void SharedFilesDialog::addLinkToCloud()
|
|||
}
|
||||
#endif
|
||||
|
||||
void SharedFilesDialog::playselectedfiles()
|
||||
void LocalSharedFilesDialog::playselectedfiles()
|
||||
{
|
||||
/* call back to the model (which does all the interfacing? */
|
||||
|
||||
|
@ -611,19 +572,18 @@ void SharedFilesDialog::playselectedfiles()
|
|||
std::cerr << std::endl;
|
||||
|
||||
std::list<std::string> paths;
|
||||
localModel -> getFilePaths(getLocalSelected(), paths);
|
||||
model -> getFilePaths(getSelected(), paths);
|
||||
|
||||
std::list<std::string>::iterator it;
|
||||
QStringList fullpaths;
|
||||
for(it = paths.begin(); it != paths.end(); it++)
|
||||
{
|
||||
std::string fullpath;
|
||||
rsFiles->ConvertSharedFilePath(*it, fullpath);
|
||||
fullpaths.push_back(QString::fromStdString(fullpath));
|
||||
|
||||
std::cerr << "Playing: " << fullpath;
|
||||
std::cerr << std::endl;
|
||||
std::string fullpath;
|
||||
rsFiles->ConvertSharedFilePath(*it, fullpath);
|
||||
fullpaths.push_back(QString::fromStdString(fullpath));
|
||||
|
||||
std::cerr << "Playing: " << fullpath;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
playFiles(fullpaths);
|
||||
|
@ -632,35 +592,11 @@ void SharedFilesDialog::playselectedfiles()
|
|||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
void SharedFilesDialog::addMsgRemoteSelected()
|
||||
{
|
||||
std::list<DirDetails> files_info ;
|
||||
|
||||
model->getFileInfoFromIndexList(getRemoteSelected(),files_info);
|
||||
|
||||
if(files_info.empty())
|
||||
return ;
|
||||
|
||||
/* create a message */
|
||||
|
||||
MessageComposer *nMsgDialog = MessageComposer::newMsg();
|
||||
if (nMsgDialog == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
nMsgDialog->setFileList(files_info) ;
|
||||
nMsgDialog->setTitleText(tr("Recommendation(s)"));
|
||||
nMsgDialog->setMsgText(tr("Recommendation(s)"));
|
||||
nMsgDialog->show();
|
||||
|
||||
/* window will destroy itself! */
|
||||
}
|
||||
|
||||
void SharedFilesDialog::recommendFilesToMsg()
|
||||
{
|
||||
std::list<DirDetails> files_info ;
|
||||
|
||||
localModel->getFileInfoFromIndexList(getLocalSelected(),files_info);
|
||||
model->getFileInfoFromIndexList(getSelected(),files_info);
|
||||
|
||||
if(files_info.empty())
|
||||
return ;
|
||||
|
@ -680,112 +616,89 @@ void SharedFilesDialog::recommendFilesToMsg()
|
|||
/* window will destroy itself! */
|
||||
}
|
||||
|
||||
void SharedFilesDialog::openfile()
|
||||
void LocalSharedFilesDialog::openfile()
|
||||
{
|
||||
/* call back to the model (which does all the interfacing? */
|
||||
/* call back to the model (which does all the interfacing? */
|
||||
|
||||
std::cerr << "SharedFilesDialog::openfile" << std::endl;
|
||||
std::cerr << "SharedFilesDialog::openfile" << std::endl;
|
||||
|
||||
QModelIndexList qmil = getLocalSelected();
|
||||
localModel->openSelected(qmil);
|
||||
QModelIndexList qmil = getSelected();
|
||||
model->openSelected(qmil);
|
||||
}
|
||||
|
||||
|
||||
void SharedFilesDialog::openfolder()
|
||||
void LocalSharedFilesDialog::openfolder()
|
||||
{
|
||||
std::cerr << "SharedFilesDialog::openfolder" << std::endl;
|
||||
|
||||
QModelIndexList qmil = getLocalSelected();
|
||||
localModel->openSelected(qmil);
|
||||
QModelIndexList qmil = getSelected();
|
||||
model->openSelected(qmil);
|
||||
}
|
||||
|
||||
void SharedFilesDialog::preModDirectories(bool update_local)
|
||||
void SharedFilesDialog::preModDirectories()
|
||||
{
|
||||
//std::cerr << "SharedFilesDialog::preModDirectories called with update_local = " << update_local << std::endl ;
|
||||
if (update_local)
|
||||
localModel->preMods();
|
||||
else
|
||||
model->preMods();
|
||||
model->preMods();
|
||||
}
|
||||
|
||||
|
||||
void SharedFilesDialog::postModDirectories(bool update_local)
|
||||
void SharedFilesDialog::postModDirectories()
|
||||
{
|
||||
//std::cerr << "SharedFilesDialog::postModDirectories called with update_local = " << update_local << std::endl ;
|
||||
if (update_local)
|
||||
{
|
||||
localModel->postMods();
|
||||
ui.localDirTreeView->update() ;
|
||||
}
|
||||
else
|
||||
{
|
||||
model->postMods();
|
||||
ui.remoteDirTreeView->update() ;
|
||||
model->postMods();
|
||||
ui.dirTreeView->update() ;
|
||||
|
||||
if (ui.filterPatternLineEdit->text().isEmpty() == false) {
|
||||
FilterItems();
|
||||
}
|
||||
}
|
||||
if (ui.filterPatternLineEdit->text().isEmpty() == false)
|
||||
FilterItems();
|
||||
|
||||
QCoreApplication::flush();
|
||||
}
|
||||
|
||||
|
||||
void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
|
||||
void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
|
||||
{
|
||||
if (!rsPeers) {
|
||||
if (!rsPeers)
|
||||
{
|
||||
/* not ready yet! */
|
||||
return;
|
||||
}
|
||||
|
||||
QModelIndex idx = ui.localDirTreeView->indexAt(point);
|
||||
QModelIndex idx = ui.dirTreeView->indexAt(point);
|
||||
if (!idx.isValid())
|
||||
return;
|
||||
QModelIndex midx = localProxyModel->mapToSource(idx);
|
||||
QModelIndex midx = proxyModel->mapToSource(idx);
|
||||
if (!midx.isValid())
|
||||
return;
|
||||
|
||||
currentFile = localModel->data(midx, RetroshareDirModel::FileNameRole).toString();
|
||||
currentFile = model->data(midx, RetroshareDirModel::FileNameRole).toString();
|
||||
|
||||
int type = localModel->getType(midx);
|
||||
int type = model->getType(midx);
|
||||
|
||||
QMenu contextMnu(this);
|
||||
|
||||
// QAction* menuAction = fileAssotiationAction(currentFile) ;
|
||||
//new QAction(QIcon(IMAGE_PLAY), currentFile, this);
|
||||
//tr( "111Play File(s)" ), this );
|
||||
// connect( openfolderAct , SIGNAL( triggered() ), this,
|
||||
// SLOT( playselectedfiles() ) );
|
||||
|
||||
switch (type) {
|
||||
case DIR_TYPE_DIR:
|
||||
contextMnu.addAction(openfolderAct);
|
||||
//contextMnu.addSeparator();
|
||||
//contextMnu.addAction(editshareAct) ;
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(createcollectionfileAct) ;
|
||||
break;
|
||||
case DIR_TYPE_FILE:
|
||||
contextMnu.addAction(openfileAct);
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(copylinklocalAct);
|
||||
// contextMnu.addAction(copylinklocalhtmlAct);
|
||||
contextMnu.addAction(sendlinkAct);
|
||||
// contextMnu.addAction(sendhtmllinkAct);
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(createcollectionfileAct) ;
|
||||
contextMnu.addSeparator();
|
||||
switch (type)
|
||||
{
|
||||
case DIR_TYPE_DIR:
|
||||
contextMnu.addAction(openfolderAct);
|
||||
contextMnu.addSeparator() ;
|
||||
contextMnu.addAction(createcollectionfileAct) ;
|
||||
break;
|
||||
case DIR_TYPE_FILE:
|
||||
contextMnu.addAction(openfileAct);
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(copylinklocalAct);
|
||||
contextMnu.addAction(sendlinkAct);
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(createcollectionfileAct) ;
|
||||
contextMnu.addSeparator();
|
||||
#ifdef RS_USE_LINKS
|
||||
contextMnu.addAction(sendlinkCloudAct);
|
||||
contextMnu.addAction(addlinkCloudAct);
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(sendlinkCloudAct);
|
||||
contextMnu.addAction(addlinkCloudAct);
|
||||
contextMnu.addSeparator();
|
||||
#endif
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(recommendFilesToMsg()));
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(recommendFilesToMsg()));
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
@ -793,7 +706,7 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
|
|||
//============================================================================
|
||||
|
||||
QAction*
|
||||
SharedFilesDialog::fileAssotiationAction(const QString /*fileName*/)
|
||||
LocalSharedFilesDialog::fileAssotiationAction(const QString /*fileName*/)
|
||||
{
|
||||
QAction* result = 0;
|
||||
|
||||
|
@ -824,22 +737,17 @@ SharedFilesDialog::fileAssotiationAction(const QString /*fileName*/)
|
|||
//============================================================================
|
||||
|
||||
void
|
||||
SharedFilesDialog::runCommandForFile()
|
||||
LocalSharedFilesDialog::runCommandForFile()
|
||||
{
|
||||
QStringList tsl;
|
||||
tsl.append( currentFile );
|
||||
QProcess::execute( currentCommand, tsl);
|
||||
//QString("%1 %2").arg(currentCommand).arg(currentFile) );
|
||||
|
||||
// QString tmess = "Some command(%1) should be executed here for file %2";
|
||||
// tmess = tmess.arg(currentCommand).arg(currentFile);
|
||||
// QMessageBox::warning(this, tr("RetroShare"), tmess, QMessageBox::Ok);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
||||
void
|
||||
SharedFilesDialog::tryToAddNewAssotiation()
|
||||
LocalSharedFilesDialog::tryToAddNewAssotiation()
|
||||
{
|
||||
AddFileAssociationDialog afad(true, this);//'add file assotiations' dialog
|
||||
|
||||
|
@ -860,68 +768,62 @@ SharedFilesDialog::tryToAddNewAssotiation()
|
|||
/**
|
||||
Toggles the Splitted, Remote and Local View on and off*/
|
||||
|
||||
void SharedFilesDialog::showFrame(bool show)
|
||||
{
|
||||
if (show) {
|
||||
ui.localframe->setVisible(true);
|
||||
ui.remoteframe->setVisible(false);
|
||||
|
||||
ui.localButton->setChecked(true);
|
||||
|
||||
ui.remoteButton->setChecked(false);
|
||||
ui.splittedButton->setChecked(false);
|
||||
|
||||
ui.titleBarLabel->setText( tr("<strong>My Shared Files</strong>"));
|
||||
}
|
||||
}
|
||||
|
||||
void SharedFilesDialog::showFrameRemote(bool show)
|
||||
{
|
||||
if (show) {
|
||||
ui.remoteframe->setVisible(true);
|
||||
ui.localframe->setVisible(false);
|
||||
|
||||
ui.remoteButton->setChecked(true);
|
||||
ui.localButton->setChecked(false);
|
||||
ui.splittedButton->setChecked(false);
|
||||
|
||||
ui.titleBarLabel->setText( tr("<strong>Friends Files</strong>"));
|
||||
}
|
||||
}
|
||||
|
||||
void SharedFilesDialog::showFrameSplitted(bool show)
|
||||
{
|
||||
if (show) {
|
||||
ui.remoteframe->setVisible(true);
|
||||
ui.localframe->setVisible(true);
|
||||
|
||||
ui.splittedButton->setChecked(true);
|
||||
|
||||
ui.localButton->setChecked(false);
|
||||
ui.remoteButton->setChecked(false);
|
||||
|
||||
ui.titleBarLabel->setText( tr("<strong>Files</strong>"));
|
||||
}
|
||||
}
|
||||
//== void SharedFilesDialog::showFrame(bool show)
|
||||
//== {
|
||||
//== if (show) {
|
||||
//== ui.localframe->setVisible(true);
|
||||
//== ui.remoteframe->setVisible(false);
|
||||
//==
|
||||
//== ui.localButton->setChecked(true);
|
||||
//==
|
||||
//== ui.remoteButton->setChecked(false);
|
||||
//== ui.splittedButton->setChecked(false);
|
||||
//==
|
||||
//== ui.titleBarLabel->setText( tr("<strong>My Shared Files</strong>"));
|
||||
//== }
|
||||
//== }
|
||||
//==
|
||||
//== void SharedFilesDialog::showFrameRemote(bool show)
|
||||
//== {
|
||||
//== if (show) {
|
||||
//== ui.remoteframe->setVisible(true);
|
||||
//== ui.localframe->setVisible(false);
|
||||
//==
|
||||
//== ui.remoteButton->setChecked(true);
|
||||
//== ui.localButton->setChecked(false);
|
||||
//== ui.splittedButton->setChecked(false);
|
||||
//==
|
||||
//== ui.titleBarLabel->setText( tr("<strong>Friends Files</strong>"));
|
||||
//== }
|
||||
//== }
|
||||
//==
|
||||
//== void SharedFilesDialog::showFrameSplitted(bool show)
|
||||
//== {
|
||||
//== if (show) {
|
||||
//== ui.remoteframe->setVisible(true);
|
||||
//== ui.localframe->setVisible(true);
|
||||
//==
|
||||
//== ui.splittedButton->setChecked(true);
|
||||
//==
|
||||
//== ui.localButton->setChecked(false);
|
||||
//== ui.remoteButton->setChecked(false);
|
||||
//==
|
||||
//== ui.titleBarLabel->setText( tr("<strong>Files</strong>"));
|
||||
//== }
|
||||
//== }
|
||||
|
||||
void SharedFilesDialog::indicatorChanged(int index)
|
||||
{
|
||||
static uint32_t correct_indicator[4] = { IND_ALWAYS,IND_LAST_DAY,IND_LAST_WEEK,IND_LAST_MONTH } ;
|
||||
|
||||
model->changeAgeIndicator(correct_indicator[index]);
|
||||
localModel->changeAgeIndicator(correct_indicator[index]);
|
||||
|
||||
ui.remoteDirTreeView->update(ui.remoteDirTreeView->rootIndex());
|
||||
ui.localDirTreeView->update(ui.localDirTreeView->rootIndex()) ;
|
||||
ui.dirTreeView->update(ui.dirTreeView->rootIndex());
|
||||
|
||||
if (correct_indicator[index] != IND_ALWAYS)
|
||||
{
|
||||
ui.remoteDirTreeView->sortByColumn(2, Qt::AscendingOrder);
|
||||
}
|
||||
ui.dirTreeView->sortByColumn(2, Qt::AscendingOrder);
|
||||
else
|
||||
{
|
||||
ui.remoteDirTreeView->sortByColumn(0, Qt::AscendingOrder);
|
||||
}
|
||||
ui.dirTreeView->sortByColumn(0, Qt::AscendingOrder);
|
||||
|
||||
updateDisplay() ;
|
||||
}
|
||||
|
@ -968,12 +870,12 @@ void SharedFilesDialog::FilterItems()
|
|||
setCursor(Qt::WaitCursor);
|
||||
QCoreApplication::processEvents() ;
|
||||
|
||||
int rowCount = ui.remoteDirTreeView->model()->rowCount();
|
||||
int rowCount = ui.dirTreeView->model()->rowCount();
|
||||
for (int row = 0; row < rowCount; row++)
|
||||
if(proxyModel == tree_proxyModel)
|
||||
tree_FilterItem(ui.remoteDirTreeView->model()->index(row, 0), text, 0);
|
||||
tree_FilterItem(ui.dirTreeView->model()->index(row, 0), text, 0);
|
||||
else
|
||||
flat_FilterItem(ui.remoteDirTreeView->model()->index(row, 0), text, 0);
|
||||
flat_FilterItem(ui.dirTreeView->model()->index(row, 0), text, 0);
|
||||
|
||||
setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
@ -982,12 +884,12 @@ bool SharedFilesDialog::flat_FilterItem(const QModelIndex &index, const QString
|
|||
{
|
||||
if(index.data(RetroshareDirModel::FileNameRole).toString().contains(text, Qt::CaseInsensitive))
|
||||
{
|
||||
ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), false);
|
||||
ui.dirTreeView->setRowHidden(index.row(), index.parent(), false);
|
||||
return false ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), true);
|
||||
ui.dirTreeView->setRowHidden(index.row(), index.parent(), true);
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
@ -1008,17 +910,17 @@ bool SharedFilesDialog::tree_FilterItem(const QModelIndex &index, const QString
|
|||
}
|
||||
|
||||
int visibleChildCount = 0;
|
||||
int rowCount = ui.remoteDirTreeView->model()->rowCount(index);
|
||||
int rowCount = ui.dirTreeView->model()->rowCount(index);
|
||||
for (int row = 0; row < rowCount; row++) {
|
||||
if (tree_FilterItem(ui.remoteDirTreeView->model()->index(row, index.column(), index), text, level + 1)) {
|
||||
if (tree_FilterItem(ui.dirTreeView->model()->index(row, index.column(), index), text, level + 1)) {
|
||||
visibleChildCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (visible || visibleChildCount) {
|
||||
ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), false);
|
||||
ui.dirTreeView->setRowHidden(index.row(), index.parent(), false);
|
||||
} else {
|
||||
ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), true);
|
||||
ui.dirTreeView->setRowHidden(index.row(), index.parent(), true);
|
||||
}
|
||||
|
||||
return (visible || visibleChildCount);
|
||||
|
|
|
@ -34,55 +34,40 @@ class SharedFilesDialog : public RsAutoUpdatePage
|
|||
|
||||
public:
|
||||
/** Default Constructor */
|
||||
SharedFilesDialog(QWidget *parent = 0);
|
||||
/** Default Destructor */
|
||||
~SharedFilesDialog();
|
||||
SharedFilesDialog(RetroshareDirModel *tree_model,RetroshareDirModel *flat_model,QWidget *parent = 0);
|
||||
|
||||
/** Default Destructor */
|
||||
~SharedFilesDialog() {}
|
||||
|
||||
virtual void updatePage() { checkUpdate() ; }
|
||||
virtual void hideEvent(QHideEvent *) ;
|
||||
virtual void showEvent(QShowEvent *) ;
|
||||
|
||||
protected:
|
||||
QTreeView *directoryView() ;
|
||||
|
||||
private slots:
|
||||
virtual void spawnCustomPopupMenu(QPoint point) = 0;
|
||||
|
||||
/* For handling the model updates */
|
||||
void preModDirectories(bool update_local);
|
||||
void postModDirectories(bool update_local);
|
||||
|
||||
void checkUpdate();
|
||||
void forceCheck();
|
||||
void preModDirectories() ;
|
||||
void postModDirectories() ;
|
||||
|
||||
/** Create the context popup menu and it's submenus */
|
||||
void shareddirtreeviewCostumPopupMenu( QPoint point );
|
||||
// void customPopupMenu(QPoint point) ;
|
||||
|
||||
void sharedDirTreeWidgetContextMenu( QPoint point );
|
||||
|
||||
void downloadRemoteSelected();
|
||||
void createCollectionFile();
|
||||
void addMsgRemoteSelected();
|
||||
|
||||
void copyLinkRemote();
|
||||
void copyLinkLocal();
|
||||
void copyLink();
|
||||
void copyLinkhtml();
|
||||
void sendLinkTo();
|
||||
void sendremoteLinkTo();
|
||||
#ifdef RS_USE_LINKS
|
||||
void sendLinkToCloud();
|
||||
void addLinkToCloud();
|
||||
#endif
|
||||
|
||||
void showFrame(bool show);
|
||||
void showFrameRemote(bool show);
|
||||
void showFrameSplitted(bool show);
|
||||
|
||||
void playselectedfiles();
|
||||
void openfile();
|
||||
void openfolder();
|
||||
void editSharePermissions();
|
||||
//== void showFrame(bool show);
|
||||
//== void showFrameRemote(bool show);
|
||||
//== void showFrameSplitted(bool show);
|
||||
|
||||
void recommendFilesToMsg();
|
||||
void runCommandForFile();
|
||||
void tryToAddNewAssotiation();
|
||||
|
||||
void indicatorChanged(int index);
|
||||
|
||||
|
@ -95,7 +80,12 @@ private slots:
|
|||
signals:
|
||||
void playFiles(QStringList files);
|
||||
|
||||
private:
|
||||
protected:
|
||||
/** Qt Designer generated object */
|
||||
Ui::SharedFilesDialog ui;
|
||||
virtual void processSettings(bool bLoad) = 0;
|
||||
|
||||
protected:
|
||||
//now context menu are created again every time theu are called ( in some
|
||||
//slots.. Maybe it's not good...
|
||||
//** Define the popup menus for the Context menu */
|
||||
|
@ -103,16 +93,13 @@ private:
|
|||
|
||||
//QMenu* contextMnu2;
|
||||
|
||||
void processSettings(bool bLoad);
|
||||
|
||||
void copyLink (const QModelIndexList& lst, bool remote);
|
||||
|
||||
void FilterItems();
|
||||
bool tree_FilterItem(const QModelIndex &index, const QString &text, int level);
|
||||
bool flat_FilterItem(const QModelIndex &index, const QString &text, int level);
|
||||
|
||||
QModelIndexList getRemoteSelected();
|
||||
QModelIndexList getLocalSelected();
|
||||
QModelIndexList getSelected();
|
||||
|
||||
/** Defines the actions for the context menu for QTreeWidget */
|
||||
QAction* openfileAct;
|
||||
|
@ -129,9 +116,6 @@ private:
|
|||
QAction* sendchatlinkAct;
|
||||
QAction* copylinklocalhtmlAct;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::SharedFilesDialog ui;
|
||||
|
||||
/* RetroshareDirModel */
|
||||
RetroshareDirModel *tree_model;
|
||||
RetroshareDirModel *flat_model;
|
||||
|
@ -140,15 +124,54 @@ private:
|
|||
QSortFilterProxyModel *flat_proxyModel;
|
||||
QSortFilterProxyModel *proxyModel;
|
||||
|
||||
RetroshareDirModel *localModel;
|
||||
QSortFilterProxyModel *localProxyModel;
|
||||
|
||||
QString currentCommand;
|
||||
QString currentFile;
|
||||
|
||||
QString lastFilterString;
|
||||
};
|
||||
|
||||
QAction* fileAssotiationAction(const QString fileName);
|
||||
class LocalSharedFilesDialog : public SharedFilesDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LocalSharedFilesDialog(QWidget *parent=NULL) ;
|
||||
virtual ~LocalSharedFilesDialog();
|
||||
|
||||
virtual void spawnCustomPopupMenu(QPoint point);
|
||||
virtual void updatePage() { checkUpdate() ; }
|
||||
|
||||
protected:
|
||||
virtual void processSettings(bool bLoad) ;
|
||||
|
||||
private slots:
|
||||
void createCollectionFile();
|
||||
void checkUpdate() ;
|
||||
void editSharePermissions();
|
||||
void playselectedfiles();
|
||||
void openfile();
|
||||
void openfolder();
|
||||
void runCommandForFile();
|
||||
void tryToAddNewAssotiation();
|
||||
void forceCheck();
|
||||
|
||||
QAction* fileAssotiationAction(const QString fileName);
|
||||
};
|
||||
class RemoteSharedFilesDialog : public SharedFilesDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RemoteSharedFilesDialog(QWidget *parent=NULL) ;
|
||||
virtual ~RemoteSharedFilesDialog() ;
|
||||
|
||||
virtual void spawnCustomPopupMenu(QPoint point);
|
||||
|
||||
protected:
|
||||
virtual void processSettings(bool bLoad) ;
|
||||
|
||||
private slots:
|
||||
void downloadRemoteSelected();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,167 +14,6 @@
|
|||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QFrame" name="remoteframe">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeView" name="remoteDirTreeView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>4</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::DragOnly</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoExpandDelay">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="itemsExpandable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QFrame" name="localframe">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeView" name="localDirTreeView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::DragOnly</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ContiguousSelection</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<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">
|
||||
<normaloff>:/images/download16.png</normaloff>:/images/download16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>391</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="checkButton">
|
||||
<property name="text">
|
||||
<string>check files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="hashLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="titleBarFrame">
|
||||
<property name="sizePolicy">
|
||||
|
@ -297,8 +136,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
</font>
|
||||
<font/>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
|
@ -330,8 +168,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
</font>
|
||||
<font/>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
|
@ -416,89 +253,102 @@ border-image: url(:/images/closepressed.png)
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="splittedButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Split View</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/view_split_top_bottom.png</normaloff>:/images/view_split_top_bottom.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
<widget class="QLabel" name="hashLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="remoteButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Friends Folders</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/friendsfolder24.png</normaloff>:/images/friendsfolder24.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
<widget class="QPushButton" name="checkButton">
|
||||
<property name="text">
|
||||
<string>check files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="localButton">
|
||||
<property name="maximumSize">
|
||||
<widget class="QPushButton" name="downloadButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
<width>140</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>My Folders</string>
|
||||
<string>Download selected</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Download</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/folder16.png</normaloff>:/images/folder16.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
<normaloff>:/images/download16.png</normaloff>:/images/download16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QFrame" name="remoteframe">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeView" name="dirTreeView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>4</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::DragOnly</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoExpandDelay">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="itemsExpandable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "ULListDelegate.h"
|
||||
#include "FileTransferInfoWidget.h"
|
||||
#include "SearchDialog.h"
|
||||
#include "SharedFilesDialog.h"
|
||||
#include "xprogressbar.h"
|
||||
#include "settings/rsharesettings.h"
|
||||
#include "util/misc.h"
|
||||
|
@ -304,6 +305,9 @@ TransfersDialog::TransfersDialog(QWidget *parent)
|
|||
QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ;
|
||||
|
||||
ui.tabWidget->insertTab(0,searchDialog = new SearchDialog(), QIcon(IMAGE_SEARCH), tr("Search")) ;
|
||||
ui.tabWidget->insertTab(1,remoteSharedFiles = new RemoteSharedFilesDialog(), QIcon(IMAGE_SEARCH), tr("Friends files")) ;
|
||||
|
||||
ui.tabWidget->addTab(localSharedFiles = new LocalSharedFilesDialog(), QIcon(IMAGE_SEARCH), tr("Your files")) ;
|
||||
|
||||
//ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ;
|
||||
//ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ;
|
||||
|
|
|
@ -37,6 +37,8 @@ class QStandardItem;
|
|||
class DetailsDialog;
|
||||
class FileProgressInfo;
|
||||
class SearchDialog;
|
||||
class LocalSharedFilesDialog;
|
||||
class RemoteSharedFilesDialog;
|
||||
|
||||
class TransfersDialog : public RsAutoUpdatePage
|
||||
{
|
||||
|
@ -56,6 +58,8 @@ public:
|
|||
static DetailsDialog *detailsdlg;
|
||||
|
||||
SearchDialog *searchDialog ;
|
||||
LocalSharedFilesDialog *localSharedFiles ;
|
||||
RemoteSharedFilesDialog *remoteSharedFiles ;
|
||||
|
||||
public slots:
|
||||
void insertTransfers();
|
||||
|
|
|
@ -325,9 +325,11 @@ int main(int argc, char *argv[])
|
|||
std::cerr << "connecting signals and slots" << std::endl ;
|
||||
QObject::connect(notify,SIGNAL(gotTurtleSearchResult(qulonglong,FileDetail)),w->transfersDialog->searchDialog ,SLOT(updateFiles(qulonglong,FileDetail))) ;
|
||||
QObject::connect(notify,SIGNAL(diskFull(int,int)) ,w ,SLOT(displayDiskSpaceWarning(int,int))) ;
|
||||
QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->sharedfilesDialog ,SLOT(preModDirectories(bool) )) ;
|
||||
QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->sharedfilesDialog ,SLOT(postModDirectories(bool) )) ;
|
||||
QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w ,SLOT(postModDirectories(bool) )) ;
|
||||
QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->transfersDialog->localSharedFiles ,SLOT(preModDirectories(bool) )) ;
|
||||
QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->transfersDialog->remoteSharedFiles ,SLOT(preModDirectories(bool) )) ;
|
||||
QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->transfersDialog->localSharedFiles ,SLOT(postModDirectories(bool) )) ;
|
||||
QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->transfersDialog->remoteSharedFiles ,SLOT(postModDirectories(bool) )) ;
|
||||
QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w ,SLOT(postModDirectories(bool) )) ;
|
||||
QObject::connect(notify,SIGNAL(transfersChanged()) ,w->transfersDialog ,SLOT(insertTransfers() )) ;
|
||||
QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->friendsDialog ,SLOT(publicChatChanged(int) ));
|
||||
QObject::connect(notify,SIGNAL(neighboursChanged()) ,w->friendsDialog->networkDialog ,SLOT(insertConnect() )) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue