OSDN Git Service

LinGui: add logging level to preferences
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 2 Dec 2008 00:27:38 +0000 (00:27 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 2 Dec 2008 00:27:38 +0000 (00:27 +0000)
git-svn-id: svn://localhost/HandBrake/trunk@1986 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/ghb.ui
gtk/src/hb-backend.c
gtk/src/hb-backend.h
gtk/src/internal_defaults.xml
gtk/src/main.c
gtk/src/resource_data.h
gtk/src/resources.plist

index 489c8b7..f2183eb 100644 (file)
@@ -3275,6 +3275,44 @@ location as the movie.</property>
                             <property name="position">6</property>
                           </packing>
                         </child>
+
+                        <child>
+                          <object class="GtkAlignment" id="alignment_j6">
+                            <property name="visible">True</property>
+                            <property name="left_padding">4</property>
+                            <child>
+                              <object class="GtkHBox" id="hbox1">
+                                <property name="visible">True</property>
+                                <property name="spacing">4</property>
+                                <child>
+                                  <object class="GtkComboBox" id="LoggingLevel">
+                                    <property name="visible">True</property>
+                                    <property name="width_request">55</property>
+                                    <signal name="changed" handler="pref_changed_cb"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label1">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Logging Level</property>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">7</property>
+                          </packing>
+                        </child>
+
                         <child>
                           <object class="GtkCheckButton" id="allow_tweaks">
                             <property name="can_focus">True</property>
@@ -3283,7 +3321,7 @@ location as the movie.</property>
                             <signal name="toggled" handler="tweaks_changed_cb"/>
                           </object>
                           <packing>
-                            <property name="position">7</property>
+                            <property name="position">8</property>
                           </packing>
                         </child>
                         <child>
@@ -3294,7 +3332,7 @@ location as the movie.</property>
                             <signal name="toggled" handler="hbfd_feature_changed_cb"/>
                           </object>
                           <packing>
-                            <property name="position">8</property>
+                            <property name="position">9</property>
                           </packing>
                         </child>
                       </object>
index ba3eb8a..0b93a4d 100644 (file)
@@ -63,6 +63,18 @@ static const gchar *index_str[] =
        "10",
 };
 
+static options_map_t d_logging_opts[] =
+{
+       {"0", "0", 0, "0"},
+       {"1", "1", 1, "1"},
+       {"2", "2", 2, "2"},
+};
+combo_opts_t logging_opts =
+{
+       sizeof(d_logging_opts)/sizeof(options_map_t),
+       d_logging_opts
+};
+
 static options_map_t d_container_opts[] =
 {
        {"MKV", "mkv", HB_MUX_MKV, "mkv"},
@@ -224,6 +236,7 @@ typedef struct
 
 combo_name_map_t combo_name_map[] =
 {
+       {"LoggingLevel", &logging_opts},
        {"FileFormat", &container_opts},
        {"PictureDeinterlace", &deint_opts},
        {"tweak_PictureDeinterlace", &deint_opts},
@@ -1742,6 +1755,7 @@ ghb_update_ui_combo_box(GtkBuilder *builder, const gchar *name, gint user_data,
                subtitle_opts_set(builder, "Subtitles", user_data);
                title_opts_set(builder, "title");
                audio_track_opts_set(builder, "AudioTrack", user_data);
+               generic_opts_set(builder, "LoggingLevel", &logging_opts);
                generic_opts_set(builder, "FileFormat", &container_opts);
                generic_opts_set(builder, "PictureDeinterlace", &deint_opts);
                generic_opts_set(builder, "tweak_PictureDeinterlace", &deint_opts);
@@ -1977,11 +1991,8 @@ ghb_set_default_bitrate_opts(GtkBuilder *builder, gint last_rate)
 static ghb_status_t hb_status;
 
 void
-ghb_backend_init(GtkBuilder *builder, gint debug, gint update)
+ghb_combo_init(GtkBuilder *builder)
 {
-    /* Init libhb */
-    h_scan = hb_init( debug, update );
-    h_queue = hb_init( debug, 0 );
        // Set up the list model for the combos
        init_ui_combo_boxes(builder);
        // Populate all the combos
@@ -1989,6 +2000,14 @@ ghb_backend_init(GtkBuilder *builder, gint debug, gint update)
 }
 
 void
+ghb_backend_init(gint debug)
+{
+    /* Init libhb */
+    h_scan = hb_init( debug, 0 );
+    h_queue = hb_init( debug, 0 );
+}
+
+void
 ghb_backend_close()
 {
        hb_close(&h_queue);
index 8fa0ddc..ff86096 100644 (file)
@@ -93,7 +93,8 @@ void ghb_vquality_range(
        gdouble *page,
        gint *digits);
 //const gchar* ghb_get_rate_string(gint rate, gint type);
-void ghb_backend_init(GtkBuilder *builder, gint debug, gint update);
+void ghb_combo_init(GtkBuilder *builder);
+void ghb_backend_init(gint debug);
 void ghb_backend_close(void);
 void ghb_add_job(GValue *js, gint unique_id);
 void ghb_remove_job(gint unique_id);
index d531a0c..329f6e1 100644 (file)
                <false />
                <key>hbfd_feature</key>
                <false />
+               <key>LoggingLevel</key>
+               <string>1</string>
                <key>nocheckvquality</key>
                <false />
                <key>reduce_hd_preview</key>
index 9f7b940..30b20dc 100644 (file)
@@ -226,6 +226,7 @@ bind_chapter_tree_model (signal_user_data_t *ud)
        g_debug("Done\n");
 }
 
+
 extern void queue_list_selection_changed_cb(void);
 extern void queue_remove_clicked_cb(void);
 extern void queue_list_size_allocate_cb(void);
@@ -543,7 +544,7 @@ main (int argc, char *argv[])
        g_signal_connect(buffer, "changed", (GCallback)x264_entry_changed_cb, ud);
 
        ghb_file_menu_add_dvd(ud);
-       ghb_backend_init(ud->builder, 1, 0);
+       ghb_combo_init(ud->builder);
 
        g_debug("ud %p\n", ud);
        g_debug("ud->builder %p\n", ud->builder);
@@ -569,6 +570,10 @@ main (int argc, char *argv[])
 
        ghb_prefs_to_ui(ud);
 
+       gint logLevel;
+       logLevel = ghb_settings_get_int(ud->settings, "LoggingLevel");
+       ghb_backend_init(logLevel);
+
        if (ghb_settings_get_boolean(ud->settings, "hbfd"))
        {
                ghb_hbfd(ud, TRUE);
index a085d2c..5b46e5e 100644 (file)
 "&lt;/property&gt;\n"
 "                          &lt;/packing&gt;\n"
 "                        &lt;/child&gt;\n"
+"\n"
+"                        &lt;child&gt;\n"
+"                          &lt;object class=&quot;GtkAlignment&quot; id="
+"&quot;alignment_j6&quot;&gt;\n"
+"                            &lt;property name=&quot;visible&quot;&gt;Tr"
+"ue&lt;/property&gt;\n"
+"                            &lt;property name=&quot;left_padding&quot;&"
+"gt;4&lt;/property&gt;\n"
+"                            &lt;child&gt;\n"
+"                              &lt;object class=&quot;GtkHBox&quot; id=&"
+"quot;hbox1&quot;&gt;\n"
+"                                &lt;property name=&quot;visible&quot;&g"
+"t;True&lt;/property&gt;\n"
+"                                &lt;property name=&quot;spacing&quot;&g"
+"t;4&lt;/property&gt;\n"
+"                                &lt;child&gt;\n"
+"                                  &lt;object class=&quot;GtkComboBox&qu"
+"ot; id=&quot;LoggingLevel&quot;&gt;\n"
+"                                    &lt;property name=&quot;visible&quo"
+"t;&gt;True&lt;/property&gt;\n"
+"                                    &lt;property name=&quot;width_reque"
+"st&quot;&gt;55&lt;/property&gt;\n"
+"                                    &lt;signal name=&quot;changed&quot;"
+" handler=&quot;pref_changed_cb&quot;/&gt;\n"
+"                                  &lt;/object&gt;\n"
+"                                  &lt;packing&gt;\n"
+"                                    &lt;property name=&quot;expand&quot"
+";&gt;False&lt;/property&gt;\n"
+"                                    &lt;property name=&quot;position&qu"
+"ot;&gt;0&lt;/property&gt;\n"
+"                                  &lt;/packing&gt;\n"
+"                                &lt;/child&gt;\n"
+"                                &lt;child&gt;\n"
+"                                  &lt;object class=&quot;GtkLabel&quot;"
+" id=&quot;label1&quot;&gt;\n"
+"                                    &lt;property name=&quot;visible&quo"
+"t;&gt;True&lt;/property&gt;\n"
+"                                    &lt;property name=&quot;xalign&quot"
+";&gt;0&lt;/property&gt;\n"
+"                                    &lt;property name=&quot;label&quot;"
+" translatable=&quot;yes&quot;&gt;Logging Level&lt;/property&gt;\n"
+"                                  &lt;/object&gt;\n"
+"                                  &lt;packing&gt;\n"
+"                                    &lt;property name=&quot;position&qu"
+"ot;&gt;1&lt;/property&gt;\n"
+"                                  &lt;/packing&gt;\n"
+"                                &lt;/child&gt;\n"
+"                              &lt;/object&gt;\n"
+"                            &lt;/child&gt;\n"
+"                          &lt;/object&gt;\n"
+"                          &lt;packing&gt;\n"
+"                            &lt;property name=&quot;position&quot;&gt;7"
+"&lt;/property&gt;\n"
+"                          &lt;/packing&gt;\n"
+"                        &lt;/child&gt;\n"
+"\n"
 "                        &lt;child&gt;\n"
 "                          &lt;object class=&quot;GtkCheckButton&quot; i"
 "d=&quot;allow_tweaks&quot;&gt;\n"
 "=&quot;tweaks_changed_cb&quot;/&gt;\n"
 "                          &lt;/object&gt;\n"
 "                          &lt;packing&gt;\n"
-"                            &lt;property name=&quot;position&quot;&gt;7"
+"                            &lt;property name=&quot;position&quot;&gt;8"
 "&lt;/property&gt;\n"
 "                          &lt;/packing&gt;\n"
 "                        &lt;/child&gt;\n"
 "=&quot;hbfd_feature_changed_cb&quot;/&gt;\n"
 "                          &lt;/object&gt;\n"
 "                          &lt;packing&gt;\n"
-"                            &lt;property name=&quot;position&quot;&gt;8"
+"                            &lt;property name=&quot;position&quot;&gt;9"
 "&lt;/property&gt;\n"
 "                          &lt;/packing&gt;\n"
 "                        &lt;/child&gt;\n"
 "              <dict>\n"
 "                      <key>EncodeLogLocation</key>\n"
 "                      <false />\n"
+"                      <key>LoggingLevel</key>\n"
+"                      <string>1</string>\n"
 "                      <key>allow_tweaks</key>\n"
 "                      <false />\n"
 "                      <key>chapters_in_destination</key>\n"
index 5cc700c..0da246c 100644 (file)
@@ -3280,6 +3280,44 @@ location as the movie.&lt;/property&gt;
                             &lt;property name=&quot;position&quot;&gt;6&lt;/property&gt;
                           &lt;/packing&gt;
                         &lt;/child&gt;
+
+                        &lt;child&gt;
+                          &lt;object class=&quot;GtkAlignment&quot; id=&quot;alignment_j6&quot;&gt;
+                            &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                            &lt;property name=&quot;left_padding&quot;&gt;4&lt;/property&gt;
+                            &lt;child&gt;
+                              &lt;object class=&quot;GtkHBox&quot; id=&quot;hbox1&quot;&gt;
+                                &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;spacing&quot;&gt;4&lt;/property&gt;
+                                &lt;child&gt;
+                                  &lt;object class=&quot;GtkComboBox&quot; id=&quot;LoggingLevel&quot;&gt;
+                                    &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                    &lt;property name=&quot;width_request&quot;&gt;55&lt;/property&gt;
+                                    &lt;signal name=&quot;changed&quot; handler=&quot;pref_changed_cb&quot;/&gt;
+                                  &lt;/object&gt;
+                                  &lt;packing&gt;
+                                    &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
+                                    &lt;property name=&quot;position&quot;&gt;0&lt;/property&gt;
+                                  &lt;/packing&gt;
+                                &lt;/child&gt;
+                                &lt;child&gt;
+                                  &lt;object class=&quot;GtkLabel&quot; id=&quot;label1&quot;&gt;
+                                    &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                    &lt;property name=&quot;xalign&quot;&gt;0&lt;/property&gt;
+                                    &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;Logging Level&lt;/property&gt;
+                                  &lt;/object&gt;
+                                  &lt;packing&gt;
+                                    &lt;property name=&quot;position&quot;&gt;1&lt;/property&gt;
+                                  &lt;/packing&gt;
+                                &lt;/child&gt;
+                              &lt;/object&gt;
+                            &lt;/child&gt;
+                          &lt;/object&gt;
+                          &lt;packing&gt;
+                            &lt;property name=&quot;position&quot;&gt;7&lt;/property&gt;
+                          &lt;/packing&gt;
+                        &lt;/child&gt;
+
                         &lt;child&gt;
                           &lt;object class=&quot;GtkCheckButton&quot; id=&quot;allow_tweaks&quot;&gt;
                             &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
@@ -3288,7 +3326,7 @@ location as the movie.&lt;/property&gt;
                             &lt;signal name=&quot;toggled&quot; handler=&quot;tweaks_changed_cb&quot;/&gt;
                           &lt;/object&gt;
                           &lt;packing&gt;
-                            &lt;property name=&quot;position&quot;&gt;7&lt;/property&gt;
+                            &lt;property name=&quot;position&quot;&gt;8&lt;/property&gt;
                           &lt;/packing&gt;
                         &lt;/child&gt;
                         &lt;child&gt;
@@ -3299,7 +3337,7 @@ location as the movie.&lt;/property&gt;
                             &lt;signal name=&quot;toggled&quot; handler=&quot;hbfd_feature_changed_cb&quot;/&gt;
                           &lt;/object&gt;
                           &lt;packing&gt;
-                            &lt;property name=&quot;position&quot;&gt;8&lt;/property&gt;
+                            &lt;property name=&quot;position&quot;&gt;9&lt;/property&gt;
                           &lt;/packing&gt;
                         &lt;/child&gt;
                       &lt;/object&gt;
@@ -5196,6 +5234,8 @@ R2RrUAAABBgBAQACAAAAQAAAABAAAAAQ////AP///wD///8A////AP///wD///8A////AP///wD///8A
                <dict>
                        <key>EncodeLogLocation</key>
                        <false />
+                       <key>LoggingLevel</key>
+                       <string>1</string>
                        <key>allow_tweaks</key>
                        <false />
                        <key>chapters_in_destination</key>