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

gui: Fix nomenclature #2104

Merged
Merged
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
10 changes: 5 additions & 5 deletions src/gridcoin/researcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,12 +659,12 @@ AdvertiseBeaconResult GenerateBeaconKey(const Cpid& cpid)
return BeaconError::MISSING_KEY;
}

// Since the network-wide rain feature outputs GRC to beacon public key
// addresses, we describe this key as the participant's rain address to
// help identify transactions in the GUI:
//
// We label this key in the GUI to indicate to the user that it is a beacon key.
// The block number is also included because there are situations where there
// could be multiple beacon keys in the wallet due to expiration or forced re-
// advertisement.
const std::string address_label = strprintf(
"Beacon Rain Address for CPID %s (at %" PRIu64 ")",
"Beacon Address for CPID %s (at %" PRIu64 ")",
cpid.ToString(),
static_cast<uint64_t>(nBestHeight));

Expand Down
8 changes: 4 additions & 4 deletions src/qt/forms/rpcconsole.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1000</width>
<height>720</height>
<height>944</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -48,7 +48,7 @@
</widget>
</item>
<item row="37" column="2">
<widget class="QLabel" name="porDiff">
<widget class="QLabel" name="diff">
<property name="text">
<string>N/A</string>
</property>
Expand Down Expand Up @@ -295,9 +295,9 @@
</widget>
</item>
<item row="37" column="0">
<widget class="QLabel" name="porDiffLabel">
<widget class="QLabel" name="diffLabel">
<property name="text">
<string>Proof Of Research Difficulty</string>
<string>Difficulty</string>
</property>
</widget>
</item>
Expand Down
6 changes: 3 additions & 3 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ void RPCConsole::setClientModel(ClientModel *model)
setNumBlocks(model->getNumBlocks(), model->getNumBlocksOfPeers());

ui->boostVersion->setText(model->formatBoostVersion());
ui->porDiff->setText(model->getDifficulty());
ui->diff->setText(model->getDifficulty());

//Setup autocomplete and attach it
QStringList wordList;
Expand Down Expand Up @@ -487,7 +487,7 @@ void RPCConsole::message(int category, const QString &message, bool html)
void RPCConsole::setNumConnections(int count)
{
ui->numberOfConnections->setText(QString::number(count));
if (clientModel) ui->porDiff->setText(clientModel->getDifficulty());
if (clientModel) ui->diff->setText(clientModel->getDifficulty());

}

Expand All @@ -500,7 +500,7 @@ void RPCConsole::setNumBlocks(int count, int countOfPeers)
// If there is no current number available display N/A instead of 0, which can't ever be true
ui->totalBlocks->setText(clientModel->getNumBlocksOfPeers() == 0 ? tr("N/A") : QString::number(clientModel->getNumBlocksOfPeers()));
ui->lastBlockTime->setText(clientModel->getLastBlockDate().toString());
ui->porDiff->setText(clientModel->getDifficulty());
ui->diff->setText(clientModel->getDifficulty());
}
}

Expand Down
18 changes: 9 additions & 9 deletions src/qt/transactiondesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,31 +119,31 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, unsigned int vo
switch (gentype)
{
case MinedType::POS:
strHTML += tr("MINED - POS");
strHTML += tr("Mined - PoS");
break;
case MinedType::POR:
strHTML += tr("MINED - POR");
strHTML += tr("Mined - PoS+RR");
break;
case MinedType::ORPHANED:
strHTML += tr("MINED - ORPHANED");
strHTML += tr("Mined - Orphaned");
break;
case MinedType::POS_SIDE_STAKE_RCV:
strHTML += tr("POS SIDE STAKE RECEIVED");
strHTML += tr("PoS Side Stake Received");
break;
case MinedType::POR_SIDE_STAKE_RCV:
strHTML += tr("POR SIDE STAKE RECEIVED");
strHTML += tr("PoS+RR Side Stake Received");
break;
case MinedType::POS_SIDE_STAKE_SEND:
strHTML += tr("POS SIDE STAKE SENT");
strHTML += tr("PoS Side Stake Sent");
break;
case MinedType::POR_SIDE_STAKE_SEND:
strHTML += tr("POR SIDE STAKE SENT");
strHTML += tr("PoS+RR Side Stake Sent");
break;
case MinedType::SUPERBLOCK:
strHTML += tr("SUPERBLOCK");
strHTML += tr("Mined - Superblock");
break;
default:
strHTML += tr("MINED - UNKNOWN");
strHTML += tr("Mined - Unknown");
break;
}

Expand Down
18 changes: 9 additions & 9 deletions src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,23 +404,23 @@ QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const
switch (wtx->status.generated_type)
{
case MinedType::POS:
return tr("MINED - POS");
return tr("Mined - PoS");
case MinedType::POR:
return tr("MINED - POR");
return tr("Mined - PoS+RR");
case MinedType::ORPHANED:
return tr("MINED - ORPHANED");
return tr("Mined - Orphaned");
case MinedType::POS_SIDE_STAKE_RCV:
return tr("POS SIDE STAKE RECEIVED");
return tr("PoS Side Stake Received");
case MinedType::POR_SIDE_STAKE_RCV:
return tr("POR SIDE STAKE RECEIVED");
return tr("PoS+RR Side Stake Received");
case MinedType::POS_SIDE_STAKE_SEND:
return tr("POS SIDE STAKE SENT");
return tr("PoS Side Stake Sent");
case MinedType::POR_SIDE_STAKE_SEND:
return tr("POR SIDE STAKE SENT");
return tr("PoS+RR Side Stake Sent");
case MinedType::SUPERBLOCK:
return tr("MINED - SUPERBLOCK");
return tr("Mined - Superblock");
default:
return tr("MINED - UNKNOWN");
return tr("Mined - Unknown");
}
}
case TransactionRecord::BeaconAdvertisement:
Expand Down
66 changes: 39 additions & 27 deletions src/qt/votingdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static int column_alignments[] = {
Qt::AlignRight|Qt::AlignVCenter, // RowNumber
Qt::AlignLeft|Qt::AlignVCenter, // Expiration
Qt::AlignLeft|Qt::AlignVCenter, // Title
Qt::AlignLeft|Qt::AlignVCenter, // BestAnswer
Qt::AlignLeft|Qt::AlignVCenter, // TopAnswer
Qt::AlignRight|Qt::AlignVCenter, // TotalParticipants
Qt::AlignRight|Qt::AlignVCenter, // TotalShares
Qt::AlignLeft|Qt::AlignVCenter, // ShareType
Expand All @@ -65,7 +65,7 @@ VotingTableModel::VotingTableModel(void)
<< tr("#")
<< tr("Expiration")
<< tr("Title")
<< tr("Best Answer")
<< tr("Top Answer")
<< tr("# Voters") // Total Participants
<< tr("Total Shares")
<< tr("Share Type")
Expand Down Expand Up @@ -115,8 +115,8 @@ QVariant VotingTableModel::data(const QModelIndex &index, int role) const
return item->totalParticipants_;
case TotalShares:
return item->totalShares_;
case BestAnswer:
return item->bestAnswer_;
case TopAnswer:
return item->topAnswer_;
default:
;
}
Expand All @@ -137,8 +137,8 @@ QVariant VotingTableModel::data(const QModelIndex &index, int role) const
return item->totalParticipants_;
case TotalShares:
return item->totalShares_;
case BestAnswer:
return item->bestAnswer_;
case TopAnswer:
return item->topAnswer_;
default:
;
}
Expand All @@ -162,8 +162,8 @@ QVariant VotingTableModel::data(const QModelIndex &index, int role) const
case TotalSharesRole:
return item->totalShares_;

case BestAnswerRole:
return item->bestAnswer_;
case TopAnswerRole:
return item->topAnswer_;

case Qt::TextAlignmentRole:
return column_alignments[index.column()];
Expand Down Expand Up @@ -202,8 +202,8 @@ QVariant VotingTableModel::headerData(int section, Qt::Orientation orientation,
return tr("Total Participants.");
case TotalShares:
return tr("Total Shares.");
case BestAnswer:
return tr("Best Answer.");
case TopAnswer:
return tr("Top Answer.");
}
}
}
Expand Down Expand Up @@ -269,7 +269,7 @@ VotingItem* BuildPollItem(const PollRegistry::Sequence::Iterator& iter)
}

if (!result->m_votes.empty()) {
item->bestAnswer_ = QString::fromStdString(result->WinnerLabel()).replace("_"," ");
item->topAnswer_ = QString::fromStdString(result->WinnerLabel()).replace("_"," ");
}

return item;
Expand Down Expand Up @@ -424,7 +424,13 @@ VotingDialog::VotingDialog(QWidget *parent)
tableView_->setModel(proxyModel_);
tableView_->setFont(QFont("Arial", 10));
tableView_->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
tableView_->horizontalHeader()->setMinimumWidth(VOTINGDIALOG_WIDTH_RowNumber + VOTINGDIALOG_WIDTH_Title + VOTINGDIALOG_WIDTH_Expiration + VOTINGDIALOG_WIDTH_ShareType + VOTINGDIALOG_WIDTH_TotalParticipants + VOTINGDIALOG_WIDTH_TotalShares + VOTINGDIALOG_WIDTH_BestAnswer);
tableView_->horizontalHeader()->setMinimumWidth(VOTINGDIALOG_WIDTH_RowNumber
+ VOTINGDIALOG_WIDTH_Title
+ VOTINGDIALOG_WIDTH_Expiration
+ VOTINGDIALOG_WIDTH_ShareType
+ VOTINGDIALOG_WIDTH_TotalParticipants
+ VOTINGDIALOG_WIDTH_TotalShares
+ VOTINGDIALOG_WIDTH_TopAnswer);
tableView_->verticalHeader()->setDefaultSectionSize(40);

groupboxvlayout->addWidget(tableView_);
Expand All @@ -443,7 +449,8 @@ VotingDialog::VotingDialog(QWidget *parent)
voteDialog_ = new VotingVoteDialog(this);
pollDialog_ = new NewPollDialog(this);

loadingIndicator->setText(tr("Press reload to load polls... This can take several minutes, and the wallet may not respond until finished."));
loadingIndicator->setText(tr("Press reload to load polls... This can take several minutes, and the wallet may not "
"respond until finished."));
tableView_->hide();
loadingIndicator->show();

Expand All @@ -468,7 +475,8 @@ void VotingDialog::loadPolls(bool history)
bool isRunning = watcher.property("running").toBool();
if (tableModel_&& !isRunning)
{
loadingIndicator->setText(tr("Recalculating voting weights... This can take several minutes, and the wallet may not respond until finished."));
loadingIndicator->setText(tr("Recalculating voting weights... This can take several minutes, and the wallet may not "
"respond until finished."));
tableView_->hide();
loadingIndicator->show();

Expand Down Expand Up @@ -537,11 +545,15 @@ void VotingDialog::tableColResize(void)
tableView_->setColumnWidth(VotingTableModel::TotalParticipants, VOTINGDIALOG_WIDTH_TotalParticipants);
tableView_->setColumnWidth(VotingTableModel::TotalShares, VOTINGDIALOG_WIDTH_TotalShares);

int fixedColWidth = VOTINGDIALOG_WIDTH_RowNumber + VOTINGDIALOG_WIDTH_Expiration + VOTINGDIALOG_WIDTH_ShareType + VOTINGDIALOG_WIDTH_TotalParticipants + VOTINGDIALOG_WIDTH_TotalShares;
int fixedColWidth = VOTINGDIALOG_WIDTH_RowNumber
+ VOTINGDIALOG_WIDTH_Expiration
+ VOTINGDIALOG_WIDTH_ShareType
+ VOTINGDIALOG_WIDTH_TotalParticipants
+ VOTINGDIALOG_WIDTH_TotalShares;

int dynamicWidth = tableView_->horizontalHeader()->width() - fixedColWidth;
int nColumns = 2; // 2 dynamic columns
int columns[] = {VotingTableModel::Title,VotingTableModel::BestAnswer};
int columns[] = {VotingTableModel::Title,VotingTableModel::TopAnswer};
int remainingWidth = dynamicWidth % nColumns;
for(int cNum = 0; cNum < nColumns; cNum++) {
if(remainingWidth > 0)
Expand Down Expand Up @@ -728,10 +740,10 @@ VotingChartDialog::VotingChartDialog(QWidget *parent)
url_->setOpenExternalLinks(true);
glayout->addWidget(url_, 1, 1);

QLabel *bestAnswer = new QLabel(tr("Best Answer: "));
bestAnswer->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
bestAnswer->setTextInteractionFlags(Qt::TextSelectableByMouse);
glayout->addWidget(bestAnswer, 3, 0);
QLabel *topAnswer = new QLabel(tr("Top Answer: "));
topAnswer->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
topAnswer->setTextInteractionFlags(Qt::TextSelectableByMouse);
glayout->addWidget(topAnswer, 3, 0);

answer_ = new QLabel();
answer_->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
Expand Down Expand Up @@ -786,8 +798,8 @@ void VotingChartDialog::resetData(const VotingItem *item)

question_->setText(item->question_);
url_->setText("<a href=\""+item->url_+"\">"+item->url_+"</a>");
answer_->setText(item->bestAnswer_);
answer_->setVisible(!item->bestAnswer_.isEmpty());
answer_->setText(item->topAnswer_);
answer_->setVisible(!item->topAnswer_.isEmpty());
answerModel_->setRowCount(item->vectorOfAnswers_.size());

for (size_t y = 0; y < item->vectorOfAnswers_.size(); y++)
Expand Down Expand Up @@ -876,10 +888,10 @@ VotingVoteDialog::VotingVoteDialog(QWidget *parent)
responseType_->setTextInteractionFlags(Qt::TextSelectableByMouse);
glayout->addWidget(responseType_, 3, 1);

QLabel *bestAnswer = new QLabel(tr("Best Answer: "));
bestAnswer->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
bestAnswer->setTextInteractionFlags(Qt::TextSelectableByMouse);
glayout->addWidget(bestAnswer, 4, 0);
QLabel *topAnswer = new QLabel(tr("Top Answer: "));
topAnswer->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
topAnswer->setTextInteractionFlags(Qt::TextSelectableByMouse);
glayout->addWidget(topAnswer, 4, 0);

answer_ = new QLabel();
answer_->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
Expand Down Expand Up @@ -924,7 +936,7 @@ void VotingVoteDialog::resetData(const VotingItem *item)
question_->setText(item->question_);
url_->setText("<a href=\""+item->url_+"\">"+item->url_+"</a>");
responseType_->setText(item->responseType_);
answer_->setText(item->bestAnswer_);
answer_->setText(item->topAnswer_);
pollTxid_ = item->pollTxid_;

for (const auto& choice : item->vectorOfAnswers_) {
Expand Down
8 changes: 4 additions & 4 deletions src/qt/votingdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class WalletModel;
#define VOTINGDIALOG_WIDTH_ShareType 80
#define VOTINGDIALOG_WIDTH_TotalParticipants 80
#define VOTINGDIALOG_WIDTH_TotalShares 100
#define VOTINGDIALOG_WIDTH_BestAnswer 80
#define VOTINGDIALOG_WIDTH_TopAnswer 80

namespace polling {
// TODO: Legacy struct moved here until we redesign the voting GUI.
Expand Down Expand Up @@ -79,7 +79,7 @@ class VotingItem {
unsigned int totalParticipants_;
unsigned int totalShares_;
QString url_;
QString bestAnswer_;
QString topAnswer_;
};

// VotingTableModel
Expand All @@ -97,7 +97,7 @@ class VotingTableModel
RowNumber = 0,
Expiration = 1,
Title = 2,
BestAnswer = 3,
TopAnswer = 3,
TotalParticipants = 4,
TotalShares = 5,
ShareType = 6,
Expand All @@ -107,7 +107,7 @@ class VotingTableModel
RowNumberRole = Qt::UserRole,
ExpirationRole,
TitleRole,
BestAnswerRole,
TopAnswerRole,
TotalParticipantsRole,
TotalSharesRole,
ShareTypeRole,
Expand Down