summaryrefslogtreecommitdiffstats
path: root/src/nautilus-gdu-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nautilus-gdu-window.c')
-rw-r--r--src/nautilus-gdu-window.c120
1 files changed, 120 insertions, 0 deletions
diff --git a/src/nautilus-gdu-window.c b/src/nautilus-gdu-window.c
new file mode 100644
index 0000000..697ba13
--- /dev/null
+++ b/src/nautilus-gdu-window.c
@@ -0,0 +1,120 @@
+/*
+ * nautilus-gdu-window.c
+ *
+ * Copyright (C) 2008-2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Tomas Bzatek <tbzatek@redhat.com>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h> /* for GETTEXT_PACKAGE */
+#endif
+
+#include "nautilus-gdu.h"
+#include "nautilus-gdu-window.h"
+
+#include <glib/gi18n-lib.h>
+#include <gio/gio.h>
+
+#include <gtk/gtkicontheme.h>
+#include <gtk/gtkwidget.h>
+#include <gtk/gtkmain.h>
+
+#include <gdu/gdu.h>
+#include <gdu-gtk/gdu-gtk.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h> /* for strcmp */
+#include <unistd.h> /* for chdir */
+#include <sys/stat.h>
+
+
+void
+nautilus_gdu_spawn_dialog (GduPresentable *presentable)
+{
+ GtkWidget *dialog;
+ GtkWidget *content_area;
+
+ g_return_if_fail (presentable != NULL);
+ /* TODO: unref presentable when dialog closes */
+
+ dialog = gtk_dialog_new_with_buttons (_("Format disk"), NULL, GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_OK,
+ GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL,
+ GTK_RESPONSE_REJECT,
+ NULL);
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 400);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+
+ GtkWidget *label;
+ GtkWidget *align;
+ GtkWidget *vbox3;
+ GtkWidget *hbox;
+ GtkWidget *image;
+
+ hbox = gtk_hbox_new (FALSE, 10);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, TRUE, 0);
+
+ image = gtk_image_new ();
+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, TRUE, 0);
+// shell->priv->icon_image = image;
+
+ vbox3 = gtk_vbox_new (FALSE, 0);
+ align = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
+ gtk_container_add (GTK_CONTAINER (align), vbox3);
+ gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, TRUE, 0);
+
+ label = gtk_label_new ("488.8MB FAT File System");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, TRUE, 0);
+// shell->priv->name_label = label;
+
+ label = gtk_label_new ("cosi cosi");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, TRUE, 0);
+// shell->priv->details1_label = label;
+
+ label = gtk_label_new ("Partition 1 (MSDOS)");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, TRUE, 0);
+// shell->priv->details2_label = label;
+
+ label = gtk_label_new ("/dev/sdb1 mounted as /mnt/flash");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, TRUE, 0);
+// shell->priv->details3_label = label;
+
+
+
+ GduDevice *device;
+ device = gdu_presentable_get_device (presentable);
+ g_print ("nautilus_gdu_spawn_dialog: presentable name '%s', mounted as %s, \n device %s, object_path %s, uuid %s\n",
+ gdu_presentable_get_name (presentable), gdu_device_get_mount_path (device), gdu_device_get_device_file (device),
+ gdu_device_get_object_path (device), gdu_device_id_get_uuid (device));
+ g_object_unref (device);
+
+
+
+
+
+ gtk_widget_show_all (dialog);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}