Added Edit / Add Default Masters command

git-svn-id: http://svn.code.sf.net/p/xqf/code/trunk@125 d2ac09be-c843-0410-8b1f-f8a84130e0ec
This commit is contained in:
Alex Burger 2001-12-15 20:39:14 +00:00 committed by alex_b
parent 4e95bae651
commit bc1dc90287
6 changed files with 29 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Dec 15, 2001: Alex Burger <alex@fragit_dot_net>
- Added Edit / Add Default Masters command. Adds in all the default
master servers in case you accidentally deleted one (or all)
Dec 13, 2001: Ludwig Nussel <l-n@users.sourceforge.net>
- qstat no longer required at build time

View File

@ -72,5 +72,4 @@ extern enum server_type id2type (const char *id);
extern const char *type2id (enum server_type type);
extern GtkWidget *game_pixmap_with_label (enum server_type type);
#endif /* __GAME_H__ */

View File

@ -907,7 +907,14 @@ static void update_master_list_action (const char *action) {
}
static void update_master_list_builtin (void) {
void update_master_list_builtin (void) {
char **ptr;
for (ptr = builtin_masters_update_info; *ptr; ptr++)
update_master_list_action (*ptr);
}
void update_master_list_web (void) {
char **ptr;
for (ptr = builtin_masters_update_info; *ptr; ptr++)

View File

@ -48,6 +48,8 @@ extern void free_master (struct master *m);
extern void save_favorites (void);
extern void init_masters (int autoupdate);
extern void update_master_list_builtin (void);
extern void free_masters (void);
extern void collate_server_lists (GSList *masters, GSList **servers,

View File

@ -110,6 +110,7 @@ static GtkWidget *file_statistics_menu_item = NULL;
static GtkWidget *edit_add_menu_item = NULL;
static GtkWidget *edit_delete_menu_item = NULL;
static GtkWidget *edit_update_master_builtin_menu_item = NULL;
static GtkWidget *edit_add_master_menu_item = NULL;
static GtkWidget *edit_delete_master_menu_item = NULL;
static GtkWidget *edit_find_player_menu_item = NULL;
@ -233,6 +234,7 @@ void set_widgets_sensitivity (void) {
gtk_widget_set_sensitive (file_statistics_menu_item, sens);
gtk_widget_set_sensitive (add_menu_item, sens);
gtk_widget_set_sensitive (edit_add_menu_item, sens);
gtk_widget_set_sensitive (edit_update_master_builtin_menu_item, sens);
gtk_widget_set_sensitive (edit_add_master_menu_item, sens);
gtk_widget_set_sensitive (edit_find_player_menu_item, sens);
gtk_widget_set_sensitive (edit_find_again_menu_item, sens);
@ -1181,6 +1183,12 @@ static void copy_server_callback_plus (GtkWidget *widget, gpointer data) {
}
}
static void update_master_builtin_callback (GtkWidget *widget, gpointer data) {
update_master_list_builtin();
}
static void add_master_callback (GtkWidget *widget, gpointer data) {
char *str;
char *desc;
@ -1786,6 +1794,12 @@ static const struct menuitem edit_menu_items[] = {
{ MENU_SEPARATOR, NULL, 0, 0, NULL, NULL, NULL },
{
MENU_ITEM, N_("Add Default Masters" ), 0, GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (update_master_builtin_callback), NULL,
&edit_update_master_builtin_menu_item
},
{
MENU_ITEM, N_("Add _Master..."), 'M', GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (add_master_callback), NULL,

View File

@ -222,6 +222,7 @@ extern GtkWidget *top_window (void);
extern void set_widgets_sensitivity (void);
/* This is defined in here so that filter.c can see it */
GtkWidget *server_filter_widget[MAX_SERVER_FILTERS + 3];