-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy path02-file.php
More file actions
24 lines (19 loc) · 932 Bytes
/
02-file.php
File metadata and controls
24 lines (19 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require __DIR__ . '/../vendor/autoload.php';
$launcher = new Clue\React\Zenity\Launcher();
$builder = new Clue\React\Zenity\Builder();
$launcher->launch($builder->fileSelection())->then(function (SplFileInfo $file) use ($launcher) {
var_dump($file);
$launcher->launch(new Clue\React\Zenity\Dialog\InfoDialog('Selected "' . $file->getFilename() . '". Re-opening dialog with same selection'))->then(function () use ($file, $launcher) {
$selection = new Clue\React\Zenity\Dialog\FileSelectionDialog();
$selection->setFilename($file);
$selection->setTitle('Pretend we\'re overwriting the file');
$selection->setConfirmOverwrite(true);
$selection->setSave(true);
$launcher->launch($selection);
}, function (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
});
}, function (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
});