Browse Source

[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
0.10
Philip Kaufmann 11 years ago
parent
commit
d3207b6fa8
  1. 25
      src/qt/coincontroldialog.cpp
  2. 63
      src/qt/forms/coincontroldialog.ui
  3. 62
      src/qt/forms/sendcoinsdialog.ui

25
src/qt/coincontroldialog.cpp

@ -590,7 +590,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee
l5->setText(((nBytes > 0) ? "~" : "") + QString::number(nBytes)); // Bytes l5->setText(((nBytes > 0) ? "~" : "") + QString::number(nBytes)); // Bytes
l6->setText(sPriorityLabel); // Priority l6->setText(sPriorityLabel); // Priority
l7->setText((fLowOutput ? (fDust ? tr("DUST") : tr("yes")) : tr("no"))); // Low Output / Dust l7->setText((fLowOutput ? (fDust ? tr("Dust") : tr("yes")) : tr("no"))); // Low Output / Dust
l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change
// turn labels "red" // turn labels "red"
@ -600,10 +600,25 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
l8->setStyleSheet((nChange > 0 && nChange < CENT) ? "color:red;" : ""); // Change < 0.01BTC l8->setStyleSheet((nChange > 0 && nChange < CENT) ? "color:red;" : ""); // Change < 0.01BTC
// tool tips // tool tips
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))); QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "<br /><br />";
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))); toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)) + "<br /><br />";
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))); toolTip1 += tr("Can vary +/- 1 byte per input.");
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)));
QString toolTip2 = tr("Transactions with higher priority are more likely to get included into a block.") + "<br /><br />";
toolTip2 += tr("This label turns red, if the priority is smaller than \"medium\"") + "<br /><br />";
toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee));
QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />";
toolTip3 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee)) + "<br /><br />";
toolTip3 += tr("Amounts below 0.546 times the minimum relay fee are shown as dust.");
QString toolTip4 = tr("This label turns red, if the change is smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />";
toolTip4 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::nMinTxFee));
l5->setToolTip(toolTip1);
l6->setToolTip(toolTip2);
l7->setToolTip(toolTip3);
l8->setToolTip(toolTip4);
dialog->findChild<QLabel *>("labelCoinControlBytesText") ->setToolTip(l5->toolTip()); dialog->findChild<QLabel *>("labelCoinControlBytesText") ->setToolTip(l5->toolTip());
dialog->findChild<QLabel *>("labelCoinControlPriorityText") ->setToolTip(l6->toolTip()); dialog->findChild<QLabel *>("labelCoinControlPriorityText") ->setToolTip(l6->toolTip());
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setToolTip(l7->toolTip()); dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setToolTip(l7->toolTip());

63
src/qt/forms/coincontroldialog.ui

@ -38,8 +38,11 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelCoinControlQuantityText"> <widget class="QLabel" name="labelCoinControlQuantityText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Quantity:</string> <string>Quantity:</string>
@ -64,8 +67,11 @@
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelCoinControlBytesText"> <widget class="QLabel" name="labelCoinControlBytesText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Bytes:</string> <string>Bytes:</string>
@ -106,8 +112,11 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelCoinControlAmountText"> <widget class="QLabel" name="labelCoinControlAmountText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Amount:</string> <string>Amount:</string>
@ -132,8 +141,11 @@
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelCoinControlPriorityText"> <widget class="QLabel" name="labelCoinControlPriorityText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Priority:</string> <string>Priority:</string>
@ -148,6 +160,9 @@
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum> <enum>Qt::ActionsContextMenu</enum>
</property> </property>
<property name="text">
<string notr="true">medium</string>
</property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property> </property>
@ -171,8 +186,11 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelCoinControlFeeText"> <widget class="QLabel" name="labelCoinControlFeeText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Fee:</string> <string>Fee:</string>
@ -200,8 +218,11 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Low Output:</string> <string>Low Output:</string>
@ -220,7 +241,7 @@
<enum>Qt::ActionsContextMenu</enum> <enum>Qt::ActionsContextMenu</enum>
</property> </property>
<property name="text"> <property name="text">
<string>no</string> <string notr="true">no</string>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
@ -245,8 +266,11 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelCoinControlAfterFeeText"> <widget class="QLabel" name="labelCoinControlAfterFeeText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>After Fee:</string> <string>After Fee:</string>
@ -274,8 +298,11 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Change:</string> <string>Change:</string>
@ -377,7 +404,7 @@
<item> <item>
<widget class="QLabel" name="labelLocked"> <widget class="QLabel" name="labelLocked">
<property name="text"> <property name="text">
<string>(1 locked)</string> <string notr="true">(1 locked)</string>
</property> </property>
</widget> </widget>
</item> </item>

62
src/qt/forms/sendcoinsdialog.ui

@ -215,8 +215,11 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelCoinControlQuantityText"> <widget class="QLabel" name="labelCoinControlQuantityText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Quantity:</string> <string>Quantity:</string>
@ -247,8 +250,11 @@
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelCoinControlBytesText"> <widget class="QLabel" name="labelCoinControlBytesText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Bytes:</string> <string>Bytes:</string>
@ -292,8 +298,11 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelCoinControlAmountText"> <widget class="QLabel" name="labelCoinControlAmountText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Amount:</string> <string>Amount:</string>
@ -321,8 +330,11 @@
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelCoinControlPriorityText"> <widget class="QLabel" name="labelCoinControlPriorityText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Priority:</string> <string>Priority:</string>
@ -338,7 +350,7 @@
<enum>Qt::ActionsContextMenu</enum> <enum>Qt::ActionsContextMenu</enum>
</property> </property>
<property name="text"> <property name="text">
<string>medium</string> <string notr="true">medium</string>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
@ -366,8 +378,11 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelCoinControlFeeText"> <widget class="QLabel" name="labelCoinControlFeeText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Fee:</string> <string>Fee:</string>
@ -395,8 +410,11 @@
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelCoinControlLowOutputText"> <widget class="QLabel" name="labelCoinControlLowOutputText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Low Output:</string> <string>Low Output:</string>
@ -412,7 +430,7 @@
<enum>Qt::ActionsContextMenu</enum> <enum>Qt::ActionsContextMenu</enum>
</property> </property>
<property name="text"> <property name="text">
<string>no</string> <string notr="true">no</string>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
@ -440,8 +458,11 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelCoinControlAfterFeeText"> <widget class="QLabel" name="labelCoinControlAfterFeeText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>After Fee:</string> <string>After Fee:</string>
@ -469,8 +490,11 @@
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelCoinControlChangeText"> <widget class="QLabel" name="labelCoinControlChangeText">
<property name="styleSheet"> <property name="font">
<string notr="true">font-weight:bold;</string> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Change:</string> <string>Change:</string>
@ -693,7 +717,7 @@
<cursorShape>IBeamCursor</cursorShape> <cursorShape>IBeamCursor</cursorShape>
</property> </property>
<property name="text"> <property name="text">
<string>123.456 BTC</string> <string notr="true">123.456 BTC</string>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>

Loading…
Cancel
Save