aboutsummaryrefslogtreecommitdiffstats
path: root/ui/profile.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-12-30 19:33:05 +0000
committerGerald Combs <gerald@wireshark.org>2012-12-30 19:33:05 +0000
commit4ca47864db302c67baaccc6de20c974753ec60e5 (patch)
tree2c709c645c5d5f13cab446e4337a35df004122a8 /ui/profile.c
parentaf2b925604c272b2e348e8a1db60d0550961176b (diff)
Move profile deletion code from profile_dlg.c to profile.c. Add left
mouse and context (right mouse) signals to label stacks and use them to pop up profile menus in the status bar. Add profile actions (manage, new, edit, delete) to the profile dialog. svn path=/trunk/; revision=46863
Diffstat (limited to 'ui/profile.c')
-rw-r--r--ui/profile.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/profile.c b/ui/profile.c
index 3d737960a4..f6169477c7 100644
--- a/ui/profile.c
+++ b/ui/profile.c
@@ -395,6 +395,24 @@ profile_name_is_valid(const gchar *name)
return NULL;
}
+gboolean delete_current_profile(void) {
+ const gchar *name = get_profile_name();
+ char *pf_dir_path;
+
+ if (profile_exists(name, FALSE) && strcmp (name, DEFAULT_PROFILE) != 0) {
+ if (delete_persconffile_profile(name, &pf_dir_path) == -1) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "Can't delete profile directory\n\"%s\":\n%s.",
+ pf_dir_path, g_strerror(errno));
+
+ g_free(pf_dir_path);
+ } else {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
/*
* Editor modelines
*