Skip to content

Commit 48e9c6c

Browse files
committed
Allow jumping to any page in value view
1 parent bf410a4 commit 48e9c6c

File tree

8 files changed

+95
-42
lines changed

8 files changed

+95
-42
lines changed

src/qml/common/BetterTextField.qml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ import QtQuick.Controls 2.3
44
TextField {
55
id: control
66
property bool validationError: false
7+
property int bgImplicitWidth: 200
8+
property int bgImplicitHeight: 30
9+
property string tooltip
10+
711
selectByMouse: true
812

913
color: sysPalette.text
1014
selectionColor: sysPalette.highlight
1115
selectedTextColor: sysPalette.highlightedText
1216

1317
background: Rectangle {
14-
implicitWidth: 200
15-
implicitHeight: 30
18+
implicitWidth: control.bgImplicitWidth
19+
implicitHeight: control.bgImplicitHeight
1620
color: sysPalette.button
1721
border.width: control.validationError? 2 : 1
1822
border.color: {
@@ -22,4 +26,8 @@ TextField {
2226
return control.activeFocus ? sysPalette.highlight : sysPalette.mid
2327
}
2428
}
29+
30+
BetterToolTip {
31+
title: control.tooltip
32+
}
2533
}

src/qml/value-editor/Pagination.qml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,43 @@ import "../common"
55

66
ColumnLayout {
77
GridLayout {
8-
columns: 3
8+
columns: 2
99
Layout.fillWidth: true
1010

1111
BetterLabel {
12-
text: qsTranslate("RDM","Page") + " "
12+
text: qsTranslate("RDM","Page") + ":"
1313
wrapMode: Text.WrapAnywhere
1414
}
1515

16-
BetterLabel {
16+
BetterTextField {
1717
id: pageField;
18+
1819
text: table.currentPage;
19-
Layout.maximumWidth: 60;
20-
}
2120

22-
BetterLabel {
23-
Layout.maximumWidth: 130
24-
text: " of " + table.totalPages
25-
wrapMode: Text.WrapAnywhere
21+
tooltip: qsTranslate("RDM", "Total pages: ") + table.totalPages
22+
23+
Layout.fillWidth: true
24+
25+
validator: IntValidator {
26+
locale: pageField.locale.name
27+
bottom: 1
28+
top: table.totalPages
29+
}
30+
31+
onFocusChanged: {
32+
if (focus)
33+
return;
34+
35+
text = Qt.binding(function() { return table.currentPage; });
36+
}
37+
38+
onAccepted: {
39+
table.goToPage(text)
40+
}
2641
}
2742

2843
BetterLabel {
29-
Layout.columnSpan: 3
44+
Layout.columnSpan: 2
3045
text: qsTranslate("RDM","Size: ") + keyRowsCount
3146
}
3247
}

src/resources/translations/rdm.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@
151151
<context>
152152
<name>QObject</name>
153153
<message>
154-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="357"/>
155-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="389"/>
154+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="357"/>
155+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="389"/>
156156
<source>Cannot connect to cluster node %1:%2</source>
157157
<translation type="unfinished"></translation>
158158
</message>
159159
<message>
160-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="400"/>
161-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="418"/>
160+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="400"/>
161+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="418"/>
162162
<source>Cannot flush db (%1): %2</source>
163163
<translation type="unfinished"></translation>
164164
</message>
@@ -360,7 +360,12 @@
360360
<translation type="unfinished"></translation>
361361
</message>
362362
<message>
363-
<location filename="../../qml/value-editor/Pagination.qml" line="30"/>
363+
<location filename="../../qml/value-editor/Pagination.qml" line="21"/>
364+
<source>Total pages: </source>
365+
<translation type="unfinished"></translation>
366+
</message>
367+
<message>
368+
<location filename="../../qml/value-editor/Pagination.qml" line="45"/>
364369
<location filename="../../qml/value-editor/ValueTabs.qml" line="223"/>
365370
<location filename="../../qml/value-editor/editors/MultilineEditor.qml" line="316"/>
366371
<source>Size: </source>

src/resources/translations/rdm_es_ES.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@
151151
<context>
152152
<name>QObject</name>
153153
<message>
154-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="357"/>
155-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="389"/>
154+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="357"/>
155+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="389"/>
156156
<source>Cannot connect to cluster node %1:%2</source>
157157
<translation>No se puede conectar al nodo del cluster %1:%2</translation>
158158
</message>
159159
<message>
160-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="400"/>
161-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="418"/>
160+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="400"/>
161+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="418"/>
162162
<source>Cannot flush db (%1): %2</source>
163163
<translation>No se puede vaciar db (%1): %2</translation>
164164
</message>
@@ -406,7 +406,12 @@
406406
<translation>Nuevo nombre:</translation>
407407
</message>
408408
<message>
409-
<location filename="../../qml/value-editor/Pagination.qml" line="30"/>
409+
<location filename="../../qml/value-editor/Pagination.qml" line="21"/>
410+
<source>Total pages: </source>
411+
<translation type="unfinished"></translation>
412+
</message>
413+
<message>
414+
<location filename="../../qml/value-editor/Pagination.qml" line="45"/>
410415
<location filename="../../qml/value-editor/ValueTabs.qml" line="223"/>
411416
<location filename="../../qml/value-editor/editors/MultilineEditor.qml" line="316"/>
412417
<source>Size: </source>

src/resources/translations/rdm_ja_JP.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@
151151
<context>
152152
<name>QObject</name>
153153
<message>
154-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="357"/>
155-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="389"/>
154+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="357"/>
155+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="389"/>
156156
<source>Cannot connect to cluster node %1:%2</source>
157157
<translation>クラスタノードに書き込みできません&#x3000;%1:%2</translation>
158158
</message>
159159
<message>
160-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="400"/>
161-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="418"/>
160+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="400"/>
161+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="418"/>
162162
<source>Cannot flush db (%1): %2</source>
163163
<translation>DBをフラッシュできません&#x3000;(%1): %2</translation>
164164
</message>
@@ -366,7 +366,12 @@
366366
<translation>新しい名前:</translation>
367367
</message>
368368
<message>
369-
<location filename="../../qml/value-editor/Pagination.qml" line="30"/>
369+
<location filename="../../qml/value-editor/Pagination.qml" line="21"/>
370+
<source>Total pages: </source>
371+
<translation type="unfinished"></translation>
372+
</message>
373+
<message>
374+
<location filename="../../qml/value-editor/Pagination.qml" line="45"/>
370375
<location filename="../../qml/value-editor/ValueTabs.qml" line="223"/>
371376
<location filename="../../qml/value-editor/editors/MultilineEditor.qml" line="316"/>
372377
<source>Size: </source>

src/resources/translations/rdm_ru_RU.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@
151151
<context>
152152
<name>QObject</name>
153153
<message>
154-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="357"/>
155-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="389"/>
154+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="357"/>
155+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="389"/>
156156
<source>Cannot connect to cluster node %1:%2</source>
157157
<translation type="unfinished"></translation>
158158
</message>
159159
<message>
160-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="400"/>
161-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="418"/>
160+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="400"/>
161+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="418"/>
162162
<source>Cannot flush db (%1): %2</source>
163163
<translation type="unfinished"></translation>
164164
</message>
@@ -386,7 +386,12 @@
386386
<translation>Новое имя:</translation>
387387
</message>
388388
<message>
389-
<location filename="../../qml/value-editor/Pagination.qml" line="30"/>
389+
<location filename="../../qml/value-editor/Pagination.qml" line="21"/>
390+
<source>Total pages: </source>
391+
<translation type="unfinished"></translation>
392+
</message>
393+
<message>
394+
<location filename="../../qml/value-editor/Pagination.qml" line="45"/>
390395
<location filename="../../qml/value-editor/ValueTabs.qml" line="223"/>
391396
<location filename="../../qml/value-editor/editors/MultilineEditor.qml" line="316"/>
392397
<source>Size: </source>

src/resources/translations/rdm_zh_CN.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@
151151
<context>
152152
<name>QObject</name>
153153
<message>
154-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="357"/>
155-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="389"/>
154+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="357"/>
155+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="389"/>
156156
<source>Cannot connect to cluster node %1:%2</source>
157157
<translation>无法连接集群节点 %1:%2</translation>
158158
</message>
159159
<message>
160-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="400"/>
161-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="418"/>
160+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="400"/>
161+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="418"/>
162162
<source>Cannot flush db (%1): %2</source>
163163
<translation>无法刷新库 (%1): %2</translation>
164164
</message>
@@ -406,7 +406,12 @@
406406
<translation>新名称:</translation>
407407
</message>
408408
<message>
409-
<location filename="../../qml/value-editor/Pagination.qml" line="30"/>
409+
<location filename="../../qml/value-editor/Pagination.qml" line="21"/>
410+
<source>Total pages: </source>
411+
<translation type="unfinished"></translation>
412+
</message>
413+
<message>
414+
<location filename="../../qml/value-editor/Pagination.qml" line="45"/>
410415
<location filename="../../qml/value-editor/ValueTabs.qml" line="223"/>
411416
<location filename="../../qml/value-editor/editors/MultilineEditor.qml" line="316"/>
412417
<source>Size: </source>

src/resources/translations/rdm_zh_TW.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@
151151
<context>
152152
<name>QObject</name>
153153
<message>
154-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="357"/>
155-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="389"/>
154+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="357"/>
155+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="389"/>
156156
<source>Cannot connect to cluster node %1:%2</source>
157157
<translation>無法連接到叢集節點 %1:%2</translation>
158158
</message>
159159
<message>
160-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="400"/>
161-
<location filename="../../../3rdparty/qredisclient/src/qredisclient/connection.cpp" line="418"/>
160+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="400"/>
161+
<location filename="../../../../qredisclient/src/qredisclient/connection.cpp" line="418"/>
162162
<source>Cannot flush db (%1): %2</source>
163163
<translation>無法清空資料庫 (%1): %2</translation>
164164
</message>
@@ -406,7 +406,12 @@
406406
<translation>新名稱:</translation>
407407
</message>
408408
<message>
409-
<location filename="../../qml/value-editor/Pagination.qml" line="30"/>
409+
<location filename="../../qml/value-editor/Pagination.qml" line="21"/>
410+
<source>Total pages: </source>
411+
<translation type="unfinished"></translation>
412+
</message>
413+
<message>
414+
<location filename="../../qml/value-editor/Pagination.qml" line="45"/>
410415
<location filename="../../qml/value-editor/ValueTabs.qml" line="223"/>
411416
<location filename="../../qml/value-editor/editors/MultilineEditor.qml" line="316"/>
412417
<source>Size: </source>

0 commit comments

Comments
 (0)