diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index e79cf5190..ba07d10af 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -203,10 +203,11 @@ HEADERS += rshare.h \ gui/LogoBar.h \ gui/xprogressbar.h \ gui/plugins/PluginInterface.h \ - gui/im_history/IMHistoryKeeper.h \ - gui/im_history/IMHistoryReader.h \ - gui/im_history/IMHistoryItem.h \ - gui/im_history/IMHistoryWriter.h \ + gui/im_history/ImHistoryBrowser.h \ + gui/im_history/IMHistoryKeeper.h \ + gui/im_history/IMHistoryReader.h \ + gui/im_history/IMHistoryItem.h \ + gui/im_history/IMHistoryWriter.h \ lang/languagesupport.h \ util/stringutil.h \ util/win32.h \ @@ -373,7 +374,8 @@ FORMS += gui/StartDialog.ui \ gui/feeds/ChanMsgItem.ui \ gui/feeds/SubFileItem.ui \ gui/feeds/SubDestItem.ui \ - gui/feeds/AttachFileItem.ui + gui/feeds/AttachFileItem.ui \ + gui/im_history/ImHistoryBrowser.ui \ SOURCES += main.cpp \ rshare.cpp \ @@ -414,10 +416,11 @@ SOURCES += main.cpp \ gui/SoundManager.cpp \ gui/MessagesDialog.cpp \ gui/FileTransferInfoWidget.cpp \ - gui/im_history/IMHistoryKeeper.cpp \ - gui/im_history/IMHistoryReader.cpp \ - gui/im_history/IMHistoryItem.cpp \ - gui/im_history/IMHistoryWriter.cpp \ + gui/im_history/ImHistoryBrowser.cpp \ + gui/im_history/IMHistoryKeeper.cpp \ + gui/im_history/IMHistoryReader.cpp \ + gui/im_history/IMHistoryItem.cpp \ + gui/im_history/IMHistoryWriter.cpp \ gui/help/browser/helpbrowser.cpp \ gui/help/browser/helptextbrowser.cpp \ gui/HelpDialog.cpp \ diff --git a/retroshare-gui/src/gui/PeersDialog.cpp b/retroshare-gui/src/gui/PeersDialog.cpp index d1fd82a32..dc5d2dc41 100644 --- a/retroshare-gui/src/gui/PeersDialog.cpp +++ b/retroshare-gui/src/gui/PeersDialog.cpp @@ -52,6 +52,8 @@ #include "gui/forums/CreateForum.h" #include "gui/channels/CreateChannel.h" #include "gui/feeds/AttachFileItem.h" +#include "gui/im_history/ImHistoryBrowser.h" + #include "RetroShareLink.h" #include "MainWindow.h" @@ -221,7 +223,7 @@ PeersDialog::PeersDialog(QWidget *parent) QMenu * grpchatmenu = new QMenu(); grpchatmenu->addAction(ui.actionClearChat); grpchatmenu->addAction(ui.actionSave_History); - //grpchatmenu->addAction(ui.actionDisable_Emoticons); + grpchatmenu->addAction(ui.actionMessageHistory); ui.menuButton->setMenu(grpchatmenu); _underline = false; @@ -1887,3 +1889,9 @@ void PeersDialog::statusColumn() } } + +void PeersDialog::on_actionMessageHistory_triggered() +{ + ImHistoryBrowser imBrowser(this); + imBrowser.exec(); +} diff --git a/retroshare-gui/src/gui/PeersDialog.h b/retroshare-gui/src/gui/PeersDialog.h index f8ff29580..c8e285cbf 100644 --- a/retroshare-gui/src/gui/PeersDialog.h +++ b/retroshare-gui/src/gui/PeersDialog.h @@ -82,6 +82,8 @@ public slots: void addSmileys(); void on_actionClearChat_triggered(); + void on_actionMessageHistory_triggered(); + void displayInfoChatMenu(const QPoint& pos); // called by notifyQt when another peer is typing (in group chant and private chat) diff --git a/retroshare-gui/src/gui/PeersDialog.ui b/retroshare-gui/src/gui/PeersDialog.ui index 63b384d03..a72eb874d 100644 --- a/retroshare-gui/src/gui/PeersDialog.ui +++ b/retroshare-gui/src/gui/PeersDialog.ui @@ -1465,15 +1465,12 @@ p, li { white-space: pre-wrap; } Edit your status Message - - - true - + - Disable Emoticons + Browse Message History - Disable Emoticons + Browse History diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp new file mode 100644 index 000000000..351093f75 --- /dev/null +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp @@ -0,0 +1,45 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006 - 2010 The RetroShare Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ +#include "ImHistoryBrowser.h" + +#include +#include +#include +#include + +#include "rshare.h" + +/** Default constructor */ +ImHistoryBrowser::ImHistoryBrowser(QWidget *parent, Qt::WFlags flags) + : QDialog(parent, flags), historyKeeper(Rshare::dataDirectory() + "/his1.xml") +{ + /* Invoke Qt Designer generated QObject setup routine */ + ui.setupUi(this); + + QStringList him; + historyKeeper.getMessages(him, "", "THIS", 8); + foreach(QString mess, him) + ui.textBrowser->append(mess); + + +} + + diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h new file mode 100644 index 000000000..18069a44b --- /dev/null +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h @@ -0,0 +1,57 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006 - 2010 The RetroShare Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ + + +#ifndef _IMHISTORYBROWSER_H +#define _IMHISTORYBROWSER_H + +#include + +#include "IMHistoryKeeper.h" + +#include "ui_ImHistoryBrowser.h" + +class ImHistoryBrowser : public QDialog +{ + Q_OBJECT + +public: + /** Default constructor */ + ImHistoryBrowser(QWidget *parent = 0, Qt::WFlags flags = 0); + /** Default destructor */ + + + +private slots: + + + +private: + + IMHistoryKeeper historyKeeper; + + /** Qt Designer generated object */ + Ui::ImHistoryBrowser ui; + +}; + +#endif + diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui new file mode 100644 index 000000000..97751dcfd --- /dev/null +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.ui @@ -0,0 +1,70 @@ + + + ImHistoryBrowser + + + + 0 + 0 + 476 + 333 + + + + Message History + + + + :/images/rstray3.png:/images/rstray3.png + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + ImHistoryBrowser + close() + + + 237 + 312 + + + 237 + 166 + + + + + buttonBox + rejected() + ImHistoryBrowser + close() + + + 237 + 312 + + + 237 + 166 + + + + +