Add nag-screen
This commit is contained in:
parent
ee0fc56bde
commit
5df016b0fa
9 changed files with 261 additions and 2 deletions
|
@ -40,6 +40,7 @@ DISTFILES += qml/harbour-seaprint.qml \
|
||||||
qml/pages/*svg \
|
qml/pages/*svg \
|
||||||
qml/pages/BusyPage.qml \
|
qml/pages/BusyPage.qml \
|
||||||
qml/pages/DebugPage.qml \
|
qml/pages/DebugPage.qml \
|
||||||
|
qml/pages/NagScreen.qml \
|
||||||
rpm/harbour-seaprint.changes.in \
|
rpm/harbour-seaprint.changes.in \
|
||||||
rpm/harbour-seaprint.changes.run.in \
|
rpm/harbour-seaprint.changes.run.in \
|
||||||
rpm/harbour-seaprint.spec \
|
rpm/harbour-seaprint.spec \
|
||||||
|
|
|
@ -2,6 +2,7 @@ import QtQuick 2.0
|
||||||
import Sailfish.Silica 1.0
|
import Sailfish.Silica 1.0
|
||||||
import QtQuick.LocalStorage 2.0
|
import QtQuick.LocalStorage 2.0
|
||||||
import Nemo.Notifications 1.0
|
import Nemo.Notifications 1.0
|
||||||
|
import Nemo.Configuration 1.0
|
||||||
import "pages"
|
import "pages"
|
||||||
|
|
||||||
ApplicationWindow
|
ApplicationWindow
|
||||||
|
@ -73,5 +74,13 @@ ApplicationWindow
|
||||||
publish()
|
publish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConfigurationValue
|
||||||
|
{
|
||||||
|
id: nagScreenSetting
|
||||||
|
key: "/apps/harbour-seaprint/settings/nag-screen"
|
||||||
|
defaultValue: 0
|
||||||
|
property int expectedValue: 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,6 @@ Page {
|
||||||
signal refreshed()
|
signal refreshed()
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
console.log("Can convert from PDF:", ConvertChecker.pdf)
|
|
||||||
IppDiscovery.discover();
|
IppDiscovery.discover();
|
||||||
if(selectedFile != "")
|
if(selectedFile != "")
|
||||||
{
|
{
|
||||||
|
@ -56,6 +55,20 @@ Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property bool nagged: false
|
||||||
|
|
||||||
|
onStatusChanged: {
|
||||||
|
if(status==PageStatus.Active && !nagged && nagScreenSetting.value != nagScreenSetting.expectedValue)
|
||||||
|
{
|
||||||
|
console.log("Can convert from PDF:", ConvertChecker.pdf)
|
||||||
|
if(!ConvertChecker.pdf)
|
||||||
|
{
|
||||||
|
nagged=true
|
||||||
|
pageStack.push(Qt.resolvedUrl("NagScreen.qml"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// To enable PullDownMenu, place our content in a SilicaFlickable
|
// To enable PullDownMenu, place our content in a SilicaFlickable
|
||||||
SilicaFlickable {
|
SilicaFlickable {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -107,7 +120,6 @@ Page {
|
||||||
Connections {
|
Connections {
|
||||||
target: printer
|
target: printer
|
||||||
onAttrsChanged: {
|
onAttrsChanged: {
|
||||||
console.log(printer.url, Object.keys(printer.attrs))
|
|
||||||
if(Object.keys(printer.attrs).length === 0) {
|
if(Object.keys(printer.attrs).length === 0) {
|
||||||
delegate.visible = false
|
delegate.visible = false
|
||||||
}
|
}
|
||||||
|
|
82
qml/pages/NagScreen.qml
Normal file
82
qml/pages/NagScreen.qml
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import Sailfish.Silica 1.0
|
||||||
|
|
||||||
|
Page {
|
||||||
|
backNavigation: false
|
||||||
|
|
||||||
|
Column {
|
||||||
|
y: Theme.paddingLarge
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
width: parent.width - 2*Theme.paddingLarge
|
||||||
|
spacing: Theme.paddingLarge
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
text: qsTr("Optional dependencies are not installed!")
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
text: qsTr("In order to convert PDF files to other formats, you need utilities from the package \"poppler-utils\"")
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
text: qsTr("To install, enable delveloper mode, and open a terminal.")
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
text: qsTr("Become root:")
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
font.family: "monospace"
|
||||||
|
|
||||||
|
text: "devel-su"
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
text: qsTr("Install poppler-utils:")
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
font.family: "monospace"
|
||||||
|
|
||||||
|
text: "pkcon install poppler-utils"
|
||||||
|
}
|
||||||
|
|
||||||
|
Item{}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
text: qsTr("Dismiss")
|
||||||
|
onClicked: pageStack.pop()
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
text: qsTr("Don't show again")
|
||||||
|
onClicked: {
|
||||||
|
nagScreenSetting.value = nagScreenSetting.expectedValue
|
||||||
|
pageStack.pop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -253,6 +253,37 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>NagScreen</name>
|
||||||
|
<message>
|
||||||
|
<source>Dismiss</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Don't show again</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Optional dependencies are not installed!</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>In order to convert PDF files to other formats, you need utilities from the package "poppler-utils"</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>To install, enable delveloper mode, and open a terminal.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Become root:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Install poppler-utils:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PrinterPage</name>
|
<name>PrinterPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -253,6 +253,37 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>NagScreen</name>
|
||||||
|
<message>
|
||||||
|
<source>Dismiss</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Don't show again</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Optional dependencies are not installed!</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>In order to convert PDF files to other formats, you need utilities from the package "poppler-utils"</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>To install, enable delveloper mode, and open a terminal.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Become root:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Install poppler-utils:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PrinterPage</name>
|
<name>PrinterPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -253,6 +253,37 @@
|
||||||
<translation>Échec de l'annulation de la tâche d'impression</translation>
|
<translation>Échec de l'annulation de la tâche d'impression</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>NagScreen</name>
|
||||||
|
<message>
|
||||||
|
<source>Dismiss</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Don't show again</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Optional dependencies are not installed!</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>In order to convert PDF files to other formats, you need utilities from the package "poppler-utils"</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>To install, enable delveloper mode, and open a terminal.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Become root:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Install poppler-utils:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PrinterPage</name>
|
<name>PrinterPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -253,6 +253,37 @@
|
||||||
<translation>作业失败</translation>
|
<translation>作业失败</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>NagScreen</name>
|
||||||
|
<message>
|
||||||
|
<source>Dismiss</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Don't show again</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Optional dependencies are not installed!</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>In order to convert PDF files to other formats, you need utilities from the package "poppler-utils"</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>To install, enable delveloper mode, and open a terminal.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Become root:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Install poppler-utils:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PrinterPage</name>
|
<name>PrinterPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -253,6 +253,37 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>NagScreen</name>
|
||||||
|
<message>
|
||||||
|
<source>Dismiss</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Don't show again</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Optional dependencies are not installed!</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>In order to convert PDF files to other formats, you need utilities from the package "poppler-utils"</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>To install, enable delveloper mode, and open a terminal.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Become root:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Install poppler-utils:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PrinterPage</name>
|
<name>PrinterPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
Loading…
Reference in a new issue