1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
/***************************************************************************
* Copyright (C) 2004 by Daniel Rocher *
* daniel.rocher@adella.org *
* *
* 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 St, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef MAIN_WINDOWS_H
#define MAIN_WINDOWS_H
#include <QSslSocket>
#include "login_windows.h"
#include "configure_windows.h"
#include "mainwindows.h"
extern bool autoconnect;
class main_windows : public MainWindows {
Q_OBJECT
public:
main_windows(QWidget *parent=0);
virtual ~main_windows();
private slots: // Private slots
virtual void slot_timer();
virtual void on_pushButton_connect_clicked();
virtual void sendMessage(const QString & machine,const QString & message);
virtual void disconnectUser(const QString & pid,const QString & user);
virtual void on_configureAction_triggered();
void socketConnected();
void socketClosed();
void core();
void error(QAbstractSocket::SocketError);
void SslErrors (const QList<QSslError> &);
void errorAuth();
private: // Private attributes
QStringList ListSmbstatus;
QSslSocket sslSocket;
QAction * connect_action;
/**
These enums describe connection state.
\sa setWidgetState socketState
*/
enum socket_state {UnconnectedState,ConnectingState,ConnectedState};
/**
These enums describe protocol between %server and client.
\sa core_syntax
*/
enum command {auth_rq,auth_ack,end,kill_user,send_msg,smb_rq,smb_data,end_smb_rq,whoiam,
server_info,error_auth,error_command,error_obj,echo_request,echo_reply};
protected:
virtual void closeEvent(QCloseEvent *e);
private: // Private methods
void infoserver(const QString & text);
void setWidgetState();
void Disconnect();
void sendToServer(int cmd,const QString & inputArg1="",const QString & inputArg2="");
short unsigned int socketState();
void writeHistoryFile();
void readHistoryFile();
void comboBox_valid();
void open_dialog_for_login();
};
#endif
|