Skip to content

Commit 01647c4

Browse files
committed
Fix some UI issues with dir and file pickers
Dir picker for bom destination shouldn't require dir to exist. Dir picker shoudl start in correct directory Fix file picker for netlist/xml to display correct path on GTK. Unfortunately had to use textctrl based one instead of native ctrl.
1 parent 31686a2 commit 01647c4

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

InteractiveHtmlBom/config.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ def transfer_to_dialog(self, dlg):
101101
dlg.html.openBrowserCheckbox.Value = self.open_browser
102102

103103
# General
104-
dlg.general.bomDirPicker.Path = self.bom_dest_dir
104+
import os.path
105+
if os.path.isabs(self.bom_dest_dir):
106+
dlg.general.bomDirPicker.Path = self.bom_dest_dir
107+
else:
108+
dlg.general.bomDirPicker.Path = os.path.join(
109+
self.netlist_initial_directory, self.bom_dest_dir)
105110
dlg.general.componentSortOrderBox.SetItems(self.component_sort_order)
106111
dlg.general.blacklistBox.SetItems(self.component_blacklist)
107112
dlg.general.blacklistVirtualCheckbox.Value = self.blacklist_virtual
@@ -112,7 +117,7 @@ def transfer_to_dialog(self, dlg):
112117
dlg.extra.extraFieldsList.SetCheckedStrings(self.extra_fields)
113118
dlg.extra.boardVariantFieldBox.Value = self.board_variant_field
114119
dlg.extra.boardVariantWhitelist.SetCheckedStrings(
115-
self.board_variant_whitelist)
120+
self.board_variant_whitelist)
116121
dlg.extra.boardVariantBlacklist.SetCheckedStrings(
117122
self.board_variant_blacklist)
118123
dlg.extra.dnpFieldBox.Value = self.dnp_field

InteractiveHtmlBom/dialog/dialog_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.
325325

326326
sbSizer7 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Netlist or xml file" ), wx.VERTICAL )
327327

328-
self.netlistFilePicker = wx.FilePickerCtrl( sbSizer7.GetStaticBox(), wx.ID_ANY, wx.EmptyString, u"Select a file", u"Netlist and xml files (*.net; *.xml)|*.net;*.xml", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE|wx.FLP_FILE_MUST_EXIST|wx.FLP_OPEN|wx.FLP_SMALL|wx.BORDER_SIMPLE )
328+
self.netlistFilePicker = wx.FilePickerCtrl( sbSizer7.GetStaticBox(), wx.ID_ANY, wx.EmptyString, u"Select a file", u"Netlist and xml files (*.net; *.xml)|*.net;*.xml", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE|wx.FLP_FILE_MUST_EXIST|wx.FLP_OPEN|wx.FLP_SMALL|wx.FLP_USE_TEXTCTRL|wx.BORDER_SIMPLE )
329329
sbSizer7.Add( self.netlistFilePicker, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
330330

331331

settings_dialog.fbp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3171,7 +3171,7 @@
31713171
<property name="resize">Resizable</property>
31723172
<property name="show">1</property>
31733173
<property name="size"></property>
3174-
<property name="style">wxFLP_DEFAULT_STYLE|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_SMALL</property>
3174+
<property name="style">wxFLP_DEFAULT_STYLE|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_SMALL|wxFLP_USE_TEXTCTRL</property>
31753175
<property name="subclass">; ; forward_declare</property>
31763176
<property name="toolbar_pane">0</property>
31773177
<property name="tooltip"></property>

0 commit comments

Comments
 (0)