[gnome-commander] Use cast operator to *GtkWidget instead of previous GTK_WIDGET()
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Use cast operator to *GtkWidget instead of previous GTK_WIDGET()
- Date: Mon, 27 Jun 2011 19:46:49 +0000 (UTC)
commit 9b3876b0582d95b948182d8a9d2d14f8b3420060
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Mon Jun 27 21:45:42 2011 +0200
Use cast operator to *GtkWidget instead of previous GTK_WIDGET()
src/gnome-cmd-delete-dialog.cc | 4 ++--
src/gnome-cmd-file-selector.cc | 4 ++--
src/gnome-cmd-main-menu.cc | 10 ++++------
src/gnome-cmd-user-actions.cc | 4 ++--
src/main.cc | 2 +-
src/utils.cc | 10 +++++-----
6 files changed, 16 insertions(+), 18 deletions(-)
---
diff --git a/src/gnome-cmd-delete-dialog.cc b/src/gnome-cmd-delete-dialog.cc
index 26f0e34..19c3fa8 100644
--- a/src/gnome-cmd-delete-dialog.cc
+++ b/src/gnome-cmd-delete-dialog.cc
@@ -204,7 +204,7 @@ static gboolean update_delete_status_widgets (DeleteData *data)
gchar *msg = g_strdup_printf (_("Error while deleting \"%s\"\n\n%s"), data->problem_file, error);
data->problem_action = run_simple_dialog (
- GTK_WIDGET (main_win), TRUE, GTK_MESSAGE_ERROR, msg, _("Delete problem"),
+ *main_win, TRUE, GTK_MESSAGE_ERROR, msg, _("Delete problem"),
-1, _("Abort"), _("Retry"), _("Skip"), NULL);
g_free (msg);
@@ -282,7 +282,7 @@ void gnome_cmd_delete_dialog_show (GList *files)
n_files),
n_files);
- response = run_simple_dialog (GTK_WIDGET (main_win), FALSE,
+ response = run_simple_dialog (*main_win, FALSE,
GTK_MESSAGE_QUESTION, msg, _("Delete"),
1, _("Cancel"), _("OK"), NULL);
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 4328f1f..854404c 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -1321,7 +1321,7 @@ void gnome_cmd_file_selector_create_symlinks (GnomeCmdFileSelector *fs, GList *f
if (choice != 1) // choice != SKIP_ALL
{
gchar *msg = g_strdup (gnome_vfs_result_to_string (result));
- choice = run_simple_dialog (GTK_WIDGET (main_win), TRUE, GTK_MESSAGE_QUESTION, msg, _("Create Symbolic Link"), 3, _("Skip"), _("Skip all"), _("Cancel"), _("Retry"), NULL);
+ choice = run_simple_dialog (*main_win, TRUE, GTK_MESSAGE_QUESTION, msg, _("Create Symbolic Link"), 3, _("Skip"), _("Skip all"), _("Cancel"), _("Retry"), NULL);
g_free (msg);
}
}
@@ -1394,7 +1394,7 @@ void GnomeCmdFileSelector::show_filter()
priv->filter_box = create_hbox (*this, FALSE, 0);
GtkWidget *label = create_label (*this, _("Filter:"));
GtkWidget *entry = create_entry (*this, "entry", "");
- GtkWidget *close_btn = create_button_with_data (GTK_WIDGET (main_win), "x", GTK_SIGNAL_FUNC (on_filter_box_close), this);
+ GtkWidget *close_btn = create_button_with_data (*main_win, "x", GTK_SIGNAL_FUNC (on_filter_box_close), this);
g_signal_connect (entry, "key-press-event", G_CALLBACK (on_filter_box_keypressed), this);
gtk_box_pack_start (GTK_BOX (priv->filter_box), label, FALSE, TRUE, 6);
diff --git a/src/gnome-cmd-main-menu.cc b/src/gnome-cmd-main-menu.cc
index 3c0c03f..2143f12 100644
--- a/src/gnome-cmd-main-menu.cc
+++ b/src/gnome-cmd-main-menu.cc
@@ -162,23 +162,21 @@ static GtkWidget *create_menu_item (GnomeCmdMainMenu *main_menu, GtkMenu *parent
case MENU_TYPE_ITEM:
item = gtk_image_menu_item_new ();
- content = create_hbox (GTK_WIDGET (main_win), FALSE, 12);
+ content = create_hbox (*main_win, FALSE, 12);
desc = gtk_label_new_with_mnemonic (spec->label);
g_object_ref (desc);
gtk_widget_show (desc);
gtk_box_pack_start (GTK_BOX (content), desc, FALSE, FALSE, 0);
- shortcut = create_label (GTK_WIDGET (main_win), spec->shortcut);
+ shortcut = create_label (*main_win, spec->shortcut);
gtk_misc_set_alignment (GTK_MISC (shortcut), 1.0, 0.5);
gtk_box_pack_start (GTK_BOX (content), shortcut, TRUE, TRUE, 0);
if (spec->pixmap_type != 0 && spec->pixmap_info)
{
- pixmap = create_ui_pixmap (GTK_WIDGET (main_win),
- spec->pixmap_type,
- spec->pixmap_info,
- GTK_ICON_SIZE_MENU);
+ pixmap = create_ui_pixmap (*main_win, spec->pixmap_type, spec->pixmap_info, GTK_ICON_SIZE_MENU);
+
if (pixmap)
{
gtk_widget_show (pixmap);
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 47d1561..2b6e8d4 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -825,7 +825,7 @@ void file_create_symlink (GtkMenuItem *menuitem, gpointer not_used)
selected_files),
selected_files, gnome_cmd_dir_get_display_path (inactive_fs->get_directory()));
- gint choice = run_simple_dialog (GTK_WIDGET (main_win), TRUE, GTK_MESSAGE_QUESTION, msg, _("Create Symbolic Link"), 1, _("Cancel"), _("Create"), NULL);
+ gint choice = run_simple_dialog (*main_win, TRUE, GTK_MESSAGE_QUESTION, msg, _("Create Symbolic Link"), 1, _("Cancel"), _("Create"), NULL);
g_free (msg);
@@ -979,7 +979,7 @@ void file_exit (GtkMenuItem *menuitem, gpointer not_used)
break;
}
- gtk_widget_destroy (GTK_WIDGET (main_win));
+ gtk_widget_destroy (*main_win);
}
diff --git a/src/main.cc b/src/main.cc
index 0146459..a7f2f9a 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -169,7 +169,7 @@ int main (int argc, char *argv[])
unique_app_watch_window (app, *main_win);
g_signal_connect (app, "message-received", G_CALLBACK (on_message_received), NULL);
- gtk_widget_show (GTK_WIDGET (main_win));
+ gtk_widget_show (*main_win);
gcmd_owner.load_async();
gcmd_tags_init();
diff --git a/src/utils.cc b/src/utils.cc
index ce187bc..a4c8cdc 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -501,7 +501,7 @@ void mime_exec_single (GnomeCmdFile *f)
{
gchar *fname = get_utf8 (f->info->name);
gchar *msg = g_strdup_printf (_("\"%s\" seems to be a binary executable file but it lacks the executable bit. Do you want to set it and then run the file?"), fname);
- gint ret = run_simple_dialog (GTK_WIDGET (main_win), FALSE, GTK_MESSAGE_QUESTION, msg,
+ gint ret = run_simple_dialog (*main_win, FALSE, GTK_MESSAGE_QUESTION, msg,
_("Make Executable?"),
-1, _("Cancel"), _("OK"), NULL);
g_free (fname);
@@ -530,7 +530,7 @@ void mime_exec_single (GnomeCmdFile *f)
{
gchar *fname = get_utf8 (f->info->name);
gchar *msg = g_strdup_printf (_("\"%s\" is an executable text file. Do you want to run it, or display its contents?"), fname);
- gint ret = run_simple_dialog (GTK_WIDGET (main_win), FALSE, GTK_MESSAGE_QUESTION, msg, _("Run or Display"),
+ gint ret = run_simple_dialog (*main_win, FALSE, GTK_MESSAGE_QUESTION, msg, _("Run or Display"),
-1, _("Cancel"), _("Display"), _("Run"), NULL);
g_free (fname);
g_free (msg);
@@ -658,7 +658,7 @@ void mime_exec_multiple (GList *files, GnomeCmdApp *app)
gchar *msg = g_strdup_printf (ngettext("%s does not know how to open remote file. Do you want to download the file to a temporary location and then open it?",
"%s does not know how to open remote files. Do you want to download the files to a temporary location and then open them?", no_of_remote_files),
gnome_cmd_app_get_name (app));
- retid = run_simple_dialog (GTK_WIDGET (main_win), TRUE, GTK_MESSAGE_QUESTION, msg, "", -1, _("No"), _("Yes"), NULL);
+ retid = run_simple_dialog (*main_win, TRUE, GTK_MESSAGE_QUESTION, msg, "", -1, _("No"), _("Yes"), NULL);
asked = TRUE;
}
@@ -922,13 +922,13 @@ void set_cursor_busy_for_widget (GtkWidget *widget)
void set_cursor_busy ()
{
- set_cursor_busy_for_widget (GTK_WIDGET (main_win));
+ set_cursor_busy_for_widget (*main_win);
}
void set_cursor_default ()
{
- set_cursor_default_for_widget (GTK_WIDGET (main_win));
+ set_cursor_default_for_widget (*main_win);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]