@@ -9,7 +9,7 @@ use nwg::stretch::{
99use crate :: usbipd:: UsbDevice ;
1010
1111/// The persisted device info tab.
12- /// It displays detailed information about a persistent device profile .
12+ /// It displays detailed information about a persisted device.
1313///
1414/// Call the `update` method to update the information displayed.
1515///
@@ -20,62 +20,62 @@ use crate::usbipd::UsbDevice;
2020/// has focus. It is suggested to inhibit the `OnWindowClose` event on the
2121/// parent window (e.g. the parent `nwg::Frame`) to prevent it from closing.
2222#[ derive( Default , NwgPartial ) ]
23- pub struct ProfileInfo {
23+ pub struct PersistedInfo {
2424 #[ nwg_resource( family: "Segoe UI Semibold" , size: 16 , weight: 400 ) ]
2525 font_bold : nwg:: Font ,
2626
2727 #[ nwg_resource( family: "Segoe UI Semibold" , size: 20 , weight: 400 ) ]
2828 font_bold_big : nwg:: Font ,
2929
3030 #[ nwg_layout( flex_direction: FlexDirection :: Column , auto_spacing: None ) ]
31- device_info_layout : nwg:: FlexboxLayout ,
31+ info_layout : nwg:: FlexboxLayout ,
3232
33- #[ nwg_control( text: "Profile Info" , font: Some ( & data. font_bold_big) ) ]
34- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
35- profile_info : nwg:: Label ,
33+ #[ nwg_control( text: "Persisted Info" , font: Some ( & data. font_bold_big) ) ]
34+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
35+ persisted_info : nwg:: Label ,
3636
3737 #[ nwg_control]
38- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: Pt ( 1.0 ) } ,
38+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: Pt ( 1.0 ) } ,
3939 margin: Rect { start: Pt ( 0.0 ) , end: Pt ( 0.0 ) , top: Pt ( 5.0 ) , bottom: Pt ( 0.0 ) }
4040 ) ]
4141 separator : nwg:: Frame ,
4242
4343 #[ nwg_control( text: "VID:PID:" , font: Some ( & data. font_bold) , v_align: nwg:: VTextAlign :: Bottom ) ]
44- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ,
44+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ,
4545 margin: Rect { start: Pt ( 0.0 ) , end: Pt ( 0.0 ) , top: Pt ( 6.0 ) , bottom: Pt ( 0.0 ) }
4646 ) ]
4747 vid_pid : nwg:: Label ,
4848
4949 #[ nwg_control]
50- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
50+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
5151 vid_pid_content : nwg:: RichLabel ,
5252
5353 #[ nwg_control( text: "Serial number:" , font: Some ( & data. font_bold) , v_align: nwg:: VTextAlign :: Bottom ) ]
54- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
54+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
5555 serial : nwg:: Label ,
5656
5757 #[ nwg_control]
58- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
58+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
5959 serial_content : nwg:: RichLabel ,
6060
6161 #[ nwg_control( text: "Persisted ID:" , font: Some ( & data. font_bold) , v_align: nwg:: VTextAlign :: Bottom ) ]
62- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
62+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
6363 persisted : nwg:: Label ,
6464
6565 #[ nwg_control]
66- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
66+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
6767 persisted_content : nwg:: RichLabel ,
6868
6969 #[ nwg_control( text: "Description:" , font: Some ( & data. font_bold) , v_align: nwg:: VTextAlign :: Bottom ) ]
70- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
70+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: Pt ( 20.0 ) } ) ]
7171 description : nwg:: Label ,
7272
7373 #[ nwg_control( flags: "VISIBLE|MULTI_LINE" ) ]
74- #[ nwg_layout_item( layout: device_info_layout , size: Size { width: D :: Auto , height: D :: Auto } , flex_grow: 1.0 ) ]
74+ #[ nwg_layout_item( layout: info_layout , size: Size { width: D :: Auto , height: D :: Auto } , flex_grow: 1.0 ) ]
7575 description_content : nwg:: RichLabel ,
7676}
7777
78- impl ProfileInfo {
78+ impl PersistedInfo {
7979 pub fn update ( & self , device : Option < & UsbDevice > ) {
8080 if let Some ( device) = device {
8181 self . vid_pid_content
@@ -94,7 +94,7 @@ impl ProfileInfo {
9494 self . vid_pid_content . set_text ( "-" ) ;
9595 self . serial_content . set_text ( "-" ) ;
9696 self . persisted_content . set_text ( "-" ) ;
97- self . description_content . set_text ( "No profile selected" ) ;
97+ self . description_content . set_text ( "No device selected" ) ;
9898 }
9999 }
100100}
0 commit comments