| 105 | } |
| 106 | |
| 107 | void ExtImportPrefs::PopulateOrExchange(ShuttleGui & S) |
| 108 | { |
| 109 | S.SetBorder(2); |
| 110 | S.StartScroller(); |
| 111 | |
| 112 | S.TieCheckBox(XXO("A&ttempt to use filter in OpenFile dialog first"), |
| 113 | {wxT("/ExtendedImport/OverrideExtendedImportByOpenFileDialogChoice"), |
| 114 | true}); |
| 115 | S.StartStatic(XO("Rules to choose import filters"), 1); |
| 116 | { |
| 117 | S.SetSizerProportion(1); |
| 118 | S.StartHorizontalLay (wxEXPAND, 1); |
| 119 | { |
| 120 | bool fillRuleTable = false; |
| 121 | if (RuleTable == NULL) |
| 122 | { |
| 123 | RuleTable = safenew Grid(FormatterContext::EmptyContext(), S.GetParent(),EIPRuleTable); |
| 124 | |
| 125 | RuleTable->SetColLabelSize(RuleTable->GetDefaultRowSize()); |
| 126 | #if EXTIMPORT_MIME_SUPPORT |
| 127 | RuleTable->CreateGrid (0, 2, wxGrid::wxGridSelectRows); |
| 128 | #else |
| 129 | RuleTable->CreateGrid (0, 1, wxGrid::wxGridSelectRows); |
| 130 | #endif |
| 131 | RuleTable->DisableDragColMove (); |
| 132 | RuleTable->DisableDragRowSize (); |
| 133 | RuleTable->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_CENTER); |
| 134 | RuleTable->SetColLabelValue (0, _("File extensions")); |
| 135 | #if EXTIMPORT_MIME_SUPPORT |
| 136 | RuleTable->SetColLabelValue (1, _("Mime-types")); |
| 137 | #endif |
| 138 | RuleTable->SetRowLabelSize (0); |
| 139 | RuleTable->SetSelectionMode (wxGrid::wxGridSelectRows); |
| 140 | // call SetMinSize to enable scrolling on large content |
| 141 | RuleTable->Fit(); |
| 142 | RuleTable->SetMinSize(RuleTable->GetSize()); |
| 143 | |
| 144 | ExtImportPrefsDropTarget *dragtarget1 {}; |
| 145 | RuleTable->SetDropTarget ( |
| 146 | dragtarget1 = safenew ExtImportPrefsDropTarget( |
| 147 | dragtext1 = safenew wxTextDataObject(wxT("")) |
| 148 | ) |
| 149 | ); |
| 150 | dragtarget1->SetPrefs (this); |
| 151 | |
| 152 | RuleTable->EnableDragCell (true); |
| 153 | fillRuleTable = true; |
| 154 | } |
| 155 | S.Position(wxEXPAND | wxALL) |
| 156 | .AddWindow(RuleTable); |
| 157 | |
| 158 | PluginList = S.Id(EIPPluginList).AddListControl( |
| 159 | { { XO("Importer order"), wxLIST_FORMAT_LEFT, |
| 160 | wxLIST_AUTOSIZE_USEHEADER } }, |
| 161 | wxLC_REPORT | wxLC_SINGLE_SEL |
| 162 | ); |
| 163 | |
| 164 | if (fillRuleTable) |
nothing calls this directly
no test coverage detected