Skip to content

Commit d3207b6

Browse files
author
Philip Kaufmann
committed
[Qt] coin-control features GUI cleanup 3
- remove style sheets from ui files and use Qt attributes instead - make some more strings untranslatable, to make life for translators easier - split up long tooltips an rework the texts a little
1 parent 834e14e commit d3207b6

File tree

3 files changed

+108
-42
lines changed

3 files changed

+108
-42
lines changed

src/qt/coincontroldialog.cpp

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
590590
l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee
591591
l5->setText(((nBytes > 0) ? "~" : "") + QString::number(nBytes)); // Bytes
592592
l6->setText(sPriorityLabel); // Priority
593-
l7->setText((fLowOutput ? (fDust ? tr("DUST") : tr("yes")) : tr("no"))); // Low Output / Dust
593+
l7->setText((fLowOutput ? (fDust ? tr("Dust") : tr("yes")) : tr("no"))); // Low Output / Dust
594594
l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change
595595

596596
// turn labels "red"
@@ -600,10 +600,25 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
600600
l8->setStyleSheet((nChange > 0 && nChange < CENT) ? "color:red;" : ""); // Change < 0.01BTC
601601

602602
// tool tips
603-
l5->setToolTip(tr("This label turns red, if the transaction size is bigger than 1000 bytes.\n\n This means a fee of at least %1 per kb is required.\n\n Can vary +/- 1 Byte per input.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)));
604-
l6->setToolTip(tr("Transactions with higher priority get more likely into a block.\n\nThis label turns red, if the priority is smaller than \"medium\".\n\n This means a fee of at least %1 per kb is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)));
605-
l7->setToolTip(tr("This label turns red, if any recipient receives an amount smaller than %1.\n\n This means a fee of at least %2 is required. \n\n Amounts below 0.546 times the minimum relay fee are shown as DUST.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)).arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)));
606-
l8->setToolTip(tr("This label turns red, if the change is smaller than %1.\n\n This means a fee of at least %2 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)).arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)));
603+
QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "<br /><br />";
604+
toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)) + "<br /><br />";
605+
toolTip1 += tr("Can vary +/- 1 byte per input.");
606+
607+
QString toolTip2 = tr("Transactions with higher priority are more likely to get included into a block.") + "<br /><br />";
608+
toolTip2 += tr("This label turns red, if the priority is smaller than \"medium\"") + "<br /><br />";
609+
toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee));
610+
611+
QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />";
612+
toolTip3 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)) + "<br /><br />";
613+
toolTip3 += tr("Amounts below 0.546 times the minimum relay fee are shown as dust.");
614+
615+
QString toolTip4 = tr("This label turns red, if the change is smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />";
616+
toolTip4 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee));
617+
618+
l5->setToolTip(toolTip1);
619+
l6->setToolTip(toolTip2);
620+
l7->setToolTip(toolTip3);
621+
l8->setToolTip(toolTip4);
607622
dialog->findChild<QLabel *>("labelCoinControlBytesText") ->setToolTip(l5->toolTip());
608623
dialog->findChild<QLabel *>("labelCoinControlPriorityText") ->setToolTip(l6->toolTip());
609624
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setToolTip(l7->toolTip());

src/qt/forms/coincontroldialog.ui

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@
3838
</property>
3939
<item row="0" column="0">
4040
<widget class="QLabel" name="labelCoinControlQuantityText">
41-
<property name="styleSheet">
42-
<string notr="true">font-weight:bold;</string>
41+
<property name="font">
42+
<font>
43+
<weight>75</weight>
44+
<bold>true</bold>
45+
</font>
4346
</property>
4447
<property name="text">
4548
<string>Quantity:</string>
@@ -64,8 +67,11 @@
6467
</item>
6568
<item row="1" column="0">
6669
<widget class="QLabel" name="labelCoinControlBytesText">
67-
<property name="styleSheet">
68-
<string notr="true">font-weight:bold;</string>
70+
<property name="font">
71+
<font>
72+
<weight>75</weight>
73+
<bold>true</bold>
74+
</font>
6975
</property>
7076
<property name="text">
7177
<string>Bytes:</string>
@@ -106,8 +112,11 @@
106112
</property>
107113
<item row="0" column="0">
108114
<widget class="QLabel" name="labelCoinControlAmountText">
109-
<property name="styleSheet">
110-
<string notr="true">font-weight:bold;</string>
115+
<property name="font">
116+
<font>
117+
<weight>75</weight>
118+
<bold>true</bold>
119+
</font>
111120
</property>
112121
<property name="text">
113122
<string>Amount:</string>
@@ -132,8 +141,11 @@
132141
</item>
133142
<item row="1" column="0">
134143
<widget class="QLabel" name="labelCoinControlPriorityText">
135-
<property name="styleSheet">
136-
<string notr="true">font-weight:bold;</string>
144+
<property name="font">
145+
<font>
146+
<weight>75</weight>
147+
<bold>true</bold>
148+
</font>
137149
</property>
138150
<property name="text">
139151
<string>Priority:</string>
@@ -148,6 +160,9 @@
148160
<property name="contextMenuPolicy">
149161
<enum>Qt::ActionsContextMenu</enum>
150162
</property>
163+
<property name="text">
164+
<string notr="true">medium</string>
165+
</property>
151166
<property name="textInteractionFlags">
152167
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
153168
</property>
@@ -171,8 +186,11 @@
171186
</property>
172187
<item row="0" column="0">
173188
<widget class="QLabel" name="labelCoinControlFeeText">
174-
<property name="styleSheet">
175-
<string notr="true">font-weight:bold;</string>
189+
<property name="font">
190+
<font>
191+
<weight>75</weight>
192+
<bold>true</bold>
193+
</font>
176194
</property>
177195
<property name="text">
178196
<string>Fee:</string>
@@ -200,8 +218,11 @@
200218
<property name="enabled">
201219
<bool>false</bool>
202220
</property>
203-
<property name="styleSheet">
204-
<string notr="true">font-weight:bold;</string>
221+
<property name="font">
222+
<font>
223+
<weight>75</weight>
224+
<bold>true</bold>
225+
</font>
205226
</property>
206227
<property name="text">
207228
<string>Low Output:</string>
@@ -220,7 +241,7 @@
220241
<enum>Qt::ActionsContextMenu</enum>
221242
</property>
222243
<property name="text">
223-
<string>no</string>
244+
<string notr="true">no</string>
224245
</property>
225246
<property name="textInteractionFlags">
226247
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
@@ -245,8 +266,11 @@
245266
</property>
246267
<item row="0" column="0">
247268
<widget class="QLabel" name="labelCoinControlAfterFeeText">
248-
<property name="styleSheet">
249-
<string notr="true">font-weight:bold;</string>
269+
<property name="font">
270+
<font>
271+
<weight>75</weight>
272+
<bold>true</bold>
273+
</font>
250274
</property>
251275
<property name="text">
252276
<string>After Fee:</string>
@@ -274,8 +298,11 @@
274298
<property name="enabled">
275299
<bool>false</bool>
276300
</property>
277-
<property name="styleSheet">
278-
<string notr="true">font-weight:bold;</string>
301+
<property name="font">
302+
<font>
303+
<weight>75</weight>
304+
<bold>true</bold>
305+
</font>
279306
</property>
280307
<property name="text">
281308
<string>Change:</string>
@@ -377,7 +404,7 @@
377404
<item>
378405
<widget class="QLabel" name="labelLocked">
379406
<property name="text">
380-
<string>(1 locked)</string>
407+
<string notr="true">(1 locked)</string>
381408
</property>
382409
</widget>
383410
</item>

src/qt/forms/sendcoinsdialog.ui

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,11 @@
215215
</property>
216216
<item row="0" column="0">
217217
<widget class="QLabel" name="labelCoinControlQuantityText">
218-
<property name="styleSheet">
219-
<string notr="true">font-weight:bold;</string>
218+
<property name="font">
219+
<font>
220+
<weight>75</weight>
221+
<bold>true</bold>
222+
</font>
220223
</property>
221224
<property name="text">
222225
<string>Quantity:</string>
@@ -247,8 +250,11 @@
247250
</item>
248251
<item row="1" column="0">
249252
<widget class="QLabel" name="labelCoinControlBytesText">
250-
<property name="styleSheet">
251-
<string notr="true">font-weight:bold;</string>
253+
<property name="font">
254+
<font>
255+
<weight>75</weight>
256+
<bold>true</bold>
257+
</font>
252258
</property>
253259
<property name="text">
254260
<string>Bytes:</string>
@@ -292,8 +298,11 @@
292298
</property>
293299
<item row="0" column="0">
294300
<widget class="QLabel" name="labelCoinControlAmountText">
295-
<property name="styleSheet">
296-
<string notr="true">font-weight:bold;</string>
301+
<property name="font">
302+
<font>
303+
<weight>75</weight>
304+
<bold>true</bold>
305+
</font>
297306
</property>
298307
<property name="text">
299308
<string>Amount:</string>
@@ -321,8 +330,11 @@
321330
</item>
322331
<item row="1" column="0">
323332
<widget class="QLabel" name="labelCoinControlPriorityText">
324-
<property name="styleSheet">
325-
<string notr="true">font-weight:bold;</string>
333+
<property name="font">
334+
<font>
335+
<weight>75</weight>
336+
<bold>true</bold>
337+
</font>
326338
</property>
327339
<property name="text">
328340
<string>Priority:</string>
@@ -338,7 +350,7 @@
338350
<enum>Qt::ActionsContextMenu</enum>
339351
</property>
340352
<property name="text">
341-
<string>medium</string>
353+
<string notr="true">medium</string>
342354
</property>
343355
<property name="textInteractionFlags">
344356
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
@@ -366,8 +378,11 @@
366378
</property>
367379
<item row="0" column="0">
368380
<widget class="QLabel" name="labelCoinControlFeeText">
369-
<property name="styleSheet">
370-
<string notr="true">font-weight:bold;</string>
381+
<property name="font">
382+
<font>
383+
<weight>75</weight>
384+
<bold>true</bold>
385+
</font>
371386
</property>
372387
<property name="text">
373388
<string>Fee:</string>
@@ -395,8 +410,11 @@
395410
</item>
396411
<item row="1" column="0">
397412
<widget class="QLabel" name="labelCoinControlLowOutputText">
398-
<property name="styleSheet">
399-
<string notr="true">font-weight:bold;</string>
413+
<property name="font">
414+
<font>
415+
<weight>75</weight>
416+
<bold>true</bold>
417+
</font>
400418
</property>
401419
<property name="text">
402420
<string>Low Output:</string>
@@ -412,7 +430,7 @@
412430
<enum>Qt::ActionsContextMenu</enum>
413431
</property>
414432
<property name="text">
415-
<string>no</string>
433+
<string notr="true">no</string>
416434
</property>
417435
<property name="textInteractionFlags">
418436
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
@@ -440,8 +458,11 @@
440458
</property>
441459
<item row="0" column="0">
442460
<widget class="QLabel" name="labelCoinControlAfterFeeText">
443-
<property name="styleSheet">
444-
<string notr="true">font-weight:bold;</string>
461+
<property name="font">
462+
<font>
463+
<weight>75</weight>
464+
<bold>true</bold>
465+
</font>
445466
</property>
446467
<property name="text">
447468
<string>After Fee:</string>
@@ -469,8 +490,11 @@
469490
</item>
470491
<item row="1" column="0">
471492
<widget class="QLabel" name="labelCoinControlChangeText">
472-
<property name="styleSheet">
473-
<string notr="true">font-weight:bold;</string>
493+
<property name="font">
494+
<font>
495+
<weight>75</weight>
496+
<bold>true</bold>
497+
</font>
474498
</property>
475499
<property name="text">
476500
<string>Change:</string>
@@ -693,7 +717,7 @@
693717
<cursorShape>IBeamCursor</cursorShape>
694718
</property>
695719
<property name="text">
696-
<string>123.456 BTC</string>
720+
<string notr="true">123.456 BTC</string>
697721
</property>
698722
<property name="textInteractionFlags">
699723
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>

0 commit comments

Comments
 (0)