2016-09-15 07:07:13 -04:00
|
|
|
/*
|
|
|
|
* RetroShare Android QML App
|
|
|
|
* Copyright (C) 2016 Gioacchino Mazzurco <gio@eigenlab.org>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-09-04 09:01:44 -04:00
|
|
|
|
|
|
|
import QtQuick 2.2
|
2016-10-26 14:37:28 -04:00
|
|
|
import QtQuick.Controls 1.4
|
2016-09-15 07:07:13 -04:00
|
|
|
import org.retroshare.qml_components.LibresapiLocalClient 1.0
|
|
|
|
|
|
|
|
ApplicationWindow
|
|
|
|
{
|
|
|
|
id: mainWindow
|
|
|
|
visible: true
|
|
|
|
title: qsTr("RSChat")
|
2016-10-26 14:37:28 -04:00
|
|
|
width: 400
|
|
|
|
height: 400
|
2016-09-15 07:07:13 -04:00
|
|
|
|
2016-12-08 09:56:23 -05:00
|
|
|
property string activeChatId;
|
|
|
|
|
2016-09-15 07:07:13 -04:00
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
id: mainView
|
2016-10-26 14:37:28 -04:00
|
|
|
anchors.fill: parent
|
2016-09-15 07:07:13 -04:00
|
|
|
states:
|
|
|
|
[
|
2016-10-26 14:37:28 -04:00
|
|
|
State
|
|
|
|
{
|
|
|
|
name: "waiting_account_select"
|
|
|
|
PropertyChanges { target: swipeView; currentIndex: 0 }
|
|
|
|
PropertyChanges { target: locationsTab; enabled: true }
|
|
|
|
},
|
|
|
|
State
|
|
|
|
{
|
|
|
|
name: "running_ok"
|
|
|
|
PropertyChanges { target: swipeView; currentIndex: 1 }
|
|
|
|
PropertyChanges { target: locationsTab; enabled: false }
|
|
|
|
},
|
|
|
|
State
|
|
|
|
{
|
|
|
|
name: "running_ok_no_full_control"
|
|
|
|
PropertyChanges { target: swipeView; currentIndex: 1 }
|
|
|
|
PropertyChanges { target: locationsTab; enabled: false }
|
|
|
|
}
|
|
|
|
]
|
2016-09-15 07:07:13 -04:00
|
|
|
|
|
|
|
LibresapiLocalClient
|
|
|
|
{
|
|
|
|
onGoodResponseReceived:
|
|
|
|
{
|
|
|
|
var jsonReponse = JSON.parse(msg)
|
|
|
|
mainView.state = jsonReponse.data.runstate
|
|
|
|
}
|
|
|
|
Component.onCompleted:
|
|
|
|
{
|
|
|
|
openConnection(apiSocketPath)
|
|
|
|
request("/control/runstate/", "")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-26 14:37:28 -04:00
|
|
|
TabView
|
2016-09-15 07:07:13 -04:00
|
|
|
{
|
|
|
|
id: swipeView
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: true
|
2016-09-16 06:04:49 -04:00
|
|
|
currentIndex: 0
|
2016-09-15 07:07:13 -04:00
|
|
|
|
2016-10-26 14:37:28 -04:00
|
|
|
Tab
|
2016-09-15 07:07:13 -04:00
|
|
|
{
|
2016-10-26 14:37:28 -04:00
|
|
|
title:"Locations"
|
|
|
|
id: locationsTab
|
|
|
|
Locations { onVisibleChanged: focus = visible }
|
2016-09-15 07:07:13 -04:00
|
|
|
}
|
|
|
|
|
2016-10-26 14:37:28 -04:00
|
|
|
Tab
|
2016-09-16 06:04:49 -04:00
|
|
|
{
|
2016-10-26 14:37:28 -04:00
|
|
|
title: "Trusted Nodes"
|
|
|
|
TrustedNodesView { onVisibleChanged: focus = visible }
|
2016-09-16 06:04:49 -04:00
|
|
|
}
|
|
|
|
|
2016-10-26 14:37:28 -04:00
|
|
|
Tab
|
2016-09-16 06:04:49 -04:00
|
|
|
{
|
2016-10-26 14:37:28 -04:00
|
|
|
title: "Contacts"
|
|
|
|
Contacts { onVisibleChanged: focus = visible }
|
2016-09-16 06:04:49 -04:00
|
|
|
}
|
|
|
|
|
2016-10-26 14:37:28 -04:00
|
|
|
Tab
|
2016-09-16 06:04:49 -04:00
|
|
|
{
|
2016-10-26 14:37:28 -04:00
|
|
|
title: "Add Node"
|
|
|
|
AddTrustedNode { onVisibleChanged: focus = visible }
|
2016-09-16 06:04:49 -04:00
|
|
|
}
|
|
|
|
|
2016-10-26 14:37:28 -04:00
|
|
|
Tab
|
2016-09-15 07:07:13 -04:00
|
|
|
{
|
2016-12-08 09:56:23 -05:00
|
|
|
title: "Chat"
|
|
|
|
ChatView
|
|
|
|
{
|
|
|
|
id: chatView
|
|
|
|
chatId: mainWindow.activeChatId
|
|
|
|
onVisibleChanged: focus = visible
|
|
|
|
}
|
2016-09-27 08:05:14 -04:00
|
|
|
}
|
2016-09-15 07:07:13 -04:00
|
|
|
}
|
|
|
|
}
|
2016-09-04 09:01:44 -04:00
|
|
|
}
|