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 Rectangle { id: box width: 1000; height: 700 property alias view: view Rectangle { id: banner color: "lightgray" width: parent.width;height: 120 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 LinearGradient { anchors.fill: parent start: Qt.point(0, 0) end: Qt.point(0, 1000) gradient: Gradient { GradientStop { position: 0.0; color: "white" } GradientStop { position: 1.0; color: "#2397D4" } } } Column { anchors.centerIn: parent Label { //: the %1 will be replaced with the user name text: qsTr("Welcome to Mageia, %1").arg(user)+'\n\n' font.bold: true } Label { 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 } } } // Configure source page Rectangle { property var title: qsTr("Media sources") width: view.width; height: view.height LinearGradient { anchors.fill: parent start: Qt.point(0, 0) end: Qt.point(0, 1000) gradient: Gradient { GradientStop { position: 0.0; color: "white" } GradientStop { position: 1.0; color: "#2397D4" } } } Column { anchors.left: parent.left anchors.leftMargin: 20 y:35 Label { text: qsTr("Configure software repositories"); font.bold: true; } Label { text: qsTr("Mageia official repositories contain:"); } GridLayout { columns: 2 Rectangle {id: coreBg 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" } } } width: 80; height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true Label { anchors.centerIn: parent text: qsTr("core"); } } Label { text: qsTr("- the free-open-source packages"); wrapMode: Text.WordWrap Layout.maximumWidth: slideshow.width * .6 } Rectangle {id: nonfreeBg 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" } } } width: 80; height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true Label { anchors.centerIn: parent text: qsTr("nonfree"); color: "white"} } 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 * .8 wrapMode: Text.WordWrap } Rectangle {id: taintedBg 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" } } } width: 80; height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true Label { anchors.centerIn: parent text: qsTr("tainted"); color: "white" } } 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 * .8 } Rectangle { color: "lightgrey" width: 80; height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true Label { anchors.centerIn: parent text: qsTr("backports"); } } Label { text: qsTr("- includes software published after a Mageia release, or another version of software already present and not replaced."); wrapMode: Text.WordWrap Layout.maximumWidth: slideshow.width * .8 } Button { Layout.maximumWidth: slideshow.width * .25 Layout.columnSpan: 2 Layout.alignment: Qt.AlignHCenter objectName: "launch" onClicked: { launch.command(["drakrpm-edit-media",])} style: ButtonStyle { label: Label { text: qsTr("Edit software repositories")+" *"; width: parent.width wrapMode: Text.WordWrap } } } Rectangle {id: noteBg color: "gold"; width: 70 height: 30 Layout.alignment: Qt.AlignTop Layout.fillWidth: true Label { anchors.centerIn: parent text: qsTr("Note! ") } } 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 cdrom entry from the list of repositories.")+"

"+ 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 Layout.fillWidth: true Layout.maximumWidth: slideshow.width * .85 } } Label { x: 84 text: qsTr("(*) Administrator password is needed.") Layout.maximumWidth: slideshow.width * .25 wrapMode: Text.WordWrap font.italic: true } } } // Update page Rectangle { property var title: qsTr("Update") width: view.width; height: view.height LinearGradient { anchors.fill: parent start: Qt.point(0, 0) end: Qt.point(0, 1000) gradient: Gradient { GradientStop { position: 0.0; color: "white" } GradientStop { position: 1.0; color: "#2397D4" } } } Column { Label { text: qsTr("How Mageia manages updates"); font.bold: true; padding: 10 } Label { width: slideshow.width * .9 padding: 10 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 this icon 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 } Button { width: view.width * .18; objectName: "launch" onClicked:{ launch.command(["drakrpm-update",])} style: ButtonStyle { label: Label { text: qsTr("Check system updates")+" *"; width: parent.width wrapMode: Text.WordWrap } } } } Label { anchors {bottom: parent.bottom; horizontalCenter: parent.horizontalCenter} width: view.width * .5; padding: 5 text: qsTr("(*) User password is needed") wrapMode: Text.WordWrap font.italic: true } } // 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 LinearGradient { anchors.fill: parent start: Qt.point(0, 0) end: Qt.point(0, 1000) gradient: Gradient { GradientStop { position: 0.0; color: "white" } GradientStop { position: 1.0; color: "#2397D4" } } } Column { 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 } Label { padding: 5 text: ""; width: view.width/2; wrapMode: Text.WordWrap;textFormat: Text.RichText } Button { id: mcc objectName: "launch" onClicked: { launch.command(["drakconf"])} style: ButtonStyle { label: Label { text: qsTr("Mageia Control Center")+" *"; wrapMode: Text.WordWrap } } } Button { objectName: "link" onClicked: { link.weblink("https://www.mageia.org/doc")} style: ButtonStyle { label: Label { text: qsTr("MCC documentation"); wrapMode: Text.WordWrap } } } } Label { text: qsTr("(*) Administrator password is needed") anchors {bottom: parent.bottom; horizontalCenter: parent.horizontalCenter} wrapMode: Text.WordWrap padding: 5 width: view.width * .4; font.italic: true } } // Install software page Rectangle { property var title: qsTr("Install software") width: view.width; height: view.height LinearGradient { anchors.fill: parent start: Qt.point(0, 0) end: Qt.point(0, 1000) gradient: Gradient { GradientStop { position: 0.0; color: "white" } GradientStop { position: 1.0; color: "#2397D4" } } } Column { //anchors.left: parent.left //anchors.verticalCenter: parent.verticalCenter Label { text: qsTr("Install and remove software") width: slideshow.width * .9 padding: 5 font.bold: true wrapMode: Text.WordWrap } Label { text: qsTr("With Mageia, you will find the software in the media repositories. Mageia users simply access these media via one of the Software Managers."); width: slideshow.width * .9; padding: 5 wrapMode: Text.WordWrap textFormat: Text.RichText } Label { text: qsTr("Next slide shows a small selection of popular applications - any of which may be installed at this point.
"); width: slideshow.width * .9; padding: 5 wrapMode: Text.WordWrap textFormat: Text.RichText } Label { text: qsTr("You can find a more detailed list here:"); width: slideshow.width * .9; padding: 5 wrapMode: Text.WordWrap textFormat: Text.RichText } Button { id: listApplicationsWiki objectName: "link" onClicked: { link.weblink(qsTr("https://wiki.mageia.org/en/List_of_applications"))} style: ButtonStyle { label: Label { text: qsTr("List of applications (wiki)"); width: slideshow.width * .5 wrapMode: Text.WordWrap } } } Label { text: "
"+qsTr("You can find details of how to contact the community by selecting the More information tab."); width: slideshow.width * .9; padding: 5 wrapMode: Text.WordWrap textFormat: Text.RichText } Button { id: rpmdrake objectName: "launch" onClicked: { launch.command(["rpmdrake",])} style: ButtonStyle { label: Label { text: qsTr("RPMdrake")+" *"; width: slideshow.width * .35 wrapMode: Text.WordWrap } } } } Label { anchors {bottom: parent.bottom; horizontalCenter: parent.horizontalCenter} text: qsTr("(*) Administrator password is needed") width: slideshow.width * .45 padding: 5 wrapMode: Text.WordWrap font.italic: true } } // Applications page Rectangle { property var title: qsTr("Applications") width: view.width; height: view.height LinearGradient { anchors.fill: parent start: Qt.point(0, 0) end: Qt.point(0, 1000) gradient: Gradient { GradientStop { position: 0.0; color: "white" } GradientStop { position: 1.0; color: "#2397D4" } } } Column { Rectangle { // Bandeau avertissement id: warning width: view.width height: 60 color: "gold" Label {anchors {verticalCenter: parent.verticalCenter; } leftPadding: 15 text: qsTr("Here is a small selection of popular applications - any of which may be installed at this point.")+"
"+ "You can install an application or launch it if already installed. Ensure that you have enabled the Media sources." textFormat: Text.RichText } } Row { // Under the warning Column { // Software categories id:categoriesColumn Component { //The hightlight id: catHighlight Rectangle { width: 190 height: 30 anchors.horizontalCenter: parent.horizontalCenter color: "#2397D4" y: categoriesList.currentItem.y; } } ListView { id:categoriesList anchors {left: parent.left;} width: 190 highlight: catHighlight highlightFollowsCurrentItem: false focus: true model: [{'name': qsTr("Featured"), 'group': "featured"}, {'name': qsTr("Games"),'group': "games"}, {'name':qsTr("Internet"),'group': "internet"}, {'name':qsTr("Video"),'group': "video"}, {'name':qsTr("Audio"),'group': "audio"}, {'name':qsTr("Office"),'group': "office"}, {'name':qsTr("Graphics"),'group': "graphics"}, {'name':qsTr("System"),'group': "system"}, {'name':qsTr("Programming"),'group': "programming"}] height: 30 * 9 delegate: Rectangle{ width: parent.width height: 30 color:"#202397D4" Label {id: catLabel; text: modelData.name ; padding: 5 color: categoriesList.currentIndex === index ? "white" : "black"} MouseArea { anchors.centerIn: parent width: parent.width height: 25 onClicked: { categoriesList.currentIndex = index appListDM.items.remove(0,appListDM.count ); var rowCount = appList.count; for( var i = 0;i < rowCount;i++ ) { var entry = appList.get(i); entry.installable = installable.installable(entry.name, entry.inst_repo) var pattern = new RegExp(modelData.group, "g"); if(pattern.test(entry.group) ) { appListDM.items.insert(entry, "group"); } } appListDM.filterOnGroup = "items";} } } } } Rectangle { // Software list height: box.height - 222 x: 200 DelegateModel { id: appListDM model: AppList {id: appList} groups: [ DelegateModelGroup { includeByDefault: false name: "group" } ] filterOnGroup: "group" Component.onCompleted: { var rowCount = appList.count; items.remove(0,rowCount); for( var i = 0;i < rowCount;i++ ) { var entry = appList.get(i); var pattern = /featured/g; entry.installable = installable.installable(entry.name, entry.inst_repo) if(pattern.test(entry.group) ) { items.insert(entry, "group"); } } } delegate: Row { Image { source: icon width: 32 height: 32 } //CheckBox{ enabled: installable //} Column{ Label { text: title font.bold: true } Label { text: description width: view.width - (200 + 32 +30 + 100) wrapMode: Text.WordWrap } } Column{ Loader { Component { id: repotag Rectangle { color: "red" radius: 3 width: 70; height: 20 Label { anchors.centerIn: parent text: repo } } } Component { id: dumm; Label {text: " "}} sourceComponent: repo == "" ? dumm : repotag } Loader { Component { id: button; Button { width: view.width * .07 objectName: "launch" onClicked: { launch.command(["gurpmi",name,])} style: ButtonStyle { label: Label { horizontalAlignment: TextInput.AlignHCenter text: qsTr("Install"); } } } } Component { id: launcher; Button { width: view.width * .07 objectName: "launch" onClicked: { launch.command([command,])} style: ButtonStyle { label: Label { horizontalAlignment: TextInput.AlignHCenter text: qsTr("Launch"); } } } } Component { id: dummy;Label {text: " "; } } sourceComponent: (installable === "True") ? button : (command === "" ? dummy : launcher) } } } } Rectangle { height: view.height-warning.height width: view.width-200 color: "transparent" ListView { id: applicationsListView anchors.fill: parent clip: true model: appListDM spacing: 5 } } } } } } // Configuration summary Page Rectangle { property var title: qsTr("Your configuration") width: view.width; height: view.height LinearGradient { anchors.fill: parent start: Qt.point(0, 0) end: Qt.point(0, 1000) gradient: Gradient { GradientStop { position: 0.0; color: "white" } GradientStop { position: 1.0; color: "#2397D4" } } } ListView { id: confList anchors.fill: parent anchors.margins: 50 model: ConfList delegate: Label { text: name textFormat: Text.RichText } } } // Links page Rectangle { property var title: qsTr("More information") width: view.width; height: view.height LinearGradient { anchors.fill: parent start: Qt.point(0, 0) end: Qt.point(0, 1000) gradient: Gradient { GradientStop { position: 0.0; color: "white" } GradientStop { position: 1.0; color: "#2397D4" } } } Column { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter Grid { columns: 3 spacing: view.width * .03 Label { horizontalAlignment: TextInput.AlignHCenter width: view.width * .2 text: qsTr("Documentation") wrapMode: Text.WordWrap font.bold: true } Label { horizontalAlignment: TextInput.AlignHCenter width: view.width * .2 text: qsTr("Support") wrapMode: Text.WordWrap font.bold: true } Label { horizontalAlignment: TextInput.AlignHCenter width: view.width * .2 text: qsTr("Community") wrapMode: Text.WordWrap font.bold: true } Repeater{ model: [{'name': qsTr("Release notes"), 'url': qsTr("https://wiki.mageia.org/en/Mageia_7_Release_Notes")}, {'name': qsTr("Forums"),'url': qsTr("https://forums.mageia.org/en/")}, {'name': qsTr("Community Center"),'url': qsTr("https://www.mageia.org/community/")}, {'name': qsTr("Errata"), 'url': qsTr("https://wiki.mageia.org/en/Mageia_7_Errata")}, {'name': qsTr("Wiki"), 'url': qsTr("https://wiki.mageia.org/en/Documentation")}, {'name': qsTr("Contribute"),'url': qsTr("https://www.mageia.org/contribute/")}, {'name': qsTr("Newcomers Howto"),'url': qsTr("https://wiki.mageia.org/en/Newcomers_start_here")}, {'name': qsTr("Chat Room"),'url': qsTr("irc://irc.freenode.net/#mageia")}, {'name': qsTr("Donations"),'url': qsTr("https://www.mageia.org/donate/")}, {'name': qsTr("Documentation"),'url': qsTr("https://wiki.mageia.org/en/Documentation")}, {'name': qsTr("Bugs tracker"),'url': qsTr("https://bugs.mageia.org/")}, {'name': qsTr("Join us!"),'url': qsTr("https://identity.mageia.org/")}] delegate: Button { width: view.width * .2 objectName: "link" onClicked: { link.weblink(modelData.url)} style: ButtonStyle { label: Label { text: modelData.name horizontalAlignment: TextInput.AlignHCenter width: parent.width wrapMode: Text.WordWrap } } } } } } } } ListView { id: view z: 1 anchors.rightMargin: 0 anchors.leftMargin: 0 anchors.topMargin: 0 anchors { fill: parent; bottomMargin: 30 } model: itemModel preferredHighlightBegin: 0; preferredHighlightEnd: 0 highlightRangeMode: ListView.StrictlyEnforceRange orientation: ListView.Horizontal snapMode: ListView.SnapOneItem; flickDeceleration: 2000 highlightFollowsCurrentItem: true highlightMoveDuration: 800 cacheBuffer: 200 } } Rectangle { id: buttonbox width: banner.width; height: 46 anchors { top: banner.bottom; } color: "#2397D4" Row { anchors.centerIn: parent spacing: 10 Repeater { model: itemModel.count Rectangle { width: banner.width/9; height: 35 radius: 5 color: view.currentIndex == index ? "#262F45" : "white" Label{ anchors.verticalCenter: parent.verticalCenter text: itemModel.get(index).title font.pointSize: 8 width: parent.width color: view.currentIndex == index ? "white" : "#262F45" horizontalAlignment: Text.AlignHCenter wrapMode : Text.WordWrap } MouseArea { width: banner.width/8; height: 35 anchors.centerIn: parent onClicked: view.currentIndex = index } } } } } Row { anchors.right: box.right anchors.bottom: box.bottom anchors.margins: 6 CheckBox { text: qsTr("Show this window at startup") checked: startupcheck onClicked: norun.setRunAtLaunch(checked) } } }