import QtQuick 2.0
import QtQml.Models 2.1
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1
import QtQuick.Window 2
import Qt.labs.settings 1.0
import QtQuick.Dialogs 1.1
Rectangle {
id: box
width: 1000 * Screen.devicePixelRatio; height: 700 * Screen.devicePixelRatio
property alias view: view
//: For Right to Left language, set this string to RTL
property var direction: qsTr("LTR")
LayoutMirroring.enabled: (direction == "LTR" ? false : true)
// for tests
//LayoutMirroring.enabled: true
LayoutMirroring.childrenInherit: true
Settings {
property alias width: box.width
property alias height: box.height
}
Component {
id: slidebackground
LinearGradient {
start: Qt.point(0, 0)
end: Qt.point(0, 800)
gradient: Gradient {
GradientStop { position: 0.0; color: "#2397D4" }
GradientStop { position: 1.0; color: "#262F45" }
}
}
}
Rectangle {
id: banner
opacity: 0.95
layer.enabled: true
width: parent.width;height: 120
LinearGradient {
anchors.fill: parent
start: Qt.point(0, 0)
end: Qt.point(0, 400)
gradient: Gradient {
GradientStop { position: 0.0; color: "lightgray" }
GradientStop { position: 1.0; color: "white" }
}
}
Image {
anchors.fill: parent
anchors.bottomMargin: 10
anchors.topMargin: 10
source: "img/mageia-2013-black-alpha.png"
fillMode: Image.PreserveAspectFit
}
}
Rectangle {
id: slideshow
property Item displayItem: null
anchors {left: parent.left; top: buttonbox.bottom; bottom: parent.bottom; right: parent.right}
color: "#2397D4"
width: parent.width
ObjectModel {
id: itemModel
// Welcome page
Rectangle {
//: the button in buttons bar
property var title: qsTr("Welcome")
width: view.width; height: view.height
Loader { sourceComponent: slidebackground ;
anchors.fill: parent}
Column {
anchors.centerIn: parent
anchors.verticalCenter: parent.verticalCenter
Label {
//: the %1 will be replaced with the user name
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: TextInput.AlignHCenter
text: qsTr("Welcome to Mageia, %1").arg(user)+'\n'
font.weight: Font.DemiBold
font.pixelSize: Qt.application.font.pixelSize * 1.5
color: "white"
}
Label {
horizontalAlignment: TextInput.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("We are going to guide you through a few important steps and help
you with the configuration of your newly installed system.
Now, click on Media sources to go to the first step.");
textFormat: Text.RichText
color: "white"
}
}
}
// Configure source page
Rectangle {
property var title: qsTr("Media sources")
width: view.width; height: view.height
Loader { sourceComponent: slidebackground ;
anchors.fill: parent}
//Column {
//anchors.left: parent.left
// y: 10
GridLayout {
columns: 2
Label {
Layout.columnSpan: 2
Layout.topMargin: 10
Layout.leftMargin: 10
text: qsTr("Configure software repositories"); font.bold: true;
color: "white" }
Label {
Layout.columnSpan: 2
Layout.topMargin: 10
Layout.leftMargin: 10
text: qsTr("Mageia official repositories contain:");
color: "white" }
Button {id: coreBg
Layout.margins: 5
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
//height: Qt.application.font.pixelSize * 1.3
style: ButtonStyle {
label: Label {
horizontalAlignment: TextInput.AlignHCenter
//: Should be as displayed in software manager, thus in general not translated
text: qsTr("core");
font.bold: true; color: "black";
}
background: Rectangle {
LinearGradient {
anchors.fill: parent
start: Qt.point(0, 0)
end: Qt.point(0, 20)
gradient: Gradient {
GradientStop { position: 0.0; color: "lightgreen" }
GradientStop { position: 1.0; color: "green" }
}
}
}
}
}
Label {
text: qsTr("- the free-open-source packages");
wrapMode: Text.WordWrap
Layout.maximumWidth: slideshow.width -20 - coreBg.width
color: "white"
}
Button {
Layout.margins: 5
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
style: ButtonStyle {
label: Label {
horizontalAlignment: TextInput.AlignHCenter
//: Should be as displayed in software manager, thus in general not translated
text: qsTr("nonfree");
font.bold: true; color: "white";
}
background: Rectangle {
LinearGradient {
anchors.fill: parent
start: Qt.point(0, 0)
end: Qt.point(0, 20)
gradient: Gradient {
GradientStop { position: 0.0; color: "red" }
GradientStop { position: 1.0; color: "darkred" }
}
}
}
}
}
Label {
width: parent.width
text: qsTr("- closed-source programs, e.g. Nvidia proprietary drivers, non-free drivers for some Wi-Fi cards, etc");
Layout.maximumWidth: slideshow.width - 110
wrapMode: Text.WordWrap
color: "white"
}
Button {
Layout.margins: 5
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
style: ButtonStyle {
label: Label {
horizontalAlignment: TextInput.AlignHCenter
//: Should be as displayed in software manager, thus in general not translated
text: qsTr("tainted");
font.bold: true; color: "white";
}
background: Rectangle {
LinearGradient {
anchors.fill: parent
start: Qt.point(0, 0)
end: Qt.point(0, 20)
gradient: Gradient {
GradientStop { position: 0.0; color: "red" }
GradientStop { position: 1.0; color: "darkred" }
}
}
}
}
}
Label {
text: qsTr("- these packages (eg audio and video codecs needed for certain multimedia files or commercial DVDs) may infringe on patents or copyright laws in certain countries. ");
wrapMode: Text.WordWrap
Layout.maximumWidth: slideshow.width -110
color: "white"
}
Button {
Layout.margins: 5
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
style: ButtonStyle {
label: Label {
horizontalAlignment: TextInput.AlignHCenter
//: Should be as displayed in software manager, thus in general not translated
text: qsTr("backports");
font.bold: true; color: "black";
}
background: Rectangle {
LinearGradient {
anchors.fill: parent
start: Qt.point(0, 0)
end: Qt.point(0, 20)
gradient: Gradient {
GradientStop { position: 0.0; color: "lightgray" }
GradientStop { position: 1.0; color: "darkgray" }
}
}
}
}
}
Label {
text: qsTr("- include new versions of packages, and new packages, that do not meet the updates policy.");
wrapMode: Text.WordWrap
Layout.maximumWidth: slideshow.width -110
color: "white"
}
Button {
Layout.margins: 5
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
style: ButtonStyle {
label: Label {
horizontalAlignment: TextInput.AlignHCenter
text: qsTr("Note! ");
font.bold: true; color: "black";
}
background: Rectangle {
color: "#e6c200";
}
}
}
Label { text: qsTr("If you enabled the online repositories during installation, some media sources should be installed already. Otherwise, we will now configure these online repositories.
If this computer will have access to the Internet, you can delete the Local entry from the list of repositories.");
wrapMode: Text.WordWrap
textFormat: Text.RichText
color: "white"
Layout.fillWidth: true
Layout.maximumWidth: slideshow.width - 110
}
Label { text: qsTr("Now, please enable or disable the online repositories of your choice: click on the Edit software repositories button. Select at least the release and updates pair. Debug and Testing are for special cases.")+"
"+
qsTr("After you have checked and enabled the repositories you need, you can go to the next slide.")
wrapMode: Text.WordWrap
textFormat: Text.RichText
color: "white"
Layout.fillWidth: true
Layout.maximumWidth: slideshow.width - 10
Layout.columnSpan: 2
Layout.margins: 10
}
MButton {
Layout.maximumWidth: slideshow.width * .40
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
objectName: "launch"
onMbuttonClicked: { launch.command(["drakrpm-edit-media",])}
buttonText: qsTr("Edit software sources")+" *"
}
}
Label {
anchors {top: parent.bottom; topMargin: 3; horizontalCenter: parent.left; horizontalCenterOffset: parent.width * .4 }
text: qsTr("(*) Administrator password is needed.")
Layout.maximumWidth: slideshow.width * .4
font.italic: true
color: "white"
}
}
// Update page
Rectangle {
property var title: qsTr("Update")
width: view.width; height: view.height
Loader { sourceComponent: slidebackground ;
anchors.fill: parent}
Column {
spacing: 10
Label { text: qsTr("How Mageia manages updates"); font.bold: true;
topPadding: 30 ; leftPadding: 20
color: "white"}
Label {
width: slideshow.width - 40
padding: 20
text: qsTr("Mageia provides software which may be updated in order to fix bugs or security issues. It is highly recommended that you update your system regularly. \
An Update icon will appear in your task bar when new updates are available. To run the updates, just click on the icon below and give your user password - or use the Software Manager (root password). \
This is a background process and you will be able to use your computer normally during the updates."+"\n");
wrapMode: Text.WordWrap
color: "white"
}
Button {
width: view.width * .18
anchors.horizontalCenter: parent.horizontalCenter
objectName: "launch"
onClicked:{ launch.command(["drakrpm-update",])}
style: ButtonStyle {
label: Label {
horizontalAlignment: TextInput.AlignHCenter
text: qsTr("Check system updates")+" *";
width: parent.width
wrapMode: Text.WordWrap
color: "black"
}
}
}
Button {
x:10
width: view.width * .18;
anchors.horizontalCenter: parent.horizontalCenter
objectName: "link"
onClicked:{ link.weblink("https://advisories.mageia.org/")}
style: ButtonStyle {
label: Label {
horizontalAlignment: TextInput.AlignHCenter
//: (en) indicates that the content of the link is in English
text: qsTr("Advisories of updates (en)");
width: parent.width
wrapMode: Text.WordWrap
color: "black"
}
}
}
}
Label {
anchors {top: parent.bottom; topMargin: 3; horizontalCenter: parent.left; horizontalCenterOffset: parent.width * .4 }
text: qsTr("(*) User password is needed")
wrapMode: Text.WordWrap
font.italic: true
color: "white"
}
}
// MCC Page
Rectangle {
//: The button in the buttons bar, shortcut for Mageia Control Center
property var title: qsTr("MCC")
width: view.width; height: view.height
Loader { sourceComponent: slidebackground ;
anchors.fill: parent}
Column {
x: 10; y: 30
spacing: 10
Label {
text: qsTr("Mageia Control Center (aka drakconf) is a set of tools to help you configure your system.")
width: view.width * 0.9
padding: 10
wrapMode: Text.WordWrap
textFormat: Text.RichText
color: "white"
}
Label {
padding: 5
anchors.horizontalCenter: parent.horizontalCenter
text: "