mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Removed the delete option by right clicking on "Dive Info"
info.c - Removed the additional pop-up menu entry "Delete" - Removed the delete_dive_info() function, which created the yes/no dialog. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
aec904b612
commit
b9649f06fe
1 changed files with 1 additions and 38 deletions
39
info.c
39
info.c
|
@ -196,47 +196,12 @@ void show_dive_info(struct dive *dive)
|
||||||
dive && dive->notes ? dive->notes : "", -1);
|
dive && dive->notes ? dive->notes : "", -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int delete_dive_info(struct dive *dive)
|
|
||||||
{
|
|
||||||
int success;
|
|
||||||
GtkWidget *dialog;
|
|
||||||
|
|
||||||
if (!dive)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
dialog = gtk_dialog_new_with_buttons(_("Delete Dive"),
|
|
||||||
GTK_WINDOW(main_window),
|
|
||||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
||||||
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
|
|
||||||
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
gtk_widget_show_all(dialog);
|
|
||||||
success = gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT;
|
|
||||||
if (success) {
|
|
||||||
delete_dive(dive);
|
|
||||||
mark_divelist_changed(TRUE);
|
|
||||||
dive_list_update_dives();
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_widget_destroy(dialog);
|
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void info_menu_edit_cb(GtkMenuItem *menuitem, gpointer user_data)
|
static void info_menu_edit_cb(GtkMenuItem *menuitem, gpointer user_data)
|
||||||
{
|
{
|
||||||
if (amount_selected)
|
if (amount_selected)
|
||||||
edit_multi_dive_info(NULL);
|
edit_multi_dive_info(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void info_menu_delete_cb(GtkMenuItem *menuitem, gpointer user_data)
|
|
||||||
{
|
|
||||||
/* this needs to delete all the selected dives as well, I guess? */
|
|
||||||
delete_dive_info(current_dive);
|
|
||||||
amount_selected = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void add_menu_item(GtkMenu *menu, const char *label, const char *icon, void (*cb)(GtkMenuItem *, gpointer))
|
static void add_menu_item(GtkMenu *menu, const char *label, const char *icon, void (*cb)(GtkMenuItem *, gpointer))
|
||||||
{
|
{
|
||||||
GtkWidget *item;
|
GtkWidget *item;
|
||||||
|
@ -255,11 +220,9 @@ static void add_menu_item(GtkMenu *menu, const char *label, const char *icon, vo
|
||||||
|
|
||||||
static void populate_popup_cb(GtkTextView *entry, GtkMenu *menu, gpointer user_data)
|
static void populate_popup_cb(GtkTextView *entry, GtkMenu *menu, gpointer user_data)
|
||||||
{
|
{
|
||||||
if (amount_selected) {
|
if (amount_selected)
|
||||||
add_menu_item(menu, _("Delete"), GTK_STOCK_DELETE, info_menu_delete_cb);
|
|
||||||
add_menu_item(menu, _("Edit"), GTK_STOCK_EDIT, info_menu_edit_cb);
|
add_menu_item(menu, _("Edit"), GTK_STOCK_EDIT, info_menu_edit_cb);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static GtkEntry *text_value(GtkWidget *box, const char *label)
|
static GtkEntry *text_value(GtkWidget *box, const char *label)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue