diff options
Diffstat (limited to 'src/ui.cpp')
-rw-r--r-- | src/ui.cpp | 56 |
1 files changed, 13 insertions, 43 deletions
diff --git a/src/ui.cpp b/src/ui.cpp index 2277da6a3a..f2bdd49d55 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -1094,12 +1094,6 @@ void CMainFrame::OnMenuFileExit(wxCommandEvent& event) Close(true); } -void CMainFrame::OnMenuOptionsGenerate(wxCommandEvent& event) -{ - // Options->Generate Coins - GenerateBitcoins(event.IsChecked()); -} - void CMainFrame::OnUpdateUIOptionsGenerate(wxUpdateUIEvent& event) { event.Check(fGenerateBitcoins); @@ -1655,13 +1649,6 @@ COptionsDialog::COptionsDialog(wxWindow* parent) : COptionsDialogBase(parent) // Init values m_textCtrlTransactionFee->SetValue(FormatMoney(nTransactionFee)); - m_checkBoxLimitProcessors->SetValue(fLimitProcessors); - m_spinCtrlLimitProcessors->Enable(fLimitProcessors); - m_spinCtrlLimitProcessors->SetValue(nLimitProcessors); - int nProcessors = wxThread::GetCPUCount(); - if (nProcessors < 1) - nProcessors = 999; - m_spinCtrlLimitProcessors->SetRange(1, nProcessors); m_checkBoxStartOnSystemStartup->SetValue(fTmpStartOnSystemStartup = GetStartOnSystemStartup()); m_checkBoxMinimizeToTray->SetValue(fMinimizeToTray); m_checkBoxMinimizeOnClose->SetValue(fMinimizeOnClose); @@ -1702,11 +1689,6 @@ void COptionsDialog::OnKillFocusTransactionFee(wxFocusEvent& event) m_textCtrlTransactionFee->SetValue(FormatMoney(nTmp)); } -void COptionsDialog::OnCheckBoxLimitProcessors(wxCommandEvent& event) -{ - m_spinCtrlLimitProcessors->Enable(event.IsChecked()); -} - void COptionsDialog::OnCheckBoxUseProxy(wxCommandEvent& event) { m_textCtrlProxyIP->Enable(event.IsChecked()); @@ -1755,20 +1737,6 @@ void COptionsDialog::OnButtonApply(wxCommandEvent& event) if (ParseMoney(m_textCtrlTransactionFee->GetValue(), nTransactionFee) && nTransactionFee != nPrevTransactionFee) walletdb.WriteSetting("nTransactionFee", nTransactionFee); - int nPrevMaxProc = (fLimitProcessors ? nLimitProcessors : INT_MAX); - if (fLimitProcessors != m_checkBoxLimitProcessors->GetValue()) - { - fLimitProcessors = m_checkBoxLimitProcessors->GetValue(); - walletdb.WriteSetting("fLimitProcessors", fLimitProcessors); - } - if (nLimitProcessors != m_spinCtrlLimitProcessors->GetValue()) - { - nLimitProcessors = m_spinCtrlLimitProcessors->GetValue(); - walletdb.WriteSetting("nLimitProcessors", nLimitProcessors); - } - if (fGenerateBitcoins && (fLimitProcessors ? nLimitProcessors : INT_MAX) > nPrevMaxProc) - GenerateBitcoins(fGenerateBitcoins); - if (fTmpStartOnSystemStartup != m_checkBoxStartOnSystemStartup->GetValue()) { fTmpStartOnSystemStartup = m_checkBoxStartOnSystemStartup->GetValue(); @@ -1859,6 +1827,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 +1836,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)); @@ -1960,6 +1929,7 @@ void CSendDialog::OnButtonSend(wxCommandEvent& event) { wxMessageBox(strError + " ", _("Sending...")); EndModal(false); + return; } } } @@ -2605,6 +2575,7 @@ void CAddressBookDialog::OnClose(wxCloseEvent& event) enum { ID_TASKBAR_RESTORE = 10001, + ID_TASKBAR_SEND, ID_TASKBAR_OPTIONS, ID_TASKBAR_GENERATE, ID_TASKBAR_EXIT, @@ -2613,8 +2584,8 @@ 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) EVT_MENU(ID_TASKBAR_EXIT, CMyTaskBarIcon::OnMenuExit) END_EVENT_TABLE() @@ -2665,6 +2636,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 @@ -2681,11 +2659,6 @@ void CMyTaskBarIcon::Restore() pframeMain->Raise(); } -void CMyTaskBarIcon::OnMenuGenerate(wxCommandEvent& event) -{ - GenerateBitcoins(event.IsChecked()); -} - void CMyTaskBarIcon::OnUpdateUIGenerate(wxUpdateUIEvent& event) { event.Check(fGenerateBitcoins); @@ -2706,8 +2679,8 @@ 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 pmenu->AppendSeparator(); pmenu->Append(ID_TASKBAR_EXIT, _("E&xit")); @@ -2839,9 +2812,6 @@ bool CMyApp::OnInit() extern int g_isPainting; g_isPainting = 10000; #endif -#ifdef GUI - wxImage::AddHandler(new wxPNGHandler); -#endif #if defined(__WXMSW__ ) || defined(__WXMAC_OSX__) SetAppName("Bitcoin"); #else |