Browse Source

Remove wxWidgets

Makefiles now build bitcoind only.
qmake/make in top-level directory is used to build Bitcoin QT
Deleted almost all #ifdef GUI from the code (left one possibly controversial one)
Deleted xpm/ files.
pull/1/head
Gavin Andresen 11 years ago
parent
commit
565c4771b6
  1. 6388
      share/uiproject.fbp
  2. 10
      src/bitcoinrpc.cpp
  3. 2
      src/db.cpp
  4. 28
      src/headers.h
  5. 68
      src/init.cpp
  6. 30
      src/makefile.linux-mingw
  7. 33
      src/makefile.mingw
  8. 22
      src/makefile.osx
  9. 22
      src/makefile.unix
  10. 18
      src/makefile.vc
  11. 3221
      src/ui.cpp
  12. 355
      src/ui.h
  13. 1018
      src/uibase.cpp
  14. 425
      src/uibase.h
  15. 42
      src/util.cpp
  16. 2
      src/util.h
  17. 665
      src/xpm/about.xpm
  18. 278
      src/xpm/addressbook16.xpm
  19. 282
      src/xpm/addressbook20.xpm
  20. 219
      src/xpm/bitcoin16.xpm
  21. 160
      src/xpm/bitcoin20.xpm
  22. 232
      src/xpm/bitcoin32.xpm
  23. 277
      src/xpm/bitcoin48.xpm
  24. 292
      src/xpm/bitcoin80.xpm
  25. 41
      src/xpm/check.xpm
  26. 278
      src/xpm/send16.xpm
  27. 278
      src/xpm/send16noshadow.xpm
  28. 282
      src/xpm/send20.xpm

6388
share/uiproject.fbp

File diff suppressed because it is too large Load Diff

10
src/bitcoinrpc.cpp

@ -64,11 +64,7 @@ void PrintConsole(const std::string &format, ...) @@ -64,11 +64,7 @@ void PrintConsole(const std::string &format, ...)
buffer[limit-1] = 0;
}
printf("%s", buffer);
#if defined(__WXMSW__) && defined(GUI)
MyMessageBox(buffer, "Bitcoin", wxOK | wxICON_EXCLAMATION);
#else
fprintf(stdout, "%s", buffer);
#endif
}
@ -2357,13 +2353,7 @@ int CommandLineRPC(int argc, char *argv[]) @@ -2357,13 +2353,7 @@ int CommandLineRPC(int argc, char *argv[])
if (strPrint != "")
{
#if defined(__WXMSW__) && defined(GUI)
// Windows GUI apps can't print to command line,
// so settle for a message box yuck
MyMessageBox(strPrint, "Bitcoin", wxOK);
#else
fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str());
#endif
}
return nRet;
}

2
src/db.cpp

@ -822,7 +822,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet) @@ -822,7 +822,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
ssKey >> strKey;
// Options
#ifndef GUI
#ifndef QT_GUI
if (strKey == "fGenerateBitcoins") ssValue >> fGenerateBitcoins;
#endif
if (strKey == "nTransactionFee") ssValue >> nTransactionFee;

28
src/headers.h

@ -27,14 +27,6 @@ @@ -27,14 +27,6 @@
#define BSD 1
#endif
#endif
#ifdef GUI
#include <wx/wx.h>
#include <wx/stdpaths.h>
#include <wx/snglinst.h>
#include <wx/utils.h>
#include <wx/clipbrd.h>
#include <wx/taskbar.h>
#endif
#include <openssl/buffer.h>
#include <openssl/ecdsa.h>
#include <openssl/evp.h>
@ -95,28 +87,8 @@ @@ -95,28 +87,8 @@
#include "bignum.h"
#include "base58.h"
#include "main.h"
#ifdef GUI
#include "uibase.h"
#include "ui.h"
#else
#ifdef QT_GUI
#include "qtui.h"
#else
#include "noui.h"
#endif
#endif
#ifdef GUI
#include "xpm/addressbook16.xpm"
#include "xpm/addressbook20.xpm"
#include "xpm/bitcoin16.xpm"
#include "xpm/bitcoin20.xpm"
#include "xpm/bitcoin32.xpm"
#include "xpm/bitcoin48.xpm"
#include "xpm/bitcoin80.xpm"
#include "xpm/check.xpm"
#include "xpm/send16.xpm"
#include "xpm/send16noshadow.xpm"
#include "xpm/send20.xpm"
#include "xpm/about.xpm"
#endif

68
src/init.cpp

@ -80,7 +80,7 @@ void HandleSIGTERM(int) @@ -80,7 +80,7 @@ void HandleSIGTERM(int)
//
// Start
//
#if !defined(QT_GUI) && !defined(GUI)
#if !defined(QT_GUI)
int main(int argc, char* argv[])
{
bool fRet = false;
@ -216,14 +216,9 @@ bool AppInit2(int argc, char* argv[]) @@ -216,14 +216,9 @@ bool AppInit2(int argc, char* argv[])
strUsage += string() +
" -? \t\t " + _("This help message\n");
#if defined(__WXMSW__) && defined(GUI)
// Tabs make the columns line up in the message box
wxMessageBox(strUsage, "Bitcoin", wxOK);
#else
// Remove tabs
strUsage.erase(std::remove(strUsage.begin(), strUsage.end(), '\t'), strUsage.end());
fprintf(stderr, "%s", strUsage.c_str());
#endif
return false;
}
@ -242,7 +237,7 @@ bool AppInit2(int argc, char* argv[]) @@ -242,7 +237,7 @@ bool AppInit2(int argc, char* argv[])
fServer = GetBoolArg("-server");
/* force fServer when running without GUI */
#if !defined(QT_GUI) && !defined(GUI)
#if !defined(QT_GUI)
fServer = true;
#endif
fPrintToConsole = GetBoolArg("-printtoconsole");
@ -291,11 +286,6 @@ bool AppInit2(int argc, char* argv[]) @@ -291,11 +286,6 @@ bool AppInit2(int argc, char* argv[])
ShrinkDebugFile();
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("Bitcoin version %s\n", FormatFullVersion().c_str());
#ifdef GUI
printf("OS version %s\n", ((string)wxGetOsDescription()).c_str());
printf("System default language is %d %s\n", g_locale.GetSystemLanguage(), ((string)g_locale.GetSysName()).c_str());
printf("Language file %s (%s)\n", (string("locale/") + (string)g_locale.GetCanonicalName() + "/LC_MESSAGES/bitcoin.mo").c_str(), ((string)g_locale.GetLocale()).c_str());
#endif
printf("Default data directory %s\n", GetDefaultDataDir().c_str());
if (GetBoolArg("-loadblockindextest"))
@ -306,46 +296,6 @@ bool AppInit2(int argc, char* argv[]) @@ -306,46 +296,6 @@ bool AppInit2(int argc, char* argv[])
return false;
}
//
// Limit to single instance per user
// Required to protect the database files if we're going to keep deleting log.*
//
#if defined(__WXMSW__) && defined(GUI)
// wxSingleInstanceChecker doesn't work on Linux
wxString strMutexName = wxString("bitcoin_running.") + getenv("HOMEPATH");
for (int i = 0; i < strMutexName.size(); i++)
if (!isalnum(strMutexName[i]))
strMutexName[i] = '.';
wxSingleInstanceChecker* psingleinstancechecker = new wxSingleInstanceChecker(strMutexName);
if (psingleinstancechecker->IsAnotherRunning())
{
printf("Existing instance found\n");
unsigned int nStart = GetTime();
loop
{
// Show the previous instance and exit
HWND hwndPrev = FindWindowA("wxWindowClassNR", "Bitcoin");
if (hwndPrev)
{
if (IsIconic(hwndPrev))
ShowWindow(hwndPrev, SW_RESTORE);
SetForegroundWindow(hwndPrev);
return false;
}
if (GetTime() > nStart + 60)
return false;
// Resume this instance if the other exits
delete psingleinstancechecker;
Sleep(1000);
psingleinstancechecker = new wxSingleInstanceChecker(strMutexName);
if (!psingleinstancechecker->IsAnotherRunning())
break;
}
}
#endif
// Make sure only a single bitcoin process is using the data directory.
string strLockFile = GetDataDir() + "/.lock";
FILE* file = fopen(strLockFile.c_str(), "a"); // empty lock file; created if it doesn't exist.
@ -538,13 +488,8 @@ bool AppInit2(int argc, char* argv[]) @@ -538,13 +488,8 @@ bool AppInit2(int argc, char* argv[])
}
//
// Create the main window and start the node
// Start the node
//
#ifdef GUI
if (!fDaemon)
CreateMainWindow();
#endif
if (!CheckDiskSpace())
return false;
@ -556,12 +501,7 @@ bool AppInit2(int argc, char* argv[]) @@ -556,12 +501,7 @@ bool AppInit2(int argc, char* argv[])
if (fServer)
CreateThread(ThreadRPCServer, NULL);
#if defined(__WXMSW__) && defined(GUI)
if (fFirstRun)
SetStartOnSystemStartup(true);
#endif
#if !defined(QT_GUI) && !defined(GUI)
#if !defined(QT_GUI)
while (1)
Sleep(5000);
#endif

30
src/makefile.linux-mingw

@ -10,18 +10,12 @@ INCLUDEPATHS= \ @@ -10,18 +10,12 @@ INCLUDEPATHS= \
-I"$(DEPSDIR)/boost_1_47_0" \
-I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
-I"$(DEPSDIR)/openssl-1.0.0d/include" \
-I"$(DEPSDIR)/wxWidgets-2.9.2/lib/gcc_lib/mswud" \
-I"$(DEPSDIR)/wxWidgets-2.9.2/include" \
-I"$(DEPSDIR)/wxWidgets-2.9.2/lib/wx/include/i586-mingw32msvc-msw-unicode-static-2.9/" \
-I"$(DEPSDIR)"
LIBPATHS= \
-L"$(DEPSDIR)/boost_1_47_0/stage/lib" \
-L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
-L"$(DEPSDIR)/openssl-1.0.0d" \
-L"$(DEPSDIR)/wxWidgets-2.9.2/lib"
WXLIBS= -l wx_mswu-2.9-i586-mingw32msvc
-L"$(DEPSDIR)/openssl-1.0.0d"
LIBS= \
-l boost_system-mt-s \
@ -32,8 +26,8 @@ LIBS= \ @@ -32,8 +26,8 @@ LIBS= \
-l ssl \
-l crypto
DEFS=-D_MT -DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB
DEBUGFLAGS=-g -D__WXDEBUG__
DEFS=-D_MT -DWIN32 -D_WINDOWS -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB
DEBUGFLAGS=-g
CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
HEADERS = \
base58.h \
@ -53,8 +47,6 @@ HEADERS = \ @@ -53,8 +47,6 @@ HEADERS = \
script.h \
serialize.h \
strlcpy.h \
ui.h \
uibase.h \
uint256.h \
util.h \
wallet.h
@ -84,20 +76,7 @@ OBJS= \ @@ -84,20 +76,7 @@ OBJS= \
cryptopp/obj/cpu.o
all: bitcoin.exe
obj/%.o: %.cpp $(HEADERS)
i586-mingw32msvc-g++ -c $(CFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
i586-mingw32msvc-g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_ASM -o $@ $<
obj/ui_res.o: ../share/ui.rc ../share/pixmaps/bitcoin.ico ../share/pixmaps/check.ico ../share/pixmaps/send16.bmp ../share/pixmaps/send16mask.bmp ../share/pixmaps/send16masknoshadow.bmp ../share/pixmaps/send20.bmp ../share/pixmaps/send20mask.bmp ../share/pixmaps/addressbook16.bmp ../share/pixmaps/addressbook16mask.bmp ../share/pixmaps/addressbook20.bmp ../share/pixmaps/addressbook20mask.bmp
i586-mingw32msvc-windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<
bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/ui_res.o
i586-mingw32msvc-g++ $(CFLAGS) -mwindows -Wl,--subsystem,windows -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
all: bitcoind.exe
obj/nogui/%.o: %.cpp $(HEADERS)
@ -121,6 +100,5 @@ clean: @@ -121,6 +100,5 @@ clean:
-rm -f cryptopp/obj/*.o
-rm -f test/*.o
-rm -f headers.h.gch
-rm -f bitcoin.exe
-rm -f bitcoind.exe
-rm -f test_bitcoin.exe

33
src/makefile.mingw

@ -7,18 +7,12 @@ USE_UPNP:=0 @@ -7,18 +7,12 @@ USE_UPNP:=0
INCLUDEPATHS= \
-I"C:\boost-1.47.0-mgw" \
-I"C:\db-4.8.30.NC-mgw\build_unix" \
-I"C:\openssl-1.0.0d-mgw\include" \
-I"C:\wxWidgets-2.9.2-mgw\lib\gcc_lib\mswud" \
-I"C:\wxWidgets-2.9.2-mgw\include"
-I"C:\openssl-1.0.0d-mgw\include"
LIBPATHS= \
-L"C:\boost-1.47.0-mgw\stage\lib" \
-L"C:\db-4.8.30.NC-mgw\build_unix" \
-L"C:\openssl-1.0.0d-mgw" \
-L"C:\wxWidgets-2.9.2-mgw\lib\gcc_lib"
WXLIBS= \
-l wxmsw29ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd
-L"C:\openssl-1.0.0d-mgw"
LIBS= \
-l boost_system-mgw45-mt-s-1_47 \
@ -29,8 +23,8 @@ LIBS= \ @@ -29,8 +23,8 @@ LIBS= \
-l ssl \
-l crypto
DEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB
DEBUGFLAGS=-g -D__WXDEBUG__
DEFS=-DWIN32 -D_WINDOWS -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB
DEBUGFLAGS=-g
CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
HEADERS = \
base58.h \
@ -50,8 +44,6 @@ HEADERS = \ @@ -50,8 +44,6 @@ HEADERS = \
script.h \
serialize.h \
strlcpy.h \
ui.h \
uibase.h \
uint256.h \
util.h \
wallet.h
@ -82,20 +74,7 @@ OBJS= \ @@ -82,20 +74,7 @@ OBJS= \
cryptopp/obj/cpu.o
all: bitcoin.exe
obj/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
g++ -c $(CFLAGS) -O3 -DCRYPTOPP_X86_ASM_AVAILABLE -o $@ $<
obj/ui_res.o: ../share/ui.rc ../share/pixmaps/bitcoin.ico ../share/pixmaps/check.ico ../share/pixmaps/send16.bmp ../share/pixmaps/send16mask.bmp ../share/pixmaps/send16masknoshadow.bmp ../share/pixmaps/send20.bmp ../share/pixmaps/send20mask.bmp ../share/pixmaps/addressbook16.bmp ../share/pixmaps/addressbook16mask.bmp ../share/pixmaps/addressbook20.bmp ../share/pixmaps/addressbook20mask.bmp
windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<
bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/ui_res.o
g++ $(CFLAGS) -mwindows -Wl,--subsystem,windows -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
all: bitcoind.exe
obj/nogui/%.o: %.cpp $(HEADERS)
@ -111,7 +90,7 @@ test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:o @@ -111,7 +90,7 @@ test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
clean:
-del /Q bitcoin bitcoind test_bitcoin
-del /Q bitcoind test_bitcoin
-del /Q obj\*
-del /Q obj\nogui\*
-del /Q obj\test\*

22
src/makefile.osx vendored

@ -14,8 +14,6 @@ INCLUDEPATHS= \ @@ -14,8 +14,6 @@ INCLUDEPATHS= \
LIBPATHS= \
-L"$(DEPSDIR)/lib"
WXLIBS=$(shell $(DEPSDIR)/bin/wx-config --libs --static)
USE_UPNP:=0
LIBS= -dead_strip \
@ -27,9 +25,9 @@ LIBS= -dead_strip \ @@ -27,9 +25,9 @@ LIBS= -dead_strip \
$(DEPSDIR)/lib/libssl.a \
$(DEPSDIR)/lib/libcrypto.a
DEFS=$(shell $(DEPSDIR)/bin/wx-config --cxxflags) -D__WXMAC_OSX__ -DNOPCH -DMSG_NOSIGNAL=0 -DUSE_SSL
DEFS=-D__WXMAC_OSX__ -DNOPCH -DMSG_NOSIGNAL=0 -DUSE_SSL
DEBUGFLAGS=-g -DwxDEBUG_LEVEL=0
DEBUGFLAGS=-g
# ppc doesn't work because we don't support big-endian
CFLAGS=-mmacosx-version-min=10.5 -arch i386 -arch x86_64 -O3 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
HEADERS = \
@ -50,8 +48,6 @@ HEADERS = \ @@ -50,8 +48,6 @@ HEADERS = \
script.h \
serialize.h \
strlcpy.h \
ui.h \
uibase.h \
uint256.h \
util.h \
wallet.h
@ -78,17 +74,7 @@ ifdef USE_UPNP @@ -78,17 +74,7 @@ ifdef USE_UPNP
endif
all: bitcoin
obj/%.o: %.cpp $(HEADERS)
$(CXX) -c $(CFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
$(CXX) -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_ASM -o $@ $<
bitcoin: $(OBJS) obj/ui.o obj/uibase.o
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
all: bitcoind
obj/nogui/%.o: %.cpp $(HEADERS)
@ -104,7 +90,7 @@ test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/% @@ -104,7 +90,7 @@ test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework
clean:
-rm -f bitcoin bitcoind test_bitcoin
-rm -f bitcoind test_bitcoin
-rm -f obj/*.o
-rm -f obj/nogui/*.o
-rm -f obj/test/*.o

22
src/makefile.unix

@ -4,10 +4,6 @@ @@ -4,10 +4,6 @@
CXX=g++
WXINCLUDEPATHS=$(shell wx-config --cxxflags)
WXLIBS=$(shell wx-config --libs)
USE_UPNP:=0
DEFS=-DNOPCH -DUSE_SSL
@ -64,7 +60,7 @@ LIBS+= \ @@ -64,7 +60,7 @@ LIBS+= \
#
DEBUGFLAGS=-g -D__WXDEBUG__
DEBUGFLAGS=-g
CXXFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(HARDENING)
HEADERS = \
base58.h \
@ -84,8 +80,6 @@ HEADERS = \ @@ -84,8 +80,6 @@ HEADERS = \
script.h \
serialize.h \
strlcpy.h \
ui.h \
uibase.h \
uint256.h \
util.h \
wallet.h
@ -107,17 +101,7 @@ OBJS= \ @@ -107,17 +101,7 @@ OBJS= \
cryptopp/obj/cpu.o
all: bitcoin
obj/%.o: %.cpp $(HEADERS)
$(CXX) -c $(CXXFLAGS) $(WXINCLUDEPATHS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
$(CXX) -c $(CXXFLAGS) -O3 -o $@ $<
bitcoin: $(OBJS) obj/ui.o obj/uibase.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
all: bitcoind
obj/nogui/%.o: %.cpp $(HEADERS)
@ -133,7 +117,7 @@ test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/% @@ -133,7 +117,7 @@ test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%
$(CXX) $(CXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-Bstatic -lboost_unit_test_framework $(LIBS)
clean:
-rm -f bitcoin bitcoind test_bitcoin
-rm -f bitcoind test_bitcoin
-rm -f obj/*.o
-rm -f obj/nogui/*.o
-rm -f obj/test/*.o

18
src/makefile.vc

@ -7,25 +7,20 @@ INCLUDEPATHS= \ @@ -7,25 +7,20 @@ INCLUDEPATHS= \
/I"/boost" \
/I"/db/build_windows" \
/I"/openssl/include" \
/I"/wxwidgets/lib/vc_lib/mswu" \
/I"/wxwidgets/include" /
/I"/miniupnpc"
LIBPATHS= \
/LIBPATH:"/boost/stage/lib" \
/LIBPATH:"/db/build_windows/Release" \
/LIBPATH:"/openssl/lib" \
/LIBPATH:"/wxwidgets/lib/vc_lib" \
/LIBPATH:"/miniupnpc/msvc/Release" \
/NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib \
/NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib \
/NODEFAULTLIB:msvcrtd.lib
WXLIBS=wxmsw29u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib
USE_UPNP=0
DEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH /DNOMINMAX
DEFS=/DWIN32 /D_WINDOWS /DNOPCH /DNOMINMAX
LIBS= \
libboost_system-vc100-mt.lib \
@ -92,7 +87,7 @@ CRYPTOPP_OBJS= \ @@ -92,7 +87,7 @@ CRYPTOPP_OBJS= \
RC=../share
all: bitcoin.exe
all: bitcoind.exe
.cpp{obj}.obj:
@ -130,13 +125,6 @@ cryptopp\obj\sha.obj: cryptopp\sha.cpp @@ -130,13 +125,6 @@ cryptopp\obj\sha.obj: cryptopp\sha.cpp
cryptopp\obj\cpu.obj: cryptopp\cpu.cpp
cl $(CFLAGS) /O2 /DCRYPTOPP_DISABLE_ASM /Fo$@ %s
obj\ui.res: $(RC)/ui.rc $(RC)/pixmaps/bitcoin.ico $(RC)/pixmaps/check.ico $(RC)/pixmaps/send16.bmp $(RC)/pixmaps/send16mask.bmp $(RC)/pixmaps/send16masknoshadow.bmp $(RC)/pixmaps/send20.bmp $(RC)/pixmaps/send20mask.bmp $(RC)/pixmaps/addressbook16.bmp $(RC)/pixmaps/addressbook16mask.bmp $(RC)/pixmaps/addressbook20.bmp $(RC)/pixmaps/addressbook20mask.bmp
rc $(INCLUDEPATHS) $(DEFS) /Fo$@ %s
bitcoin.exe: $(OBJS) $(CRYPTOPP_OBJS) obj\ui.obj obj\uibase.obj obj\ui.res
link /nologo /SUBSYSTEM:WINDOWS /OUT:$@ $(LIBPATHS) $** $(WXLIBS) $(LIBS)
.cpp{obj\nogui}.obj:
cl $(CFLAGS) /Fo$@ %s
@ -163,10 +151,10 @@ obj\nogui\init.obj: $(HEADERS) @@ -163,10 +151,10 @@ obj\nogui\init.obj: $(HEADERS)
bitcoind.exe: $(OBJS:obj\=obj\nogui\) $(CRYPTOPP_OBJS) obj\ui.res
link /nologo /OUT:$@ $(LIBPATHS) $** $(LIBS)
clean:
-del /Q obj\*
-del /Q obj\nogui\*
-del /Q cryptopp\obj\*
-del /Q *.ilk
-del /Q *.pdb
-del /Q bitcoind.exe

3221
src/ui.cpp

File diff suppressed because it is too large Load Diff

355
src/ui.h

@ -1,355 +0,0 @@ @@ -1,355 +0,0 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UI_H
#define BITCOIN_UI_H
#include <boost/function.hpp>
#include "wallet.h"
DECLARE_EVENT_TYPE(wxEVT_UITHREADCALL, -1)
extern wxLocale g_locale;
void HandleCtrlA(wxKeyEvent& event);
void UIThreadCall(boost::function0<void>);
int ThreadSafeMessageBox(const std::string& message, const std::string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1);
bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, wxWindow* parent);
void CalledSetStatusBar(const std::string& strText, int nField);
void MainFrameRepaint();
void CreateMainWindow();
void SetStartOnSystemStartup(bool fAutoStart);
inline void InitMessage(const std::string &message)
{
}
inline int MyMessageBox(const wxString& message, const wxString& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
{
#ifdef GUI
if (!fDaemon)
return wxMessageBox(message, caption, style, parent, x, y);
#endif
printf("wxMessageBox %s: %s\n", std::string(caption).c_str(), std::string(message).c_str());
fprintf(stderr, "%s: %s\n", std::string(caption).c_str(), std::string(message).c_str());
return wxOK;
}
#define wxMessageBox MyMessageBox
class CMainFrame : public CMainFrameBase
{
protected:
// Event handlers
void OnNotebookPageChanged(wxNotebookEvent& event);
void OnClose(wxCloseEvent& event);
void OnIconize(wxIconizeEvent& event);
void OnMouseEvents(wxMouseEvent& event);
void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
void OnIdle(wxIdleEvent& event);
void OnPaint(wxPaintEvent& event);
void OnPaintListCtrl(wxPaintEvent& event);
void OnMenuFileExit(wxCommandEvent& event);
void OnUpdateUIOptionsGenerate(wxUpdateUIEvent& event);
void OnMenuOptionsChangeYourAddress(wxCommandEvent& event);
void OnMenuOptionsEncryptWallet(wxCommandEvent& event);
void OnMenuOptionsChangeWalletPassphrase(wxCommandEvent& event);
void OnMenuOptionsOptions(wxCommandEvent& event);
void OnMenuHelpAbout(wxCommandEvent& event);
void OnButtonSend(wxCommandEvent& event);
void OnButtonAddressBook(wxCommandEvent& event);
void OnSetFocusAddress(wxFocusEvent& event);
void OnMouseEventsAddress(wxMouseEvent& event);
void OnButtonNew(wxCommandEvent& event);
void OnButtonCopy(wxCommandEvent& event);
void OnListColBeginDrag(wxListEvent& event);
void OnListItemActivated(wxListEvent& event);
void OnListItemActivatedProductsSent(wxListEvent& event);
void OnListItemActivatedOrdersSent(wxListEvent& event);
void OnListItemActivatedOrdersReceived(wxListEvent& event);
public:
/** Constructor */
CMainFrame(wxWindow* parent);
~CMainFrame();
// Custom
enum
{
ALL = 0,
SENTRECEIVED = 1,
SENT = 2,
RECEIVED = 3,
};
int nPage;
wxListCtrl* m_listCtrl;
bool fShowGenerated;
bool fShowSent;
bool fShowReceived;
bool fRefreshListCtrl;
bool fRefreshListCtrlRunning;
bool fOnSetFocusAddress;
unsigned int nListViewUpdated;
bool fRefresh;
void OnUIThreadCall(wxCommandEvent& event);
int GetSortIndex(const std::string& strSort);
void InsertLine(bool fNew, int nIndex, uint256 hashKey, std::string strSort, const wxColour& colour, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5);
bool DeleteLine(uint256 hashKey);
bool InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex=-1);
void RefreshListCtrl();
void RefreshStatusColumn();
};
class CTxDetailsDialog : public CTxDetailsDialogBase
{
protected:
// Event handlers
void OnButtonOK(wxCommandEvent& event);
public:
/** Constructor */
CTxDetailsDialog(wxWindow* parent, CWalletTx wtx);
// State
CWalletTx wtx;
};
class COptionsDialog : public COptionsDialogBase
{
protected:
// Event handlers
void OnListBox(wxCommandEvent& event);
void OnKillFocusTransactionFee(wxFocusEvent& event);
void OnCheckBoxUseProxy(wxCommandEvent& event);
void OnKillFocusProxy(wxFocusEvent& event);
void OnButtonOK(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
void OnButtonApply(wxCommandEvent& event);
public:
/** Constructor */
COptionsDialog(wxWindow* parent);
// Custom
bool fTmpStartOnSystemStartup;
bool fTmpMinimizeOnClose;
void SelectPage(int nPage);
CAddress GetProxyAddr();
};
class CAboutDialog : public CAboutDialogBase
{
protected:
// Event handlers
void OnButtonOK(wxCommandEvent& event);
public:
/** Constructor */
CAboutDialog(wxWindow* parent);
};
class CSendDialog : public CSendDialogBase
{
protected:
// Event handlers
void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
void OnKillFocusAmount(wxFocusEvent& event);
void OnButtonAddressBook(wxCommandEvent& event);
void OnButtonPaste(wxCommandEvent& event);
void OnButtonSend(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
public:
/** Constructor */
CSendDialog(wxWindow* parent, const wxString& strAddress="");
// Custom
bool fEnabledPrev;
std::string strFromSave;
std::string strMessageSave;
};
class CSendingDialog : public CSendingDialogBase
{
public:
// Event handlers
void OnClose(wxCloseEvent& event);
void OnButtonOK(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
void OnPaint(wxPaintEvent& event);
public:
/** Constructor */
CSendingDialog(wxWindow* parent, const CAddress& addrIn, int64 nPriceIn, const CWalletTx& wtxIn);
~CSendingDialog();
// State
CAddress addr;
int64 nPrice;
CWalletTx wtx;
wxDateTime start;
char pszStatus[10000];
bool fCanCancel;
bool fAbort;
bool fSuccess;
bool fUIDone;
bool fWorkDone;
void Close();
void Repaint();
bool Status();
bool Status(const std::string& str);
bool Error(const std::string& str);
void StartTransfer();
void OnReply2(CDataStream& vRecv);
void OnReply3(CDataStream& vRecv);
};
void SendingDialogStartTransfer(void* parg);
void SendingDialogOnReply2(void* parg, CDataStream& vRecv);
void SendingDialogOnReply3(void* parg, CDataStream& vRecv);
class CAddressBookDialog : public CAddressBookDialogBase
{
protected:
// Event handlers
void OnNotebookPageChanged(wxNotebookEvent& event);
void OnListEndLabelEdit(wxListEvent& event);
void OnListItemSelected(wxListEvent& event);
void OnListItemActivated(wxListEvent& event);
void OnButtonDelete(wxCommandEvent& event);
void OnButtonCopy(wxCommandEvent& event);
void OnButtonEdit(wxCommandEvent& event);
void OnButtonNew(wxCommandEvent& event);
void OnButtonOK(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
void OnClose(wxCloseEvent& event);
public:
/** Constructor */
CAddressBookDialog(wxWindow* parent, const wxString& strInitSelected, int nPageIn, bool fDuringSendIn);
// Custom
enum
{
SENDING = 0,
RECEIVING = 1,
};
int nPage;
wxListCtrl* m_listCtrl;
bool fDuringSend;
wxString GetAddress();
wxString GetSelectedAddress();
wxString GetSelectedSendingAddress();
wxString GetSelectedReceivingAddress();
bool CheckIfMine(const std::string& strAddress, const std::string& strTitle);
};
class CGetTextFromUserDialog : public CGetTextFromUserDialogBase
{
protected:
// Event handlers
void OnButtonOK(wxCommandEvent& event) { EndModal(true); }
void OnButtonCancel(wxCommandEvent& event) { EndModal(false); }
void OnClose(wxCloseEvent& event) { EndModal(false); }
void OnKeyDown(wxKeyEvent& event)
{
if (event.GetKeyCode() == '\r' || event.GetKeyCode() == WXK_NUMPAD_ENTER)
EndModal(true);
else
HandleCtrlA(event);
}
public:
/** Constructor */
CGetTextFromUserDialog(wxWindow* parent,
const std::string& strCaption,
const std::string& strMessage1,
const std::string& strValue1="",
const std::string& strMessage2="",
const std::string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption)
{
int x = GetSize().GetWidth();
int y = GetSize().GetHeight();
m_staticTextMessage1->SetLabel(strMessage1);
m_textCtrl1->SetValue(strValue1);
y += wxString(strMessage1).Freq('\n') * 14;
if (!strMessage2.empty())
{
m_staticTextMessage2->Show(true);
m_staticTextMessage2->SetLabel(strMessage2);
m_textCtrl2->Show(true);
m_textCtrl2->SetValue(strValue2);
y += 46 + wxString(strMessage2).Freq('\n') * 14;
}
#ifndef __WXMSW__
x = x * 114 / 100;
y = y * 114 / 100;
#endif
SetSize(x, y);
}
// Custom
std::string GetValue() { return (std::string)m_textCtrl1->GetValue(); }
std::string GetValue1() { return (std::string)m_textCtrl1->GetValue(); }
std::string GetValue2() { return (std::string)m_textCtrl2->GetValue(); }
};
class CMyTaskBarIcon : public wxTaskBarIcon
{
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);
void OnMenuExit(wxCommandEvent& event);
public:
CMyTaskBarIcon() : wxTaskBarIcon()
{
Show(true);
}
void Show(bool fShow=true);
void Hide();
void Restore();
void UpdateTooltip();
virtual wxMenu* CreatePopupMenu();
DECLARE_EVENT_TABLE()
};
#endif

1018
src/uibase.cpp

File diff suppressed because it is too large Load Diff

425
src/uibase.h

@ -1,425 +0,0 @@ @@ -1,425 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 21 2009)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __uibase__
#define __uibase__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/toolbar.h>
#include <wx/statusbr.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/choice.h>
#include <wx/listctrl.h>
#include <wx/panel.h>
#include <wx/notebook.h>
#include <wx/frame.h>
#include <wx/html/htmlwin.h>
#include <wx/dialog.h>
#include <wx/listbox.h>
#include <wx/checkbox.h>
#include <wx/scrolwin.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
#define wxID_MAINFRAME 1000
#define wxID_BUTTONSEND 1001
#define wxID_BUTTONRECEIVE 1002
#define wxID_TEXTCTRLADDRESS 1003
#define wxID_BUTTONNEW 1004
#define wxID_BUTTONCOPY 1005
#define wxID_PROXYIP 1006
#define wxID_PROXYPORT 1007
#define wxID_TRANSACTIONFEE 1008
#define wxID_TEXTCTRLPAYTO 1009
#define wxID_BUTTONPASTE 1010
#define wxID_BUTTONADDRESSBOOK 1011
#define wxID_TEXTCTRLAMOUNT 1012
#define wxID_CHOICETRANSFERTYPE 1013
#define wxID_LISTCTRL 1014
#define wxID_BUTTONRENAME 1015
#define wxID_PANELSENDING 1016
#define wxID_LISTCTRLSENDING 1017
#define wxID_PANELRECEIVING 1018
#define wxID_LISTCTRLRECEIVING 1019
#define wxID_BUTTONDELETE 1020
#define wxID_BUTTONEDIT 1021
#define wxID_TEXTCTRL 1022
///////////////////////////////////////////////////////////////////////////////
/// Class CMainFrameBase
///////////////////////////////////////////////////////////////////////////////
class CMainFrameBase : public wxFrame
{
private:
protected:
wxMenuBar* m_menubar;
wxMenu* m_menuFile;
wxMenu* m_menuHelp;
wxToolBar* m_toolBar;
wxStaticText* m_staticText32;
wxButton* m_buttonNew;
wxButton* m_buttonCopy;
wxStaticText* m_staticText41;
wxStaticText* m_staticTextBalance;
wxChoice* m_choiceFilter;
wxNotebook* m_notebook;
wxPanel* m_panel9;
wxPanel* m_panel91;
wxPanel* m_panel92;
wxPanel* m_panel93;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnMouseEvents( wxMouseEvent& event ) { event.Skip(); }
virtual void OnPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnMenuFileExit( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMenuOptionsChangeYourAddress( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMenuOptionsEncryptWallet( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMenuOptionsChangeWalletPassphrase( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMenuOptionsOptions( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMenuHelpAbout( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonSend( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonAddressBook( wxCommandEvent& event ) { event.Skip(); }
virtual void OnKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnMouseEventsAddress( wxMouseEvent& event ) { event.Skip(); }
virtual void OnSetFocusAddress( wxFocusEvent& event ) { event.Skip(); }
virtual void OnButtonNew( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCopy( wxCommandEvent& event ) { event.Skip(); }
virtual void OnNotebookPageChanged( wxNotebookEvent& event ) { event.Skip(); }
virtual void OnListColBeginDrag( wxListEvent& event ) { event.Skip(); }
virtual void OnListItemActivated( wxListEvent& event ) { event.Skip(); }
virtual void OnPaintListCtrl( wxPaintEvent& event ) { event.Skip(); }
public:
wxMenu* m_menuOptions;
wxMenuItem* m_menuOptionsEncryptWallet;
wxMenuItem* m_menuOptionsChangeWalletPassphrase;
wxStatusBar* m_statusBar;
wxTextCtrl* m_textCtrlAddress;
wxListCtrl* m_listCtrlAll;
wxListCtrl* m_listCtrlSentReceived;
wxListCtrl* m_listCtrlSent;
wxListCtrl* m_listCtrlReceived;
CMainFrameBase( wxWindow* parent, wxWindowID id = wxID_MAINFRAME, const wxString& title = _("Bitcoin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 723,484 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
~CMainFrameBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CTxDetailsDialogBase
///////////////////////////////////////////////////////////////////////////////
class CTxDetailsDialogBase : public wxDialog
{
private:
protected:
wxHtmlWindow* m_htmlWin;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void OnButtonOK( wxCommandEvent& event ) { event.Skip(); }
public:
CTxDetailsDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Transaction Details"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 620,450 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CTxDetailsDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class COptionsDialogBase
///////////////////////////////////////////////////////////////////////////////
class COptionsDialogBase : public wxDialog
{
private:
protected:
wxListBox* m_listBox;
wxScrolledWindow* m_scrolledWindow;
wxPanel* m_panelMain;
wxCheckBox* m_checkBoxStartOnSystemStartup;
wxCheckBox* m_checkBoxMinimizeToTray;
wxCheckBox* m_checkBoxUseUPnP;
wxCheckBox* m_checkBoxMinimizeOnClose;
wxCheckBox* m_checkBoxUseProxy;
wxStaticText* m_staticTextProxyIP;
wxTextCtrl* m_textCtrlProxyIP;
wxStaticText* m_staticTextProxyPort;
wxTextCtrl* m_textCtrlProxyPort;
wxStaticText* m_staticText32;
wxStaticText* m_staticText31;
wxTextCtrl* m_textCtrlTransactionFee;
wxPanel* m_panelTest2;
wxStaticText* m_staticText321;
wxStaticText* m_staticText69;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
wxButton* m_buttonApply;
// Virtual event handlers, overide them in your derived class
virtual void OnListBox( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCheckBoxMinimizeToTray( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCheckBoxUseProxy( wxCommandEvent& event ) { event.Skip(); }
virtual void OnKillFocusProxy( wxFocusEvent& event ) { event.Skip(); }
virtual void OnKillFocusTransactionFee( wxFocusEvent& event ) { event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonApply( wxCommandEvent& event ) { event.Skip(); }
public:
COptionsDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 540,360 ), long style = wxDEFAULT_DIALOG_STYLE );
~COptionsDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CAboutDialogBase
///////////////////////////////////////////////////////////////////////////////
class CAboutDialogBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmap;
wxStaticText* m_staticText40;
wxStaticText* m_staticTextMain;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void OnButtonOK( wxCommandEvent& event ) { event.Skip(); }
public:
wxStaticText* m_staticTextVersion;
CAboutDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About Bitcoin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 532,333 ), long style = wxDEFAULT_DIALOG_STYLE );
~CAboutDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CSendDialogBase
///////////////////////////////////////////////////////////////////////////////
class CSendDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextInstructions;
wxStaticBitmap* m_bitmapCheckMark;
wxStaticText* m_staticText36;
wxTextCtrl* m_textCtrlAddress;
wxButton* m_buttonPaste;
wxButton* m_buttonAddress;
wxStaticText* m_staticText19;
wxTextCtrl* m_textCtrlAmount;
wxStaticText* m_staticText20;
wxChoice* m_choiceTransferType;
wxButton* m_buttonSend;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnTextAddress( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonPaste( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonAddressBook( wxCommandEvent& event ) { event.Skip(); }
virtual void OnKillFocusAmount( wxFocusEvent& event ) { event.Skip(); }
virtual void OnButtonSend( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ) { event.Skip(); }
public:
CSendDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Send Coins"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 498,157 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CSendDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CSendingDialogBase
///////////////////////////////////////////////////////////////////////////////
class CSendingDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextSending;
wxTextCtrl* m_textCtrlStatus;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ) { event.Skip(); }
public:
CSendingDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Sending..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 442,151 ), long style = wxDEFAULT_DIALOG_STYLE );
~CSendingDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CYourAddressDialogBase
///////////////////////////////////////////////////////////////////////////////
class CYourAddressDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticText45;
wxListCtrl* m_listCtrl;
wxButton* m_buttonRename;
wxButton* m_buttonNew;
wxButton* m_buttonCopy;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnListEndLabelEdit( wxListEvent& event ) { event.Skip(); }
virtual void OnListItemActivated( wxListEvent& event ) { event.Skip(); }
virtual void OnListItemSelected( wxListEvent& event ) { event.Skip(); }
virtual void OnButtonRename( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonNew( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCopy( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ) { event.Skip(); }
public:
CYourAddressDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Your Bitcoin Addresses"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 610,390 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CYourAddressDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CAddressBookDialogBase
///////////////////////////////////////////////////////////////////////////////
class CAddressBookDialogBase : public wxDialog
{
private:
protected:
wxNotebook* m_notebook;
wxPanel* m_panelSending;
wxStaticText* m_staticText55;
wxListCtrl* m_listCtrlSending;
wxPanel* m_panelReceiving;
wxStaticText* m_staticText45;
wxListCtrl* m_listCtrlReceiving;
wxButton* m_buttonDelete;
wxButton* m_buttonCopy;
wxButton* m_buttonEdit;
wxButton* m_buttonNew;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnNotebookPageChanged( wxNotebookEvent& event ) { event.Skip(); }
virtual void OnListEndLabelEdit( wxListEvent& event ) { event.Skip(); }
virtual void OnListItemActivated( wxListEvent& event ) { event.Skip(); }
virtual void OnListItemSelected( wxListEvent& event ) { event.Skip(); }
virtual void OnButtonDelete( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCopy( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonEdit( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonNew( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ) { event.Skip(); }
public:
wxButton* m_buttonCancel;
CAddressBookDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Address Book"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 610,390 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CAddressBookDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CGetTextFromUserDialogBase
///////////////////////////////////////////////////////////////////////////////
class CGetTextFromUserDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextMessage1;
wxTextCtrl* m_textCtrl1;
wxStaticText* m_staticTextMessage2;
wxTextCtrl* m_textCtrl2;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ) { event.Skip(); }
public:
CGetTextFromUserDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 440,138 ), long style = wxDEFAULT_DIALOG_STYLE );
~CGetTextFromUserDialogBase();
};
#endif //__uibase__

42
src/util.cpp

@ -471,40 +471,6 @@ void ParseParameters(int argc, char* argv[]) @@ -471,40 +471,6 @@ void ParseParameters(int argc, char* argv[])
}
const char* wxGetTranslation(const char* pszEnglish)
{
#ifdef GUI
// Wrapper of wxGetTranslation returning the same const char* type as was passed in
static CCriticalSection cs;
CRITICAL_BLOCK(cs)
{
// Look in cache
static map<string, char*> mapCache;
map<string, char*>::iterator mi = mapCache.find(pszEnglish);
if (mi != mapCache.end())
return (*mi).second;
// wxWidgets translation
wxString strTranslated = wxGetTranslation(wxString(pszEnglish, wxConvUTF8));
// We don't cache unknown strings because caller might be passing in a
// dynamic string and we would keep allocating memory for each variation.
if (strcmp(pszEnglish, strTranslated.utf8_str()) == 0)
return pszEnglish;
// Add to cache, memory doesn't need to be freed. We only cache because
// we must pass back a pointer to permanently allocated memory.
char* pszCached = new char[strlen(strTranslated.utf8_str())+1];
strcpy(pszCached, strTranslated.utf8_str());
mapCache[pszEnglish] = pszCached;
return pszCached;
}
return NULL;
#else
return pszEnglish;
#endif
}
bool WildcardMatch(const char* psz, const char* mask)
{
@ -573,10 +539,6 @@ void PrintException(std::exception* pex, const char* pszThread) @@ -573,10 +539,6 @@ void PrintException(std::exception* pex, const char* pszThread)
printf("\n\n************************\n%s\n", pszMessage);
fprintf(stderr, "\n\n************************\n%s\n", pszMessage);
strMiscWarning = pszMessage;
#ifdef GUI
if (wxTheApp && !fDaemon)
MyMessageBox(pszMessage, "Bitcoin", wxOK | wxICON_ERROR);
#endif
throw;
}
@ -598,10 +560,6 @@ void PrintExceptionContinue(std::exception* pex, const char* pszThread) @@ -598,10 +560,6 @@ void PrintExceptionContinue(std::exception* pex, const char* pszThread)
printf("\n\n************************\n%s\n", pszMessage);
fprintf(stderr, "\n\n************************\n%s\n", pszMessage);
strMiscWarning = pszMessage;
#ifdef GUI
if (wxTheApp && !fDaemon)
boost::thread(boost::bind(ThreadOneMessageBox, string(pszMessage)));
#endif
}

2
src/util.h

@ -132,7 +132,7 @@ inline int myclosesocket(SOCKET& hSocket) @@ -132,7 +132,7 @@ inline int myclosesocket(SOCKET& hSocket)
return ret;
}
#define closesocket(s) myclosesocket(s)
#if !defined(QT_GUI) && !defined(GUI)
#if !defined(QT_GUI)
inline const char* _(const char* psz)
{
return psz;

665
src/xpm/about.xpm

@ -1,665 +0,0 @@ @@ -1,665 +0,0 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
/* XPM */
static const char * about_xpm[] = {
/* columns rows colors chars-per-pixel */
"96 564 92 1",
" c #001269",
". c #000C72",
"X c #00057F",
"o c #001175",
"O c #000B6A",
"+ c #000E84",
"@ c #000489",
"# c #001583",
"$ c #001B89",
"% c #001B99",
"& c #000B92",
"* c #00208B",
"= c #002B97",
"- c #0004A6",
"; c #001DA7",
": c #0014BC",
"> c #0019BB",
", c #0017B4",
"< c #0023A3",
"1 c #002CAA",
"2 c #0030A4",
"3 c #003BA3",
"4 c #0033AB",
"5 c #003FA8",