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.
This commit is contained in:
Georges Basile Stavracas Neto
2018-07-29 00:54:02 -03:00
parent 862017ab96
commit 89e80e688b
8 changed files with 0 additions and 77 deletions
-7
View File
@@ -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>
-7
View File
@@ -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>
@@ -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
-5
View File
@@ -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
@@ -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
-14
View File
@@ -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,
-40
View File
@@ -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
-2
View File
@@ -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);