mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 16:09:37 -05:00
attempt to fix UI bug that automatically deselected after setting msg as read
This commit is contained in:
parent
2faaccbb7a
commit
67e8b87750
@ -398,7 +398,7 @@ void RsGxsChannelPostsModel::clear()
|
||||
initEmptyHierarchy();
|
||||
|
||||
postMods();
|
||||
emit channelLoaded();
|
||||
emit channelPostsLoaded();
|
||||
}
|
||||
|
||||
void RsGxsChannelPostsModel::setPosts(const RsGxsChannelGroup& group, std::vector<RsGxsChannelPost>& posts)
|
||||
@ -431,7 +431,7 @@ void RsGxsChannelPostsModel::setPosts(const RsGxsChannelGroup& group, std::vecto
|
||||
|
||||
postMods();
|
||||
|
||||
emit channelLoaded();
|
||||
emit channelPostsLoaded();
|
||||
}
|
||||
|
||||
void RsGxsChannelPostsModel::update_posts(const RsGxsGroupId& group_id)
|
||||
|
@ -173,7 +173,7 @@ public:
|
||||
void debug_dump();
|
||||
|
||||
signals:
|
||||
void channelLoaded(); // emitted after the posts have been set. Can be used to updated the UI.
|
||||
void channelPostsLoaded(); // emitted after the posts have been loaded.
|
||||
|
||||
private:
|
||||
RsGxsChannelGroup mChannelGroup;
|
||||
|
@ -323,7 +323,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
|
||||
connect(ui->channelFiles_TV->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(sortColumnFiles(int,Qt::SortOrder)));
|
||||
|
||||
connect(ui->postsTree->selectionModel(),SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),this,SLOT(showPostDetails()));
|
||||
connect(mChannelPostsModel,SIGNAL(channelLoaded()),this,SLOT(updateChannelFiles()));
|
||||
connect(mChannelPostsModel,SIGNAL(channelPostsLoaded()),this,SLOT(postChannelLoad()));
|
||||
|
||||
QFontMetricsF fm(font());
|
||||
|
||||
@ -431,12 +431,6 @@ void GxsChannelPostsWidgetWithModel::showPostDetails()
|
||||
{
|
||||
QModelIndex index = ui->postsTree->selectionModel()->currentIndex();
|
||||
|
||||
if(!index.isValid() && !mSelectedPost.isNull() && mGroup.mMeta.mGroupId == mSelectedGroup)
|
||||
{
|
||||
index = mChannelPostsModel->getIndexOfMessage(mSelectedPost);
|
||||
whileBlocking(ui->postsTree)->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
if(!index.isValid())
|
||||
{
|
||||
ui->postDetails_TE->clear();
|
||||
@ -503,20 +497,6 @@ void GxsChannelPostsWidgetWithModel::showPostDetails()
|
||||
}
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidgetWithModel::updateChannelFiles()
|
||||
{
|
||||
std::list<RsGxsFile> files;
|
||||
|
||||
mChannelPostsModel->getFilesList(files);
|
||||
mChannelFilesModel->setFiles(files);
|
||||
|
||||
ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_FILE);
|
||||
ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE);
|
||||
ui->channelFiles_TV->setAutoSelect(true);
|
||||
|
||||
//mChannelPostFilesProxyModel->sort(0, Qt::AscendingOrder);
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidgetWithModel::updateGroupData()
|
||||
{
|
||||
if(groupId().isNull())
|
||||
@ -548,6 +528,29 @@ void GxsChannelPostsWidgetWithModel::updateGroupData()
|
||||
});
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidgetWithModel::postChannelLoad()
|
||||
{
|
||||
std::cerr << "Post channel load..." << std::endl;
|
||||
|
||||
if(!mSelectedPost.isNull() && mGroup.mMeta.mGroupId == mSelectedGroup)
|
||||
{
|
||||
QModelIndex index = mChannelPostsModel->getIndexOfMessage(mSelectedPost);
|
||||
std::cerr << "Setting current index to " << index.row() << ","<< index.column() << " for current post " << mSelectedPost << std::endl;
|
||||
whileBlocking(ui->postsTree)->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
std::list<RsGxsFile> files;
|
||||
|
||||
mChannelPostsModel->getFilesList(files);
|
||||
mChannelFilesModel->setFiles(files);
|
||||
|
||||
ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_FILE);
|
||||
ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE);
|
||||
ui->channelFiles_TV->setAutoSelect(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidgetWithModel::updateDisplay(bool complete)
|
||||
{
|
||||
#ifdef DEBUG_CHANNEL
|
||||
@ -779,7 +782,6 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
|
||||
}
|
||||
|
||||
ui->infoDistribution->setText(distrib_string);
|
||||
|
||||
#ifdef TODO
|
||||
ui->infoWidget->show();
|
||||
ui->feedWidget->hide();
|
||||
@ -788,8 +790,8 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
|
||||
//ui->feedToolButton->setEnabled(false);
|
||||
//ui->fileToolButton->setEnabled(false);
|
||||
#endif
|
||||
|
||||
ui->subscribeToolButton->setText(tr("Subscribe ") + " " + QString::number(group.mMeta.mPop) );
|
||||
|
||||
}
|
||||
|
||||
#ifdef TODO
|
||||
|
@ -138,7 +138,7 @@ private slots:
|
||||
void setViewMode(int viewMode);
|
||||
void settingsChanged();
|
||||
void handlePostsTreeSizeChange(QSize s);
|
||||
void updateChannelFiles();
|
||||
void postChannelLoad();
|
||||
|
||||
public slots:
|
||||
void sortColumnFiles(int col,Qt::SortOrder so);
|
||||
|
Loading…
Reference in New Issue
Block a user