[gnome-disk-utility/new-ui] Use _new_for_ instead of just _for_ in constructors



commit d5e63b4b527c9aba61b8c11cb066ca56396b2a97
Author: David Zeuthen <davidz redhat com>
Date:   Mon Oct 26 16:28:36 2009 -0400

    Use _new_for_ instead of just _for_ in constructors

 src/gdu-gtk/gdu-confirmation-dialog.c |   16 +++++++-------
 src/gdu-gtk/gdu-confirmation-dialog.h |   26 ++++++++++++------------
 src/gdu-gtk/gdu-error-dialog.c        |   16 +++++++-------
 src/gdu-gtk/gdu-error-dialog.h        |   26 ++++++++++++------------
 src/gdu-gtk/gdu-format-dialog.c       |   12 +++++-----
 src/gdu-gtk/gdu-format-dialog.h       |    4 +-
 src/gdu-gtk/gdu-partition-dialog.c    |    4 +-
 src/gdu-gtk/gdu-partition-dialog.h    |   12 +++++-----
 src/palimpsest/gdu-section-drive.c    |   35 ++++++++++++++++-----------------
 src/palimpsest/gdu-section-volumes.c  |   32 +++++++++++++++---------------
 10 files changed, 91 insertions(+), 92 deletions(-)
---
diff --git a/src/gdu-gtk/gdu-confirmation-dialog.c b/src/gdu-gtk/gdu-confirmation-dialog.c
index 1c0df37..ae98f85 100644
--- a/src/gdu-gtk/gdu-confirmation-dialog.c
+++ b/src/gdu-gtk/gdu-confirmation-dialog.c
@@ -254,10 +254,10 @@ gdu_confirmation_dialog_new (GtkWindow      *parent,
 }
 
 GtkWidget *
-gdu_confirmation_dialog_for_drive (GtkWindow      *parent,
-                                   GduDevice      *device,
-                                   const gchar    *message,
-                                   const gchar    *button_text)
+gdu_confirmation_dialog_new_for_drive (GtkWindow      *parent,
+                                       GduDevice      *device,
+                                       const gchar    *message,
+                                       const gchar    *button_text)
 {
         g_return_val_if_fail (GDU_IS_DEVICE (device), NULL);
         return GTK_WIDGET (g_object_new (GDU_TYPE_CONFIRMATION_DIALOG,
@@ -269,10 +269,10 @@ gdu_confirmation_dialog_for_drive (GtkWindow      *parent,
 }
 
 GtkWidget *
-gdu_confirmation_dialog_for_volume (GtkWindow      *parent,
-                                    GduDevice      *device,
-                                    const gchar    *message,
-                                    const gchar    *button_text)
+gdu_confirmation_dialog_new_for_volume (GtkWindow      *parent,
+                                        GduDevice      *device,
+                                        const gchar    *message,
+                                        const gchar    *button_text)
 {
         g_return_val_if_fail (GDU_IS_DEVICE (device), NULL);
         return GTK_WIDGET (g_object_new (GDU_TYPE_CONFIRMATION_DIALOG,
diff --git a/src/gdu-gtk/gdu-confirmation-dialog.h b/src/gdu-gtk/gdu-confirmation-dialog.h
index c14f76c..eb8ea31 100644
--- a/src/gdu-gtk/gdu-confirmation-dialog.h
+++ b/src/gdu-gtk/gdu-confirmation-dialog.h
@@ -54,19 +54,19 @@ struct GduConfirmationDialogClass
         GduDialogClass parent_class;
 };
 
-GType       gdu_confirmation_dialog_get_type   (void) G_GNUC_CONST;
-GtkWidget  *gdu_confirmation_dialog_new        (GtkWindow      *parent,
-                                                GduPresentable *presentable,
-                                                const gchar    *message,
-                                                const gchar    *button_text);
-GtkWidget  *gdu_confirmation_dialog_for_drive  (GtkWindow      *parent,
-                                                GduDevice      *device,
-                                                const gchar    *message,
-                                                const gchar    *button_text);
-GtkWidget  *gdu_confirmation_dialog_for_volume (GtkWindow      *parent,
-                                                GduDevice      *device,
-                                                const gchar    *message,
-                                                const gchar    *button_text);
+GType       gdu_confirmation_dialog_get_type       (void) G_GNUC_CONST;
+GtkWidget  *gdu_confirmation_dialog_new            (GtkWindow      *parent,
+                                                    GduPresentable *presentable,
+                                                    const gchar    *message,
+                                                    const gchar    *button_text);
+GtkWidget  *gdu_confirmation_dialog_new_for_drive  (GtkWindow      *parent,
+                                                    GduDevice      *device,
+                                                    const gchar    *message,
+                                                    const gchar    *button_text);
+GtkWidget  *gdu_confirmation_dialog_new_for_volume (GtkWindow      *parent,
+                                                    GduDevice      *device,
+                                                    const gchar    *message,
+                                                    const gchar    *button_text);
 
 G_END_DECLS
 
diff --git a/src/gdu-gtk/gdu-error-dialog.c b/src/gdu-gtk/gdu-error-dialog.c
index 2738d97..1004e0b 100644
--- a/src/gdu-gtk/gdu-error-dialog.c
+++ b/src/gdu-gtk/gdu-error-dialog.c
@@ -340,10 +340,10 @@ gdu_error_dialog_new (GtkWindow      *parent,
 }
 
 GtkWidget *
-gdu_error_dialog_for_drive (GtkWindow      *parent,
-                            GduDevice      *device,
-                            const gchar    *message,
-                            const GError   *error)
+gdu_error_dialog_new_for_drive (GtkWindow      *parent,
+                                GduDevice      *device,
+                                const gchar    *message,
+                                const GError   *error)
 {
         g_return_val_if_fail (GDU_IS_DEVICE (device), NULL);
         return GTK_WIDGET (g_object_new (GDU_TYPE_ERROR_DIALOG,
@@ -355,10 +355,10 @@ gdu_error_dialog_for_drive (GtkWindow      *parent,
 }
 
 GtkWidget *
-gdu_error_dialog_for_volume (GtkWindow      *parent,
-                             GduDevice      *device,
-                             const gchar    *message,
-                             const GError   *error)
+gdu_error_dialog_new_for_volume (GtkWindow      *parent,
+                                 GduDevice      *device,
+                                 const gchar    *message,
+                                 const GError   *error)
 {
         g_return_val_if_fail (GDU_IS_DEVICE (device), NULL);
         return GTK_WIDGET (g_object_new (GDU_TYPE_ERROR_DIALOG,
diff --git a/src/gdu-gtk/gdu-error-dialog.h b/src/gdu-gtk/gdu-error-dialog.h
index 06b812c..e44ee5a 100644
--- a/src/gdu-gtk/gdu-error-dialog.h
+++ b/src/gdu-gtk/gdu-error-dialog.h
@@ -54,19 +54,19 @@ struct GduErrorDialogClass
         GduDialogClass parent_class;
 };
 
-GType       gdu_error_dialog_get_type (void) G_GNUC_CONST;
-GtkWidget  *gdu_error_dialog_new             (GtkWindow      *parent,
-                                              GduPresentable *presentable,
-                                              const gchar    *message,
-                                              const GError   *error);
-GtkWidget  *gdu_error_dialog_for_drive       (GtkWindow      *parent,
-                                              GduDevice      *device,
-                                              const gchar    *message,
-                                              const GError   *error);
-GtkWidget  *gdu_error_dialog_for_volume      (GtkWindow      *parent,
-                                              GduDevice      *device,
-                                              const gchar    *message,
-                                              const GError   *error);
+GType       gdu_error_dialog_get_type       (void) G_GNUC_CONST;
+GtkWidget  *gdu_error_dialog_new            (GtkWindow      *parent,
+                                             GduPresentable *presentable,
+                                             const gchar    *message,
+                                             const GError   *error);
+GtkWidget  *gdu_error_dialog_new_for_drive  (GtkWindow      *parent,
+                                             GduDevice      *device,
+                                             const gchar    *message,
+                                             const GError   *error);
+GtkWidget  *gdu_error_dialog_new_for_volume (GtkWindow      *parent,
+                                             GduDevice      *device,
+                                             const gchar    *message,
+                                             const GError   *error);
 
 G_END_DECLS
 
diff --git a/src/gdu-gtk/gdu-format-dialog.c b/src/gdu-gtk/gdu-format-dialog.c
index f07e3dc..07ca3b1 100644
--- a/src/gdu-gtk/gdu-format-dialog.c
+++ b/src/gdu-gtk/gdu-format-dialog.c
@@ -240,9 +240,9 @@ gdu_format_dialog_new (GtkWindow            *parent,
 }
 
 GtkWidget *
-gdu_format_dialog_for_drive (GtkWindow            *parent,
-                             GduDevice            *device,
-                             GduFormatDialogFlags  flags)
+gdu_format_dialog_new_for_drive (GtkWindow            *parent,
+                                 GduDevice            *device,
+                                 GduFormatDialogFlags  flags)
 {
         return GTK_WIDGET (g_object_new (GDU_TYPE_FORMAT_DIALOG,
                                          "transient-for", parent,
@@ -252,9 +252,9 @@ gdu_format_dialog_for_drive (GtkWindow            *parent,
 }
 
 GtkWidget *
-gdu_format_dialog_for_volume (GtkWindow            *parent,
-                              GduDevice            *device,
-                              GduFormatDialogFlags  flags)
+gdu_format_dialog_new_for_volume (GtkWindow            *parent,
+                                  GduDevice            *device,
+                                  GduFormatDialogFlags  flags)
 {
         return GTK_WIDGET (g_object_new (GDU_TYPE_FORMAT_DIALOG,
                                          "transient-for", parent,
diff --git a/src/gdu-gtk/gdu-format-dialog.h b/src/gdu-gtk/gdu-format-dialog.h
index 51cb814..67c3ee2 100644
--- a/src/gdu-gtk/gdu-format-dialog.h
+++ b/src/gdu-gtk/gdu-format-dialog.h
@@ -58,10 +58,10 @@ GType       gdu_format_dialog_get_type           (void) G_GNUC_CONST;
 GtkWidget  *gdu_format_dialog_new                (GtkWindow            *parent,
                                                   GduPresentable       *presentable,
                                                   GduFormatDialogFlags  flags);
-GtkWidget  *gdu_format_dialog_for_drive          (GtkWindow            *parent,
+GtkWidget  *gdu_format_dialog_new_for_drive      (GtkWindow            *parent,
                                                   GduDevice            *device,
                                                   GduFormatDialogFlags  flags);
-GtkWidget  *gdu_format_dialog_for_volume         (GtkWindow            *parent,
+GtkWidget  *gdu_format_dialog_new_for_volume     (GtkWindow            *parent,
                                                   GduDevice            *device,
                                                   GduFormatDialogFlags  flags);
 gchar      *gdu_format_dialog_get_fs_type        (GduFormatDialog *dialog);
diff --git a/src/gdu-gtk/gdu-partition-dialog.c b/src/gdu-gtk/gdu-partition-dialog.c
index 81804ee..e384229 100644
--- a/src/gdu-gtk/gdu-partition-dialog.c
+++ b/src/gdu-gtk/gdu-partition-dialog.c
@@ -123,8 +123,8 @@ gdu_partition_dialog_new (GtkWindow            *parent,
 }
 
 GtkWidget *
-gdu_partition_dialog_for_drive (GtkWindow            *parent,
-                                GduDevice            *device)
+gdu_partition_dialog_new_for_drive (GtkWindow            *parent,
+                                    GduDevice            *device)
 {
         return GTK_WIDGET (g_object_new (GDU_TYPE_PARTITION_DIALOG,
                                          "transient-for", parent,
diff --git a/src/gdu-gtk/gdu-partition-dialog.h b/src/gdu-gtk/gdu-partition-dialog.h
index 7c36842..f72ad52 100644
--- a/src/gdu-gtk/gdu-partition-dialog.h
+++ b/src/gdu-gtk/gdu-partition-dialog.h
@@ -51,12 +51,12 @@ struct GduPartitionDialogClass
         GduDialogClass parent_class;
 };
 
-GType       gdu_partition_dialog_get_type           (void) G_GNUC_CONST;
-GtkWidget  *gdu_partition_dialog_new                (GtkWindow               *parent,
-                                                     GduPresentable          *presentable);
-GtkWidget  *gdu_partition_dialog_for_drive          (GtkWindow               *parent,
-                                                     GduDevice               *device);
-gchar      *gdu_partition_dialog_get_scheme         (GduPartitionDialog      *dialog);
+GType       gdu_partition_dialog_get_type      (void) G_GNUC_CONST;
+GtkWidget  *gdu_partition_dialog_new           (GtkWindow               *parent,
+                                                GduPresentable          *presentable);
+GtkWidget  *gdu_partition_dialog_new_for_drive (GtkWindow               *parent,
+                                                GduDevice               *device);
+gchar      *gdu_partition_dialog_get_scheme    (GduPartitionDialog      *dialog);
 
 G_END_DECLS
 
diff --git a/src/palimpsest/gdu-section-drive.c b/src/palimpsest/gdu-section-drive.c
index edac18e..e919ec6 100644
--- a/src/palimpsest/gdu-section-drive.c
+++ b/src/palimpsest/gdu-section-drive.c
@@ -317,10 +317,10 @@ eject_op_callback (GduDevice *device,
 
         if (error != NULL) {
                 GtkWidget *dialog;
-                dialog = gdu_error_dialog_for_drive (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
-                                                     device,
-                                                     _("Error ejecting media"),
-                                                     error);
+                dialog = gdu_error_dialog_new_for_drive (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                         device,
+                                                         _("Error ejecting media"),
+                                                         error);
                 gtk_widget_show_all (dialog);
                 gtk_window_present (GTK_WINDOW (dialog));
                 gtk_dialog_run (GTK_DIALOG (dialog));
@@ -361,10 +361,10 @@ detach_op_callback (GduDevice *device,
 
         if (error != NULL) {
                 GtkWidget *dialog;
-                dialog = gdu_error_dialog_for_drive (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
-                                                     device,
-                                                     _("Error detaching drive"),
-                                                     error);
+                dialog = gdu_error_dialog_new_for_drive (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                         device,
+                                                         _("Error detaching drive"),
+                                                         error);
                 gtk_widget_show_all (dialog);
                 gtk_window_present (GTK_WINDOW (dialog));
                 gtk_dialog_run (GTK_DIALOG (dialog));
@@ -408,10 +408,10 @@ partition_table_create_op_callback (GduDevice  *device,
 
                 g_debug ("error: %s", error->message);
 
-                dialog = gdu_error_dialog_for_drive (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
-                                                     device,
-                                                     _("Error formatting drive"),
-                                                     error);
+                dialog = gdu_error_dialog_new_for_drive (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                         device,
+                                                         _("Error formatting drive"),
+                                                         error);
                 gtk_widget_show_all (dialog);
                 gtk_window_present (GTK_WINDOW (dialog));
                 gtk_dialog_run (GTK_DIALOG (dialog));
@@ -440,16 +440,15 @@ on_format_button_clicked (GduButtonElement *button_element,
                 goto out;
 
         toplevel = GTK_WINDOW (gdu_shell_get_toplevel (gdu_section_get_shell (GDU_SECTION (section))));
-        dialog = gdu_partition_dialog_for_drive (toplevel,
-                                                 d);
+        dialog = gdu_partition_dialog_new_for_drive (toplevel, d);
         gtk_widget_show_all (dialog);
         response = gtk_dialog_run (GTK_DIALOG (dialog));
         gtk_widget_hide (dialog);
         if (response == GTK_RESPONSE_OK) {
-                confirmation_dialog = gdu_confirmation_dialog_for_drive (toplevel,
-                                                                         d,
-                                                                         _("Are you sure you want to format the drive?"),
-                                                                         _("_Format"));
+                confirmation_dialog = gdu_confirmation_dialog_new_for_drive (toplevel,
+                                                                             d,
+                                                                             _("Are you sure you want to format the drive?"),
+                                                                             _("_Format"));
                 gtk_widget_show_all (confirmation_dialog);
                 response = gtk_dialog_run (GTK_DIALOG (confirmation_dialog));
                 gtk_widget_hide (confirmation_dialog);
diff --git a/src/palimpsest/gdu-section-volumes.c b/src/palimpsest/gdu-section-volumes.c
index 9c9935c..30cb196 100644
--- a/src/palimpsest/gdu-section-volumes.c
+++ b/src/palimpsest/gdu-section-volumes.c
@@ -91,10 +91,10 @@ unmount_op_callback (GduDevice *device,
 
         if (error != NULL) {
                 GtkWidget *dialog;
-                dialog = gdu_error_dialog_for_volume (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
-                                                      device,
-                                                      _("Error unmounting volume"),
-                                                      error);
+                dialog = gdu_error_dialog_new_for_volume (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                          device,
+                                                          _("Error unmounting volume"),
+                                                          error);
                 gtk_widget_show_all (dialog);
                 gtk_window_present (GTK_WINDOW (dialog));
                 gtk_dialog_run (GTK_DIALOG (dialog));
@@ -389,10 +389,10 @@ partition_modify_op_callback (GduDevice *device,
 
         if (error != NULL) {
                 GtkWidget *dialog;
-                dialog = gdu_error_dialog_for_volume (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
-                                                      device,
-                                                      _("Error modifying partition"),
-                                                      error);
+                dialog = gdu_error_dialog_new_for_volume (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                          device,
+                                                          _("Error modifying partition"),
+                                                          error);
                 gtk_widget_show_all (dialog);
                 gtk_window_present (GTK_WINDOW (dialog));
                 gtk_dialog_run (GTK_DIALOG (dialog));
@@ -511,10 +511,10 @@ luks_lock_op_callback (GduDevice *device,
 
         if (error != NULL) {
                 GtkWidget *dialog;
-                dialog = gdu_error_dialog_for_volume (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
-                                                      device,
-                                                      _("Error locking LUKS volume"),
-                                                      error);
+                dialog = gdu_error_dialog_new_for_volume (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                          device,
+                                                          _("Error locking LUKS volume"),
+                                                          error);
                 gtk_widget_show_all (dialog);
                 gtk_window_present (GTK_WINDOW (dialog));
                 gtk_dialog_run (GTK_DIALOG (dialog));
@@ -634,10 +634,10 @@ unlock_op_cb (GduDevice *device,
         if (error != NULL && error->code == GDU_ERROR_INHIBITED) {
                 GtkWidget *dialog;
 
-                dialog = gdu_error_dialog_for_volume (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
-                                                      device,
-                                                      _("Error unlocking LUKS volume"),
-                                                      error);
+                dialog = gdu_error_dialog_new_for_volume (GTK_WINDOW (gdu_shell_get_toplevel (shell)),
+                                                          device,
+                                                          _("Error unlocking LUKS volume"),
+                                                          error);
                 gtk_widget_show_all (dialog);
                 gtk_window_present (GTK_WINDOW (dialog));
                 gtk_dialog_run (GTK_DIALOG (dialog));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]