-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
freemountain
authored and
freemountain
committed
Feb 3, 2017
1 parent
2542736
commit eee4860
Showing
6 changed files
with
198 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
build | ||
dist | ||
default | ||
/default | ||
node_modules | ||
/.qmake.cache | ||
/.qmake.stash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import QtQuick 2.6 | ||
import QtQuick.Controls 2.0 | ||
|
||
Item { | ||
id: item | ||
property string text: "" | ||
|
||
property color color | ||
|
||
signal action(string url) | ||
|
||
Rectangle { | ||
id: background; | ||
color: item.color | ||
anchors.fill: parent | ||
|
||
DropArea { | ||
anchors.fill: parent; | ||
|
||
onEntered: { | ||
background.color = Qt.darker(item.color) | ||
|
||
drag.accept (Qt.CopyAction); | ||
} | ||
|
||
onDropped: { | ||
item.action(drop.urls[0].slice(7)); | ||
|
||
background.color = item.color; | ||
} | ||
|
||
onExited: { | ||
background.color = item.color; | ||
} | ||
} | ||
|
||
Label { | ||
text: item.text | ||
font.pointSize: 24 | ||
font.bold: true | ||
anchors.horizontalCenter: parent.horizontalCenter | ||
anchors.verticalCenter: parent.verticalCenter | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import qbs.base | ||
import qbs.FileInfo | ||
import qbs.File | ||
import qbs.Probes | ||
import qbs.ModUtils | ||
|
||
QNodeNpmPkg { | ||
name: "default" | ||
|
||
Group { | ||
name: "out" | ||
fileTagsFilter: ["npm_pkg.default"] | ||
qbs.install: true | ||
qbs.installSourceBase: product.destinationDirectory | ||
qbs.installDir: "default" | ||
} | ||
|
||
Group { | ||
name: "input" | ||
files: ["./**"] | ||
fileTags: ["npm_pkg_input"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import QtQuick 2.6 | ||
import QtQuick.Controls 2.0 | ||
import QtQuick.Controls.Material 2.0 | ||
import QtQuick.Dialogs 1.1 | ||
import Quark 1.0 | ||
|
||
ApplicationWindow { | ||
visible: true | ||
width: 300 | ||
height: 200 | ||
id:window | ||
|
||
Gluon { | ||
id: store | ||
} | ||
|
||
ActionRect { | ||
id: run; | ||
height: window.height / 2 | ||
width: window.width | ||
anchors.top: window.top | ||
color: "lightsteelblue" | ||
text: "Run" | ||
|
||
onAction: { | ||
store.trigger("startProcess", url); | ||
} | ||
} | ||
|
||
ActionRect { | ||
id: deploy | ||
color: "steelblue" | ||
height: window.height / 2 | ||
width: window.width | ||
anchors.top: run.bottom | ||
text: "Deploy" | ||
|
||
property var pkgPath | ||
property var targetPath | ||
|
||
onAction: { | ||
fd.visible = true; | ||
deploy.pkgPath = url | ||
} | ||
|
||
FileDialog { | ||
id: fd | ||
title: "Please choose output directory" | ||
folder: shortcuts.home | ||
selectFolder: true | ||
|
||
onAccepted: { | ||
deploy.targetPath = fd.fileUrls[0].slice(7) // contains file:///User/.. | ||
md.visible = true; | ||
fd.visible = false; | ||
|
||
store.trigger("deployApp", { | ||
pkg: deploy.pkgPath, | ||
target: deploy.targetPath | ||
}); | ||
} | ||
|
||
onRejected: { | ||
fd.visible = false; | ||
} | ||
} | ||
|
||
MessageDialog { | ||
id: md | ||
title: "Bundling..." | ||
text: "Deplyed " + deploy.pkgPath + " to " + deploy.targetPath | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const Quark = require("quark"); | ||
const path = require("path"); | ||
|
||
// require("shelljs/global"); | ||
|
||
const app = Quark.of({ | ||
initialState: { | ||
apps: [] | ||
}, | ||
mappings: { | ||
startProcess: "onStart", | ||
deployApp: "onDeploy" | ||
}, | ||
intents: { | ||
onStart(state, dir) { | ||
console.error("start"); | ||
return state.update("processes", processes => processes.concat(dir)); | ||
}, | ||
|
||
onDeploy(state, program) { | ||
console.error("deploy"); | ||
return state.update("apps", apps => apps.concat(program)) | ||
} | ||
} | ||
}); | ||
|
||
app.listen("processes").on("data", console.error.bind(console)); | ||
// app.listen("apps").on("data", console.error.bind(console)); | ||
// | ||
/* | ||
onDeploy: function() { | ||
bundle: path.join(path.dirname(options.shellPath), '..', '..') | ||
const pkgJson = require(pkg); | ||
const name = pkgJson.name || "quark"; | ||
const target = path.join(targetBase, `${name}.app`); | ||
const pkgBase = path.dirname(pkg); | ||
const appBase = path.join(target, "Contents", "Resources", "app"); | ||
console.error("pkbBase", pkgBase); | ||
console.error("appBase", appBase); | ||
cp("-R", bundle, target); | ||
rm("-rf", appBase) | ||
cp("-R", pkgBase, appBase); | ||
} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "quark-default", | ||
"version": "0.1.0", | ||
"main": "main.js", | ||
"initialQml": "index.qml", | ||
"dependencies": { | ||
"shelljs": "^0.7.5" | ||
} | ||
} |