waveview/src/gawhelp.c

70 lines
1.1 KiB
C
Raw Normal View History

2022-09-24 17:47:18 -04:00
/*
* gawhelp.c -
* This file is part of gaw Gtk Analog Wave viewer
*
* include LICENSE
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
// #include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gaw.h>
2024-06-15 11:58:18 -04:00
2022-09-24 17:47:18 -04:00
#ifdef TRACE_MEM
#include <tracemem.h>
#endif
2024-06-15 11:58:18 -04:00
2022-09-24 17:47:18 -04:00
void ah_show_page (UserData *ud, char *url )
{
2024-06-15 11:58:18 -04:00
char *envcmd = getenv("GAW_HELPCMD");
char *cmd = ud->up->helpCmd;
char *fmt;
char *cmdline;
2022-09-24 17:47:18 -04:00
2024-06-15 11:58:18 -04:00
if ( envcmd ) {
cmd = envcmd;
}
if ( app_strstr(cmd, "%s") ) {
fmt = app_strdup(cmd);
} else {
fmt = g_strconcat ( cmd, " %s", NULL);
}
cmdline = g_strdup_printf( fmt, url);
msg_dbg("cmdline '%s'\n", cmdline);
system( cmdline);
g_free(fmt);
g_free(cmdline);
2022-09-24 17:47:18 -04:00
}
2024-06-15 11:58:18 -04:00
2022-09-24 17:47:18 -04:00
void ah_show_userguide_dialog (UserData *ud)
{
2024-06-15 11:58:18 -04:00
char *envurl = getenv( "GAW_USERGUIDE");
char *url = ud->up->userGuide;
if ( envurl) {
url = envurl;
}
ah_show_page (ud, url );
2022-09-24 17:47:18 -04:00
}
void ah_show_website_dialog (UserData *ud)
{
2024-06-15 11:58:18 -04:00
char *envurl = getenv( "GAW_WEBSITE");
char *url = ud->up->webSite;
if ( envurl) {
url = envurl;
}
ah_show_page (ud, url );
2022-09-24 17:47:18 -04:00
}