Commit 937ae7eb authored by Claes Sjofors's avatar Claes Sjofors

Xtt trace, toolbar button to open parent trace window

parent 884c8b73
......@@ -112,6 +112,13 @@ void RtTraceGtk::activate_display_object(GtkWidget *w, gpointer data)
tractx->activate_display_object();
}
void RtTraceGtk::activate_parent_window(GtkWidget *w, gpointer data)
{
RtTrace *tractx = (RtTrace *)data;
tractx->activate_parent_window();
}
void RtTraceGtk::activate_collect_insert(GtkWidget *w, gpointer data)
{
RtTrace *tractx = (RtTrace *)data;
......@@ -312,6 +319,8 @@ RtTraceGtk::RtTraceGtk( void *tr_parent_ctx, GtkWidget *tr_parent_wid, pwr_tObji
pwr_tAName hostname;
pwr_tOName plcconnect;
pwr_tFileName fname;
pwr_tObjid parent;
pwr_tCid parent_cid;
sts = gdh_ObjidToName( tr_objid, name, sizeof(name), cdh_mNName);
if (EVEN(sts)) {
......@@ -613,6 +622,20 @@ RtTraceGtk::RtTraceGtk( void *tr_parent_ctx, GtkWidget *tr_parent_wid, pwr_tObji
// Toolbar
GtkToolbar *tools = (GtkToolbar *) g_object_new(GTK_TYPE_TOOLBAR, NULL);
// Open parent window for subwindows
sts = gdh_GetParent( objid, &parent);
if ( ODD(sts)) {
sts = gdh_GetObjectClass( parent, &parent_cid);
if ( ODD(sts) && parent_cid != pwr_cClass_plc) {
GtkWidget *tools_parent_window = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_up.png");
gtk_container_add( GTK_CONTAINER(tools_parent_window),
gtk_image_new_from_file( fname));
g_signal_connect(tools_parent_window, "clicked", G_CALLBACK(activate_parent_window), this);
gtk_toolbar_append_widget( tools, tools_parent_window, "Open parent window", "");
}
}
GtkWidget *tools_display_object = gtk_button_new();
dcli_translate_filename( fname, "$pwr_exe/xtt_navigator.png");
gtk_container_add( GTK_CONTAINER(tools_display_object),
......@@ -722,4 +745,4 @@ RtTraceGtk::RtTraceGtk( void *tr_parent_ctx, GtkWidget *tr_parent_wid, pwr_tObji
sprintf( msg, "Trace file is older than database version\n(%s < %s)", flow_version_str, window_version_str);
wow->DisplayError( "Version mismatch", msg);
}
}
\ No newline at end of file
}
......@@ -66,6 +66,7 @@ class RtTraceGtk : public RtTrace {
static void activate_savetrace(GtkWidget *w, gpointer data);
static void activate_restoretrace(GtkWidget *w, gpointer data);
static void activate_cleartrace(GtkWidget *w, gpointer data);
static void activate_parent_window(GtkWidget *w, gpointer data);
static void activate_display_object(GtkWidget *w, gpointer data);
static void activate_collect_insert(GtkWidget *w, gpointer data);
static void activate_open_object(GtkWidget *w, gpointer data);
......@@ -88,4 +89,4 @@ class RtTraceGtk : public RtTrace {
static void activate_helpplclist(GtkWidget *w, gpointer data);
};
#endif
\ No newline at end of file
#endif
......@@ -470,6 +470,29 @@ void RtTrace::activate_cleartrace()
flow_RemoveTraceObjects( flow_ctx);
}
void RtTrace::activate_parent_window()
{
int sts;
pwr_tAttrRef attrref;
pwr_tOid parent;
xmenu_eItemType itemtype;
sts = gdh_GetParent( objid, &parent);
if ( EVEN(sts)) return;
itemtype = xmenu_eItemType_Object;
attrref = cdh_ObjidToAref( parent);
if ( call_method_cb) {
(call_method_cb)( parent_ctx,
"$Object-OpenTrace",
"$Object-OpenTraceFilter",
attrref,
itemtype,
xmenu_mUtility_XNav, NULL);
}
}
void RtTrace::activate_display_object()
{
flow_tObject node;
......@@ -1578,4 +1601,4 @@ RtTrace::RtTrace( void *tr_parent_ctx, pwr_tObjid tr_objid,
display_object_cb(0), collect_insert_cb(0), is_authorized_cb(0), popup_menu_cb(0),
call_method_cb(0), trace_list(0), version(0), m_has_host(0), wow(0)
{
}
\ No newline at end of file
}
......@@ -113,6 +113,7 @@ class RtTrace {
void activate_savetrace();
void activate_restoretrace();
void activate_cleartrace();
void activate_parent_window();
void activate_display_object();
void activate_collect_insert();
void activate_open_object();
......@@ -155,4 +156,4 @@ class RtTrace {
};
#endif
\ No newline at end of file
#endif
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