2 #ifndef YAWMPPP_APPLET_H
3 #define YAWMPPP_APPLET_H
8 /* not less than the dock applet */
11 #define ERR_MAX_ISPS "You can't have more than 40 entries."
13 #define ERR_CANT_MKDIR "Unable to create directory ~/.yawmppp\n"\
14 "Current configuration could not be\n"\
17 #define ERR_CANT_WRITE "Unable to create configuration files\n"\
18 "in directory ~/.yawmppp. Current configuration\n"\
19 "may not have been only partially written."
21 #define ERR_DIDNT_WRITE "There were errors when saving the configuration.\n"\
22 "Do you still wish to close wmppp.pref and [maybe] lose\n"\
25 #define INFO_CANT_APPLY_NOW "The dock applet will update itself only when\n"\
26 "the current connection is over."
28 #define ERR_CANT_SU "Script didn't run properly. Bad password ?"
30 #define MAX_EXPECT_PAIRS 16
32 struct PREF_ISP_INFO
{
46 /* appended in 1.1.0 */
48 char s_expect
[MAX_EXPECT_PAIRS
][32];
49 char s_send
[MAX_EXPECT_PAIRS
][32];
51 struct ISP_PPP ppp
; /* defined in ../isprc.h */
53 /* appended in 1.1.2 */
65 int linectl
; /* 0=modem 1=local */
66 int flowctl
; /* 0=crtscts 1=xonxoff 2=nocrtscts 3=DC */
69 int lcp
[5]; /* in the same order as in the dialog */
77 void create_preferences_panel(void);
78 void clear_and_disable_right_pane(void);
79 void load_rc_entries(void);
80 void update_right_pane(void);
81 void commit_back_to_db(void);
83 int write_and_apply_data(void);
84 void check_client(void);
85 int file_exists(char *s
);
86 void find_out_paths(void);
87 void test_set_path(char *,char *);
89 void xlate_ppp_to_pref(struct YAWMPPP_ISP_INFO
*wii
,
90 struct PREF_ISP_INFO
*pii
);
92 GtkWidget
*hlabel_new(char *);
94 GtkWidget
*make_ppp_pane(void);
95 void get_ppp_pane(void);
96 void set_ppp_pane(void);
97 char *mk_ppp_string(struct PREF_PPP_OPT
*modi
,char *sep
);
98 void read_ppp_options_from_rc(char *p
);
100 char *wrapped_strtok(char *a
,char *b
);
102 gint
applet_kill (GtkWidget
* widget
, GdkEvent
* event
, gpointer data
);
103 void applet_destroy (GtkWidget
* widget
, gpointer data
);
104 void applet_apply (GtkWidget
* widget
, gpointer data
);
105 void applet_save_and_quit (GtkWidget
* widget
, gpointer data
);
107 void list_select(GtkCList
*cl
,gint row
,gint column
,
108 GdkEventButton
*geb
,gpointer data
);
109 void list_unselect(GtkCList
*cl
,gint row
,gint column
,
110 GdkEventButton
*geb
,gpointer data
);
112 void list_moveup(GtkWidget
*gw
,gpointer data
);
113 void list_movedown(GtkWidget
*gw
,gpointer data
);
114 void list_remove(GtkWidget
*gw
,gpointer data
);
115 void list_duplicate(GtkWidget
*gw
,gpointer data
);
116 void list_add(GtkWidget
*gw
,gpointer data
);
118 /* more settings dialog */
120 void pop_advanced(GtkWidget
*gw
,gpointer data
);
121 void adv_ok (GtkWidget
* widget
, gpointer data
);
122 void adv_cancel (GtkWidget
* widget
, gpointer data
);
123 void adv_destroy (GtkWidget
* widget
, gpointer data
);
125 void enable_local_ppp(gboolean e
);
126 void ppp_override_toggle(GtkToggleButton
*gtb
,gpointer data
);
128 /* more settings dialog */
130 void isp_rename(GtkEditable
*ge
,gpointer data
);
132 void make_ppp_default(GtkWidget
*w
,gpointer data
);
136 void pop_expect(GtkWidget
*w
,gpointer data
);
137 void exp_ok (GtkWidget
* widget
, gpointer data
);
138 void exp_cancel (GtkWidget
* widget
, gpointer data
);
139 void exp_destroy (GtkWidget
* widget
, gpointer data
);
140 void exp_update(void);
141 void exp_up(GtkWidget
*widget
,gpointer data
);
142 void exp_down(GtkWidget
*widget
,gpointer data
);
143 void exp_disable(void);
144 void exp_enable(void);
145 void exp_select(GtkCList
*cl
,gint row
,gint column
,
146 GdkEventButton
*geb
,gpointer data
);
147 void exp_unselect(GtkCList
*cl
,gint row
,gint column
,
148 GdkEventButton
*geb
,gpointer data
);
149 void exp_add_delay(void);
150 void exp_remove(void);
152 void expa_destroy (GtkWidget
* widget
, gpointer data
);
153 void expa_ok (GtkWidget
* widget
, gpointer data
);
154 void expa_cancel (GtkWidget
* widget
, gpointer data
);
158 void extract_delimited_string(char *dest
,char *src
,int count
,char delim
,int max
);
161 void pop_help (GtkWidget
* widget
, gpointer data
);
162 void help_dead (GtkWidget
* widget
, gpointer data
);
163 void help_die (GtkWidget
* widget
, gpointer data
);
166 void add_man(char *manpage
,GtkWidget
*text
,int index
);
167 void add_docfile(char *source
,GtkWidget
*text
,int index
);
171 void run_as_root(char *what
);
172 gint
pwd_kill (GtkWidget
* widget
, GdkEvent
* event
, gpointer data
);
174 void pwd_cancel(GtkWidget
*gw
,gpointer data
);
175 void pwd_ok(GtkWidget
*gw
,gpointer data
);
176 void pwd_view(GtkWidget
*gw
,gpointer data
);
178 void spwd_destroy (GtkWidget
* widget
, gpointer data
);
179 void spwd_close(GtkWidget
*gw
,gpointer data
);
180 int try_run_script(char *cmd
);