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 menu option for save watch configs #258

Merged
merged 9 commits into from
Oct 24, 2020

Conversation

MartinNievas
Copy link
Contributor

This PR adds a menu entry in openambit app, to save watch config and apps, on a JSON file. This PR is related to #256

Add sync menu option for synchronizing watch apps

  • The option is "Save configuration for the watch (JSON file)"
  • When this option is activated, watch apps and settings will be stored on openambit config folder as JSON files (apprules and settings"

As this is a large patch, I explain what the functions do. Any advice will be well accepted :D

  • getWatchAppConfig
    • Will read and store watch apps on apprules.json file
  • getWatchModeConfig
    • Will read and store watch settings on settings.json
  • writeJson
    • This function writes the current settings and apps to JSON files as part of regular syncing in CLI or GUI.
    • Files are saved in openambit config folder.

As a comment, I noticed that my APPKEY is different. To connect with movescount, you need to change this.

Vasco Tenner and others added 7 commits February 10, 2019 17:54
Additional installation instructions for ubuntu.
- This write the current settings and apps to JSON files as part of regular syncing in CLI or GUI.
- Files are saved in the same place as openambit.conf
- The entry is "Save configuration for the watch (JSON file)"
- When this option is activated, watch aps and settings will be stored
on openambit config folder as JSON files (apprules and settings"
Copy link
Contributor

@centic9 centic9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very nice and ready for merging in general, just a few minor things that we could clean up.

build.sh Outdated
if [ "$DO_INSTALL" == "1" ]; then
echo "------installing $target------"
sudo make install
sudo ldconfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some unrelated newline/blank changes, maybe you can revert them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will revert them

QJsonDocument doc = QJsonDocument::fromJson(_data);
QString formattedJsonString = doc.toJson(QJsonDocument::Indented);

//formattedJsonString.replace("", "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can remove this commented code here

@@ -0,0 +1 @@
personal_config.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this gitignore useful in general or just a leftover?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a leftover. I used to store a different APPKEY there, because on Task.cpp I had:

+#include "personal_config.h"
+++ b/src/openambit-cli/Task.cpp
@@ -7,8 +7,11 @@
 #include <movescount/logstore.h>
 #include <movescount/movescountxml.h>
 #include <libambit_int.h>
+#include "personal_config.h"
 
-#define APPKEY                 "HpF9f1qV5qrDJ1hY1QK1diThyPsX10Mh4JvCw9xVQSglJNLdcwr3540zFyLzIC3e"
+#ifndef APPKEY
+  #define APPKEY                 "HpF9f1qV5qrDJ1hY1QK1diThyPsX10Mh4JvCw9xVQSglJNLdcwr3540zFyLzIC3e"
+#endif
 #define MOVESCOUNT_DEFAULT_URL "https://uiservices.movescount.com/"

- Revert unrelated newline/blank changes.
- Remove commented code.
- Remove .gitingnoe on src/openambit-cli/.gitignore
Copy link
Contributor

@centic9 centic9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's good to go.

Thanks for the contribution!

@centic9 centic9 merged commit 54d925f into openambitproject:master Oct 24, 2020
@centic9
Copy link
Contributor

centic9 commented Oct 24, 2020

The command-line application now also learned this, see commit 6c3c781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants