[evolution-kolab] EPlugin: fixed radiobutton groups
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab] EPlugin: fixed radiobutton groups
- Date: Fri, 3 Aug 2012 16:44:30 +0000 (UTC)
commit da057d34df218281cd4029912f58ca9af637218a
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Tue Jul 31 15:41:54 2012 +0200
EPlugin: fixed radiobutton groups
* fixed the GtkRadioButton groups for folder type
(metadata) and access rights (acl) so that really
only one button in the group can be set active
src/eplugin/e-kolab-folder-metadata.c | 60 +++++++++++++++--------------
src/eplugin/e-kolab-folder-permissions.c | 41 ++++++++++----------
2 files changed, 52 insertions(+), 49 deletions(-)
---
diff --git a/src/eplugin/e-kolab-folder-metadata.c b/src/eplugin/e-kolab-folder-metadata.c
index f9a95c5..0f70577 100644
--- a/src/eplugin/e-kolab-folder-metadata.c
+++ b/src/eplugin/e-kolab-folder-metadata.c
@@ -52,6 +52,8 @@ e_kolab_folder_metadata_ui_new (void)
KolabFolderMetaUIData *uidata = g_new0 (KolabFolderMetaUIData, 1);
GtkWidget *widget = NULL;
GtkWidget *grid = NULL;
+ GtkWidget *btn_loco = NULL;
+ GtkWidget *btn = NULL;
uidata->widgets = g_new0 (KolabFolderMetaUIWidgets, 1);
uidata->widgets->container = gtk_frame_new (C_("Kolab Folder Metadata",
@@ -64,35 +66,35 @@ e_kolab_folder_metadata_ui_new (void)
gtk_container_set_border_width (GTK_CONTAINER (grid), 16);
gtk_container_add (GTK_CONTAINER (uidata->widgets->container), grid);
- widget = gtk_radio_button_new_with_label (NULL, C_("Kolab Folder Type",
- "Mail"));
- uidata->widgets->radio_btn_type_mail = widget;
- uidata->widgets->radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget));
- gtk_container_add (GTK_CONTAINER (grid), widget);
-
- widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
- C_("Kolab Folder Type",
- "Calendar"));
- uidata->widgets->radio_btn_type_calendar = widget;
- gtk_container_add (GTK_CONTAINER (grid), widget);
-
- widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
- C_("Kolab Folder Type",
- "Memos"));
- uidata->widgets->radio_btn_type_memos = widget;
- gtk_container_add (GTK_CONTAINER (grid), widget);
-
- widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
- C_("Kolab Folder Type",
- "Tasks"));
- uidata->widgets->radio_btn_type_tasks = widget;
- gtk_container_add (GTK_CONTAINER (grid), widget);
-
- widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
- C_("Kolab Folder Type",
- "Contacts"));
- uidata->widgets->radio_btn_type_contacts = widget;
- gtk_container_add (GTK_CONTAINER (grid), widget);
+ btn_loco = gtk_radio_button_new_with_label (NULL, C_("Kolab Folder Type",
+ "Mail"));
+ uidata->widgets->radio_btn_type_mail = btn_loco;
+ uidata->widgets->radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (btn_loco));
+ gtk_container_add (GTK_CONTAINER (grid), btn_loco);
+
+ btn = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (btn_loco),
+ C_("Kolab Folder Type",
+ "Calendar"));
+ uidata->widgets->radio_btn_type_calendar = btn;
+ gtk_container_add (GTK_CONTAINER (grid), btn);
+
+ btn = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (btn_loco),
+ C_("Kolab Folder Type",
+ "Memos"));
+ uidata->widgets->radio_btn_type_memos = btn;
+ gtk_container_add (GTK_CONTAINER (grid), btn);
+
+ btn = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (btn_loco),
+ C_("Kolab Folder Type",
+ "Tasks"));
+ uidata->widgets->radio_btn_type_tasks = btn;
+ gtk_container_add (GTK_CONTAINER (grid), btn);
+
+ btn = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (btn_loco),
+ C_("Kolab Folder Type",
+ "Contacts"));
+ uidata->widgets->radio_btn_type_contacts = btn;
+ gtk_container_add (GTK_CONTAINER (grid), btn);
/* FIXME connect signals */
g_warning ("%s: FIXME connect signals", __func__);
diff --git a/src/eplugin/e-kolab-folder-permissions.c b/src/eplugin/e-kolab-folder-permissions.c
index e7a63fc..b357571 100644
--- a/src/eplugin/e-kolab-folder-permissions.c
+++ b/src/eplugin/e-kolab-folder-permissions.c
@@ -74,6 +74,7 @@ kolab_folder_permissions_ui_edit_dialog_cb (KolabFolderPermUIData *uidata)
GtkWidget *label = NULL;
GtkWidget *entry = NULL;
GtkWidget *frame = NULL;
+ GtkWidget *btn_loco = NULL;
GtkWidget *btn = NULL;
GtkWidget *grid = NULL;
GtkWidget *widget = NULL;
@@ -128,44 +129,44 @@ kolab_folder_permissions_ui_edit_dialog_cb (KolabFolderPermUIData *uidata)
row = 0;
- widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
- C_("Kolab Folder Permissions",
- "Read"));
- uidata->widgets->radio_btn_perm_read = widget;
- gtk_grid_attach (GTK_GRID (grid), widget, 0, row, 1, 1);
+ btn_loco = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
+ C_("Kolab Folder Permissions",
+ "Read"));
+ uidata->widgets->radio_btn_perm_read = btn_loco;
+ gtk_grid_attach (GTK_GRID (grid), btn_loco, 0, row, 1, 1);
widget = gtk_label_new ("(lrs)");
gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
gtk_grid_attach (GTK_GRID (grid), widget, 1, row, 1, 1);
row++;
- widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
- C_("Kolab Folder Permissions",
- "Append"));
- uidata->widgets->radio_btn_perm_append = widget;
- gtk_grid_attach (GTK_GRID (grid), widget, 0, row, 1, 1);
+ btn = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (btn_loco),
+ C_("Kolab Folder Permissions",
+ "Append"));
+ uidata->widgets->radio_btn_perm_append = btn;
+ gtk_grid_attach (GTK_GRID (grid), btn, 0, row, 1, 1);
widget = gtk_label_new ("(lrsip)");
gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
gtk_grid_attach (GTK_GRID (grid), widget, 1, row, 1, 1);
row++;
- widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
- C_("Kolab Folder Permissions",
- "Write"));
- uidata->widgets->radio_btn_perm_write = widget;
- gtk_grid_attach (GTK_GRID (grid), widget, 0, row, 1, 1);
+ btn = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (btn_loco),
+ C_("Kolab Folder Permissions",
+ "Write"));
+ uidata->widgets->radio_btn_perm_write = btn;
+ gtk_grid_attach (GTK_GRID (grid), btn, 0, row, 1, 1);
widget = gtk_label_new ("(lrswipte)");
gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
gtk_grid_attach (GTK_GRID (grid), widget, 1, row, 1, 1);
row++;
- widget = gtk_radio_button_new_with_label (uidata->widgets->radio_group,
- C_("Kolab Folder Permissions",
- "All"));
- uidata->widgets->radio_btn_perm_all = widget;
- gtk_grid_attach (GTK_GRID (grid), widget, 0, row, 1, 1);
+ btn = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (btn_loco),
+ C_("Kolab Folder Permissions",
+ "All"));
+ uidata->widgets->radio_btn_perm_all = btn;
+ gtk_grid_attach (GTK_GRID (grid), btn, 0, row, 1, 1);
widget = gtk_label_new ("(lrswipakxte)");
gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
gtk_grid_attach (GTK_GRID (grid), widget, 1, row, 1, 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]