Skip to content

Commit

Permalink
Fixed issue #1122.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsschmidt1337 committed Oct 17, 2024
1 parent 4ecda93 commit 35766a5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public DatFile getFileNameObj() {
}

public void setFileNameObj(DatFile fileNameObj) {
filename = new File(fileNameObj.getNewName()).getName();
filename = fileNameObj.getShortNameMixedCase();
filepath = fileNameObj.getNewName();
getTab().setToolTipText(filepath);
setFilenameWithStar(filename + "*"); //$NON-NLS-1$
Expand Down
11 changes: 11 additions & 0 deletions src/org/nschmidt/ldparteditor/data/DatFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,17 @@ public String toString() {
public String getShortName() {
String shortFilename = new File(newName).getName();
shortFilename = shortFilename.toLowerCase(Locale.ENGLISH);
shortFilename = appendTypeInfoToShortName(shortFilename);
return shortFilename;
}

public String getShortNameMixedCase() {
String shortFilename = new File(newName).getName();
shortFilename = appendTypeInfoToShortName(shortFilename);
return shortFilename;
}

private String appendTypeInfoToShortName(String shortFilename) {
shortFilename = shortFilename.replace("\\", File.separator); //$NON-NLS-1$
if (type.equals(DatType.SUBPART)) {
shortFilename = "S" + File.separator + shortFilename; //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static synchronized void updateStatus(Composite3D c3d) {

final DatFile df = c3d.getLockableDatFileReference();
sb.append(" "); //$NON-NLS-1$
sb.append(df.getShortName());
sb.append(df.getShortNameMixedCase());
sb.append(", "); //$NON-NLS-1$
sb.append(I18n.PERSPECTIVE_ZOOM);
sb.append(": "); //$NON-NLS-1$
Expand Down Expand Up @@ -352,7 +352,7 @@ public static synchronized void updateStatus(DatFile df) {
updateSelection(sb, vm);

sb.append(" "); //$NON-NLS-1$
sb.append(df.getShortName());
sb.append(df.getShortNameMixedCase());
Editor3DWindow.getStatusLabel().setText(sb.toString());
Editor3DWindow.getStatusLabel().setSize(Editor3DWindow.getStatusLabel().computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2888,7 +2888,7 @@ public synchronized void updateTabs(CTabItem[] items) {
if (df3 == null) continue;
openFiles.remove(df3);
CTabItem tItem = new CTabItem(tabFolderOpenDatFilesPtr[0], SWT.NONE);
tItem.setText(df3.getShortName() + (Project.getUnsavedFiles().contains(df3) ? "*" : "")); //$NON-NLS-1$ //$NON-NLS-2$
tItem.setText(df3.getShortNameMixedCase() + (Project.getUnsavedFiles().contains(df3) ? "*" : "")); //$NON-NLS-1$ //$NON-NLS-2$
tItem.setToolTipText(df3.getNewName());
tItem.setData(df3);
if (df3.equals(Project.getFileToEdit())) {
Expand All @@ -2899,7 +2899,7 @@ public synchronized void updateTabs(CTabItem[] items) {

for (DatFile df2 : openFiles) {
CTabItem tItem = new CTabItem(tabFolderOpenDatFilesPtr[0], SWT.NONE);
tItem.setText(df2.getShortName() + (Project.getUnsavedFiles().contains(df2) ? "*" : "")); //$NON-NLS-1$ //$NON-NLS-2$
tItem.setText(df2.getShortNameMixedCase() + (Project.getUnsavedFiles().contains(df2) ? "*" : "")); //$NON-NLS-1$ //$NON-NLS-2$
tItem.setToolTipText(df2.getNewName());
tItem.setData(df2);
if (df2.equals(Project.getFileToEdit())) {
Expand Down

0 comments on commit 35766a5

Please sign in to comment.