summaryrefslogblamecommitdiffstats
path: root/src/pvsgui.h
blob: f9a0ab882deb40f0a5b2914642423bc5d4c49668 (plain) (tree)






































































































                                                                            
/*
 # Copyright (c) 2009, 2010 - OpenSLX Project, Computer Center University of
 # Freiburg
 #
 # This program is free software distributed under the GPL version 2.
 # See http://openslx.org/COPYING
 #
 # If you have any feedback please consult http://openslx.org/feedback and
 # send your suggestions, praise, or complaints to feedback@openslx.org
 #
 # General information about OpenSLX can be found at http://openslx.org/
 */

#ifndef PVSCLIENTGUI_H_
#define PVSCLIENTGUI_H_

#include <QtGui>
#include <QtNetwork>
#include "ui_clientToolbar.h"
#include "src/gui/clientConfigDialog.h"
#include "src/gui/clientChatDialog.h"
#include "src/gui/clientFileSendDialog.h"
#include "src/gui/clientFileReceiveDialog.h"
#include "src/gui/clientVNCViewer.h"
#include "src/gui/clientInfoDialog.h"
#include "src/gui/aboutDialog.h"

#include "pvsinterface.h"

class PVSGUI: public QWidget, private Ui_ClientToolbarClass
{
    Q_OBJECT
    Q_CLASSINFO("D-Bus Interface", "org.openslx.pvsgui")

public:
    PVSGUI(QWidget *parent = 0);
    ~PVSGUI();

    int const static POSITION_TOP_LEFT = 0;
    int const static POSITION_TOP_CENTER = 1;
    int const static POSITION_TOP_RIGHT = 2;
    int const static POSITION_BOTTOM_LEFT = 3;
    int const static POSITION_BOTTOM_CENTER = 4;
    int const static POSITION_BOTTOM_RIGHT = 5;

public Q_SLOTS:
    void updateConfig();

protected:
    void enterEvent(QEvent *e);
    void leaveEvent(QEvent *e);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);

private Q_SLOTS:
    void showMessage(QString title, QString msg, bool useDialog = false);
    void hide();
    void connected(QString host);
    void disconnected();
    void addHost(QString host);
    void delHost(QString host);
    void pvsConnect(QAction *action);
    void pvsDisconnect();
    void setVncAllow(int i);
    void sendFile();
    void receiveFile();

private:
    void setupMenu();
    void setLocation(int location);
    void hide(bool b);

    QMenu *_menu;
    QMenu *_hostMenu;
    QHash<QString, QAction*> *_hosts;
    QSettings _settings;
    QSystemTrayIcon *_trayIcon;
    ClientChatDialog *_chatDialog;
    ClientConfigDialog *_configDialog;
    ClientInfoDialog *_infoDialog;
    ClientVNCViewer *_vncViewer;
    AboutDialog *_aboutDialog;

    QAction *_disconnectAction;
    QAction *_startChatAction;
    QAction *_sendFileAction;
    QAction *_configAction;
    QAction *_showInfoAction;
    QAction *_aboutAction;
    QAction *_quitAction;

    int _location;
    QPoint _clickPoint;
    QString _passwd;

    QTcpServer *_serverSocket;

    OrgOpenslxPvsInterface *_ifaceDBus;

};

#endif /* PVSCLIENTGUI_H_ */