fixed coumn visibility depending on box

This commit is contained in:
csoler 2022-12-04 18:46:19 +01:00
parent a7570b70eb
commit 7b78b87c65
3 changed files with 12 additions and 7 deletions

View File

@ -88,7 +88,7 @@ int RsMessageModel::rowCount(const QModelIndex& parent) const
int RsMessageModel::columnCount(const QModelIndex &/*parent*/) const
{
return COLUMN_THREAD_NB_COLUMNS ;
return COLUMN_THREAD_NB_COLUMNS;
}
bool RsMessageModel::getMessageData(const QModelIndex& i,Rs::Msgs::MessageInfo& fmpe) const

View File

@ -54,9 +54,9 @@ public:
COLUMN_THREAD_DATE = 0x07,
COLUMN_THREAD_TAGS = 0x08,
COLUMN_THREAD_MSGID = 0x09,
COLUMN_THREAD_NB_COLUMNS = 0x0a,
COLUMN_THREAD_CONTENT = 0x0b
};
COLUMN_THREAD_CONTENT = 0x0a,
COLUMN_THREAD_NB_COLUMNS = 0x0b
};
enum QuickViewFilter {
QUICK_VIEW_ALL = 0x00,

View File

@ -254,9 +254,6 @@ MessagesDialog::MessagesDialog(QWidget *parent)
sortColumn(RsMessageModel::COLUMN_THREAD_DATE,Qt::DescendingOrder);
// load settings
processSettings(true);
//ui.messageTreeWidget->installEventFilter(this);
// remove close button of the the first tab
@ -299,6 +296,11 @@ MessagesDialog::MessagesDialog(QWidget *parent)
connect(ui.messageTreeWidget->selectionModel(), SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&)), this, SLOT(currentChanged(const QModelIndex&,const QModelIndex&)));
// load settings
processSettings(true);
ui.listWidget->setCurrentRow(0); // always starts with inbox => allows to setup the proper number of columns
mEventHandlerId=0;
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event) { RsQThreadUtils::postToObject( [this,event]() { handleEvent_main_thread(event); }); }, mEventHandlerId, RsEventType::MAIL_STATUS );
@ -917,11 +919,14 @@ void MessagesDialog::changeBox(int box_row)
}
insertMsgTxtAndFiles(ui.messageTreeWidget->currentIndex());
ui.messageTreeWidget->setPlaceholderText(placeholderText);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_READ,box_row!=ROW_INBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_STAR,box_row==ROW_OUTBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_SPAM,box_row==ROW_OUTBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_TAGS,box_row==ROW_OUTBOX);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_MSGID,true);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_CONTENT,true);
}
else
{