if (!event.Iconized())
fClosedToTray = false;
#if defined(__WXGTK__) || defined(__WXMAC_OSX__)
- if (mapArgs.count("-minimizetotray")) {
+ if (GetBoolArg("-minimizetotray")) {
#endif
// The tray icon sometimes disappears on ubuntu karmic
// Hiding the taskbar button doesn't work cleanly on ubuntu lucid
if (fAllFromMe && fAllToMe)
{
// Payment to self
- int64 nValue = wtx.vout[0].nValue;
+ int64 nChange = wtx.GetChange();
InsertLine(fNew, nIndex, hash, strSort, colour,
strStatus,
nTime ? DateTimeStr(nTime) : "",
_("Payment to yourself"),
- "",
- "");
- /// issue: can't tell which is the payment and which is the change anymore
- // FormatMoney(nNet - nValue, true),
- // FormatMoney(nValue, true));
+ FormatMoney(-(nDebit - nChange), true),
+ FormatMoney(nCredit - nChange, true));
}
else if (fAllFromMe)
{
strDescription += " - ";
strDescription += mapValue["message"];
}
+ else if (!mapValue["comment"].empty())
+ {
+ if (!strDescription.empty())
+ strDescription += " - ";
+ strDescription += mapValue["comment"];
+ }
int64 nValue = txout.nValue;
if (nTxFee > 0)
string strName = dialog.GetValue();
// Generate new key
- string strAddress = PubKeyToAddress(CWalletDB().GetKeyFromKeyPool());
+ string strAddress = PubKeyToAddress(GetKeyFromKeyPool());
// Save
SetAddressBookName(strAddress, strName);
if (fAllToMe)
{
// Payment to self
- /// issue: can't tell which is the payment and which is the change anymore
- //int64 nValue = wtx.vout[0].nValue;
- //strHTML += _("<b>Debit:</b> ") + FormatMoney(-nValue) + "<br>";
- //strHTML += _("<b>Credit:</b> ") + FormatMoney(nValue) + "<br>";
+ int64 nChange = wtx.GetChange();
+ int64 nValue = nCredit - nChange;
+ strHTML += _("<b>Debit:</b> ") + FormatMoney(-nValue) + "<br>";
+ strHTML += _("<b>Credit:</b> ") + FormatMoney(nValue) + "<br>";
}
int64 nTxFee = nDebit - wtx.GetValueOut();
//
if (!wtx.mapValue["message"].empty())
strHTML += string() + "<br><b>" + _("Message:") + "</b><br>" + HtmlEscape(wtx.mapValue["message"], true) + "<br>";
+ if (!wtx.mapValue["comment"].empty())
+ strHTML += string() + "<br><b>" + _("Comment:") + "</b><br>" + HtmlEscape(wtx.mapValue["comment"], true) + "<br>";
if (wtx.IsCoinBase())
strHTML += string() + "<br>" + _("Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.") + "<br>";
void CTxDetailsDialog::OnButtonOK(wxCommandEvent& event)
{
- Close();
- //Destroy();
+ EndModal(false);
}
//m_listBox->Append(_("Test 2"));
m_listBox->SetSelection(0);
SelectPage(0);
+#ifndef __WXMSW__
+ SetSize(1.0 * GetSize().GetWidth(), 1.2 * GetSize().GetHeight());
+#endif
#if defined(__WXGTK__) || defined(__WXMAC_OSX__)
m_checkBoxStartOnSystemStartup->SetLabel(_("&Start Bitcoin on window system startup"));
- if (!mapArgs.count("-minimizetotray"))
+ if (!GetBoolArg("-minimizetotray"))
{
// Minimize to tray is just too buggy on Linux
fMinimizeToTray = false;
m_checkBoxStartOnSystemStartup->SetValue(fTmpStartOnSystemStartup = GetStartOnSystemStartup());
m_checkBoxMinimizeToTray->SetValue(fMinimizeToTray);
m_checkBoxMinimizeOnClose->SetValue(fMinimizeOnClose);
+ if (fHaveUPnP)
+ m_checkBoxUseUPnP->SetValue(fUseUPnP);
+ else
+ m_checkBoxUseUPnP->Enable(false);
m_checkBoxUseProxy->SetValue(fUseProxy);
m_textCtrlProxyIP->Enable(fUseProxy);
m_textCtrlProxyPort->Enable(fUseProxy);
void COptionsDialog::OnButtonOK(wxCommandEvent& event)
{
OnButtonApply(event);
- Close();
+ EndModal(false);
}
void COptionsDialog::OnButtonCancel(wxCommandEvent& event)
{
- Close();
+ EndModal(false);
}
void COptionsDialog::OnButtonApply(wxCommandEvent& event)
walletdb.WriteSetting("fMinimizeOnClose", fMinimizeOnClose);
}
+ if (fHaveUPnP && fUseUPnP != m_checkBoxUseUPnP->GetValue())
+ {
+ fUseUPnP = m_checkBoxUseUPnP->GetValue();
+ walletdb.WriteSetting("fUseUPnP", fUseUPnP);
+ MapPort(fUseUPnP);
+ }
+
fUseProxy = m_checkBoxUseProxy->GetValue();
walletdb.WriteSetting("fUseProxy", fUseProxy);
CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent)
{
- m_staticTextVersion->SetLabel(strprintf(_("version %s%s beta"), FormatVersion(VERSION).c_str(), pszSubVer));
+ m_staticTextVersion->SetLabel(strprintf(_("version %s"), FormatFullVersion().c_str()));
// Change (c) into UTF-8 or ANSI copyright symbol
wxString str = m_staticTextMain->GetLabel();
void CAboutDialog::OnButtonOK(wxCommandEvent& event)
{
- Close();
+ EndModal(false);
}
if (fontTmp.GetPointSize() > 9);
fontTmp.SetPointSize(9);
m_staticTextInstructions->SetFont(fontTmp);
- SetSize(725, 380);
+ SetSize(725, 180);
#endif
// Set Icon
iconSend.CopyFromBitmap(wxBitmap(send16noshadow_xpm));
SetIcon(iconSend);
- wxCommandEvent event;
- OnTextAddress(event);
-
// Fixup the tab order
m_buttonPaste->MoveAfterInTabOrder(m_buttonCancel);
m_buttonAddress->MoveAfterInTabOrder(m_buttonPaste);
this->Layout();
}
-void CSendDialog::OnTextAddress(wxCommandEvent& event)
-{
- // Check mark
- event.Skip();
- bool fBitcoinAddress = IsValidBitcoinAddress(m_textCtrlAddress->GetValue());
- m_bitmapCheckMark->Show(fBitcoinAddress);
-
- // Grey out message if bitcoin address
- bool fEnable = !fBitcoinAddress;
- m_staticTextFrom->Enable(fEnable);
- m_textCtrlFrom->Enable(fEnable);
- m_staticTextMessage->Enable(fEnable);
- m_textCtrlMessage->Enable(fEnable);
- m_textCtrlMessage->SetBackgroundColour(wxSystemSettings::GetColour(fEnable ? wxSYS_COLOUR_WINDOW : wxSYS_COLOUR_BTNFACE));
- if (!fEnable && fEnabledPrev)
- {
- strFromSave = m_textCtrlFrom->GetValue();
- strMessageSave = m_textCtrlMessage->GetValue();
- m_textCtrlFrom->SetValue(_("n/a"));
- m_textCtrlMessage->SetValue(_("Can't include a message when sending to a Bitcoin address"));
- }
- else if (fEnable && !fEnabledPrev)
- {
- m_textCtrlFrom->SetValue(strFromSave);
- m_textCtrlMessage->SetValue(strMessageSave);
- }
- fEnabledPrev = fEnable;
-}
-
void CSendDialog::OnKillFocusAmount(wxFocusEvent& event)
{
// Reformat the amount
if (fBitcoinAddress)
{
- // Send to bitcoin address
- CScript scriptPubKey;
- scriptPubKey << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
-
- string strError = SendMoney(scriptPubKey, nValue, wtx, true);
- if (strError == "")
- wxMessageBox(_("Payment sent "), _("Sending..."));
- else if (strError == "ABORTED")
- return; // leave send dialog open
- else
- {
- wxMessageBox(strError + " ", _("Sending..."));
- EndModal(false);
- }
+ CRITICAL_BLOCK(cs_main)
+ {
+ // Send to bitcoin address
+ CScript scriptPubKey;
+ scriptPubKey << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
+
+ string strError = SendMoney(scriptPubKey, nValue, wtx, true);
+ if (strError == "")
+ wxMessageBox(_("Payment sent "), _("Sending..."));
+ else if (strError == "ABORTED")
+ return; // leave send dialog open
+ else
+ {
+ wxMessageBox(strError + " ", _("Sending..."));
+ EndModal(false);
+ }
+ }
}
else
{
// Message
wtx.mapValue["to"] = strAddress;
- wtx.mapValue["from"] = m_textCtrlFrom->GetValue();
- wtx.mapValue["message"] = m_textCtrlMessage->GetValue();
// Send to IP address
CSendingDialog* pdialog = new CSendingDialog(this, addr, nValue, wtx);
if (!CreateTransaction(scriptPubKey, nPrice, wtx, reservekey, nFeeRequired))
{
if (nPrice + nFeeRequired > GetBalance())
- Error(strprintf(_("This is an oversized transaction that requires a transaction fee of %s"), FormatMoney(nFeeRequired).c_str()));
+ Error(strprintf(_("This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds"), FormatMoney(nFeeRequired).c_str()));
else
Error(_("Transaction creation failed"));
return;
strName = dialog.GetValue();
// Generate new key
- strAddress = PubKeyToAddress(CWalletDB().GetKeyFromKeyPool());
+ strAddress = PubKeyToAddress(GetKeyFromKeyPool());
}
// Add to list and select it
void CreateMainWindow()
{
pframeMain = new CMainFrame(NULL);
- if (mapArgs.count("-min"))
+ if (GetBoolArg("-min"))
pframeMain->Iconize(true);
#if defined(__WXGTK__) || defined(__WXMAC_OSX__)
- if (!mapArgs.count("-minimizetotray"))
+ if (!GetBoolArg("-minimizetotray"))
fMinimizeToTray = false;
#endif
pframeMain->Show(true); // have to show first to get taskbar button to hide
}
if (pid > 0)
pthread_exit((void*)0);
+
+ pid_t sid = setsid();
+ if (sid < 0)
+ fprintf(stderr, "Error: setsid() returned %d errno %d\n", sid, errno);
}
return true;