mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 21:34:10 -05:00
Merge pull request #1468 from csoler/v0.6-ImprovedGUI
V0.6 improved gui
This commit is contained in:
commit
60c9e3a324
@ -315,6 +315,7 @@ struct RsIdentityDetails : RsSerializable
|
|||||||
|
|
||||||
RsGxsImage mAvatar;
|
RsGxsImage mAvatar;
|
||||||
|
|
||||||
|
rstime_t mPublishTS;
|
||||||
rstime_t mLastUsageTS;
|
rstime_t mLastUsageTS;
|
||||||
|
|
||||||
std::map<RsIdentityUsage,rstime_t> mUseCases;
|
std::map<RsIdentityUsage,rstime_t> mUseCases;
|
||||||
@ -329,6 +330,7 @@ struct RsIdentityDetails : RsSerializable
|
|||||||
RS_SERIAL_PROCESS(mPgpId);
|
RS_SERIAL_PROCESS(mPgpId);
|
||||||
//RS_SERIAL_PROCESS(mReputation);
|
//RS_SERIAL_PROCESS(mReputation);
|
||||||
//RS_SERIAL_PROCESS(mAvatar);
|
//RS_SERIAL_PROCESS(mAvatar);
|
||||||
|
RS_SERIAL_PROCESS(mPublishTS);
|
||||||
RS_SERIAL_PROCESS(mLastUsageTS);
|
RS_SERIAL_PROCESS(mLastUsageTS);
|
||||||
RS_SERIAL_PROCESS(mUseCases);
|
RS_SERIAL_PROCESS(mUseCases);
|
||||||
}
|
}
|
||||||
|
@ -703,6 +703,7 @@ bool p3IdService::getIdDetails(const RsGxsId &id, RsIdentityDetails &details)
|
|||||||
details.mLastUsageTS = it->second.TS ;
|
details.mLastUsageTS = it->second.TS ;
|
||||||
details.mUseCases = it->second.usage_map ;
|
details.mUseCases = it->second.usage_map ;
|
||||||
}
|
}
|
||||||
|
details.mPublishTS = data.mPublishTs;
|
||||||
|
|
||||||
// one utf8 symbol can be at most 4 bytes long - would be better to measure real unicode length !!!
|
// one utf8 symbol can be at most 4 bytes long - would be better to measure real unicode length !!!
|
||||||
if(details.mNickname.length() > RSID_MAXIMUM_NICKNAME_SIZE*4)
|
if(details.mNickname.length() > RSID_MAXIMUM_NICKNAME_SIZE*4)
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QDateTime>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QWidgetAction>
|
#include <QWidgetAction>
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
@ -175,6 +176,7 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
mStateHelper->addClear(IDDIALOG_IDLIST, ui->idTreeWidget);
|
mStateHelper->addClear(IDDIALOG_IDLIST, ui->idTreeWidget);
|
||||||
|
|
||||||
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
||||||
|
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_PublishTS);
|
||||||
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
||||||
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Type);
|
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Type);
|
||||||
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_GpgId);
|
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_GpgId);
|
||||||
@ -190,6 +192,7 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->label_negative);
|
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->label_negative);
|
||||||
|
|
||||||
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
||||||
|
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_PublishTS);
|
||||||
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
||||||
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_Type);
|
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_Type);
|
||||||
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_GpgId);
|
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_GpgId);
|
||||||
@ -200,6 +203,7 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->usageStatistics_TB);
|
mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->usageStatistics_TB);
|
||||||
|
|
||||||
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
||||||
|
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_PublishTS);
|
||||||
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
||||||
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_Type);
|
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_Type);
|
||||||
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_GpgId);
|
mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_GpgId);
|
||||||
@ -1768,6 +1772,7 @@ void IdDialog::insertIdDetails(uint32_t token)
|
|||||||
/* get GPG Details from rsPeers */
|
/* get GPG Details from rsPeers */
|
||||||
RsPgpId ownPgpId = rsPeers->getGPGOwnId();
|
RsPgpId ownPgpId = rsPeers->getGPGOwnId();
|
||||||
|
|
||||||
|
ui->lineEdit_PublishTS->setText(QDateTime::fromSecsSinceEpoch(data.mMeta.mPublishTs).toString(Qt::SystemLocaleShortDate));
|
||||||
ui->lineEdit_Nickname->setText(QString::fromUtf8(data.mMeta.mGroupName.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE));
|
ui->lineEdit_Nickname->setText(QString::fromUtf8(data.mMeta.mGroupName.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE));
|
||||||
ui->lineEdit_KeyId->setText(QString::fromStdString(data.mMeta.mGroupId.toStdString()));
|
ui->lineEdit_KeyId->setText(QString::fromStdString(data.mMeta.mGroupId.toStdString()));
|
||||||
//ui->lineEdit_GpgHash->setText(QString::fromStdString(data.mPgpIdHash.toStdString()));
|
//ui->lineEdit_GpgHash->setText(QString::fromStdString(data.mPgpIdHash.toStdString()));
|
||||||
|
@ -526,39 +526,25 @@ border-image: url(:/images/closepressed.png)
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Identity info</string>
|
<string>Identity info</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="detailsGroupBoxGLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="10" column="1">
|
<item row="1" column="2" colspan="2">
|
||||||
<widget class="QLineEdit" name="neighborNodesOpinion_TF">
|
<widget class="QLineEdit" name="lineEdit_KeyId">
|
||||||
<property name="toolTip">
|
<property name="enabled">
|
||||||
<string><html><head/><body><p>Average opinion of neighbor nodes about this identity. Negative is bad,</p><p>positive is good. Zero is neutral.</p></body></html></string>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0">
|
<item row="9" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label_YourOpinion">
|
<widget class="QLabel" name="label_YourOpinion">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Your opinion:</string>
|
<string>Your opinion:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="12" column="2" colspan="2">
|
||||||
<widget class="QLabel" name="banoption_label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Ban-option:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0" colspan="2">
|
|
||||||
<widget class="Line" name="line_IdInfo">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="11" column="1">
|
|
||||||
<widget class="QLineEdit" name="overallOpinion_TF">
|
<widget class="QLineEdit" name="overallOpinion_TF">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p>Overall reputation score, accounting for yours and your friends'.</p><p>Negative is bad, positive is good. Zero is neutral. If the score is too low,</p><p>the identity is flagged as bad, and will be filtered out in forums, chat lobbies,</p><p>channels, etc.</p></body></html></string>
|
<string><html><head/><body><p>Overall reputation score, accounting for yours and your friends'.</p><p>Negative is bad, positive is good. Zero is neutral. If the score is too low,</p><p>the identity is flagged as bad, and will be filtered out in forums, chat lobbies,</p><p>channels, etc.</p></body></html></string>
|
||||||
@ -568,7 +554,41 @@ border-image: url(:/images/closepressed.png)
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="1">
|
<item row="7" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_LastUsed">
|
||||||
|
<property name="text">
|
||||||
|
<string>Last used:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2" colspan="2">
|
||||||
|
<widget class="QLineEdit" name="lineEdit_Type"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_Nickname">
|
||||||
|
<property name="text">
|
||||||
|
<string>Identity name :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0" colspan="4">
|
||||||
|
<widget class="Line" name="line_IdInfo">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="2" rowspan="2" colspan="2">
|
||||||
|
<widget class="QLineEdit" name="lineEdit_GpgName">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="2" colspan="2">
|
||||||
<widget class="QComboBox" name="ownOpinion_CB">
|
<widget class="QComboBox" name="ownOpinion_CB">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
@ -625,71 +645,31 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="1">
|
<item row="7" column="2" colspan="2">
|
||||||
<widget class="QCheckBox" name="autoBanIdentities_CB">
|
<widget class="QLineEdit" name="lineEdit_LastUsed"/>
|
||||||
<property name="text">
|
|
||||||
<string>Auto-Ban all identities signed by the same node</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="neighborNodesOpinion_LB">
|
|
||||||
<property name="text">
|
|
||||||
<string>Friend votes:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="11" column="0">
|
|
||||||
<widget class="QLabel" name="overallOpinion_LB">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Overall:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="lineEdit_KeyId">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="label_Type">
|
<widget class="QLabel" name="label_Type">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Type:</string>
|
<string>Type:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="4" column="0" rowspan="2" colspan="2">
|
||||||
<widget class="QLineEdit" name="lineEdit_Nickname">
|
<widget class="QLabel" name="label_GpgName">
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QLineEdit" name="lineEdit_Type"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_Nickname">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Identity name :</string>
|
<string>Owner node name :</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_GpgId">
|
||||||
|
<property name="text">
|
||||||
|
<string>Owner node ID :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2" colspan="2">
|
||||||
<widget class="QLineEdit" name="lineEdit_GpgId">
|
<widget class="QLineEdit" name="lineEdit_GpgId">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -699,29 +679,39 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="10" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label_LastUsed">
|
<widget class="QLabel" name="banoption_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Last used:</string>
|
<string>Ban-option:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="11" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label_GpgName">
|
<widget class="QLabel" name="neighborNodesOpinion_LB">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Owner node name :</string>
|
<string>Friend votes:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="11" column="2" colspan="2">
|
||||||
<widget class="QLabel" name="label_GpgId">
|
<widget class="QLineEdit" name="neighborNodesOpinion_TF">
|
||||||
<property name="text">
|
<property name="toolTip">
|
||||||
<string>Owner node ID :</string>
|
<string><html><head/><body><p>Average opinion of neighbor nodes about this identity. Negative is bad,</p><p>positive is good. Zero is neutral.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="10" column="2" colspan="2">
|
||||||
<widget class="QLineEdit" name="lineEdit_GpgName">
|
<widget class="QCheckBox" name="autoBanIdentities_CB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Auto-Ban all identities signed by the same node</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2" colspan="2">
|
||||||
|
<widget class="QLineEdit" name="lineEdit_Nickname">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -730,17 +720,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="0" column="4" rowspan="9">
|
||||||
<widget class="QLabel" name="label_KeyId">
|
|
||||||
<property name="text">
|
|
||||||
<string>Identity ID :</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QLineEdit" name="lineEdit_LastUsed"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2" rowspan="11">
|
|
||||||
<layout class="QGridLayout" name="avatarGLayout">
|
<layout class="QGridLayout" name="avatarGLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="avatarLabel">
|
<widget class="QLabel" name="avatarLabel">
|
||||||
@ -883,6 +863,36 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="12" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="overallOpinion_LB">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Overall:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_KeyId">
|
||||||
|
<property name="text">
|
||||||
|
<string>Identity ID :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="label_PublishTS">
|
||||||
|
<property name="text">
|
||||||
|
<string>Created on :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="2">
|
||||||
|
<widget class="QLineEdit" name="lineEdit_PublishTS"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -1500,6 +1500,8 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId)
|
|||||||
|
|
||||||
if(!source_index.isValid())
|
if(!source_index.isValid())
|
||||||
{
|
{
|
||||||
|
std::cerr << "Cannot navigate to msg " << msgId << " in forum " << mForumGroup.mMeta.mGroupId << ": index unknown. Setting mNavigatePendingMsgId." << std::endl;
|
||||||
|
|
||||||
mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading.
|
mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading.
|
||||||
return true; // we have to return true here, otherwise the caller will intepret the async loading as an error.
|
return true; // we have to return true here, otherwise the caller will intepret the async loading as an error.
|
||||||
}
|
}
|
||||||
@ -1855,32 +1857,43 @@ void GxsForumThreadWidget::postForumLoading()
|
|||||||
#endif
|
#endif
|
||||||
if(!mNavigatePendingMsgId.isNull() && mThreadModel->getIndexOfMessage(mNavigatePendingMsgId).isValid())
|
if(!mNavigatePendingMsgId.isNull() && mThreadModel->getIndexOfMessage(mNavigatePendingMsgId).isValid())
|
||||||
{
|
{
|
||||||
mThreadId = mNavigatePendingMsgId;
|
std::cerr << "Pending msg navigation: " << mNavigatePendingMsgId << ". Using it as new thread Id" << std::endl;
|
||||||
mNavigatePendingMsgId.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId);
|
QModelIndex source_index = mThreadModel->getIndexOfMessage(mNavigatePendingMsgId);
|
||||||
|
|
||||||
if(!mThreadId.isNull() && source_index.isValid())
|
|
||||||
{
|
|
||||||
QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
|
QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
|
||||||
|
|
||||||
ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||||
ui->threadTreeWidget->scrollTo(index);
|
ui->threadTreeWidget->scrollTo(index);
|
||||||
#ifdef DEBUG_FORUMS
|
|
||||||
std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl;
|
changedThread(index);
|
||||||
#endif
|
mNavigatePendingMsgId.clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId);
|
||||||
|
|
||||||
|
if(!mThreadId.isNull() && source_index.isValid())
|
||||||
|
{
|
||||||
|
QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
|
||||||
|
ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||||
|
ui->threadTreeWidget->scrollTo(index);
|
||||||
#ifdef DEBUG_FORUMS
|
#ifdef DEBUG_FORUMS
|
||||||
std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl;
|
std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
ui->threadTreeWidget->selectionModel()->clear();
|
}
|
||||||
ui->threadTreeWidget->selectionModel()->reset();
|
else
|
||||||
mThreadId.clear();
|
{
|
||||||
//blank();
|
#ifdef DEBUG_FORUMS
|
||||||
}
|
std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl;
|
||||||
// we also need to restore expanded threads
|
#endif
|
||||||
|
ui->threadTreeWidget->selectionModel()->clear();
|
||||||
|
ui->threadTreeWidget->selectionModel()->reset();
|
||||||
|
mThreadId.clear();
|
||||||
|
//blank();
|
||||||
|
}
|
||||||
|
// we also need to restore expanded threads
|
||||||
|
}
|
||||||
|
|
||||||
ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str()));
|
ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str()));
|
||||||
ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder);
|
ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user