Skip to content

Commit

Permalink
Add "Relative Filename" column to card window
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Feb 6, 2023
1 parent dd24b78 commit c70d683
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/KKManager/Windows/Content/CardWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/KKManager/Windows/Content/CardWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public CardWindow()
}
};

olvColumnRelativeFilename.AspectGetter = rowObject => rowObject is Card card ? card.Location.FullName.Substring(_currentDirectory.FullName.Length).TrimStart('/', '\\') : rowObject;

ListTools.SetUpSearchBox(listView, toolStripTextBoxSearch);
}

Expand Down Expand Up @@ -234,6 +236,9 @@ public void RefreshList()
return;
}

var prevEmptyListMsg = listView.EmptyListMsg;
listView.EmptyListMsg = "Loading...";

var cardLoadObservable = CardLoader.ReadCards(CurrentDirectory, DirectorySearchMode, _cancellationTokenSource.Token);

var processedCount = 0;
Expand All @@ -254,6 +259,7 @@ public void RefreshList()
RefreshThumbnails(true);

MainWindow.SetStatusText("Done loading cards");
listView.EmptyListMsg = prevEmptyListMsg;
},
_cancellationTokenSource.Token);
}
Expand Down
12 changes: 12 additions & 0 deletions src/KKManager/Windows/Content/CardWindow.resx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@
<data name="olvColumnFileSize.Text" xml:space="preserve">
<value>File Size</value>
</data>
<data name="olvColumnRelativeFilename.Text" xml:space="preserve">
<value>Relative Filename</value>
</data>
<data name="olvColumnFilename.DisplayIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="olvColumnFilename.Text" xml:space="preserve">
<value>Filename</value>
</data>
Expand Down Expand Up @@ -655,6 +661,12 @@ If off, only cards from the top directory are shown.</value>
<data name="&gt;&gt;toolStripTextBoxSearch.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripTextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;olvColumnRelativeFilename.Name" xml:space="preserve">
<value>olvColumnRelativeFilename</value>
</data>
<data name="&gt;&gt;olvColumnRelativeFilename.Type" xml:space="preserve">
<value>BrightIdeasSoftware.OLVColumn, ObjectListView, Version=2.9.1.1072, Culture=neutral, PublicKeyToken=b1c5bf581481bcd4</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>CardWindow</value>
</data>
Expand Down

0 comments on commit c70d683

Please sign in to comment.