[gnote] Update GTG export for popover



commit 0d4aa3524dae4aa86be968ebcb88d4712ac950c7
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Jan 3 13:47:18 2016 +0200

    Update GTG export for popover

 src/addins/exporttogtg/exporttogtg.desktop.in.in |    4 +++-
 src/addins/exporttogtg/exporttogtgnoteaddin.cpp  |   21 +++++++++++++--------
 src/addins/exporttogtg/exporttogtgnoteaddin.hpp  |    5 +++--
 3 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/src/addins/exporttogtg/exporttogtg.desktop.in.in 
b/src/addins/exporttogtg/exporttogtg.desktop.in.in
index a2d1307..1249570 100644
--- a/src/addins/exporttogtg/exporttogtg.desktop.in.in
+++ b/src/addins/exporttogtg/exporttogtg.desktop.in.in
@@ -4,8 +4,10 @@ _Name=Export to Getting Things GNOME
 _Description=Exports individual notes as Getting Things GNOME tasks
 _Authors=Aurimas Černius
 Category=Tools
-Version=0.1
+Version=0.2
 DefaultEnabled=false
 Module=exporttogtg
 LibgnoteRelease= LIBGNOTE_RELEASE@
 LibgnoteVersionInfo= LIBGNOTE_VERSION_INFO@
+[Actions]
+actions_void=exporttogtg-export
diff --git a/src/addins/exporttogtg/exporttogtgnoteaddin.cpp b/src/addins/exporttogtg/exporttogtgnoteaddin.cpp
index 2d23e19..871f001 100644
--- a/src/addins/exporttogtg/exporttogtgnoteaddin.cpp
+++ b/src/addins/exporttogtg/exporttogtgnoteaddin.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2013-2014 Aurimas Cernius
+ * Copyright (C) 2013-2014,2016 Aurimas Cernius
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -67,16 +67,21 @@ void ExportToGTGNoteAddin::shutdown()
 
 void ExportToGTGNoteAddin::on_note_opened()
 {
-  Glib::RefPtr<gnote::NoteWindow::NonModifyingAction> action =
-    gnote::NoteWindow::NonModifyingAction::create("ExportToGTGAction", _("Export to Getting Things GNOME"),
-                                                  _("Export note as Getting Things GNOME task"));
-  action->signal_activate().connect(
-    sigc::mem_fun(*this, &ExportToGTGNoteAddin::export_button_clicked));
-  add_note_action(action, gnote::EXPORT_TO_GTG_ORDER);
+  register_main_window_action_callback("exporttogtg-export", sigc::mem_fun(*this,
+    &ExportToGTGNoteAddin::export_button_clicked));
 }
 
 
-void ExportToGTGNoteAddin::export_button_clicked()
+std::map<int, Gtk::Widget*> ExportToGTGNoteAddin::get_actions_popover_widgets() const
+{
+  auto widgets = NoteAddin::get_actions_popover_widgets();
+  auto button = gnote::utils::create_popover_button("win.exporttogtg-export", _("Export to Getting Things 
GNOME"));
+  gnote::utils::add_item_to_ordered_map(widgets, gnote::EXPORT_TO_GTG_ORDER, button);
+  return widgets;
+}
+
+
+void ExportToGTGNoteAddin::export_button_clicked(const Glib::VariantBase&)
 {
   try {
     if (s_gtg_interface == 0) {
diff --git a/src/addins/exporttogtg/exporttogtgnoteaddin.hpp b/src/addins/exporttogtg/exporttogtgnoteaddin.hpp
index b70a580..d623253 100644
--- a/src/addins/exporttogtg/exporttogtgnoteaddin.hpp
+++ b/src/addins/exporttogtg/exporttogtgnoteaddin.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2013 Aurimas Cernius
+ * Copyright (C) 2013,2016 Aurimas Cernius
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -56,8 +56,9 @@ public:
   virtual void initialize() override;
   virtual void shutdown() override;
   virtual void on_note_opened() override;
+  virtual std::map<int, Gtk::Widget*> get_actions_popover_widgets() const override;
 private:
-  void export_button_clicked();
+  void export_button_clicked(const Glib::VariantBase&);
 
   static Glib::RefPtr<Gio::DBus::InterfaceInfo> s_gtg_interface;
 };


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