[epiphany/wip/bookmarks-import: 1/2] bookmarks: Add import/export application menu items



commit 75321a41ce8882d24a9a39a955b06f110e7c5fd0
Author: Iulian Radu <iulian radu67 gmail com>
Date:   Mon Nov 21 22:37:21 2016 +0200

    bookmarks: Add import/export application menu items

 src/ephy-shell.c                           |   18 ++++++++++++++++++
 src/resources/epiphany-application-menu.ui |   15 +++++++++++++++
 src/window-commands.c                      |   16 ++++++++++++++++
 src/window-commands.h                      |    6 ++++++
 4 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 67bcf5b..7b5daf4 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -164,6 +164,22 @@ reopen_closed_tab (GSimpleAction *action,
 }
 
 static void
+import_bookmarks (GSimpleAction *action,
+                  GVariant      *parameter,
+                  gpointer      *user_data)
+{
+  window_cmd_import_bookmarks (NULL, NULL, NULL);
+}
+
+static void
+export_bookmarks (GSimpleAction *action,
+                  GVariant      *parameter,
+                  gpointer      *user_data)
+{
+  window_cmd_export_bookmarks (NULL, NULL, NULL);
+}
+
+static void
 show_history (GSimpleAction *action,
               GVariant      *parameter,
               gpointer       user_data)
@@ -234,6 +250,8 @@ quit_application (GSimpleAction *action,
 static GActionEntry app_entries[] = {
   { "new-window", new_window, NULL, NULL, NULL },
   { "new-incognito", new_incognito_window, NULL, NULL, NULL },
+  { "import-bookmarks", import_bookmarks, NULL, NULL, NULL },
+  { "export-bookmarks", export_bookmarks, NULL, NULL, NULL },
   { "history", show_history, NULL, NULL, NULL },
   { "preferences", show_preferences, NULL, NULL, NULL },
   { "shortcuts", show_shortcuts, NULL, NULL, NULL },
diff --git a/src/resources/epiphany-application-menu.ui b/src/resources/epiphany-application-menu.ui
index 2a94d5a..8f6f354 100644
--- a/src/resources/epiphany-application-menu.ui
+++ b/src/resources/epiphany-application-menu.ui
@@ -19,6 +19,21 @@
       </item>
     </section>
     <section>
+      <submenu>
+        <attribute name="label" translatable="yes">_Bookmarks</attribute>
+        <section>
+          <item>
+            <attribute name="label" translatable="yes">I_mport bookmarks</attribute>
+            <attribute name="action">app.import-bookmarks</attribute>
+            <attribute name="accel">&lt;Primary&gt;m</attribute>
+          </item>
+          <item>
+            <attribute name="label" translatable="yes">E_xport bookmarks</attribute>
+            <attribute name="action">app.export-bookmarks</attribute>
+            <attribute name="accel">&lt;Primary&gt;x</attribute>
+          </item>
+        </section>
+      </submenu>
       <item>
         <attribute name="label" translatable="yes">_History</attribute>
         <attribute name="action">app.history</attribute>
diff --git a/src/window-commands.c b/src/window-commands.c
index 030435d..c4fa1aa 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -93,6 +93,22 @@ window_cmd_new_incognito_window (GSimpleAction *action,
 }
 
 void
+window_cmd_import_bookmarks (GSimpleAction *action,
+                             GVariant      *parameter,
+                             gpointer       user_data)
+{
+
+}
+
+void
+window_cmd_export_bookmarks (GSimpleAction *action,
+                             GVariant      *parameter,
+                             gpointer       user_data)
+{
+
+}
+
+void
 window_cmd_show_history (GSimpleAction *action,
                          GVariant      *parameter,
                          gpointer       user_data)
diff --git a/src/window-commands.h b/src/window-commands.h
index df9779a..e8b0831 100644
--- a/src/window-commands.h
+++ b/src/window-commands.h
@@ -32,6 +32,12 @@ void window_cmd_new_window                      (GSimpleAction *action,
 void window_cmd_new_incognito_window            (GSimpleAction *action,
                                                  GVariant      *parameter,
                                                  gpointer       user_data);
+void window_cmd_import_bookmarks                (GSimpleAction *action,
+                                                 GVariant      *parameter,
+                                                 gpointer       user_data);
+void window_cmd_export_bookmarks                (GSimpleAction *action,
+                                                 GVariant      *parameter,
+                                                 gpointer       user_data);
 void window_cmd_show_history                    (GSimpleAction *action,
                                                  GVariant      *parameter,
                                                  gpointer       user_data);


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