Skip to content
Snippets Groups Projects
Commit fa198ad2 authored by deuce's avatar deuce
Browse files

Everything but new user and save user now working.

parent 48f14de0
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,8 @@ void load_user(GtkWidget *wiggy, gpointer data) ...@@ -15,6 +15,8 @@ void load_user(GtkWidget *wiggy, gpointer data)
GtkWidget *w; GtkWidget *w;
char str[1024]; char str[1024];
gboolean b; gboolean b;
int i;
FILE *f;
user.number=current_user; user.number=current_user;
if(user.number < 1 || user.number > totalusers) { if(user.number < 1 || user.number > totalusers) {
...@@ -586,6 +588,164 @@ void load_user(GtkWidget *wiggy, gpointer data) ...@@ -586,6 +588,164 @@ void load_user(GtkWidget *wiggy, gpointer data)
fprintf(stderr,"Cannot get the chat split personal widget\n"); fprintf(stderr,"Cannot get the chat split personal widget\n");
else else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.chat&CHAT_SPLITP); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.chat&CHAT_SPLITP);
/* Msg/File Settings */
w=glade_xml_get_widget(xml, "cUserNETMAIL");
if(w==NULL)
fprintf(stderr,"Cannot get the netmail widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.misc&NETMAIL);
w=glade_xml_get_widget(xml, "cUserCLRSCRN");
if(w==NULL)
fprintf(stderr,"Cannot get the clear screen widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.misc&CLRSCRN);
w=glade_xml_get_widget(xml, "cUserANFSCAN");
if(w==NULL)
fprintf(stderr,"Cannot get the ask new file scan widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.misc&ANFSCAN);
w=glade_xml_get_widget(xml, "cUserEXTDESC");
if(w==NULL)
fprintf(stderr,"Cannot get the extended descriptions widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.misc&EXTDESC);
w=glade_xml_get_widget(xml, "cUserBATCHFLAG");
if(w==NULL)
fprintf(stderr,"Cannot get the batch flagging widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.misc&BATCHFLAG);
w=glade_xml_get_widget(xml, "cUserAUTOHANG");
if(w==NULL)
fprintf(stderr,"Cannot get the auto hangup after transfer widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.misc&AUTOHANG);
w=glade_xml_get_widget(xml, "cUserCLRSCRN");
if(w==NULL)
fprintf(stderr,"Cannot get the clear screen widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.misc&CLRSCRN);
w=glade_xml_get_widget(xml, "cExternalEditor");
if(w==NULL)
fprintf(stderr,"Cannot get the external editor widget\n");
else
gtk_combo_box_set_active(GTK_COMBO_BOX(w),user.xedit);
w=glade_xml_get_widget(xml, "cDefaultDownloadProtocol");
if(w==NULL)
fprintf(stderr,"Cannot get the default download protocol widget\n");
else {
gtk_combo_box_set_active(GTK_COMBO_BOX(w),-1);
for(i=0;i<cfg.total_prots;i++) {
if(cfg.prot[i]->mnemonic==user.prot) {
gtk_combo_box_set_active(GTK_COMBO_BOX(w),i);
break;
}
}
}
w=glade_xml_get_widget(xml, "cTempQWKFileType");
if(w==NULL)
fprintf(stderr,"Cannot get the temp QWK file type widget\n");
else {
gtk_combo_box_set_active(GTK_COMBO_BOX(w),-1);
for(i=0;i<cfg.total_fcomps;i++) {
if(!stricmp(cfg.fcomp[i]->ext,user.tmpext)) {
gtk_combo_box_set_active(GTK_COMBO_BOX(w),i);
break;
}
}
}
w=glade_xml_get_widget(xml, "cUserQWK_FILES");
if(w==NULL)
fprintf(stderr,"Cannot get the include new files list widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_FILES);
w=glade_xml_get_widget(xml, "cUserQWK_EMAIL");
if(w==NULL)
fprintf(stderr,"Cannot get the include unread email widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_EMAIL);
w=glade_xml_get_widget(xml, "cUserQWK_ALLMAIL");
if(w==NULL)
fprintf(stderr,"Cannot get the include all email widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_ALLMAIL);
w=glade_xml_get_widget(xml, "cUserQWK_DELMAIL");
if(w==NULL)
fprintf(stderr,"Cannot get the delete email widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_DELMAIL);
w=glade_xml_get_widget(xml, "cUserQWK_BYSELF");
if(w==NULL)
fprintf(stderr,"Cannot get the include messages by self widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_BYSELF);
w=glade_xml_get_widget(xml, "cUserQWK_EXPCTLA");
if(w==NULL)
fprintf(stderr,"Cannot get the expand ctrl-a widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_EXPCTLA);
w=glade_xml_get_widget(xml, "cUserQWK_RETCTLA");
if(w==NULL)
fprintf(stderr,"Cannot get the retail ctrl-a widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_RETCTLA);
w=glade_xml_get_widget(xml, "cUserQWK_ATTACH");
if(w==NULL)
fprintf(stderr,"Cannot get the include attachments widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_ATTACH);
w=glade_xml_get_widget(xml, "cUserQWK_NOINDEX");
if(w==NULL)
fprintf(stderr,"Cannot get the don't include index files widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_NOINDEX);
w=glade_xml_get_widget(xml, "cUserQWK_TZ");
if(w==NULL)
fprintf(stderr,"Cannot get the include TZ widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_TZ);
w=glade_xml_get_widget(xml, "cUserQWK_VIA");
if(w==NULL)
fprintf(stderr,"Cannot get the include VIA widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_VIA);
w=glade_xml_get_widget(xml, "cUserQWK_NOCTRL");
if(w==NULL)
fprintf(stderr,"Cannot get the include extraneous control files widget\n");
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),user.qwk&QWK_NOCTRL);
/* Extended Comment */
sprintf(str,"%suser/%4.4u.msg", cfg.data_dir,user.number);
f=fopen(str,"r");
if(f) {
w=glade_xml_get_widget(xml, "tExtendedComment");
while((i=fread(str,1,sizeof(str),f)))
gtk_text_buffer_insert_at_cursor(gtk_text_view_get_buffer(GTK_TEXT_VIEW(w)), str,i);
fclose(f);
}
} }
int update_current_user(int new_user) int update_current_user(int new_user)
...@@ -686,3 +846,36 @@ void user_toggle_inactive(GtkWidget *t, gpointer data) ...@@ -686,3 +846,36 @@ void user_toggle_inactive(GtkWidget *t, gpointer data)
else else
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w),inactive); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w),inactive);
} }
void find_user(GtkWidget *t, gpointer data)
{
GtkWidget *w;
unsigned int nu;
w=glade_xml_get_widget(xml, "eMatchUser");
if(w==NULL)
fprintf(stderr,"Cannot get the find user entry widget\n");
else {
nu=matchuser(&cfg, gtk_entry_get_text(GTK_ENTRY(w)), TRUE);
if(nu==0) {
w=glade_xml_get_widget(xml, "NotFoundWindow");
if(w==NULL)
fprintf(stderr,"Could not locate NotFoundWindow widget\n");
else
gtk_widget_show(GTK_WIDGET(w));
}
else
update_current_user(nu);
}
}
void close_notfoundwindow(GtkWidget *t, gpointer data)
{
GtkWidget *w;
w=glade_xml_get_widget(xml, "NotFoundWindow");
if(w==NULL)
fprintf(stderr,"Could not locate NotFoundWindow widget\n");
else
gtk_widget_hide(GTK_WIDGET(w));
}
...@@ -63,6 +63,7 @@ int refresh_globals(void) ...@@ -63,6 +63,7 @@ int refresh_globals(void)
/* Re-add combobox values */ /* Re-add combobox values */
for(i=0; i<cfg.total_shells; i++) for(i=0; i<cfg.total_shells; i++)
gtk_combo_box_append_text(GTK_COMBO_BOX(cCommandShell), cfg.shell[i]->name); gtk_combo_box_append_text(GTK_COMBO_BOX(cCommandShell), cfg.shell[i]->name);
gtk_combo_box_append_text(GTK_COMBO_BOX(cExternalEditor), "Internal Editor");
for(i=0; i<cfg.total_xedits; i++) for(i=0; i<cfg.total_xedits; i++)
gtk_combo_box_append_text(GTK_COMBO_BOX(cExternalEditor), cfg.xedit[i]->name); gtk_combo_box_append_text(GTK_COMBO_BOX(cExternalEditor), cfg.xedit[i]->name);
for(i=0; i<cfg.total_prots; i++) for(i=0; i<cfg.total_prots; i++)
......
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
<property name="is_important">False</property> <property name="is_important">False</property>
<child> <child>
<widget class="GtkEntry" id="entry2"> <widget class="GtkEntry" id="eMatchUser">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">True</property> <property name="editable">True</property>
...@@ -5360,4 +5360,80 @@ ...@@ -5360,4 +5360,80 @@
<property name="translator_credits" translatable="yes" comments="TRANSLATORS: Replace this string with your names, one name per line.">translator-credits</property> <property name="translator_credits" translatable="yes" comments="TRANSLATORS: Replace this string with your names, one name per line.">translator-credits</property>
</widget> </widget>
<widget class="GtkDialog" id="NotFoundWindow">
<property name="title" translatable="yes">User Not Found</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">True</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="okbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label73">
<property name="visible">True</property>
<property name="label" translatable="yes">Could not find the user specified.</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface> </glade-interface>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment