diff --git a/README.md b/README.md index e4099ca4a974d7ba3ff61948622182268ca2ac50..8403ea20ceeb621c62df17b640afc05a44f68cdc 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,14 @@ <br> </h1> -<h4 align="center">A minimal note-taking application built on top of <a href="https://kotlinlang.org/" target="_blank">Kotlin</a></h4> +<h4 align="center">A minimal note-taking application built on top of +<a href="https://kotlinlang.org/" target="_blank">Kotlin</a></h4> <p align="center"> <a href="#goal">Goal</a> • <a href="#features">Key Features</a> • + <a href="#user-manual">User Manual</a> • + <a href="#microservices">Microservices</a> • <a href="#installation">Installation</a> • <a href="#technologies">Technologies</a> • <a href="#contribution">Contribution</a> • @@ -21,12 +24,14 @@  ## Goal -**Sticky Note** is a simple and easy-to-use note-taking application with many features supported. This is a project from team 112 of CS 346: Application development. - +**Sticky Note** is a simple and easy-to-use note-taking application with many features supported. This is a project +from team 112 of CS 346: Application development. ## Features #### Main features include: -- A top-level menu bar that lists major functions, and indicates the hotkeys for each feature (e.g. File, Edit, View menu and submenus). -- Toolbars that let the user control settings and modes that apply to the application e.g. a Bold button that can be used to embolden text, and reflects the state of selected text. +- A top-level menu bar that lists major functions, and indicates the hotkeys for each feature +(e.g. File, Edit, View menu and submenus). +- Toolbars that let the user control settings and modes that apply to the application e.g. a Bold button that can be +used to embolden text, and reflects the state of selected text. - Minimize/maximize buttons function as expected. - Undo-redo support for actions in the user interface. - Cut-copy-paste text. @@ -43,14 +48,69 @@ - Image Support - Command Line Support -## Microservices: +## User Manual +A guide for users to refer to regarding the features offered by the note-taking application. Additionally, +this is also an instruction guide for TA to grade this project. + +### Running the app via the command line +- To run the app via the command line, unzip the distribution zip file and head to `app/bin/` +- To see the list of local notes via the command line run: `./app help` +- To open the app normal run the app without any command line arguments: `./app` +- To open a specific note with an ID, copy the ID of the note to be opened and pass it as a +command line argument: `./app <ID>` + +### Running the app normally +- Run the `app.bat` file present in `app/bin` + +### Local Storage +- To save the opened note locally, use the keyboard shortcut `Ctrl`+`S` (or optionally, navigate to the `File` option +in the menu bar and click on `Save`) +- To delete the opened note locally, use the keyboard shortcut `Ctrl`+`D` (or optionally, navigate to the `File` option +in the menu bar and click on `Delete`) +- To rename the opened note locally, navigate to the `File` option in the menu bar and click on `Rename` +- To open a locally stored note, navigate to the `File` option in the menu bar and click on `Local Notes` + - To select a local note, double-click the note row to be opened + - Optionally, users can click the note row to be opened and click the `Open` button towards the bottom of the notes + explorer window +- To delete a locally stored note, navigate to the `File` option in the menu bar and click on `Local Notes`. Users must +then click on the note row to be deleted and click the `Open` button towards the bottom of the notes explorer window + +## Remote Storage +- To fetch data from the remotely stored version of the opened note, navigate to the `Sync` option in the menu bar and +click on `Fetch Remote`. Click on `OK` for the dialog prompt. +- To push data to/update data in the remotely stored version of the opened note, navigate to the `Sync` option in the +menu bar and +click on `Update Remote`. Click on `OK` for the dialog prompt. +- To fetch data from a remote note, navigate to the `File` option in the menu bar and +click on `Remote Notes`. Click on the specific note to be fetched from remote and click on the `Fetch` button towards +the bottom of the notes explorer window. +- To delete a remote note navigate to the `File` option in the menu bar and +click on `Remote Notes`. Click on the specific note to be fetched from remote and click on the `Delete` button towards +the bottom of the notes explorer window. + +### Opening a new window +- To open a new note window, navigate to the `File` option in the menu bar and click on `New` + +### Inserting an image +- To insert an image, navigate to the `Insert` option in the menu bar and click on `Insert Image` +- Only `.jpg`, `.jpeg`, and `.png` image file formats are supported +- **Note that attempting to upload an image into a note fails if there is no internet connection!** + +### Dark/Light Theme +- To toggle between light and dark mode, navigate to the `Mode` option in the menu bar and click on `Dark` or `Light` +accordingly + + +## Microservices This notes application makes use of the microservices architecture for storing notes and images - [Notes Microservice](https://git.uwaterloo.ca/a32menon/notes-app-backend) - [Image Microservice](https://git.uwaterloo.ca/a32menon/notes-app-image) ## Installation -- To install Sticky Notes, simply head over to Software Releases and unzip one of our many releases (Sprint 4 being the latest) -- Once the file has been installed and unzipped, the app can be executed by going to the `bin/` directory and running the `./app` command +- To install Sticky Notes, simply head over to Software Releases and unzip one of our many releases +(Sprint 4 being the latest) +- Once the file has been installed and unzipped, the app can be executed by going to the `app/bin/` or `console/bin` +(according to the name of the directory inside the zip package) directory and running the `./app` command ## Technologies This project uses the following technologies: diff --git a/app/src/main/kotlin/notes/multi/app/App.kt b/app/src/main/kotlin/notes/multi/app/App.kt index fa4179d280ab80f9d544ce60b7902d84b932c710..ca3082dccab8c63f42f3092b56ff24a31ee84a35 100644 --- a/app/src/main/kotlin/notes/multi/app/App.kt +++ b/app/src/main/kotlin/notes/multi/app/App.kt @@ -27,20 +27,17 @@ fun main(args: Array<String>) { +-------------------------------------------------------------------------------------+ WELCOME TO TEAM 112'S CONSOLE BASED NOTES APP - This application is a working console-based prototype for the - note taking application that the team will be delivering at the end of the term. - - With this simple app, users can: - 1. Create Notes - 2. Edit Notes - 3. Delete Notes - 4. Close GUI Window + This is a working console-based interface for the GUI notes application created by + Team 112. To access the app through the command line, simply run ./app <ARG> The value of <ARG> can be: - - help: To view the info of the app and list of all notes + - "help": To view the info of the app and list of all notes - Note ID: ID of the target note that is intended to be opened + + The list of notes have been displayed as follows: + Note ID | Name | Last Updated +-------------------------------------------------------------------------------------+ """.trimIndent() diff --git a/app/test.db b/app/test.db index 3486fba3e8a74c9a3ff33e2ca74afec971dbae2a..5e20e2b005809baa5d7afb53c95ca46c0bac0b02 100644 Binary files a/app/test.db and b/app/test.db differ diff --git a/software-releases/app-sprint4.zip b/software-releases/app-sprint4.zip index 26f62db1f526b2a4c8f766840f54ad4189afaa91..377fd1e6961d4e63ee394746a3f91f6d91327fd9 100644 Binary files a/software-releases/app-sprint4.zip and b/software-releases/app-sprint4.zip differ diff --git a/utilities/src/main/kotlin/notes/multi/utilities/notescene.kt b/utilities/src/main/kotlin/notes/multi/utilities/notescene.kt index 7f8794358aae1320fa9e65749f0bfa5162ecb3c7..da39cb92d7df9110a93f8b33cfef65e55b9156b7 100644 --- a/utilities/src/main/kotlin/notes/multi/utilities/notescene.kt +++ b/utilities/src/main/kotlin/notes/multi/utilities/notescene.kt @@ -21,6 +21,7 @@ import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody.Companion.asRequestBody import java.io.File +import java.net.NoRouteToHostException import java.time.LocalDateTime import java.util.* @@ -648,6 +649,11 @@ class notescene(private val stage: Stage, private val lists:GUInote, private val warning.title = "Error in file upload" warning.contentText = e.message warning.showAndWait() + } catch (e: NoRouteToHostException) { + var warning = Alert(Alert.AlertType.ERROR) + warning.title = "No internet connection" + warning.contentText = "You must have an internet connection to upload image!" + warning.showAndWait() } } }