1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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);
}
|