Add settings panel for homeserver's domain
This commit is contained in:
parent
0834b246ad
commit
1f10403ace
7 changed files with 175 additions and 13 deletions
|
|
@ -26,7 +26,9 @@
|
|||
|
||||
#include "FlatButton.h"
|
||||
#include "InputValidator.h"
|
||||
#include "LoginSettings.h"
|
||||
#include "MatrixClient.h"
|
||||
#include "OverlayModal.h"
|
||||
#include "RaisedButton.h"
|
||||
#include "TextField.h"
|
||||
|
||||
|
|
@ -53,10 +55,14 @@ private slots:
|
|||
// Displays errors produced during the login.
|
||||
void loginError(QString error_message);
|
||||
|
||||
// Manipulate settings modal.
|
||||
void showSettingsModal();
|
||||
void closeSettingsModal(const QString &server);
|
||||
|
||||
private:
|
||||
QVBoxLayout *top_layout_;
|
||||
|
||||
QHBoxLayout *back_layout_;
|
||||
QHBoxLayout *top_bar_layout_;
|
||||
QHBoxLayout *logo_layout_;
|
||||
QHBoxLayout *button_layout_;
|
||||
|
||||
|
|
@ -64,6 +70,7 @@ private:
|
|||
QLabel *error_label_;
|
||||
|
||||
FlatButton *back_button_;
|
||||
FlatButton *advanced_settings_button_;
|
||||
RaisedButton *login_button_;
|
||||
|
||||
QWidget *form_widget_;
|
||||
|
|
@ -73,6 +80,10 @@ private:
|
|||
TextField *matrixid_input_;
|
||||
TextField *password_input_;
|
||||
|
||||
OverlayModal *settings_modal_;
|
||||
LoginSettings *login_settings_;
|
||||
QString custom_domain_;
|
||||
|
||||
InputValidator *matrix_id_validator_;
|
||||
|
||||
// Matrix client API provider.
|
||||
|
|
|
|||
40
include/LoginSettings.h
Normal file
40
include/LoginSettings.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOGIN_SETTINGS_H
|
||||
#define LOGIN_SETTINGS_H
|
||||
|
||||
#include <QFrame>
|
||||
|
||||
#include "FlatButton.h"
|
||||
#include "TextField.h"
|
||||
|
||||
class LoginSettings : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LoginSettings(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void closing(const QString &server);
|
||||
|
||||
private:
|
||||
TextField *input_;
|
||||
FlatButton *submit_button_;
|
||||
};
|
||||
|
||||
#endif // LOGIN_SETTINGS_H
|
||||
|
|
@ -50,6 +50,7 @@ private:
|
|||
inline void OverlayModal::setDuration(int duration)
|
||||
{
|
||||
duration_ = duration;
|
||||
animation_->setDuration(duration_);
|
||||
}
|
||||
|
||||
inline void OverlayModal::setColor(QColor color)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue