summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/main.c b/main.c
index 6e6bbd084..dfd1b1447 100644
--- a/main.c
+++ b/main.c
@@ -14,7 +14,6 @@ GtkWidget *main_vbox;
GtkWidget *error_info_bar;
GtkWidget *error_label;
int error_count;
-struct DiveList dive_list;
GConfClient *gconf;
struct units output_units;
@@ -98,7 +97,7 @@ void update_dive(struct dive *new_dive)
if (old_dive) {
flush_dive_info_changes(old_dive);
flush_dive_equipment_changes(old_dive);
- flush_divelist(&dive_list, old_dive);
+ flush_divelist(old_dive);
}
if (new_dive) {
show_dive_info(new_dive);
@@ -190,7 +189,7 @@ static void file_open(GtkWidget *w, gpointer data)
}
g_slist_free(filenames);
report_dives();
- dive_list_update_dives(dive_list);
+ dive_list_update_dives();
}
gtk_widget_destroy(dialog);
}
@@ -316,7 +315,7 @@ static void unit_dialog(GtkWidget *w, gpointer data)
/* Make sure to flush any modified old dive data with old units */
update_dive(NULL);
output_units = menu_units;
- update_dive_list_units(&dive_list);
+ update_dive_list_units();
repaint_dive();
gconf_client_set_bool(gconf, GCONF_NAME(feet), output_units.length == FEET, NULL);
gconf_client_set_bool(gconf, GCONF_NAME(psi), output_units.pressure == PSI, NULL);
@@ -365,7 +364,8 @@ static void renumber_dialog(GtkWidget *w, gpointer data)
}
static GtkActionEntry menu_items[] = {
- { "FileMenuAction", GTK_STOCK_FILE, "Log", NULL, NULL, NULL},
+ { "FileMenuAction", GTK_STOCK_FILE, "File", NULL, NULL, NULL},
+ { "LogMenuAction", GTK_STOCK_FILE, "Log", NULL, NULL, NULL},
{ "OpenFile", GTK_STOCK_OPEN, NULL, "<control>O", NULL, G_CALLBACK(file_open) },
{ "SaveFile", GTK_STOCK_SAVE, NULL, "<control>S", NULL, G_CALLBACK(file_save) },
{ "Print", GTK_STOCK_PRINT, NULL, "<control>P", NULL, G_CALLBACK(do_print) },
@@ -386,10 +386,11 @@ static const gchar* ui_string = " \
<separator name=\"Separator1\"/> \
<menuitem name=\"Import\" action=\"Import\" /> \
<separator name=\"Separator2\"/> \
+ <menuitem name=\"Quit\" action=\"Quit\" /> \
+ </menu> \
+ <menu name=\"LogMenu\" action=\"LogMenuAction\"> \
<menuitem name=\"Units\" action=\"Units\" /> \
<menuitem name=\"Renumber\" action=\"Renumber\" /> \
- <separator name=\"Separator3\"/> \
- <menuitem name=\"Quit\" action=\"Quit\" /> \
</menu> \
</menubar> \
</ui> \
@@ -424,6 +425,7 @@ int main(int argc, char **argv)
GtkWidget *info_box;
GtkWidget *notebook;
GtkWidget *dive_info;
+ GtkWidget *dive_list;
GtkWidget *equipment;
GtkWidget *menubar;
GtkWidget *vbox;
@@ -464,7 +466,7 @@ int main(int argc, char **argv)
/* Create the actual divelist */
dive_list = dive_list_create();
- gtk_paned_add2(GTK_PANED(paned), dive_list.container_widget);
+ gtk_paned_add2(GTK_PANED(paned), dive_list);
/* VBox for dive info, and tabs */
info_box = gtk_vbox_new(FALSE, 6);
@@ -509,7 +511,7 @@ int main(int argc, char **argv)
}
report_dives();
- dive_list_update_dives(dive_list);
+ dive_list_update_dives();
gtk_main();
return 0;