Commit e9c9acaa authored by LordTermor's avatar LordTermor Committed by LordTermor

It's now possible to choose an aur build directory

parent 9befdf30
......@@ -50,6 +50,9 @@ public:
PAMAC_QT_INT_PROPERTY_GET_SET(cleanKeepNumPkgs,pamac_config_get_clean_keep_num_pkgs(m_config.get()),
setCleanKeepNumPkgs,pamac_config_set_clean_keep_num_pkgs(m_config.get(),size_t(cleanKeepNumPkgs)))
PAMAC_QT_STRING_PROPERTY_GET_SET(aurBuildDirectory,pamac_config_get_aur_build_dir(m_config.get()),
setAurBuildDirectory,pamac_config_set_aur_build_dir(m_config.get(),aurBuildDirectory.toUtf8()))
operator PamacConfig*(){
return m_config.get();
}
......
......@@ -79,7 +79,7 @@ public:
pamac_transaction_start_generate_mirrors_list(m_transaction.get(),country.toUtf8());
}
Q_INVOKABLE void cleanCache(int cleanKeepNumPkgs,bool cleanRmOnlyInstalled){
pamac_transaction_clean_cache(m_transaction.get(),uint(cleanKeepNumPkgs),cleanRmOnlyInstalled);
pamac_transaction_clean_cache(m_transaction.get(),uint64_t(cleanKeepNumPkgs),cleanRmOnlyInstalled);
}
Q_INVOKABLE void quitDaemon(){
pamac_transaction_quit_daemon(m_transaction.get());
......
......@@ -18,11 +18,11 @@ namespace Utils {
Q_PROPERTY(QString getName READ getName WRITE setName)\
inline QString getName() const\
{\
return QString::fromUtf8(method);\
return QString::fromUtf8(getMethod);\
}\
inline void setName(const QString& str)\
inline void setName(const QString& getName)\
{\
setMethod(str.toUtf8());\
setMethod;\
}
#define PAMAC_QT_URL_PROPERTY_GET(name,method)\
......
......@@ -27,3 +27,13 @@ function readFile(fileUrl) {
request.send(null);
return request.responseText;
}
function urlToPath(urlString) {
var s
if (urlString.startsWith("file:///")) {
var k = urlString.charAt(9) === ':' ? 8 : 7
s = urlString.substring(k)
} else {
s = urlString
}
return decodeURIComponent(s);
}
import QtQuick 2.4
import Qt.labs.platform 1.1
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import Pamac.Config 1.0
import Pamac.Database 1.0
import Pamac.PackageModel 1.0
import QtQuick.Dialogs 1.2
import "../js/JSUtils.js" as Utils
Dialog{
title: qsTr("Preferences")
......@@ -452,24 +454,87 @@ Dialog{
Label {
enabled: aurEnabledCheckBox.enabled
id: label8
height: comboBox1.height
height: aurBuildDirTextArea.height
text: qsTr("Build directory:")
verticalAlignment: Text.AlignVCenter
anchors.top: comboBox1.top
anchors.top: aurBuildDirTextArea.top
anchors.topMargin: 0
anchors.left: checkBox6.left
anchors.leftMargin: 0
}
ComboBox {
enabled: aurEnabledCheckBox.enabled
id: comboBox1
TextArea {
text: config.aurBuildDirectory
enabled: false
id: aurBuildDirTextArea
x: 500
displayText: "(None)"
anchors.left: label8.right
anchors.top: checkBoxVCSUpdates.bottom
anchors.topMargin: 6
anchors.right: chooseButton.left
Connections{
target: transaction
onWritePamacConfigFinished:{
aurBuildDirTextArea.text = config.aurBuildDirectory;
}
}
}
Button{
anchors.top: aurBuildDirTextArea.top
enabled: aurEnabledCheckBox.enabled
id:chooseButton
anchors.right: parent.right
anchors.rightMargin: 6
icon.name: "folder"
onClicked: {
aurBuildDirDialog.open();
}
}
FileDialog{
folder: encodeURIComponent(aurBuildDirTextArea.text)
id:aurBuildDirDialog
selectFolder:true
selectMultiple: false
selectExisting: true
title: qsTr("Please choose a build directory")
onAccepted: {
var path = Utils.urlToPath(aurBuildDirDialog.fileUrl.toString());
var obj = {"BuildDirectory":path};
transaction.startWritePamacConfig(obj);
}
}
RowLayout{
enabled: aurEnabledCheckBox.enabled
anchors.top: aurBuildDirTextArea.bottom
anchors.left: aurBuildDirTextArea.left
anchors.right: chooseButton.right
Button{
Layout.fillHeight: true
Layout.fillWidth: true
id:defaultLocationButton
text:qsTr("Default")
onClicked: {
var path = "/var/tmp"
var obj = {"BuildDirectory":path};
transaction.startWritePamacConfig(obj);
}
}
Button{
Layout.fillHeight: true
Layout.fillWidth: true
id:tmpLocationButton
text:qsTr("Temporary directory")
onClicked: {
var path = Utils.urlToPath(StandardPaths.standardLocations(StandardPaths.TempLocation)[0]);
var obj = {"BuildDirectory":path};
transaction.startWritePamacConfig(obj);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment