Doomseeker
   
  • Doomseeker
  • Wadseeker
  • Download
  • Tracker
  • Git
  • Docs
  • Main Page
  • Classes
  • Files
  • File List
  • File Members

src/core/connectionhandler.h

00001 //------------------------------------------------------------------------------
00002 // connectionhandler.h
00003 //------------------------------------------------------------------------------
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018 // 02110-1301, USA.
00019 //
00020 //------------------------------------------------------------------------------
00021 // Copyright (C) 2012 Braden Obrzut <admin@maniacsvault.net>
00022 //                    "Zalewa" <zalewapl@gmail.com>
00023 //------------------------------------------------------------------------------ 
00024 
00025 #ifndef __CONNECTIONHANDLER_H__
00026 #define __CONNECTIONHANDLER_H__
00027 
00028 #include <QObject>
00029 
00030 class CommandLineInfo;
00031 class Server;
00032 class QUrl;
00033 class QWidget;
00034 
00035 class ConnectionHandler : public QObject
00036 {
00037         Q_OBJECT
00038 
00039         public:
00040                 ConnectionHandler(Server *server, QWidget *parent=NULL, bool handleResponse=false);
00041 
00042                 void    run();
00043 
00044                 static bool checkWadseekerValidity(QWidget *parent=NULL);
00045                 static ConnectionHandler *connectByUrl(const QUrl &url);
00057                 static bool obtainJoinCommandLine(QWidget *parent, const Server* server, CommandLineInfo& cli, const QString& errorCaption, bool managedDemo, bool *hadMissing=NULL);
00058 
00059         protected:
00060                 void    finish(int response);
00061                 void    refreshToJoin();
00062 
00063         protected slots:
00064                 void    checkResponse(Server *server, int response);
00065 
00066         signals:
00067                 void    finished(int response);
00068 
00069         private:
00070                 bool    handleResponse;
00071                 Server  *server;
00072                 QWidget *parent;
00073 };
00074 
00075 #endif
   
Doomseeker © 2009-2024 The Doomseeker Team