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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
|
/* Generated by GOB (v0.90.5) on Tue Dec 21 17:43:57 1999
(do not edit directly) */
#include "balsa-druid-page-user.h"
#line 30 "balsa-druid-page-user.gob"
#include <sys/types.h>
#include <sys/stat.h>
#include "balsa-druid-page-error.h"
#include "balsa-app.h"
#line 16 "balsa-druid-page-user.c"
static void balsa_druid_page_user_class_init (BalsaDruidPageUserClass *c);
static void balsa_druid_page_user_init (BalsaDruidPageUser *self);
static void balsa_druid_page_user_construct (BalsaDruidPage *self);
static void balsa_druid_page_user_prepare (GnomeDruidPage *_self, GtkWidget *druid);
static gboolean balsa_druid_page_user_next (GnomeDruidPage *_self, GtkWidget *druid);
static BalsaDruidPageClass *parent_class = NULL;
guint
balsa_druid_page_user_get_type (void)
{
static guint type = 0;
if (!type) {
static const GtkTypeInfo info = {
"BalsaDruidPageUser",
sizeof (BalsaDruidPageUser),
sizeof (BalsaDruidPageUserClass),
(GtkClassInitFunc) balsa_druid_page_user_class_init,
(GtkObjectInitFunc) balsa_druid_page_user_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
type = gtk_type_unique (balsa_druid_page_get_type(), &info);
}
return type;
}
static GtkObject *(* new) (BalsaInitDruid *druid) = balsa_druid_page_user_new;
#define GET_NEW (gtk_type_new(balsa_druid_page_user_get_type()))
static void
balsa_druid_page_user_class_init (BalsaDruidPageUserClass *c)
{
BalsaDruidPageClass *balsa_druid_page_class = (BalsaDruidPageClass *)c;
GnomeDruidPageClass *gnome_druid_page_class = (GnomeDruidPageClass *)c;
parent_class = gtk_type_class (balsa_druid_page_get_type ());
balsa_druid_page_class->construct = balsa_druid_page_user_construct;
gnome_druid_page_class->prepare = balsa_druid_page_user_prepare;
gnome_druid_page_class->next = balsa_druid_page_user_next;
return;
}
#line 58 "balsa-druid-page-user.gob"
static void
balsa_druid_page_user_init (BalsaDruidPageUser *self)
#line 68 "balsa-druid-page-user.c"
{
{
#line 58 "balsa-druid-page-user.gob"
GtkTable *table;
GtkLabel *label;
gchar *preset;
char hostbuf[512];
self->emaster.setbits = 0;
self->emaster.numentries = 0;
self->emaster.donemask = 0;
self->ed0.master = &( self->emaster );
self->ed1.master = &( self->emaster );
self->ed2.master = &( self->emaster );
self->ed3.master = &( self->emaster );
table = GTK_TABLE( gtk_table_new( 5, 2, FALSE ) );
label = GTK_LABEL( gtk_label_new( _("Please enter information about yourself.") ) );
gtk_label_set_justify( label, GTK_JUSTIFY_CENTER );
gtk_label_set_line_wrap( label, TRUE );
gtk_table_attach( table, GTK_WIDGET( label ), 0, 2, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
8, 4 );
preset = g_get_real_name();
balsa_init_add_table_entry( table, 0, _("Name:"), preset, &( self->ed0 ), GTK_WIDGET( self ), &( self->name ) );
gethostname( hostbuf, 511 );
preset = g_strconcat( g_get_user_name(), "@", hostbuf, NULL );
balsa_init_add_table_entry( table, 1, _("Email address:"), preset, &( self->ed1 ), GTK_WIDGET( self ), &( self->email ) );
g_free( preset );
preset = "localhost";
balsa_init_add_table_entry( table, 2, _("SMTP Server:"), preset, &( self->ed2 ), GTK_WIDGET( self ), &( self->smtp ) );
preset = g_strconcat( g_get_home_dir(), "/mail", NULL );
balsa_init_add_table_entry( table, 3, _("Local Mail Directory:"), preset, &( self->ed3 ), GTK_WIDGET( self ), &( self->localmaildir ) );
g_free( preset );
gtk_box_pack_start( GTK_BOX( (GNOME_DRUID_PAGE_STANDARD( self ))->vbox ),
GTK_WIDGET( table ), TRUE, TRUE, 8 );
gtk_widget_show_all( GTK_WIDGET( table ) );
#line 114 "balsa-druid-page-user.c"
}
}
#line 50 "balsa-druid-page-user.gob"
GtkObject *
balsa_druid_page_user_new (BalsaInitDruid *druid)
{
g_return_val_if_fail (BALSA_IS_INITDRUID (druid), (GtkObject *)0);
g_return_val_if_fail (druid != NULL, (GtkObject *)0);
{
#line 51 "balsa-druid-page-user.gob"
GtkObject *self = GTK_OBJECT( GET_NEW );
(BALSA_DRUID_PAGE( self ))->druid = GNOME_DRUID( druid );
balsa_druid_page_user_construct( BALSA_DRUID_PAGE( self ) );
return self;
#line 133 "balsa-druid-page-user.c"
}
}
#line 101 "balsa-druid-page-user.gob"
static void
balsa_druid_page_user_construct (BalsaDruidPage *self)
#define PARENT_HANDLER(args...) \
{ if(BALSA_DRUID_PAGE_CLASS(parent_class)->construct) \
(* BALSA_DRUID_PAGE_CLASS(parent_class)->construct)(##args); }
{
{
#line 102 "balsa-druid-page-user.gob"
(GNOME_DRUID_PAGE_STANDARD( self ))->title = g_strdup( _("User Settings" ) );
g_return_if_fail( (BALSA_DRUID_PAGE( self ))->druid != NULL );
(GNOME_DRUID_PAGE_STANDARD( self ))->logo_image = (BALSA_INITDRUID( (BALSA_DRUID_PAGE( self ))->druid ))->default_logo;
PARENT_HANDLER( self );
#line 155 "balsa-druid-page-user.c"
}
}
#undef PARENT_HANDLER
#line 111 "balsa-druid-page-user.gob"
static void
balsa_druid_page_user_prepare (GnomeDruidPage *_self, GtkWidget *druid)
#define PARENT_HANDLER(args...) \
{ if(GNOME_DRUID_PAGE_CLASS(parent_class)->prepare) \
(* GNOME_DRUID_PAGE_CLASS(parent_class)->prepare)(##args); }
{
g_return_if_fail (GTK_IS_WIDGET (druid));
g_return_if_fail (druid != NULL);
{
#line 112 "balsa-druid-page-user.gob"
BalsaDruidPageUser *self = BALSA_DRUID_PAGE_USER( _self );
/* Don't let them continue unless all entries have something. */
/* FIXME: unify this with code above */
if( ENTRY_MASTER_DONE( self->emaster ) ) {
gnome_druid_set_buttons_sensitive( GNOME_DRUID( druid ), TRUE, TRUE, TRUE );
} else {
gnome_druid_set_buttons_sensitive( GNOME_DRUID( druid ), TRUE, FALSE, TRUE );
}
gnome_druid_set_show_finish( GNOME_DRUID( druid ), FALSE );
#line 185 "balsa-druid-page-user.c"
}
}
#undef PARENT_HANDLER
#line 127 "balsa-druid-page-user.gob"
static gboolean
balsa_druid_page_user_next (GnomeDruidPage *_self, GtkWidget *druid)
#define PARENT_HANDLER(args...) \
{ if(GNOME_DRUID_PAGE_CLASS(parent_class)->next) \
(* GNOME_DRUID_PAGE_CLASS(parent_class)->next)(##args); }
{
g_return_val_if_fail (GTK_IS_WIDGET (druid), (gboolean )0);
g_return_val_if_fail (druid != NULL, (gboolean )0);
{
#line 128 "balsa-druid-page-user.gob"
gchar *uhoh;
BalsaDruidPageUser *self = BALSA_DRUID_PAGE_USER( _self );
if( balsa_app.address->personal )
g_free( balsa_app.address->personal );
balsa_app.address->personal = g_strdup( gtk_entry_get_text( GTK_ENTRY( self->name ) ) );
if( balsa_app.address->mailbox )
g_free( balsa_app.address->mailbox );
balsa_app.address->mailbox = g_strdup( gtk_entry_get_text( GTK_ENTRY( self->email ) ) );
if( balsa_app.smtp_server );
g_free( balsa_app.smtp_server );
balsa_app.smtp_server = g_strdup( gtk_entry_get_text( GTK_ENTRY( self->smtp ) ) );
if( balsa_app.local_mail_directory );
g_free( balsa_app.local_mail_directory );
balsa_app.local_mail_directory = g_strdup( gtk_entry_get_text( GTK_ENTRY( self->localmaildir ) ) );
if( balsa_init_create_to_directory( balsa_app.local_mail_directory, &uhoh ) ) {
GtkObject *page;
page = balsa_druid_page_error_new_after( BALSA_DRUID_PAGE( self ), _("Local Mail Problem"), uhoh );
g_free( uhoh );
balsa_druid_page_error_goto_me( BALSA_DRUID_PAGE_ERROR( page ) );
} else {
PARENT_HANDLER( _self, druid );
}
return TRUE;
#line 233 "balsa-druid-page-user.c"
}
}
#undef PARENT_HANDLER
#undef GET_NEW
/*REALLY BAD HACK
This is to avoid unused warnings if you don't call
some method, it pollutes the namespace but the call
is weird enough. I need to find a better way to do
this */
void __balsa_druid_page_user_really_bad_hack_to_avoid_warnings(void);
void
__balsa_druid_page_user_really_bad_hack_to_avoid_warnings(void)
{
((void (*)(void))new)();
}
|