Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Block Clock to Block Status #441

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ QT_FORMS_UI = \
qt/forms/transactiondescdialog.ui

QT_MOC_CPP = \
qml/components/moc_blockclockdial.cpp \
qml/components/moc_blockstatusdial.cpp \
qml/controls/moc_linegraph.cpp \
qml/models/moc_chainmodel.cpp \
qml/models/moc_networktraffictower.cpp \
Expand Down Expand Up @@ -118,7 +118,7 @@ QT_QRC_LOCALE_CPP = qt/qrc_bitcoin_locale.cpp
QT_QRC_LOCALE = qt/bitcoin_locale.qrc

BITCOIN_QT_H = \
qml/components/blockclockdial.h \
qml/components/blockstatusdial.h \
qml/controls/linegraph.h \
qml/models/chainmodel.h \
qml/models/networktraffictower.h \
Expand Down Expand Up @@ -310,7 +310,7 @@ BITCOIN_QT_WALLET_CPP = \

BITCOIN_QML_BASE_CPP = \
qml/bitcoin.cpp \
qml/components/blockclockdial.cpp \
qml/components/blockstatusdial.cpp \
qml/controls/linegraph.cpp \
qml/models/chainmodel.cpp \
qml/models/networktraffictower.cpp \
Expand All @@ -333,8 +333,8 @@ QML_RES_ICONS = \
qml/res/icons/arrow-down.png \
qml/res/icons/arrow-up.png \
qml/res/icons/bitcoin-circle.png \
qml/res/icons/blockclock-size-compact.png \
qml/res/icons/blockclock-size-showcase.png \
qml/res/icons/blockstatus-size-compact.png \
qml/res/icons/blockstatus-size-showcase.png \
qml/res/icons/blocktime-dark.png \
qml/res/icons/blocktime-light.png \
qml/res/icons/caret-left.png \
Expand Down Expand Up @@ -364,8 +364,8 @@ QML_QRC_CPP = qml/qrc_bitcoin.cpp
QML_QRC = qml/bitcoin_qml.qrc
QML_RES_QML = \
qml/components/AboutOptions.qml \
qml/components/BlockClock.qml \
qml/components/BlockClockDisplayMode.qml \
qml/components/BlockStatus.qml \
qml/components/BlockStatusDisplayMode.qml \
qml/components/BlockCounter.qml \
qml/components/ConnectionOptions.qml \
qml/components/ConnectionSettings.qml \
Expand Down Expand Up @@ -418,15 +418,15 @@ QML_RES_QML = \
qml/pages/node/Peers.qml \
qml/pages/node/PeerDetails.qml \
qml/pages/node/Shutdown.qml \
qml/pages/onboarding/OnboardingBlockclock.qml \
qml/pages/onboarding/OnboardingBlockStatus.qml \
qml/pages/onboarding/OnboardingConnection.qml \
qml/pages/onboarding/OnboardingCover.qml \
qml/pages/onboarding/OnboardingStorageAmount.qml \
qml/pages/onboarding/OnboardingStorageLocation.qml \
qml/pages/onboarding/OnboardingStrengthen.qml \
qml/pages/onboarding/OnboardingWizard.qml \
qml/pages/settings/SettingsAbout.qml \
qml/pages/settings/SettingsBlockClockDisplayMode.qml \
qml/pages/settings/SettingsBlockStatusDisplayMode.qml \
qml/pages/settings/SettingsConnection.qml \
qml/pages/settings/SettingsDeveloper.qml \
qml/pages/settings/SettingsDisplay.qml \
Expand Down
4 changes: 2 additions & 2 deletions src/qml/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifdef __ANDROID__
#include <qml/androidnotifier.h>
#endif
#include <qml/components/blockclockdial.h>
#include <qml/components/blockstatusdial.h>
#include <qml/controls/linegraph.h>
#include <qml/guiconstants.h>
#include <qml/models/chainmodel.h>
Expand Down Expand Up @@ -327,7 +327,7 @@ int QmlGuiMain(int argc, char* argv[])
AppMode app_mode = SetupAppMode();

qmlRegisterSingletonInstance<AppMode>("org.bitcoincore.qt", 1, 0, "AppMode", &app_mode);
qmlRegisterType<BlockClockDial>("org.bitcoincore.qt", 1, 0, "BlockClockDial");
qmlRegisterType<BlockStatusDial>("org.bitcoincore.qt", 1, 0, "BlockStatusDial");
qmlRegisterType<LineGraph>("org.bitcoincore.qt", 1, 0, "LineGraph");
qmlRegisterUncreatableType<PeerDetailsModel>("org.bitcoincore.qt", 1, 0, "PeerDetailsModel", "");

Expand Down
12 changes: 6 additions & 6 deletions src/qml/bitcoin_qml.qrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/qml">
<file>components/AboutOptions.qml</file>
<file>components/BlockClock.qml</file>
<file>components/BlockClockDisplayMode.qml</file>
<file>components/BlockStatus.qml</file>
<file>components/BlockStatusDisplayMode.qml</file>
<file>components/BlockCounter.qml</file>
<file>controls/CaretRightIcon.qml</file>
<file>components/ConnectionOptions.qml</file>
Expand Down Expand Up @@ -55,15 +55,15 @@
<file>pages/node/Peers.qml</file>
<file>pages/node/PeerDetails.qml</file>
<file>pages/node/Shutdown.qml</file>
<file>pages/onboarding/OnboardingBlockclock.qml</file>
<file>pages/onboarding/OnboardingBlockStatus.qml</file>
<file>pages/onboarding/OnboardingConnection.qml</file>
<file>pages/onboarding/OnboardingCover.qml</file>
<file>pages/onboarding/OnboardingStorageAmount.qml</file>
<file>pages/onboarding/OnboardingStorageLocation.qml</file>
<file>pages/onboarding/OnboardingStrengthen.qml</file>
<file>pages/onboarding/OnboardingWizard.qml</file>
<file>pages/settings/SettingsAbout.qml</file>
<file>pages/settings/SettingsBlockClockDisplayMode.qml</file>
<file>pages/settings/SettingsBlockStatusDisplayMode.qml</file>
<file>pages/settings/SettingsConnection.qml</file>
<file>pages/settings/SettingsDeveloper.qml</file>
<file>pages/settings/SettingsDisplay.qml</file>
Expand All @@ -85,8 +85,8 @@
<file alias="arrow-down">res/icons/arrow-down.png</file>
<file alias="arrow-up">res/icons/arrow-up.png</file>
<file alias="bitcoin-circle">res/icons/bitcoin-circle.png</file>
<file alias="blockclock-size-compact">res/icons/blockclock-size-compact.png</file>
<file alias="blockclock-size-showcase">res/icons/blockclock-size-showcase.png</file>
<file alias="blockstatus-size-compact">res/icons/blockstatus-size-compact.png</file>
<file alias="blockstatus-size-showcase">res/icons/blockstatus-size-showcase.png</file>
<file alias="blocktime-dark">res/icons/blocktime-dark.png</file>
<file alias="blocktime-light">res/icons/blocktime-light.png</file>
<file alias="bitcoin">../qt/res/icons/bitcoin.png</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ Item {

Settings {
id: settings
property alias blockclocksize: dial.scale
property alias blockstatussize: dial.scale
}

BlockClockDial {
BlockStatusDial {
id: dial
anchors.horizontalCenter: root.horizontalCenter
scale: Theme.blockclocksize
scale: Theme.blockstatussize
width: {Math.max(Math.min(200, Math.min(root.parentWidth - 30, root.parentHeight - 30)),
Math.min((root.parentWidth * dial.scale), (root.parentHeight * dial.scale)))}
height: dial.width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ ColumnLayout {
ButtonGroup.group: group
text: qsTr("Compact")
description: qsTr("For personal use on a computer or smartphone.")
image: "image://images/blockclock-size-compact"
checked: Theme.blockclocksize == (1/3)
image: "image://images/blockstatus-size-compact"
checked: Theme.blockstatussize == (1/3)
onClicked: {
Theme.blockclocksize = (1/3)
Theme.blockstatussize = (1/3)
}
}

OptionButton {
Layout.fillWidth: true
ButtonGroup.group: group
text: qsTr("Showcase")
description: qsTr("A larger block clock for public display on a tablet or other large screen.")
image: "image://images/blockclock-size-showcase"
checked: Theme.blockclocksize == (1/2)
description: qsTr("A larger block status for public display on a tablet or other large screen.")
image: "image://images/blockstatus-size-showcase"
checked: Theme.blockstatussize == (1/2)
onClicked: {
Theme.blockclocksize = (1/2)
Theme.blockstatussize = (1/2)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <qml/components/blockclockdial.h>
#include <qml/components/blockstatusdial.h>

#include <QBrush>
#include <QColor>
Expand All @@ -12,7 +12,7 @@
#include <QtMath>
#include <QtGlobal>

BlockClockDial::BlockClockDial(QQuickItem *parent)
BlockStatusDial::BlockStatusDial(QQuickItem *parent)
: QQuickPaintedItem(parent)
{
m_animation_timer.setTimerType(Qt::PreciseTimer);
Expand All @@ -32,7 +32,7 @@ BlockClockDial::BlockClockDial(QQuickItem *parent)
m_delay_timer.start();
}

void BlockClockDial::setupConnectingGradient(const QPen & pen)
void BlockStatusDial::setupConnectingGradient(const QPen & pen)
{
m_connecting_gradient.setCenter(getBoundsForPen(pen).center());
m_connecting_gradient.setAngle(m_connecting_start_angle);
Expand All @@ -43,7 +43,7 @@ void BlockClockDial::setupConnectingGradient(const QPen & pen)
m_connecting_gradient.setColorAt(1, "transparent");
}

qreal BlockClockDial::decrementGradientAngle(qreal angle)
qreal BlockStatusDial::decrementGradientAngle(qreal angle)
{
if (angle == -360) {
return 0;
Expand All @@ -52,7 +52,7 @@ qreal BlockClockDial::decrementGradientAngle(qreal angle)
}
}

qreal BlockClockDial::getTargetAnimationAngle()
qreal BlockStatusDial::getTargetAnimationAngle()
{
if (connected() && synced()) {
return m_time_ratio_list[0].toDouble() * 360;
Expand All @@ -63,7 +63,7 @@ qreal BlockClockDial::getTargetAnimationAngle()
}
}

qreal BlockClockDial::incrementAnimatingMaxAngle(qreal angle)
qreal BlockStatusDial::incrementAnimatingMaxAngle(qreal angle)
{
if (connected()) {
return angle += (getTargetAnimationAngle() - angle) * 0.05;
Expand All @@ -77,19 +77,19 @@ qreal BlockClockDial::incrementAnimatingMaxAngle(qreal angle)
}
}

void BlockClockDial::setTimeRatioList(QVariantList new_list)
void BlockStatusDial::setTimeRatioList(QVariantList new_list)
{
m_time_ratio_list = new_list;
update();
}

void BlockClockDial::setVerificationProgress(double progress)
void BlockStatusDial::setVerificationProgress(double progress)
{
m_verification_progress = progress;
update();
}

void BlockClockDial::setConnected(bool connected)
void BlockStatusDial::setConnected(bool connected)
{
if (m_is_connected != connected) {
m_is_connected = connected;
Expand All @@ -104,7 +104,7 @@ void BlockClockDial::setConnected(bool connected)
}
}

void BlockClockDial::setSynced(bool is_synced)
void BlockStatusDial::setSynced(bool is_synced)
{
if (m_is_synced != is_synced) {
m_is_synced = is_synced;
Expand All @@ -116,7 +116,7 @@ void BlockClockDial::setSynced(bool is_synced)
}
}

void BlockClockDial::setPaused(bool paused)
void BlockStatusDial::setPaused(bool paused)
{
if (m_is_paused != paused) {
m_is_paused = paused;
Expand All @@ -128,39 +128,39 @@ void BlockClockDial::setPaused(bool paused)
}
}

void BlockClockDial::setPenWidth(qreal width)
void BlockStatusDial::setPenWidth(qreal width)
{
m_pen_width = width;
update();
}

void BlockClockDial::setScale(qreal scale)
void BlockStatusDial::setScale(qreal scale)
{
m_scale = scale;
update();

Q_EMIT scaleChanged();
}

void BlockClockDial::setBackgroundColor(QColor color)
void BlockStatusDial::setBackgroundColor(QColor color)
{
m_background_color = color;
update();
}

void BlockClockDial::setConfirmationColors(QList<QColor> colorList)
void BlockStatusDial::setConfirmationColors(QList<QColor> colorList)
{
m_confirmation_colors = colorList;
update();
}

void BlockClockDial::setTimeTickColor(QColor color)
void BlockStatusDial::setTimeTickColor(QColor color)
{
m_time_tick_color = color;
update();
}

QRectF BlockClockDial::getBoundsForPen(const QPen & pen)
QRectF BlockStatusDial::getBoundsForPen(const QPen & pen)
{
const QRectF bounds = boundingRect();
const qreal smallest = qMin(bounds.width(), bounds.height());
Expand All @@ -185,7 +185,7 @@ QRectF BlockClockDial::getBoundsForPen(const QPen & pen)
return rect;
}

void BlockClockDial::paintBlocks(QPainter * painter)
void BlockStatusDial::paintBlocks(QPainter * painter)
{
int numberOfBlocks = m_time_ratio_list.length();
if (numberOfBlocks < 2) {
Expand Down Expand Up @@ -234,7 +234,7 @@ void BlockClockDial::paintBlocks(QPainter * painter)
}
}

void BlockClockDial::paintProgress(QPainter * painter)
void BlockStatusDial::paintProgress(QPainter * painter)
{
QPen pen(m_confirmation_colors[5]);
pen.setWidthF(m_pen_width);
Expand All @@ -257,7 +257,7 @@ void BlockClockDial::paintProgress(QPainter * painter)
painter->drawArc(bounds, startAngle * 16, spanAngle * 16);
}

void BlockClockDial::paintConnectingAnimation(QPainter * painter)
void BlockStatusDial::paintConnectingAnimation(QPainter * painter)
{
QPen pen;
pen.setWidthF(m_pen_width);
Expand All @@ -274,7 +274,7 @@ void BlockClockDial::paintConnectingAnimation(QPainter * painter)
}
}

void BlockClockDial::paintBackground(QPainter * painter)
void BlockStatusDial::paintBackground(QPainter * painter)
{
QPen pen(m_background_color);
pen.setWidthF(m_pen_width);
Expand All @@ -284,13 +284,13 @@ void BlockClockDial::paintBackground(QPainter * painter)
painter->drawEllipse(bounds);
}

double BlockClockDial::degreesPerPixel()
double BlockStatusDial::degreesPerPixel()
{
double circumference = width() * 3.1415926;
return 360 / circumference;
}

void BlockClockDial::paintTimeTicks(QPainter * painter)
void BlockStatusDial::paintTimeTicks(QPainter * painter)
{
QPen pen(m_time_tick_color);
pen.setWidthF(m_pen_width);
Expand All @@ -309,7 +309,7 @@ void BlockClockDial::paintTimeTicks(QPainter * painter)
}
}

void BlockClockDial::paint(QPainter * painter)
void BlockStatusDial::paint(QPainter * painter)
{
if (width() <= 0 || height() <= 0) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <QTimer>
#include <QtGlobal>

class BlockClockDial : public QQuickPaintedItem
class BlockStatusDial : public QQuickPaintedItem
{
Q_OBJECT
Q_PROPERTY(QVariantList timeRatioList READ timeRatioList WRITE setTimeRatioList)
Expand All @@ -26,7 +26,7 @@ class BlockClockDial : public QQuickPaintedItem
Q_PROPERTY(QColor timeTickColor READ timeTickColor WRITE setTimeTickColor)

public:
explicit BlockClockDial(QQuickItem * parent = nullptr);
explicit BlockStatusDial(QQuickItem * parent = nullptr);
void paint(QPainter * painter) override;

QVariantList timeRatioList() const { return m_time_ratio_list; };
Expand Down
Loading
Loading