Commit d98ce426 authored by claes's avatar claes

Login added

parent 2ffdd2dd
/*
* Proview $Id: rt_xtt_gtk.cpp,v 1.14 2008-06-03 06:12:43 claes Exp $
* Proview $Id: rt_xtt_gtk.cpp,v 1.15 2008-06-24 08:05:25 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -222,6 +222,9 @@ void XttGtk::activate_change_value( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->open_change_value();
}
......@@ -229,6 +232,9 @@ void XttGtk::activate_command( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
if ( xtt->command_open) {
g_object_set( ((XttGtk *)xtt)->cmd_input, "visible", FALSE, NULL);
xtt->set_prompt( "");
......@@ -260,13 +266,33 @@ void XttGtk::activate_print( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_print();
}
void XttGtk::activate_login( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
xtt->xnav->open_login();
}
void XttGtk::activate_logout( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
xtt->xnav->logout();
}
void XttGtk::activate_find( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_find();
}
......@@ -274,6 +300,9 @@ void XttGtk::activate_findregex( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_findregex();
}
......@@ -281,6 +310,9 @@ void XttGtk::activate_findnext( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_findnext();
}
......@@ -288,6 +320,9 @@ void XttGtk::activate_collapse( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_collapse();
}
......@@ -295,6 +330,9 @@ void XttGtk::activate_openobject( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_openobject();
}
......@@ -302,6 +340,9 @@ void XttGtk::activate_openplc( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_openplc();
}
......@@ -309,6 +350,9 @@ void XttGtk::activate_showcrossref( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->xnav->show_crossref();
}
......@@ -316,6 +360,9 @@ void XttGtk::activate_opengraph( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_opengraph();
}
......@@ -323,6 +370,9 @@ void XttGtk::activate_collect_insert( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_collect_insert();
}
......@@ -330,6 +380,9 @@ void XttGtk::activate_collect_show( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->xnav->collect_show();
}
......@@ -337,6 +390,9 @@ void XttGtk::activate_collect_remove( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->xnav->collect_remove();
}
......@@ -344,6 +400,9 @@ void XttGtk::activate_collect_clear( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->xnav->collect_clear();
}
......@@ -351,6 +410,9 @@ void XttGtk::activate_advanceduser( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_advanceduser();
}
......@@ -379,6 +441,9 @@ void XttGtk::activate_help( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_help();
}
......@@ -386,6 +451,9 @@ void XttGtk::activate_help_project( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_help_project();
}
......@@ -393,6 +461,9 @@ void XttGtk::activate_help_proview( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->activate_help_proview();
}
......@@ -400,6 +471,9 @@ void XttGtk::activate_back( GtkWidget *w, gpointer data)
{
Xtt *xtt = (Xtt *)data;
if ( !xtt->xnav->is_authorized())
return;
xtt->xnav->brow_push();
}
......@@ -536,6 +610,14 @@ XttGtk::XttGtk( int argc, char *argv[], int *return_sts) :
gtk_image_new_from_stock( "gtk-print", GTK_ICON_SIZE_MENU));
g_signal_connect(file_print, "activate", G_CALLBACK(XttGtk::activate_print), this);
GtkWidget *file_login = gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Login"));
g_signal_connect( file_login, "activate",
G_CALLBACK(XttGtk::activate_login), this);
GtkWidget *file_logout = gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("Log_Out"));
g_signal_connect( file_logout, "activate",
G_CALLBACK(XttGtk::activate_logout), this);
GtkWidget *file_close = gtk_image_menu_item_new_with_mnemonic( CoWowGtk::translate_utf8("_Close"));
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(file_close),
gtk_image_new_from_stock( "gtk-close", GTK_ICON_SIZE_MENU));
......@@ -545,6 +627,8 @@ XttGtk::XttGtk( int argc, char *argv[], int *return_sts) :
GtkMenu *file_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_print);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_login);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_logout);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_close);
GtkWidget *file = gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_File"));
......@@ -846,6 +930,9 @@ XttGtk::XttGtk( int argc, char *argv[], int *return_sts) :
xhelp->open_URL_cb = open_URL_cb;
CoXHelp::set_default( xhelp);
if ( !xnav->is_authorized( pwr_mAccess_AllRt, 0))
xnav->open_login();
wow = new CoWowGtk( toplevel);
if ( !quiet)
wow->DisplayWarranty();
......
/*
* Proview $Id: rt_xtt_gtk.h,v 1.1 2007-01-04 08:40:24 claes Exp $
* Proview $Id: rt_xtt_gtk.h,v 1.2 2008-06-24 08:05:25 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -76,6 +76,8 @@ class XttGtk : public Xtt {
static void activate_command( GtkWidget *w, gpointer data);
static void activate_exit( GtkWidget *w, gpointer data);
static void activate_print( GtkWidget *w, gpointer data);
static void activate_login( GtkWidget *w, gpointer data);
static void activate_logout( GtkWidget *w, gpointer data);
static void activate_find( GtkWidget *w, gpointer data);
static void activate_findregex( GtkWidget *w, gpointer data);
static void activate_findnext( GtkWidget *w, gpointer data);
......
/*
* Proview $Id: xtt_xnav_gtk.cpp,v 1.5 2008-04-25 11:28:54 claes Exp $
* Proview $Id: xtt_xnav_gtk.cpp,v 1.6 2008-06-24 08:09:56 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -51,6 +51,7 @@ typedef void *Widget;
#include "co_error.h"
#include "co_xhelp.h"
#include "co_wow_gtk.h"
#include "co_login_gtk.h"
#include "xtt_xnav_gtk.h"
#include "xtt_item.h"
#include "xtt_menu.h"
......@@ -254,10 +255,19 @@ GeCurve *XNavGtk::gecurve_new( char *name, char *filename, GeCurveData *data,
}
XttFileview *XNavGtk::fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
int type, char *target_attr, char *trigger_attr)
int type, char *target_attr, char *trigger_attr, char *filetype)
{
return new XttFileviewGtk( this, parent_wid, oid, title, dir, pattern, type, target_attr,
trigger_attr);
trigger_attr, filetype);
}
CoLogin *XNavGtk::login_new( char *name,
char *groupname,
void (* bc_success)( void *),
void (* bc_cancel)( void *),
pwr_tStatus *status)
{
return new CoLoginGtk( this, parent_wid, name, groupname, bc_success, bc_cancel, status);
}
void XNavGtk::bell( int time)
......
/*
* Proview $Id: xtt_xnav_gtk.h,v 1.3 2008-04-25 11:28:54 claes Exp $
* Proview $Id: xtt_xnav_gtk.h,v 1.4 2008-06-24 08:09:56 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -72,7 +72,12 @@ class XNavGtk : public XNav {
GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right);
XttFileview *fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
int type, char *target_attr, char *trigger_attr);
int type, char *target_attr, char *trigger_attr, char *filetype);
CoLogin *login_new( char *wl_name,
char *wl_groupname,
void (* wl_bc_success)( void *),
void (* wl_bc_cancel)( void *),
pwr_tStatus *status);
void bell( int time);
void get_popup_menu( pwr_sAttrRef attrref,
xmenu_eItemType item_type,
......
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