Commit 7765aaff authored by Dennis Beier's avatar Dennis Beier
Browse files

login page now shows description and urlogin page now shows description and urll

parent 01478114
......@@ -106,6 +106,16 @@ QHash<int, QByteArray> ServerChoiceModel::roleNames() const
return roles;
}
QString ServerChoiceModel::getCurrentServerDesc() const
{
return currentServerDesc;
}
void ServerChoiceModel::setCurrentServerDesc(const QString &value)
{
currentServerDesc = value;
}
QString ServerChoiceModel::getCurrentServer() const
{
return currentServer;
......
......@@ -37,6 +37,7 @@ class ServerChoiceModel : public QAbstractListModel
QSqlDatabase mDb = QSqlDatabase::addDatabase( "QSQLITE" ,"serverConnection");
public:
Q_PROPERTY(QString currentServer READ getCurrentServer WRITE setCurrentServer NOTIFY currentServerChanged)
Q_PROPERTY(QString currentServerDesc READ getCurrentServerDesc WRITE setCurrentServerDesc )
ServerChoiceModel(void);
QList<ServerChoice> getServerList(void) const;
Q_INVOKABLE void addDomain(QString,QString);
......@@ -45,11 +46,15 @@ public:
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
QString getCurrentServer() const;
void setCurrentServer(const QString &value);
QString getCurrentServerDesc() const;
void setCurrentServerDesc(const QString &value);
signals:
void currentServerChanged(void);
protected:
QHash<int, QByteArray> roleNames() const;
QString currentServer;
QString currentServerDesc;
};
#endif // SERVERCHOICEMODEL_H
......@@ -16,10 +16,12 @@ Item {
Settings{
id:currentServerSetting
property alias currentServerChoice: currentServer.text
property alias currentServerChoiceDesc: currentServerdesc.text
Component.onCompleted: {
var current =serverChoices.currentServer;
if(serverChoices.currentServer){
currentServerChoice = serverChoices.currentServer;
currentServerChoiceDesc = serverChoices.currentServerDesc;
mainStack.mainViewPushed = false
}
rocketChatController.newServerByDomain(currentServerChoice)
......@@ -35,6 +37,7 @@ Item {
var current =serverChoices.currentServer;
if(serverChoices.currentServer){
currentServerSetting.currentServerChoice = serverChoices.currentServer;
currentServerSetting.currentServerChoiceDesc = serverChoices.currentServerDesc;
rocketChatController.newServerByDomain(currentServerSetting.currentServerChoice)
mainStack.mainViewPushed = false
serverChoices.currentServer = ""
......@@ -73,22 +76,31 @@ Item {
width: 340
height: 500
Rectangle {
height: 28
height: childrenRect.height
anchors.left: parent.left
anchors.right: parent.right
color :"transparent"
Text {
id: currentServerdesc
text: "Default Server"
anchors.left: parent.left
color: Colors.white
font.pointSize: Fonts.largeFontSize
}
Text {
anchors.top: currentServerdesc.bottom
id: currentServer
text: "chat.fairkom.net"
anchors.left: parent.left
color: Colors.white
font.pointSize: Fonts.largeFontSize
font.pointSize: Fonts.smallFontSize
}
Button{
anchors.right: parent.right
width: 28
height: 28
flat: true
anchors.verticalCenter: parent.verticalCenter
StdImageHighDPI {
anchors.fill: parent
source: "qrc:/res/buttons/navigation/tabbar-settings.svg"
......
......@@ -12,6 +12,47 @@ Page {
DeleteEntry{
id:deletePopup
}
header: ToolBar {
id: topToolbar
property string color: Colors.primary
height: 50
anchors.left: parent.left
anchors.right: parent.right
background: Rectangle {
color: topToolbar.color
Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: Colors.separatorGrey
}
}
Row {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
spacing: 9
Backbutton {
id: backbutton
anchors.verticalCenter: parent.verticalCenter
onClicked: {
mainStack.pop()
}
}
Text {
anchors.top: parent.top
anchors.bottom: parent.bottom
text: qsTr("Server Choice")
font.bold: false
font.family: Fonts.opensans.name
color: Colors.white
verticalAlignment: Text.AlignVCenter
}
}
}
ListView {
anchors.bottom: addServerButton.top
......@@ -30,7 +71,8 @@ Page {
anchors.left: parent.left
anchors.right: parent.right
onClicked:{
serverChoices.currentServer = model.domain;
serverChoices.currentServer = model.domain;
serverChoices.currentServerDesc = model.description;
mainStack.pop();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment