Mudlet  0
Mudclient
dlgConnectionProfiles.h
Go to the documentation of this file.
1 #ifndef MUDLET_DLGCONNECTIONPROFILES_H
2 #define MUDLET_DLGCONNECTIONPROFILES_H
3 
4 /***************************************************************************
5  * Copyright (C) 2008-2011 by Heiko Koehn - KoehnHeiko@googlemail.com *
6  * Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
7  * Copyright (C) 2016 by Stephen Lyons - slysven@virginmedia.com *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License *
20  * along with this program; if not, write to the *
21  * Free Software Foundation, Inc., *
22  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
23  ***************************************************************************/
24 
25 #include "pre_guard.h"
26 #include "ui_connection_profiles.h"
27 #include "post_guard.h"
28 
29 class dlgConnectionProfiles : public QDialog, public Ui::connection_profiles
30 {
31  Q_OBJECT
32 
33 public:
34  Q_DISABLE_COPY(dlgConnectionProfiles)
35  dlgConnectionProfiles(QWidget* parent = nullptr);
36  void fillout_form();
37  QPair<bool, QString> writeProfileData(const QString& profile, const QString& item, const QString& what);
38  QString readProfileData(const QString& profile, const QString& item);
39  void accept() override;
40 
41 signals:
42  void signal_establish_connection(QString profile_name, int historyVersion);
43 
44 public slots:
46  void slot_save_name();
47  void slot_update_url(const QString &);
49  void slot_update_login(const QString &);
50  void slot_update_pass(const QString &);
51  void slot_update_website(const QString &);
54 
55  void slot_item_clicked(QListWidgetItem*);
56  void slot_addProfile();
57  void slot_deleteProfile();
59 
60  void slot_update_autologin(int state);
61  void slot_update_discord_optin(int state);
62  void slot_connectToServer();
63  void slot_cancel();
64  void slot_copy_profile();
65 
66 private:
67  void copyFolder(QString sourceFolder, QString destFolder);
68  QString getDescription(const QString& hostUrl, quint16 port, const QString& profile_name);
69  bool validateConnect();
70  void updateDiscordStatus();
71 
72  bool validName;
73  bool validUrl;
74  bool validPort;
75 
76  QStringList mProfileList;
77  QPalette mRegularPalette;
78  QPalette mOKPalette;
79  QPalette mErrorPalette;
80  QPalette mReadOnlyPalette;
85 };
86 
87 #endif // MUDLET_DLGCONNECTIONPROFILES_H
void slot_update_discord_optin(int state)
QPair< bool, QString > writeProfileData(const QString &profile, const QString &item, const QString &what)
QString getDescription(const QString &hostUrl, quint16 port, const QString &profile_name)
QString readProfileData(const QString &profile, const QString &item)
void slot_update_autologin(int state)
void copyFolder(QString sourceFolder, QString destFolder)
void signal_establish_connection(QString profile_name, int historyVersion)
void slot_update_url(const QString &)
void slot_item_clicked(QListWidgetItem *)
void slot_update_website(const QString &)
void slot_update_login(const QString &)
dlgConnectionProfiles(QWidget *parent=nullptr)
void slot_update_pass(const QString &)