Show date in chat messages and small style changes.

Save and restore window position of the Historiy Browser.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3446 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-09-05 10:32:32 +00:00
parent e635e5a026
commit c63905fefc
13 changed files with 44 additions and 52 deletions

View File

@ -325,8 +325,16 @@ QString ChatStyle::formatMessage(enumFormatMessage type, QString &name, QDateTim
// } // }
// } // }
// if the message is on same date show only time
QString timeFormat;
// if (timestamp.daysTo(QDateTime::currentDateTime()) == 0) {
// timeFormat = "hh:mm:ss";
// } else {
timeFormat = "dd.MM.yyyy hh:mm:ss";
// }
QString formatMsg = style.replace("%name%", name) QString formatMsg = style.replace("%name%", name)
.replace("%timestamp%", timestamp.toString("hh:mm:ss")) .replace("%timestamp%", timestamp.toString(timeFormat))
.replace("%message%", msg); .replace("%message%", msg);
return formatMsg; return formatMsg;

View File

@ -68,6 +68,16 @@ ImHistoryBrowser::ImHistoryBrowser(bool isPrivateChatIn, IMHistoryKeeper &histKe
foreach(IMHistoryItem item, historyItems) { foreach(IMHistoryItem item, historyItems) {
addItem(item); addItem(item);
} }
QByteArray geometry = Settings->valueFromGroup("HistorieBrowser", "Geometry", QByteArray()).toByteArray();
if (geometry.isEmpty() == false) {
restoreGeometry(geometry);
}
}
ImHistoryBrowser::~ImHistoryBrowser()
{
Settings->setValueToGroup("HistorieBrowser", "Geometry", saveGeometry());
} }
void ImHistoryBrowser::historyAdd(IMHistoryItem item) void ImHistoryBrowser::historyAdd(IMHistoryItem item)

View File

@ -38,6 +38,7 @@ public:
/** Default constructor */ /** Default constructor */
ImHistoryBrowser(bool isPrivateChat, IMHistoryKeeper &histKeeper, QWidget *parent = 0, Qt::WFlags flags = 0); ImHistoryBrowser(bool isPrivateChat, IMHistoryKeeper &histKeeper, QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */ /** Default destructor */
virtual ~ImHistoryBrowser();
private slots: private slots:
void historyAdd(IMHistoryItem item); void historyAdd(IMHistoryItem item);

View File

@ -17,6 +17,9 @@
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset> <normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property> </property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="mainLayout"> <layout class="QGridLayout" name="mainLayout">
@ -103,7 +106,6 @@ border-image: url(:/images/closepressed.png)
</widget> </widget>
<resources> <resources>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="../images.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>

View File

@ -4,7 +4,7 @@
<table class='incomingTable' width='100%'> <table class='incomingTable' width='100%'>
<tr> <tr>
<td class='header incomingHeader'>%name%</td> <td class='header incomingHeader'>%name%</td>
<td width='10%' align='left' class='time incomingTime'>[%timestamp%] </td> <td width='130' align='right' class='time incomingTime'>[%timestamp%]</td>
</tr> </tr>
</table> </table>

View File

@ -4,7 +4,7 @@
<table class='outgoingTable' width='100%'> <table class='outgoingTable' width='100%'>
<tr> <tr>
<td class='header outgoingHeader'>%name%</td> <td class='header outgoingHeader'>%name%</td>
<td width='10%' align='left' class='time outgoingTime'>[%timestamp%] </td> <td width='130' align='right' class='time outgoingTime'>[%timestamp%]</td>
</tr> </tr>
</table> </table>

View File

@ -1,11 +1,10 @@
<style type="text/css"> <style type="text/css">
%css-style% %css-style%
</style> </style>
<table width='100%'> <table class='header hincomingHeader' width='100%'>
<tr> <tr>
<td class='header hincomingHeader'>%name%</td> <td class='name'>%name%</td>
<td width='10%' align='left' class='time hincomingTime'>[%timestamp%] </td> <td width='130' align='right' class='time'>[%timestamp%]</td>
</tr> </tr>
</table> </table>
<table width="100%"> <table width="100%">
@ -13,4 +12,3 @@
<td>%message%</td> <td>%message%</td>
</tr> </tr>
</table> </table>

View File

@ -1,11 +1,10 @@
<style type="text/css"> <style type="text/css">
%css-style% %css-style%
</style> </style>
<table width='100%'> <table class='header houtgoingHeader' width='100%'>
<tr> <tr>
<td class='header houtgoingHeader'>%name%</td> <td class='name'>%name%</td>
<td width='10%' align='left' class='time houtgoingTime'>[%timestamp%] </td> <td width='130' align='right' class='time'>[%timestamp%]</td>
</tr> </tr>
</table> </table>
<table width="100%"> <table width="100%">
@ -13,4 +12,3 @@
<td>%message%</td> <td>%message%</td>
</tr> </tr>
</table> </table>

View File

@ -1,11 +1,10 @@
<style type="text/css"> <style type="text/css">
%css-style% %css-style%
</style> </style>
<table width='100%'> <table class='incomingHeader' width='100%'>
<tr> <tr>
<td class='header incomingHeader'>%name%</td> <td class='name'>%name%</td>
<td width='10%' align='left' class='time incomingTime'>[%timestamp%] </td> <td width='130' align='right' class='time'>[%timestamp%]</td>
</tr> </tr>
</table> </table>
<table width="100%"> <table width="100%">
@ -13,4 +12,3 @@
<td>%message%</td> <td>%message%</td>
</tr> </tr>
</table> </table>

View File

@ -1,4 +1,4 @@
.header { .name{
font-weight: bold; font-weight: bold;
} }
@ -11,41 +11,20 @@
color: #295b07; color: #295b07;
} }
.incomingTime {
background-color:#dfedff;
color: #295b07;
}
.outgoingHeader { .outgoingHeader {
background-color:#f5f5f5; background-color:#f5f5f5;
border-color:#fafafa #e3e3e3 #e3e3e3 #fafafa; border-color:#fafafa #e3e3e3 #e3e3e3 #fafafa;
color: #244578; color: #244578;
} }
.outgoingTime {
background-color:#f5f5f5;
color: #244578;
}
.hincomingHeader { .hincomingHeader {
background-color:#dfedff; background-color:#dfedff;
border-color:#fafafa #d1dfef #d1dfef #fafafa; border-color:#fafafa #d1dfef #d1dfef #fafafa;
color: #295b07; color: #295b07;
} }
.hincomingTime {
background-color:#dfedff;
color: #295b07;
}
.houtgoingHeader { .houtgoingHeader {
background-color:#f5f5f5; background-color:#f5f5f5;
border-color:#fafafa #e3e3e3 #e3e3e3 #fafafa; border-color:#fafafa #e3e3e3 #e3e3e3 #fafafa;
color: #244578; color: #244578;
} }
.houtgoingTime {
background-color:#f5f5f5;
color: #244578;
}

View File

@ -1,11 +1,10 @@
<style type="text/css"> <style type="text/css">
%css-style% %css-style%
</style> </style>
<table width='100%'> <table class='outgoingHeader' width='100%'>
<tr> <tr>
<td class='header outgoingHeader'>%name%</td> <td class='name'>%name%</td>
<td width='10%' align='left' class='time outgoingTime'>[%timestamp%] </td> <td width='130' align='right' class='time'>[%timestamp%]</td>
</tr> </tr>
</table> </table>
<table width="100%"> <table width="100%">
@ -13,4 +12,3 @@
<td>%message%</td> <td>%message%</td>
</tr> </tr>
</table> </table>

View File

@ -7463,7 +7463,7 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<source>Browse Message History</source> <source>Browse Message History</source>
<translation>Nachrichtenverlauf Anzeigen</translation> <translation>Nachrichtenverlauf anzeigen</translation>
</message> </message>
<message> <message>
<source>Browse History</source> <source>Browse History</source>