From 385f6377ca4f0be4cf4a5b493e8d13995534b5be Mon Sep 17 00:00:00 2001 From: Jan Lipovský Date: Wed, 29 Dec 2010 17:56:04 +0100 Subject: GUI with Options dialog --- globals.h | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 globals.h (limited to 'globals.h') diff --git a/globals.h b/globals.h new file mode 100644 index 0000000..95e48d8 --- /dev/null +++ b/globals.h @@ -0,0 +1,123 @@ +#ifndef GNCPMOUNT_GLOBALS_H +#define GNCPMOUNT_GLOBALS_H + +#define PROG_VERSION 0.1.2 +#define GUI_TITLE "gncpmount - 0.1.2" + + +/** +* Define type TWindow - structure of important widgets in gui +*/ +typedef struct gui_struct +{ + GtkWidget *win; + GtkWidget *menu; + GtkWidget *vbox; + GtkWidget *table; + + GtkWidget *check_n; + + GtkWidget *btnbox; + + GtkWidget *notebook; + + /* Buttons */ + GtkWidget *btn_close; + GtkWidget *btn_mount; + GtkWidget *btn_browse; + + /* Entry */ + GtkWidget *entry_username; + GtkWidget *entry_password; + GtkWidget *entry_server; + GtkWidget *entry_mount_point; + GtkWidget *entry_dns_server; +} TWindow; + +/** Structure of widgets used in GUI */ +TWindow gui; + + +/** +* Define type TWindow - structure of important widgets in gui +*/ +typedef struct opt_struct +{ + GtkWidget *dialog; + + /* Entry */ + GtkWidget *entry_codepage; + GtkWidget *entry_charset; + GtkWidget *entry_volume; + GtkWidget *entry_uid; + GtkWidget *entry_gid; + GtkWidget *entry_fmode; + GtkWidget *entry_dmode; + GtkWidget *entry_timeout; + GtkWidget *entry_retrycount; + + /* ComboBox */ + GtkWidget *combo_signature; + + /* Check box */ + GtkWidget *check_C; + GtkWidget *check_s; + GtkWidget *check_m; + GtkWidget *check_b; +}TODialog; + +/** Structure of widgets used in GUI - Optionns dialog */ +TODialog options; + + + +/** +* Parameters which are appent to the ncpmount command +*/ +typedef struct params +{ + gchar *username; /* user name sent to server */ + gchar *password; /* use this password */ + gchar *server; /* server name to be used */ + gchar *dns_name; /* DNS server name to be used when mounting over TCP or UDP */ + gchar *mount_point; /* mount point directory */ + + gchar *volume; /* Volume to mount, for NFS re-eport */ + gchar *uid; /* uid the mounted files get */ + gchar *gid; /* gid the mounted files get */ + gchar *fmode; /* permission the files get (octal notation) */ + gchar *dmode; /* permission the dirs get (octal notation) */ + gchar *time_out; /* waiting time (in 1/100s) to wait for an answer from the server. Default: 60 */ + gchar *retry_count; /* number of retry attempts. Default: 5 */ + gchar *level; /* signature level */ + gchar *charset; /* charset used for input and display */ + gchar *codepage; /* codepage used on volume, including letters 'cp' */ + + /*gchar *cuid; */ /* uid to identify the connection to mount on - Only makes sense for root */ + + gboolean C; /* don't convert password to uppercase */ + gboolean n; /* do not use any password */ + gboolean s; /* enable renaming/deletion of read-only files */ + gboolean b; /* force bindery login to NDS servers */ + gboolean m; /* allow multiple logins to server */ + +} TParameters; + + +TParameters cmd_params; + + +/** Sets given parameter whith given value */ +/*void init_parameters (const gchar *value, gchar **param);*/ + +/** Sets given parameter whith given value */ +void set_parameter_text (GtkWidget *entry, gchar **param); + + +/** Sets given parameter whith given value */ +void set_parameter_bool (GtkWidget *checkbox, gboolean *param); + + + + +#endif -- cgit