123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- import QtQuick 2.0
- import QtQuick.Dialogs 1.2
- import QtQuick.Controls 1.4
- import QtQuick.Controls.Styles 1.4
- import "popups"
- Item {
- id: root
- anchors.right: parent.right
- anchors.left: parent.left
- height: childrenRect.height
- signal closeClicked()
- property alias closeVisible: closeControl.visible
- Row {
- anchors.left: parent.left
- anchors.leftMargin: 10
- spacing: 10
- height: 40
- Text {
- font.weight: Font.Bold
- anchors.verticalCenter: parent.verticalCenter
- text: qsTr("Active projects") + ":"
- }
- ComboBox {
- id: repositories
- anchors.verticalCenter: parent.verticalCenter
- width: 400
- model: _handler.repositories
- textRole: "name"
- onActivated: {
- _handler.activateRepository(index)
- }
- currentIndex: _handler.repositories.activeRepositoryIndex
- style: ComboBoxStyle {
- font.weight:Font.Bold
- }
- }
- Separator {
- anchors.verticalCenter: parent.verticalCenter
- }
- Button {
- anchors.verticalCenter: parent.verticalCenter
- text: qsTr("Add...")
- onClicked: {
- console.log("repoOpenDialog.folder: " + repoOpenDialog.folder)
- repoOpenDialog.open()
- }
- }
- Button {
- anchors.verticalCenter: parent.verticalCenter
- text: qsTr("Pull")
- onClicked: {
- pullDialog.open()
- }
- }
- }
- Row {
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.topMargin: 10
- anchors.rightMargin: 10
- spacing: 10
- Button {
- id: closeControl
- style: ButtonStyle {
- background: Image {
- source: control.pressed ? "qrc:///images/x-mark-3-24_active.png" : "qrc:///images/x-mark-3-24.png"
- }
- }
- onClicked: {
- root.closeClicked()
- }
- }
- Button {
- id: help
- style: ButtonStyle {
- background: Image {
- source: control.pressed ? "qrc:///images/question-mark-4-24_active.png" : "qrc:///images/question-mark-4-24.png"
- }
- }
- onClicked: {
- helpDialog.open()
- }
- }
- }
- FileDialog {
- id: repoOpenDialog
- folder: _handler.homePath
- selectFolder: true
- selectMultiple: false
- onAccepted: {
- _handler.open(repoOpenDialog.fileUrl, true)
- }
- }
- Dialog {
- id: helpDialog
- title: qsTr("About")
- modality: Qt.NonModal
- contentItem: Item {
- implicitWidth: 400
- implicitHeight: 200
- Text {
- anchors.left: parent.left
- anchors.leftMargin: 8
- anchors.right: parent.right
- anchors.rightMargin: 8
- anchors.horizontalCenter: parent
- wrapMode: Text.WordWrap
- font.pointSize: 12
- textFormat: Text.RichText
- text:"<p><b>CuteGit</b> is free opensource software. You're free to use and modify it in terms of GPLv3 license.<br/>" +
- "You can support project by contributing your ideas and code to CuteGit repository.</p>" +
- "<p><b>Author:</b> Alexey Edelev aka semlanik</p>"
- }
- }
- }
- PullStrategy {
- id: pullDialog
- onAccepted: {
- _handler.pull(pullDialog.strategy)
- }
- }
- }
|