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
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
|
|
|
#include "mainpage.h"
|
2007-11-16 20:35:52 -05:00
|
|
|
#include "ui_MessengerWindow.h"
|
|
|
|
#include "NetworkDialog.h"
|
2009-01-03 21:28:30 -05:00
|
|
|
#include <gui/Preferences/rsharesettings.h>
|
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;
|
2009-01-07 16:12:31 -05:00
|
|
|
//class MainWindow;
|
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
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
2009-01-07 16:12:31 -05:00
|
|
|
MessengerWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
|
2009-01-03 21:28:30 -05:00
|
|
|
/** Default Destructor */
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2008-07-10 14:52:56 -04:00
|
|
|
void setChatDialog(PeersDialog *cd);
|
2007-11-16 20:35:52 -05:00
|
|
|
|
|
|
|
NetworkDialog *networkDialog2;
|
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
QPixmap picture;
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
public slots:
|
2009-02-22 12:36:39 -05:00
|
|
|
void insertPeers();
|
2009-01-03 21:28:30 -05:00
|
|
|
/** Called when this dialog is to be displayed */
|
2007-11-14 22:18:48 -05:00
|
|
|
void show();
|
|
|
|
|
|
|
|
LogoBar & getLogoBar() const;
|
|
|
|
|
|
|
|
protected:
|
2009-01-03 21:28:30 -05:00
|
|
|
void closeEvent (QCloseEvent * event);
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
/** Create the context popup menu and it's submenus */
|
2007-11-14 22:18:48 -05:00
|
|
|
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();
|
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
void addFriend2();
|
|
|
|
|
2009-01-30 18:51:59 -05:00
|
|
|
void getAvatar();
|
2009-01-07 16:12:31 -05:00
|
|
|
|
2009-01-08 12:29:01 -05:00
|
|
|
void openShareManager();
|
|
|
|
|
|
|
|
void showMessagesPopup();
|
|
|
|
|
2009-01-07 16:12:31 -05:00
|
|
|
//void showMessages(MainWindow::Page page = MainWindow::Messages);
|
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
/** RsServer Friend Calls */
|
|
|
|
void allowfriend2();
|
|
|
|
void connectfriend2();
|
|
|
|
void setaddressfriend2();
|
|
|
|
void trustfriend2();
|
|
|
|
|
|
|
|
void changeAvatarClicked();
|
|
|
|
void updateAvatar();
|
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
|
|
|
|
private:
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
/* 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
|
|
|
|
2009-01-07 16:12:31 -05:00
|
|
|
//MainWindow* mainWindow;
|
|
|
|
|
|
|
|
|
2009-01-03 21:28:30 -05:00
|
|
|
/** Define the popup menus for the Context menu */
|
2007-11-14 22:18:48 -05:00
|
|
|
QMenu* contextMnu;
|
2009-01-03 21:28:30 -05:00
|
|
|
/** Defines the actions for the context menu */
|
2007-11-14 22:18:48 -05:00
|
|
|
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;
|
2009-09-30 18:10:49 -04:00
|
|
|
|
|
|
|
QFont itemFont;
|
2009-01-03 21:28:30 -05:00
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::MessengerWindow ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|