Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

allezxandre/Syncthing-Mac

Repository files navigation

Logo Syncthing

Syncthing GUI for Mac

This is a Mac OS GUI for Syncthing (an open-source, P2P, file syncing software on GitHub), made in Swift.

Interactions with the REST API are following the documentation.

I'm nowhere near experienced in Swift, and this project was intended as a way to learn Mac OS app development. Please excuse my use of the French language in the code, I didn't intend to share the code at first.

Building

This project uses Swift 2.0 syntax. You'll need Xcode 7 to build it.

Open Syncthing GUI.xcworkspace and build.

Do not use Syncthing GUI.xcodeproj for building

This project uses Cocoapods to manage librairies, but everything is commited to the git repository, so building should be as easy as pressing "Build" in Xcode after a git pull.

Current librairies in use:

  1. Alamofire --- an HTTP networking library
  2. SwiftyJSON --- a JSON manipulation library

Status

Operational:

  • Syncthing communication system
  • Basic folder layout
  • Settings panel
  • Periodic refresh (1 sec when front window)

Broken:

  • The refresh button on the toolbar
  • Path representation for Remote syncthing servers
  • "Out of Sync" status (I just didn't implement it)

WIP:

  • File list view
  • Periodic refresh in background

Programming

Here I'll write the main ideas behind the structure of the code:

  • Syncthing objects are in the SyncthingObject.swift file. The documentation doesn't provide very accurate descriptions, so (almost) all objects are based on examples from the documentation.
  • The RestApi.swift file handles the REST interactions. It uses one main function that handles GET and POST requests to interact with Syncthing. They are called by functions that provide a callback function.
  • For ambiguous classes, variables and functions, I use the following syntax so that Xcode knows how to document the Quick Help :
/** 
Description 

-parameter parameter1: Description
-returns returnType: Description
*/
func name(parameter1: Type...) -> ReturnType { ... }
  • The CustomStringConvertible class provides the var description: String variable for use with log commands like NSLog and print.

License

Creative Commons License
This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/).

About

A Syncthing GUI in Swift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published