Cleanup
This commit is contained in:
parent
17f49370bf
commit
da41f0c515
|
@ -4,3 +4,5 @@ moc*
|
|||
rcc*
|
||||
*.qmlc
|
||||
*.jsc
|
||||
vendor/
|
||||
tor/
|
||||
|
|
21
main.go
21
main.go
|
@ -27,7 +27,7 @@ func init() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
log.SetLevel(log.LevelDebug)
|
||||
log.SetLevel(log.LevelInfo)
|
||||
|
||||
// our globals
|
||||
gcd := gothings.NewGrandCentralDispatcher(nil)
|
||||
|
@ -50,12 +50,13 @@ func main() {
|
|||
app := gui.NewQGuiApplication(len(os.Args), os.Args)
|
||||
app.SetWindowIcon(gui.NewQIcon5(":/qml/images/cwtch-icon.png"))
|
||||
|
||||
// window construction boilerplate
|
||||
view := initializeQtView(qmlSource)
|
||||
core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, true)
|
||||
quickcontrols2.QQuickStyle_SetStyle("Universe")
|
||||
engine := qml.NewQQmlApplicationEngine(nil)
|
||||
|
||||
// variables we want to access from inside qml
|
||||
view.RootContext().SetContextProperty("gcd", gcd)
|
||||
|
||||
engine.RootContext().SetContextProperty("gcd", gcd)
|
||||
engine.Load(qmlSource)
|
||||
|
||||
acn, err := connectivity.StartTor(the.CwtchDir, "")
|
||||
if err != nil {
|
||||
|
@ -85,19 +86,11 @@ func main() {
|
|||
//})
|
||||
return nam
|
||||
})
|
||||
view.SetNetworkAccessManagerFactory(factory)
|
||||
engine.SetNetworkAccessManagerFactory(factory)
|
||||
app.Exec()
|
||||
acn.Close()
|
||||
}
|
||||
|
||||
// window construction boilerplate
|
||||
func initializeQtView(source *core.QUrl) *qml.QQmlApplicationEngine {
|
||||
core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, true)
|
||||
quickcontrols2.QQuickStyle_SetStyle("Universe")
|
||||
engine := qml.NewQQmlApplicationEngine(nil)
|
||||
engine.Load(source)
|
||||
return engine
|
||||
}
|
||||
|
||||
// this is mostly going to get factored out when we add profile support
|
||||
// for now, it loads a single peer and fills the ui with its data
|
||||
|
|
|
@ -18,7 +18,6 @@ ColumnLayout {
|
|||
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
text: parent.toolbar.text + " Bulletin Board"
|
||||
}
|
||||
|
||||
TextField {
|
||||
|
@ -47,8 +46,8 @@ ColumnLayout {
|
|||
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
contentWidth: bulletin.width
|
||||
contentHeight: bulletin.height
|
||||
contentWidth: parent.width
|
||||
contentHeight: parent.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
maximumFlickVelocity: 800
|
||||
|
||||
|
@ -161,7 +160,6 @@ ColumnLayout {
|
|||
anchors.right: parent.right
|
||||
anchors.rightMargin:10
|
||||
onClicked: {
|
||||
console.log("REPLYING!!!")
|
||||
gcd.broadcast("ResetMessagePane")
|
||||
theStack.pane = theStack.messagePane
|
||||
gcd.loadMessagesPane(from)
|
||||
|
|
|
@ -41,7 +41,7 @@ ColumnLayout {
|
|||
var remove = -1
|
||||
for(var i=0;i<solutions.count;i++) {
|
||||
var puzzleName = "Puzzle " + points
|
||||
console.log("Checking Solution " + puzzleName)
|
||||
//console.log("Checking Solution " + puzzleName)
|
||||
|
||||
if (puzzleName == solutions.get(i).text) {
|
||||
if (Utils.scorePath(JSON.parse(path)) < Utils.scorePath(JSON.parse(solutions.get(i).path))) {
|
||||
|
@ -54,7 +54,7 @@ ColumnLayout {
|
|||
|
||||
if (remove > -1) {
|
||||
solutions.remove(remove)
|
||||
console.log("Better solution found for Puzzle " + "Puzzle " + JSON.stringify(msg.s))
|
||||
//console.log("Better solution found for Puzzle " + "Puzzle " + JSON.stringify(msg.s))
|
||||
|
||||
}
|
||||
solutions.insert(0,{
|
||||
|
@ -85,9 +85,9 @@ ColumnLayout {
|
|||
textRole: "text"
|
||||
model: solutions
|
||||
onActivated: {
|
||||
console.log("Loading puzzle " + index)
|
||||
//console.log("Loading puzzle " + index)
|
||||
var solution = solutions.get(index)
|
||||
console.log("Loading puzzle " + JSON.parse(solution.path))
|
||||
//console.log("Loading puzzle " + JSON.parse(solution.path))
|
||||
canvas.points = JSON.parse(solution.points)
|
||||
canvas.path = JSON.parse(solution.path)
|
||||
gameScore.text = Utils.scorePath(canvas.path)
|
||||
|
@ -114,12 +114,6 @@ ColumnLayout {
|
|||
property int nextMessageID: 1
|
||||
|
||||
onClicked: {
|
||||
/**if (newposttitle.text != "" && newpostbody.text != "") {
|
||||
var msg = JSON.stringify({"o":2, "t":newposttitle.text, "b":newpostbody.text})
|
||||
gcd.sendMessage(msg, nextMessageID++)
|
||||
}
|
||||
newposttitle.text = ""
|
||||
newpostbody.text = ""**/
|
||||
canvas.points = []
|
||||
canvas.path = []
|
||||
gameScore.text = 0
|
||||
|
@ -147,7 +141,6 @@ ColumnLayout {
|
|||
Component.onCompleted: {
|
||||
for(var i=0;i<5;i++) {
|
||||
points.push(Utils.getRandomInt(0,256))
|
||||
console.log("POINTS" + points)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,12 +191,12 @@ ColumnLayout {
|
|||
var point = (mymouse.arrpoints["x"]*16)+mymouse.arrpoints["y"]
|
||||
var inPoints = Utils.isGridOccupied(mymouse.arrpoints["x"], mymouse.arrpoints["y"], canvas.points)
|
||||
|
||||
console.log("Checking Point " + point + " in path " + inPoints + " path length is " + canvas.path.length)
|
||||
//console.log("Checking Point " + point + " in path " + inPoints + " path length is " + canvas.path.length)
|
||||
if (inPoints == true) {
|
||||
var alreadyInPath = false
|
||||
for(var i=0;i<canvas.path.length;i++) {
|
||||
if (canvas.path[i] == point) {
|
||||
console.log("Point already in path!!")
|
||||
//console.log("Point already in path!!")
|
||||
|
||||
alreadyInPath = true
|
||||
}
|
||||
|
@ -211,7 +204,7 @@ ColumnLayout {
|
|||
|
||||
if (alreadyInPath == false) {
|
||||
canvas.path.push(point)
|
||||
console.log("Pushing " + point + " to path" + canvas.path)
|
||||
//console.log("Pushing " + point + " to path" + canvas.path)
|
||||
}
|
||||
} else {
|
||||
canvas.path = []
|
||||
|
|
|
@ -17,7 +17,6 @@ ColumnLayout {
|
|||
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
text: parent.toolbar.text + " Lists"
|
||||
}
|
||||
|
||||
TextField {
|
||||
|
@ -46,8 +45,8 @@ ColumnLayout {
|
|||
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
contentWidth: bulletin.width
|
||||
contentHeight: bulletin.height
|
||||
contentWidth: parent.width
|
||||
contentHeight: parent.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
maximumFlickVelocity: 800
|
||||
|
||||
|
@ -80,8 +79,6 @@ ColumnLayout {
|
|||
}
|
||||
|
||||
if(msg.c != undefined) {
|
||||
console.log("Checking off " + msg.c)
|
||||
console.log(jsonModel4.get(msg.c).title)
|
||||
jsonModel4.get(msg.c).complete = true
|
||||
}
|
||||
|
||||
|
@ -120,7 +117,6 @@ ColumnLayout {
|
|||
RowLayout {
|
||||
CheckBox {
|
||||
checked: complete
|
||||
checkedState: complete ? Qt.Checked : Qt.UnChecked
|
||||
onClicked: {
|
||||
var msg = JSON.stringify({"o":4, "c":index})
|
||||
gcd.sendMessage(msg, btnSend.nextMessageID++)
|
||||
|
|
|
@ -51,10 +51,4 @@ ColumnLayout { // settingsPane
|
|||
}
|
||||
|
||||
}//end of column with padding
|
||||
|
||||
Component.onCompleted: {
|
||||
zoomSlider.value = Screen.pixelDensity / 3.2 // artistic license. set by erinn. fight me before changing
|
||||
if (zoomSlider.value < zoomSlider.from) zoomSlider.value = zoomSlider.from
|
||||
if (zoomSlider.value > zoomSlider.to) zoomSlider.value = zoomSlider.to
|
||||
}
|
||||
}
|
|
@ -32,10 +32,7 @@ function scorePath(path) {
|
|||
var pathLength = 0
|
||||
for (var i=0;i<path.length-1;i++) {
|
||||
pathLength += distance(path[i],path[i+1])
|
||||
console.log("Path Length:" + pathLength)
|
||||
}
|
||||
|
||||
|
||||
return ""+pathLength
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ Rectangle {
|
|||
Image {
|
||||
anchors.left: parent.left
|
||||
id: ico
|
||||
source: "qrc:/qml/images/fontawesome/"+icon+".svg"
|
||||
source: "qrc:/qml/images/fontawesome/"+(icon!=""?icon:"regular/window-maximize")+".svg"
|
||||
height: button.height / 2
|
||||
sourceSize.height: button.height / 2
|
||||
}
|
||||
|
|
Reference in New Issue