Commit 2cf4b56a authored by Claes Sjofors's avatar Claes Sjofors

Xtt eventlog window bugfix when opened for specific object

parent 38d4a0dd
......@@ -425,7 +425,7 @@ HistGtk::HistGtk( void *hist_parent_ctx,
GtkWidget *hist_pane = gtk_vpaned_new();
// Create hist
hist = new EvListGtk( this, hist_pane, ev_eType_HistList, hist_size, 0, &hist_widget);
hist = new EvListGtk( this, hist_pane, ev_eType_HistList, hist_size, 0, &hist_widget, hist_init_cb);
hist->start_trace_cb = &hist_start_trace_cb;
hist->display_in_xnav_cb = &hist_display_in_xnav_cb;
hist->popup_menu_cb = &hist_popup_menu_cb;
......@@ -443,24 +443,9 @@ HistGtk::HistGtk( void *hist_parent_ctx,
gtk_paned_set_position( GTK_PANED(hist_pane), 300);
// Init start and stop time
pwr_tStatus sts;
pwr_tAName name_str;
gint pos = 0;
((Hist *)this)->all_cb();
// If objid is applied, search for this object
pos = 0;
if ( arp && cdh_ObjidIsNotNull(arp->Objid)) {
sts = gdh_AttrrefToName( arp, name_str, sizeof(name_str), cdh_mName_pathStrict);
if (ODD(sts)) {
gtk_editable_insert_text( GTK_EDITABLE(event_name_entry_w), name_str,
strlen(name_str), &pos);
this->eventName_str = name_str;
get_hist_list();
}
}
wow = new CoWowGtk( parent_wid_hist);
*status = 1;
......@@ -702,6 +687,14 @@ void HistGtk::set_search_string( const char *s1, const char *s2,
gtk_label_set_text( GTK_LABEL(this->search_string4_lbl_w), CoWowGtk::convert_utf8(s4));
}
void HistGtk::insert_eventname( const char *name)
{
int pos = 0;
gtk_editable_insert_text( GTK_EDITABLE(event_name_entry_w), name,
strlen(name), &pos);
}
/************************************************************************
*
......
......@@ -83,6 +83,7 @@ class HistGtk : public Hist {
const char *s3, const char *s4);
void SetListTime( pwr_tTime StartTime, pwr_tTime StopTime,
int Sensitive);
void insert_eventname( const char *name);
static gboolean action_inputfocus( GtkWidget *w, GdkEvent *event, gpointer data);
static void activate_exit( GtkWidget *w, gpointer data);
......
......@@ -96,6 +96,10 @@ Hist::Hist( void *hist_parent_ctx,
eventType_Unblock(false), eventType_Reblock(false),
eventType_CancelBlock(false)
{
if ( arp)
aref = *arp;
else
memset( &aref, 0, sizeof(aref));
}
......@@ -1020,6 +1024,23 @@ pwr_tStatus Hist::AdjustForDayBreak( Hist *histOP, pwr_tTime *Time,
return 1;
} /* AdjustForDayBreak */
void Hist::hist_init_cb( void *ctx)
{
Hist *hist = (Hist *)ctx;
pwr_tAName name_str;
pwr_tStatus sts;
// If objid is applied, search for this object
if ( cdh_ObjidIsNotNull( hist->aref.Objid)) {
sts = gdh_AttrrefToName( &hist->aref, name_str, sizeof(name_str), cdh_mName_pathStrict);
if (ODD(sts)) {
hist->insert_eventname( name_str);
hist->eventName_str = name_str;
hist->get_hist_list();
}
}
}
#endif
#endif
......
......@@ -100,6 +100,7 @@ class Hist {
bool eventType_Reblock;
bool eventType_CancelBlock;
CoWow *wow;
pwr_tAttrRef aref;
void get_hist_list();
pwr_tStatus hist_add_ack_mess( mh_sAck *MsgP);
......@@ -116,6 +117,7 @@ class Hist {
const char *s3, const char *s4) {}
virtual void SetListTime( pwr_tTime StartTime, pwr_tTime StopTime,
int Sensitive) {}
virtual void insert_eventname( const char *name) {}
void activate_print();
......@@ -146,6 +148,7 @@ class Hist {
unsigned long item_type, unsigned long utility,
char *arg, int x, int y);
static void help_event_cb( void *ctx, void *item);
static void hist_init_cb( void *ctx);
};
#else
......@@ -163,6 +166,7 @@ class Hist {
void (*help_cb)( void *, const char *);
void (*popup_menu_cb)( void *, pwr_sAttrRef, unsigned long,
unsigned long, char *, int x, int y);
};
#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