@@ -52,6 +52,8 @@ mod imp {
5252 pub assemble_url : RefCell < Option < String > > ,
5353 pub nvidia_row : adw:: SwitchRow ,
5454 pub init_row : adw:: SwitchRow ,
55+ pub hostname_row : adw:: EntryRow ,
56+ pub root_row : adw:: SwitchRow ,
5557 pub volume_rows : Rc < RefCell < Vec < adw:: EntryRow > > > ,
5658 pub scrolled_window : gtk:: ScrolledWindow ,
5759 #[ property( get, set, nullable, construct_only) ]
@@ -277,14 +279,24 @@ impl CreateDistroboxDialog {
277279
278280 imp. init_row . set_title ( & gettext ( "Init process" ) ) ;
279281
282+ imp. hostname_row . set_title ( & gettext ( "Hostname" ) ) ;
283+
284+ imp. root_row . set_title ( & gettext ( "Privileged" ) ) ;
285+
280286 preferences_group. add ( & imp. name_row ) ;
281287 preferences_group. add ( & imp. image_row ) ;
282288 preferences_group. add ( & imp. home_row_expander ) ;
283- preferences_group. add ( & imp. nvidia_row ) ;
284- preferences_group. add ( & imp. init_row ) ;
289+
290+ let advanced_group = adw:: PreferencesGroup :: new ( ) ;
291+ advanced_group. set_title ( & gettext ( "Advanced" ) ) ;
292+ advanced_group. add ( & imp. hostname_row ) ;
293+ advanced_group. add ( & imp. root_row ) ;
294+ advanced_group. add ( & imp. nvidia_row ) ;
295+ advanced_group. add ( & imp. init_row ) ;
285296
286297 let volumes_group = self . build_volumes_group ( ) ;
287298 content. append ( & preferences_group) ;
299+ content. append ( & advanced_group) ;
288300 content. append ( & volumes_group) ;
289301
290302 let create_btn = self . build_create_btn ( ) ;
@@ -927,13 +939,23 @@ impl CreateDistroboxDialog {
927939 . collect :: < Result < Vec < _ > , _ > > ( ) ?;
928940
929941 let name = CreateArgName :: new ( & imp. name_row . text ( ) ) ?;
942+ let hostname = {
943+ let value = imp. hostname_row . text ( ) . trim ( ) . to_string ( ) ;
944+ if value. is_empty ( ) {
945+ None
946+ } else {
947+ Some ( value)
948+ }
949+ } ;
930950
931951 let create_args = CreateArgs {
932952 name,
933953 image : image. to_string ( ) ,
934954 nvidia : imp. nvidia_row . is_active ( ) ,
935955 home_path : self . home_folder ( ) ,
936956 init : imp. init_row . is_active ( ) ,
957+ hostname,
958+ root : imp. root_row . is_active ( ) ,
937959 volumes,
938960 } ;
939961
0 commit comments