[gnome-disk-utility] Use libgdu in gnome-disk-image-mounter
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility] Use libgdu in gnome-disk-image-mounter
- Date: Tue, 31 Jul 2012 15:06:43 +0000 (UTC)
commit a3de27431121be04c7f35118474287378cf95cb2
Author: David Zeuthen <zeuthen gmail com>
Date: Tue Jul 31 11:03:03 2012 -0400
Use libgdu in gnome-disk-image-mounter
Signed-off-by: David Zeuthen <zeuthen gmail com>
src/disk-image-mounter/Makefile.am | 2 +-
src/disk-image-mounter/main.c | 29 ++---------------------------
2 files changed, 3 insertions(+), 28 deletions(-)
---
diff --git a/src/disk-image-mounter/Makefile.am b/src/disk-image-mounter/Makefile.am
index 29fc1dc..665a73f 100644
--- a/src/disk-image-mounter/Makefile.am
+++ b/src/disk-image-mounter/Makefile.am
@@ -13,7 +13,6 @@ gnome_disk_image_mounter_CPPFLAGS = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DG_LOG_DOMAIN=\"gnome-disk-image-mounter\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -DUDISKS_API_IS_SUBJECT_TO_CHANGE \
$(NULL)
gnome_disk_image_mounter_CFLAGS = \
@@ -27,6 +26,7 @@ gnome_disk_image_mounter_LDADD = \
$(GLIB2_LIBS) \
$(UDISKS2_LIBS) \
$(GTK3_LIBS) \
+ $(top_builddir)/src/libgdu/libgdu.la \
$(NULL)
clean-local :
diff --git a/src/disk-image-mounter/main.c b/src/disk-image-mounter/main.c
index b69f505..6349960 100644
--- a/src/disk-image-mounter/main.c
+++ b/src/disk-image-mounter/main.c
@@ -28,7 +28,7 @@
#include <gtk/gtk.h>
-#include <udisks/udisks.h>
+#include <libgdu/libgdu.h>
static gboolean have_gtk = FALSE;
static UDisksClient *udisks_client = NULL;
@@ -81,31 +81,6 @@ static const GOptionEntry opt_entries[] =
/* ---------------------------------------------------------------------------------------------------- */
-/* TODO: keep in sync with src/disks/gduutils.c (ideally in shared lib) */
-static void
-_gdu_utils_configure_file_chooser_for_disk_images (GtkFileChooser *file_chooser)
-{
- GtkFileFilter *filter;
- const gchar *folder;
-
- /* Default to the "Documents" folder since that's where we save such images */
- folder = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
- if (folder != NULL)
- gtk_file_chooser_set_current_folder (file_chooser, folder);
-
- /* TODO: define proper mime-types */
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("All Files"));
- gtk_file_filter_add_pattern (filter, "*");
- gtk_file_chooser_add_filter (file_chooser, filter); /* adopts filter */
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("Disk Images (*.img, *.iso)"));
- gtk_file_filter_add_pattern (filter, "*.img");
- gtk_file_filter_add_pattern (filter, "*.iso");
- gtk_file_chooser_add_filter (file_chooser, filter); /* adopts filter */
- gtk_file_chooser_set_filter (file_chooser, filter);
-}
-
static GSList *
do_filechooser (void)
{
@@ -121,7 +96,7 @@ do_filechooser (void)
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("_Mount"), GTK_RESPONSE_ACCEPT,
NULL);
- _gdu_utils_configure_file_chooser_for_disk_images (GTK_FILE_CHOOSER (dialog));
+ gdu_utils_configure_file_chooser_for_disk_images (GTK_FILE_CHOOSER (dialog), TRUE);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (dialog), FALSE);
/* Add a RO check button that defaults to RO */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]