This commit is contained in:
2019-05-23 04:48:00 -07:00
parent e84c693464
commit 4f090db179
8 changed files with 122 additions and 49 deletions

View File

@@ -10,7 +10,8 @@ require (__DIR__."/functions.pashua.php");
// Read Prefs
$p = unserialize(file_get_contents(__DIR__."/prefs.php"));
$prefs_file = "/Users/".get_current_user()."/Library/Preferences/yuba_prefs.php";
$p = unserialize(file_get_contents($prefs_file));
if(!$p['bdest']) {
$p['bdest'] = "/Users/".get_current_user()."/Documents/Yuba/";
if (!is_dir($p['bdest'])) { if (!mkdir($p['bdest'])) { echo "Error creating destination directory"; } }
@@ -19,7 +20,8 @@ if(!$p['bdest']) {
// Load strings
$strings[] = array("Do nothing","Reveal result in Finder","Upload result with rsync");
$strings[] = array("Bypass","Generate","Rebuild (tk)");
$strings[] = array("Bypass","Generate","Rebuild");
$strings[] = array("external","ql-thumbnail","qltool","qlmanage");
$result = Pashua::showDialog(makeWindowString($p, $strings));
@@ -34,6 +36,7 @@ if (@$result['cb']) {
$result['postflight'] = array_search($result['postflight'],$strings[0]);
$result['thumbs'] = array_search($result['thumbs'],$strings[1]);
$result['thumb_priority'] = array_search($result['thumb_priority'],$strings[2]);
// If the user didn't specify a destpath, set to default
@@ -47,7 +50,7 @@ $result['destpath'] = str_replace("Desktop/Desktop","Desktop",$result['destpath'
// Write Prefs
file_put_contents("prefs.php",serialize($result));
file_put_contents($prefs_file,serialize($result));
echo "1";
?>