mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
GUI mods for new Forum sorting method. (Last Post)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1629 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
821855d16e
commit
4546be7778
@ -553,10 +553,23 @@ void ForumsDialog::insertThreads()
|
|||||||
mCurrPostId = "";
|
mCurrPostId = "";
|
||||||
std::string fId = mCurrForumId;
|
std::string fId = mCurrForumId;
|
||||||
|
|
||||||
|
#define VIEW_LAST_POST 0
|
||||||
|
#define VIEW_THREADED 1
|
||||||
|
#define VIEW_FLAT 2
|
||||||
|
|
||||||
bool flatView = false;
|
bool flatView = false;
|
||||||
if (ui.viewBox->currentIndex() == 1)
|
bool useChildTS = false;
|
||||||
|
switch(ui.viewBox->currentIndex())
|
||||||
{
|
{
|
||||||
|
case VIEW_LAST_POST:
|
||||||
|
useChildTS = true;
|
||||||
|
break;
|
||||||
|
case VIEW_FLAT:
|
||||||
flatView = true;
|
flatView = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case VIEW_THREADED:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<ThreadInfoSummary> threads;
|
std::list<ThreadInfoSummary> threads;
|
||||||
@ -587,9 +600,23 @@ void ForumsDialog::insertThreads()
|
|||||||
|
|
||||||
{
|
{
|
||||||
QDateTime qtime;
|
QDateTime qtime;
|
||||||
|
if (useChildTS)
|
||||||
|
qtime.setTime_t(tit->childTS);
|
||||||
|
else
|
||||||
qtime.setTime_t(tit->ts);
|
qtime.setTime_t(tit->ts);
|
||||||
|
|
||||||
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
|
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
|
||||||
item -> setText(0, timestamp);
|
|
||||||
|
QString txt = timestamp;
|
||||||
|
if (useChildTS)
|
||||||
|
{
|
||||||
|
QDateTime qtime2;
|
||||||
|
qtime2.setTime_t(tit->ts);
|
||||||
|
QString timestamp2 = qtime2.toString("yyyy-MM-dd hh:mm:ss");
|
||||||
|
txt += " / ";
|
||||||
|
txt += timestamp2;
|
||||||
|
}
|
||||||
|
item -> setText(0, txt);
|
||||||
}
|
}
|
||||||
ForumMsgInfo msginfo ;
|
ForumMsgInfo msginfo ;
|
||||||
rsForums->getForumMessage(fId,tit->msgId,msginfo) ;
|
rsForums->getForumMessage(fId,tit->msgId,msginfo) ;
|
||||||
@ -639,9 +666,23 @@ void ForumsDialog::insertThreads()
|
|||||||
|
|
||||||
{
|
{
|
||||||
QDateTime qtime;
|
QDateTime qtime;
|
||||||
|
if (useChildTS)
|
||||||
|
qtime.setTime_t(mit->childTS);
|
||||||
|
else
|
||||||
qtime.setTime_t(mit->ts);
|
qtime.setTime_t(mit->ts);
|
||||||
|
|
||||||
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
|
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
|
||||||
child -> setText(0, timestamp);
|
|
||||||
|
QString txt = timestamp;
|
||||||
|
if (useChildTS)
|
||||||
|
{
|
||||||
|
QDateTime qtime2;
|
||||||
|
qtime2.setTime_t(mit->ts);
|
||||||
|
QString timestamp2 = qtime2.toString("yyyy-MM-dd hh:mm:ss");
|
||||||
|
txt += " / ";
|
||||||
|
txt += timestamp2;
|
||||||
|
}
|
||||||
|
child -> setText(0, txt);
|
||||||
}
|
}
|
||||||
ForumMsgInfo msginfo ;
|
ForumMsgInfo msginfo ;
|
||||||
rsForums->getForumMessage(fId,mit->msgId,msginfo) ;
|
rsForums->getForumMessage(fId,mit->msgId,msginfo) ;
|
||||||
|
@ -642,6 +642,11 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="viewBox">
|
<widget class="QComboBox" name="viewBox">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Last Post</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Threaded View</string>
|
<string>Threaded View</string>
|
||||||
|
@ -69,6 +69,7 @@ class ForumMsgInfo
|
|||||||
std::wstring title;
|
std::wstring title;
|
||||||
std::wstring msg;
|
std::wstring msg;
|
||||||
time_t ts;
|
time_t ts;
|
||||||
|
time_t childTS;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -87,7 +88,7 @@ class ThreadInfoSummary
|
|||||||
std::wstring msg;
|
std::wstring msg;
|
||||||
int count; /* file count */
|
int count; /* file count */
|
||||||
time_t ts;
|
time_t ts;
|
||||||
|
time_t childTS;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, const ForumInfo &info);
|
std::ostream &operator<<(std::ostream &out, const ForumInfo &info);
|
||||||
|
Loading…
Reference in New Issue
Block a user