From 239c29ba6dfde1cc1b2502123b166f3ce5d2122e Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 7 Aug 2008 18:49:57 +0000 Subject: [PATCH] added QFrame for can hide Lokal Directories -fixed not streach last section, stretch root. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@669 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/SharedFilesDialog.cpp | 29 +- retroshare-gui/src/gui/SharedFilesDialog.h | 5 +- retroshare-gui/src/gui/SharedFilesDialog.ui | 287 +++++++++++-------- 3 files changed, 201 insertions(+), 120 deletions(-) diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index 4c8f298b7..c919ee180 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -64,8 +64,9 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent) - connect(ui.checkButton, SIGNAL(clicked()), this, SLOT(forceCheck())); + 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 ) ) ); @@ -113,12 +114,19 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent) 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->setResizeMode (3, QHeaderView::Interactive); + + r_header->setStretchLastSection(false); + r_header->setResizeMode(0, QHeaderView::Stretch); r_header->resizeSection ( 0, 210 ); r_header->resizeSection ( 1, 100 ); r_header->resizeSection ( 2, 100 ); r_header->resizeSection ( 3, 100 ); + + l_header->setHighlightSections(false); + r_header->setHighlightSections(false); + /* Set Multi Selection */ ui.remoteDirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection); @@ -439,3 +447,20 @@ void SharedFilesDialog::shareddirtreeWidgetCostumPopupMenu( QPoint point ) } +/** + Toggles the Lokal TreeView on and off, changes toggle button text + */ +void SharedFilesDialog::showFrame(bool show) +{ + if (show) { + ui.frame->setVisible(true); + ui.frameButton->setChecked(true); + ui.frameButton->setToolTip(tr("Hide Lokal Direrectories")); + ui.frameButton->setIcon(QIcon(tr(":images/hide_toolbox_frame.png"))); + } else { + ui.frame->setVisible(false); + ui.frameButton->setChecked(false); + ui.frameButton->setToolTip(tr("Show Lokal Directories")); + ui.frameButton->setIcon(QIcon(tr(":images/show_toolbox_frame.png"))); + } +} diff --git a/retroshare-gui/src/gui/SharedFilesDialog.h b/retroshare-gui/src/gui/SharedFilesDialog.h index 25d51038b..d0cc7334e 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.h +++ b/retroshare-gui/src/gui/SharedFilesDialog.h @@ -56,7 +56,10 @@ private slots: void shareddirtreeWidgetCostumPopupMenu( QPoint point ); void downloadRemoteSelected(); -// void addMsgRemoteSelected(); +// void addMsgRemoteSelected(); + + void showFrame(bool show); + // void recommendfile(); void playselectedfiles(); diff --git a/retroshare-gui/src/gui/SharedFilesDialog.ui b/retroshare-gui/src/gui/SharedFilesDialog.ui index 51ab8260d..2c47f659e 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.ui +++ b/retroshare-gui/src/gui/SharedFilesDialog.ui @@ -5,7 +5,7 @@ 0 0 - 445 + 548 401 @@ -498,143 +498,196 @@ Qt::NoContextMenu - + - 1 + 0 - - - - 0 - + + - - - - - 0 - - - 6 - - - - - - - - :/images/fileshare16.png - - - - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt; font-weight:600;">Files</span></p></body></html> - - - - - - - - - Qt::Horizontal - - - - 271 - 20 - - - - - - + + + 0 + + + 6 + + + - check files + + + + :/images/fileshare16.png - - + + - + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt; font-weight:600;">Files</span></p></body></html> - - - - 0 - 0 - - + Qt::Horizontal - - - - 0 - 0 - - - - Qt::CustomContextMenu - - - false - - - true - - - QAbstractItemView::DragOnly - - - false - - - QAbstractItemView::ContiguousSelection - - - true - - - - - - 4 - 0 - - - - Qt::CustomContextMenu - - - true - - - QAbstractItemView::DragOnly - - - false - - - true - - + + + 271 + 20 + + + + + + + + check files + + + + + + + + + + + + + + + 14 + 31 + + + + + 14 + 31 + + + + + + + + 16 + 31 + + + + true + + + + + + + Qt::Vertical + + + + 14 + 321 + + + + + + + + + + Qt::Horizontal + + + 5 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Qt::CustomContextMenu + + + false + + + true + + + QAbstractItemView::DragOnly + + + false + + + QAbstractItemView::ContiguousSelection + + + true + + + + + + + + + 4 + 0 + + + + Qt::CustomContextMenu + + + true + + + QAbstractItemView::DragOnly + + + false + + + true + + + +