#ifndef CONNECTDIALOG_H
#define CONNECTDIALOG_H

#include <QDialog>

class QPushButton;
class ChatServer;
class ChatClient;

namespace Ui
{
	class ConnectDialog;
}

class ConnectDialog : public QDialog
{
	Q_OBJECT

  private:
	Ui::ConnectDialog *ui;
	QPushButton* buttonConnect;
	ChatServer* chatServer;
	ChatClient* chatClient;

  public:
	explicit ConnectDialog(QWidget *parent = 0);
	virtual ~ConnectDialog();
	QString getUserNickname() const;

  protected slots:
	void tryEnableConnectButton();
	void serverModeSelected();
	void clientModeSelected();
	void buttonConnectPressed();

  protected:
	bool canEnableConnectButton() const;
	bool connectAsServer();
	bool connectAsClient();
};

#endif // CONNECTDIALOG_H
