summaryrefslogtreecommitdiffstats
path: root/globals.h
blob: 907adf391d5f23538dc74ad5a2fb3e174d4ea5c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef GNCPMOUNT_GLOBALS_H
#define GNCPMOUNT_GLOBALS_H

#include <gtk/gtk.h>

#define PROG_VERSION "0.0.3"
#define GUI_TITLE "gncpmount - 0.0.3"



/**
* 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;

    gboolean   btn_mount_enable;

    /* 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;

/** Optionns and mount-point */
TParameters cmd_params;


/** 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);


/**
*   Return ncpmount command - set length = NULL
*   if you do not wannt to know length of returnet string
*/
gchar * get_ncpmount_command (gboolean whith_password, gint *length);


/** Clear all parameter in cmd_params*/
void clear_cmdparams ();

#endif