[gnote] * Should build with Gtk+2.12 and Gtkmm 2.12 (Closes #580250) (Robert Millan)
- From: Hubert Figuière <hub src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnote] * Should build with Gtk+2.12 and Gtkmm 2.12 (Closes #580250) (Robert Millan)
- Date: Sun, 26 Apr 2009 21:53:11 -0400 (EDT)
commit 44f8b7d74ab9b61ec4abd3ef63d86e1a092df683
Author: Robert Millan <rmh aybabtu com>
Date: Sun Apr 26 21:28:19 2009 -0400
* Should build with Gtk+2.12 and Gtkmm 2.12 (Closes #580250) (Robert Millan)
Signed-off-by: Hubert Figuiere <hub figuiere net>
---
NEWS | 1 +
README | 12 ++++++++++--
configure.ac | 11 ++++++++---
src/utils.cpp | 14 +++++++++++++-
src/watchers.cpp | 2 ++
5 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index 3d347bc..4cbf0f6 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ New features:
Fixes:
* Should now build if Gtk+ 2.16 is present but not Gtkmm 2.16.
+ * Should build with Gtk+ 2.12 and Gtkmm 2.12 (Closes #580250) (Robert Millan)
Translations:
diff --git a/README b/README
index f8dbb1d..bbb45dc 100644
--- a/README
+++ b/README
@@ -6,11 +6,19 @@ Gnote is a C++ port of Tomboy
I wrote this as an experiment, and the emphasis has been put on making
it a clone as close as possible to the original.
-Installing
-----------
+Compiling
+---------
See the INSTALL file.
+Dependencies:
+- Gtkmm 2.12 minimum (Gtkmm 2.14 recommended)
+- Gtk+ 2.12.
+- Libxml++ 2.6 or later (2.26 recommended)
+- libuuid
+- boost 1.34
+- (optional) gtk-spell 2.0.9
+
Importing Tomboy notes
----------------------
diff --git a/configure.ac b/configure.ac
index 7dba504..e24de81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,9 +23,7 @@ AC_SUBST(GNOTE_VERSION)
dnl all the library version.
dnl if one is harcoded elsewhere, it is a bug
-dnl 2.14 needed for gtk_show_uri(). Possibly replacable by gnomevfs or what not
-dnl to backport.
-GTK_VERSION=2.14
+GTK_VERSION=2.12
LIBGLIBMM_VERSION=2.0
LIBGTKMM_VERSION=2.12.0
dnl LIBGLADEMM_VERSION=2.6.0
@@ -76,6 +74,13 @@ dnl PKG_CHECK_MODULES(LIBGLADEMM, [libglademm-2.4 >= $LIBGLADEMM_VERSION])
dnl PKG_CHECK_MODULES(LIBGNOMEUI, [libgnomeui-2.0 >= $LIBGNOMEUI_VERSION])
dnl PKG_CHECK_MODULES(LIBGCONFMM, [gconfmm-2.6 >= $LIBGCONFMM_VERSION])
+PKG_CHECK_EXISTS(gtk+-2.0 >= 2.14.0,
+ [AC_DEFINE(HAVE_GTK_SHOW_URI, 1, [Define to 1 if you have gtk_show_uri])],
+ [])
+PKG_CHECK_EXISTS(gtkmm-2.4 >= 2.14.0,
+ [AC_DEFINE(HAVE_CLASS_GTK__WIDGET_SIGNAL_POPUP_MENU, 1, [Define to 1 if class Gtk::Widget has signal_popup_menu])],
+ [])
+
dnl check for the ext2 uuid library. TODO replace it with something more portable
AC_CHECK_HEADER(uuid/uuid.h,,[AC_MSG_ERROR("uuid header is missing")])
AC_CHECK_LIB(uuid,uuid_unparse_lower, ,[AC_MSG_ERROR("libuuid library is missing")])
diff --git a/src/utils.cpp b/src/utils.cpp
index f5147e0..7164d23 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -18,6 +18,9 @@
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <iostream>
#include <algorithm>
@@ -28,6 +31,7 @@
#include <gtk/gtk.h>
#include <glibmm/i18n.h>
+#include <glibmm/spawn.h>
#include <gtkmm/icontheme.h>
#include <gtkmm/image.h>
#include <gtkmm/stock.h>
@@ -105,7 +109,7 @@ namespace gnote {
Glib::RefPtr<Gdk::Pixbuf> get_icon(const std::string & name, int size)
{
try {
- return Gtk::IconTheme::get_default()->load_icon(name, size);
+ return Gtk::IconTheme::get_default()->load_icon(name, size, (Gtk::IconLookupFlags) 0);
}
catch(const Glib::Exception & e)
{
@@ -123,6 +127,7 @@ namespace gnote {
}
GError *error = NULL;
+#ifdef HAVE_GTK_SHOW_URI
if(!gtk_show_uri (screen, uri.c_str(), gtk_get_current_event_time (), &error)) {
std::string message = _("The \"Gnote Manual\" could "
@@ -140,6 +145,9 @@ namespace gnote {
g_error_free(error);
}
}
+#else
+ Glib::spawn_command_line_async ("xdg-open " + uri);
+#endif
}
@@ -149,7 +157,11 @@ namespace gnote {
if(!url.empty()) {
GError *err = NULL;
DBG_OUT("Opening url '%s'...", url.c_str());
+#ifdef HAVE_GTK_SHOW_URI
gtk_show_uri (NULL, url.c_str(), GDK_CURRENT_TIME, &err);
+#else
+ Glib::spawn_command_line_async ("xdg-open " + url);
+#endif
if(err) {
throw Glib::Error(err, true);
}
diff --git a/src/watchers.cpp b/src/watchers.cpp
index d5a1aa4..061e891 100644
--- a/src/watchers.cpp
+++ b/src/watchers.cpp
@@ -445,8 +445,10 @@ namespace gnote {
sigc::mem_fun(*this, &NoteUrlWatcher::on_button_press), false);
editor->signal_populate_popup().connect(
sigc::mem_fun(*this, &NoteUrlWatcher::on_populate_popup));
+#ifdef HAVE_CLASS_GTK__WIDGET_SIGNAL_POPUP_MENU
editor->signal_popup_menu().connect(
sigc::mem_fun(*this, &NoteUrlWatcher::on_popup_menu), false);
+#endif
}
std::string NoteUrlWatcher::get_url(const Gtk::TextIter & start, const Gtk::TextIter & end)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]