Commit 94263582 authored by Claes Sjofors's avatar Claes Sjofors

Help menu links updated

parent d650a2d5
......@@ -597,7 +597,7 @@ void RtTrace::activate_view()
void RtTrace::activate_help()
{
if ( help_cb)
(help_cb)(this, "trace");
(help_cb)(this, "opg_trace");
}
void RtTrace::activate_helpplc()
......
......@@ -3081,6 +3081,9 @@ void WNav::refresh()
void WNav::select_object( brow_tObject object)
{
if ( !object_exist( object))
return;
if ( set_focus_cb)
(set_focus_cb)( parent_ctx, this);
......
......@@ -458,6 +458,16 @@ void XttGtk::activate_help_project( GtkWidget *w, gpointer data)
xtt->activate_help_project();
}
void XttGtk::activate_help_navigator( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_help_navigator();
}
void XttGtk::activate_help_proview( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
......@@ -817,6 +827,10 @@ XttGtk::XttGtk( int argc, char *argv[], int *return_sts) :
gtk_widget_add_accelerator( help_overview, "activate", accel_g,
'h', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *help_navigator = gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Navigator"));
g_signal_connect( help_navigator, "activate",
G_CALLBACK(XttGtk::activate_help_navigator), this);
GtkWidget *help_project = gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Project"));
g_signal_connect( help_project, "activate",
G_CALLBACK(XttGtk::activate_help_project), this);
......@@ -827,6 +841,7 @@ XttGtk::XttGtk( int argc, char *argv[], int *return_sts) :
GtkMenu *help_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(help_menu), help_overview);
gtk_menu_shell_append(GTK_MENU_SHELL(help_menu), help_navigator);
gtk_menu_shell_append(GTK_MENU_SHELL(help_menu), help_project);
gtk_menu_shell_append(GTK_MENU_SHELL(help_menu), help_proview);
......
......@@ -95,6 +95,7 @@ class XttGtk : public Xtt {
static void activate_zoom_out( GtkWidget *w, gpointer data);
static void activate_zoom_reset( GtkWidget *w, gpointer data);
static void activate_help( GtkWidget *w, gpointer data);
static void activate_help_navigator( GtkWidget *w, gpointer data);
static void activate_help_project( GtkWidget *w, gpointer data);
static void activate_help_proview( GtkWidget *w, gpointer data);
static void activate_back( GtkWidget *w, gpointer data);
......
......@@ -106,6 +106,7 @@ class Xtt {
void activate_zoom_in();
void activate_zoom_out();
void activate_help();
void activate_help_navigator();
void activate_help_project();
void activate_help_proview();
void activate_method( char *method, char *filter);
......
......@@ -443,6 +443,11 @@ void Xtt::activate_help_project()
CoXHelp::dhelp("index", "", navh_eHelpFile_Project, NULL, 0);
}
void Xtt::activate_help_navigator()
{
CoXHelp::dhelp("opg_navigator", "", navh_eHelpFile_Other, "$pwr_lang/man_opg.dat", 0);
}
void Xtt::activate_help_proview()
{
CoXHelp::dhelp( "version", "", navh_eHelpFile_Other, "$pwr_exe/xtt_version_help.dat", 0);
......
......@@ -257,7 +257,7 @@ EvGtk::EvGtk( void *ev_parent_ctx,
gtk_widget_add_accelerator( help_help, "activate", accel_g,
'h', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *help_helpevent = gtk_check_menu_item_new_with_mnemonic(
GtkWidget *help_helpevent = gtk_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("Help Selected Event"));
g_signal_connect( help_helpevent, "activate",
G_CALLBACK(eve_activate_helpevent), this);
......@@ -430,7 +430,7 @@ EvGtk::EvGtk( void *ev_parent_ctx,
gtk_widget_add_accelerator( help_help, "activate", accel_g,
'h', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *help_helpevent = gtk_check_menu_item_new_with_mnemonic(
GtkWidget *help_helpevent = gtk_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("Help Selected Event"));
g_signal_connect( help_helpevent, "activate",
G_CALLBACK(ala_activate_helpevent), this);
......@@ -635,6 +635,8 @@ EvGtk::EvGtk( void *ev_parent_ctx,
g_object_set( parent_wid_blk, "visible", FALSE, NULL);
}
wow = new CoWowGtk( parent_wid_ala);
sts = outunit_connect( user);
if ( EVEN(sts))
*status = sts;
......
......@@ -220,7 +220,7 @@ HistGtk::HistGtk( void *hist_parent_ctx,
gtk_widget_add_accelerator( help_help, "activate", accel_g,
'h', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *help_helpevent = gtk_check_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("Help Selected Event"));
GtkWidget *help_helpevent = gtk_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("Help Selected Event"));
g_signal_connect( help_helpevent, "activate",
G_CALLBACK(activate_helpevent), this);
......@@ -453,6 +453,8 @@ HistGtk::HistGtk( void *hist_parent_ctx,
get_hist_list();
}
wow = new CoWowGtk( parent_wid_hist);
*status = 1;
}
......
......@@ -281,7 +281,7 @@ OpGtk::OpGtk( void *op_parent_ctx,
GtkWidget *tools_help = gtk_button_new();
gtk_container_add( GTK_CONTAINER(tools_help),
gtk_image_new_from_stock( "gtk-help", GTK_ICON_SIZE_SMALL_TOOLBAR));
g_signal_connect(tools_help, "clicked", G_CALLBACK(activate_help), this);
g_signal_connect(tools_help, "clicked", G_CALLBACK(activate_help_overview), this);
gtk_toolbar_append_widget( GTK_TOOLBAR(tools), tools_help, "Help", "");
GtkWidget *tools_navigator = gtk_button_new();
......@@ -866,6 +866,13 @@ void OpGtk::activate_help( GtkWidget *w, gpointer data)
op->activate_help();
}
void OpGtk::activate_help_overview( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
op->activate_help_overview();
}
void OpGtk::activate_appl1( GtkWidget *w, gpointer data)
{
Op *op = (Op*)data;
......
......@@ -78,6 +78,7 @@ class OpGtk : public Op {
static void activate_eventlog( GtkWidget *w, gpointer data);
static void activate_navigator( GtkWidget *w, gpointer data);
static void activate_help( GtkWidget *w, gpointer data);
static void activate_help_overview( GtkWidget *w, gpointer data);
static void activate_appl1( GtkWidget *w, gpointer data);
static void activate_appl2( GtkWidget *w, gpointer data);
static void activate_appl3( GtkWidget *w, gpointer data);
......
......@@ -296,6 +296,8 @@ EvMotif::EvMotif( void *ev_parent_ctx,
flow_AddCloseVMProtocolCb( parent_wid_blk,
(XtCallbackProc)blk_activate_exit, this);
wow = new CoWowMotif( toplevel_ala);
// Store this for the mh callbacks
ev = this;
......
......@@ -247,6 +247,7 @@ HistMotif::HistMotif( void *hist_parent_ctx,
}
}
wow = new CoWowMotif( parent_wid_hist);
}
......
......@@ -70,7 +70,7 @@ void CLog::activate_prev_file()
void CLog::activate_help()
{
if ( help_cb)
(help_cb)( parent_ctx, "consolelog");
(help_cb)( parent_ctx, "opg_nav_systemmsg");
}
......
......@@ -27,6 +27,7 @@
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "co_wow.h"
#include "pwr_baseclasses.h"
#include "rt_gdh.h"
#include "rt_mh.h"
......@@ -180,43 +181,47 @@ void Ev::eve_activate_ack_last()
void Ev::eve_activate_help()
{
if ( help_cb)
(help_cb)( parent_ctx, "eventlist");
(help_cb)( parent_ctx, "opg_eventlist");
}
void Ev::eve_activate_helpevent()
{
char eventname[80];
int sts;
ItemAlarm *item;
if ( help_cb) {
sts = ev->eve->get_selected_event( eventname);
if( ODD(sts))
(help_cb)( parent_ctx, eventname);
sts = ev->eve->get_selected_event( eventname, &item);
if( ODD(sts)) {
wow->DisplayText( eventname, item->eventmoretext);
}
}
}
void Ev::ala_activate_help()
{
if ( help_cb)
(help_cb)( parent_ctx, "alarmlist");
(help_cb)( parent_ctx, "opg_alarmlist");
}
void Ev::ala_activate_helpevent()
{
char eventname[80];
int sts;
ItemAlarm *item;
if ( help_cb) {
sts = ala->get_selected_event( eventname);
if( ODD(sts))
(help_cb)( parent_ctx, eventname);
sts = ala->get_selected_event( eventname, &item);
if( ODD(sts)) {
wow->DisplayText( eventname, item->eventmoretext);
}
}
}
void Ev::blk_activate_help()
{
if ( help_cb)
(help_cb)( parent_ctx, "blocklist");
(help_cb)( parent_ctx, "opg_blocklist");
}
int Ev::get_alarm_info( evlist_sAlarmInfo *info)
......
......@@ -30,6 +30,8 @@
# include "xtt_evlist.h"
#endif
class CoWow;
typedef struct {
char Object[120];
char Alias[8];
......@@ -77,6 +79,7 @@ class Ev {
int ala_size;
int blk_size;
ev_sAlias alias_list[20];
CoWow *wow;
static Ev *ev;
virtual void map_eve() {}
......
......@@ -1738,22 +1738,21 @@ void EvList::ack( mh_sEventId *id)
}
}
int EvList::get_selected_event( char *eventname)
int EvList::get_selected_event( char *eventname, ItemAlarm **item)
{
brow_tNode *node_list;
int node_count;
ItemAlarm *item;
brow_GetSelectedNodes( brow->ctx, &node_list, &node_count);
if ( !node_count)
return 0;
brow_GetUserData( node_list[0], (void **)&item);
brow_GetUserData( node_list[0], (void **)item);
free( node_list);
switch( item->type)
switch( (*item)->type)
{
case evlist_eItemType_Alarm:
strcpy( eventname, item->eventname);
strcpy( eventname, (*item)->eventname);
break;
default:
return 0;
......
......@@ -50,6 +50,8 @@
#include "flow_browapi.h"
#endif
class ItemAlarm;
#define ALARM_INFO_A_SIZE 5
#define ALARM_INFO_B_SIZE 2
#define ALARM_INFO_C_SIZE 2
......@@ -188,7 +190,7 @@ class EvList {
void set_hide_text( int value);
int get_alarm_info( evlist_sAlarmInfo *info);
int get_last_not_acked_prio( mh_sEventId **id, unsigned long type, unsigned long prio);
int get_selected_event( char *eventname);
int get_selected_event( char *eventname, ItemAlarm **item);
int get_destination( pwr_tTime time, void **dest);
void block_remove();
void print( char *filename);
......
......@@ -211,7 +211,7 @@ void XttFast::fast_help_cb( void *ctx)
XttFast *fast = (XttFast *) ctx;
if ( fast->help_cb)
(fast->help_cb)( fast->xnav, "fastwindow");
(fast->help_cb)( fast->xnav, "opg_fastcurves");
}
void XttFast::fast_scan( void *data)
......
......@@ -36,6 +36,7 @@ using namespace std;
extern "C" {
#include "co_cdh.h"
#include "co_time.h"
#include "co_wow.h"
#include "pwr_baseclasses.h"
#include "rt_gdh.h"
#include "rt_mh.h"
......@@ -119,18 +120,20 @@ void Hist::activate_print()
void Hist::activate_help()
{
if ( help_cb)
(help_cb)( parent_ctx, "histlist");
(help_cb)( parent_ctx, "opg_eventlog");
}
void Hist::activate_helpevent()
{
char eventname[80];
int sts;
ItemAlarm *item;
if ( help_cb) {
sts = hist->get_selected_event( eventname);
if( ODD(sts))
(help_cb)( parent_ctx, eventname);
sts = hist->get_selected_event( eventname, &item);
if( ODD(sts)) {
wow->DisplayText( eventname, item->eventmoretext);
}
}
}
......
......@@ -39,6 +39,8 @@ extern "C" {
#endif
#define ERROR_TIME_CONVERT -99
class CoWow;
class Hist {
public:
Hist( void *hist_parent_ctx,
......@@ -80,6 +82,7 @@ class Hist {
bool eventType_Unblock;
bool eventType_Reblock;
bool eventType_CancelBlock;
CoWow *wow;
void get_hist_list();
pwr_tStatus hist_add_ack_mess( mh_sAck *MsgP);
......
......@@ -143,6 +143,12 @@ void Op::activate_help()
help_cb( parent_ctx, "index");
}
void Op::activate_help_overview()
{
if ( help_cb)
help_cb( parent_ctx, "overview");
}
void Op::jop_command_cb( void *op, char *command)
{
if ( ((Op *)op)->command_cb)
......
......@@ -80,6 +80,7 @@ class Op {
void activate_eventlog();
void activate_navigator();
void activate_help();
void activate_help_overview();
static void jop_command_cb( void *op, char *command);
};
......
......@@ -240,7 +240,7 @@ void XttSevHist::sevhist_help_cb( void *ctx)
XttSevHist *sevhist = (XttSevHist *) ctx;
if ( sevhist->help_cb)
(sevhist->help_cb)( sevhist->xnav, "sevhistwindow");
(sevhist->help_cb)( sevhist->xnav, "opg_history");
}
void XttSevHist::sevhist_scan( void *data)
......
......@@ -273,7 +273,7 @@ void XttTrend::trend_help_cb( void *ctx)
XttTrend *trend = (XttTrend *) ctx;
if ( trend->help_cb)
(trend->help_cb)( trend->xnav, "trendwindow");
(trend->help_cb)( trend->xnav, "opg_trend");
}
void XttTrend::trend_scan( void *data)
......
......@@ -6748,6 +6748,8 @@ static void xnav_op_help_cb( void *ctx, const char *key)
int sts;
sts = CoXHelp::dhelp( key, "", navh_eHelpFile_Project, NULL, 0);
if ( EVEN(sts))
sts = CoXHelp::dhelp( key, "", navh_eHelpFile_Base, NULL, 0);
if ( EVEN(sts))
xnav->message( 'E', "Unable to find topic");
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment