Support new QtInfoMsg message type
[quassel.git] / src / qtui / simplenetworkeditor.h
1 /***************************************************************************
2  *   Copyright (C) 2005-2015 by the Quassel Project                        *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) version 3.                                           *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
19  ***************************************************************************/
20
21 #ifndef SIMPLENETWORKEDITOR_H
22 #define SIMPLENETWORKEDITOR_H
23
24 #include "ui_simplenetworkeditor.h"
25
26 #include "network.h"
27
28 class SimpleNetworkEditor : public QWidget
29 {
30     Q_OBJECT
31
32 public:
33     SimpleNetworkEditor(QWidget *parent = 0);
34
35     void displayNetworkInfo(const NetworkInfo &networkInfo);
36     void saveToNetworkInfo(NetworkInfo &networkInfo);
37
38     QStringList defaultChannels() const;
39     void setDefaultChannels(const QStringList &channels);
40
41 signals:
42     void widgetHasChanged();
43
44 private slots:
45     // code duplication from settingspages/networkssettingspage.{h|cpp}
46     void on_serverList_itemSelectionChanged();
47     void on_addServer_clicked();
48     void on_deleteServer_clicked();
49     void on_editServer_clicked();
50     void on_upServer_clicked();
51     void on_downServer_clicked();
52
53     void setWidgetStates();
54
55 private:
56     Ui::SimpleNetworkEditor ui;
57
58     NetworkInfo _networkInfo;
59 };
60
61
62 #endif //SIMPLENETWORKEDITOR_H