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-01-22 20:58:56 -05:00
|
|
|
|
|
|
|
#include "mainpage.h"
|
|
|
|
#include "ui_PeersDialog.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-01-22 20:58:56 -05:00
|
|
|
class PeersDialog : public MainPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
|
|
|
PeersDialog(QWidget *parent = 0);
|
2008-07-10 06:34:49 -04:00
|
|
|
/** Default Destructor */
|
|
|
|
|
2008-12-07 09:19:13 -05:00
|
|
|
PopupChatDialog *getPrivateChat(std::string id, std::string name, uint chatflags);
|
2008-07-10 06:34:49 -04:00
|
|
|
void clearOldChats();
|
|
|
|
|
2009-01-22 20:58:56 -05:00
|
|
|
void loadEmoticonsgroupchat();
|
2007-11-14 22:18:48 -05:00
|
|
|
void setChatDialog(ChatDialog *cd);
|
|
|
|
|
2008-07-10 06:34:49 -04:00
|
|
|
public slots:
|
|
|
|
|
2009-02-22 12:36:39 -05:00
|
|
|
void insertPeers();
|
2008-07-10 06:34:49 -04:00
|
|
|
void toggleSendItem( QTreeWidgetItem *item, int col );
|
|
|
|
|
|
|
|
void insertChat();
|
|
|
|
void setChatInfo(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
|
|
|
|
|
|
|
void smileyWidgetgroupchat();
|
|
|
|
void addSmileys();
|
|
|
|
|
2009-01-22 20:58:56 -05:00
|
|
|
void on_actionClearChat_triggered();
|
|
|
|
void displayInfoChatMenu(const QPoint& pos);
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
/** Create the context popup menu and it's submenus */
|
2007-11-14 22:18:48 -05:00
|
|
|
void peertreeWidgetCostumPopupMenu( QPoint point );
|
|
|
|
|
|
|
|
/** Export friend in Friends Dialog */
|
|
|
|
void exportfriend();
|
|
|
|
/** Remove friend */
|
|
|
|
void removefriend();
|
|
|
|
/** start a chat with a friend **/
|
|
|
|
void chatfriend();
|
|
|
|
void msgfriend();
|
|
|
|
|
2009-01-22 20:58:56 -05:00
|
|
|
void configurefriend();
|
|
|
|
void viewprofile();
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
/** RsServer Friend Calls */
|
|
|
|
void allowfriend();
|
|
|
|
void connectfriend();
|
|
|
|
void setaddressfriend();
|
|
|
|
void trustfriend();
|
2008-07-10 06:34:49 -04:00
|
|
|
|
|
|
|
void setColor();
|
|
|
|
void insertSendList();
|
|
|
|
void checkChat();
|
|
|
|
void sendMsg();
|
|
|
|
|
|
|
|
//void privchat();
|
|
|
|
|
|
|
|
void setFont();
|
|
|
|
void getFont();
|
|
|
|
void underline();
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2009-01-22 20:58:56 -05:00
|
|
|
|
|
|
|
private:
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
/* Worker Functions */
|
|
|
|
/* (1) Update Display */
|
|
|
|
|
|
|
|
/* (2) Utility Fns */
|
|
|
|
QTreeWidgetItem *getCurrentPeer();
|
|
|
|
|
|
|
|
ChatDialog *chatDialog;
|
|
|
|
|
|
|
|
|
2009-01-22 20:58:56 -05:00
|
|
|
/** Define the popup menus for the Context menu */
|
2007-11-14 22:18:48 -05:00
|
|
|
QMenu* contextMnu;
|
2009-01-22 20:58:56 -05:00
|
|
|
/** Defines the actions for the context menu */
|
2007-11-14 22:18:48 -05:00
|
|
|
QAction* chatAct;
|
|
|
|
QAction* msgAct;
|
|
|
|
QAction* connectfriendAct;
|
2009-01-22 20:58:56 -05:00
|
|
|
QAction* profileviewAct;
|
2007-11-14 22:18:48 -05:00
|
|
|
QAction* configurefriendAct;
|
|
|
|
QAction* exportfriendAct;
|
|
|
|
QAction* removefriendAct;
|
|
|
|
|
|
|
|
QTreeWidget *peertreeWidget;
|
2008-07-10 06:34:49 -04:00
|
|
|
|
|
|
|
QColor _currentColor;
|
2009-01-22 20:58:56 -05:00
|
|
|
bool _underline;
|
2008-07-10 06:34:49 -04:00
|
|
|
|
|
|
|
QHash<QString, QString> smileys;
|
|
|
|
|
|
|
|
std::map<std::string, PopupChatDialog *> chatDialogs;
|
|
|
|
|
|
|
|
QFont mCurrentFont; /* how the text will come out */
|
2009-01-22 20:58:56 -05:00
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::PeersDialog ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|