forked from clue/reactphp-zenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02-file.php
More file actions
25 lines (19 loc) · 837 Bytes
/
02-file.php
File metadata and controls
25 lines (19 loc) · 837 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
25
<?php
use Clue\React\Zenity\Launcher;
use Clue\React\Zenity\Dialog\FileSelectionDialog;
use Clue\React\Zenity\Builder;
use Clue\React\Zenity\Dialog\InfoDialog;
require __DIR__ . '/../vendor/autoload.php';
$launcher = new Launcher();
$builder = new Builder();
$launcher->launch($builder->fileSelection())->then(function (SplFileInfo $file) use ($launcher) {
var_dump($file);
$launcher->launch(new InfoDialog('Selected "' . $file->getFilename() . '". Re-opening dialog with same selection'))->then(function () use ($file, $launcher) {
$selection = new FileSelectionDialog();
$selection->setFilename($file);
$selection->setTitle('Pretend we\'re overwriting the file');
$selection->setConfirmOverwrite(true);
$selection->setSave(true);
$launcher->launch($selection);
});
});