Commit 6fb50260 authored by Carson Black's avatar Carson Black

Montages, but on the command line

parent 8057071b
......@@ -10,6 +10,12 @@ Item {
visible: false
width: 800
height: 400 + (400 * 1/3)
function clisave(loc) {
screenRoot.grabToImage(function(result) {
result.saveToFile(loc);
Qt.quit();
});
}
Item {
anchors.fill: parent
Row {
......
......@@ -184,6 +184,12 @@ Item {
function open() {
screenshotSavePicker.open()
}
function clisave(loc) {
screenRoot.grabToImage(function(result) {
result.saveToFile(loc);
Qt.quit();
});
}
FileDialog {
id: screenshotSavePicker
selectExisting: false
......
......@@ -167,8 +167,24 @@ Kirigami.ApplicationWindow {
}
Component.onCompleted: {
if (Qt.application.arguments[1] != null) {
root.imageSource = "file:/" + Qt.application.arguments[1]
var argus = Qt.application.arguments
console.log(argus)
if (argus[1] == null) {
return
}
if (argus[1].startsWith("/")) {
root.imageSource = "file:" + Qt.application.arguments[1]
} else if (argus[1].toLowerCase() == "md" || argus[1].toLowerCase() == "montage-default" ) {
var old = root.imageSource
root.imageSource = argus[2]
colorShot.clisave(argus[3])
root.imageSource = old
}
else if (argus[1].toLowerCase() == "ms" || argus[1].toLowerCase() == "montage-small" ) {
var old = root.imageSource
root.imageSource = argus[2]
monoShot.clisave(argus[3])
root.imageSource = old
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment