mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-03-14 18:06:34 -04:00
Add IRC link and info popup
This commit is contained in:
parent
7ea5a92b78
commit
6272b360c0
@ -74,9 +74,9 @@ public class CachedViewCB<T extends PresentationModel> extends ViewCB<T> {
|
||||
*/
|
||||
public void activate() {
|
||||
log.trace("Lifecycle: activate " + this.getClass().getSimpleName());
|
||||
if (childController instanceof CachedViewCB)
|
||||
/* if (childController instanceof CachedViewCB)
|
||||
((CachedViewCB) childController).activate();
|
||||
|
||||
*/
|
||||
if (presentationModel != null)
|
||||
presentationModel.activate();
|
||||
}
|
||||
@ -86,8 +86,8 @@ public class CachedViewCB<T extends PresentationModel> extends ViewCB<T> {
|
||||
*/
|
||||
public void deactivate() {
|
||||
log.trace("Lifecycle: deactivate " + this.getClass().getSimpleName());
|
||||
if (childController instanceof CachedViewCB)
|
||||
((CachedViewCB) childController).deactivate();
|
||||
/* if (childController instanceof CachedViewCB)
|
||||
((CachedViewCB) childController).deactivate();*/
|
||||
|
||||
if (presentationModel != null)
|
||||
presentationModel.deactivate();
|
||||
|
@ -156,6 +156,9 @@ public class AccountViewCB extends CachedViewCB<AccountPM> {
|
||||
break;
|
||||
}
|
||||
|
||||
// for IRC demo we deactivate the arbitratorSettingsTab
|
||||
arbitratorSettingsTab.setDisable(true);
|
||||
|
||||
tab.setContent(view);
|
||||
((TabPane) root).getSelectionModel().select(tab);
|
||||
Initializable childController = loader.getController();
|
||||
|
@ -47,19 +47,23 @@
|
||||
</GridPane.margin>
|
||||
</ComboBox>
|
||||
|
||||
<Label text="IRC nick name:" GridPane.rowIndex="1"/>
|
||||
<InputTextField fx:id="ircNickNameTextField" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
||||
<Label text="Check if your nickname is available:" GridPane.rowIndex="1"/>
|
||||
<Hyperlink text="Open IRC @Freenode #bitsquare-trading in browser"
|
||||
onAction="#onOpenIRC" GridPane.columnIndex="1" GridPane.rowIndex="1" minHeight="26"/>
|
||||
|
||||
<Label text="Currency:" GridPane.rowIndex="2"/>
|
||||
<Label text="Your IRC nick name:" GridPane.rowIndex="2"/>
|
||||
<InputTextField fx:id="ircNickNameTextField" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
|
||||
|
||||
<Label text="Currency:" GridPane.rowIndex="3"/>
|
||||
<ComboBox fx:id="currencyComboBox" promptText="Select currency"
|
||||
onAction="#onSelectCurrency" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="2"/>
|
||||
GridPane.rowIndex="3"/>
|
||||
|
||||
<InfoDisplay gridPane="$root" onAction="#onOpenSetupHelp" rowIndex="3"
|
||||
<InfoDisplay gridPane="$root" onAction="#onOpenSetupHelp" rowIndex="4"
|
||||
text="The payments account data will be saved in a encrypted form to the Bitcoin block chain and will be used in the trade process for account verification."/>
|
||||
|
||||
<HBox fx:id="buttonsHBox" GridPane.columnIndex="1" GridPane.rowIndex="4" spacing="10">
|
||||
<Button fx:id="saveButton" text="Save" onAction="#onSave" defaultButton="true" disable="true"/>
|
||||
<HBox fx:id="buttonsHBox" GridPane.columnIndex="1" GridPane.rowIndex="5" spacing="10">
|
||||
<Button fx:id="saveButton" text="Save" onAction="#onSave" defaultButton="true" disable="true"/>
|
||||
<GridPane.margin>
|
||||
<Insets top="15.0" bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
@ -67,7 +71,7 @@
|
||||
|
||||
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="200.0"/>
|
||||
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="250.0"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
|
||||
</columnConstraints>
|
||||
|
||||
@ -77,6 +81,7 @@
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
<RowConstraints vgrow="NEVER"/>
|
||||
</rowConstraints>
|
||||
|
||||
</GridPane>
|
||||
|
@ -20,12 +20,18 @@ package io.bitsquare.gui.main.account.content.irc;
|
||||
import io.bitsquare.bank.BankAccountType;
|
||||
import io.bitsquare.gui.CachedViewCB;
|
||||
import io.bitsquare.gui.components.InputTextField;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.gui.main.account.MultiStepNavigation;
|
||||
import io.bitsquare.gui.main.account.content.ContextAware;
|
||||
import io.bitsquare.gui.main.help.Help;
|
||||
import io.bitsquare.gui.main.help.HelpId;
|
||||
import io.bitsquare.gui.util.validation.InputValidator;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.Currency;
|
||||
@ -33,7 +39,9 @@ import java.util.ResourceBundle;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.util.Callback;
|
||||
@ -103,6 +111,8 @@ public class IrcAccountViewCB extends CachedViewCB<IrcAccountPm> implements Cont
|
||||
}
|
||||
});
|
||||
|
||||
typesComboBox.getSelectionModel().select(0);
|
||||
|
||||
super.initialize(url, rb);
|
||||
}
|
||||
|
||||
@ -112,6 +122,18 @@ public class IrcAccountViewCB extends CachedViewCB<IrcAccountPm> implements Cont
|
||||
|
||||
setupListeners();
|
||||
setupBindings();
|
||||
|
||||
Platform.runLater(() -> {
|
||||
Popups.openInfo("Demo setup for simulating the banking transfer",
|
||||
"For demo purposes we use a special setup so that users can simulate the banking transfer when " +
|
||||
"meeting in an IRC chat room.\n" +
|
||||
"You need to define your IRC nickname and later in the trade process you can find your " +
|
||||
"trading partner with his IRC nickname in the chat room and simulate the bank transfer " +
|
||||
"activities, which are:\n\n" +
|
||||
"1. Bitcoin buyer indicates that he has started the bank transfer.\n\n" +
|
||||
"2. Bitcoin seller confirms that he has received the national currency from the " +
|
||||
"bank transfer.");
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("EmptyMethod")
|
||||
@ -163,7 +185,14 @@ public class IrcAccountViewCB extends CachedViewCB<IrcAccountPm> implements Cont
|
||||
Help.openWindow(HelpId.SETUP_FIAT_ACCOUNT);
|
||||
}
|
||||
|
||||
|
||||
@FXML
|
||||
void onOpenIRC() {
|
||||
try {
|
||||
Desktop.getDesktop().browse(URI.create("https://webchat.freenode.net/?channels=bitsquare-trading"));
|
||||
} catch (IOException e) {
|
||||
log.error("Cannot open browser. " + e.getMessage());
|
||||
}
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Private methods
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -189,5 +218,7 @@ public class IrcAccountViewCB extends CachedViewCB<IrcAccountPm> implements Cont
|
||||
ircNickNameTextField.textProperty().bindBidirectional(presentationModel.ircNickName);
|
||||
saveButton.disableProperty().bind(presentationModel.saveButtonDisable);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user