summaryrefslogtreecommitdiffstats
path: root/src/app/mount.js
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-08-28 22:44:34 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-08-31 23:30:34 +0900
commitf9abd9d505434c9244c03eac708e29a0ca042f6b (patch)
tree30a197ab4c413849188bc131ff859212e636c821 /src/app/mount.js
parent14d42d284de233f9937becf3fc9ee0dabede3b21 (diff)
downloadkrusader-r14.1.x.tar.gz
krusader-r14.1.x.zip
Restructure source foldersr14.1.x
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 086012dcad8a976a0dabbb7cbc20c9cb612cdfa9)
Diffstat (limited to 'src/app/mount.js')
-rw-r--r--src/app/mount.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/app/mount.js b/src/app/mount.js
new file mode 100644
index 0000000..3aadcc8
--- /dev/null
+++ b/src/app/mount.js
@@ -0,0 +1,37 @@
+/*
+ This is an extension for the Krusader filemanager
+ http://krusader.sf.net/
+
+ Author: Jonas Bähr, http://www.jonas-baehr.de/
+
+ This script shows a dialog for mounting a device. The commandline which is
+ returned by this is executed by Krusader's UserAction-system
+ Krusader looks for the variable 'cmd'.
+
+ scriptDir is a string-variable set by Krusader with the directory of the currently
+ executed script. This is usefull for relative path's inside scripts.
+*/
+
+var ui = Factory.loadui( scriptDir + 'mount.ui' );
+
+ui.child('device').setFocus();
+
+var m = ui.exec();
+
+var cmd = "@CANCEL@"; //FIXME: replace this with UserAction.cancel
+
+if (m) {
+ var cmd = "mount";
+ var device = ui.child('device').url;
+ var mountpoint = ui.child('mountpoint').url;
+ var filesystem = ui.child('filesystem').currentText;
+ var options = ui.child('options').text;
+
+ if ( filesystem != '<auto>' && filesystem != '' )
+ cmd += " -t " + filesystem;
+ if ( options != '' )
+ cmd += " " + options;
+
+ cmd += " " + device + " " + mountpoint;
+}
+