Skip to content

Commit 5cccb13

Browse files
committed
Move from noui.h / ui.h to one ui_interface.h with dummy implementation for the daemon.
1 parent 5a60b66 commit 5cccb13

File tree

10 files changed

+63
-92
lines changed

10 files changed

+63
-92
lines changed

bitcoin-qt.pro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ HEADERS += src/qt/bitcoingui.h \
115115
src/key.h \
116116
src/db.h \
117117
src/script.h \
118-
src/noui.h \
119118
src/init.h \
120119
src/headers.h \
121120
src/irc.h \
@@ -135,7 +134,6 @@ HEADERS += src/qt/bitcoingui.h \
135134
src/qt/guiconstants.h \
136135
src/qt/optionsmodel.h \
137136
src/qt/monitoreddatamapper.h \
138-
src/qtui.h \
139137
src/qt/transactiondesc.h \
140138
src/qt/transactiondescdialog.h \
141139
src/qt/bitcoinamountfield.h \
@@ -156,7 +154,8 @@ HEADERS += src/qt/bitcoingui.h \
156154
src/protocol.h \
157155
src/qt/notificator.h \
158156
src/qt/qtipcserver.h \
159-
src/allocators.h
157+
src/allocators.h \
158+
src/ui_interface.h
160159

161160
SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
162161
src/qt/transactiontablemodel.cpp \

src/headers.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,5 @@
8787
#include "bignum.h"
8888
#include "base58.h"
8989
#include "main.h"
90-
#ifdef QT_GUI
91-
#include "qtui.h"
92-
#else
93-
#include "noui.h"
94-
#endif
90+
#include "wallet.h"
91+
#include "ui_interface.h"

src/makefile.linux-mingw

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ OBJS= \
5959
obj/rpcdump.o \
6060
obj/script.o \
6161
obj/util.o \
62-
obj/wallet.o
62+
obj/wallet.o \
63+
obj/noui.o
6364

6465
all: bitcoind.exe
6566

src/makefile.mingw

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ OBJS= \
5757
obj/rpcdump.o \
5858
obj/script.o \
5959
obj/util.o \
60-
obj/wallet.o
60+
obj/wallet.o \
61+
obj/noui.o
6162

6263

6364
all: bitcoind.exe

src/makefile.osx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ OBJS= \
7474
obj/rpcdump.o \
7575
obj/script.o \
7676
obj/util.o \
77-
obj/wallet.o
77+
obj/wallet.o \
78+
obj/noui.o
7879

7980
ifdef USE_UPNP
8081
DEFS += -DUSE_UPNP=$(USE_UPNP)

src/makefile.unix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ OBJS= \
105105
obj/rpcdump.o \
106106
obj/script.o \
107107
obj/util.o \
108-
obj/wallet.o
108+
obj/wallet.o \
109+
obj/noui.o
109110

110111

111112
all: bitcoind

src/noui.cpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright (c) 2010 Satoshi Nakamoto
2+
// Copyright (c) 2009-2012 The Bitcoin developers
3+
// Distributed under the MIT/X11 software license, see the accompanying
4+
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
5+
#include "ui_interface.h"
6+
7+
#include <string>
8+
#include "headers.h"
9+
#include "init.h"
10+
11+
int ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style)
12+
{
13+
printf("%s: %s\n", caption.c_str(), message.c_str());
14+
fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str());
15+
return 4;
16+
}
17+
18+
bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption)
19+
{
20+
return true;
21+
}
22+
23+
void MainFrameRepaint()
24+
{
25+
}
26+
27+
void AddressBookRepaint()
28+
{
29+
}
30+
31+
void InitMessage(const std::string &message)
32+
{
33+
}
34+
35+
std::string _(const char* psz)
36+
{
37+
return psz;
38+
}
39+
40+
void QueueShutdown()
41+
{
42+
// Without UI, Shutdown can simply be started in a new thread
43+
CreateThread(Shutdown, NULL);
44+
}
45+

src/noui.h

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/qt/transactiondesc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "bitcoinunits.h"
55

66
#include "headers.h"
7-
#include "qtui.h"
7+
#include "ui_interface.h"
88

99
#include <QString>
1010

src/qtui.h renamed to src/ui_interface.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright (c) 2010 Satoshi Nakamoto
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
4-
#ifndef BITCOIN_EXTERNUI_H
5-
#define BITCOIN_EXTERNUI_H
4+
#ifndef BITCOIN_UI_INTERFACE_H
5+
#define BITCOIN_UI_INTERFACE_H
66

77
#include <string>
8-
#include "wallet.h"
8+
#include "util.h" // for int64
99

1010
#define wxYES 0x00000002
1111
#define wxOK 0x00000004
@@ -36,6 +36,8 @@
3636
// Force blocking, modal message box dialog (not just notification)
3737
#define wxMODAL 0x00040000
3838

39+
/* These UI communication functions are implemented in bitcoin.cpp (for ui) and noui.cpp (no ui) */
40+
3941
extern int ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style=wxOK);
4042
extern bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption);
4143
extern void ThreadSafeHandleURL(const std::string& strURL);

0 commit comments

Comments
 (0)