Reworked clear and delete of public and private chat history.

Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4022 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-02-08 21:59:17 +00:00
parent c448e82987
commit 17a57e0509
11 changed files with 142 additions and 94 deletions

View File

@ -207,7 +207,8 @@ PeersDialog::PeersDialog(QWidget *parent)
}
QMenu * grpchatmenu = new QMenu();
grpchatmenu->addAction(ui.actionClearChat);
grpchatmenu->addAction(ui.actionClear_Chat_History);
grpchatmenu->addAction(ui.actionDelete_Chat_History);
grpchatmenu->addAction(ui.actionSave_History);
grpchatmenu->addAction(ui.actionMessageHistory);
ui.menuButton->setMenu(grpchatmenu);
@ -1718,11 +1719,17 @@ void PeersDialog::setChatInfo(QString info, QColor color)
ui.msgText->append(QString::fromUtf8("<font color='grey'>")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + info + QString::fromUtf8("</i></font>"));
}
void PeersDialog::on_actionClearChat_triggered()
void PeersDialog::on_actionClear_Chat_History_triggered()
{
ui.msgText->clear();
}
void PeersDialog::on_actionDelete_Chat_History_triggered()
{
on_actionClear_Chat_History_triggered();
historyKeeper.clear();
}
void PeersDialog::smileyWidgetgroupchat()
{
Emoticons::showSmileyWidget(this, ui.emoticonBtn, SLOT(addSmileys()), true);

View File

@ -82,9 +82,6 @@ public slots:
void smileyWidgetgroupchat();
void addSmileys();
void on_actionClearChat_triggered();
void on_actionMessageHistory_triggered();
// called by notifyQt when another peer is typing (in group chant and private chat)
void updatePeerStatusString(const QString& peer_id,const QString& status_string,bool is_private_chat) ;
@ -103,6 +100,10 @@ private slots:
void pasteLink() ;
void contextMenu(QPoint) ;
void on_actionClear_Chat_History_triggered();
void on_actionDelete_Chat_History_triggered();
void on_actionMessageHistory_triggered();
/** Create the context popup menu and it's submenus */
void peertreeWidgetCostumPopupMenu( QPoint point );

View File

@ -1385,7 +1385,7 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
</layout>
<action name="actionClearChat">
<action name="actionClear_Chat_History">
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/edit-clear-history.png</normaloff>:/images/edit-clear-history.png</iconset>
@ -1553,6 +1553,18 @@ p, li { white-space: pre-wrap; }
<string>Sort Ascending Order</string>
</property>
</action>
<action name="actionDelete_Chat_History">
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/edit-clear-history.png</normaloff>:/images/edit-clear-history.png</iconset>
</property>
<property name="text">
<string>Delete Chat History</string>
</property>
<property name="toolTip">
<string>Deletes all stored and displayed chat history</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@ -149,8 +149,8 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
ui.chattextEdit->setAcceptDrops(false);
QMenu * toolmenu = new QMenu();
toolmenu->addAction(ui.actionClear_Chat);
toolmenu->addAction(ui.actionClear_Chat_History);
toolmenu->addAction(ui.actionDelete_Chat_History);
toolmenu->addAction(ui.actionSave_Chat_History);
toolmenu->addAction(ui.actionClearOfflineMessages);
toolmenu->addAction(ui.actionMessageHistory);
@ -826,15 +826,15 @@ void PopupChatDialog::addSmiley()
//============================================================================
void PopupChatDialog::on_actionClear_Chat_triggered()
void PopupChatDialog::on_actionClear_Chat_History_triggered()
{
ui.textBrowser->clear();
}
void PopupChatDialog::on_actionClear_Chat_History_triggered()
void PopupChatDialog::on_actionDelete_Chat_History_triggered()
{
ui.textBrowser->clear();
historyKeeper.clearHistory();
on_actionClear_Chat_History_triggered();
historyKeeper.clear();
}
void PopupChatDialog::updatePeerAvatar(const std::string& peer_id)

View File

@ -106,8 +106,8 @@ private slots:
void updatePeersCustomStateString(const QString& peer_id, const QString& status_string) ;
void on_actionClear_Chat_triggered();
void on_actionClear_Chat_History_triggered();
void on_actionDelete_Chat_History_triggered();
bool fileSave();
bool fileSaveAs();

View File

@ -848,13 +848,13 @@ background: white;}</string>
<string>Strike</string>
</property>
</action>
<action name="actionClear_Chat">
<action name="actionClear_Chat_History">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit-clear-history.png</normaloff>:/images/edit-clear-history.png</iconset>
</property>
<property name="text">
<string>Clear Chat</string>
<string>Clear Chat History</string>
</property>
</action>
<action name="action_Disable_Emoticons">
@ -886,16 +886,16 @@ background: white;}</string>
<string>Browse History</string>
</property>
</action>
<action name="actionClear_Chat_History">
<action name="actionDelete_Chat_History">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit-clear-history.png</normaloff>:/images/edit-clear-history.png</iconset>
</property>
<property name="text">
<string>Clear Chat History</string>
<string>Delete Chat History</string>
</property>
<property name="toolTip">
<string>deletes all stored and displayed chat history </string>
<string>Deletes all stored and displayed chat history</string>
</property>
</action>
</widget>

View File

@ -250,16 +250,6 @@ void IMHistoryKeeper::removeMessages(QList<int> &hiids)
}
}
void IMHistoryKeeper::clearHistory(){
IMHistoryWriter wri;
if(!wri.remove(hfName))
std::cerr << "\nFailed to remove history file" << std::endl;
clear();
}
//=============================================================================
void IMHistoryKeeper::saveHistory()

View File

@ -93,9 +93,6 @@ public:
//! Remove items
void removeMessages(QList<int> &hiids);
//! Remove history
void clearHistory(void);
private:
bool loadHistoryFile();

View File

@ -41,6 +41,10 @@ bool IMHistoryWriter::write(QList<IMHistoryItem>& itemList, const QString fileNa
errMess = "No error";
if (itemList.size() == 0) {
return remove(fileName);
}
//==== check for file and open it
QFile fl(fileName);
if (fl.open(QIODevice::WriteOnly | QIODevice::Truncate) == false) {
@ -78,8 +82,12 @@ bool IMHistoryWriter::write(QList<IMHistoryItem>& itemList, const QString fileNa
return true;
}
bool IMHistoryWriter::remove(const QString &fileName){
return QFile::remove(fileName);
bool IMHistoryWriter::remove(const QString &fileName)
{
if (!QFile::remove(fileName)) {
qDebug() << " IMHistoryWriter::remove Failed to remove history file";
return false;
}
return true;
}

View File

@ -998,7 +998,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>ChannelFeed</name>
<message>
<location filename="../gui/ChannelFeed.ui" line="+154"/>
<location filename="../gui/ChannelFeed.ui" line="+119"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
@ -1021,17 +1021,17 @@ p, li { white-space: pre-wrap; }
<translation>Anzeige</translation>
</message>
<message>
<location line="+269"/>
<location line="+275"/>
<source>Set all to read</source>
<translation>Alle als gelesen markieren</translation>
</message>
<message>
<location line="+100"/>
<location line="+88"/>
<source>Create Channel</source>
<translation>Kanal erstellen</translation>
</message>
<message>
<location line="-198"/>
<location line="-192"/>
<source>Unsubscribe</source>
<translation>Abbestellen</translation>
</message>
@ -1051,7 +1051,7 @@ p, li { white-space: pre-wrap; }
<translation>Kanal abbestellen</translation>
</message>
<message>
<location filename="../gui/ChannelFeed.cpp" line="+77"/>
<location filename="../gui/ChannelFeed.cpp" line="+82"/>
<source>Own Channels</source>
<translation>Meine Kanäle</translation>
</message>
@ -1072,7 +1072,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../gui/ChannelFeed.ui" line="-168"/>
<location filename="../gui/ChannelFeed.cpp" line="+50"/>
<location filename="../gui/ChannelFeed.cpp" line="+56"/>
<source>Post to Channel</source>
<translation>Kanalbeitrag erstellen</translation>
</message>
@ -1092,17 +1092,22 @@ p, li { white-space: pre-wrap; }
<translation>Zeige Kanal-Details</translation>
</message>
<message>
<location line="+9"/>
<location line="+3"/>
<source>Restore Publish Rights for Channel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Share Channel</source>
<translation>Verteile Kanal</translation>
</message>
<message>
<location line="+258"/>
<location line="+259"/>
<source>No Channel Selected</source>
<translation>Keinen Kanal gewählt</translation>
</message>
<message>
<location line="-261"/>
<location line="-262"/>
<source>Edit Channel Details</source>
<translation>Kanal-Details bearbeiten</translation>
</message>
@ -3551,7 +3556,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>ForumsDialog</name>
<message>
<location filename="../gui/ForumsDialog.cpp" line="+265"/>
<location filename="../gui/ForumsDialog.cpp" line="+270"/>
<source>Subscribe to Forum</source>
<translation>Forum abonnieren</translation>
</message>
@ -3675,7 +3680,7 @@ p, li { white-space: pre-wrap; }
<translation>Andere Foren</translation>
</message>
<message>
<location filename="../gui/ForumsDialog.ui" line="+621"/>
<location filename="../gui/ForumsDialog.ui" line="+597"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
@ -3703,7 +3708,7 @@ p, li { white-space: pre-wrap; }
<translation>Anzeige</translation>
</message>
<message>
<location line="+94"/>
<location line="+88"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
@ -7345,7 +7350,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>PeersDialog</name>
<message>
<location filename="../gui/PeersDialog.cpp" line="+455"/>
<location filename="../gui/PeersDialog.cpp" line="+456"/>
<source>Chat</source>
<translation>Chat</translation>
</message>
@ -7370,7 +7375,7 @@ p, li { white-space: pre-wrap; }
<translation>Verbinde zum Freund</translation>
</message>
<message>
<location line="-317"/>
<location line="-318"/>
<source>Profile</source>
<translation>Profil</translation>
</message>
@ -7380,7 +7385,7 @@ p, li { white-space: pre-wrap; }
<translation>Willkommen bei RetroShare&apos;s Gruppenchat.</translation>
</message>
<message>
<location line="+63"/>
<location line="+64"/>
<source>me</source>
<translation>ich</translation>
</message>
@ -7477,7 +7482,7 @@ p, li { white-space: pre-wrap; }
<translation>Neuer Gruppenchat</translation>
</message>
<message>
<location line="+285"/>
<location line="+291"/>
<source>Load File</source>
<translation>Lade Datei</translation>
</message>
@ -7555,6 +7560,10 @@ p, li { white-space: pre-wrap; }
<source>Bold</source>
<translation>Fett</translation>
</message>
<message>
<source>Clear Chat</source>
<translation type="obsolete">Nachrichtenverlauf leeren</translation>
</message>
<message>
<location line="+332"/>
<location line="+3"/>
@ -7627,8 +7636,18 @@ p, li { white-space: pre-wrap; }
<translation>Aufsteigend sortieren</translation>
</message>
<message>
<location line="-150"/>
<location filename="../gui/PeersDialog.cpp" line="-1505"/>
<location line="+9"/>
<source>Delete Chat History</source>
<translation>Nachrichtenverlauf löschen</translation>
</message>
<message>
<location line="+3"/>
<source>Deletes all stored and displayed chat history</source>
<translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation>
</message>
<message>
<location line="-162"/>
<location filename="../gui/PeersDialog.cpp" line="-1511"/>
<source>Add Friend</source>
<translation>Freund hinzufügen</translation>
</message>
@ -7673,13 +7692,13 @@ p, li { white-space: pre-wrap; }
<message>
<location line="+27"/>
<source>Clear Chat History</source>
<translation>Verlauf löschen</translation>
<translation>Nachrichtenverlauf leeren</translation>
</message>
<message>
<location line="+85"/>
<location line="+3"/>
<source>Save Chat History</source>
<translation>Chat Verlauf speichern</translation>
<translation>Nachrichtenverlauf speichern</translation>
</message>
<message>
<location filename="../gui/PeersDialog.cpp" line="-40"/>
@ -7708,7 +7727,7 @@ p, li { white-space: pre-wrap; }
<translation>Willst du diesen Freund entfernen?</translation>
</message>
<message>
<location line="+726"/>
<location line="+732"/>
<source>Save as...</source>
<translation>Speichern unter...</translation>
</message>
@ -7740,12 +7759,12 @@ p, li { white-space: pre-wrap; }
<translation>Status Spalte ausblenden</translation>
</message>
<message>
<location filename="../gui/PeersDialog.cpp" line="-1850"/>
<location filename="../gui/PeersDialog.cpp" line="-1857"/>
<source>Friends Storm</source>
<translation>Aktivitäten</translation>
</message>
<message>
<location line="+1209"/>
<location line="+1210"/>
<source>is typing...</source>
<translation>tippt...</translation>
</message>
@ -8076,7 +8095,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>PopupChatDialog</name>
<message>
<location filename="../gui/chat/PopupChatDialog.cpp" line="+744"/>
<location filename="../gui/chat/PopupChatDialog.cpp" line="+745"/>
<source>Hide Avatar</source>
<translation>Avatar verstecken</translation>
</message>
@ -8086,7 +8105,7 @@ p, li { white-space: pre-wrap; }
<translation>Avatar zeigen</translation>
</message>
<message>
<location line="+153"/>
<location line="+159"/>
<source>Load Picture File</source>
<translation>Lade Bilddatei</translation>
</message>
@ -8144,17 +8163,31 @@ p, li { white-space: pre-wrap; }
<translation>Nachrichtenverlauf</translation>
</message>
<message>
<location line="-372"/>
<location line="-29"/>
<source>Clear Chat History</source>
<translation>Nachrichtenverlauf leeren</translation>
</message>
<message>
<location line="+38"/>
<source>Delete Chat History</source>
<translation>Nachrichtenverlauf löschen</translation>
</message>
<message>
<location line="+3"/>
<source>Deletes all stored and displayed chat history</source>
<translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation>
</message>
<message>
<location line="-384"/>
<source>Send</source>
<translation>Senden</translation>
</message>
<message>
<location line="+343"/>
<source>Clear Chat</source>
<translation>Chat-Chronik löschen</translation>
<translation type="obsolete">Chat Verlauf löschen</translation>
</message>
<message>
<location line="+8"/>
<location line="+351"/>
<source>Disable Emoticons</source>
<translation>Deaktiviere Emoticons</translation>
</message>
@ -8188,7 +8221,7 @@ p, li { white-space: pre-wrap; }
<location line="+392"/>
<location line="+3"/>
<source>Save Chat History</source>
<translation>Chat Verlauf speichern</translation>
<translation>Nachrichtenverlauf speichern</translation>
</message>
<message>
<location filename="../gui/chat/PopupChatDialog.cpp" line="+61"/>
@ -8201,7 +8234,7 @@ p, li { white-space: pre-wrap; }
<translation>Text Datei (*.txt );;Alle Dateien (*)</translation>
</message>
<message>
<location line="-712"/>
<location line="-718"/>
<source>Your Friend is offline
Do you want to send them a Message instead</source>
<translation>Dein Freund ist Offline willst du ihm stattdessen eine Nachricht senden</translation>
@ -8212,7 +8245,7 @@ Do you want to send them a Message instead</source>
<translation>Bild anhängen</translation>
</message>
<message>
<location filename="../gui/chat/PopupChatDialog.cpp" line="+755"/>
<location filename="../gui/chat/PopupChatDialog.cpp" line="+761"/>
<source>is Idle and may not reply</source>
<translation>antwortet möglicherweise nicht, da der Status auf &quot;Untätig&quot; gesetzt wurde</translation>
</message>
@ -8232,7 +8265,7 @@ Do you want to send them a Message instead</source>
<translation>ist Offline.</translation>
</message>
<message>
<location line="-713"/>
<location line="-719"/>
<source>Paste RetroShare Link</source>
<translation>RetroShare Link einfügen</translation>
</message>
@ -11129,7 +11162,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>TransfersDialog</name>
<message>
<location filename="../gui/TransfersDialog.cpp" line="+246"/>
<location filename="../gui/TransfersDialog.cpp" line="+291"/>
<source>Cancel</source>
<translation>Abbrechen</translation>
</message>
@ -11327,7 +11360,7 @@ p, li { white-space: pre-wrap; }
<translation>Blockstrategie</translation>
</message>
<message>
<location line="+397"/>
<location line="+398"/>
<source>Queued</source>
<translation>In Warteschleife</translation>
</message>
@ -11337,22 +11370,22 @@ p, li { white-space: pre-wrap; }
<translation>Pausiert</translation>
</message>
<message>
<location line="-139"/>
<location line="-138"/>
<source>Transferring</source>
<translation>Übertrage</translation>
</message>
<message>
<location line="+357"/>
<location line="+361"/>
<source>RetroShare</source>
<translation></translation>
</message>
<message>
<location line="+128"/>
<location line="+124"/>
<source>Details:</source>
<translation>Details:</translation>
</message>
<message>
<location line="+233"/>
<location line="+243"/>
<source>Open Transfer</source>
<translation>Öffne Übertragung</translation>
</message>
@ -11362,12 +11395,12 @@ p, li { white-space: pre-wrap; }
<translation>Datei %1 ist nicht komplett. Wenn es eine Media Datei ist dann versuche &quot;Vorschau&quot;.</translation>
</message>
<message>
<location line="-364"/>
<location line="-370"/>
<source>Are you sure that you want to cancel and delete these files?</source>
<translation>Soll dieser Download wirklich abgebrochen und gelöscht werden?</translation>
</message>
<message>
<location line="-904"/>
<location line="-910"/>
<source>Speed / Queue position</source>
<translation>Geschwindigkeits- / Warteschlangenposition</translation>
</message>
@ -11405,63 +11438,63 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="+12"/>
<location line="+531"/>
<location line="+532"/>
<source>Slower</source>
<translation>Langsamer</translation>
</message>
<message>
<location line="-529"/>
<location line="+530"/>
<location line="-530"/>
<location line="+531"/>
<location line="+2"/>
<source>Average</source>
<translation>Durchschnitt</translation>
</message>
<message>
<location line="-530"/>
<location line="+529"/>
<location line="-531"/>
<location line="+530"/>
<source>Faster</source>
<translation>Schneller</translation>
</message>
<message>
<location line="-425"/>
<location line="-426"/>
<source>Move in Queue...</source>
<translation>Verschiebe in Warteschlange...</translation>
</message>
<message>
<location line="+260"/>
<location line="+145"/>
<location line="+132"/>
<location line="+262"/>
<location line="+144"/>
<location line="+133"/>
<source>Failed</source>
<translation>Gescheitert</translation>
</message>
<message>
<location line="-273"/>
<location line="+142"/>
<location line="+132"/>
<location line="+141"/>
<location line="+133"/>
<source>Okay</source>
<translation>OK</translation>
</message>
<message>
<location line="-131"/>
<location line="+132"/>
<location line="-132"/>
<location line="+133"/>
<source>Waiting</source>
<translation>Warte</translation>
</message>
<message>
<location line="-131"/>
<location line="-132"/>
<source>Downloading</source>
<translation>Ladend</translation>
</message>
<message>
<location line="-132"/>
<location line="+133"/>
<location line="-131"/>
<location line="+132"/>
<location line="+133"/>
<location line="+1"/>
<source>Complete</source>
<translation>Vollständig</translation>
</message>
<message>
<location line="-129"/>
<location line="-130"/>
<source>Unknown</source>
<translation>Unbekannt</translation>
</message>
@ -11471,17 +11504,17 @@ p, li { white-space: pre-wrap; }
<translation>Version: </translation>
</message>
<message>
<location line="+79"/>
<location line="+80"/>
<source>Uploading</source>
<translation>Hochladend</translation>
</message>
<message>
<location line="-128"/>
<location line="-129"/>
<source>Checking...</source>
<translation>Überprüfe...</translation>
</message>
<message>
<location line="-556"/>
<location line="-557"/>
<source>Force Check</source>
<translation>Erzwinge Überprüfung</translation>
</message>