[gnome-calendar] appmenu: Remove "New Event" entry



commit 89e80e688b970f5ea13c7b39ea64ff05ee9c7af1
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Jul 28 19:58:02 2018 -0300

    appmenu: Remove "New Event" entry
    
    The "New Event" menu item is confusing and misleading, since
    it is contextless item that has a context-aware action. The
    result varies depending on which view you are, but this is in
    no way communicated.
    
    So just remove that, and all the GcalWindow API that is not
    used anymore altogether.

 data/ui/menus.ui                           |  7 ------
 data/ui/window.ui                          |  7 ------
 doc/reference/gnome-calendar-decl-list.txt |  1 -
 doc/reference/gnome-calendar-decl.txt      |  5 ----
 doc/reference/gnome-calendar-sections.txt  |  1 -
 src/gcal-application.c                     | 14 -----------
 src/gcal-window.c                          | 40 ------------------------------
 src/gcal-window.h                          |  2 --
 8 files changed, 77 deletions(-)
---
diff --git a/data/ui/menus.ui b/data/ui/menus.ui
index 7c9f167e..a1fd8f36 100644
--- a/data/ui/menus.ui
+++ b/data/ui/menus.ui
@@ -1,13 +1,6 @@
 <?xml version="1.0"?>
 <interface>
   <menu id="app-menu">
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">Add Eve_nt…</attribute>
-        <attribute name="action">app.new</attribute>
-        <attribute name="accel">&lt;Primary&gt;n</attribute>
-      </item>
-    </section>
     <section>
       <item>
         <attribute name="label" translatable="yes">_Calendars</attribute>
diff --git a/data/ui/window.ui b/data/ui/window.ui
index 171134da..b3448c80 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -386,13 +386,6 @@
             <property name="margin">12</property>
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkModelButton">
-                <property name="text" translatable="yes">Add Eve_nt</property>
-                <property name="action-name">app.new</property>
-                <property name="visible">True</property>
-              </object>
-            </child>
 
             <!-- Synchronize -->
             <child>
diff --git a/doc/reference/gnome-calendar-decl-list.txt b/doc/reference/gnome-calendar-decl-list.txt
index fdf0fe86..393afce2 100644
--- a/doc/reference/gnome-calendar-decl-list.txt
+++ b/doc/reference/gnome-calendar-decl-list.txt
@@ -542,7 +542,6 @@ GcalWeekView
 <FILE>gcal-window</FILE>
 GCAL_TYPE_WINDOW
 gcal_window_new_with_view_and_date
-gcal_window_new_event
 gcal_window_set_search_mode
 gcal_window_set_search_query
 gcal_window_open_event_by_uuid
diff --git a/doc/reference/gnome-calendar-decl.txt b/doc/reference/gnome-calendar-decl.txt
index 05e28682..77d0ee19 100644
--- a/doc/reference/gnome-calendar-decl.txt
+++ b/doc/reference/gnome-calendar-decl.txt
@@ -722,11 +722,6 @@ GcalShellSearchProvider *search_provider, GcalManager             *manager
 GcalApplication     *app, GcalWindowViewType   view_type, icaltimetype        *date
 </FUNCTION>
 <FUNCTION>
-<NAME>gcal_window_new_event</NAME>
-<RETURNS>void                  </RETURNS>
-GcalWindow          *self
-</FUNCTION>
-<FUNCTION>
 <NAME>gcal_window_set_search_mode</NAME>
 <RETURNS>void                  </RETURNS>
 GcalWindow          *self, gboolean             enabled
diff --git a/doc/reference/gnome-calendar-sections.txt b/doc/reference/gnome-calendar-sections.txt
index ed99d871..8b273956 100644
--- a/doc/reference/gnome-calendar-sections.txt
+++ b/doc/reference/gnome-calendar-sections.txt
@@ -561,7 +561,6 @@ GcalWeekView
 <TITLE>GcalWindow</TITLE>
 GCAL_TYPE_WINDOW
 gcal_window_new_with_view_and_date
-gcal_window_new_event
 gcal_window_set_search_mode
 gcal_window_set_search_query
 gcal_window_open_event_by_uuid
diff --git a/src/gcal-application.c b/src/gcal-application.c
index 31d95513..4040fcec 100644
--- a/src/gcal-application.c
+++ b/src/gcal-application.c
@@ -59,10 +59,6 @@ struct _GcalApplication
   GcalClock          *clock;
 };
 
-static void     gcal_application_create_new_event     (GSimpleAction           *new_event,
-                                                       GVariant                *parameter,
-                                                       gpointer                 app);
-
 static void     gcal_application_launch_search        (GSimpleAction           *search,
                                                        GVariant                *parameter,
                                                        gpointer                 app);
@@ -113,7 +109,6 @@ static GOptionEntry gcal_application_goptions[] = {
 };
 
 static const GActionEntry gcal_app_entries[] = {
-  { "new",    gcal_application_create_new_event },
   { "sync",   gcal_application_sync },
   { "search", gcal_application_launch_search },
   { "about",  gcal_application_show_about },
@@ -555,15 +550,6 @@ gcal_application_init (GcalApplication *self)
   self->search_provider = gcal_shell_search_provider_new (self->manager);
 }
 
-static void
-gcal_application_create_new_event (GSimpleAction *new_event,
-                                   GVariant      *parameter,
-                                   gpointer       app)
-{
-  GcalApplication *self = GCAL_APPLICATION (app);
-  gcal_window_new_event (GCAL_WINDOW (self->window));
-}
-
 static void
 gcal_application_sync (GSimpleAction *sync,
                        GVariant      *parameter,
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 8ea7fa62..5f2830fc 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -1604,46 +1604,6 @@ gcal_window_new_with_date (GcalApplication *app,
                        NULL);
 }
 
-/* new-event interaction: first variant */
-/**
- * gcal_window_new_event:
- * @self: a #GcalWindow
- *
- * Makes #GcalWindow create a new event.
- */
-void
-gcal_window_new_event (GcalWindow *self)
-{
-  g_autoptr (GDateTime) start_date, end_date;
-
-  /* 1st and 2nd steps */
-  set_new_event_mode (self, TRUE);
-
-  start_date = g_date_time_new_now_local ();
-
-  /* adjusting dates according to the actual view */
-  switch (self->active_view)
-    {
-    case GCAL_WINDOW_VIEW_DAY:
-    case GCAL_WINDOW_VIEW_WEEK:
-      end_date = g_date_time_add_hours (start_date, 1);
-      break;
-
-    case GCAL_WINDOW_VIEW_MONTH:
-    case GCAL_WINDOW_VIEW_YEAR:
-      end_date = g_date_time_add_days (start_date, 1);
-      break;
-
-    case GCAL_WINDOW_VIEW_LIST:
-    case GCAL_WINDOW_VIEW_SEARCH:
-    default:
-      end_date = g_date_time_add_days (start_date, 1);
-      break;
-    }
-
-  create_event_detailed_cb (NULL, start_date, end_date, self);
-}
-
 /**
  * gcal_window_set_search_mode:
  * @self: a #GcalWindow
diff --git a/src/gcal-window.h b/src/gcal-window.h
index e4a52767..8b7c55f9 100644
--- a/src/gcal-window.h
+++ b/src/gcal-window.h
@@ -35,8 +35,6 @@ G_DECLARE_FINAL_TYPE (GcalWindow, gcal_window, GCAL, WINDOW, GtkApplicationWindo
 GtkWidget*           gcal_window_new_with_date                  (GcalApplication     *app,
                                                                  icaltimetype        *date);
 
-void                 gcal_window_new_event                      (GcalWindow          *self);
-
 void                 gcal_window_set_search_mode                (GcalWindow          *self,
                                                                  gboolean             enabled);
 


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