[gnome-disk-utility] update to latest DKD API where erase= and tasks within jobs has been removed
- From: David Zeuthen <davidz src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-disk-utility] update to latest DKD API where erase= and tasks within jobs has been removed
- Date: Thu, 2 Apr 2009 17:32:38 -0400 (EDT)
commit 12cdfc1bf3bdc4c8b17a3906b29d4532da1053fc
Author: David Zeuthen <davidz redhat com>
Date: Thu Apr 2 17:30:09 2009 -0400
update to latest DKD API where erase= and tasks within jobs has been removed
---
src/gdu-gtk/gdu-gtk.c | 131 ++------------------
src/gdu-gtk/gdu-gtk.h | 17 +--
src/gdu/gdu-device.c | 69 +---------
src/gdu/gdu-device.h | 10 +--
src/gdu/gdu-marshal.list | 4 +-
src/gdu/gdu-pool.c | 18 +---
src/gdu/gdu-private.h | 5 +-
src/gdu/gdu-util.c | 70 ++---------
src/gdu/gdu-util.h | 3 -
.../gdu-section-create-partition-table.c | 18 +--
src/palimpsest/gdu-section-job.c | 24 +----
src/palimpsest/gdu-section-linux-md-drive.c | 17 +--
src/palimpsest/gdu-section-partition.c | 18 +--
src/palimpsest/gdu-section-unallocated.c | 1 -
src/palimpsest/gdu-section-unrecognized.c | 12 +--
src/palimpsest/gdu-shell.c | 18 +--
16 files changed, 72 insertions(+), 363 deletions(-)
diff --git a/src/gdu-gtk/gdu-gtk.c b/src/gdu-gtk/gdu-gtk.c
index fab6ba0..399c747 100644
--- a/src/gdu-gtk/gdu-gtk.c
+++ b/src/gdu-gtk/gdu-gtk.c
@@ -1108,38 +1108,30 @@ out:
* gdu_util_delete_confirmation_dialog:
* @parent_window: parent window for transient dialog
* @title: the title of the dialog
- * @show_secure_erase_combo_box: %TRUE to include secure erase combo box
* @primary_text: primary text
* @secondary_text: secondary text
* @affirmative_action_button_mnemonic: text to use on the affirmative action button
*
- * Utility to show a confirmation dialog for deletion. If @show_secure_erase_combo_box is %TRUE
- * a combo box allowing the user to choose the secure erase option will be shown, otherwise
- * "none" will be returned (unless the user cancelled the dialog).
+ * Utility to show a confirmation dialog for deletion.
*
- * Returns: %NULL if the user canceled, otherwise the secure erase
- * type. Must be freed by the caller.
+ * Returns: %FALSE if the user canceled, otherwise %TRUE.
**/
-char *
+gboolean
gdu_util_delete_confirmation_dialog (GtkWidget *parent_window,
const char *title,
- gboolean show_secure_erase_combo_box,
const char *primary_text,
const char *secondary_text,
const char *affirmative_action_button_mnemonic)
{
- int response;
+ gboolean ret;
+ gint response;
GtkWidget *dialog;
- char *secure_erase;
GtkWidget *hbox;
GtkWidget *image;
GtkWidget *main_vbox;
GtkWidget *label;
- int row;
- GtkWidget *combo_box;
- GtkWidget *table;
- secure_erase = NULL;
+ ret = FALSE;
dialog = gtk_dialog_new_with_buttons (title,
GTK_WINDOW (parent_window),
@@ -1175,58 +1167,21 @@ gdu_util_delete_confirmation_dialog (GtkWidget *parent_window,
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (label), FALSE, FALSE, 0);
- if (show_secure_erase_combo_box) {
- row = 0;
-
- table = gtk_table_new (2, 2, FALSE);
- gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
-
- /* secure erase */
- label = gtk_label_new (NULL);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
- gtk_label_set_markup_with_mnemonic (GTK_LABEL (label), _("_Secure Erase:"));
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row + 1,
- GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
- combo_box = gdu_util_secure_erase_combo_box_create ();
- gtk_table_attach (GTK_TABLE (table), combo_box, 1, 2, row, row + 1,
- GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo_box);
-
- row++;
-
- /* secure erase desc */
- label = gtk_label_new (NULL);
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
- gtk_label_set_width_chars (GTK_LABEL (label), 40);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach (GTK_TABLE (table), label, 1, 2, row, row + 1,
- GTK_FILL, GTK_EXPAND | GTK_FILL, 2, 2);
- gdu_util_secure_erase_combo_box_set_desc_label (combo_box, label);
-
- row++;
- }
-
gtk_widget_grab_focus (gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL));
gtk_dialog_add_button (GTK_DIALOG (dialog), affirmative_action_button_mnemonic, 0);
gtk_widget_show_all (dialog);
response = gtk_dialog_run (GTK_DIALOG (dialog));
- if (show_secure_erase_combo_box) {
- secure_erase = gdu_util_secure_erase_combo_box_get_selected (combo_box);
- } else {
- secure_erase = g_strdup ("none");
- }
-
gtk_widget_destroy (dialog);
if (response != 0) {
- g_free (secure_erase);
- secure_erase = NULL;
goto out;
}
+ ret = TRUE;
+
out:
- return secure_erase;
+ return ret;
}
/* ---------------------------------------------------------------------------------------------------- */
@@ -1712,74 +1667,6 @@ gdu_util_part_table_type_combo_box_get_selected (GtkWidget *combo_box)
/* ---------------------------------------------------------------------------------------------------- */
-static void
-gdu_util_secure_erase_combo_box_update_desc_label (GtkWidget *combo_box)
-{
- GtkWidget *desc_label;
-
- desc_label = g_object_get_data (G_OBJECT (combo_box), "gdu-desc-label");
- if (desc_label != NULL) {
- char *s;
- char *secure_erase;
- char *secure_erase_desc;
-
- secure_erase = gdu_util_secure_erase_combo_box_get_selected (combo_box);
- secure_erase_desc = gdu_util_secure_erase_get_description (secure_erase);
- s = g_strdup_printf ("<small><i>%s</i></small>", secure_erase_desc);
- gtk_label_set_markup (GTK_LABEL (desc_label), s);
- g_free (s);
- g_free (secure_erase_desc);
- g_free (secure_erase);
- }
-}
-
-static void
-gdu_util_secure_erase_combo_box_changed (GtkWidget *combo_box, gpointer user_data)
-{
- gdu_util_secure_erase_combo_box_update_desc_label (combo_box);
-}
-
-GtkWidget *
-gdu_util_secure_erase_combo_box_create (void)
-{
- GtkWidget *combo_box;
-
- combo_box = gtk_combo_box_new_text ();
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), _("Don't overwrite data"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), _("Overwrite data"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), _("Overwrite data 3 times"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), _("Overwrite data 7 times"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), _("Overwrite data 35 times"));
- gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); /* read default from gconf; use lockdown too */
-
- g_signal_connect (combo_box, "changed", (GCallback) gdu_util_secure_erase_combo_box_changed, NULL);
- return combo_box;
-}
-
-char *
-gdu_util_secure_erase_combo_box_get_selected (GtkWidget *combo_box)
-{
- const char *result[] = {"none", "full", "full3pass", "full7pass", "full35pass"};
- int active;
-
- active = gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box));
- g_assert (active >= 0 && active < (int) sizeof (result));
- return g_strdup (result[active]);
-}
-
-void
-gdu_util_secure_erase_combo_box_set_desc_label (GtkWidget *combo_box, GtkWidget *desc_label)
-{
- g_object_set_data_full (G_OBJECT (combo_box),
- "gdu-desc-label",
- g_object_ref (desc_label),
- g_object_unref);
-
- gdu_util_secure_erase_combo_box_update_desc_label (combo_box);
-}
-
-/* ---------------------------------------------------------------------------------------------------- */
-
GdkPixbuf *
gdu_util_get_pixbuf_for_presentable (GduPresentable *presentable, GtkIconSize size)
{
diff --git a/src/gdu-gtk/gdu-gtk.h b/src/gdu-gtk/gdu-gtk.h
index 0b6052c..7bc191b 100644
--- a/src/gdu-gtk/gdu-gtk.h
+++ b/src/gdu-gtk/gdu-gtk.h
@@ -55,12 +55,11 @@ gboolean gdu_util_dialog_change_secret (GtkWidget *parent_window,
gboolean bypass_keyring,
gboolean indicate_wrong_passphrase);
-char *gdu_util_delete_confirmation_dialog (GtkWidget *parent_window,
- const char *title,
- gboolean show_secure_erase_combo_box,
- const char *primary_text,
- const char *secondary_text,
- const char *affirmative_action_button_mnemonic);
+gboolean gdu_util_delete_confirmation_dialog (GtkWidget *parent_window,
+ const char *title,
+ const char *primary_text,
+ const char *secondary_text,
+ const char *affirmative_action_button_mnemonic);
/* ---------------------------------------------------------------------------------------------------- */
@@ -76,12 +75,6 @@ char *gdu_util_fstype_combo_box_get_selected (GtkWidget *combo_box);
/* ---------------------------------------------------------------------------------------------------- */
-GtkWidget *gdu_util_secure_erase_combo_box_create (void);
-void gdu_util_secure_erase_combo_box_set_desc_label (GtkWidget *combo_box, GtkWidget *desc_label);
-char *gdu_util_secure_erase_combo_box_get_selected (GtkWidget *combo_box);
-
-/* ---------------------------------------------------------------------------------------------------- */
-
GtkWidget *gdu_util_part_type_combo_box_create (const char *part_scheme);
void gdu_util_part_type_combo_box_rebuild (GtkWidget *combo_box,
const char *part_scheme);
diff --git a/src/gdu/gdu-device.c b/src/gdu/gdu-device.c
index b5debf4..2bca4d4 100644
--- a/src/gdu/gdu-device.c
+++ b/src/gdu/gdu-device.c
@@ -79,10 +79,7 @@ typedef struct
char *job_id;
uid_t job_initiated_by_uid;
gboolean job_is_cancellable;
- int job_num_tasks;
- int job_cur_task;
- char *job_cur_task_id;
- double job_cur_task_percentage;
+ double job_percentage;
char *id_usage;
char *id_type;
@@ -243,14 +240,8 @@ collect_props (const char *key, const GValue *value, DeviceProperties *props)
props->job_initiated_by_uid = g_value_get_uint (value);
else if (strcmp (key, "job-is-cancellable") == 0)
props->job_is_cancellable = g_value_get_boolean (value);
- else if (strcmp (key, "job-num-tasks") == 0)
- props->job_num_tasks = g_value_get_int (value);
- else if (strcmp (key, "job-cur-task") == 0)
- props->job_cur_task = g_value_get_int (value);
- else if (strcmp (key, "job-cur-task-id") == 0)
- props->job_cur_task_id = g_strdup (g_value_get_string (value));
- else if (strcmp (key, "job-cur-task-percentage") == 0)
- props->job_cur_task_percentage = g_value_get_double (value);
+ else if (strcmp (key, "job-percentage") == 0)
+ props->job_percentage = g_value_get_double (value);
else if (strcmp (key, "id-usage") == 0)
props->id_usage = g_strdup (g_value_get_string (value));
@@ -440,7 +431,6 @@ device_properties_free (DeviceProperties *props)
g_free (props->device_presentation_name);
g_free (props->device_presentation_icon_name);
g_free (props->job_id);
- g_free (props->job_cur_task_id);
g_free (props->id_usage);
g_free (props->id_type);
g_free (props->id_version);
@@ -694,10 +684,7 @@ _gdu_device_job_changed (GduDevice *device,
const char *job_id,
uid_t job_initiated_by_uid,
gboolean job_is_cancellable,
- int job_num_tasks,
- int job_cur_task,
- const char *job_cur_task_id,
- double job_cur_task_percentage)
+ double job_percentage)
{
g_print ("%s: %s: %s\n", __FUNCTION__, device->priv->props->device_file, job_id);
@@ -706,11 +693,7 @@ _gdu_device_job_changed (GduDevice *device,
device->priv->props->job_id = g_strdup (job_id);
device->priv->props->job_initiated_by_uid = job_initiated_by_uid;
device->priv->props->job_is_cancellable = job_is_cancellable;
- device->priv->props->job_num_tasks = job_num_tasks;
- device->priv->props->job_cur_task = job_cur_task;
- g_free (device->priv->props->job_cur_task_id);
- device->priv->props->job_cur_task_id = g_strdup (job_cur_task_id);
- device->priv->props->job_cur_task_percentage = job_cur_task_percentage;
+ device->priv->props->job_percentage = job_percentage;
g_signal_emit (device, signals[JOB_CHANGED], 0);
}
@@ -1426,28 +1409,10 @@ gdu_device_job_is_cancellable (GduDevice *device)
return device->priv->props->job_is_cancellable;
}
-int
-gdu_device_job_get_num_tasks (GduDevice *device)
-{
- return device->priv->props->job_num_tasks;
-}
-
-int
-gdu_device_job_get_cur_task (GduDevice *device)
-{
- return device->priv->props->job_cur_task;
-}
-
-const char *
-gdu_device_job_get_cur_task_id (GduDevice *device)
-{
- return device->priv->props->job_cur_task_id;
-}
-
double
-gdu_device_job_get_cur_task_percentage (GduDevice *device)
+gdu_device_job_get_percentage (GduDevice *device)
{
- return device->priv->props->job_cur_task_percentage;
+ return device->priv->props->job_percentage;
}
/* -------------------------------------------------------------------------------- */
@@ -1472,7 +1437,6 @@ void
gdu_device_op_filesystem_create (GduDevice *device,
const char *fstype,
const char *fslabel,
- const char *fserase,
const char *encrypt_passphrase,
gboolean fs_take_ownership,
GduDeviceFilesystemCreateCompletedFunc callback,
@@ -1491,9 +1455,6 @@ gdu_device_op_filesystem_create (GduDevice *device,
if (fslabel != NULL && strlen (fslabel) > 0) {
options[n++] = g_strdup_printf ("label=%s", fslabel);
}
- if (fserase != NULL && strlen (fserase) > 0) {
- options[n++] = g_strdup_printf ("erase=%s", fserase);
- }
if (encrypt_passphrase != NULL && strlen (encrypt_passphrase) > 0) {
options[n++] = g_strdup_printf ("luks_encrypt=%s", encrypt_passphrase);
}
@@ -1654,7 +1615,6 @@ op_partition_delete_cb (DBusGProxy *proxy, GError *error, gpointer user_data)
void
gdu_device_op_partition_delete (GduDevice *device,
- const char *secure_erase,
GduDevicePartitionDeleteCompletedFunc callback,
gpointer user_data)
{
@@ -1668,9 +1628,6 @@ gdu_device_op_partition_delete (GduDevice *device,
data->user_data = user_data;
n = 0;
- if (secure_erase != NULL && strlen (secure_erase) > 0) {
- options[n++] = g_strdup_printf ("erase=%s", secure_erase);
- }
options[n] = NULL;
org_freedesktop_DeviceKit_Disks_Device_partition_delete_async (device->priv->proxy,
@@ -1710,7 +1667,6 @@ gdu_device_op_partition_create (GduDevice *device,
char **flags,
const char *fstype,
const char *fslabel,
- const char *fserase,
const char *encrypt_passphrase,
gboolean fs_take_ownership,
GduDevicePartitionCreateCompletedFunc callback,
@@ -1732,9 +1688,6 @@ gdu_device_op_partition_create (GduDevice *device,
if (fslabel != NULL && strlen (fslabel) > 0) {
fsoptions[n++] = g_strdup_printf ("label=%s", fslabel);
}
- if (fserase != NULL && strlen (fserase) > 0) {
- fsoptions[n++] = g_strdup_printf ("erase=%s", fserase);
- }
if (encrypt_passphrase != NULL && strlen (encrypt_passphrase) > 0) {
fsoptions[n++] = g_strdup_printf ("luks_encrypt=%s", encrypt_passphrase);
}
@@ -1824,7 +1777,6 @@ op_create_partition_table_cb (DBusGProxy *proxy, GError *error, gpointer user_da
void
gdu_device_op_partition_table_create (GduDevice *device,
const char *scheme,
- const char *secure_erase,
GduDevicePartitionTableCreateCompletedFunc callback,
gpointer user_data)
{
@@ -1838,9 +1790,6 @@ gdu_device_op_partition_table_create (GduDevice
data->user_data = user_data;
n = 0;
- if (secure_erase != NULL && strlen (secure_erase) > 0) {
- options[n++] = g_strdup_printf ("erase=%s", secure_erase);
- }
options[n] = NULL;
org_freedesktop_DeviceKit_Disks_Device_partition_table_create_async (device->priv->proxy,
@@ -2273,7 +2222,6 @@ op_remove_component_from_linux_md_array_cb (DBusGProxy *proxy, GError *error, gp
void
gdu_device_op_linux_md_remove_component (GduDevice *device,
const char *component_objpath,
- const char *secure_erase,
GduDeviceLinuxMdRemoveComponentCompletedFunc callback,
gpointer user_data)
{
@@ -2287,9 +2235,6 @@ gdu_device_op_linux_md_remove_component (GduDevice
data->user_data = user_data;
n = 0;
- if (secure_erase != NULL && strlen (secure_erase) > 0) {
- options[n++] = g_strdup_printf ("erase=%s", secure_erase);
- }
options[n] = NULL;
org_freedesktop_DeviceKit_Disks_Device_linux_md_remove_component_async (
diff --git a/src/gdu/gdu-device.h b/src/gdu/gdu-device.h
index 14a55bb..f4f655d 100644
--- a/src/gdu/gdu-device.h
+++ b/src/gdu/gdu-device.h
@@ -98,10 +98,7 @@ gboolean gdu_device_job_in_progress (GduDevice *device);
const char *gdu_device_job_get_id (GduDevice *device);
uid_t gdu_device_job_get_initiated_by_uid (GduDevice *device);
gboolean gdu_device_job_is_cancellable (GduDevice *device);
-int gdu_device_job_get_num_tasks (GduDevice *device);
-int gdu_device_job_get_cur_task (GduDevice *device);
-const char *gdu_device_job_get_cur_task_id (GduDevice *device);
-double gdu_device_job_get_cur_task_percentage (GduDevice *device);
+double gdu_device_job_get_percentage (GduDevice *device);
const char *gdu_device_id_get_usage (GduDevice *device);
const char *gdu_device_id_get_type (GduDevice *device);
@@ -233,7 +230,6 @@ void gdu_device_op_filesystem_check (GduDevice
/* ---------------------------------------------------------------------------------------------------- */
void gdu_device_op_partition_delete (GduDevice *device,
- const char *secure_erase,
GduDevicePartitionDeleteCompletedFunc callback,
gpointer user_data);
@@ -250,7 +246,6 @@ void gdu_device_op_partition_modify (GduDevice
void gdu_device_op_partition_table_create (GduDevice *device,
const char *scheme,
- const char *secure_erase,
GduDevicePartitionTableCreateCompletedFunc callback,
gpointer user_data);
@@ -312,7 +307,6 @@ void gdu_device_op_linux_md_add_component (GduDevice
void gdu_device_op_linux_md_remove_component (GduDevice *device,
const char *component_objpath,
- const char *secure_erase,
GduDeviceLinuxMdRemoveComponentCompletedFunc callback,
gpointer user_data);
@@ -321,7 +315,6 @@ void gdu_device_op_linux_md_remove_component (GduDevice
void gdu_device_op_filesystem_create (GduDevice *device,
const char *fstype,
const char *fslabel,
- const char *fserase,
const char *encrypt_passphrase,
gboolean fs_take_ownership,
GduDeviceFilesystemCreateCompletedFunc callback,
@@ -337,7 +330,6 @@ void gdu_device_op_partition_create (GduDevice *device,
char **flags,
const char *fstype,
const char *fslabel,
- const char *fserase,
const char *encrypt_passphrase,
gboolean fs_take_ownership,
GduDevicePartitionCreateCompletedFunc callback,
diff --git a/src/gdu/gdu-marshal.list b/src/gdu/gdu-marshal.list
index 4cf9a00..8767880 100644
--- a/src/gdu/gdu-marshal.list
+++ b/src/gdu/gdu-marshal.list
@@ -1,2 +1,2 @@
-VOID:BOOLEAN,STRING,UINT,BOOLEAN,INT,INT,STRING,DOUBLE
-VOID:STRING,BOOLEAN,STRING,UINT,BOOLEAN,INT,INT,STRING,DOUBLE
+VOID:BOOLEAN,STRING,UINT,BOOLEAN,DOUBLE
+VOID:STRING,BOOLEAN,STRING,UINT,BOOLEAN,DOUBLE
diff --git a/src/gdu/gdu-pool.c b/src/gdu/gdu-pool.c
index 623cddc..9fde7dd 100644
--- a/src/gdu/gdu-pool.c
+++ b/src/gdu/gdu-pool.c
@@ -930,10 +930,7 @@ device_job_changed_signal_handler (DBusGProxy *proxy,
const char *job_id,
guint32 job_initiated_by_uid,
gboolean job_is_cancellable,
- int job_num_tasks,
- int job_cur_task,
- const char *job_cur_task_id,
- double job_cur_task_percentage,
+ double job_percentage,
gpointer user_data)
{
GduPool *pool = GDU_POOL (user_data);
@@ -945,10 +942,7 @@ device_job_changed_signal_handler (DBusGProxy *proxy,
job_id,
job_initiated_by_uid,
job_is_cancellable,
- job_num_tasks,
- job_cur_task,
- job_cur_task_id,
- job_cur_task_percentage);
+ job_percentage);
g_signal_emit_by_name (pool, "device-job-changed", device);
g_object_unref (device);
} else {
@@ -1050,16 +1044,13 @@ gdu_pool_new (void)
}
dbus_g_object_register_marshaller (
- gdu_marshal_VOID__STRING_BOOLEAN_STRING_UINT_BOOLEAN_INT_INT_STRING_DOUBLE,
+ gdu_marshal_VOID__STRING_BOOLEAN_STRING_UINT_BOOLEAN_DOUBLE,
G_TYPE_NONE,
DBUS_TYPE_G_OBJECT_PATH,
G_TYPE_BOOLEAN,
G_TYPE_STRING,
G_TYPE_UINT,
G_TYPE_BOOLEAN,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_STRING,
G_TYPE_DOUBLE,
G_TYPE_INVALID);
@@ -1077,9 +1068,6 @@ gdu_pool_new (void)
G_TYPE_STRING,
G_TYPE_UINT,
G_TYPE_BOOLEAN,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_STRING,
G_TYPE_DOUBLE,
G_TYPE_INVALID);
diff --git a/src/gdu/gdu-private.h b/src/gdu/gdu-private.h
index 6c5e45b..fe94862 100644
--- a/src/gdu/gdu-private.h
+++ b/src/gdu/gdu-private.h
@@ -106,10 +106,7 @@ void _gdu_device_job_changed (GduDevice *device,
const char *job_id,
uid_t job_initiated_by_uid,
gboolean job_is_cancellable,
- int job_num_tasks,
- int job_cur_task,
- const char *job_cur_task_id,
- double job_cur_task_percentage);
+ double job_percentage);
void _gdu_volume_rewrite_enclosing_presentable (GduVolume *volume);
void _gdu_volume_hole_rewrite_enclosing_presentable (GduVolumeHole *volume_hole);
diff --git a/src/gdu/gdu-util.c b/src/gdu/gdu-util.c
index 153d5f2..3542c21 100644
--- a/src/gdu/gdu-util.c
+++ b/src/gdu/gdu-util.c
@@ -290,11 +290,11 @@ gdu_get_job_description (const char *job_id)
} else if (strcmp (job_id, "FilesystemCheck") == 0) {
s = g_strdup (_("Checking File System"));
} else if (strcmp (job_id, "LuksFormat") == 0) {
- s = g_strdup (_("Creating Encrypted LUKS Device"));
+ s = g_strdup (_("Creating LUKS Device"));
} else if (strcmp (job_id, "LuksUnlock") == 0) {
- s = g_strdup (_("Unlocking Encrypted LUKS Device"));
+ s = g_strdup (_("Unlocking LUKS Device"));
} else if (strcmp (job_id, "LuksLock") == 0) {
- s = g_strdup (_("Locking Encrypted LUKS Device"));
+ s = g_strdup (_("Locking LUKS Device"));
} else if (strcmp (job_id, "PartitionTableCreate") == 0) {
s = g_strdup (_("Creating Partition Table"));
} else if (strcmp (job_id, "PartitionDelete") == 0) {
@@ -313,30 +313,19 @@ gdu_get_job_description (const char *job_id)
s = g_strdup (_("Removing Component from RAID Array"));
} else if (strcmp (job_id, "LinuxMdStop") == 0) {
s = g_strdup (_("Stopping RAID Array"));
- } else if (strcmp (job_id, "DriveSmartInitiateSelftest") == 0) {
+ } else if (strcmp (job_id, "LinuxMdStart") == 0) {
+ s = g_strdup (_("Starting RAID Array"));
+ } else if (strcmp (job_id, "DriveAtaSmartInitiateSelftest") == 0) {
s = g_strdup (_("Running S.M.A.R.T. Self Test"));
} else if (strcmp (job_id, "DriveEject") == 0) {
s = g_strdup (_("Ejecting Media"));
+ } else if (strcmp (job_id, "ForceUnmount") == 0) {
+ s = g_strdup (_("Forcibly Unmounting Filesystem"));
+ } else if (strcmp (job_id, "ForceLuksTeardown") == 0) {
+ s = g_strdup (_("Forcibly Locking LUKS device"));
} else {
s = g_strdup_printf ("%s", job_id);
- }
- return s;
-}
-
-char *
-gdu_get_task_description (const char *task_id)
-{
- char *s;
- if (strcmp (task_id, "zeroing") == 0) {
- s = g_strdup (_("Zeroing data"));
- } else if (strcmp (task_id, "sync") == 0) {
- s = g_strdup (_("Flushing data to disk"));
- } else if (strcmp (task_id, "mkfs") == 0) {
- s = g_strdup (_("Creating File System"));
- } else if (strlen (task_id) == 0) {
- s = g_strdup ("");
- } else {
- s = g_strdup_printf ("%s", task_id);
+ g_warning ("No friendly string for job with id '%s'", job_id);
}
return s;
}
@@ -512,43 +501,6 @@ gdu_util_part_table_type_get_description (char *part_type)
/* ---------------------------------------------------------------------------------------------------- */
char *
-gdu_util_secure_erase_get_description (char *secure_erase_type)
-{
- g_return_val_if_fail (secure_erase_type != NULL, NULL);
-
- if (strcmp (secure_erase_type, "none") == 0)
- return g_strdup (_("Data on the disk won't be erased. This option doesn't add any time to the "
- "requested operation but can pose a security threat since some data "
- "may be recovered."));
-
- else if (strcmp (secure_erase_type, "full") == 0)
- return g_strdup (_("All data on the disk will by overwritten by zeroes providing some "
- "security against data recovery. This operation may take a long time "
- "depending on the size and speed of the disk."));
-
- else if (strcmp (secure_erase_type, "full3pass") == 0)
- return g_strdup (_("Random data is written to the disk three times. This operation may "
- "take some time depending on the size and speed of the disk but "
- "provides good security against data recovery."));
-
- else if (strcmp (secure_erase_type, "full7pass") == 0)
- return g_strdup (_("Random data is written to the disk seven times. This operation may "
- "take a very long time depending on the size and speed of the disk "
- "but provides excellent security against data recovery."));
-
- else if (strcmp (secure_erase_type, "full35pass") == 0)
- return g_strdup (_("Random data is written to the disk 35 times before starting the "
- "operation. This operation may take extremely long time depending on the "
- "size and speed of the disk but provides the most effective "
- "security against data recovery."));
-
- else
- return NULL;
-}
-
-/* ---------------------------------------------------------------------------------------------------- */
-
-char *
gdu_util_get_default_part_type_for_scheme_and_fstype (const char *scheme, const char *fstype, guint64 size)
{
const char *type;
diff --git a/src/gdu/gdu-util.h b/src/gdu/gdu-util.h
index 488d01c..1ad6602 100644
--- a/src/gdu/gdu-util.h
+++ b/src/gdu/gdu-util.h
@@ -37,8 +37,6 @@ char *gdu_util_fstype_get_description (char *fstype);
char *gdu_util_part_table_type_get_description (char *part_type);
-char *gdu_util_secure_erase_get_description (char *secure_erase_type);
-
char *gdu_util_get_speed_for_display (guint64 size);
char *gdu_util_get_connection_for_display (const char *connection_interface, guint64 connection_speed);
@@ -46,7 +44,6 @@ char *gdu_util_get_connection_for_display (const char *connection_interface, gui
char *gdu_util_get_desc_for_part_type (const char *part_scheme, const char *part_type);
char *gdu_get_job_description (const char *job_id);
-char *gdu_get_task_description (const char *task_id);
char *gdu_linux_md_get_raid_level_for_display (const gchar *linux_md_raid_level);
diff --git a/src/palimpsest/gdu-section-create-partition-table.c b/src/palimpsest/gdu-section-create-partition-table.c
index 0127f3d..600f919 100644
--- a/src/palimpsest/gdu-section-create-partition-table.c
+++ b/src/palimpsest/gdu-section-create-partition-table.c
@@ -67,14 +67,13 @@ create_part_table_callback (GtkAction *action, gpointer user_data)
{
GduSectionCreatePartitionTable *section = GDU_SECTION_CREATE_PARTITION_TABLE (user_data);
GduDevice *device;
- char *secure_erase;
+ gboolean do_erase;
char *scheme;
char *primary;
char *secondary;
char *drive_name;
scheme = NULL;
- secure_erase = NULL;
primary = NULL;
secondary = NULL;
drive_name = NULL;
@@ -101,15 +100,14 @@ create_part_table_callback (GtkAction *action, gpointer user_data)
drive_name);
}
- secure_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))),
- "",
- FALSE,
- primary,
- secondary,
- _("C_reate"));
+ do_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))),
+ "",
+ primary,
+ secondary,
+ _("C_reate"));
- if (secure_erase == NULL)
+ if (!do_erase)
goto out;
scheme = gdu_util_part_table_type_combo_box_get_selected (
@@ -117,7 +115,6 @@ create_part_table_callback (GtkAction *action, gpointer user_data)
gdu_device_op_partition_table_create (device,
scheme,
- secure_erase,
create_partition_table_callback,
g_object_ref (section));
@@ -125,7 +122,6 @@ out:
if (device != NULL)
g_object_unref (device);
g_free (scheme);
- g_free (secure_erase);
g_free (primary);
g_free (secondary);
g_free (drive_name);
diff --git a/src/palimpsest/gdu-section-job.c b/src/palimpsest/gdu-section-job.c
index b5e13d6..20a601e 100644
--- a/src/palimpsest/gdu-section-job.c
+++ b/src/palimpsest/gdu-section-job.c
@@ -34,7 +34,6 @@ struct _GduSectionJobPrivate
{
GtkWidget *job_description_label;
GtkWidget *job_progress_bar;
- GtkWidget *job_task_label;
PolKitAction *pk_cancel_job_others_action;
PolKitGnomeAction *cancel_action;
@@ -77,7 +76,6 @@ job_update (GduSectionJob *section, GduDevice *device)
char *s;
uid_t job_initiator;
char *job_description;
- char *task_description;
double percentage;
if (device != NULL && gdu_device_job_in_progress (device)) {
@@ -94,24 +92,12 @@ job_update (GduSectionJob *section, GduDevice *device)
NULL);
job_description = gdu_get_job_description (gdu_device_job_get_id (device));
- task_description = gdu_get_task_description (gdu_device_job_get_cur_task_id (device));
s = g_strdup_printf ("<b>%s</b>", job_description);
gtk_label_set_markup (GTK_LABEL (section->priv->job_description_label), s);
g_free (s);
- if (gdu_device_job_get_num_tasks (device) < 2)
- gtk_label_set_markup (GTK_LABEL (section->priv->job_task_label), task_description);
- else {
- s = g_strdup_printf (_("%s (task %d of %d)"),
- task_description,
- gdu_device_job_get_cur_task (device) + 1,
- gdu_device_job_get_num_tasks (device));
- gtk_label_set_markup (GTK_LABEL (section->priv->job_task_label), s);
- g_free (s);
- }
-
- percentage = gdu_device_job_get_cur_task_percentage (device);
+ percentage = gdu_device_job_get_percentage (device);
if (percentage < 0) {
gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (section->priv->job_progress_bar), 2.0 / 50);
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (section->priv->job_progress_bar));
@@ -131,7 +117,6 @@ job_update (GduSectionJob *section, GduDevice *device)
}
g_free (job_description);
- g_free (task_description);
polkit_gnome_action_set_sensitive (section->priv->cancel_action,
gdu_device_job_is_cancellable (device));
@@ -233,13 +218,6 @@ gdu_section_job_init (GduSectionJob *section)
gtk_box_pack_start (GTK_BOX (vbox2), progress_bar, TRUE, TRUE, 0);
section->priv->job_progress_bar = progress_bar;
- label = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (label), "Task Name (task 1 of 3)");
- gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
- gtk_box_pack_start (GTK_BOX (vbox2), label, TRUE, TRUE, 0);
- section->priv->job_task_label = label;
-
-
button_box = gtk_hbutton_box_new ();
gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_END);
gtk_box_set_spacing (GTK_BOX (button_box), 6);
diff --git a/src/palimpsest/gdu-section-linux-md-drive.c b/src/palimpsest/gdu-section-linux-md-drive.c
index 7a11d77..2d16ca8 100644
--- a/src/palimpsest/gdu-section-linux-md-drive.c
+++ b/src/palimpsest/gdu-section-linux-md-drive.c
@@ -392,7 +392,7 @@ detach_action_callback (GtkAction *action, gpointer user_data)
if (!(slave_flags & GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_NOT_ATTACHED)) {
char *primary;
char *secondary;
- char *secure_erase;
+ gboolean do_erase;
char *array_name;
char *component_name;
@@ -409,24 +409,21 @@ detach_action_callback (GtkAction *action, gpointer user_data)
component_name,
array_name);
- secure_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))),
- "",
- FALSE,
- primary,
- secondary,
- _("_Remove Component"));
- if (secure_erase != NULL) {
+ do_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))),
+ "",
+ primary,
+ secondary,
+ _("_Remove Component"));
+ if (do_erase) {
/* yay, remove this component from the array */
gdu_device_op_linux_md_remove_component (device,
component_objpath,
- secure_erase,
remove_component_callback,
g_object_ref (section));
}
g_free (primary);
g_free (secondary);
- g_free (secure_erase);
g_free (array_name);
g_free (component_name);
}
diff --git a/src/palimpsest/gdu-section-partition.c b/src/palimpsest/gdu-section-partition.c
index b404404..a860c22 100644
--- a/src/palimpsest/gdu-section-partition.c
+++ b/src/palimpsest/gdu-section-partition.c
@@ -75,7 +75,7 @@ delete_partition_callback (GtkAction *action, gpointer user_data)
GduPresentable *presentable;
char *primary;
char *secondary;
- char *secure_erase;
+ gboolean do_erase;
GduPresentable *toplevel_presentable;
GduDevice *toplevel_device;
char *drive_name;
@@ -83,7 +83,6 @@ delete_partition_callback (GtkAction *action, gpointer user_data)
const gchar *type;
gint msdos_type;
- secure_erase = NULL;
primary = NULL;
secondary = NULL;
toplevel_presentable = NULL;
@@ -198,18 +197,16 @@ delete_partition_callback (GtkAction *action, gpointer user_data)
}
}
- secure_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))),
- "",
- FALSE,
- primary,
- secondary,
- _("_Delete Partition"));
+ do_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))),
+ "",
+ primary,
+ secondary,
+ _("_Delete Partition"));
- if (secure_erase == NULL)
+ if (!do_erase)
goto out;
gdu_device_op_partition_delete (device,
- secure_erase,
op_delete_partition_callback,
g_object_ref (section));
@@ -226,7 +223,6 @@ out:
g_object_unref (toplevel_device);
g_free (primary);
g_free (secondary);
- g_free (secure_erase);
g_free (drive_name);
}
diff --git a/src/palimpsest/gdu-section-unallocated.c b/src/palimpsest/gdu-section-unallocated.c
index 830e66d..0bd8ea6 100644
--- a/src/palimpsest/gdu-section-unallocated.c
+++ b/src/palimpsest/gdu-section-unallocated.c
@@ -251,7 +251,6 @@ create_partition_callback (GtkAction *action, gpointer user_data)
flags,
fstype,
fslabel,
- "",
data->encrypt_passphrase,
take_ownership,
create_partition_completed,
diff --git a/src/palimpsest/gdu-section-unrecognized.c b/src/palimpsest/gdu-section-unrecognized.c
index 878aaf0..c2a9303 100644
--- a/src/palimpsest/gdu-section-unrecognized.c
+++ b/src/palimpsest/gdu-section-unrecognized.c
@@ -181,7 +181,7 @@ erase_action_callback (GtkAction *action, gpointer user_data)
GduPresentable *presentable;
GduPresentable *toplevel_presentable;
GduDevice *toplevel_device;
- char *secure_erase;
+ gboolean do_erase;
char *primary;
char *secondary;
char *drive_name;
@@ -191,7 +191,6 @@ erase_action_callback (GtkAction *action, gpointer user_data)
data = NULL;
fstype = NULL;
fslabel = NULL;
- secure_erase = NULL;
primary = NULL;
secondary = NULL;
device = NULL;
@@ -266,14 +265,13 @@ erase_action_callback (GtkAction *action, gpointer user_data)
}
}
- secure_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))),
- "",
- FALSE,
+ do_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))),
+ "",
primary,
secondary,
_("C_reate"));
- if (secure_erase == NULL)
+ if (!do_erase)
goto out;
data = g_new0 (CreateFilesystemData, 1);
@@ -295,7 +293,6 @@ erase_action_callback (GtkAction *action, gpointer user_data)
gdu_device_op_filesystem_create (device,
fstype,
fslabel,
- secure_erase,
data->encrypt_passphrase,
take_ownership,
erase_action_completed,
@@ -312,7 +309,6 @@ out:
g_free (secondary);
g_free (fstype);
g_free (fslabel);
- g_free (secure_erase);
g_free (drive_name);
}
diff --git a/src/palimpsest/gdu-shell.c b/src/palimpsest/gdu-shell.c
index 78e7989..907e0b3 100644
--- a/src/palimpsest/gdu-shell.c
+++ b/src/palimpsest/gdu-shell.c
@@ -1511,13 +1511,12 @@ erase_action_callback (GtkAction *action, gpointer user_data)
gchar *drive_name;
gchar *primary;
gchar *secondary;
- gchar *secure_erase;
+ gboolean do_erase;
device = NULL;
drive_name = NULL;
primary = NULL;
secondary = NULL;
- secure_erase = NULL;
toplevel_presentable = NULL;
toplevel_device = NULL;
@@ -1578,17 +1577,15 @@ erase_action_callback (GtkAction *action, gpointer user_data)
}
}
- secure_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (shell),
- "",
- TRUE,
- primary,
- secondary,
- _("_Erase"));
- if (secure_erase != NULL) {
+ do_erase = gdu_util_delete_confirmation_dialog (gdu_shell_get_toplevel (shell),
+ "",
+ primary,
+ secondary,
+ _("_Erase"));
+ if (do_erase) {
gdu_device_op_filesystem_create (device,
"empty",
"",
- secure_erase,
NULL,
FALSE,
op_erase_callback,
@@ -1598,7 +1595,6 @@ erase_action_callback (GtkAction *action, gpointer user_data)
out:
g_free (secondary);
g_free (primary);
- g_free (secure_erase);
g_free (drive_name);
if (toplevel_presentable != NULL)
g_object_unref (toplevel_presentable);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]