[gnome-calendar/wip/gbsneto/calendar-popover: 3/4] window: toggle calendar visibility when selecting the row



commit 3d033e1f5fe0776dcd3be2de4d63e56d8ac57675
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Jul 8 20:22:41 2016 -0300

    window: toggle calendar visibility when selecting the row
    
    Instead of opening the calendar for editing, toggle its visibility
    when clicking the listbox row.

 src/gcal-window.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index d99c4cb..369880c 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -910,21 +910,12 @@ source_row_activated (GtkListBox    *listbox,
                       GtkListBoxRow *row,
                       gpointer       user_data)
 {
-  GcalWindow *window;
-  ESource *source;
+  GtkWidget *check;
 
-  window = GCAL_WINDOW (user_data);
-  source = g_object_get_data (G_OBJECT (row), "source");
+  check = g_object_get_data (G_OBJECT (row), "check");
 
-  if (source == NULL)
-    return;
-
-  gcal_source_dialog_set_source (GCAL_SOURCE_DIALOG (window->source_dialog), source);
-  gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (window->source_dialog), GCAL_SOURCE_DIALOG_MODE_EDIT);
-
-  gtk_widget_hide (window->calendar_popover);
-
-  gtk_widget_show (window->source_dialog);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
+                                !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)));
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]