cd->timeout--;
if (cd->timeout == 0)
{
- gtk_widget_destroy (cd->dlg);
+ gtk_widget_destroy (GTK_WIDGET(cd->dlg));
ghb_suspend_gpm();
return FALSE;
}
prune_logs(signal_user_data_t *ud)
{
gchar *dest_dir;
+ gint days;
// Only prune logs stored in the default config dir location
+ days = ghb_settings_combo_int(ud->settings, "LogLongevity");
+ if (days > 365)
+ return;
+
dest_dir = ghb_get_user_config_dir("EncodeLogs");
if (g_file_test(dest_dir, G_FILE_TEST_IS_DIR))
{
const gchar *file;
- int week = 7*24*60*60;
+ gint duration = days * 24 * 60 * 60;
+
GDir *gdir = g_dir_open(dest_dir, 0, NULL);
time_t now;
path = g_strdup_printf("%s/%s", dest_dir, file);
g_stat(path, &stbuf);
- if (now - stbuf.st_mtime > week)
+ if (now - stbuf.st_mtime > duration)
{
g_unlink(path);
}
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkAlignment" id="alignment63">
+ <property name="visible">True</property>
+ <property name="left_padding">21</property>
+ <child>
+ <object class="GtkHBox" id="hbox83">
+ <property name="visible">True</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkComboBox" id="LogLongevity">
+ <property name="visible">True</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="labela1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Activity Log Longevity</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
</child>
</object>
d_logging_opts
};
+static options_map_t d_log_longevity_opts[] =
+{
+ {"Week", "week", 7, "7"},
+ {"Month", "month", 30, "30"},
+ {"Year", "year", 365, "365"},
+ {"Immortal", "immortal", 366, "366"},
+};
+combo_opts_t log_longevity_opts =
+{
+ sizeof(d_log_longevity_opts)/sizeof(options_map_t),
+ d_log_longevity_opts
+};
+
static options_map_t d_appcast_update_opts[] =
{
{"Never", "never", 0, "never"},
{"PicturePAR", &par_opts},
{"PictureModulus", &alignment_opts},
{"LoggingLevel", &logging_opts},
+ {"LogLongevity", &log_longevity_opts},
{"check_updates", &appcast_update_opts},
{"VideoQualityGranularity", &vqual_granularity_opts},
{"FileFormat", &container_opts},
generic_opts_set(ud->builder, "PicturePAR", &par_opts);
generic_opts_set(ud->builder, "PictureModulus", &alignment_opts);
generic_opts_set(ud->builder, "LoggingLevel", &logging_opts);
+ generic_opts_set(ud->builder, "LogLongevity", &log_longevity_opts);
generic_opts_set(ud->builder, "check_updates", &appcast_update_opts);
generic_opts_set(ud->builder, "FileFormat", &container_opts);
generic_opts_set(ud->builder, "PictureDeinterlace", &deint_opts);