Commit 1f3d9db9 authored by LordTermor's avatar LordTermor Committed by LordTermor

Various fixes and further adoptions

parent 7db764ef
......@@ -23,7 +23,6 @@
<file>src/qml/Dialogs/ScreenshotViewerDialog.qml</file>
<file>src/qml/Dialogs/TransactionOptDependsDialog.qml</file>
<file>src/qml/Dialogs/TransactionSummaryDialog.qml</file>
<file>src/qml/Dialogs/TransactionSummaryDialog.qml.orig</file>
<file>src/qml/Pages/PageAURPackageInfo.qml</file>
<file>src/qml/Pages/PagePackageInfo.qml</file>
<file>src/qml/Pages/UpdatesPage.qml</file>
......
......@@ -20,7 +20,6 @@ QVariantMap QmlDialogRunner::exec(const QUrl &qmlFile,const QVariantMap& propert
QQuickView view(qobject_cast<QQmlEngine*>(parent()),nullptr);
view.installEventFilter(&filter);
view.setSource(qmlFile);
view.show();
QObject *object = view.rootObject();
for (auto it = propertiesMap.keyValueBegin();it!=propertiesMap.keyValueEnd();++it) {
......@@ -29,6 +28,7 @@ QVariantMap QmlDialogRunner::exec(const QUrl &qmlFile,const QVariantMap& propert
}
}
view.setTitle(object->property("title").toString());
view.show();
if(object->metaObject()->indexOfMethod("close()")>-1){
connect(object,SIGNAL(close()),&view,SLOT(close()));
......
......@@ -5,6 +5,8 @@ import QPamac.Database 1.0
import NotificationServices 1.0
import "../../js/JSUtils.js" as Utils
import "./SideMenu" as SideMenu
import "./" as Components
Pane {
background: Pane{
......@@ -124,7 +126,7 @@ Pane {
horizontalAlignment: Text.AlignHCenter
}
ProgressBar {
Components.ProgressBar {
value: transaction.progress
indeterminate: transaction.indeterminate
id: progressBar
......
......@@ -34,7 +34,7 @@ ToolButton {
icon.name: "edit-undo-history"
text: "View History"
onTriggered: {
DialogRunner.exec("qrc:/src/qml/HistoryDialog.qml");
DialogRunner.exec(Qt.resolvedUrl("../Dialogs/HistoryDialog.qml"));
}
}
Labs.FileDialog{
......@@ -57,14 +57,14 @@ ToolButton {
icon.name: "settings-configure"
text: "Preferences"
onTriggered: {
DialogRunner.exec(Qt.resolvedUrl("PreferencesDialog.qml"),{"transaction":transaction})
DialogRunner.exec(Qt.resolvedUrl("../Dialogs/PreferencesDialog.qml"),{"transaction":transaction})
}
}
Action {
icon.name: "help-about-symbolic"
text: "About"
onTriggered: {
DialogRunner.exec(Qt.resolvedUrl("AboutDialog.qml"));
DialogRunner.exec(Qt.resolvedUrl("../Dialogs/AboutDialog.qml"));
}
}
}
......
......@@ -41,7 +41,7 @@ LoaderDelegate{
hoveredRow=-1
}
onDoubleClicked: {
if( list.packageList.every(value=>JSUtils.qmlTypeOf(value,"AlpmPackage")))
if(list.packageList.every(value=>JSUtils.qmlTypeOf(value,"AlpmPackage")))
stackView.push("../Pages/PagePackageInfo.qml",{pkg: packageList[index]})
else
stackView.push("../Pages/PageAURPackageInfo.qml",{pkg: packageList[index]})
......@@ -168,6 +168,11 @@ LoaderDelegate{
width: 45
height: width
source:(JSUtils.isAccessible(iconUrl) && iconUrl.toString().length)?Qt.resolvedUrl("file://"+iconUrl):"image://icons/package-x-generic"
onStatusChanged: {
if (status==Image.Error){
source="image://icons/package-x-generic"
}
}
}
Column{
......
......@@ -13,7 +13,7 @@ import "../../js/JSUtils.js" as JSUtils
Table{
property var packageList: []
showHeader: false
property alias packageListFuture:packageModelWatcher.future
model:modelLoader.item
......@@ -47,7 +47,7 @@ Table{
}
showHeader: JSUtils.isAccessible(packageList) && packageList.length>0
Column{
width: implicitWidth
......
......@@ -17,7 +17,7 @@ ListView{
}
}
delegate:MenuItemDelegate {
delegate:Components.MenuItemDelegate {
text: name
onClicked:{
currentIndex=index
......
......@@ -3,6 +3,7 @@ import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QPamac.History 1.0
import QPamac.Database 1.0
import "../Components" as Components
import "../../js/JSUtils.js" as JSUtils
Pane{
......@@ -11,131 +12,130 @@ Pane{
id:historyDialog
padding: 3
anchors.fill: parent
ColumnLayout{
anchors.fill: parent
Pane{
Layout.preferredHeight: height
Layout.preferredWidth: width
width: parent.width
Label{
text: qsTr("Filter options:")
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: -filters.padding
anchors.topMargin: -filters.padding
}
Pane{
Label{
text: qsTr("Filter options:")
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: -filters.padding
anchors.topMargin: -filters.padding
}
anchors{
top: parent.top
left: parent.left
right: parent.right
}
height: 50
id:filters
padding: 10
height: 50
id:filters
padding: 10
GridLayout{
anchors.fill: parent
RowLayout{
GridLayout{
anchors.fill: parent
RowLayout{
Label{
id: packageFilterLabel
text: qsTr("Package name:")
padding: 5
}
TextArea{
Layout.fillWidth: true
width: 100
id: packageFilter
}
}
RowLayout{
Label{
id: actionChooserLabel
text: qsTr("Actions:")
padding: 5
Label{
id: packageFilterLabel
text: qsTr("Package name:")
padding: 5
}
TextArea{
Layout.fillWidth: true
width: 100
id: packageFilter
}
}
RowLayout{
Label{
id: actionChooserLabel
text: qsTr("Actions:")
padding: 5
}
CheckBox{
id: installedCheckbox
text:qsTr("Installed")
checked: true
}
CheckBox{
id: removedCheckbox
text:qsTr("Removed")
checked: true
}
CheckBox{
id: upgradedCheckbox
text:qsTr("Upgraded")
checked: true
}
CheckBox{
id: unknownCheckbox
text:qsTr("Unknown")
checked: true
CheckBox{
id: installedCheckbox
text:qsTr("Installed")
checked: true
}
CheckBox{
id: removedCheckbox
text:qsTr("Removed")
checked: true
}
CheckBox{
id: upgradedCheckbox
text:qsTr("Upgraded")
checked: true
}
CheckBox{
id: unknownCheckbox
text:qsTr("Unknown")
checked: true
}
}
}
}
}
Table{
id:table
property var history
anchors{
top:filters.bottom
bottom: parent.bottom
left: parent.left
right: parent.right
}
Components.Table{
Layout.fillHeight: true
Layout.preferredWidth: width
width: parent.width
height: parent.height
id:table
property var history
background: Rectangle{
color:systemPalette.alternateBase
}
background: Rectangle{
color:systemPalette.alternateBase
}
model:HistoryModel{
historyList: {
let result = table.history;
model:HistoryModel{
historyList: {
let result = table.history;
if(packageFilter.text!="")
result = result.filter(value => value.name.includes(packageFilter.text));
if(packageFilter.text!="")
result = result.filter(value => value.name.includes(packageFilter.text));
result = result.filter(value=>{
switch(value.type){
case "Installed":
return installedCheckbox.checked
case "Removed":
return removedCheckbox.checked
case "Upgraded":
return upgradedCheckbox.checked
case "Unknown":
return unknownCheckbox.checked
}
return true
});
return result
}
onHistoryListChanged:{
table.view.contentY=0
result = result.filter(value=>{
switch(value.type){
case "Installed":
return installedCheckbox.checked
case "Removed":
return removedCheckbox.checked
case "Upgraded":
return upgradedCheckbox.checked
case "Unknown":
return unknownCheckbox.checked
}
return true
});
return result
}
onHistoryListChanged:{
table.view.contentY=0
}
}
}
delegate: Label{
background: Rectangle{
color: (row%2!==0)?systemPalette.alternateBase:systemPalette.mid
}
delegate: Label{
background: Rectangle{
color: (row%2!==0)?systemPalette.alternateBase:systemPalette.mid
}
Rectangle{
anchors{
top: parent.top
left:parent.left
right: parent.right
Rectangle{
anchors{
top: parent.top
left:parent.left
right: parent.right
}
height:2
color: (row%2===0)?systemPalette.alternateBase:systemPalette.mid
}
height:2
color: (row%2===0)?systemPalette.alternateBase:systemPalette.mid
padding: 5
wrapMode: Text.WordWrap
text: modelData
}
Component.onCompleted: {
table.history = Database.getHistory();
}
padding: 5
wrapMode: Text.WordWrap
text: modelData
}
Component.onCompleted: {
table.history = Database.getHistory();
}
}
}
......@@ -8,6 +8,7 @@ import QPamac.PackageModel 1.0
import QPamac.Transaction 1.0
import "../../js/JSUtils.js" as Utils
import "../Components" as Components
Page{
title: qsTr("Preferences")
signal dialogAccepted
......@@ -94,7 +95,7 @@ Page{
}
}
delegate:
MenuItemDelegate{
Components.MenuItemDelegate{
backgroundColor: systemPalette.alternateBase
highlighted: tabBar.currentIndex==index
text: itemText
......@@ -140,7 +141,7 @@ Page{
text: qsTr("Remove unrequired dependecies")
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
settingName: "RemoveUnrequiredDeps"
checked: config.recurse
id: checkBox
......@@ -153,7 +154,7 @@ Page{
text: qsTr("Check available disk space")
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
settingName: "CheckSpace"
checked: Database.checkspace
id: checkBox1
......@@ -185,7 +186,7 @@ Page{
text: qsTr("Enable downgrade")
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
checked: config.enableDowngrade
id: checkBoxDowngrade
......@@ -197,7 +198,7 @@ Page{
text: qsTr("Check for updates")
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
checked: config.downloadUpdates
id: checkBox2
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
......@@ -239,7 +240,7 @@ Page{
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
checked: config.downloadUpdates
id: checkBox3
x: 0
......@@ -251,7 +252,7 @@ Page{
settingName: "DownloadUpdates"
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
checked: config.noUpdateHideIcon
id: checkBox4
x: 0
......@@ -448,7 +449,7 @@ Page{
anchors.topMargin: 0
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
checked: config.enableAur
id: aurEnabledCheckBox
x: 465
......@@ -459,7 +460,7 @@ Page{
settingName: "EnableAUR"
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
enabled: aurEnabledCheckBox.enabled
checked: config.checkAurUpdates
id: checkBox6
......@@ -470,7 +471,7 @@ Page{
anchors.leftMargin: 30
settingName: "CheckAURUpdates"
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
enabled: aurEnabledCheckBox.enabled
checked: config.checkAurVCSUpdates
id: checkBoxVCSUpdates
......@@ -593,7 +594,7 @@ Page{
anchors.topMargin: 6
}
PreferencesCheckBox {
Components.PreferencesCheckBox {
checked: config.cleanRmOnlyUninstalled
id: checkBox7
text: qsTr("Remove only the versions of uninstalled packages")
......
......@@ -3,12 +3,15 @@ import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
import QPamac.PackageModel 1.0
import "../Components" as Components
Page{
property var summary:null
property var summary
property var result
anchors.fill: parent
width: 600
height: 400
id:dialog
Flickable{
clip: true
boundsBehavior: Flickable.StopAtBounds
......@@ -27,30 +30,29 @@ Page{
id:column
height: childrenRect.height
width: parent.width
SummaryCategoryListView {
Components.SummaryCategoryListView {
visible: summary.toInstall.length>0
text: qsTr("To Install:")
packageList: summary.toInstall
}
SummaryCategoryListView {
Components.SummaryCategoryListView {
visible: summary.toRemove.length>0
text: qsTr("To Remove:")
packageList: summary.toRemove
}
SummaryCategoryListView {
Components.SummaryCategoryListView {
visible: summary.toReinstall.length>0
text: qsTr("To Reinstall:")
packageList: summary.toReinstall
}
SummaryCategoryListView {
Components.SummaryCategoryListView {
visible: summary.toUpgrade.length>0
text: qsTr("To Upgrade:")
packageList: summary.toUpgrade
}
SummaryCategoryListView {
Components.SummaryCategoryListView {
visible: summary.toBuild.length>0
text: qsTr("To Build:")
packageList: summary.toBuild
......
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
import QPamac.PackageModel 1.0
Page{
property var summary
property var result
anchors.fill: parent
Flickable{
clip: true
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar{
active:true
}
anchors{
margins: 6
top:parent.top
bottom: buttonBox.top
left: parent.left
right: parent.right
}
contentHeight: column.height
Column{
id:column
height: childrenRect.height
width: parent.width
SummaryCategoryListView {
visible: summary.toInstall.length>0
text: qsTr("To Install:")
packageList: summary.toInstall
}
SummaryCategoryListView {
visible: summary.toRemove.length>0
text: qsTr("To Remove:")
packageList: summary.toRemove
}
SummaryCategoryListView {
visible: summary.toReinstall.length>0
text: qsTr("To Reinstall:")
packageList: summary.toReinstall
}
SummaryCategoryListView {
visible: summary.toUpgrade.length>0
text: qsTr("To Upgrade:")
packageList: summary.toUpgrade
}
SummaryCategoryListView {
visible: summary.toBuild.length>0
text: qsTr("To Integrate:")
packageList: summary.toBuild
}
}
}
DialogButtonBox{
id:buttonBox
anchors{
margins: 6
bottom: parent.bottom
left: parent.left
right: parent.right
}
standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel
onAccepted: dialogAccepted()
onRejected: dialogRejected()
}
signal dialogAccepted
onDialogAccepted: {
result = true;
close();
}
onDialogRejected: {
result = false;
close();
}
signal dialogRejected
signal close
}
......@@ -13,71 +13,72 @@ import "../../js/JSUtils.js" as JSUtils
ApplicationWindow {
// function showUpdates(){
// if(stackView.currentItem.objectName!=="updatesPage")
// stackView.push("UpdatesPage.qml");
// }
// function clear(){
// toInstall=[];
// toRemove=[];
// toBuild=[];
// toLoad=[];
// }
// property var toInstall: []
// property var toRemove: []
// property var toBuild: []
// property var toLoad: []
// property var ignoreWhenUpdate: []
// onClosing: {
// sClosing();
// }
// signal sClosing;
// Transaction{
// id:transaction
// database: Database
// onStartPreparing: {
// if(started){
// details = "";
// }
// }
// onFinished:{
// if(success){
// clear();
// }
// }
// Component.onDestruction: {
// transaction.quitDaemon();
// }
// requestChooseProvider: (depend,list)=>{
// let objects = {"depend":depend,"lst":list,"provider":undefined}
// objects = DialogRunner.exec("qrc:/src/qml/ChooseProviderDialog.qml",objects)
// return objects["provider"]
// }
// requestOptDepends: (pkgname,lst)=>{
// let result = DialogRunner.exec("qrc:/src/qml/TransactionOptDependsDialog.qml",{"pkgName":pkgname,"opDeps":lst,"opted":undefined});
// return objects["opted"];
// }
// requestImportKey: (pkgname,key,owner)=>{
// let objects = {"pkgName":pkgname,"key":key,"owner":owner,"ok":undefined}
// objects = DialogRunner.exec("qrc:/src/qml/AskImportKeyDialog.qml",objects);
// return objects["ok"];
// }
// requestCommit: summary=>{
function showUpdates(){
if(stackView.currentItem.objectName!=="updatesPage")
stackView.push("UpdatesPage.qml");
}
function clear(){
toInstall=[];
toRemove=[];
toBuild=[];
toLoad=[];
}