summaryrefslogtreecommitdiffstats
path: root/qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml')
-rw-r--r--qml/AppList.qml2
-rw-r--r--qml/MButton.qml21
-rw-r--r--qml/Version.qml2
-rw-r--r--qml/helpers.py4
-rw-r--r--qml/img/pysol01.pngbin0 -> 2696 bytes
-rw-r--r--qml/mageiawelcome.py44
-rw-r--r--qml/mw-ui.qml833
7 files changed, 516 insertions, 390 deletions
diff --git a/qml/AppList.qml b/qml/AppList.qml
index b6e3f3c..6f04606 100644
--- a/qml/AppList.qml
+++ b/qml/AppList.qml
@@ -13,6 +13,7 @@ ListElement { group: "games";description: qsTr("Kart racing game featuring Tux a
ListElement { group: "games";description: qsTr("Postnuclear realtime strategy"); title: "Warzone 2100";name: "warzone2100";command: "warzone2100";repo: "";icon: "img/warzone2100.png";}
ListElement { group: "games";description: qsTr("Fantasy turn-based strategy game"); title: "Battle for Wesnoth";name: "wesnoth";command: "wesnoth";repo: "";icon: "img/wesnoth.png";}
ListElement { group: "games";description: qsTr("RTS Game of Ancient Warfare"); title: "O A.D";name: "0ad";command: "0ad";repo: "";icon: "img/0ad.png";}
+ListElement { group: "games";description: qsTr("A collection of more than 1000 solitaire card games"); title: "PySolFC";name: "PySolFC";command: "pysol";repo: "";icon: "img/pysol01.png";}
ListElement { group: "graphics";description: qsTr("3d modeller/renderer"); title: "Blender";name: "blender";command: "blender.nonsse";repo: "";icon: "img/blender.png";}
ListElement { group: "graphics";description: qsTr("Painting program"); title: "MyPaint";name: "mypaint";command: "mypaint";repo: "";icon: "img/mypaint.png";}
ListElement { group: "graphics";description: qsTr("The GNU Image Manipulation Program"); title: "GIMP";name: "gimp";command: "gimp";repo: "";icon: "img/gimp.png";}
@@ -24,7 +25,6 @@ ListElement { group: "internet";description: qsTr("Full-featured graphical ftp/f
ListElement { group: "internet featured";description: qsTr("Next-generation web browser"); title: "Firefox";name: "firefox";command: "firefox";repo: "";icon: "img/firefox.png";}
ListElement { group: "internet featured";description: qsTr("Lightweight but feature rich bittorrent client"); title: "Qbittorrent";name: "qbittorrent";command: "qbittorrent";repo: "";icon: "img/qbittorrent.png";}
ListElement { group: "internet";description: qsTr("Fast Webbrowser"); title: "Chromium";name: "chromium-browser";command: "chromium-browser";repo: "";icon: "img/chromium.png";}
-ListElement { group: "internet";description: qsTr("File sharing client compatible with eDonkey"); title: "Amule";name: "amule";command: "amule";repo: "";icon: "img/amule.png";}
ListElement { group: "internet";description: qsTr("E-mail, news and RSS client"); title: "Thunderbird";name: "thunderbird";command: "thunderbird";repo: "";icon: "img/thunderbird.png";}
ListElement { group: "internet";description: qsTr("Fast e-mail client"); title: "Claws Mail";name: "claws-mail";command: "claws-mail";repo: "";icon: "img/claws-mail.png";}
ListElement { group: "video featured";description: qsTr("Media Player"); title: "Smplayer";name: "smplayer";command: "smplayer";repo: "";icon: "img/smplayer.png";}
diff --git a/qml/MButton.qml b/qml/MButton.qml
new file mode 100644
index 0000000..f7085e3
--- /dev/null
+++ b/qml/MButton.qml
@@ -0,0 +1,21 @@
+// MButton.qml
+// Customized button
+import QtQuick 2.0
+import QtGraphicalEffects 1
+
+Rectangle {
+ id:mbutton
+ property alias buttonText: textItem.text
+ width: textItem.implicitWidth + 10
+ height: textItem.implicitHeight + 10
+ color: "lightgrey"
+ radius: 5
+ signal mbuttonClicked
+ MouseArea {
+ anchors.fill: parent
+ onClicked: mbuttonClicked()
+ }
+ Text {id: textItem
+ anchors.centerIn: parent
+ }
+ }
diff --git a/qml/Version.qml b/qml/Version.qml
new file mode 100644
index 0000000..c5356bf
--- /dev/null
+++ b/qml/Version.qml
@@ -0,0 +1,2 @@
+import QtQuick 2.0
+Item { property var version: '1.93';}
diff --git a/qml/helpers.py b/qml/helpers.py
index 7d69eb1..f777f04 100644
--- a/qml/helpers.py
+++ b/qml/helpers.py
@@ -3,8 +3,6 @@
import gettext
import rpm
-ts = rpm.TransactionSet()
-
def get_desktop_name(x):
return {
'01plasma':'KDE Plasma',
@@ -33,7 +31,7 @@ def get_desktop_name2(x):
def is_installed(name):
- mi = ts.dbMatch('name', name)
+ mi = rpm.TransactionSet().dbMatch('name', name)
release = ""
for h in mi:
release = (h['release']).decode("utf-8")
diff --git a/qml/img/pysol01.png b/qml/img/pysol01.png
new file mode 100644
index 0000000..d730851
--- /dev/null
+++ b/qml/img/pysol01.png
Binary files differ
diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py
index b5e13da..8986333 100644
--- a/qml/mageiawelcome.py
+++ b/qml/mageiawelcome.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-from PyQt5.QtGui import QGuiApplication, QIcon
+from PyQt5.QtGui import QGuiApplication, QIcon, QScreen
from PyQt5.QtQuick import QQuickView
from PyQt5.QtCore import QUrl, QLocale, QTranslator, QLibraryInfo, QVariant, QAbstractListModel, \
QModelIndex, Qt, QObject, pyqtSlot, pyqtSignal, QCoreApplication
@@ -43,6 +43,14 @@ class ConfList(QAbstractListModel):
desktop = get_desktop_name2(os.getenv("XDG_CURRENT_DESKTOP"))
if desktop == 'unknown':
desktop = os.getenv("XDG_CURRENT_DESKTOP")
+ self.screen_factor = 0.0
+ if desktop == 'Gnome Wayland':
+ import gi
+ gi.require_version('Gdk', '3.0')
+ from gi.repository.Gdk import Display
+ # pre-3.22, otherwise deprecated
+ #factor = Gdk.Screen.get_default().get_monitor_scale_factor(0)
+ self.screen_factor = Display.get_default().get_monitor(0).get_scale_factor()
# Search active network connections
net = QNetworkConfigurationManager()
@@ -57,7 +65,7 @@ class ConfList(QAbstractListModel):
netconfs += ", " + conf.name()
self.configuration = [
- {'name': translate('ConfList',"<b>Congratulations!</b><BR />You have completed the installation of {}").format(release)},
+ {'name': translate('ConfList',"<b>Congratulations!</b><BR />You have are now running {}").format(release)},
{'name': translate('ConfList',"You are using linux kernel: {}").format(kernel)},
{'name': translate('ConfList',"Your system architecture is: {}").format(arch)},
{'name': translate('ConfList',"You are now using the Desktop: {}").format(desktop)},
@@ -68,6 +76,15 @@ class ConfList(QAbstractListModel):
else:
self.configuration.append({'name': translate('ConfList',"You have no network connection")})
+ def factor(self, app):
+ '''
+ Determine screen factor
+ Can be specific for Gnome Wayland
+ '''
+ if self.screen_factor == 0 :
+ screen = app.primaryScreen()
+ self.screen_factor = screen.devicePixelRatio()
+ return self.screen_factor
def data(self, index, role=Qt.DisplayRole):
row = index.row()
@@ -104,9 +121,8 @@ class Launcher(QObject):
if cmd[0] == "gurpmi":
proc.wait()
print(proc.returncode)
- if (proc.returncode == 0):
- # Give the signal to reload the applist
- self.installed.emit()
+ # Give the signal to reload the applist
+ self.installed.emit()
class Norun(QObject):
def __init__(self):
@@ -136,9 +152,15 @@ class Installable(QObject):
@pyqtSlot(str, str, result=bool)
def installable(self, app,repo):
is_app_installed, inst_repo = is_installed(app)
- installable = (not is_app_installed) or (repo != inst_repo and inst_repo != "")
+ installable = (not is_app_installed) or (repo != inst_repo and inst_repo == "")
return installable
+ @pyqtSlot(str, str, result=bool)
+ def other(self, app, repo):
+ is_app_installed, inst_repo = is_installed(app)
+ return (is_app_installed and repo == '' and inst_repo != "")
+
+
def username():
user = pwd.getpwuid(os.getuid())[4] # pw_gecos, i e the real name
if user == "":
@@ -154,10 +176,12 @@ if __name__ == '__main__':
appTranslator = QTranslator()
if appTranslator.load(QLocale(),"mageiawelcome","_", '/usr/share/mageiawelcome/translations'):
app.installTranslator(appTranslator)
+ app.setOrganizationName("Mageia")
+ app.setApplicationName("Mageiawelcome")
view = QQuickView()
view.setResizeMode(QQuickView.SizeRootObjectToView)
view.setTitle(app.translate('app',"Welcome to Mageia"))
- app.setWindowIcon(QIcon("icons/32x32/apps/mageiawelcome.png"))
+ app.setWindowIcon(QIcon("/usr/share/icons/hicolor/32x32/apps/mageiawelcome.png"))
cb = Callbrowser()
la = Launcher()
us = username()
@@ -165,6 +189,12 @@ if __name__ == '__main__':
cl = ConfList()
nr = Norun()
sc = nr.startupcheck()
+ factor = cl.factor(app)
+ screen = app.primaryScreen()
+ defaultHeight = 700 * factor
+ defaultWidth = 1000 * factor
+ centerPoint = screen.availableGeometry().center()
+ view.setGeometry(centerPoint.x() -defaultWidth/2, centerPoint.y() - defaultHeight/2, defaultWidth,defaultHeight)
view.rootContext().setContextProperty('link', cb)
view.rootContext().setContextProperty('launch', la)
view.rootContext().setContextProperty('user', us)
diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml
index 334c06d..40fa2e4 100644
--- a/qml/mw-ui.qml
+++ b/qml/mw-ui.qml
@@ -5,20 +5,34 @@ 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; height: 650
+ width: 1000 * Screen.devicePixelRatio; height: 650 * 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)
+ end: Qt.point(0, box.height)
gradient: Gradient {
- GradientStop { position: 0.0; color: "#2397D4" }
- GradientStop { position: 1.0; color: "#262F45" }
+ GradientStop { position: 1.0; color: "#2397D4" }
+ GradientStop { position: 0.0; color: "#262F45" }
}
}
}
@@ -94,150 +108,201 @@ Rectangle {
Loader { sourceComponent: slidebackground ;
anchors.fill: parent}
- Column {
- anchors.left: parent.left
- anchors.leftMargin: 20
- y: 35
- Label { text: qsTr("Configure software repositories"); font.bold: true;
- color: "white" }
- Label { text: qsTr("Mageia official repositories contain:");
- color: "white" }
- 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
+ //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
- Label {
- anchors.centerIn: parent
- text: qsTr("core"); }
+ //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 * .6
+ Layout.maximumWidth: slideshow.width -20 - coreBg.width
color: "white"
}
-
- 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
+ Button {
+ Layout.margins: 5
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
- Label {
- anchors.centerIn: parent
- text: qsTr("nonfree");
- color: "white"}
+ 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 * .8
+ Layout.maximumWidth: slideshow.width - 110
wrapMode: Text.WordWrap
color: "white"
}
- 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
+ Button {
+ Layout.margins: 5
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
- Label {
- anchors.centerIn: parent
- text: qsTr("tainted");
- color: "white" }
+ 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 * .8
+ Layout.maximumWidth: slideshow.width -110
color: "white"
}
- Rectangle {
- color: "lightgrey"
- width: 80; height: 30
+ Button {
+ Layout.margins: 5
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
- Label { anchors.centerIn: parent
- text: qsTr("backports"); }
+ 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("- includes software published after a Mageia release, or another version of software already present and not replaced.");
+ text: qsTr("- include new versions of packages, and new packages, that do not meet the updates policy.");
wrapMode: Text.WordWrap
- Layout.maximumWidth: slideshow.width * .8
+ Layout.maximumWidth: slideshow.width -110
color: "white"
}
Button {
- Layout.maximumWidth: slideshow.width * .25
- Layout.columnSpan: 2
- Layout.alignment: Qt.AlignHCenter
- objectName: "launch"
- onClicked: { launch.command(["drakrpm-edit-media",])}
+ Layout.margins: 5
+ Layout.alignment: Qt.AlignTop
+ Layout.fillWidth: true
style: ButtonStyle {
label: Label {
- text: qsTr("Edit software repositories")+" *";
- width: parent.width
- wrapMode: Text.WordWrap
- color: "black"
+ horizontalAlignment: TextInput.AlignHCenter
+ text: qsTr("Note! ");
+ font.bold: true; color: "black";
+ }
+ background: Rectangle {
+ color: "#e6c200";
}
+
}
}
- 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 <i>cdrom</i> entry from the list of repositories.")+"<BR /><BR />"+
- qsTr("Now, please enable or disable the online repositories of your choice: click on the <i>Edit software repositories</i> button. Select at least the <i>release</i> and <i>updates</i> pair. <i>Debug</i> and <i>Testing</i> are for special cases.")+"<BR />"+
- qsTr("After you have checked and enabled the repositories you need, you can go to the next slide.<BR />");
+ If this computer will have access to the Internet, you can delete the <i>Local</i> 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 <i>Edit software repositories</i> button. Select at least the <i>release</i> and <i>updates</i> pair. <i>Debug</i> and <i>Testing</i> are for special cases.")+"<BR />"+
+ 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 * .85
+ 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 {
- x: 84
+ anchors {top: parent.bottom; topMargin: 3; horizontalCenter: parent.left; horizontalCenterOffset: parent.width * .4 }
text: qsTr("(*) Administrator password is needed.")
- Layout.maximumWidth: slideshow.width * .25
- wrapMode: Text.WordWrap
+ Layout.maximumWidth: slideshow.width * .4
font.italic: true
color: "white"
}
- }
+
}
// Update page
Rectangle {
@@ -246,55 +311,37 @@ Rectangle {
Loader { sourceComponent: slidebackground ;
anchors.fill: parent}
Column {
- x:10; y: 30
spacing: 10
- Label { text: qsTr("How Mageia manages updates"); font.bold: true; padding: 10
+ Label { text: qsTr("How Mageia manages updates"); font.bold: true;
+ topPadding: 30 ; leftPadding: 20
color: "white"}
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 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");
+ 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 {
- x:10
- width: view.width * .18;
+ MButton {
+ 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"
- }
- }
+ onMbuttonClicked: { launch.command(["drakrpm-update",])}
+ buttonText: qsTr("Check system updates")+" *"
}
- Button {
- x:10
- width: view.width * .18;
+ MButton {
+ 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"
- }
- }
+ //: (en) indicates that the content of the link is in English
+ onMbuttonClicked: { link.weblink("https://advisories.mageia.org/")}
+ buttonText: qsTr("Advisories of updates (en)")
}
}
Label {
- anchors {bottom: parent.bottom; }
- anchors.bottomMargin: 10
- x:20
+ 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
@@ -322,6 +369,7 @@ Rectangle {
}
Label {
padding: 5
+ anchors.horizontalCenter: parent.horizontalCenter
text: "<ul><li>"+qsTr("Software Management")+"</li><li>"
+ qsTr("Hardware")+"</li><li>"
+ qsTr("Network and Internet")+"</li><li>"
@@ -330,47 +378,25 @@ Rectangle {
+ qsTr("Local Disks")+"</li><li>"
+ qsTr("Security")+"</li><li>"
+ qsTr("Boot")+"</li></ul>";
- width: view.width/2; wrapMode: Text.WordWrap;textFormat: Text.RichText
+ wrapMode: Text.WordWrap;textFormat: Text.RichText
color: "white"
}
-
- Button {
- id: mcc
- x: 10
- width: view.width * .18;
+ MButton {
+ anchors.horizontalCenter: parent.horizontalCenter
objectName: "launch"
- onClicked: { launch.command(["drakconf"])}
- style: ButtonStyle {
- label: Label {
- horizontalAlignment: TextInput.AlignHCenter
- text: qsTr("Mageia Control Center")+" *";
- width: parent.width
- wrapMode: Text.WordWrap
- color: "black"
- }
- }
+ onMbuttonClicked: { launch.command(["drakconf",])}
+ buttonText: qsTr("Mageia Control Center")+" *"
+ }
+ MButton {
+ anchors.horizontalCenter: parent.horizontalCenter
+ objectName: "link"
+ onMbuttonClicked: { link.weblink("https://www.mageia.org/doc")}
+ buttonText: qsTr("MCC documentation")
}
- Button {
- x: 10
- width: view.width * .18;
- objectName: "link"
- onClicked: { link.weblink("https://www.mageia.org/doc")}
- style: ButtonStyle {
- label: Label {
- horizontalAlignment: TextInput.AlignHCenter
- text: qsTr("MCC documentation");
- width: parent.width
- wrapMode: Text.WordWrap
- color: "black"
- }
- }
- }
}
Label {
- anchors {bottom: parent.bottom; }
- anchors.bottomMargin: 10
- x:20
+ anchors {top: parent.bottom; topMargin: 3; horizontalCenter: parent.left; horizontalCenterOffset: parent.width * .4 }
text: qsTr("(*) Administrator password is needed")
wrapMode: Text.WordWrap
font.italic: true
@@ -384,12 +410,10 @@ Rectangle {
Loader { sourceComponent: slidebackground ;
anchors.fill: parent}
Column {
- //anchors.left: parent.left
- //anchors.verticalCenter: parent.verticalCenter
- x:10; y: 30
Label {
text: qsTr("Install and remove software")
- width: slideshow.width * .9
+ width: slideshow.width
+ topPadding: 30; leftPadding: 20;
padding: 10
font.bold: true
wrapMode: Text.WordWrap
@@ -397,70 +421,46 @@ Rectangle {
}
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: 10
+ width: slideshow.width
+ padding: 20
wrapMode: Text.WordWrap
textFormat: Text.RichText
color: "white"
}
+ MButton {
+ anchors.left: parent.left; anchors.leftMargin: 20;
+ width: slideshow.width * .35
+ objectName: "launch"
+ onMbuttonClicked: { launch.command(["rpmdrake",])}
+ buttonText: qsTr("RPMdrake")+" *"
+ }
Label {
text: qsTr("The next slide shows a small selection of popular applications - any of which may be installed at this point.<BR/>");
- width: slideshow.width * .9;
- padding: 10
+ width: slideshow.width
+ padding: 20
wrapMode: Text.WordWrap
textFormat: Text.RichText
color: "white"
}
Label {
text: qsTr("You can find a more detailed list here:");
- width: slideshow.width * .9;
- padding: 10
+ width: slideshow.width
+ padding: 20
wrapMode: Text.WordWrap
textFormat: Text.RichText
color: "white"
}
- Button {
- id: listApplicationsWiki
- x: 10
+ MButton {
+ anchors.left: parent.left; anchors.leftMargin: 20
+ width: slideshow.width * .35
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
- color: "black"
- }
- }
- }
- Label {
- text: "<BR />"+qsTr("You can find details of how to contact the community by selecting the <i>More information</i> tab.");
- width: slideshow.width * .9;
- padding: 10
- wrapMode: Text.WordWrap
- textFormat: Text.RichText
- color: "white"
- }
- Button {
- id: rpmdrake
- x: 10
- objectName: "launch"
- onClicked: {
- launch.command(["rpmdrake",])}
- style: ButtonStyle {
- label: Label {
- text: qsTr("RPMdrake")+" *";
- width: slideshow.width * .35
- wrapMode: Text.WordWrap
- color: "black"
- }
- }
+ //: Translate only if the link is to a specific page for your language
+ onMbuttonClicked: { link.weblink(qsTr("https://wiki.mageia.org/en/List_of_applications"))}
+ buttonText: qsTr("List of applications (wiki)")
}
}
Label {
- anchors {bottom: parent.bottom; }
- anchors.bottomMargin: 10
- x:20
+ anchors {top: parent.bottom; topMargin: 3; horizontalCenter: parent.left; horizontalCenterOffset: parent.width * .4 }
text: qsTr("(*) Administrator password is needed")
wrapMode: Text.WordWrap
font.italic: true
@@ -475,10 +475,15 @@ Rectangle {
{
var entry = appList.get(i);
var pattern = new RegExp(group, "g");
- if(pattern.test(entry.group) ) {
+ if(pattern.test(entry.group) && !pyinstallable.other(entry.name, entry.repo)) {
appListDM.items.insert(entry, "group");
}
}
+ for(var child in applicationsListView.contentItem.children) {
+ if (applicationsListView.contentItem.children[child].naturalwidth > softListRect.installwidth ) {
+ softListRect.installwidth = applicationsListView.contentItem.children[child].naturalwidth
+ }
+ }
appListDM.filterOnGroup = "items";
}
@@ -490,7 +495,7 @@ Rectangle {
Column {
Rectangle {
- // Bandeau avertissement
+ // warning banner
id: warning
width: view.width
height: warnText.height
@@ -500,23 +505,27 @@ Rectangle {
width: view.width
horizontalAlignment: TextInput.AlignHCenter
font.pixelSize: Qt.application.font.pixelSize * .9
- text: qsTr("Here is a small selection of popular applications - any of which may be installed or launched at this point.")+"<BR />"+"Ensure that you have enabled the <i>Media sources</i>."
+ text: qsTr("Here is a small selection of popular applications - any of which may be installed or launched at this point.")+"<BR />"+qsTr("Ensure that you have enabled the <i>Media sources</i>.")
textFormat: Text.RichText
wrapMode: Text.WordWrap
+ color: "black"
+ font.weight: Font.DemiBold
}
}
- Row {
- // Under the warning
- Column {
+ Item {
+ width: row.width
+ height: 200
+ Row {
+ id: row
+ // Under the warning
+
// Software categories
- id:categoriesColumn
- Component { //The hightlight
+ Component { //The hightlight
id: catHighlight
Rectangle {
- width: 190
+ width: categoriesList.width
height: Qt.application.font.pixelSize + 16
- anchors.horizontalCenter: parent.horizontalCenter
color: "#262F45"
y: categoriesList.currentItem.y;
}
@@ -524,7 +533,6 @@ Rectangle {
ListView {
id:categoriesList
- anchors {left: parent.left;}
width: 190
highlight: catHighlight
highlightFollowsCurrentItem: false
@@ -562,137 +570,155 @@ Rectangle {
}
}
- }
- Rectangle {
- // Software list
- height: box.height - 222
- x: 210
-
- DelegateModel {
- id: appListDM
- model: AppList {id: appList}
- groups: [
- DelegateModelGroup {
- includeByDefault: false
- name: "group"
+ Rectangle {
+ // Software list
+ id: softListRect
+ height: view.height
+ width: view.width - categoriesList.width
+ color: "transparent"
+ // the width of install and Launch button will be calculated then updated. We give here a minimal size
+ property real installwidth: Qt.application.font.pixelSize * 2
+
+ 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;
+ if(pattern.test(entry.group) && !pyinstallable.other(entry.name, entry.repo) ) {
+ items.insert(entry, "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;
- if(pattern.test(entry.group) ) {
- items.insert(entry, "group");
- }
- }
- }
- delegate: Row {
- spacing: 10
- Image {
- source: icon
- width: 32
- height: 32
- }
- //CheckBox{ enabled: installable
- //}
- Column{
- Label {
- text: title
- font.weight: Font.DemiBold
- color: "white"
}
- Label {
- text: description
- font.italic: true
- font.pixelSize: Qt.application.font.pixelSize * .9
- width: view.width - (200 + 44 +38 + Qt.application.font.pixelSize * 4 * 2)
- wrapMode: Text.WordWrap
- color: "white"
+ // The lsit has to be painted first for buttons width evaluation
+ applicationsListView.forceLayout()
+ for(var child in applicationsListView.contentItem.children) {
+ if (applicationsListView.contentItem.children[child].naturalwidth > softListRect.installwidth ) {
+ softListRect.installwidth = applicationsListView.contentItem.children[child].naturalwidth
+ }
}
+ console.log("Screen: ", Screen.devicePixelRatio, Screen.pixelDensity)
+ }
+ delegate: Row {
+ spacing: 10
+ property int naturalwidth : optButton.item.implicitWidth
+ Image {
+ source: icon
+ width: 32
+ height: 32
}
+ //CheckBox{ enabled: installable
+ //}
+ Column{
+ Label {
+ text: title
+ font.weight: Font.DemiBold
+ color: "white"
+ }
+ Label {
+ text: description
+ font.italic: true
+ font.pixelSize: Qt.application.font.pixelSize * .9
+ width: view.width - (190 + 44 +38 + softListRect.installwidth + tag.width )
+ wrapMode: Text.WordWrap
+ color: "white"
+ }
+ }
- Loader {
- Component { id: button;
- Button {
- width: Qt.application.font.pixelSize * 4; height: Qt.application.font.pixelSize * 1.3
- objectName: "launch"
- onClicked: {
- launch.command(["gurpmi",name,])}
- style: ButtonStyle {
- label: Label {
- horizontalAlignment: TextInput.AlignHCenter
- verticalAlignment: TextInput.AlignVCenter
- text: qsTr("Install");
- font.pixelSize: Qt.application.font.pixelSize * .8
- color: "black"
+ Loader {
+ id: optButton
+ Component { id: button;
+ Button {
+ width: softListRect.installwidth;
+ height: Qt.application.font.pixelSize * 1.3
+ objectName: "launch"
+ onClicked: {
+ launch.command(["gurpmi",name,])}
+ style: ButtonStyle {
+ label: Label {
+ horizontalAlignment: TextInput.AlignHCenter
+ verticalAlignment: TextInput.AlignVCenter
+ text: qsTr("Install");
+ font.pixelSize: Qt.application.font.pixelSize * .8
+ color: "black"
+ }
}
}
}
-
- }
- Component { id: launcher;
- Button {
- width: Qt.application.font.pixelSize * 4; height: Qt.application.font.pixelSize * 1.3
- objectName: "launch"
- onClicked: {
- launch.command([command,])}
- style: ButtonStyle {
- label: Label {
- horizontalAlignment: TextInput.AlignHCenter
- verticalAlignment: TextInput.AlignVCenter
- text: qsTr("Launch");
- font.pixelSize: Qt.application.font.pixelSize * .8
- color: "black"
+ Component { id: launcher;
+ Button {
+ width: softListRect.installwidth;
+ height: Qt.application.font.pixelSize * 1.3
+ objectName: "launch"
+ onClicked: {
+ launch.command([command,])}
+ style: ButtonStyle {
+ label: Label {
+ horizontalAlignment: TextInput.AlignHCenter
+ verticalAlignment: TextInput.AlignVCenter
+ text: qsTr("Launch");
+ font.pixelSize: Qt.application.font.pixelSize * .8
+ color: "black"
+ }
}
}
}
- }
- Component { id: dummy;Label {text: qsTr("Installed")
- padding: 2
- horizontalAlignment: TextInput.AlignHCenter
- font.pixelSize: Qt.application.font.pixelSize * .8
- width: Qt.application.font.pixelSize * 4
- color: "white"
+ Component { id: dummy;Label {text: qsTr("Installed")
+ padding: 2
+ horizontalAlignment: TextInput.AlignHCenter
+ font.pixelSize: Qt.application.font.pixelSize * .8
+ width: softListRect.installwidth
+ color: "white"
+ }
}
+ sourceComponent: ( pyinstallable.installable(name, repo)) ? button : (command === "" ? dummy : launcher)
}
- sourceComponent: ( pyinstallable.installable(name, repo)) ? button : (command === "" ? dummy : launcher)
- }
- Loader {
- Component {
- id: repotag
- Rectangle {
- color: "#FF4C4C"
- radius: 3
- width: Qt.application.font.pixelSize * 3.2; height: Qt.application.font.pixelSize * 1.3
- Label {
- anchors.centerIn: parent
- text: repo
- font.pixelSize: Qt.application.font.pixelSize * .8
- color: "white"
+ Loader {
+ id: tag
+ Component {
+ id: repotag
+ Rectangle {
+ color: "#FF4C4C"
+ radius: 3
+ width: Qt.application.font.pixelSize * 3.5; height: Qt.application.font.pixelSize * 1.3
+ Label {
+ anchors.centerIn: parent
+ text: repo
+ font.pixelSize: Qt.application.font.pixelSize * .8
+ color: "white"
+ }
}
}
+ Component { id: dumm;
+ Label {
+ width: Qt.application.font.pixelSize * 3.5;
+ text: " "}}
+ sourceComponent: repo == "" ? dumm : repotag
}
- Component { id: dumm; Label {text: " "}}
- sourceComponent: repo == "" ? dumm : repotag
}
+ }
+ Rectangle {
+ height: view.height-warning.height
+ width: view.width-200
+ color: "transparent"
+ ListView {
+ id: applicationsListView
+ anchors.fill: parent
+ clip: true
+ model: appListDM
+ spacing: 5
}
-
- }
- Rectangle {
- height: view.height-warning.height
- width: view.width-200
- color: "transparent"
- ListView {
- id: applicationsListView
- anchors.fill: parent
- clip: true
- model: appListDM
- spacing: 5
}
}
}
@@ -701,19 +727,44 @@ Rectangle {
}
// Configuration summary Page
Rectangle {
+ Version {id:version}
property var title: qsTr("Your configuration")
width: view.width; height: view.height
Loader { sourceComponent: slidebackground ;
anchors.fill: parent}
- ListView {
- id: confList
- anchors.fill: parent
- anchors.margins: 50
- model: ConfList
- delegate: Label {
- text: name
- textFormat: Text.RichText
- color: "white"
+
+ Column {
+ Rectangle{
+ height: 50
+ width:1
+ color:"transparent"
+ }
+ ListView {
+ id: confList
+ width: view.width
+ height: view.height -150
+ model: ConfList
+ delegate: Label {
+ text: name
+ leftPadding: 50
+ textFormat: Text.RichText
+ color: "white"
+ }
+ }
+ MButton {
+ anchors.horizontalCenter: parent.horizontalCenter
+ objectName: "launch"
+ onMbuttonClicked: { about.open() }
+ buttonText: qsTr("About")
+ }
+ MessageDialog {
+ id: about
+ title: qsTr("About Mageiawelcome")
+ //: %1 will be replaced with the release number, %2 with author's names
+ text: qsTr("Release %1<br />Authors : %2").arg(version.version).arg("Daniel Napora, Papoteur, Antony Baker<br />")
+ //: replace with the list of translator's names
+ detailedText: qsTr("Translators: English is the source language")
+ standardButtons: StandardButton.Close
}
}
}
@@ -754,18 +805,30 @@ Rectangle {
color: "white"
}
Repeater{
- model: [{'name': qsTr("Release notes"), 'url': qsTr("https://wiki.mageia.org/en/Mageia_6_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_6_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/")},
+ model: [{'name': qsTr("Release notes"), 'url':
+ //: Translate only if the link is to a specific page for your language
+ qsTr("https://wiki.mageia.org/en/Mageia_6_Release_Notes")},
+ {'name': qsTr("Forums"),'url':
+ //: Translate only if the link is to a specific page for your language
+ qsTr("https://forums.mageia.org/en/")},
+ {'name': qsTr("Community Center"),'url': "https://www.mageia.org/community/"},
+ {'name': qsTr("Errata"), 'url':
+ //: Translate only if the link is to a specific page for your language
+ qsTr("https://wiki.mageia.org/en/Mageia_6_Errata")},
+ {'name': qsTr("Wiki"), 'url':
+ //: Translate only if the link is to a specific page for your language
+ qsTr("https://wiki.mageia.org/en/Documentation")},
+ {'name': qsTr("Contribute"),'url': "https://www.mageia.org/contribute/"},
+ {'name': qsTr("Newcomers Howto"),'url':
+ //: Translate only if the link is to a specific page for your language
+ qsTr("https://wiki.mageia.org/en/Newcomers_start_here")},
+ {'name': qsTr("Chat Room"),
+ //: Translate only if the link is to a specific page for your language
+ 'url': qsTr("irc://irc.freenode.net/#mageia")},
+ {'name': qsTr("Donations"),'url': "https://www.mageia.org/donate/"},
{'name': qsTr("Documentation"),'url': "https://www.mageia.org/doc/"},
- {'name': qsTr("Bugs tracker"),'url': qsTr("https://bugs.mageia.org/")},
- {'name': qsTr("Join us!"),'url': qsTr("https://identity.mageia.org/")}]
+ {'name': qsTr("Bugs tracker"),'url': "https://bugs.mageia.org/"},
+ {'name': qsTr("Join us!"),'url': "https://identity.mageia.org/"}]
delegate: Button {
width: view.width * .2
objectName: "link"
@@ -777,6 +840,10 @@ Rectangle {
color: "black"
width: parent.width
wrapMode: Text.WordWrap }
+ background: Rectangle {
+ color: "lightgrey"
+ radius: 5
+ }
}
}
}
@@ -791,7 +858,7 @@ Rectangle {
anchors.rightMargin: 0
anchors.leftMargin: 0
anchors.topMargin: 0
- anchors { fill: parent; bottomMargin: 30 }
+ anchors { fill: parent; bottomMargin: startCB.implicitHeight +10 }
model: itemModel
preferredHighlightBegin: 0; preferredHighlightEnd: 0
highlightRangeMode: ListView.StrictlyEnforceRange
@@ -804,36 +871,42 @@ Rectangle {
}
Rectangle {
id: buttonbox
- width: banner.width; height: 46
+ width: banner.width; height: buttonRow.height
anchors { top: banner.bottom; }
color: "#262F45"
+ RowLayout {
+ id: buttonRow
- Row {
- anchors.centerIn: parent
- spacing: 10
+ Rectangle {
+ Layout.preferredWidth: 8
+ Layout.preferredHeight: buttonbox.height
+ color: buttonbox.color
+ }
Repeater {
model: itemModel.count
- Rectangle {
- width: banner.width/9; height: 35
- radius: 5
- color: view.currentIndex == index ? "#2397D4" : "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
- }
+ Button {
+ Layout.fillHeight: true
- MouseArea {
- width: banner.width/8; height: 35
- anchors.centerIn: parent
- onClicked: view.currentIndex = index
+ Layout.preferredWidth: (buttonbox.width - 8)/8-9;
+ Layout.topMargin: 6
+ Layout.bottomMargin: 6
+ style: ButtonStyle {
+ background: Rectangle {
+ radius: 5
+ color: view.currentIndex == index ? "#2397D4" : "white"
+ }
+ label: Label{
+ text: itemModel.get(index).title
+ font.pointSize: 9
+ color: view.currentIndex == index ? "white" : "#262F45"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ wrapMode : Text.WordWrap
+ }
}
+ onClicked: view.currentIndex = index
}
}
}
@@ -843,6 +916,7 @@ Rectangle {
anchors.bottom: box.bottom
anchors.margins: 6
CheckBox {
+ id:startCB
text: qsTr("Show this window at startup")
checked: startupcheck
onClicked: norun.setRunAtLaunch(checked)
@@ -852,6 +926,7 @@ Rectangle {
target: launch
onInstalled: {
// get the signal to reload the applist
+ console.log("Reload applications list")
itemModel.update_list(categoriesList.currentItem.myGroup)
}
}