Skip to content

Commit

Permalink
Changed file dialog filter order
Browse files Browse the repository at this point in the history
  • Loading branch information
maccasoft committed Jul 10, 2023
1 parent b481771 commit 78843d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void widgetSelected(SelectionEvent e) {

});

filterIndex = SpinTools.filterExtensions.length - 1;
filterIndex = 0;
}

public void setFilterIndex(int index) {
Expand Down Expand Up @@ -578,7 +578,7 @@ void createSpin1CompilerPage(Composite parent) {
label.setText("Template");
spin1Template = new FileSelector(composite);
spin1Template.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
spin1Template.setFilterIndex(1);
spin1Template.setFilterIndex(2);
spin1Template.setSelection(preferences.getSpin1Template());

new Label(composite, SWT.NONE);
Expand Down Expand Up @@ -615,7 +615,7 @@ void createSpin2CompilerPage(Composite parent) {
label.setText("Template");
spin2Template = new FileSelector(composite);
spin2Template.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
spin2Template.setFilterIndex(2);
spin2Template.setFilterIndex(3);
spin2Template.setSelection(preferences.getSpin2Template());

new Label(composite, SWT.NONE);
Expand Down
16 changes: 8 additions & 8 deletions modules/spin-tools/src/com/maccasoft/propeller/SpinTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,16 @@ public class SpinTools {
FindReplaceDialog findReplaceDialog;

public static final String[] filterNames = new String[] {
"All Source Files",
"C Files",
"Spin1 Files",
"Spin2 Files",
"All Source Files"
"Spin2 Files"
};
public static final String[] filterExtensions = new String[] {
"*.spin;*.spin2;*.c",
"*.c",
"*.spin",
"*.spin2",
"*.spin;*.spin2;*.c",
"*.spin2"
};

final CaretListener caretListener = new CaretListener() {
Expand Down Expand Up @@ -1634,7 +1634,7 @@ private void handleFileOpen() {
dlg.setText("Open Source File");
dlg.setFilterNames(filterNames);
dlg.setFilterExtensions(filterExtensions);
dlg.setFilterIndex(filterExtensions.length - 1);
dlg.setFilterIndex(0);

File filterPath = null;

Expand Down Expand Up @@ -1667,7 +1667,7 @@ private void handleFileOpenFrom(String filterPath) {
dlg.setText("Open Source File");
dlg.setFilterNames(filterNames);
dlg.setFilterExtensions(filterExtensions);
dlg.setFilterIndex(filterExtensions.length - 1);
dlg.setFilterIndex(0);

if (filterPath != null) {
dlg.setFilterPath(filterPath);
Expand Down Expand Up @@ -1880,7 +1880,7 @@ private void doFileSaveAs(EditorTab editorTab) {
dlg.setText("Save Source File");
dlg.setFilterNames(filterNames);
dlg.setFilterExtensions(filterExtensions);
dlg.setFilterIndex(filterExtensions.length - 1);
dlg.setFilterIndex(0);

dlg.setFileName(editorTab.getText());
dlg.setOverwrite(true);
Expand Down Expand Up @@ -2628,7 +2628,7 @@ private void handleListingExport(Shell shell, SpinObject object) {
"Listing Files"
};
String[] filterExtensions = new String[] {
"*.lst"
"*.lst;*.txt"
};
dlg.setFilterNames(filterNames);
dlg.setFilterExtensions(filterExtensions);
Expand Down

0 comments on commit 78843d5

Please sign in to comment.