Merge branch 'misc-fixes' of git://github.com/DataBeaver/subsurface

Pull miscellaneous fixes, mostly UI stuff from Mikko Rasa.

Both this and the pull from Pierre-Yves Chibon created a "Save As" menu
entry and logic.  As a result, there were a fair number of conflicts,
but I tried to make the end result somewhat reasonable.  I might have
missed some semantic conflict, though.

Series-acked-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>

* 'misc-fixes' of git://github.com/DataBeaver/subsurface:
  Add a separate "Save as" entry to the menu
  Changes to menu icons
  Improved depth info for dives without samples
  Divide the panes evenly in view_three
This commit is contained in:
Linus Torvalds 2012-08-17 10:57:24 -07:00
commit d0e27c6c53
5 changed files with 59 additions and 53 deletions

16
info.c
View file

@ -175,9 +175,17 @@ static void info_menu_delete_cb(GtkMenuItem *menuitem, gpointer user_data)
delete_dive_info(current_dive);
}
static void add_menu_item(GtkMenu *menu, const char *label, void (*cb)(GtkMenuItem *, gpointer))
static void add_menu_item(GtkMenu *menu, const char *label, const char *icon, void (*cb)(GtkMenuItem *, gpointer))
{
GtkWidget *item = gtk_menu_item_new_with_label(label);
GtkWidget *item;
if (icon) {
GtkWidget *image;
item = gtk_image_menu_item_new_with_label(label);
image = gtk_image_new_from_stock(icon, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
} else {
item = gtk_menu_item_new_with_label(label);
}
g_signal_connect(item, "activate", G_CALLBACK(cb), NULL);
gtk_widget_show(item); /* Yes, really */
gtk_menu_prepend(menu, item);
@ -185,8 +193,8 @@ static void add_menu_item(GtkMenu *menu, const char *label, void (*cb)(GtkMenuIt
static void populate_popup_cb(GtkTextView *entry, GtkMenu *menu, gpointer user_data)
{
add_menu_item(menu, "Delete", info_menu_delete_cb);
add_menu_item(menu, "Edit", info_menu_edit_cb);
add_menu_item(menu, "Delete", GTK_STOCK_DELETE, info_menu_delete_cb);
add_menu_item(menu, "Edit", GTK_STOCK_EDIT, info_menu_edit_cb);
}
static GtkEntry *text_value(GtkWidget *box, const char *label)