mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 23:36:59 -05:00
factored some duplicate code in MessagesDialog.cpp
This commit is contained in:
parent
dc24bb6f03
commit
b4ab766da9
@ -173,12 +173,12 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
||||
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_DATE, fm.width("01/01/1970")*1.5);
|
||||
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_READ, fm.width('0')*1.1);
|
||||
|
||||
QHeaderView_setSectionResizeModeColumn(msgwheader, RsMessageModel::COLUMN_THREAD_STAR, QHeaderView::Fixed);
|
||||
QHeaderView_setSectionResizeModeColumn(msgwheader, RsMessageModel::COLUMN_THREAD_ATTACHMENT, QHeaderView::Fixed);
|
||||
QHeaderView_setSectionResizeModeColumn(msgwheader, RsMessageModel::COLUMN_THREAD_STAR, QHeaderView::Interactive);
|
||||
QHeaderView_setSectionResizeModeColumn(msgwheader, RsMessageModel::COLUMN_THREAD_ATTACHMENT, QHeaderView::Interactive);
|
||||
QHeaderView_setSectionResizeModeColumn(msgwheader, RsMessageModel::COLUMN_THREAD_SUBJECT, QHeaderView::Interactive);
|
||||
QHeaderView_setSectionResizeModeColumn(msgwheader, RsMessageModel::COLUMN_THREAD_AUTHOR, QHeaderView::Interactive);
|
||||
QHeaderView_setSectionResizeModeColumn(msgwheader, RsMessageModel::COLUMN_THREAD_DATE, QHeaderView::Interactive);
|
||||
QHeaderView_setSectionResizeModeColumn(msgwheader, RsMessageModel::COLUMN_THREAD_READ, QHeaderView::Fixed);
|
||||
QHeaderView_setSectionResizeModeColumn(msgwheader, RsMessageModel::COLUMN_THREAD_READ, QHeaderView::Interactive);
|
||||
|
||||
ui.forwardmessageButton->setToolTip(tr("Forward selected Message"));
|
||||
ui.replyallmessageButton->setToolTip(tr("Reply to All"));
|
||||
@ -196,7 +196,6 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
||||
// Set initial size of the splitter
|
||||
ui.listSplitter->setStretchFactor(0, 0);
|
||||
ui.listSplitter->setStretchFactor(1, 1);
|
||||
|
||||
|
||||
/* add filter actions */
|
||||
ui.filterLineEdit->addFilter(QIcon(), tr("Subject"), RsMessageModel::COLUMN_THREAD_SUBJECT, tr("Search Subject"));
|
||||
@ -280,10 +279,7 @@ void MessagesDialog::preModelUpdate()
|
||||
// save current selection
|
||||
|
||||
mTmpSavedSelectedIds.clear();
|
||||
QModelIndexList qmil = ui.messageTreeWidget->selectionModel()->selectedRows();
|
||||
|
||||
foreach(const QModelIndex& m, qmil)
|
||||
mTmpSavedSelectedIds.push_back(m.sibling(m.row(),RsMessageModel::COLUMN_THREAD_MSGID).data(RsMessageModel::MsgIdRole).toString()) ;
|
||||
getSelectedMessages(mTmpSavedSelectedIds);
|
||||
|
||||
std::cerr << "Pre-change: saving selection for " << mTmpSavedSelectedIds.size() << " indexes" << std::endl;
|
||||
}
|
||||
@ -298,7 +294,6 @@ void MessagesDialog::postModelUpdate()
|
||||
foreach(const QString& s,mTmpSavedSelectedIds)
|
||||
{
|
||||
QModelIndex i = mMessageProxyModel->mapFromSource(mMessageModel->getIndexOfMessage(s.toStdString()));
|
||||
|
||||
sel.select(i.sibling(i.row(),0),i.sibling(i.row(),RsMessageModel::COLUMN_THREAD_NB_COLUMNS-1));
|
||||
}
|
||||
|
||||
|
@ -454,7 +454,7 @@
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
@ -745,6 +745,9 @@
|
||||
<property name="expandsOnDoubleClick">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="headerCascadingSectionResizes">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QGridLayout" name="msgLayout"/>
|
||||
@ -850,8 +853,8 @@
|
||||
<tabstop>listWidget</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="icons.qrc"/>
|
||||
<include location="images.qrc"/>
|
||||
<include location="icons.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
Loading…
x
Reference in New Issue
Block a user