Commit Graph

1196 Commits

Author SHA1 Message Date
Manfred Karrer
15854bdf06 Restrict non Desktop API for linux only (Win7 cause problems) 2014-11-20 00:58:26 +01:00
Manfred Karrer
5b5bacc397 Cleanup, improve logging 2014-11-20 00:09:27 +01:00
Manfred Karrer
a23277a527 Use Utilities when accessing the default currency 2014-11-19 20:50:33 +01:00
Manfred Karrer
c57aba7992 Fix tradestate problem 2014-11-19 20:36:03 +01:00
Manfred Karrer
c9bed48a53 Change back fee to new standard 2014-11-19 20:35:08 +01:00
Manfred Karrer
82325f615f Fix missing update for trade state (#285) 2014-11-19 18:03:26 +01:00
Manfred Karrer
b9b50da190 Cleanup 2014-11-19 17:17:07 +01:00
Manfred Karrer
d482798024 Change open URI support 2014-11-19 17:04:19 +01:00
Manfred Karrer
279145a5ca Add support if desktop.browse(uri) is not supported 2014-11-19 16:10:26 +01:00
Manfred Karrer
b7d6c5195e Add support if desktop.browse(uri) is not supported (Ubuntu with latest java version) 2014-11-19 16:10:03 +01:00
Manfred Karrer
107731b884 Use biteasy testnet as link for tx explorer 2014-11-19 15:07:17 +01:00
Manfred Karrer
aff235dbb0 Add null check 2014-11-19 14:33:39 +01:00
Manfred Karrer
3c6f31a421 Revert fee to old 0.0001 BTC to avoid problems with not accepted tx 2014-11-19 14:33:25 +01:00
Manfred Karrer
bc39d4d315 Deactivate relay mode 2014-11-19 13:16:52 +01:00
Manfred Karrer
74bedff837 Scroll down to important content #226 2014-11-19 02:25:46 +01:00
Manfred Karrer
bd8b39b996 Show busy spinner at pay reg. fee #284 2014-11-19 01:48:17 +01:00
Manfred Karrer
2b4e7528c4 Add behindFirewall 2014-11-19 00:29:49 +01:00
Manfred Karrer
b85317c8f3 Shutdown peer in BootstrappedPeerFactory in case of bootstrap is still in progress (#270)\n\n Te other shutdown call in TomP2PNode would not trigger a shutdown as the peer is null during bootstrap 2014-11-18 23:44:41 +01:00
Manfred Karrer
9517c7ee6d Show busy spinner at create and take offer #281 2014-11-18 23:25:21 +01:00
Manfred Karrer
f92104f4e2 Close trade after withdrawal #283 2014-11-18 20:19:30 +01:00
Manfred Karrer
f8e4d1a41d Allow only EUR for the moment (#282) 2014-11-18 20:04:28 +01:00
Manfred Karrer
f9859b3a13 Fix trade state update bug 2014-11-18 19:52:46 +01:00
Manfred Karrer
b87a27922a Fix missing remove listener (Should fix #280 - not reproducible yet) 2014-11-18 19:08:02 +01:00
Manfred Karrer
ee310fc4ae Reduce security deposit to make testing cheaper on IRC accountmodel 2014-11-18 17:11:10 +01:00
Manfred Karrer
cbcab9e5aa Cleanup 2014-11-18 16:13:06 +01:00
Manfred Karrer
e4a54c47f8 Reduce security deposit to make testing cheaper 2014-11-18 16:12:53 +01:00
Manfred Karrer
3234df4484 Change log level 2014-11-18 16:08:00 +01:00
Manfred Karrer
976a76411f Update formatter to new lower reg. fee (miner fee dropped 10 fold) 2014-11-17 20:26:20 +01:00
Manfred Karrer
46a56e4e4f Update to BitcoinJ 0.12.2 2014-11-17 18:57:58 +01:00
Manfred Karrer
29cfdd2301 Update for lastest TomP2P master 2014-11-17 18:04:52 +01:00
Manfred Karrer
f6d6f80a64 Update to lastest TomP2P master 2014-11-17 17:40:22 +01:00
Chris Beams
b9a1095578
Merge branch 'cbeams'
Changes made during the effort to decouple "backend initialization" for
the purpose of developing and testing the GUI while offline and/or
without having to actually connect to the bitcoin / tomp2p networks.
This decoupling is not yet possible--these changes just prepare for it.
These changes also represent the first steps in streamlining controller
archictecture toward maximum maintainability. See individual commit
comments for details.

* cbeams:
  Polish MainViewCB
  Refactor ViewLoader for proper injection
  Refactor MainViewCB and Navigation.Item
2014-11-17 11:47:27 +01:00
Chris Beams
70d6be1aef
Polish MainViewCB
Complete the MainViewCB refactoring process described earlier now that
ViewLoader is properly injected (see previous commit). Also, rearrange
the few private methods that remain to align with their order of
invocation.
2014-11-17 11:29:33 +01:00
Chris Beams
f6f97d55ed
Avoid use of JOpt's #defaultsTo method
Providing an explicit default using the #defaultsTo method ends up
short-circuiting the Spring Environment's hierarchical property resolution
process. for example, if --port.useManualPortForwarding has a default
value of `false`, then the command line property source always returns a
value when its #getProperty method is invoked by the Environment. This
means that a lower-precedence property source never has the opportunity
to return its value. For example, if port.useManualPortForwarding had
been set to true in the filesystem property source
(at ${user.data.dir}/bitsquare.properties), this property value would
never be resolved because the default command line property source always
overrides it (thus the notion of "short circuiting" above).

This change eliminates the use of JOpt's #defaultsTo method in favor of
a simple approach to advertising default values (if any) in the option's
description string. The result is --help output that reads exactly the
same as it did before, but no actual default value is set at the command
line property source level.

Note that the default property source is still created, and default
values are still assigned in BitsquareEnvironment#defaultPropertySource.
This property source has the lowest precedence, and this means that any
and all other property sources have the opportunity to provide a value
and override the default.
2014-11-17 11:18:21 +01:00
Manfred Karrer
97fc4a728e Remove PeerConnection for sendDirect 2014-11-17 02:30:47 +01:00
Chris Beams
a4d3fab462
Refactor ViewLoader for proper injection
ViewLoader is now modeled as a stateless singleton and injected into all
components (usually controllers) that need it. This is as opposed to the
prior situation in which a ViewLoader was instatiated every time view
loading was required. This was an understerstandable approach, given
that FXMLLoader (which ViewLoader wraps) assumes the same
construction-per-use approach, but it is nevertheless problematic.

 - Return Item tuple from ViewLoader#load.

   This avoids the need to call ViewLoader#load followed by individual
   calls to get the view and then the controller, as this requires
   mutable state to be held in the ViewLoader (which is now a shared
   singleton injected throughout the application). The previous approach
   is (a) confusing and (b) could create problems in a multithreaded
   environment. While (b) is unlikely in our case, the new approach is
   still clearer anyway.

 - Refactor ViewLoader#load to accept URL vs FxmlResource.

   This decouples the ViewLoader abstraction away from the
   Navigation.Item / FxmlResource abstraction completely.
2014-11-16 16:51:10 +01:00
Manfred Karrer
8e18a265de Change log level for bitcoinJ 2014-11-16 16:22:53 +01:00
Manfred Karrer
edfef9865c Use Utilities.copyToClipboard, add copy offer/trade ID 2014-11-16 16:22:21 +01:00
Chris Beams
cc75aec8f0
Refactor MainViewCB and Navigation.Item
Changes to MainViewCB
---------------------

This is a siginificant restructuring of the main controller in the
system and suggests a number of ideas and practices that should be
applied when refactoring the rest of the controllers or designing new
ones. UI code is inherently verbose; as such, the best we can do is to
structure a controller such as MainViewCB in a way that minimizes the
verbosity as much as possible and focuses on making what is happening as
clear as possible. That's why (as is described further below), almost
everything important now happens in the #initialize method. A major goal
of this change is that developers are able to look at MainViewCB and
read its #initialize method like a script. Indirections to other methods
are minimized as much as possible. The primary focus is on readability
(and therefore maintainability).

These changes began as an effort to substitute a mocked-out "backend",
i.e. bitcoin and p2p infrastructure, such that the application could
be run as quickly as possible, without the need for network
sychronization, bootstrapping, etc, for the purposes of UI development
and testing. Trying to make that change naturally evolved into this set
of refactorings. So at this point, MainViewCB is still "hard-wired" to
live bitcoin and tomp2p backends, but changing that, i.e. providing
mocked-out backends will be that much easier and clearer to accomplish
now.

Specifics:

 - Use public vs. private contstructor. This allows for the possibility
   of unit testing, avoids spurious warnings in the IDE, and generally
   adheres to the principle of least surprise.

 - Orchestrate creation and composition of components within the
   #initialize method. This avoids the need for member fields almost
   entirely.

 - Extract and delegate to private methods from #initialize only where
   it helps readibility. In general, this change assumes that initialize
   should be "where the action is": if the layout of a particular view
   is complex, then deal with that complexity directly within the
   #initialize method. However, if the creation of a given component is
   particularly verbose--for example the creation of the splash screen,
   then extract a #createSplashScreen method that returns a VBox. The
   same approach has been applied in extracting the
   #createBankAccountComboBox, #applyPendingTradesInfoIcon and
   #loadSelectedNavigation methods.

 - Extract the NavButton member class to cleanly encapsulate what it
   means to be a ToggleButton on the Bitsquare application navigation.
   This approach is similar to the MenuItem class in
   AccountSettingsViewCB.

 - Use "double-brace initialization" syntax for JavaFX components
   where appropriate, e.g.:

    HBox rightNavPane =
            new HBox(accountComboBox, settingsButton, accountButton) {{
        setSpacing(10);
        setRightAnchor(this, 10d);
        setTopAnchor(this, 0d);
    }};

   This approach, while typically rarely used, is an especially
   appropriate fit for JavaFX UI components, as the the allows for both
   maximum concision and clarity. Most JavaFX components are configured
   through a combination of constructor parameters and setter method
   invocations, and this approach allows all of them to happen at
   construction/initialization time.

 - Remove class section comments. In general--and as @mkarrer and I have
   discussed--these `////...` blocks shouldn't be necessary going
   forward. The goal is classes that are as small and focused as they
   can be, and they should be self-documenting to the greatest degree
   possible.

 - Remove empty lifecycle methods from the ViewCB superclass.

 - Remove Profiler statements. These are fine for specific debugging
   sessions, but should otherwise be removed for normal use.

Changes to Navigation.Item
--------------------------

These changes to the Navigation.Item enum were made in support of the
refactorings above, particularly in support of the newly extracted
NavButton class being as concise to construct as possible.

 - Introduce Navigation.Item#getDisplayName

   Push navigation button titles, such as "Overview" for HOME, "Buy BTC"
   for BUY, etc. into the Navigation.Item enum itself. This can later be
   refactored to support I18N, e.g. by embedding a message label instead
   of the actual english word. Not all Navigation items have a display
   name yet (and it may or may not make sense for them all to have one).
   The default value is "NONE".
2014-11-16 16:05:50 +01:00
Manfred Karrer
dd80d3edf3 Disable relay mode 2014-11-15 19:05:27 +01:00
Manfred Karrer
eee523e8b3 Use DIRECT as default connection type 2014-11-15 18:33:43 +01:00
Manfred Karrer
103542dd87 Adopt tests for manual port forwarding, rename NAT to AUTO_PORT_FORWARDING 2014-11-15 18:33:11 +01:00
Manfred Karrer
dc464b36e4 Add manual port forwarding support 2014-11-15 18:06:58 +01:00
Manfred Karrer
3811cabba1 Rename Preferences to Settings (#272) 2014-11-14 14:28:08 +01:00
Manfred Karrer
45f7a3b8fc Merge remote-tracking branch 'origin/master' 2014-11-14 14:12:11 +01:00
Manfred Karrer
745c62ab82 Use darwin as alternative for mac 2014-11-14 14:06:43 +01:00
Manfred Karrer
24c75a884e Fix os name for linux 2014-11-14 14:02:26 +01:00
Chris Beams
1d5673ebb1
Polish
- Use AtomicBoolean vs. SimpleBooleanProperty in TomP2PTests to avoid
   use of javax.* classes where they aren't otherwise necessary.

 - Reformat code globally to eliminate trailing whitespace and fix
   indentation

 - Optimize imports globally to eliminate unused imports
2014-11-14 08:56:06 +01:00
Manfred Karrer
c8ece38889 Use external IP not internal 2014-11-14 03:01:36 +01:00
Manfred Karrer
745cba983d Use currencyCode instead of locationKey 2014-11-14 03:01:01 +01:00