~ubuntu-branches/ubuntu/saucy/quassel/saucy-proposed

« back to all changes in this revision

Viewing changes to src/qtui/coreconnectdlg.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-02-17 12:49:50 UTC
  • mto: This revision was merged to the branch mainline in revision 59.
  • Revision ID: james.westby@ubuntu.com-20100217124950-v9hajw5d2xa6fszn
Tags: upstream-0.6~beta1
ImportĀ upstreamĀ versionĀ 0.6~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (C) 2005-09 by the Quassel Project                          *
 
2
 *   Copyright (C) 2009 by the Quassel Project                             *
3
3
 *   devel@quassel-irc.org                                                 *
4
4
 *                                                                         *
5
5
 *   This program is free software; you can redistribute it and/or modify  *
19
19
 ***************************************************************************/
20
20
 
21
21
#ifndef CORECONNECTDLG_H
22
 
#define CORECONNECTDLG_H
23
 
 
24
 
#include <QAbstractSocket>
25
 
 
26
 
#include "types.h"
27
 
 
28
 
#include "ui_coreconnectdlg.h"
29
 
#include "ui_coreaccounteditdlg.h"
30
 
 
31
 
class ClientSyncer;
32
 
class CoreConfigWizard;
 
22
#define CORECONNECTDLG_H_
 
23
 
 
24
#include <QDialog>
 
25
 
 
26
#include "coreaccount.h"
 
27
 
 
28
#include "ui_coreconnectauthdlg.h"
 
29
 
 
30
class CoreAccountSettingsPage;
33
31
 
34
32
class CoreConnectDlg : public QDialog {
35
33
  Q_OBJECT
36
34
 
37
35
public:
38
 
  CoreConnectDlg(bool = false, QWidget *parent = 0);
39
 
  ~CoreConnectDlg();
40
 
 
41
 
// signals:
42
 
//   void newClientSyncer(ClientSyncer *);
43
 
 
44
 
private slots:
45
 
  /*** Phase Null: Accounts ***/
46
 
  void restartPhaseNull();
47
 
 
48
 
  void on_accountList_itemSelectionChanged();
49
 
  void on_autoConnect_clicked(bool);
50
 
 
51
 
  void on_addAccount_clicked();
52
 
  void on_editAccount_clicked();
53
 
  void on_deleteAccount_clicked();
54
 
  void on_useInternalCore_clicked();
55
 
  void on_viewSslCertButton_clicked();
56
 
  void on_ignoreWarningsButton_clicked();
57
 
 
58
 
  void on_accountList_itemDoubleClicked(QListWidgetItem *item);
59
 
  void on_accountButtonBox_accepted();
60
 
 
61
 
  void setAccountWidgetStates();
62
 
 
63
 
  /*** Phase One: Connection ***/
64
 
  void connectToCore();
65
 
 
66
 
  void initPhaseError(const QString &error);
67
 
  void initPhaseWarnings(const QStringList &warnings);
68
 
  void initPhaseMsg(const QString &msg);
69
 
  void initPhaseSocketState(QAbstractSocket::SocketState);
70
 
 
71
 
  /*** Phase Two: Login ***/
72
 
  void startLogin();
73
 
  void doLogin();
74
 
  void doLogin(const QVariantMap &loginData);
75
 
  void loginFailed(const QString &);
76
 
  void startCoreConfig(const QVariantList &backends);
77
 
  void configWizardAccepted();
78
 
  void configWizardRejected();
79
 
  void on_launchCoreConfigWizard_clicked();
80
 
 
81
 
  void setLoginWidgetStates();
82
 
 
83
 
  /*** Phase Three: Sync ***/
84
 
  void startSync();
85
 
  void syncFinished();
86
 
 
87
 
  void coreSessionProgress(quint32, quint32);
88
 
  void coreNetworksProgress(quint32, quint32);
89
 
 
90
 
private:
91
 
  AccountId findFreeAccountId();
92
 
 
93
 
  Ui::CoreConnectDlg ui;
94
 
 
95
 
  AccountId autoConnectAccount;
96
 
  QHash<AccountId, QVariantMap> accounts;
97
 
  AccountId _internalAccountId;
98
 
  QVariantMap accountData;
99
 
  AccountId account;
100
 
 
101
 
  bool doingAutoConnect;
102
 
 
103
 
  QVariantList storageBackends;
104
 
 
105
 
  ClientSyncer *clientSyncer;
106
 
  CoreConfigWizard *wizard;
107
 
};
108
 
 
109
 
 
110
 
// ========================================
111
 
//  CoreAccountEditDlg
112
 
// ========================================
113
 
class CoreAccountEditDlg : public QDialog {
114
 
  Q_OBJECT
115
 
 
116
 
public:
117
 
  CoreAccountEditDlg(AccountId id, const QVariantMap &data, const QStringList &existing = QStringList(), QWidget *parent = 0);
118
 
 
119
 
  QVariantMap accountData();
120
 
 
121
 
private slots:
122
 
  void on_host_textChanged(const QString &);
123
 
  void on_accountName_textChanged(const QString &);
124
 
 
125
 
  void setWidgetStates();
126
 
 
127
 
private:
128
 
  Ui::CoreAccountEditDlg ui;
129
 
 
130
 
  QStringList existing;
131
 
  QVariantMap account;
132
 
};
133
 
 
134
 
// ========================================
135
 
//  SslCertDisplayDialog
136
 
// ========================================
137
 
#ifdef HAVE_SSL
138
 
class QSslCertificate;
139
 
 
140
 
class SslCertDisplayDialog : public QDialog {
141
 
  Q_OBJECT
142
 
 
143
 
public:
144
 
  SslCertDisplayDialog(const QString &host, const QSslCertificate &cert, QWidget *parent = 0);
145
 
};
146
 
#endif // HAVE_SSL
147
 
 
148
 
#endif // CORECONNECTDLG_H
 
36
  CoreConnectDlg(QWidget *parent = 0);
 
37
  AccountId selectedAccount() const;
 
38
 
 
39
  void accept();
 
40
 
 
41
private:
 
42
  CoreAccountSettingsPage *_settingsPage;
 
43
};
 
44
 
 
45
class CoreConnectAuthDlg : public QDialog {
 
46
  Q_OBJECT
 
47
 
 
48
public:
 
49
  CoreConnectAuthDlg(CoreAccount *account, QWidget *parent = 0);
 
50
 
 
51
  void accept();
 
52
 
 
53
private slots:
 
54
  void setButtonStates();
 
55
 
 
56
private:
 
57
  Ui::CoreConnectAuthDlg ui;
 
58
  CoreAccount *_account;
 
59
};
 
60
 
 
61
#endif