2007-11-14 22:18:48 -05:00
|
|
|
/****************************************************************
|
|
|
|
* RetroShare is distributed under the following license:
|
|
|
|
*
|
2007-11-18 18:35:53 -05:00
|
|
|
* Copyright (C) 2007, RetroShare Team
|
2007-11-14 22:18:48 -05:00
|
|
|
*
|
|
|
|
* 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.
|
2009-01-03 21:28:30 -05:00
|
|
|
****************************************************************/
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
#ifndef _MESSENGERWINDOW_H
|
2009-01-03 21:28:30 -05:00
|
|
|
#define _MESSENGERWINDOW_H
|
|
|
|
|
2007-11-16 20:35:52 -05:00
|
|
|
#include "ui_MessengerWindow.h"
|
2010-02-03 12:39:30 -05:00
|
|
|
|
2009-01-07 16:12:31 -05:00
|
|
|
#include <gui/common/rwindow.h>
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
class LogoBar;
|
2008-07-10 14:52:56 -04:00
|
|
|
class PeersDialog;
|
2010-06-17 13:39:32 -04:00
|
|
|
class PopupChatDialog;
|
2009-01-03 21:28:30 -05:00
|
|
|
|
2009-01-07 16:12:31 -05:00
|
|
|
class MessengerWindow : public RWindow
|
2009-01-03 21:28:30 -05:00
|
|
|
{
|
2010-06-17 13:39:32 -04:00
|
|
|
Q_OBJECT
|
2007-11-16 20:35:52 -05:00
|
|
|
|
2010-06-17 13:39:32 -04:00
|
|
|
public:
|
|
|
|
QPixmap picture;
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2010-07-18 07:43:39 -04:00
|
|
|
static void showYourself ();
|
2010-06-17 13:39:32 -04:00
|
|
|
static MessengerWindow* getInstance();
|
|
|
|
static void releaseInstance();
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
public slots:
|
2010-06-17 13:39:32 -04:00
|
|
|
void updateMessengerDisplay() ;
|
2010-08-31 16:00:49 -04:00
|
|
|
#ifndef MINIMAL_RSGUI
|
2010-06-17 13:39:32 -04:00
|
|
|
void updateAvatar();
|
|
|
|
void loadmystatusmessage();
|
2010-08-31 16:00:49 -04:00
|
|
|
#endif // MINIMAL_RSGUI
|
2010-04-27 08:21:39 -04:00
|
|
|
|
2010-06-17 13:39:32 -04:00
|
|
|
LogoBar & getLogoBar() const;
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
protected:
|
2010-06-17 13:39:32 -04:00
|
|
|
/** Default Constructor */
|
|
|
|
MessengerWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
|
|
|
|
/** Default Destructor */
|
|
|
|
~MessengerWindow();
|
2009-01-03 21:28:30 -05:00
|
|
|
|
2010-06-17 13:39:32 -04:00
|
|
|
void closeEvent (QCloseEvent * event);
|
2009-01-03 21:28:30 -05:00
|
|
|
|
|
|
|
private slots:
|
2010-06-17 13:39:32 -04:00
|
|
|
/** Create the context popup menu and it's submenus */
|
|
|
|
void messengertreeWidgetCostumPopupMenu( QPoint point );
|
2009-01-03 21:28:30 -05:00
|
|
|
|
2010-08-31 16:00:49 -04:00
|
|
|
#ifndef MINIMAL_RSGUI
|
2010-06-17 13:39:32 -04:00
|
|
|
/** Add a new friend */
|
|
|
|
void addFriend();
|
|
|
|
/** Export friend */
|
|
|
|
void exportfriend();
|
|
|
|
/** Remove friend */
|
|
|
|
void removefriend();
|
2010-08-31 16:00:49 -04:00
|
|
|
#endif // MINIMAL_RSGUI
|
|
|
|
/** start to connect to a friend **/
|
|
|
|
void connectfriend();
|
|
|
|
#ifndef MINIMAL_RSGUI
|
2010-06-17 13:39:32 -04:00
|
|
|
/** start a chat with a friend **/
|
|
|
|
void chatfriend(QTreeWidgetItem *pPeer);
|
|
|
|
void chatfriendproxy();
|
|
|
|
/** start Messages Composer **/
|
|
|
|
void sendMessage();
|
|
|
|
/** show peers details for each friend **/
|
|
|
|
void configurefriend();
|
|
|
|
|
2010-07-15 07:25:34 -04:00
|
|
|
void recommendfriend();
|
|
|
|
void pastePerson();
|
|
|
|
|
2010-06-17 13:39:32 -04:00
|
|
|
/** Open Shared Manager **/
|
|
|
|
void openShareManager();
|
|
|
|
|
|
|
|
/** get own last stored Avatar**/
|
|
|
|
void getAvatar();
|
|
|
|
|
|
|
|
void changeAvatarClicked();
|
|
|
|
|
|
|
|
void savestatusmessage();
|
2010-08-31 16:00:49 -04:00
|
|
|
#endif // MINIMAL_RSGUI
|
2010-06-17 13:39:32 -04:00
|
|
|
|
|
|
|
void on_actionSort_Peers_Descending_Order_activated();
|
|
|
|
void on_actionSort_Peers_Ascending_Order_activated();
|
|
|
|
void on_actionRoot_is_decorated_activated();
|
|
|
|
|
|
|
|
void filterRegExpChanged();
|
|
|
|
void clearFilter();
|
2010-02-03 12:39:30 -05:00
|
|
|
|
|
|
|
signals:
|
2010-06-17 13:39:32 -04:00
|
|
|
void friendsUpdated() ;
|
2010-08-31 16:00:49 -04:00
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
private:
|
2010-07-18 07:43:39 -04:00
|
|
|
static MessengerWindow *_instance;
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2010-06-17 13:39:32 -04:00
|
|
|
void processSettings(bool bLoad);
|
2010-04-27 08:21:39 -04:00
|
|
|
|
2010-08-31 16:00:49 -04:00
|
|
|
void displayMenu();
|
|
|
|
|
2010-06-17 13:39:32 -04:00
|
|
|
/* Worker Functions */
|
|
|
|
/* (1) Update Display */
|
2010-07-20 15:45:07 -04:00
|
|
|
QTimer *timer;
|
2009-01-07 16:12:31 -05:00
|
|
|
|
2010-06-17 13:39:32 -04:00
|
|
|
/* (2) Utility Fns */
|
|
|
|
QTreeWidgetItem *getCurrentPeer();
|
|
|
|
void insertPeers();
|
2009-01-07 16:12:31 -05:00
|
|
|
|
2010-06-17 13:39:32 -04:00
|
|
|
void FilterItems();
|
|
|
|
bool FilterItem(QTreeWidgetItem *pItem, QString &sPattern);
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2010-06-17 13:39:32 -04:00
|
|
|
QTreeView *messengertreeWidget;
|
|
|
|
|
|
|
|
LogoBar * _rsLogoBarmessenger;
|
|
|
|
|
|
|
|
QFont itemFont;
|
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::MessengerWindow ui;
|
2009-01-03 21:28:30 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|