2007-11-14 22:18:48 -05:00
|
|
|
/****************************************************************
|
|
|
|
* RShare is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006, crypton
|
|
|
|
*
|
|
|
|
* 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-22 20:58:56 -05:00
|
|
|
****************************************************************/
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
#ifndef _PEERSDIALOG_H
|
2009-01-22 20:58:56 -05:00
|
|
|
#define _PEERSDIALOG_H
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
#include <QFileDialog>
|
|
|
|
|
2008-07-10 06:34:49 -04:00
|
|
|
#include "chat/PopupChatDialog.h"
|
2009-11-17 07:45:06 -05:00
|
|
|
#include "RsAutoUpdatePage.h"
|
2009-01-22 20:58:56 -05:00
|
|
|
|
|
|
|
#include "mainpage.h"
|
|
|
|
#include "ui_PeersDialog.h"
|
|
|
|
|
2009-03-12 10:14:55 -04:00
|
|
|
#include "im_history/IMHistoryKeeper.h"
|
|
|
|
|
2008-07-10 06:34:49 -04:00
|
|
|
class QFont;
|
|
|
|
class QAction;
|
|
|
|
class QTextEdit;
|
|
|
|
class QTextCharFormat;
|
2007-11-14 22:18:48 -05:00
|
|
|
class ChatDialog;
|
|
|
|
|
2009-11-17 07:45:06 -05:00
|
|
|
class PeersDialog : public RsAutoUpdatePage
|
2009-01-22 20:58:56 -05:00
|
|
|
{
|
2009-10-04 18:27:42 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
|
|
|
PeersDialog(QWidget *parent = 0);
|
|
|
|
/** Default Destructor */
|
|
|
|
|
|
|
|
PopupChatDialog *getPrivateChat(std::string id, std::string name, uint chatflags);
|
|
|
|
void clearOldChats();
|
|
|
|
|
|
|
|
void loadEmoticonsgroupchat();
|
|
|
|
// void setChatDialog(ChatDialog *cd);
|
|
|
|
|
|
|
|
QPixmap picture;
|
2009-11-17 07:45:06 -05:00
|
|
|
virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage
|
2010-01-17 12:58:28 -05:00
|
|
|
virtual void keyPressEvent(QKeyEvent *) ;
|
2009-10-04 18:27:42 -04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2010-01-17 12:58:28 -05:00
|
|
|
void insertPeers();
|
2009-10-04 18:27:42 -04:00
|
|
|
void toggleSendItem( QTreeWidgetItem *item, int col );
|
|
|
|
|
|
|
|
void insertChat();
|
|
|
|
void setChatInfo(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
|
|
|
void resetStatusBar() ;
|
|
|
|
|
|
|
|
|
|
|
|
void smileyWidgetgroupchat();
|
|
|
|
void addSmileys();
|
|
|
|
|
|
|
|
void on_actionClearChat_triggered();
|
|
|
|
void displayInfoChatMenu(const QPoint& pos);
|
|
|
|
|
|
|
|
// 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) ;
|
|
|
|
|
|
|
|
void updatePeersCustomStateString(const QString& peer_id) ;
|
|
|
|
void updatePeersAvatar(const QString& peer_id);
|
|
|
|
void updateAvatar(); // called by notifyQt to update the avatar when it gets changed by another component
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
/** Create the context popup menu and it's submenus */
|
|
|
|
void peertreeWidgetCostumPopupMenu( QPoint point );
|
|
|
|
|
|
|
|
void updateStatusString(const QString& statusString) ; // called when a peer is typing in group chat
|
|
|
|
void updateStatusTyping() ; // called each time a key is hit
|
|
|
|
|
|
|
|
//void updatePeerStatusString(const QString& peer_id,const QString& chat_status) ;
|
|
|
|
|
|
|
|
/** Export friend in Friends Dialog */
|
|
|
|
void exportfriend();
|
|
|
|
/** Remove friend */
|
|
|
|
void removefriend();
|
|
|
|
/** start a chat with a friend **/
|
|
|
|
void chatfriend();
|
|
|
|
void msgfriend();
|
|
|
|
|
|
|
|
void configurefriend();
|
|
|
|
void viewprofile();
|
|
|
|
|
|
|
|
/** RsServer Friend Calls */
|
|
|
|
void allowfriend();
|
|
|
|
void connectfriend();
|
|
|
|
void setaddressfriend();
|
|
|
|
void trustfriend();
|
|
|
|
|
|
|
|
void setColor();
|
|
|
|
void insertSendList();
|
|
|
|
void checkChat();
|
|
|
|
void sendMsg();
|
2009-10-08 15:08:44 -04:00
|
|
|
|
|
|
|
void statusmessage();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
|
|
|
//void privchat();
|
|
|
|
|
|
|
|
void setFont();
|
|
|
|
void getFont();
|
|
|
|
void underline();
|
|
|
|
|
|
|
|
void changeAvatarClicked();
|
|
|
|
void getAvatar();
|
|
|
|
|
|
|
|
void on_actionAdd_Friend_activated();
|
2010-01-16 20:36:50 -05:00
|
|
|
void on_actionCreate_New_Forum_activated();
|
|
|
|
void on_actionCreate_New_Channel_activated();
|
2009-10-04 18:27:42 -04:00
|
|
|
|
|
|
|
void loadmypersonalstatus();
|
2009-09-02 18:42:31 -04:00
|
|
|
|
2009-05-15 08:07:37 -04:00
|
|
|
signals:
|
2009-10-04 18:27:42 -04:00
|
|
|
void friendsUpdated() ;
|
|
|
|
void notifyGroupChat(const QString&,const QString&) ;
|
|
|
|
|
|
|
|
private:
|
|
|
|
class QLabel *iconLabel, *textLabel;
|
|
|
|
class QWidget *widget;
|
|
|
|
class QWidgetAction *widgetAction;
|
|
|
|
class QSpacerItem *spacerItem;
|
|
|
|
|
|
|
|
/* Worker Functions */
|
|
|
|
/* (1) Update Display */
|
|
|
|
|
|
|
|
/* (2) Utility Fns */
|
|
|
|
QTreeWidgetItem *getCurrentPeer();
|
|
|
|
|
|
|
|
/** Define the popup menus for the Context menu */
|
|
|
|
QMenu* contextMnu;
|
|
|
|
/** Defines the actions for the context menu */
|
|
|
|
QAction* chatAct;
|
|
|
|
QAction* msgAct;
|
|
|
|
QAction* connectfriendAct;
|
|
|
|
QAction* profileviewAct;
|
|
|
|
QAction* configurefriendAct;
|
|
|
|
QAction* exportfriendAct;
|
|
|
|
QAction* removefriendAct;
|
|
|
|
|
2010-01-13 16:25:18 -05:00
|
|
|
//QTreeWidget *peertreeWidget;
|
2009-10-04 18:27:42 -04:00
|
|
|
|
|
|
|
IMHistoryKeeper historyKeeper;
|
|
|
|
|
|
|
|
QColor _currentColor;
|
|
|
|
bool _underline;
|
|
|
|
time_t last_status_send_time ;
|
2009-10-04 19:03:25 -04:00
|
|
|
|
|
|
|
QHash<QString, QString> smileys;
|
2009-10-04 18:27:42 -04:00
|
|
|
|
|
|
|
std::map<std::string, PopupChatDialog *> chatDialogs;
|
|
|
|
|
|
|
|
QFont mCurrentFont; /* how the text will come out */
|
|
|
|
|
|
|
|
/** A RshareSettings object used for saving/loading settings */
|
|
|
|
RshareSettings* _settings;
|
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::PeersDialog ui;
|
2009-01-22 20:58:56 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|