Commit Graph

713 Commits

Author SHA1 Message Date
Manfred Karrer
704230fbdd Deactivate close tab button when funds are paid (#130) 2014-11-13 02:35:33 +01:00
Manfred Karrer
e459ce8419 Fix tx history update bug (#234) 2014-11-13 02:00:40 +01:00
Manfred Karrer
a86add2d9b Fix nullpointer 2014-11-13 01:45:39 +01:00
Manfred Karrer
19e0763ff5 Fix missing update in open trade screen (#244) 2014-11-13 01:43:48 +01:00
Manfred Karrer
f92f7de138 Cleanup 2014-11-13 01:02:43 +01:00
Manfred Karrer
f71d7c3bd4 Fix sorting bug in open trades (#239) 2014-11-13 00:52:16 +01:00
Manfred Karrer
2d5f1fb0e6 Remove web view for help 2014-11-13 00:41:33 +01:00
Manfred Karrer
59db93dbdc Use Utilities.openURL instead of Desktop.getDesktop().browse 2014-11-13 00:40:58 +01:00
Manfred Karrer
57faf40759 Fix missing update in open trades table (part of #239) 2014-11-13 00:28:33 +01:00
Chris Beams
d657763596
Merge branch 'cbeams'
* cbeams:
  Refactor SignatureService
  Polish formatting
  Rename io.bitsquare.crypto.{Crypto=>Signature}Service
  Replace 'Facade' naming with 'Service' naming
2014-11-12 14:07:13 +01:00
Manfred Karrer
a81db94f25
Remove NetworkPreferencesModel 2014-11-12 14:04:17 +01:00
Chris Beams
c0d415e12b
Refactor SignatureService
SignatureService methods are now generic with respect to Bitsquare's
domain, i.e. there is no longer any awareness of "contracts",
"registration data", or the like. In fact, because SignatureService
holds no state whatsoever, it would be reasonable to refactor the class
into a set of static utility methods. However, this change leaves
SignatureService as a DI-managed POJO for the time being.

Major changes:

 - Rename #signContract => #signMessage
 - Rename #getEmbeddedAccountRegistrationData => #digestMessageWithSignature
2014-11-12 13:59:27 +01:00
Chris Beams
75b7482bf1
Polish formatting 2014-11-12 11:15:28 +01:00
Chris Beams
99dcea4001
Rename io.bitsquare.crypto.{Crypto=>Signature}Service 2014-11-12 11:11:16 +01:00
Chris Beams
80758a0a47
Replace 'Facade' naming with 'Service' naming 2014-11-12 10:49:50 +01:00
Manfred Karrer
526727134f Add network info screen 2014-11-12 04:37:49 +01:00
Manfred Karrer
60102661ff Cleanup 2014-11-12 03:23:55 +01:00
Manfred Karrer
8d5cdf8d1f Use Trace loggong level for tomp2p and bitcoinJ 2014-11-12 03:16:31 +01:00
Manfred Karrer
5fe0db7ba8 Use UUID instead of Random 2014-11-12 03:15:55 +01:00
Chris Beams
eed2be1942
Merge branch 'cbeams'
* cbeams:
  Add 'appJar' and 'bootstapNodeJar' tasks to build
2014-11-11 23:54:59 +01:00
Chris Beams
6c36b2fa46
Add 'appJar' and 'bootstapNodeJar' tasks to build
The build now exposes two explicit ShadowJar tasks: one for the main
JavaFX client (`appJar`) and one for the headless bootstrap node
(`bootstrapNodeJar`).

Run as follows:

    ./gradlew appJar
    -- or --
    ./gradlew bootstrapNodeJar

The resulting executable jar for each will be found in the `build/libs`
directory.

Thanks to @johnrengleman for his help at johnrengelman/shadow#108

Resolves #265
Resolves #252
2014-11-11 23:53:32 +01:00
Chris Beams
69ed19d3dc
Merge branch 'cbeams'
* cbeams:
  Reorder methods in BitsquareEnvironment for clarity
  Introduce 'app.version' property and remove hardcoded version
  Use Preconditions#checkNotNull vs. #checkArgument
  Rename name, port properties to node.name, node.port
  Remove unused ApplicationPreferences variable
  Rename config file from bitsquare.{conf=>properties}
2014-11-11 22:56:43 +01:00
Chris Beams
14dde61832
Reorder methods in BitsquareEnvironment for clarity 2014-11-11 22:55:33 +01:00
Chris Beams
9adc41e23f
Introduce 'app.version' property and remove hardcoded version 2014-11-11 22:55:33 +01:00
Chris Beams
15a6d8a295
Use Preconditions#checkNotNull vs. #checkArgument 2014-11-11 21:56:44 +01:00
Chris Beams
ccd5f815f8
Rename name, port properties to node.name, node.port 2014-11-11 21:52:43 +01:00
Chris Beams
d55a03f2d8
Remove unused ApplicationPreferences variable 2014-11-11 21:51:57 +01:00
Chris Beams
1fcd0343d5
Rename config file from bitsquare.{conf=>properties} 2014-11-11 21:38:48 +01:00
Manfred Karrer
f23a1b8fa6 Add app preferences UI 2014-11-11 20:06:51 +01:00
Chris Beams
0136ea2884
Polish and test BitsquareEnvironment
- Introduce a test-time dependency on spring-test module for access to
   MockPropertySource and friends.

 - Add BitsquareEnvironmentTests and test that property source precedence
   works as expected, i.e. that properties supplied on the command line
   have highest precedence, overriding those picked up via environment
   variables, system properties, the bitsquare.properties file or any of
   the other available property sources.
2014-11-11 19:29:26 +01:00
Chris Beams
c8770f96a9
Move io.bitsquare.{=>app.}BitsquareEnvironmentTests 2014-11-11 19:29:25 +01:00
Manfred Karrer
eb0bd4a99a Rename usage of settings to applicationPreferences 2014-11-11 18:49:32 +01:00
Manfred Karrer
33085b5c2c Refactor Settings model to 2 separate models 2014-11-11 18:43:08 +01:00
Manfred Karrer
9751a5206e Rename settings package to preferences 2014-11-11 17:11:37 +01:00
Manfred Karrer
2ac43f63d4 Add 2 sub screens for preferences 2014-11-11 16:56:09 +01:00
Manfred Karrer
b5fc148b75 Use ViewCB<? extends PresentationModel instead of Initializable type 2014-11-11 16:20:39 +01:00
Chris Beams
d3f1ec252e
Merge branch 'wip-cbeams'
These changes eliminate the use of "appName" throughout the codebase in
favor of explicitly named, and therefore individually configurable
alternatives specific to each component. For example, instead of passing
the application name through the WalletFacade boundary and then using a
utility like AppDirectory to put construct the wallet directory on the
fly, the path to wallet directory is now passed explicitly as a
@Named(WALLET_DIR) parameter to the WalletFacade constructor.

The result is not only better configurability (e.g. the WALLET_DIR
property can be overridden without affecting any other parts of the
system), but also better understandability. See
BitsquareEnvironment#defaultProperties to see how it all comes together.
Note how the value of appName is mapped to each of these new properties,
all in one place where it's easy to get an overview etc.

Also, as of this commit, there is only one place in the codebase where
the word "Bitsquare" is hard-coded (in `i.b.app.BitsquareEnvironment`):

    $ git grep -h '"Bitsquare"' src
        public static final String DEFAULT_APP_NAME = "Bitsquare";

To keep things clean, further hard-coding should be avoided from this
point forward.

See extended comments for each commit for details.

* wip-cbeams:
  Eliminate remaining uses of @Named("appName")
  Introduce explicit title param in ViewCB
  Introduce io.bitsquare.btc.UserAgent
  Introduce explicit dir and prefix params in Persistence
  Introduce explicit wallet and useragent params in WalletFacade
  Rename environment "app properties"=>"default properties"
2014-11-11 14:59:59 +01:00
Chris Beams
1c0a6ee432
Eliminate remaining uses of @Named("appName")
Changes include:

 - Remove lighthouse.files.AppDirectory. Several methods from this class
   have, as of this commit, been rewritten and moved into the
   BitsquareEnvironment and BitsquareApp classes as appropriate.

 - Rename "appName" property => "app.name" for consistency with other
   configurable properties.

 - Allow configuration of both user and application data directories on
   the command line. See --help menu for details.
2014-11-11 14:57:18 +01:00
Chris Beams
454ee1fbe0
Introduce explicit title param in ViewCB
Like previous commits, this change removes reliance on the global
"appName" in favor of an explicit and configurable "view.title"
parameter. It is still set by default to the value of appName, but this
assignment is now done in BitsquareEnvironment, as are the other similar
parameters that have been broken out in previous commits.
2014-11-11 12:27:18 +01:00
Chris Beams
8f8866da6a
Introduce io.bitsquare.btc.UserAgent
This makes things generally more explicit and reduces the number of
String arguments in the WalletFacade constructor.
2014-11-11 12:27:18 +01:00
Chris Beams
b10958e790
Introduce explicit dir and prefix params in Persistence
Like the previous commit, this change eliminates the reliance on
"appName" within the Persistence class in favor of explicit and
independently configurable parameters.

Additionally, the FileUtil class has been removed as it is no longer
necessary.
2014-11-11 12:24:58 +01:00
Chris Beams
8f76a1d37b
Introduce explicit wallet and useragent params in WalletFacade
Previously, WalletFacade relied on "appName" to derive all information
related to the location of the bitcoinj wallet, the prefix of that
wallet, and the useragent name that will be used for bitcoin version
messages.

Now explicit parameters have been exposed for each of these, making for
a clearer and more configurable arrangement. The values associated with
each parameter still default to the value of "appName" (usually
"Bitsquare", "Bitsquare-Alice", or similar), however the assignment of
these defaults is now done in BitsquareEnvironment#defaultProperties
PropertySource. This approach allows for overriding any or all of these
parameters in any of the property sources that have higher precedence
than the default set, (e.g. in system environment variables, the
bitsquare.properties file, etc).

As a result of these changes, WalletFacade now has no awareness whatsover
of the Bitsquare "application", which is as it should be. This change
removes a conceptual tangle, and what would have become a code-level
tangle had we tried to replace the use of @Named("appName") with a
reference to BitsquareEnvironment#APP_NAME_KEY.

This begins a series of such changes, in which references to "appName"
will be eliminated in favor of similar explicit parameters.
2014-11-11 11:53:58 +01:00
Chris Beams
fd033faae3
Rename environment "app properties"=>"default properties" 2014-11-11 10:27:21 +01:00
Chris Beams
2b3c22d382
Merge branch 'wip-cbeams'
* wip-cbeams:
  Overhaul property management and main class infrastructure

Conflicts:
	build.gradle
2014-11-11 04:28:14 +01:00
Chris Beams
acf44128b2
Overhaul property management and main class infrastructure
Use of the Spring Environment
-----------------------------

This change replaces the use of the argparse4j library and basic
Properties objects with the Spring Framework's Environment abstraction.
The Environment allows for managing any number of 'property sources' in
a hierarchical fashion, such that a call to
`environment.getProperty("someKey")` iterates through an ordered set of
property sources, returning the first value associated with the given
key.

BitsquareEnvironment, introduced in this commit, eliminates the
functionality previously present in ConfigLoader, modeling the
bitsquare.conf and bitsquare.properties files as Spring Resource
objects, and in turn creating ResourcePropertySources out of them. These
custom property sources are combined with standard property sources
based on system environment variables and Java system properties as well
as a property source based on the command-line arguments passed to a
Bitsquare application to form a unified, one-stop configuration
hierarchy.

For example, let's say a Bitsquare user wishes to customize the port
that his Bitsquare application listens on. The simplest approach
(assuming the user is comfortable with the command line), would be the
following:

    java -jar bitsquare.jar --port=1234

where '1234' is the custom port of choice. This is convenient enough for
one-off experimentation, but if the user wishes to make this a permanent
arrangement, he may want to add a `port=1234` entry to his
{bitsquare_app_dir}/bitsquare.conf file.

Alternatively, the user may wish to specify the port value as an
environment variable, e.g.:

    PORT=1234 java -jar bitsquare.jar

or with a JVM system property, e.g.:

    java -jar -DPORT=1234 bitsquare.jar

With BitsquareEnvironment, and its customized set of PropertySources in
place, the value of the port property may be specified in any of the
ways described above, and it is all handled in a unified way.

Restructuring of *Main classes
------------------------------

This commit also introduces significant changes to the structure of
executable Bitsquare applications. For example, prior to this change,
the io.bitsquare.app.gui.Main class was responsible for being both a
JavaFX Application and a standard Java main class.

Now, however, these concerns have been renamed and separated.
BitsquareApp is the JavaFX Application, and BitsquareAppMain is the Java
main class. Likewise, BootstrapNode has been broken out into
BootstrapNode and BootstrapNodeMain.

A common base class for the *Main classes has been extracted, named
BitsquareExecutable, which creates a template for option parsing,
environment creation, and ultimately application execution that applies
both to the BootstrapNode and BitsquareApp cases.

Improved help text
------------------

With the removal of argparse4j and the introduction of JOpt for argument
parsing, the application's help text has been improved. Use --help to
display this text, where you'll see information about default values,
etc. To do this easily from the Gradle build, run any of the following
commands:

    # Display help text
    ./gradlew run -Pargs="--help"

    # Qualify the application name as "Bitsquare-Alice"
    ./gradlew run -Pargs="--appName=Alice"

    # Customize the port
    ./gradlew run -Pargs="--port=7377"

Renaming of FatalException
--------------------------

Finally, the exception formerly known as io.bitsquare.gui.FatalException
has been moved up a package and generalized to
io.bitsquare.BitsquareException, as it is now used more widely.
2014-11-11 04:20:48 +01:00
Manfred Karrer
28edc0bf60 Deactivate success check for GetPeerAddress, User baseFuture.isSuccess() 2014-11-11 02:56:28 +01:00
Manfred Karrer
4a765cd27a Fix wrong else clause 2014-11-11 02:41:47 +01:00
Manfred Karrer
475be0d676 Add testAddGetWithReconnect test 2014-11-11 02:31:39 +01:00
Manfred Karrer
a3abd2fd69 Remove test classes 2014-11-11 02:17:48 +01:00
Manfred Karrer
0f65441700 Set prefHeight for HBoxes to prevent layout jumping 2014-11-11 02:10:31 +01:00