MainView.qml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import QtQuick 2.0
  2. import QtQuick.Controls 1.4
  3. import QtQuick.Dialogs 1.2
  4. import org.semlanik.nicegit 1.0
  5. Item {
  6. Row {
  7. id: selector
  8. Text {
  9. text: "Active repository" + repoOpenDialog.fileUrl
  10. }
  11. Button {
  12. text: "Choose..."
  13. onClicked: repoOpenDialog.open()
  14. }
  15. }
  16. Column {
  17. anchors.top: selector.bottom
  18. Repeater {
  19. model: _handler.repositories
  20. Text {
  21. text: model.name
  22. }
  23. }
  24. }
  25. ListView {
  26. height: 200
  27. width: 100
  28. anchors.right: parent.right
  29. model: _handler.modelByHead("master")
  30. delegate: Rectangle {
  31. color: "#cccccc"
  32. width: 200
  33. height: 100
  34. Text {
  35. anchors.centerIn: parent
  36. text: model.sha1
  37. }
  38. }
  39. }
  40. FileDialog {
  41. id: repoOpenDialog
  42. folder: "."
  43. selectFolder: true
  44. selectMultiple: false
  45. onAccepted: {
  46. _handler.open(repoOpenDialog.fileUrl)
  47. }
  48. }
  49. }