File indexing completed on 2024-05-05 05:40:58

0001 #ifndef SELECTCONNECTIONPROFILEDIALOG_H
0002 #define SELECTCONNECTIONPROFILEDIALOG_H
0003 
0004 #include "customs/filedirchooser.h"
0005 #include "data/player.h"
0006 #include "network/connectionprofile.h"
0007 
0008 #include "rwidgets_global.h"
0009 #include <QAbstractItemModel>
0010 #include <QDialog>
0011 #include <QDir>
0012 #include <QPointer>
0013 #include <QSettings>
0014 #include <memory>
0015 
0016 #include "network/characterdatamodel.h"
0017 
0018 namespace Ui
0019 {
0020 class SelectConnectionProfileDialog;
0021 }
0022 
0023 class GameController;
0024 class ProfileModel;
0025 class SelectConnProfileController;
0026 /**
0027  * @brief The SelectConnectionProfileDialog class is the dialog box shown at starting or when the connection is lost.
0028  */
0029 class RWIDGET_EXPORT SelectConnectionProfileDialog : public QDialog
0030 {
0031     Q_OBJECT
0032 public:
0033     explicit SelectConnectionProfileDialog(GameController* ctrl, QWidget* parent= nullptr);
0034     virtual ~SelectConnectionProfileDialog();
0035     void setArgumentProfile(QString host, int port, QByteArray password);
0036 
0037 public slots:
0038     QByteArray openImage(const QString& path= QDir::homePath());
0039 
0040 private:
0041     Ui::SelectConnectionProfileDialog* ui;
0042     QPointer<GameController> m_gameCtrl;
0043     std::unique_ptr<SelectConnProfileController> m_ctrl;
0044 
0045     QString m_avatarUri;
0046     int m_currentProfileIndex= -1;
0047     bool m_passChanged= false;
0048 };
0049 
0050 #endif // SELECTCONNECTIONPROFILEDIALOG_H