diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index 0a6a711bf..202da0cf9 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -1193,7 +1193,7 @@ void ForumsDialog::nextUnreadMessage() ui.threadTreeWidget->setCurrentItem(currentItem); return; } - } while( currentItem = ui.threadTreeWidget->itemBelow(currentItem) ); + } while( (currentItem = ui.threadTreeWidget->itemBelow(currentItem)) != NULL ); } // TODO diff --git a/retroshare-gui/src/gui/ForumsDialog.ui b/retroshare-gui/src/gui/ForumsDialog.ui index c9e2535f4..14dc4ab0c 100644 --- a/retroshare-gui/src/gui/ForumsDialog.ui +++ b/retroshare-gui/src/gui/ForumsDialog.ui @@ -728,11 +728,7 @@ p, li { white-space: pre-wrap; } - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<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:10pt; font-weight:600; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Forum:</p></body></html> + Forum: @@ -849,12 +845,15 @@ background: white; 0 + + + 10 + 75 + true + + - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<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;"> -<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:10pt; font-weight:600;">Thread:</span></p></body></html> + Thread: @@ -998,17 +997,11 @@ background: white;} - - - 80 - 24 - - - - - 80 - 24 - + + + 0 + 0 + Next unread @@ -1222,12 +1215,15 @@ border-image: url(:/images/closepressed.png) + + + 10 + 75 + true + + - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<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:8pt; font-weight:600;">LOADING</span></p></body></html> + Loading diff --git a/retroshare-gui/src/gui/ShareManager.cpp b/retroshare-gui/src/gui/ShareManager.cpp index 67bcaccda..3d971038b 100644 --- a/retroshare-gui/src/gui/ShareManager.cpp +++ b/retroshare-gui/src/gui/ShareManager.cpp @@ -182,7 +182,7 @@ void ShareManager::load() QHBoxLayout* layout = new QHBoxLayout(widget); layout->addWidget(cb, 0, Qt::AlignCenter); layout->setSpacing(0); - layout->setContentsMargins(0, 0, 0, 0); + layout->setContentsMargins(10, 0, 0, 0); // to be centered widget->setLayout(layout); listWidget->setCellWidget(row, col + COLUMN_NETWORKWIDE, widget); diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index 798009b79..6d39a7788 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -54,6 +54,7 @@ #define IMAGE_COPYLINK ":/images/copyrslink.png" #define IMAGE_OPENFOLDER ":/images/folderopen.png" #define IMAGE_OPENFILE ":/images/fileopen.png" +#define IMAGE_COLLECTION ":/images/mimetypes/rscollection-16.png" // Define to avoid using the search in treeview, because it is really slow for now. // @@ -229,7 +230,7 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent) addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Links to Cloud" ), this ); connect( addlinkCloudAct , SIGNAL( triggered() ), this, SLOT( addLinkToCloud( ) ) ); #endif - createcollectionfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Create collection file"), this); + createcollectionfileAct = new QAction(QIcon(IMAGE_COLLECTION), tr("Create collection file"), this); connect(createcollectionfileAct, SIGNAL(triggered()), this, SLOT(createCollectionFile())); openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this); connect(openfileAct, SIGNAL(triggered()), this, SLOT(openfile())); diff --git a/retroshare-gui/src/gui/common/RsCollectionDialog.cpp b/retroshare-gui/src/gui/common/RsCollectionDialog.cpp index a37add0e8..b99d20c18 100644 --- a/retroshare-gui/src/gui/common/RsCollectionDialog.cpp +++ b/retroshare-gui/src/gui/common/RsCollectionDialog.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "RsCollectionDialog.h" #include "RsCollectionFile.h" @@ -32,7 +33,8 @@ RsCollectionDialog::RsCollectionDialog(const QString& CollectionFileName,const s { setupUi(this) ; - setWindowTitle(CollectionFileName) ; + setWindowTitle(QString("%1 - %2").arg(windowTitle()).arg(QFileInfo(_filename).baseName())); + // 1 - add all elements to the list. int row = 0; @@ -43,6 +45,11 @@ RsCollectionDialog::RsCollectionDialog(const QString& CollectionFileName,const s _fileEntriesTW->setHorizontalHeaderItem(2,new QTableWidgetItem(tr("Size"))) ; _fileEntriesTW->setHorizontalHeaderItem(3,new QTableWidgetItem(tr("Hash"))) ; + QHeaderView *header = _fileEntriesTW->horizontalHeader(); + header->setResizeMode(0, QHeaderView::Fixed); + + header->setHighlightSections(false); + _cboxes.clear() ; _cboxes.resize(dlinfos.size(),NULL) ; uint64_t total_size ; @@ -52,14 +59,22 @@ RsCollectionDialog::RsCollectionDialog(const QString& CollectionFileName,const s { _fileEntriesTW->insertRow(row) ; - QCheckBox *cb = new QCheckBox ; + QWidget *widget = new QWidget; + + QCheckBox *cb = new QCheckBox(widget); cb->setChecked(true) ; + QHBoxLayout *layout = new QHBoxLayout(widget); + layout->addWidget(cb, 0, Qt::AlignCenter); + layout->setSpacing(0); + layout->setContentsMargins(10, 0, 0, 0); // to be centered + widget->setLayout(layout); + connect(cb,SIGNAL(toggled(bool)),this,SLOT(updateSizes())) ; _cboxes[i] = cb ; - _fileEntriesTW->setCellWidget(row,0,cb) ; + _fileEntriesTW->setCellWidget(row,0,widget) ; _fileEntriesTW->setItem(row,1,new QTableWidgetItem(dlinfos[i].path + "/" + dlinfos[i].name)) ; _fileEntriesTW->setItem(row,2,new QTableWidgetItem(QString::number(dlinfos[i].size))) ; _fileEntriesTW->setItem(row,3,new QTableWidgetItem(dlinfos[i].hash)) ; @@ -81,9 +96,36 @@ RsCollectionDialog::RsCollectionDialog(const QString& CollectionFileName,const s connect(_deselectAll_PB,SIGNAL(clicked()),this,SLOT(deselectAll())) ; connect(_cancel_PB,SIGNAL(clicked()),this,SLOT(cancel())) ; connect(_download_PB,SIGNAL(clicked()),this,SLOT(download())) ; + + _fileEntriesTW->installEventFilter(this); } -void RsCollectionDialog::updateSizes() +bool RsCollectionDialog::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == _fileEntriesTW) { + if (event->type() == QEvent::KeyPress) { + QKeyEvent *keyEvent = static_cast(event); + if (keyEvent && keyEvent->key() == Qt::Key_Space) { + // Space pressed + QModelIndex currentIndex = _fileEntriesTW->currentIndex(); + QModelIndex index = _fileEntriesTW->model()->index(currentIndex.row(), 0, currentIndex.parent()); + QWidget *widget = dynamic_cast(_fileEntriesTW->indexWidget(index)); + if (widget) { + QCheckBox *cb = dynamic_cast(widget->children().front()); + if (cb) { + cb->toggle(); + } + } + + return true; // eat event + } + } + } + // pass the event on to the parent class + return QDialog::eventFilter(obj, event); +} + +void RsCollectionDialog::updateSizes() { uint64_t total_size = 0 ; uint32_t total_files = 0 ; @@ -102,14 +144,14 @@ void RsCollectionDialog::selectAll() const { std::cerr << "Selecting all !" << std::endl; for(int i=0;i<_dlinfos.size();++i) - dynamic_cast(_fileEntriesTW->cellWidget(i,0))->setChecked(true) ; + _cboxes[i]->setChecked(true) ; } void RsCollectionDialog::deselectAll() const { std::cerr << "Deselecting all !" << std::endl; for(int i=0;i<_dlinfos.size();++i) - dynamic_cast(_fileEntriesTW->cellWidget(i,0))->setChecked(false) ; + _cboxes[i]->setChecked(false) ; } void RsCollectionDialog::cancel() @@ -143,5 +185,3 @@ void RsCollectionDialog::download() close(); } - - diff --git a/retroshare-gui/src/gui/common/RsCollectionDialog.h b/retroshare-gui/src/gui/common/RsCollectionDialog.h index 12304c4da..ab5bd0571 100644 --- a/retroshare-gui/src/gui/common/RsCollectionDialog.h +++ b/retroshare-gui/src/gui/common/RsCollectionDialog.h @@ -26,7 +26,7 @@ class QCheckBox ; -class RsCollectionDialog: public QDialog, public Ui::rsCollectionDialog +class RsCollectionDialog: public QDialog, public Ui::RsCollectionDialog { Q_OBJECT @@ -40,6 +40,9 @@ class RsCollectionDialog: public QDialog, public Ui::rsCollectionDialog void cancel() ; void updateSizes() ; + protected: + bool eventFilter(QObject *obj, QEvent *ev); + private: const std::vector& _dlinfos ; std::vector _cboxes ; diff --git a/retroshare-gui/src/gui/common/RsCollectionDialog.ui b/retroshare-gui/src/gui/common/RsCollectionDialog.ui index 460638abf..239313fee 100644 --- a/retroshare-gui/src/gui/common/RsCollectionDialog.ui +++ b/retroshare-gui/src/gui/common/RsCollectionDialog.ui @@ -1,161 +1,176 @@ - - - rsCollectionDialog - - - - 0 - 0 - 434 - 310 - - - - Dialog - - - - - - - - - - File name : - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Total size : - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Selected files: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - TextLabel - - - - - - - TextLabel - - - - - - - TextLabel - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::DotLine - - - true - - - true - - - false - - - false - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Select all - - - - - - - Deselect all - - - - - - - Cancel - - - - - - - Download! - - - - - - - - - - + + + RsCollectionDialog + + + + 0 + 0 + 434 + 310 + + + + Collection + + + + :/images/mimetypes/rscollection-16.png:/images/mimetypes/rscollection-16.png + + + true + + + + + + + + + + File name : + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Total size : + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Selected files: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SelectRows + + + Qt::DotLine + + + true + + + true + + + false + + + 22 + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Select all + + + + + + + Deselect all + + + + + + + Cancel + + + + + + + Download! + + + + + + + + + + + + diff --git a/retroshare-gui/src/gui/common/RsUrlHandler.cpp b/retroshare-gui/src/gui/common/RsUrlHandler.cpp index 2ed1c6b57..c397982a9 100644 --- a/retroshare-gui/src/gui/common/RsUrlHandler.cpp +++ b/retroshare-gui/src/gui/common/RsUrlHandler.cpp @@ -39,10 +39,7 @@ bool RsUrlHandler::openUrl(const QUrl& url) QMessageBox::warning(NULL,QObject::tr("Treatment of collection file has failed."),QObject::tr("The collection file ") + url.toLocalFile() + QObject::tr(" could not be openned. Reported error is: ") + QString::fromStdString(e.what())) ; return false ; } + return true; } - else - return QDesktopServices::openUrl(url) ; + return QDesktopServices::openUrl(url) ; } - - - diff --git a/retroshare-gui/src/lang/retroshare_de.qm b/retroshare-gui/src/lang/retroshare_de.qm index 538b8d2b6..4bf4e8261 100644 Binary files a/retroshare-gui/src/lang/retroshare_de.qm and b/retroshare-gui/src/lang/retroshare_de.qm differ diff --git a/retroshare-gui/src/lang/retroshare_de.ts b/retroshare-gui/src/lang/retroshare_de.ts index 691949ca1..d76718a25 100644 --- a/retroshare-gui/src/lang/retroshare_de.ts +++ b/retroshare-gui/src/lang/retroshare_de.ts @@ -3942,30 +3942,34 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Arial'; font-weight:600;">Foren</span></p></body></html> - + + Thread: + Thema: + + + Start new Thread for Selected Forum Starte ein neues Thema im ausgewählten Forum - + Display Anzeige - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <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:10pt; font-weight:600; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Forum:</p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <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:10pt; font-weight:600; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Forum:</p></body></html> - + Last Post Letzter Beitrag @@ -3981,42 +3985,46 @@ p, li { white-space: pre-wrap; } - + Date Datum - - + + Title Titel - - + + Forum: + Forum: + + + + Author Autor - + Signed Unterzeichnet - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <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;"> <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:10pt; font-weight:600;">Thread:</span></p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <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;"> <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:10pt; font-weight:600;">Thema:</span></p></body></html> - + Previous Thread Vorheriger Beitrag @@ -4031,7 +4039,7 @@ p, li { white-space: pre-wrap; } Alle Dateien runterladen - + Next unread Nächste ungelesene @@ -4041,21 +4049,17 @@ p, li { white-space: pre-wrap; } Auf Beitrag antworten - + + Loading + Lade + + + Create Forum Forum erstellen - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<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:8pt; font-weight:600;">LOADING</span></p></body></html> - - - - + Print Drucken @@ -4071,7 +4075,7 @@ p, li { white-space: pre-wrap; } Erstelle neues Thema - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -10046,7 +10050,7 @@ Lockdatei: - + Unable to make path @@ -10469,12 +10473,12 @@ p, li { white-space: pre-wrap; } Create selection file - + Erstelle Kollektion Collection files - + Kollektion @@ -10482,17 +10486,57 @@ p, li { white-space: pre-wrap; } File - Datei + Datei Size - Grösse + Grösse Hash - Prüfsumme + Prüfsumme + + + + Collection + Kollektion + + + + File name : + Dateiname: + + + + Total size : + Größe: + + + + Selected files: + Ausgewählt: + + + + Select all + Alle auswählen + + + + Deselect all + Keine auswählen + + + + Cancel + Abbrechen + + + + Download! + Herunterladen @@ -11174,7 +11218,7 @@ Es hilft auch, wenn Sie sich hinter einer Firewall/VPN befinden. Plugins - Plugins + Plugins @@ -11531,7 +11575,7 @@ p, li { white-space: pre-wrap; } SharedFilesDialog - + Download Herunterladen @@ -11682,7 +11726,7 @@ p, li { white-space: pre-wrap; } Create collection file - + Kollektion erstellen @@ -13480,51 +13524,8 @@ p, li { white-space: pre-wrap; } rsCollectionDialog - - Dialog - - - - - File name : - - - - - Total size : - - - - - Selected files: - - - - - - - TextLabel - - - - - Select all - - - - - Deselect all - - - - Cancel - Abbrechen - - - - Download! - + Abbrechen