Author: mjc
Date: Thu Feb 14 13:08:11 2008
New Revision: 2282
URL: http://svn.gnome.org/viewvc/gthumb?rev=2282&view=rev

Log:
2008-02-14  Michael J. Chudobiak  <[EMAIL PROTECTED]>

        * NEWS:
        * data/glade/gthumb_preferences.glade:
        * data/gthumb.schemas.in:
        * libgthumb/file-utils.c: (mime_type_is_video),
        (mime_type_is_audio):
        * libgthumb/preferences.h:
        * src/dlg-preferences.c: (include_audio_video_toggled_cb),
        (dlg_preferences):
        Added preference to ignore audio and video files. Bug #467468.



Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/data/glade/gthumb_preferences.glade
   trunk/data/gthumb.schemas.in
   trunk/libgthumb/file-utils.c
   trunk/libgthumb/preferences.h
   trunk/src/dlg-preferences.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS  (original)
+++ trunk/NEWS  Thu Feb 14 13:08:11 2008
@@ -32,6 +32,7 @@
          Bug #504580.
        * Bug #402942 - Add status message during photo import (orientation
          adjust step)
+       * Added preference to ignore audio and video files. Bug #467468.
 
        Bugfixes:
 

Modified: trunk/data/glade/gthumb_preferences.glade
==============================================================================
--- trunk/data/glade/gthumb_preferences.glade   (original)
+++ trunk/data/glade/gthumb_preferences.glade   Thu Feb 14 13:08:11 2008
@@ -1067,7 +1067,7 @@
                          <child>
                            <widget class="GtkTable" id="table14">
                              <property name="visible">True</property>
-                             <property name="n_rows">3</property>
+                             <property name="n_rows">4</property>
                              <property name="n_columns">2</property>
                              <property name="homogeneous">False</property>
                              <property name="row_spacing">6</property>
@@ -1320,6 +1320,29 @@
                                  <property name="y_options">fill</property>
                                </packing>
                              </child>
+
+                             <child>
+                               <widget class="GtkCheckButton" 
id="toggle_audio_video">
+                                 <property name="visible">True</property>
+                                 <property name="tooltip" 
translatable="yes">By default, gThumb lists all files that are likely to be 
found on a digital camera - photos, videos, and audio files. You can omit the 
audio and video files by deselecting this checkbox.</property>
+                                 <property name="can_focus">True</property>
+                                 <property name="label" 
translatable="yes">Include audio clips and movies in browser view</property>
+                                 <property name="use_underline">True</property>
+                                 <property 
name="relief">GTK_RELIEF_NORMAL</property>
+                                 <property 
name="focus_on_click">True</property>
+                                 <property name="active">False</property>
+                                 <property name="inconsistent">False</property>
+                                 <property 
name="draw_indicator">True</property>
+                               </widget>
+                               <packing>
+                                 <property name="left_attach">0</property>
+                                 <property name="right_attach">2</property>
+                                 <property name="top_attach">3</property>
+                                 <property name="bottom_attach">4</property>
+                                 <property name="x_options">fill</property>
+                                 <property name="y_options"></property>
+                               </packing>
+                             </child>
                            </widget>
                            <packing>
                              <property name="padding">0</property>

Modified: trunk/data/gthumb.schemas.in
==============================================================================
--- trunk/data/gthumb.schemas.in        (original)
+++ trunk/data/gthumb.schemas.in        Thu Feb 14 13:08:11 2008
@@ -163,6 +163,19 @@
       </schema>
 
       <schema>
+        <key>/schemas/apps/gthumb/browser/include_audio_video</key>
+        <applyto>/apps/gthumb/browser/include_audio_video</applyto>
+        <owner>gthumb</owner>
+        <type>bool</type>
+        <default>true</default>
+        <locale name="C">
+          <short></short>
+          <long>
+          </long>
+        </locale>
+      </schema>
+
+      <schema>
        <key>/schemas/apps/gthumb/browser/save_thumbnails</key>
        <applyto>/apps/gthumb/browser/save_thumbnails</applyto>
        <owner>gthumb</owner>

Modified: trunk/libgthumb/file-utils.c
==============================================================================
--- trunk/libgthumb/file-utils.c        (original)
+++ trunk/libgthumb/file-utils.c        Thu Feb 14 13:08:11 2008
@@ -708,8 +708,9 @@
 {
        g_return_val_if_fail (mime_type != NULL, FALSE);
 
-       return ( (strstr (mime_type, "video") != NULL) ||
-                (strcmp (mime_type, "application/ogg") == 0));
+       return ( ((strstr (mime_type, "video") != NULL) ||
+                (strcmp (mime_type, "application/ogg") == 0)) &&
+                (eel_gconf_get_boolean (PREF_INCLUDE_AUDIO_VIDEO, TRUE) == 
TRUE));;
 }
 
 
@@ -730,7 +731,8 @@
 {
        g_return_val_if_fail (mime_type != NULL, FALSE);
 
-       return (strstr (mime_type, "audio") != NULL);
+       return ((strstr (mime_type, "audio") != NULL) && 
+               (eel_gconf_get_boolean (PREF_INCLUDE_AUDIO_VIDEO, TRUE) == 
TRUE));
 }
 
 

Modified: trunk/libgthumb/preferences.h
==============================================================================
--- trunk/libgthumb/preferences.h       (original)
+++ trunk/libgthumb/preferences.h       Thu Feb 14 13:08:11 2008
@@ -49,6 +49,7 @@
 #define  PREF_SHOW_COMMENTS          "/apps/gthumb/browser/show_comments"
 #define  PREF_SHOW_THUMBNAILS        "/apps/gthumb/browser/show_thumbnails"
 #define  PREF_FAST_FILE_TYPE         "/apps/gthumb/browser/fast_file_type"
+#define  PREF_INCLUDE_AUDIO_VIDEO    "/apps/gthumb/browser/include_audio_view"
 #define  PREF_SAVE_THUMBNAILS        "/apps/gthumb/browser/save_thumbnails"
 #define  PREF_THUMBNAIL_SIZE         "/apps/gthumb/browser/thumbnail_size"
 #define  PREF_THUMBNAIL_LIMIT        "/apps/gthumb/browser/thumbnail_limit"

Modified: trunk/src/dlg-preferences.c
==============================================================================
--- trunk/src/dlg-preferences.c (original)
+++ trunk/src/dlg-preferences.c Thu Feb 14 13:08:11 2008
@@ -82,6 +82,7 @@
        GtkWidget  *toggle_show_comments;
        GtkWidget  *toggle_show_thumbs;
        GtkWidget  *toggle_file_type;
+       GtkWidget  *toggle_audio_video;
        GtkWidget  *opt_thumbs_size;
        GtkWidget  *toggle_confirm_del;
        GtkWidget  *toggle_ask_to_save;
@@ -315,6 +316,15 @@
 
 
 static void
+include_audio_video_toggled_cb (GtkToggleButton *button,
+                                DialogData      *data)
+{
+        eel_gconf_set_boolean (PREF_INCLUDE_AUDIO_VIDEO, 
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->toggle_audio_video)));
+       gth_browser_refresh (data->browser);
+}
+
+
+static void
 zoom_quality_high_cb (GtkToggleButton *button,
                      DialogData      *data)
 {
@@ -407,6 +417,7 @@
 
         data->toggle_show_thumbs = glade_xml_get_widget (data->gui, 
"toggle_show_thumbs");
         data->toggle_file_type = glade_xml_get_widget (data->gui, 
"toggle_file_type");
+       data->toggle_audio_video = glade_xml_get_widget (data->gui, 
"toggle_audio_video");
 
         data->opt_thumbs_size = glade_xml_get_widget (data->gui, 
"opt_thumbs_size");
         data->opt_click_policy = glade_xml_get_widget (data->gui, 
"opt_click_policy");
@@ -480,6 +491,7 @@
        /* * browser */
 
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(data->toggle_file_type), ! eel_gconf_get_boolean (PREF_FAST_FILE_TYPE, TRUE));
+       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(data->toggle_audio_video), eel_gconf_get_boolean (PREF_INCLUDE_AUDIO_VIDEO, 
TRUE));
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(data->toggle_show_filenames), eel_gconf_get_boolean (PREF_SHOW_FILENAMES, 
FALSE));
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(data->toggle_show_comments), eel_gconf_get_boolean (PREF_SHOW_COMMENTS, TRUE));
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(data->toggle_show_thumbs), eel_gconf_get_boolean (PREF_SHOW_THUMBNAILS, TRUE));
@@ -595,6 +607,10 @@
                          "toggled",
                          G_CALLBACK (fast_file_type_toggled_cb),
                          data);
+        g_signal_connect (G_OBJECT (data->toggle_audio_video),
+                          "toggled",
+                          G_CALLBACK (include_audio_video_toggled_cb),
+                          data);
 
        g_signal_connect (G_OBJECT (data->opt_zoom_quality_high),
                          "toggled",
_______________________________________________
SVN-commits-list mailing list (read only)
http://mail.gnome.org/mailman/listinfo/svn-commits-list

Want to limit the commits to a few modules? Go to above URL, log in to edit 
your options and select the modules ('topics') you want.
Module maintainer? It is possible to set the reply-to to your development 
mailing list. Email [EMAIL PROTECTED] if interested.

Reply via email to