Skip to content

Commit

Permalink
Fixed bug with GitHub-related dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
emd4600 committed Oct 12, 2024
1 parent 4a95460 commit 2ef9f4e
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ local.properties
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project

# Codeium metadata
*.*~

Projects/**
bin
WinMerge
Expand Down
15 changes: 15 additions & 0 deletions src/sporemodder/view/dialogs/ConnectToRepositoryUI.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.VBox?>


<VBox fx:id="mainNode" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="400.0" spacing="10.0" xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sporemodder.view.dialogs.ConnectToRepositoryUI">
<children>
<Label text="Set the URL to an existing repository, such as 'https://github.com/emd4600/advanced-creature-paint'. You must have permissions to write to that repository." wrapText="true" />
<Label text="Doing this will not synchronize any data between your local computer and the GitHub repository. You can do it later in the 'Git Sync' wnidow (push &amp; pull)." wrapText="true" />
<TextField fx:id="urlTextField" />
<Label fx:id="warningLabel" text="Repository URL cannot be empty" visible="false" />
</children>
</VBox>
41 changes: 41 additions & 0 deletions src/sporemodder/view/dialogs/CreateRepositoryUI.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>


<VBox fx:id="mainNode" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="500.0" spacing="5.0" xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sporemodder.view.dialogs.CreateRepositoryUI">
<children>
<GridPane hgap="10.0" vgap="5.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Repository Name:" />
<Label text="Description:" GridPane.rowIndex="1" />
<Label text="Repository URL:" GridPane.rowIndex="2" />
<TextField fx:id="repoNameTextField" GridPane.columnIndex="1" />
<TextField fx:id="descriptionTextField" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="urlTextField" editable="false" disable="true" GridPane.columnIndex="1" GridPane.rowIndex="2" />
</children>
</GridPane>
<CheckBox fx:id="isPrivateCheckBox" mnemonicParsing="false" text="Private repository">
<tooltip>
<Tooltip text="If the repository is private, only you will be able to see it. You can make it public later in the repository settings." wrapText="true" />
</tooltip>
</CheckBox>
<Label fx:id="warningLabel" text="Label" visible="false" />
</children>
</VBox>
30 changes: 30 additions & 0 deletions src/sporemodder/view/dialogs/GitAuthenticateUI.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Hyperlink?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<VBox fx:id="mainNode" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="400.0" spacing="10.0" xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sporemodder.view.dialogs.GitAuthenticateUI">
<children>
<Label text="Your GitHub login has expired. To log in again, go to:" />
<Hyperlink fx:id="githubLoginLink" text="Hyperlink">
<font>
<Font size="16.0" />
</font>
</Hyperlink>
<Label text="Then insert the following code:" />
<AnchorPane>
<children>
<TextField fx:id="loginCodeTextField" alignment="CENTER" editable="false" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<font>
<Font size="30.0" />
</font>
</TextField>
</children>
</AnchorPane>
<Label layoutX="10.0" layoutY="80.0" text="Once you are logged in, this dialog will close after a few seconds." />
</children>
</VBox>

0 comments on commit 2ef9f4e

Please sign in to comment.