Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links to Product Website, User Guide #61

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
+ " 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 @@
* Copies the URL to the user guide to the clipboard.
*/
@FXML
private void copyUrl() {
private void copyUserGuideUrl() {
copyToClipboard(USERGUIDE_URL);
}

Check warning on line 122 in src/main/java/seedu/address/ui/HelpWindow.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/HelpWindow.java#L121-L122

Added lines #L121 - L122 were not covered by tests

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

Check warning on line 130 in src/main/java/seedu/address/ui/HelpWindow.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/HelpWindow.java#L129-L130

Added lines #L129 - L130 were not covered by tests

private void copyToClipboard(String content) {
final Clipboard clipboard = Clipboard.getSystemClipboard();
final ClipboardContent url = new ClipboardContent();
url.putString(USERGUIDE_URL);
url.putString(content);

Check warning on line 135 in src/main/java/seedu/address/ui/HelpWindow.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/HelpWindow.java#L135

Added line #L135 was not covered by tests
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