[glom/maemo5] Maemo: Fix the build.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glom/maemo5] Maemo: Fix the build.
- Date: Fri, 2 Oct 2009 15:09:08 +0000 (UTC)
commit edc2ef05a797e9cf44413221d55cdf35959e61df
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Oct 2 17:08:59 2009 +0200
Maemo: Fix the build.
* glom/frame_glom.cc:
* glom/import_csv/dialog_import_csv.cc:
* glom/import_csv/dialog_import_csv_progress.cc: Added no-exceptions ifdefs,
and corrected the hildonmm code.
ChangeLog | 9 +++++++++
configure.ac | 2 +-
glom/frame_glom.cc | 7 +++++--
glom/import_csv/dialog_import_csv.cc | 17 ++++++++++++++++-
glom/import_csv/dialog_import_csv_progress.cc | 20 +++++++++++++++++++-
5 files changed, 50 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 42be811..70f3086 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-10-02 Murray Cumming <murrayc murrayc com>
+
+ Maemo: Fix the build.
+
+ * glom/frame_glom.cc:
+ * glom/import_csv/dialog_import_csv.cc:
+ * glom/import_csv/dialog_import_csv_progress.cc: Added no-exceptions ifdefs,
+ and corrected the hildonmm code.
+
1.12.1:
2009-10-02 Murray Cumming <murrayc murrayc com>
diff --git a/configure.ac b/configure.ac
index 9708133..d9bee27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,7 +77,7 @@ AM_CONDITIONAL([HOST_WIN32], [test "x$glom_host_win32" = xyes])
# ./configure --prefix=/usr --enable-postgesql --enable-sqlite --enable-maemo;make all install
# And you might need to do:
# export PYTHON=python2.5
-# export CXXFLAGS="-fno-execptions"
+# export CXXFLAGS="-fno-exceptions"
AC_ARG_ENABLE([maemo],
[AS_HELP_STRING([--enable-maemo],
[build with support for the Maemo platform
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index 559f7f9..87e8307 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -64,6 +64,9 @@
#ifdef GLOM_ENABLE_MAEMO
#include <hildonmm/note.h>
+#include <hildonmm/entry.h>
+#include <hildonmm/text-view.h>
+#include <hildonmm/button.h>
#endif
#include <glom/filechooser_export.h>
@@ -136,7 +139,7 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
#ifndef GLOM_ENABLE_MAEMO
m_pEntry_QuickFind = Gtk::manage(new Gtk::Entry());
#else
- m_pEntry_QuickFind = Gtk::manage(new Hildon::Entry());
+ m_pEntry_QuickFind = Gtk::manage(new Hildon::Entry(Gtk::Hildon::SIZE_AUTO));
#endif
m_pEntry_QuickFind->signal_activate().connect(
sigc::mem_fun(*this, &Frame_Glom::on_button_quickfind) ); //Pressing Enter here is like pressing Find.
@@ -146,7 +149,7 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
m_pButton_QuickFind = Gtk::manage(new Gtk::Button(_("_Find"), true));
#else
m_pButton_QuickFind = Gtk::manage(new Hildon::Button(Gtk::Hildon::SIZE_AUTO,
- Hildon::BUTTON_ARRANGEMENT_VERTICAL, _("Find")));
+ Hildon::BUTTON_ARRANGEMENT_VERTICAL, _("Find"), _("Search for records")));
#endif
m_pButton_QuickFind->signal_clicked().connect(
sigc::mem_fun(*this, &Frame_Glom::on_button_quickfind) );
diff --git a/glom/import_csv/dialog_import_csv.cc b/glom/import_csv/dialog_import_csv.cc
index 66a6cf1..a1a198b 100644
--- a/glom/import_csv/dialog_import_csv.cc
+++ b/glom/import_csv/dialog_import_csv.cc
@@ -725,8 +725,23 @@ void Dialog_Import_CSV::validate_primary_key()
void Dialog_Import_CSV::on_parser_file_read_error(const Glib::ustring& error_message)
{
+ std::string filename;
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ try
+ {
+ filename = Glib::filename_from_uri(m_file_uri);
+ }
+ catch(const Glib::ConvertError& ex)
+ {
+ std::cerr << "Glib::filename_from_uri() failed: " << ex.what() << std::endl;
+ }
+#else
+ std::auto_ptr<Glib::Error> error;
+ filename = Glib::filename_from_uri(m_file_uri, error);
+#endif
+
show_error_dialog(_("Could Not Open file"),
- Glib::ustring::compose(_("The file at \"%1\" could not be opened: %2"), Glib::filename_from_uri(m_file_uri), error_message) );
+ Glib::ustring::compose(_("The file at \"%1\" could not be opened: %2"), filename, error_message) );
}
void Dialog_Import_CSV::on_parser_have_display_name(const Glib::ustring& display_name)
diff --git a/glom/import_csv/dialog_import_csv_progress.cc b/glom/import_csv/dialog_import_csv_progress.cc
index 6a6a224..42994b1 100644
--- a/glom/import_csv/dialog_import_csv_progress.cc
+++ b/glom/import_csv/dialog_import_csv_progress.cc
@@ -60,12 +60,30 @@ void Dialog_Import_CSV_Progress::import(Dialog_Import_CSV& data_source)
switch(data_source.get_parser_state())
{
case CsvParser::STATE_PARSING:
+ {
// Wait for the parsing to finish. We do not start importing before the file has been
// parsed completely since we would not to rollback our changes in case of a
// parsing error.
- m_progress_bar->set_text(Glib::ustring::compose(_("Parsing CSV file %1"), Glib::filename_from_uri(data_source.get_file_uri())));
+
+ std::string filename;
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ try
+ {
+ filename = Glib::filename_from_uri(data_source.get_file_uri());
+ }
+ catch(const Glib::ConvertError& ex)
+ {
+ std::cerr << "Glib::filename_from_uri() failed: " << ex.what() << std::endl;
+ }
+ #else
+ std::auto_ptr<Glib::Error> error;
+ filename = Glib::filename_from_uri(data_source.get_file_uri(), error);
+ #endif
+
+ m_progress_bar->set_text(Glib::ustring::compose(_("Parsing CSV file %1"), filename));
m_ready_connection = data_source.signal_state_changed().connect(sigc::mem_fun(*this, &Dialog_Import_CSV_Progress::on_state_changed));
break;
+ }
case CsvParser::STATE_PARSED:
begin_import();
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]