[gthumb] Use better titles in the file/move dialogs - bug 585127
- From: Michael J. Chudobiak <mjc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gthumb] Use better titles in the file/move dialogs - bug 585127
- Date: Tue, 9 Jun 2009 09:34:56 -0400 (EDT)
commit 87d57bcb0a131534ec270a14de1999054e7066c6
Author: mjclab <mjclab pekkala localdomain>
Date: Tue Jun 9 09:33:36 2009 -0400
Use better titles in the file/move dialogs - bug 585127
Also, make the dialogs bigger.
---
libgthumb/gfile-utils.c | 2 +-
src/dlg-file-utils.c | 4 ++--
src/gth-browser-actions-callbacks.c | 5 ++++-
src/gth-folder-selection-dialog.c | 15 +++++++++------
src/gth-folder-selection-dialog.h | 3 ++-
5 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/libgthumb/gfile-utils.c b/libgthumb/gfile-utils.c
index c47415c..0af557e 100644
--- a/libgthumb/gfile-utils.c
+++ b/libgthumb/gfile-utils.c
@@ -402,7 +402,7 @@ gboolean gfile_path_contains (GFile *file,
g_assert (find_this != NULL);
utf8_path = g_file_get_parse_name (file);
- result = strstr (utf8_path, find_this);
+ result = (strstr (utf8_path, find_this) != NULL);
g_free (utf8_path);
return result;
diff --git a/src/dlg-file-utils.c b/src/dlg-file-utils.c
index 7026f29..28fb456 100644
--- a/src/dlg-file-utils.c
+++ b/src/dlg-file-utils.c
@@ -407,7 +407,7 @@ dlg_file_move__ask_dest (GthWindow *window,
GtkWidget *file_sel;
const char *path;
- file_sel = gth_folder_selection_new (_("Choose the destination folder"));
+ file_sel = gth_folder_selection_new (GTK_WINDOW (window), _("File move - choose destination folder"));
if (default_dir != NULL)
path = default_dir;
@@ -507,7 +507,7 @@ dlg_file_copy__ask_dest (GthWindow *window,
GtkWidget *file_sel;
const char *path;
- file_sel = gth_folder_selection_new (_("Choose the destination folder"));
+ file_sel = gth_folder_selection_new (GTK_WINDOW (window), _("File copy - choose the destination folder"));
if (default_dir != NULL)
path = default_dir;
diff --git a/src/gth-browser-actions-callbacks.c b/src/gth-browser-actions-callbacks.c
index 7d74666..f80bd7b 100644
--- a/src/gth-browser-actions-callbacks.c
+++ b/src/gth-browser-actions-callbacks.c
@@ -1301,7 +1301,10 @@ folder_copy (GthWindow *window,
if (path == NULL)
return;
- file_sel = gth_folder_selection_new (_("Choose the destination folder"));
+ if (move)
+ file_sel = gth_folder_selection_new (GTK_WINDOW (window), _("Folder move - choose the destination folder"));
+ else
+ file_sel = gth_folder_selection_new (GTK_WINDOW (window), _("Folder copy - choose the destination folder"));
parent = remove_level_from_path (path);
gth_folder_selection_set_folder (GTH_FOLDER_SELECTION (file_sel), parent);
diff --git a/src/gth-folder-selection-dialog.c b/src/gth-folder-selection-dialog.c
index 085526f..fa47b65 100644
--- a/src/gth-folder-selection-dialog.c
+++ b/src/gth-folder-selection-dialog.c
@@ -39,8 +39,6 @@
#define RC_RECENT_FILE ".gnome2/gthumb/recents"
-#define DEFAULT_DIALOG_WIDTH 390
-#define DEFAULT_DIALOG_HEIGHT 350
#define MAX_RECENT_LIST 20
@@ -242,7 +240,8 @@ browse_button_clicked_cb (GtkButton *button,
static void
-gth_folder_selection_construct (GthFolderSelection *folder_sel,
+gth_folder_selection_construct (GtkWindow *window,
+ GthFolderSelection *folder_sel,
const char *title)
{
GtkDialog *dialog;
@@ -251,6 +250,7 @@ gth_folder_selection_construct (GthFolderSelection *folder_sel,
GtkWidget *label1, *label2;
GtkWidget *alignment;
GtkWidget *browse_button;
+ int width, height;
folder_sel->priv->title = g_strdup (title);
gtk_window_set_title (GTK_WINDOW (folder_sel), title);
@@ -264,8 +264,11 @@ gth_folder_selection_construct (GthFolderSelection *folder_sel,
gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
- gtk_window_set_default_size (GTK_WINDOW (dialog), DEFAULT_DIALOG_WIDTH, DEFAULT_DIALOG_HEIGHT);
+ gth_get_screen_size (window, &width, &height);
+ gtk_window_set_default_size (GTK_WINDOW (dialog),
+ width * 4 / 10,
+ height * 6 / 10);
main_box = gtk_vbox_new (FALSE, 12);
gtk_box_pack_start (GTK_BOX (dialog->vbox), main_box, TRUE, TRUE, 0);
@@ -395,12 +398,12 @@ gth_folder_selection_get_type ()
GtkWidget*
-gth_folder_selection_new (const char *title)
+gth_folder_selection_new (GtkWindow *window, const char *title)
{
GtkWidget *widget;
widget = GTK_WIDGET (g_object_new (GTH_TYPE_FOLDER_SELECTION, NULL));
- gth_folder_selection_construct (GTH_FOLDER_SELECTION (widget), title);
+ gth_folder_selection_construct (window, GTH_FOLDER_SELECTION (widget), title);
return widget;
}
diff --git a/src/gth-folder-selection-dialog.h b/src/gth-folder-selection-dialog.h
index dc97bdd..19eaa32 100644
--- a/src/gth-folder-selection-dialog.h
+++ b/src/gth-folder-selection-dialog.h
@@ -54,7 +54,8 @@ struct _GthFolderSelectionClass
GType gth_folder_selection_get_type (void) G_GNUC_CONST;
-GtkWidget * gth_folder_selection_new (const char *title);
+GtkWidget * gth_folder_selection_new (GtkWindow *window,
+ const char *title);
void gth_folder_selection_set_folder (GthFolderSelection *fsel,
const char *folder);
const char * gth_folder_selection_get_folder (GthFolderSelection *fsel);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]