Compare commits

..

No commits in common. "c54838ad6ff4fae975c265cda13f7f24c5b39f26" and "9e2ad81cff1465e26bbed011803624f58eb7fd2a" have entirely different histories.

2 changed files with 14 additions and 19 deletions

View File

@ -120,10 +120,10 @@ mount(std::vector<const char *> args, std::string data_directory,
std::cout << "Initializing " std::cout << "Initializing "
<< app_config::get_provider_display_name(prov) << app_config::get_provider_display_name(prov)
<< (unique_id.empty() ? "" << (unique_id.empty() ? ""
: (prov == provider_type::remote) : (prov == provider_type::s3 || prov == provider_type::sia)
? " [" + remote_host + ':' + ? " [" + unique_id + ']'
std::to_string(remote_port) + ']' : " [" + remote_host + ':' +
: " [" + unique_id + ']') std::to_string(remote_port) + ']')
<< " Drive" << std::endl; << " Drive" << std::endl;
if (prov == provider_type::remote) { if (prov == provider_type::remote) {
std::uint16_t port{0U}; std::uint16_t port{0U};

View File

@ -18,17 +18,19 @@ class _AddMountWidgetState extends State<AddMountWidget> {
static const _items = <String>['Encrypt', 'Remote', 'S3', 'Sia']; static const _items = <String>['Encrypt', 'Remote', 'S3', 'Sia'];
static const _padding = 15.0; static const _padding = 15.0;
late String _mountType; String? _mountType;
@override
void initState() {
_mountType = widget.mountType;
super.initState();
}
List<Widget> _createTextField( List<Widget> _createTextField(
String title, String title,
String dataName, { String dataName, {
String? value, String? value,
}) { }) {
if (value != null) {
widget.onDataChanged(dataName, value);
}
return [ return [
const SizedBox(height: _padding), const SizedBox(height: _padding),
Text( Text(
@ -40,7 +42,6 @@ class _AddMountWidgetState extends State<AddMountWidget> {
), ),
), ),
TextField( TextField(
autofocus: dataName == 'Name',
decoration: InputDecoration(), decoration: InputDecoration(),
onChanged: (value) => widget.onDataChanged(dataName, value), onChanged: (value) => widget.onDataChanged(dataName, value),
controller: TextEditingController(text: value), controller: TextEditingController(text: value),
@ -50,7 +51,7 @@ class _AddMountWidgetState extends State<AddMountWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mountTypeLower = _mountType.toLowerCase(); final mountTypeLower = _mountType?.toLowerCase();
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -73,10 +74,10 @@ class _AddMountWidgetState extends State<AddMountWidget> {
DropdownButton<String>( DropdownButton<String>(
value: _mountType, value: _mountType,
onChanged: (value) { onChanged: (value) {
widget.onDataChanged('Provider', value);
setState(() { setState(() {
_mountType = value ?? ""; _mountType = value;
}); });
widget.onDataChanged('Provider', value);
}, },
items: items:
_items.map<DropdownMenuItem<String>>((item) { _items.map<DropdownMenuItem<String>>((item) {
@ -116,10 +117,4 @@ class _AddMountWidgetState extends State<AddMountWidget> {
], ],
); );
} }
@override
void initState() {
_mountType = widget.mountType;
super.initState();
}
} }