[gnote] Allow main window actions with gint32 state
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Allow main window actions with gint32 state
- Date: Wed, 30 Dec 2015 18:38:13 +0000 (UTC)
commit d81368116e694147f7456f7aee36f3863baa11ba
Author: Aurimas Černius <aurisc4 gmail com>
Date: Wed Dec 30 20:12:25 2015 +0200
Allow main window actions with gint32 state
src/mainwindowaction.cpp | 10 ++++++++++
src/mainwindowaction.hpp | 2 ++
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/mainwindowaction.cpp b/src/mainwindowaction.cpp
index 3252f7b..cdec6f8 100644
--- a/src/mainwindowaction.cpp
+++ b/src/mainwindowaction.cpp
@@ -31,6 +31,11 @@ MainWindowAction::Ptr MainWindowAction::create(const Glib::ustring & name, bool
return Ptr(new MainWindowAction(name, state));
}
+MainWindowAction::Ptr MainWindowAction::create(const Glib::ustring & name, int state)
+{
+ return Ptr(new MainWindowAction(name, state));
+}
+
MainWindowAction::Ptr MainWindowAction::create(const Glib::ustring & name, const Glib::ustring & state)
{
return Ptr(new MainWindowAction(name, state));
@@ -46,6 +51,11 @@ MainWindowAction::MainWindowAction(const Glib::ustring & name, bool state)
{
}
+MainWindowAction::MainWindowAction(const Glib::ustring & name, int state)
+ : Gio::SimpleAction(name, Glib::VARIANT_TYPE_INT32, Glib::Variant<gint32>::create(state))
+{
+}
+
MainWindowAction::MainWindowAction(const Glib::ustring & name, const Glib::ustring & state)
: Gio::SimpleAction(name, Glib::VARIANT_TYPE_STRING, Glib::Variant<Glib::ustring>::create(state))
{
diff --git a/src/mainwindowaction.hpp b/src/mainwindowaction.hpp
index 9439338..bdb7f10 100644
--- a/src/mainwindowaction.hpp
+++ b/src/mainwindowaction.hpp
@@ -35,6 +35,7 @@ public:
static Ptr create(const Glib::ustring & name);
static Ptr create(const Glib::ustring & name, bool state);
+ static Ptr create(const Glib::ustring & name, int state);
static Ptr create(const Glib::ustring & name, const Glib::ustring & state);
void set_state(const Glib::VariantBase & value)
@@ -44,6 +45,7 @@ public:
protected:
MainWindowAction(const Glib::ustring & name);
MainWindowAction(const Glib::ustring & name, bool state);
+ MainWindowAction(const Glib::ustring & name, int state);
MainWindowAction(const Glib::ustring & name, const Glib::ustring & state);
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]