[gthumb/ext] use better default values for window size, thumb size, list order
- From: Paolo Bacchilega <paobac src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gthumb/ext] use better default values for window size, thumb size, list order
- Date: Fri, 4 Sep 2009 15:19:34 +0000 (UTC)
commit 115b4152408db97f73517f31577ce822fe40da27
Author: Paolo Bacchilega <paobac src gnome org>
Date: Fri Sep 4 15:47:11 2009 +0200
use better default values for window size, thumb size, list order
data/gthumb.schemas.in | 6 ++--
.../data/gthumb_photo_importer.schemas.in | 8 ++--
extensions/photo_importer/dlg-photo-importer.c | 2 +-
gthumb/gth-browser.c | 39 ++++++++++++++++++--
gthumb/gth-preferences.h | 2 +-
5 files changed, 44 insertions(+), 13 deletions(-)
---
diff --git a/data/gthumb.schemas.in b/data/gthumb.schemas.in
index 51c31d7..a06736d 100644
--- a/data/gthumb.schemas.in
+++ b/data/gthumb.schemas.in
@@ -234,7 +234,7 @@
<applyto>/apps/gthumb/browser/sort_type</applyto>
<owner>gthumb</owner>
<type>string</type>
- <default>name</default>
+ <default>file::mtime</default>
<locale name="C">
<short></short>
<long></long>
@@ -380,7 +380,7 @@
<applyto>/apps/gthumb/ui/window_width</applyto>
<owner>gthumb</owner>
<type>int</type>
- <default>690</default>
+ <default>0</default>
<locale name="C">
<short></short>
<long>
@@ -393,7 +393,7 @@
<applyto>/apps/gthumb/ui/window_height</applyto>
<owner>gthumb</owner>
<type>int</type>
- <default>460</default>
+ <default>0</default>
<locale name="C">
<short></short>
<long>
diff --git a/extensions/photo_importer/data/gthumb_photo_importer.schemas.in b/extensions/photo_importer/data/gthumb_photo_importer.schemas.in
index 4e6be34..9642b3f 100644
--- a/extensions/photo_importer/data/gthumb_photo_importer.schemas.in
+++ b/extensions/photo_importer/data/gthumb_photo_importer.schemas.in
@@ -28,11 +28,11 @@
</schema>
<schema>
- <key>/schemas/apps/gthumb/ext/photo_importer/subfolder_format</key>
- <applyto>/apps/gthumb/ext/photo_importer/subfolder_format</applyto>
+ <key>/schemas/apps/gthumb/ext/photo_importer/subfolder_single</key>
+ <applyto>/apps/gthumb/ext/photo_importer/subfolder_single</applyto>
<owner>gthumb</owner>
- <type>string</type>
- <default></default>
+ <type>bool</type>
+ <default>TRUE</default>
<locale name="C">
<short></short>
<long>
diff --git a/extensions/photo_importer/dlg-photo-importer.c b/extensions/photo_importer/dlg-photo-importer.c
index bc5382b..5a444f0 100644
--- a/extensions/photo_importer/dlg-photo-importer.c
+++ b/extensions/photo_importer/dlg-photo-importer.c
@@ -719,7 +719,7 @@ dlg_photo_importer (GthBrowser *browser,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("delete_checkbutton")), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_DELETE, FALSE));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("adjust_orientation_checkbutton")), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_ADJUST_ORIENTATION, TRUE));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("single_subfolder_checkbutton")), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_SUBFOLDER_SINGLE, FALSE));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("single_subfolder_checkbutton")), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_SUBFOLDER_SINGLE, TRUE));
gtk_combo_box_set_active (GTK_COMBO_BOX (data->subfolder_type_list), eel_gconf_get_enum (PREF_PHOTO_IMPORT_SUBFOLDER_TYPE, GTH_TYPE_SUBFOLDER_TYPE, GTH_SUBFOLDER_TYPE_FILE_DATE));
update_destination (data);
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 201809d..366a38d 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -3077,9 +3077,40 @@ _gth_browser_construct (GthBrowser *browser)
char *caption;
int i;
- gtk_window_set_default_size (GTK_WINDOW (browser),
- eel_gconf_get_integer (PREF_UI_WINDOW_WIDTH, DEFAULT_UI_WINDOW_WIDTH),
- eel_gconf_get_integer (PREF_UI_WINDOW_HEIGHT, DEFAULT_UI_WINDOW_HEIGHT));
+ {
+ int width;
+ int height;
+
+ width = eel_gconf_get_integer (PREF_UI_WINDOW_WIDTH, 0);
+ height = eel_gconf_get_integer (PREF_UI_WINDOW_HEIGHT, 0);
+
+ if ((width == 0) || (height == 0)) {
+ GdkScreen *screen;
+ int max_width;
+ int max_height;
+ int sidebar_width;
+ int thumb_size;
+ int n_cols;
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (browser));
+ max_width = gdk_screen_get_width (screen) * 5 / 6;
+ max_height = gdk_screen_get_height (screen) * 2 / 3;
+
+ sidebar_width = eel_gconf_get_integer (PREF_UI_BROWSER_SIDEBAR_WIDTH, DEF_SIDEBAR_WIDTH) + 10;
+ thumb_size = eel_gconf_get_integer (PREF_THUMBNAIL_SIZE, DEF_THUMBNAIL_SIZE) + 40;
+
+ for (n_cols = 4; n_cols >= 1; n_cols--) {
+ width = sidebar_width + 40 + (n_cols * thumb_size);
+ if (width < max_width)
+ break;
+ }
+ if (n_cols == 0)
+ width = max_width;
+ height = max_height;
+ }
+
+ gtk_window_set_default_size (GTK_WINDOW (browser), width, height);
+ }
/* ui actions */
@@ -3279,7 +3310,7 @@ _gth_browser_construct (GthBrowser *browser)
browser->priv->file_list = gth_file_list_new (GTH_FILE_LIST_TYPE_NORMAL);
gth_browser_set_sort_order (browser,
- gth_main_get_sort_type (eel_gconf_get_string (PREF_SORT_TYPE, "file::name")),
+ gth_main_get_sort_type (eel_gconf_get_string (PREF_SORT_TYPE, "file::mtime")),
FALSE);
gth_browser_enable_thumbnails (browser, eel_gconf_get_boolean (PREF_SHOW_THUMBNAILS, TRUE));
gth_file_list_set_thumb_size (GTH_FILE_LIST (browser->priv->file_list), eel_gconf_get_integer (PREF_THUMBNAIL_SIZE, DEF_THUMBNAIL_SIZE));
diff --git a/gthumb/gth-preferences.h b/gthumb/gth-preferences.h
index 631738b..cd533a5 100644
--- a/gthumb/gth-preferences.h
+++ b/gthumb/gth-preferences.h
@@ -97,7 +97,7 @@ G_BEGIN_DECLS
#define DEFAULT_UI_WINDOW_WIDTH 690
#define DEFAULT_UI_WINDOW_HEIGHT 460
#define DEFAULT_FAST_FILE_TYPE TRUE
-#define DEFAULT_THUMBNAIL_SIZE 112
+#define DEFAULT_THUMBNAIL_SIZE 128
#define DEFAULT_CONFIRM_DELETION TRUE
#define DEFAULT_MSG_SAVE_MODIFIED_IMAGE TRUE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]