Skip to content

Commit 0033ae8

Browse files
committed
Support Ctrl+A to select all rows in current page
1 parent 49d3476 commit 0033ae8

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ kotlin.code.style=official
44
# Application Global Properties
55
app.name=CatSpy
66
app.id=me.gegenbauer.catspy
7-
app.version.name=1.1.11
8-
app.version.code=1001011
7+
app.version.name=1.1.12
8+
app.version.code=1001012
99
app.author=gegenbauer
1010
app.repo=catspy
1111
app.repo.link=https://github.com/Gegenbauer/CatSpy

ui/log/src/main/kotlin/me/gegenbauer/catspy/log/ui/table/LogTable.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ class LogTable(
342342
rows.forEach(bookmarkManager::removeBookmark)
343343
}
344344

345+
private fun selectAllRowsInCurrentPage() {
346+
tableModel.selectedLogRows.addAll(0 until rowCount)
347+
}
348+
345349
private fun copySelectedRows() {
346350

347351
suspend fun collectRowsContent(rows: List<Int>): String {
@@ -512,6 +516,7 @@ class LogTable(
512516
KEY_LAST_ROW -> moveToLastRow()
513517
KEY_FIRST_ROW -> moveToFirstRow()
514518
KEY_COPY -> copySelectedRows()
519+
KEY_SELECT_ALL -> selectAllRowsInCurrentPage()
515520
}
516521
super.keyPressed(event)
517522
}
@@ -584,6 +589,7 @@ class LogTable(
584589
private val KEY_LAST_ROW = Key.C_END
585590
private val KEY_FIRST_ROW = Key.C_HOME
586591
private val KEY_COPY = Key.C_C
592+
private val KEY_SELECT_ALL = Key.C_A
587593
private val disabledKeys = listOf(
588594
KEY_PREVIOUS_ROW, KEY_NEXT_ROW,
589595
KEY_SHOW_LOGS_IN_DIALOG, KEY_PAGE_UP,

ui/utils/src/main/kotlin/me/gegenbauer/catspy/utils/ui/KeySupport.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ object Key {
111111
val C_END = getKeyEventInfo(KeyEvent.VK_END, vkMask)
112112
val C_HOME = getKeyEventInfo(KeyEvent.VK_HOME, vkMask)
113113

114+
val C_A = getKeyEventInfo(KeyEvent.VK_A, vkMask)
114115
val C_F = getKeyEventInfo(KeyEvent.VK_F, vkMask)
115116
val C_L = getKeyEventInfo(KeyEvent.VK_L, vkMask)
116117
val C_G = getKeyEventInfo(KeyEvent.VK_G, vkMask)

0 commit comments

Comments
 (0)