summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gdict-app-menus.ui12
-rw-r--r--src/gdict-app.c16
-rw-r--r--src/gdict-window.c39
3 files changed, 23 insertions, 44 deletions
diff --git a/src/gdict-app-menus.ui b/src/gdict-app-menus.ui
index 7ffcd9a..992fde1 100644
--- a/src/gdict-app-menus.ui
+++ b/src/gdict-app-menus.ui
@@ -2,6 +2,13 @@
<menu id="app-menu">
<section>
<item>
+ <attribute name="label" translatable="yes">_New Window</attribute>
+ <attribute name="action">app.new</attribute>
+ <attribute name="accel">&lt;Primary&gt;n</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
<attribute name="label" translatable="yes">Preferences</attribute>
<attribute name="action">app.preferences</attribute>
</item>
@@ -28,11 +35,6 @@
<attribute name="label" translatable="yes">_File</attribute>
<section>
<item>
- <attribute name="label" translatable="yes">_New</attribute>
- <attribute name="action">win.new</attribute>
- <attribute name="accel">&lt;Primary&gt;n</attribute>
- </item>
- <item>
<attribute name="label" translatable="yes">_Save a Copy...</attribute>
<attribute name="action">win.save-as</attribute>
</item>
diff --git a/src/gdict-app.c b/src/gdict-app.c
index d644d47..89f4659 100644
--- a/src/gdict-app.c
+++ b/src/gdict-app.c
@@ -78,6 +78,21 @@ static GOptionEntry gdict_app_goptions[] = {
};
static void
+gdict_app_cmd_new (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ GdictApp *app = user_data;
+ GtkWidget *window = gdict_window_new (GDICT_WINDOW_ACTION_CLEAR,
+ GTK_APPLICATION (app),
+ app->loader,
+ NULL, NULL, NULL,
+ NULL);
+
+ gtk_widget_show (window);
+}
+
+static void
gdict_app_cmd_preferences (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -147,6 +162,7 @@ gdict_app_cmd_quit (GSimpleAction *action,
static const GActionEntry app_entries[] =
{
+ { "new", gdict_app_cmd_new, NULL, NULL, NULL },
{ "preferences", gdict_app_cmd_preferences, NULL, NULL, NULL },
{ "help", gdict_app_cmd_help, NULL, NULL, NULL },
{ "about", gdict_app_cmd_about, NULL, NULL, NULL },
diff --git a/src/gdict-window.c b/src/gdict-window.c
index d756e64..fb81726 100644
--- a/src/gdict-window.c
+++ b/src/gdict-window.c
@@ -867,44 +867,6 @@ gdict_window_load_state (GdictWindow *window)
}
static void
-gdict_window_cmd_file_new (GSimpleAction *action,
- GVariant *parameter,
- gpointer user_data)
-{
- GdictWindow *window = user_data;
- GtkApplication *application = gtk_window_get_application (GTK_WINDOW (window));
- GtkWidget *new_window;
- gchar *word = NULL;
-
- gdict_window_store_state (window);
-
- word = gdict_defbox_get_selected_word (GDICT_DEFBOX (window->defbox));
- if (word)
- {
- new_window = gdict_window_new (GDICT_WINDOW_ACTION_LOOKUP,
- application,
- window->loader,
- NULL,
- NULL,
- NULL,
- word);
- g_free (word);
- }
- else
- new_window = gdict_window_new (GDICT_WINDOW_ACTION_CLEAR,
- application,
- window->loader,
- NULL,
- NULL,
- NULL,
- NULL);
-
- gtk_widget_show (new_window);
-
- g_signal_emit (window, gdict_window_signals[CREATED], 0, new_window);
-}
-
-static void
gdict_window_cmd_save_as (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -1274,7 +1236,6 @@ gdict_window_cmd_escape (GSimpleAction *action,
static const GActionEntry entries[] =
{
/* File menu */
- { "new", gdict_window_cmd_file_new, NULL, NULL, NULL },
{ "save-as", gdict_window_cmd_save_as, NULL, NULL, NULL },
{ "preview", gdict_window_cmd_file_preview, NULL, NULL, NULL },
{ "print", gdict_window_cmd_file_print, NULL, NULL, NULL },