From 3b7925eb7d0653ab304786e8e2344af91a6826fb Mon Sep 17 00:00:00 2001 From: John Maguire Date: Sun, 1 May 2011 00:27:15 -0400 Subject: [PATCH 1/3] added "Send Bitcoins" option in the tray menu --- ui.cpp | 10 ++++++++++ ui.h | 1 + 2 files changed, 11 insertions(+) diff --git a/ui.cpp b/ui.cpp index a95f31bd..49a0f9ec 100644 --- a/ui.cpp +++ b/ui.cpp @@ -2605,6 +2605,7 @@ void CAddressBookDialog::OnClose(wxCloseEvent& event) enum { ID_TASKBAR_RESTORE = 10001, + ID_TASKBAR_SEND, ID_TASKBAR_OPTIONS, ID_TASKBAR_GENERATE, ID_TASKBAR_EXIT, @@ -2613,6 +2614,7 @@ enum BEGIN_EVENT_TABLE(CMyTaskBarIcon, wxTaskBarIcon) EVT_TASKBAR_LEFT_DCLICK(CMyTaskBarIcon::OnLeftButtonDClick) EVT_MENU(ID_TASKBAR_RESTORE, CMyTaskBarIcon::OnMenuRestore) + EVT_MENU(ID_TASKBAR_SEND, CMyTaskBarIcon::OnMenuSend) EVT_MENU(ID_TASKBAR_OPTIONS, CMyTaskBarIcon::OnMenuOptions) EVT_MENU(ID_TASKBAR_GENERATE, CMyTaskBarIcon::OnMenuGenerate) EVT_UPDATE_UI(ID_TASKBAR_GENERATE, CMyTaskBarIcon::OnUpdateUIGenerate) @@ -2665,6 +2667,13 @@ void CMyTaskBarIcon::OnMenuRestore(wxCommandEvent& event) Restore(); } +void CMyTaskBarIcon::OnMenuSend(wxCommandEvent& event) +{ + // Taskbar: Send + CSendDialog dialog(pframeMain); + dialog.ShowModal(); +} + void CMyTaskBarIcon::OnMenuOptions(wxCommandEvent& event) { // Since it's modal, get the main window to do it @@ -2706,6 +2715,7 @@ wxMenu* CMyTaskBarIcon::CreatePopupMenu() { wxMenu* pmenu = new wxMenu; pmenu->Append(ID_TASKBAR_RESTORE, _("&Open Bitcoin")); + pmenu->Append(ID_TASKBAR_SEND, _("&Send Bitcoins")); pmenu->Append(ID_TASKBAR_OPTIONS, _("O&ptions...")); pmenu->AppendCheckItem(ID_TASKBAR_GENERATE, _("&Generate Coins"))->Check(fGenerateBitcoins); #ifndef __WXMAC_OSX__ // Mac has built-in quit menu diff --git a/ui.h b/ui.h index af97d5ab..05c4ee9a 100644 --- a/ui.h +++ b/ui.h @@ -323,6 +323,7 @@ protected: // Event handlers void OnLeftButtonDClick(wxTaskBarIconEvent& event); void OnMenuRestore(wxCommandEvent& event); + void OnMenuSend(wxCommandEvent& event); void OnMenuOptions(wxCommandEvent& event); void OnUpdateUIGenerate(wxUpdateUIEvent& event); void OnMenuGenerate(wxCommandEvent& event); From bd3bd83dda1f2c964b34b6f4e615b2a85dad2484 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Sun, 1 May 2011 00:53:45 -0400 Subject: [PATCH 2/3] added balance to tooltips --- ui.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui.cpp b/ui.cpp index 49a0f9ec..ac2f2cf9 100644 --- a/ui.cpp +++ b/ui.cpp @@ -1859,6 +1859,7 @@ CSendDialog::CSendDialog(wxWindow* parent, const wxString& strAddress) : CSendDi m_bitmapCheckMark->Show(false); fEnabledPrev = true; m_textCtrlAddress->SetFocus(); + //// todo: should add a display of your balance for convenience #ifndef __WXMSW__ wxFont fontTmp = m_staticTextInstructions->GetFont(); @@ -1867,7 +1868,7 @@ CSendDialog::CSendDialog(wxWindow* parent, const wxString& strAddress) : CSendDi m_staticTextInstructions->SetFont(fontTmp); SetSize(725, 180); #endif - + // Set Icon wxIcon iconSend; iconSend.CopyFromBitmap(wxBitmap(send16noshadow_xpm)); @@ -2626,9 +2627,9 @@ void CMyTaskBarIcon::Show(bool fShow) static char pszPrevTip[200]; if (fShow) { - string strTooltip = _("Bitcoin"); + string strTooltip = _("Balance: ") + FormatMoney(GetBalance()); if (fGenerateBitcoins) - strTooltip = _("Bitcoin - Generating"); + strTooltip = _("Bitcoin - Generating (Balance: ") + FormatMoney(GetBalance()) + ")"; if (fGenerateBitcoins && vNodes.empty()) strTooltip = _("Bitcoin - (not connected)"); From d67cfd146a333f1268ddd464381e99a7753ec85f Mon Sep 17 00:00:00 2001 From: John Maguire Date: Sun, 1 May 2011 09:20:29 -0400 Subject: [PATCH 3/3] fixed some translations which was... weird --- ui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui.cpp b/ui.cpp index ac2f2cf9..3a21f42f 100644 --- a/ui.cpp +++ b/ui.cpp @@ -2627,9 +2627,9 @@ void CMyTaskBarIcon::Show(bool fShow) static char pszPrevTip[200]; if (fShow) { - string strTooltip = _("Balance: ") + FormatMoney(GetBalance()); + string strTooltip = strprintf(_("Balance: %s"), FormatMoney(GetBalance()).c_str()); if (fGenerateBitcoins) - strTooltip = _("Bitcoin - Generating (Balance: ") + FormatMoney(GetBalance()) + ")"; + strTooltip = strprintf(_("Bitcoin - Generating (Balance: %s)"), FormatMoney(GetBalance()).c_str()); if (fGenerateBitcoins && vNodes.empty()) strTooltip = _("Bitcoin - (not connected)");