aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-03-09 11:31:24 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-03-09 11:31:24 +0800
commitf963cc39a7d21f64f578dae50fd08c44181a3bf6 (patch)
tree7cdf0c0c9bab037272ba6fca48aebbccd4c0de74 /e-util
parent85d0142d21286ce87cd5f6c3d1e2f71aa994151f (diff)
downloadgsoc2013-evolution-f963cc39a7d21f64f578dae50fd08c44181a3bf6.tar
gsoc2013-evolution-f963cc39a7d21f64f578dae50fd08c44181a3bf6.tar.gz
gsoc2013-evolution-f963cc39a7d21f64f578dae50fd08c44181a3bf6.tar.bz2
gsoc2013-evolution-f963cc39a7d21f64f578dae50fd08c44181a3bf6.tar.lz
gsoc2013-evolution-f963cc39a7d21f64f578dae50fd08c44181a3bf6.tar.xz
gsoc2013-evolution-f963cc39a7d21f64f578dae50fd08c44181a3bf6.tar.zst
gsoc2013-evolution-f963cc39a7d21f64f578dae50fd08c44181a3bf6.zip
Cleaning up the attachment bar, centralizing its popup menu, and converting
everything to GtkUIManager/GtkActions. Saving progress mid-stream... not sure about the MIME part utilities yet. Also, add some EActivity subclasses. Considering an EFileActivity subclass for asynchronous GIO operations (loading/saving attachments, etc.), but still ironing out details. svn path=/branches/kill-bonobo/; revision=37389
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-binding.c6
-rw-r--r--e-util/e-util.c27
-rw-r--r--e-util/e-util.h2
3 files changed, 33 insertions, 2 deletions
diff --git a/e-util/e-binding.c b/e-util/e-binding.c
index 26e23ee792..6a29166cc1 100644
--- a/e-util/e-binding.c
+++ b/e-util/e-binding.c
@@ -524,11 +524,13 @@ e_binding_transform_string_to_color (const GValue *src_value,
{
GdkColor color;
const gchar *string;
- gboolean success;
+ gboolean success = FALSE;
string = g_value_get_string (src_value);
- if (gdk_color_parse (string, &color))
+ if (gdk_color_parse (string, &color)) {
g_value_set_boxed (dst_value, &color);
+ success = TRUE;
+ }
return success;
}
diff --git a/e-util/e-util.c b/e-util/e-util.c
index c65fcbceaf..32f6169bd5 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -186,6 +186,33 @@ exit:
}
/**
+ * e_file_open_tmp:
+ * @name_used: location to store the actual named used, or %NULL
+ * @error: return location for a #GError, or %NULL
+ *
+ * Convenience function wraps g_file_open_tmp() but chooses a suitable
+ * filename template using both the package name and the user name.
+ *
+ * Returns: A file handle (as from open()) to the file opened for reading
+ * and writing. The file is opened in binary mode on platforms
+ * where there is a difference. The file handle should be closed
+ * with close(). In case of errors, -1 is returned and @error
+ * will be set.
+ **/
+gint
+e_file_open_tmp (gchar **name_used,
+ GError **error)
+{
+ static gchar *template = NULL;
+
+ if (G_UNLIKELY (template == NULL))
+ template = g_strdup_printf (
+ PACKAGE "-%s-XXXXXX", g_get_user_name ());
+
+ return g_file_open_tmp (template, name_used, error);
+}
+
+/**
* e_load_ui_definition:
* @ui_manager: a #GtkUIManager
* @basename: basename of the UI definition file
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 65e492850f..5f431156eb 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -46,6 +46,8 @@ void e_show_uri (GtkWindow *parent,
const gchar *uri);
void e_display_help (GtkWindow *parent,
const gchar *link_id);
+gint e_file_open_tmp (gchar **name_used,
+ GError **error);
guint e_load_ui_definition (GtkUIManager *ui_manager,
const gchar *basename);
gint e_action_compare_by_label (GtkAction *action1,