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.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#ifndef _MESSENGERWINDOW_H
|
|
|
|
#define _MESSENGERWINDOW_H
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
|
|
|
#include "mainpage.h"
|
2007-11-16 20:35:52 -05:00
|
|
|
#include "ui_MessengerWindow.h"
|
|
|
|
#include "NetworkDialog.h"
|
2008-08-20 18:32:41 -04:00
|
|
|
#include <gui/Preferences/rsharesettings.h>
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
class LogoBar;
|
2008-07-10 14:52:56 -04:00
|
|
|
class PeersDialog;
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2008-10-23 12:17:29 -04:00
|
|
|
class MessengerWindow : public QMainWindow
|
2007-11-14 22:18:48 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
|
|
|
MessengerWindow(QWidget *parent = 0);
|
|
|
|
/** Default Destructor */
|
|
|
|
|
|
|
|
void insertPeers();
|
2008-07-10 14:52:56 -04:00
|
|
|
void setChatDialog(PeersDialog *cd);
|
2007-11-16 20:35:52 -05:00
|
|
|
|
|
|
|
NetworkDialog *networkDialog2;
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
/** Called when this dialog is to be displayed */
|
|
|
|
void show();
|
|
|
|
|
|
|
|
LogoBar & getLogoBar() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void closeEvent (QCloseEvent * event);
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
/** Create the context popup menu and it's submenus */
|
|
|
|
void messengertreeWidgetCostumPopupMenu( QPoint point );
|
|
|
|
|
|
|
|
/** Export friend in Friends Dialog */
|
|
|
|
void exportfriend2();
|
|
|
|
/** Remove friend */
|
|
|
|
void removefriend2();
|
|
|
|
/** start a chat with a friend **/
|
|
|
|
void chatfriend2();
|
|
|
|
|
|
|
|
void sendMessage();
|
|
|
|
|
2007-11-16 20:35:52 -05:00
|
|
|
void configurefriend2();
|
|
|
|
|
|
|
|
void addFriend2();
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
/** RsServer Friend Calls */
|
|
|
|
void allowfriend2();
|
|
|
|
void connectfriend2();
|
|
|
|
void setaddressfriend2();
|
|
|
|
void trustfriend2();
|
|
|
|
|
|
|
|
void changeAvatarClicked();
|
|
|
|
void updateAvatar();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
/* Worker Functions */
|
|
|
|
/* (1) Update Display */
|
|
|
|
|
|
|
|
/* (2) Utility Fns */
|
|
|
|
QTreeWidgetItem *getCurrentPeer(bool &isOnline);
|
|
|
|
|
2008-07-10 14:52:56 -04:00
|
|
|
PeersDialog *chatDialog;
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
/** Define the popup menus for the Context menu */
|
|
|
|
QMenu* contextMnu;
|
|
|
|
/** Defines the actions for the context menu */
|
|
|
|
QAction* chatAct;
|
|
|
|
QAction* sendMessageAct;
|
|
|
|
QAction* connectfriendAct;
|
|
|
|
QAction* configurefriendAct;
|
|
|
|
QAction* exportfriendAct;
|
2007-11-16 20:35:52 -05:00
|
|
|
QAction* removefriend2Act;
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
QTreeView *messengertreeWidget;
|
|
|
|
|
|
|
|
LogoBar * _rsLogoBarmessenger;
|
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::MessengerWindow ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|