[PATCH 5/5] Only remember a DC nickname if the user has pressed OK

Lubomir I. Ivanov neolit123 at gmail.com
Sun Dec 16 14:26:38 PST 2012


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

In gtk-gui.c:set_dc_nickname() the call to remember_dc() perhaps should
be inside the GTK_RESPONSE_ACCEPT branch. This way the user may actually
skip setting the nickname at this point, but then set it the next time
when asked.

This will essentially make the dialog persistent until the user picks
a nickname for this DC.

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
 gtk-gui.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk-gui.c b/gtk-gui.c
index 4d795be..88e71ba 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -2110,8 +2110,8 @@ void set_dc_nickname(struct dive *dive)
 			if (strcmp(dive->dc.model, gtk_entry_get_text(GTK_ENTRY(entry))))
 				dive->dc.nickname = cleanedup_nickname(gtk_entry_get_text(GTK_ENTRY(entry)),
 									sizeof(nickname));
+			remember_dc(dive->dc.deviceid, dive->dc.nickname, TRUE);
 		}
 		gtk_widget_destroy(dialog);
-		remember_dc(dive->dc.deviceid, dive->dc.nickname, TRUE);
 	}
 }
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list