#undef GTK_DISABLE_DEPRECATED
#include "gtkoptionmenu.h"
-#define GTK_DISABLE_DEPRECATED
#define WANT_HPANED 1
#include "gtkhpaned.h"
static void update_cmpl(PossibleCompletion* poss,
CompletionState* cmpl_state);
-static void gtk_file_selection_class_init (GtkFileSelectionClass *klass);
static void gtk_file_selection_set_property (GObject *object,
guint prop_id,
const GValue *value,
guint prop_id,
GValue *value,
GParamSpec *pspec);
-static void gtk_file_selection_init (GtkFileSelection *filesel);
static void gtk_file_selection_finalize (GObject *object);
static void gtk_file_selection_destroy (GtkObject *object);
static void gtk_file_selection_map (GtkWidget *widget);
#endif
-static GtkWindowClass *parent_class = NULL;
-
/* Saves errno when something cmpl does fails. */
static gint cmpl_errno;
}
#endif
-GType
-gtk_file_selection_get_type (void)
-{
- static GType file_selection_type = 0;
-
- if (!file_selection_type)
- {
- static const GTypeInfo filesel_info =
- {
- sizeof (GtkFileSelectionClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gtk_file_selection_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GtkFileSelection),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gtk_file_selection_init,
- };
-
- file_selection_type =
- g_type_register_static (GTK_TYPE_DIALOG, I_("GtkFileSelection"),
- &filesel_info, 0);
- }
-
- return file_selection_type;
-}
+G_DEFINE_TYPE (GtkFileSelection, gtk_file_selection, GTK_TYPE_DIALOG)
static void
gtk_file_selection_class_init (GtkFileSelectionClass *class)
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
- parent_class = g_type_class_peek_parent (class);
-
gobject_class->finalize = gtk_file_selection_finalize;
gobject_class->set_property = gtk_file_selection_set_property;
gobject_class->get_property = gtk_file_selection_get_property;
gtk_file_selection_update_fileops (filesel);
- g_object_notify (G_OBJECT (filesel), "show_fileops");
+ g_object_notify (G_OBJECT (filesel), "show-fileops");
}
void
gtk_widget_destroy (filesel->fileop_c_dir);
filesel->fileop_c_dir = NULL;
}
- g_object_notify (G_OBJECT (filesel), "show_fileops");
+ g_object_notify (G_OBJECT (filesel), "show-fileops");
}
filesel->last_selected = NULL;
}
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ GTK_OBJECT_CLASS (gtk_file_selection_parent_class)->destroy (object);
}
static void
/* Refresh the contents */
gtk_file_selection_populate (filesel, "", FALSE, FALSE);
- GTK_WIDGET_CLASS (parent_class)->map (widget);
+ GTK_WIDGET_CLASS (gtk_file_selection_parent_class)->map (widget);
}
static void
g_free (filesel->fileop_file);
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (gtk_file_selection_parent_class)->finalize (object);
}
/* Begin file operations callbacks */
if (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE))
buf = g_strdup_printf (_("The folder name \"%s\" contains symbols that are not allowed in filenames"), dirname);
else
- buf = g_strdup_printf (_("Error creating folder \"%s\": %s\n%s"), dirname, error->message,
- _("You probably used symbols not allowed in filenames."));
+ buf = g_strdup_printf (_("Error creating folder '%s': %s"),
+ dirname, error->message);
gtk_file_selection_fileop_error (fs, buf);
g_error_free (error);
goto out;
if (g_mkdir (sys_full_path, 0777) < 0)
{
- buf = g_strdup_printf (_("Error creating folder \"%s\": %s\n"), dirname,
- g_strerror (errno));
+ buf = g_strdup_printf (_("Error creating folder '%s': %s"),
+ dirname, g_strerror (errno));
gtk_file_selection_fileop_error (fs, buf);
}
buf = g_strdup_printf (_("The filename \"%s\" contains symbols that are not allowed in filenames"),
fs->fileop_file);
else
- buf = g_strdup_printf (_("Error deleting file \"%s\": %s\n%s"),
- fs->fileop_file, error->message,
- _("It probably contains symbols not allowed in filenames."));
+ buf = g_strdup_printf (_("Error deleting file '%s': %s"),
+ fs->fileop_file, error->message);
gtk_file_selection_fileop_error (fs, buf);
g_error_free (error);
if (g_unlink (sys_full_path) < 0)
{
- buf = g_strdup_printf (_("Error deleting file \"%s\": %s"),
+ buf = g_strdup_printf (_("Error deleting file '%s': %s"),
fs->fileop_file, g_strerror (errno));
gtk_file_selection_fileop_error (fs, buf);
}
if (error)
{
if (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE))
- buf = g_strdup_printf (_("The file name \"%s\" contains symbols that are not allowed in filenames"), new_filename);
+ buf = g_strdup_printf (_("The filename \"%s\" contains symbols that are not allowed in filenames"), new_filename);
else
- buf = g_strdup_printf (_("Error renaming file to \"%s\": %s\n%s"),
- new_filename, error->message,
- _("You probably used symbols not allowed in filenames."));
+ buf = g_strdup_printf (_("Error renaming file to \"%s\": %s"),
+ new_filename, error->message);
gtk_file_selection_fileop_error (fs, buf);
g_error_free (error);
goto out1;
if (error)
{
if (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE))
- buf = g_strdup_printf (_("The file name \"%s\" contains symbols that are not allowed in filenames"), old_filename);
+ buf = g_strdup_printf (_("The filename \"%s\" contains symbols that are not allowed in filenames"), old_filename);
else
- buf = g_strdup_printf (_("Error renaming file \"%s\": %s\n%s"),
- old_filename, error->message,
- _("It probably contains symbols not allowed in filenames."));
+ buf = g_strdup_printf (_("Error renaming file \"%s\": %s"),
+ old_filename, error->message);
gtk_file_selection_fileop_error (fs, buf);
g_error_free (error);
goto out2;
if (index != -1)
{
- if (fs->last_selected != NULL)
- g_free (fs->last_selected);
+ g_free (fs->last_selected);
fs->last_selected = g_strdup (g_ptr_array_index (new_names, index));
filename = get_real_filename (fs->last_selected, FALSE);
cmpl_free_dir_list (cmpl_state->directory_storage);
cmpl_free_dir_sent_list (cmpl_state->directory_sent_storage);
- if (cmpl_state->user_dir_name_buffer)
- g_free (cmpl_state->user_dir_name_buffer);
- if (cmpl_state->user_directories)
- g_free (cmpl_state->user_directories);
- if (cmpl_state->the_completion.text)
- g_free (cmpl_state->the_completion.text);
- if (cmpl_state->updated_text)
- g_free (cmpl_state->updated_text);
+ g_free (cmpl_state->user_dir_name_buffer);
+ g_free (cmpl_state->user_directories);
+ g_free (cmpl_state->the_completion.text);
+ g_free (cmpl_state->updated_text);
g_free (cmpl_state);
}
error:
- if (cmpl_state->user_dir_name_buffer)
- g_free (cmpl_state->user_dir_name_buffer);
- if (cmpl_state->user_directories)
- g_free (cmpl_state->user_directories);
+ g_free (cmpl_state->user_dir_name_buffer);
+ g_free (cmpl_state->user_directories);
cmpl_state->user_dir_name_buffer = NULL;
cmpl_state->user_directories = NULL;