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

Remove unused attachment functionality. #1345

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
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ std::string msMiningErrors5;
std::string msMiningErrors6;
std::string msMiningErrors7;
std::string msMiningErrors8;
std::string msAttachmentGuid;
std::string msMiningErrorsIncluded;
std::string msMiningErrorsExcluded;
std::string msNeuralResponse;
Expand Down
1 change: 0 additions & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ extern std::string msMiningErrors5;
extern std::string msMiningErrors6;
extern std::string msMiningErrors7;
extern std::string msMiningErrors8;
extern std::string msAttachmentGuid;

extern std::string msMiningErrorsIncluded;
extern std::string msMiningErrorsExcluded;
Expand Down
65 changes: 29 additions & 36 deletions src/qt/forms/sendcoinsentry.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@
<property name="spacing">
<number>12</number>
</property>
<item row="6" column="1">
<widget class="BitcoinAmountField" name="payAmount"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&amp;Label:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>addAsLabel</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
Expand Down Expand Up @@ -149,22 +133,21 @@
</property>
</widget>
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="spacing">
<number>0</number>
<item row="6" column="1">
<widget class="BitcoinAmountField" name="payAmount"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&amp;Label:</string>
</property>
<item>
<widget class="QValidatedLineEdit" name="txtMessage">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Send Custom Message to a Gridcoin Recipient</string>
</property>
</widget>
</item>
</layout>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>addAsLabel</cstring>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label">
Expand All @@ -179,12 +162,22 @@
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="btnAddAttachment">
<property name="text">
<string>Add Attachment</string>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="spacing">
<number>0</number>
</property>
</widget>
<item>
<widget class="QValidatedLineEdit" name="txtMessage">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Send Custom Message to a Gridcoin Recipient</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
Expand Down
7 changes: 0 additions & 7 deletions src/qt/forms/transactiondescdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnViewAttachment">
<property name="text">
<string>View Attachment</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnExecute">
<property name="enabled">
Expand Down
13 changes: 0 additions & 13 deletions src/qt/sendcoinsentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,6 @@ void SendCoinsEntry::on_addressBookButton_clicked()
}
}


void SendCoinsEntry::on_btnAddAttachment_clicked()
{
if(!model)
return;
// 9-19-2015; Show Add document attachment dialog
// msAttachmentGuid = "";

#if defined(WIN32) && defined(QT_GUI)
std::string sData = qtExecuteDotNetStringFunction("ShowForm","frmAddAttachment");
#endif
}

void SendCoinsEntry::on_payTo_textChanged(const QString &address)
{
if(!model)
Expand Down
1 change: 0 additions & 1 deletion src/qt/sendcoinsentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ private slots:
void on_deleteButton_clicked();
void on_payTo_textChanged(const QString &address);
void on_addressBookButton_clicked();
void on_btnAddAttachment_clicked();
void on_pasteButton_clicked();
void updateDisplayUnit();
void updateIcons();
Expand Down
21 changes: 0 additions & 21 deletions src/qt/transactiondescdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,9 @@ TransactionDescDialog::TransactionDescDialog(const QModelIndex &idx, QWidget *pa
ui->detailText->setHtml(desc);
//If smart contract is populated
ui->btnExecute->setVisible(Contains(msHashBoinc,"<CODE>"));
ui->btnViewAttachment->setVisible(Contains(msHashBoinc,"<ATTACHMENT>"));
}

TransactionDescDialog::~TransactionDescDialog()
{
delete ui;
}

void TransactionDescDialog::on_btnViewAttachment_clicked()
{
//9-19-2015
std::string sTXID = ExtractXML(msHashBoinc,"<ATTACHMENTGUID>","</ATTACHMENTGUID>");
LogPrintf("View attachment %s",sTXID);

if (sTXID.empty())
{
QString qsCaption = tr("Gridcoin Documents");
QString qsBody = tr("Document cannot be found on P2P server.");
QMessageBox::critical(this, qsCaption, qsBody, QMessageBox::Ok, QMessageBox::Ok);
}
else
{
#if defined(WIN32) && defined(QT_GUI)
std::string sData = qtExecuteDotNetStringFunction("ShowForm","frmAddAttachment," + sTXID);
#endif
}
}
3 changes: 0 additions & 3 deletions src/qt/transactiondescdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class TransactionDescDialog : public QDialog

private:
Ui::TransactionDescDialog *ui;

private slots:
void on_btnViewAttachment_clicked();
};

#endif // TRANSACTIONDESCDIALOG_H
5 changes: 0 additions & 5 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,6 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QList<SendCoinsRecipie
CWalletTx wtx;
CReserveKey keyChange(wallet);
int64_t nFeeRequired = 0;
if (!msAttachmentGuid.empty())
{
LogPrintf("Adding attachment to tx %s",wtx.hashBoinc);
wtx.hashBoinc += "<ATTACHMENT><TXID>" + wtx.GetHash().ToString() + "</TXID><ATTACHMENTGUID>" + msAttachmentGuid + "</ATTACHMENTGUID></ATTACHMENT>";
}
wtx.hashBoinc += messages;
bool fCreated = wallet->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired, coinControl);

Expand Down