mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 23:45:49 -04:00
Merge pull request #2747 from csoler/v0.6-BugFixing_30
2 important fixes
This commit is contained in:
commit
bb533eefc8
5 changed files with 40 additions and 21 deletions
|
@ -1105,6 +1105,11 @@ void GxsGroupFrameDialog::updateGroupSummary()
|
||||||
* Qt::QueuedConnection is important!
|
* Qt::QueuedConnection is important!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Here we save the focus, and restore it afterwards: there's no need to grab the focus here and
|
||||||
|
// if we do, it may harm the navitation in forums, channels, boards, etc.
|
||||||
|
|
||||||
|
auto w = QApplication::focusWidget();
|
||||||
|
|
||||||
insertGroupsData(*groupInfo);
|
insertGroupsData(*groupInfo);
|
||||||
updateSearchResults();
|
updateSearchResults();
|
||||||
|
|
||||||
|
@ -1132,6 +1137,11 @@ void GxsGroupFrameDialog::updateGroupSummary()
|
||||||
|
|
||||||
delete groupInfo;
|
delete groupInfo;
|
||||||
|
|
||||||
|
// Restore the focus.
|
||||||
|
|
||||||
|
if(w)
|
||||||
|
w->setFocus();
|
||||||
|
|
||||||
}, this );
|
}, this );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,7 +411,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
|
||||||
connect(ui->channelPostFiles_TV->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(sortColumnPostFiles(int,Qt::SortOrder)));
|
connect(ui->channelPostFiles_TV->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(sortColumnPostFiles(int,Qt::SortOrder)));
|
||||||
connect(ui->channelFiles_TV->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(sortColumnFiles(int,Qt::SortOrder)));
|
connect(ui->channelFiles_TV->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(sortColumnFiles(int,Qt::SortOrder)));
|
||||||
|
|
||||||
connect(ui->channelPostFiles_TV,SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showChannelFilesContextMenu(QPoint)));
|
connect(ui->channelPostFiles_TV,SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showChannelPostFilesContextMenu(QPoint)));
|
||||||
connect(ui->channelFiles_TV,SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showChannelFilesContextMenu(QPoint)));
|
connect(ui->channelFiles_TV,SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showChannelFilesContextMenu(QPoint)));
|
||||||
|
|
||||||
connect(ui->postsTree->selectionModel(),SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),this,SLOT(showPostDetails()));
|
connect(ui->postsTree->selectionModel(),SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),this,SLOT(showPostDetails()));
|
||||||
|
@ -1344,13 +1344,26 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
|
||||||
|
|
||||||
showPostDetails();
|
showPostDetails();
|
||||||
}
|
}
|
||||||
|
void GxsChannelPostsWidgetWithModel::showChannelFilesContextMenu(QPoint p)
|
||||||
void GxsChannelPostsWidgetWithModel::showChannelFilesContextMenu(QPoint /*p*/)
|
|
||||||
{
|
{
|
||||||
QMenu contextMnu(this) ;
|
QModelIndex index = ui->channelFiles_TV->indexAt(p);
|
||||||
|
|
||||||
QAction *action = contextMnu.addAction(QIcon(), tr("Copy Retroshare link"), this, SLOT(copyChannelFilesLink()));
|
if(!index.isValid())
|
||||||
action->setData(QVariant::fromValue(sender()));
|
return;
|
||||||
|
|
||||||
|
QMenu contextMnu(this) ;
|
||||||
|
contextMnu.addAction(QIcon(), tr("Copy Retroshare link"), this, SLOT(copyChannelFilesLink()))->setData(QVariant::fromValue(index));
|
||||||
|
contextMnu.exec(QCursor::pos());
|
||||||
|
}
|
||||||
|
void GxsChannelPostsWidgetWithModel::showChannelPostFilesContextMenu(QPoint p)
|
||||||
|
{
|
||||||
|
QModelIndex index = ui->channelPostFiles_TV->indexAt(p);
|
||||||
|
|
||||||
|
if(!index.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
QMenu contextMnu(this) ;
|
||||||
|
contextMnu.addAction(QIcon(), tr("Copy Retroshare link"), this, SLOT(copyChannelFilesLink()))->setData(QVariant::fromValue(index));
|
||||||
contextMnu.exec(QCursor::pos());
|
contextMnu.exec(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1358,16 +1371,11 @@ void GxsChannelPostsWidgetWithModel::copyChannelFilesLink()
|
||||||
{
|
{
|
||||||
// Block the popup if no results available
|
// Block the popup if no results available
|
||||||
QAction *action = dynamic_cast<QAction*>(sender());
|
QAction *action = dynamic_cast<QAction*>(sender());
|
||||||
RSTreeView *tree = dynamic_cast<RSTreeView*>(action->data().value<QWidget*>());
|
|
||||||
|
|
||||||
QModelIndexList sel = tree->selectionModel()->selection().indexes();
|
|
||||||
|
|
||||||
if(sel.empty())
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
QModelIndex s = action->data().toModelIndex();
|
||||||
ChannelPostFileInfo file;
|
ChannelPostFileInfo file;
|
||||||
|
|
||||||
if(!static_cast<RsGxsChannelPostFilesModel*>(tree->model())->getFileData(sel.front(),file))
|
if(!static_cast<const RsGxsChannelPostFilesModel*>(s.model())->getFileData(s,file))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RetroShareLink link = RetroShareLink::createFile(QString::fromUtf8(file.mName.c_str()), file.mSize, QString::fromStdString(file.mHash.toStdString()));
|
RetroShareLink link = RetroShareLink::createFile(QString::fromUtf8(file.mName.c_str()), file.mSize, QString::fromStdString(file.mHash.toStdString()));
|
||||||
|
|
|
@ -166,6 +166,7 @@ public slots:
|
||||||
void sortColumnPostFiles(int col,Qt::SortOrder so);
|
void sortColumnPostFiles(int col,Qt::SortOrder so);
|
||||||
void updateCommentsCount(int n);
|
void updateCommentsCount(int n);
|
||||||
void showChannelFilesContextMenu(QPoint p);
|
void showChannelFilesContextMenu(QPoint p);
|
||||||
|
void showChannelPostFilesContextMenu(QPoint p);
|
||||||
void copyChannelFilesLink();
|
void copyChannelFilesLink();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -217,9 +217,9 @@ void TransferPage::updateDefaultStrategy(int i)
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
#ifdef WINDOWS_SYS
|
#ifdef WINDOWS_SYS
|
||||||
if(QMessageBox::Yes != QMessageBox::warning(nullptr,tr("Warning"),tr("On Windows systems, randomly writing in the middle of large empty files may hang the software for several seconds. Do you want to use this option anyway?"),QMessageBox::Yes,QMessageBox::No))
|
if(QMessageBox::Yes != QMessageBox::warning(nullptr,tr("Warning"),tr("On Windows systems, randomly writing in the middle of large empty files may hang the software for several seconds. Do you want to use this option anyway (otherwise use \"progressive\")?"),QMessageBox::Yes,QMessageBox::No))
|
||||||
{
|
{
|
||||||
ui._defaultStrategy_CB->setCurrentIndex(0);
|
ui._defaultStrategy_CB->setCurrentIndex(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
@ -443,7 +443,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p><span style=" font-weight:600;">Streaming </span>causes the transfer to request 1MB file chunks in increasing order, facilitating preview while downloading. <span style=" font-weight:600;">Random</span> is purely random and favors swarming behavior. <span style=" font-weight:600;">Progressive</span> is a compromise, selecting the next chunk at random within less than 50MB after the end of the partial file. That allows some randomness while preventing large empty file initialization times.</p></body></html></string>
|
<string><html><head/><body><p><span style=" font-weight:600;">Streaming </span>causes the transfer to request 1MB file chunks in increasing order, facilitating preview while downloading. <span style=" font-weight:600;">Random</span> is purely random and favors swarming behavior (although not recommended on Windows systems). <span style=" font-weight:600;">Progressive</span> is a good compromise, selecting the next chunk at random within less than 50MB after the end of the partial file. That allows some randomness while preventing large empty file initialization times.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue