Merge branch 'master' into v0.6-BugFixing_20

This commit is contained in:
csoler 2023-03-21 21:06:58 +01:00 committed by GitHub
commit 8f9d99a232
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 186 additions and 52 deletions

View file

@ -280,16 +280,18 @@ void ChannelPostDelegate::setWidgetGrid(bool use_grid)
QWidget *ChannelPostFilesDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*option*/, const QModelIndex& index) const
{
ChannelPostFileInfo file = index.data(Qt::UserRole).value<ChannelPostFileInfo>() ;
ChannelPostFileInfo file = index.data(Qt::UserRole).value<ChannelPostFileInfo>() ;
if(index.column() == RsGxsChannelPostFilesModel::COLUMN_FILES_FILE)
{
GxsChannelFilesStatusWidget* w = new GxsChannelFilesStatusWidget(file,parent);
if(index.column() == RsGxsChannelPostFilesModel::COLUMN_FILES_FILE)
{
GxsChannelFilesStatusWidget* w = new GxsChannelFilesStatusWidget(file,parent,true);
w->setFocusPolicy(Qt::StrongFocus);
connect(w,SIGNAL(onButtonClick()),this->parent(),SLOT(updateDAll_PB()));
return w;
}
else
return NULL;
return w;
}
else
return NULL;
}
void ChannelPostFilesDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
{
@ -416,6 +418,8 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
connect(ui->postsTree->selectionModel(),SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),this,SLOT(showPostDetails()));
connect(ui->postsTree,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(postContextMenu(const QPoint&)));
connect(ui->channel_TW,SIGNAL(currentChanged(int)),this,SLOT(currentTabChanged(int)));
connect(mChannelPostsModel,SIGNAL(channelPostsLoaded()),this,SLOT(postChannelPostLoad()));
ui->postName_LB->hide();
@ -501,6 +505,22 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
}, mEventHandlerId, RsEventType::GXS_CHANNELS );
}
void GxsChannelPostsWidgetWithModel::currentTabChanged(int t)
{
switch(t)
{
case CHANNEL_TABS_DETAILS:
case CHANNEL_TABS_FILES:
ui->showUnread_TB->setHidden(true);
ui->viewType_TB->setHidden(true);
break;
case CHANNEL_TABS_POSTS:
ui->showUnread_TB->setHidden(false);
ui->viewType_TB->setHidden(false);
break;
}
}
void GxsChannelPostsWidgetWithModel::updateZoomFactor(bool zoom_or_unzoom)
{
mChannelPostsDelegate->zoom(zoom_or_unzoom);