Skip to content

Commit

Permalink
Merge pull request #61 from adriantan101/update-help-links
Browse files Browse the repository at this point in the history
Add links to Product Website, User Guide
  • Loading branch information
JoanneHing authored Oct 9, 2024
2 parents 9b7127f + ccd15f8 commit 40a3e33
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
26 changes: 21 additions & 5 deletions src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/
public class HelpWindow extends UiPart<Stage> {

public static final String USERGUIDE_URL = "https://se-education.org/addressbook-level3/UserGuide.html";
public static final String USERGUIDE_URL = "https://ay2425s1-cs2103t-w11-3.github.io/tp/UserGuide.html#quick-start";
public static final String PRODUCT_WEBSITE = "https://ay2425s1-cs2103t-w11-3.github.io/tp/";
public static final String HELP_MESSAGE = "Welcome to the AcademyAssist Help Window!\n\n"
+ "Here are some useful commands to get started:\n\n"
+ "1. add: Adds a student's details\n"
Expand All @@ -34,13 +35,16 @@ public class HelpWindow extends UiPart<Stage> {
+ " Format: clear\n\n"
+ "8. exit: Exits the program\n"
+ " Format: exit\n\n"
+ "For more detailed information, please refer to the user guide: " + USERGUIDE_URL;
+ "For more detailed information, please refer to the links below\n";

private static final Logger logger = LogsCenter.getLogger(HelpWindow.class);
private static final String FXML = "HelpWindow.fxml";

@FXML
private Button copyButton;
private Button copyUserGuideButton;

@FXML
private Button copyProductWebsiteButton;

@FXML
private TextArea helpMessageArea;
Expand Down Expand Up @@ -113,10 +117,22 @@ public void focus() {
* Copies the URL to the user guide to the clipboard.
*/
@FXML
private void copyUrl() {
private void copyUserGuideUrl() {
copyToClipboard(USERGUIDE_URL);
}

/**
* Copies the URL to the README to the clipboard.
*/
@FXML
private void copyProductWebsite() {
copyToClipboard(PRODUCT_WEBSITE);
}

private void copyToClipboard(String content) {
final Clipboard clipboard = Clipboard.getSystemClipboard();
final ClipboardContent url = new ClipboardContent();
url.putString(USERGUIDE_URL);
url.putString(content);
clipboard.setContent(url);
}
}
6 changes: 5 additions & 1 deletion src/main/resources/view/HelpWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.stage.Stage?>

Expand All @@ -25,7 +26,10 @@
</padding>
<children>
<TextArea fx:id="helpMessageArea" editable="false" wrapText="true" VBox.vgrow="ALWAYS" />
<Button fx:id="copyButton" mnemonicParsing="false" onAction="#copyUrl" text="Copy URL" />
<HBox alignment="CENTER" spacing="10">
<Button fx:id="copyUserGuideButton" mnemonicParsing="false" onAction="#copyUserGuideUrl" text="Copy User Guide URL" />
<Button fx:id="copyReadmeButton" mnemonicParsing="false" onAction="#copyProductWebsite" text="Copy Product Website URL" />
</HBox>
</children>
</VBox>
</Scene>
Expand Down

0 comments on commit 40a3e33

Please sign in to comment.