Skip to content

Commit 545dcc4

Browse files
committed
Links to help pages.
1 parent db4fc88 commit 545dcc4

File tree

4 files changed

+43
-28
lines changed

4 files changed

+43
-28
lines changed

flow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
*
3636
*/
3737

38-
#define _GNU_SOURCE // asprintf()
38+
#ifndef _GNU_SOURCE
39+
# define _GNU_SOURCE // asprintf()
40+
#endif
3941

4042
#include "flow.hpp"
4143

iOS/ARViewController.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ - (IBAction)handleMenuButton:(id)sender {
12991299
]];
13001300
[alertController addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:
13011301
^(UIAlertAction *action) {
1302-
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/artoolkit/artoolkit6/wiki/Camera-calibration-iOS"]];
1302+
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/artoolkit/ar6-wiki/wiki/Camera-calibration-iOS"]];
13031303
}
13041304
]];
13051305
[alertController addAction:[UIAlertAction actionWithTitle:@"Print" style:UIAlertActionStyleDefault handler:

macOS/PrefsWindowController.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ - (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url
301301

302302
-(void) showHelp:(id)sender
303303
{
304-
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/artoolkit/artoolkit6/wiki/Camera-calibration-macOS"]];
304+
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/artoolkit/ar6-wiki/wiki/Camera-calibration-macOS"]];
305305
}
306306

307307
@end

prefsLibConfig.cpp

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ void *showPreferencesThread(void *arg)
166166
{
167167
enum state {
168168
PREFS_BEGIN,
169+
PREFS_OPTION_HELP,
169170
PREFS_OPTION_CAMERA,
170171
PREFS_OPTION_CALIB_SAVE,
171172
PREFS_OPTION_CALIB_SAVE_DIR,
@@ -196,21 +197,22 @@ void *showPreferencesThread(void *arg)
196197
const char prompt[] =
197198
"Preferences\n"
198199
"\n"
199-
"1. Camera.\n"
200-
"2. Save calibration on/off.\n"
201-
"3. Save calibration destination directory.\n"
200+
"1. Help.\n"
201+
"2. Camera.\n"
202+
"3. Save calibration on/off.\n"
203+
"4. Save calibration destination directory.\n"
202204
#if defined(ARTOOLKIT6_CSUU) && defined(ARTOOLKIT6_CSAT)
203-
"4. Upload calibration to artoolkit.org on/off.\n"
204-
"5. Calibration pattern type.\n"
205-
"6. Calibration pattern size.\n"
206-
"7. Calibration pattern spacing.\n"
205+
"5. Upload calibration to artoolkit.org on/off.\n"
206+
"6. Calibration pattern type.\n"
207+
"7. Calibration pattern size.\n"
208+
"8. Calibration pattern spacing.\n"
207209
#else
208-
"4. Upload calibration to my server on/off.\n"
209-
"5. My calibration server URL.\n"
210-
"6. My calibration server authentication token.\n"
211-
"7. Calibration pattern type.\n"
212-
"8. Calibration pattern size.\n"
213-
"9. Calibration pattern spacing.\n"
210+
"5. Upload calibration to my server on/off.\n"
211+
"6. My calibration server URL.\n"
212+
"7. My calibration server authentication token.\n"
213+
"8. Calibration pattern type.\n"
214+
"9. Calibration pattern size.\n"
215+
"10. Calibration pattern spacing.\n"
214216
#endif
215217
"\n"
216218
"Press [esc] to finish or type number and press [return] ";
@@ -222,22 +224,33 @@ void *showPreferencesThread(void *arg)
222224
state = PREFS_END;
223225
} else {
224226
free(inputa);
225-
if (inputi == 1) state = PREFS_OPTION_CAMERA;
226-
else if (inputi == 2) state = PREFS_OPTION_CALIB_SAVE;
227-
else if (inputi == 3) state = PREFS_OPTION_CALIB_SAVE_DIR;
228-
else if (inputi == 4) state = PREFS_OPTION_CALIB_UPLOAD;
227+
if (inputi == 1) state = PREFS_OPTION_HELP;
228+
else if (inputi == 2) state = PREFS_OPTION_CAMERA;
229+
else if (inputi == 3) state = PREFS_OPTION_CALIB_SAVE;
230+
else if (inputi == 4) state = PREFS_OPTION_CALIB_SAVE_DIR;
231+
else if (inputi == 5) state = PREFS_OPTION_CALIB_UPLOAD;
229232
#if defined(ARTOOLKIT6_CSUU) && defined(ARTOOLKIT6_CSAT)
230-
else if (inputi == 5) state = PREFS_OPTION_CALIB_PATT_TYPE;
231-
else if (inputi == 6) state = PREFS_OPTION_CALIB_PATT_SIZE;
232-
else if (inputi == 7) state = PREFS_OPTION_CALIB_PATT_SPACING;
233+
else if (inputi == 6) state = PREFS_OPTION_CALIB_PATT_TYPE;
234+
else if (inputi == 7) state = PREFS_OPTION_CALIB_PATT_SIZE;
235+
else if (inputi == 8) state = PREFS_OPTION_CALIB_PATT_SPACING;
233236
#else
234-
else if (inputi == 5) state = PREFS_OPTION_CSUU;
235-
else if (inputi == 6) state = PREFS_OPTION_CSAT;
236-
else if (inputi == 7) state = PREFS_OPTION_CALIB_PATT_TYPE;
237-
else if (inputi == 8) state = PREFS_OPTION_CALIB_PATT_SIZE;
238-
else if (inputi == 9) state = PREFS_OPTION_CALIB_PATT_SPACING;
237+
else if (inputi == 6) state = PREFS_OPTION_CSUU;
238+
else if (inputi == 7) state = PREFS_OPTION_CSAT;
239+
else if (inputi == 8) state = PREFS_OPTION_CALIB_PATT_TYPE;
240+
else if (inputi == 9) state = PREFS_OPTION_CALIB_PATT_SIZE;
241+
else if (inputi == 10) state = PREFS_OPTION_CALIB_PATT_SPACING;
239242
#endif
240243
}
244+
} else if (state == PREFS_OPTION_HELP) {
245+
int ret = system("which xdg-open");
246+
if (ret != 0) {
247+
EdenMessageInput((const unsigned char *)"Unable to open help (missing xdg-open command). Press [return] to continue. ", 0, 0, 0, 0, 0);
248+
inputa = EdenMessageInputGetInput();
249+
free(inputa);
250+
} else {
251+
system("xdg-open https://github.com/artoolkit/ar6-wiki/wiki/Camera-calibration-Linux");
252+
}
253+
state = PREFS_BEGIN;
241254
} else if (state == PREFS_OPTION_CAMERA) {
242255
ARVideoSourceInfoListT *sil = ar2VideoCreateSourceInfoList("");
243256
if (!sil) {

0 commit comments

Comments
 (0)