* Set Size column item to 60

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@821 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2008-11-18 17:14:49 +00:00
parent 5ecf99e8aa
commit faad47a636

View File

@ -17,11 +17,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#include "rshare.h"
#include "SharedFilesDialog.h"
****************************************************************/
#include "rshare.h"
#include "SharedFilesDialog.h"
#include "rsiface/rsiface.h"
#include "rsiface/rspeers.h"
@ -46,7 +46,7 @@
/* Images for context menu icons */
#define IMAGE_DOWNLOAD ":/images/download16.png"
#define IMAGE_PLAY ":/images/start.png"
#define IMAGE_PLAY ":/images/start.png"
#define IMAGE_HASH_BUSY ":/images/settings.png"
#define IMAGE_HASH_DONE ":/images/friendsfolder24.png"
#define IMAGE_MSG ":/images/message-mail.png"
@ -54,23 +54,23 @@
#define IMAGE_FRIEND ":/images/peers_16x16.png"
#define IMAGE_PROGRESS ":/images/browse-looking.gif"
/** Constructor */
SharedFilesDialog::SharedFilesDialog(QWidget *parent)
: MainPage(parent)
{
/* Invoke the Qt Designer generated object setup routine */
/** Constructor */
SharedFilesDialog::SharedFilesDialog(QWidget *parent)
: MainPage(parent)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
connect(ui.checkButton, SIGNAL(clicked()), this, SLOT(forceCheck()));
connect(ui.frameButton, SIGNAL(toggled(bool)), this, SLOT(showFrame(bool)));
connect( ui.localDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( shareddirtreeWidgetCostumPopupMenu( QPoint ) ) );
connect( ui.remoteDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( shareddirtreeviewCostumPopupMenu( QPoint ) ) );
connect( ui.localDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( shareddirtreeWidgetCostumPopupMenu( QPoint ) ) );
connect( ui.remoteDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( shareddirtreeviewCostumPopupMenu( QPoint ) ) );
/*
connect( ui.remoteDirTreeView, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
@ -98,29 +98,29 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
/* Set header resize modes and initial section sizes */
QHeaderView * l_header = ui.localDirTreeView->header () ;
l_header->setResizeMode (0, QHeaderView::Interactive);
l_header->setResizeMode (1, QHeaderView::Interactive);
QHeaderView * l_header = ui.localDirTreeView->header () ;
l_header->setResizeMode (0, QHeaderView::Interactive);
l_header->setResizeMode (1, QHeaderView::Interactive);
l_header->setResizeMode (2, QHeaderView::Interactive);
l_header->setResizeMode (3, QHeaderView::Interactive);
l_header->setResizeMode (3, QHeaderView::Interactive);
l_header->resizeSection ( 0, 210 );
l_header->resizeSection ( 1, 100 );
l_header->resizeSection ( 1, 70 );
l_header->resizeSection ( 2, 100 );
l_header->resizeSection ( 3, 100 );
/* Set header resize modes and initial section sizes */
QHeaderView * r_header = ui.remoteDirTreeView->header () ;
r_header->setResizeMode (0, QHeaderView::Interactive);
r_header->setResizeMode (1, QHeaderView::Interactive);
QHeaderView * r_header = ui.remoteDirTreeView->header () ;
r_header->setResizeMode (0, QHeaderView::Interactive);
r_header->setResizeMode (1, QHeaderView::Interactive);
r_header->setResizeMode (2, QHeaderView::Interactive);
r_header->setResizeMode (3, QHeaderView::Interactive);
r_header->setStretchLastSection(false);
r_header->setResizeMode(0, QHeaderView::Stretch);
r_header->setResizeMode(0, QHeaderView::Stretch);
r_header->resizeSection ( 0, 210 );
r_header->resizeSection ( 1, 100 );
r_header->resizeSection ( 1, 70 );
r_header->resizeSection ( 2, 100 );
r_header->resizeSection ( 3, 100 );
@ -136,11 +136,11 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
timer->start(1000);
/* Hide platform specific features */
#ifdef Q_WS_WIN
#endif
}
/* Hide platform specific features */
#ifdef Q_WS_WIN
#endif
}
void SharedFilesDialog::checkUpdate()
{
@ -149,7 +149,7 @@ void SharedFilesDialog::checkUpdate()
{
ui.hashLabel->setPixmap(QPixmap(IMAGE_HASH_BUSY));
/*QMovie *movie = new QMovie(IMAGE_PROGRESS);
ui.hashLabel->setMovie(movie);
ui.hashLabel->setMovie(movie);
movie->start();*/
}
else
@ -168,28 +168,28 @@ void SharedFilesDialog::forceCheck()
}
void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
downloadAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Download" ), this );
void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
downloadAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Download" ), this );
connect( downloadAct , SIGNAL( triggered() ), this, SLOT( downloadRemoteSelected() ) );
// addMsgAct = new QAction( tr( "Add to Message" ), this );
// addMsgAct = new QAction( tr( "Add to Message" ), this );
// connect( addMsgAct , SIGNAL( triggered() ), this, SLOT( addMsgRemoteSelected() ) );
contextMnu.clear();
contextMnu.clear();
contextMnu.addAction( downloadAct);
// contextMnu.addAction( addMsgAct);
contextMnu.exec( mevent->globalPos() );
}
contextMnu.exec( mevent->globalPos() );
}
void SharedFilesDialog::downloadRemoteSelected()
{
void SharedFilesDialog::downloadRemoteSelected()
{
/* call back to the model (which does all the interfacing? */
std::cerr << "Downloading Files";
@ -201,9 +201,9 @@ void SharedFilesDialog::downloadRemoteSelected()
}
void SharedFilesDialog::playselectedfiles()
{
void SharedFilesDialog::playselectedfiles()
{
/* call back to the model (which does all the interfacing? */
std::cerr << "SharedFilesDialog::playselectedfiles()";
@ -235,8 +235,8 @@ void SharedFilesDialog::playselectedfiles()
#if 0
void SharedFilesDialog::addMsgRemoteSelected()
{
void SharedFilesDialog::addMsgRemoteSelected()
{
/* call back to the model (which does all the interfacing? */
std::cerr << "Recommending Files";
@ -249,8 +249,8 @@ void SharedFilesDialog::addMsgRemoteSelected()
}
void SharedFilesDialog::recommendfile()
{
void SharedFilesDialog::recommendfile()
{
/* call back to the model (which does all the interfacing? */
std::cerr << "Recommending Files";
@ -262,9 +262,9 @@ void SharedFilesDialog::recommendfile()
void SharedFilesDialog::recommendFileSetOnly()
{
void SharedFilesDialog::recommendFileSetOnly()
{
/* call back to the model (which does all the interfacing? */
std::cerr << "Recommending File Set (clearing old selection)";
@ -276,9 +276,9 @@ void SharedFilesDialog::recommendFileSetOnly()
localModel -> recommendSelectedOnly(qism->selectedIndexes());
}
void SharedFilesDialog::recommendFilesTo( std::string rsid )
{
void SharedFilesDialog::recommendFilesTo( std::string rsid )
{
recommendFileSetOnly();
rsicontrol -> ClearInMsg();
rsicontrol -> SetInMsg(rsid, true);
@ -326,8 +326,8 @@ void SharedFilesDialog::recommendFilesToMsg( std::string rsid )
#endif
void SharedFilesDialog::openfile()
{
void SharedFilesDialog::openfile()
{
/* call back to the model (which does all the interfacing? */
std::cerr << "Opening File";
@ -339,10 +339,10 @@ void SharedFilesDialog::openfile()
}
void SharedFilesDialog::openfolder()
{
void SharedFilesDialog::openfolder()
{
}
}
void SharedFilesDialog::preModDirectories(bool update_local)
@ -371,17 +371,17 @@ void SharedFilesDialog::ModDirectories(bool update_local)
}
void SharedFilesDialog::shareddirtreeWidgetCostumPopupMenu( QPoint point )
{
QMenu contextMnu2( this );
QMouseEvent *mevent2 = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
openfolderAct = new QAction(QIcon(IMAGE_PLAY), tr( "Play File(s)" ), this );
void SharedFilesDialog::shareddirtreeWidgetCostumPopupMenu( QPoint point )
{
QMenu contextMnu2( this );
QMouseEvent *mevent2 = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
openfolderAct = new QAction(QIcon(IMAGE_PLAY), tr( "Play File(s)" ), this );
connect( openfolderAct , SIGNAL( triggered() ), this, SLOT( playselectedfiles() ) );
#if 0
openfileAct = new QAction(QIcon(IMAGE_ATTACHMENT), tr( "Add to Recommend List" ), this );
openfileAct = new QAction(QIcon(IMAGE_ATTACHMENT), tr( "Add to Recommend List" ), this );
connect( openfileAct , SIGNAL( triggered() ), this, SLOT( recommendfile() ) );
/* now we're going to ask who to recommend it to...