Commit 783bd7db authored by Martyn Russell's avatar Martyn Russell

tracker-miner-fs, tracker-extract: Add config option SchedIdle

The config option allows 3 states, 'always', 'first-index' or 'never'. The
default is 'first-index'.

The tracker-preferences dialog now has 3 radio buttons explaining this too.

This is a first attempt at fixing GB#659422
parent 04caa7ff
......@@ -25,6 +25,16 @@ Boston, MA 02110-1301, USA.
<_description>Log verbosity.</_description>
</key>
<key name="sched-idle" enum="org.freedesktop.Tracker.TrackerSchedIdle">
<default>'first-index'</default>
<_summary>Scheduler priority when idle</_summary>
<_description>
The scheduler is the kernel component that decides which
runnable application will be executed by the CPU next. Each
application has an associated scheduling policy and priority.
</_description>
</key>
<key name="max-bytes" type="i">
<_summary>Max bytes to extract</_summary>
<_description>Maximum number of UTF-8 bytes to extract.</_description>
......
......@@ -32,6 +32,16 @@ Boston, MA 02110-1301, USA.
<default>15</default>
</key>
<key name="sched-idle" enum="org.freedesktop.Tracker.TrackerSchedIdle">
<default>'first-index'</default>
<_summary>Scheduler priority when idle</_summary>
<_description>
The scheduler is the kernel component that decides which
runnable application will be executed by the CPU next. Each
application has an associated scheduling policy and priority.
</_description>
</key>
<key name="throttle" type="i">
<_summary>Throttle</_summary>
<_description>Indexing speed, the higher the slower.</_description>
......
......@@ -29,6 +29,12 @@ typedef enum {
TRACKER_VERBOSITY_DEBUG,
} TrackerVerbosity;
typedef enum {
TRACKER_SCHED_IDLE_ALWAYS,
TRACKER_SCHED_IDLE_FIRST_INDEX,
TRACKER_SCHED_IDLE_NEVER,
} TrackerSchedIdle;
G_END_DECLS
#endif /* __TRACKER_ENUMS_H__ */
......@@ -34,6 +34,7 @@
/* Default values */
#define DEFAULT_VERBOSITY 0
#define DEFAULT_SCHED_IDLE 1
#define DEFAULT_INITIAL_SLEEP 15 /* 0->1000 */
#define DEFAULT_ENABLE_MONITORS TRUE
#define DEFAULT_THROTTLE 0 /* 0->20 */
......@@ -78,6 +79,7 @@ enum {
/* General */
PROP_VERBOSITY,
PROP_SCHED_IDLE,
PROP_INITIAL_SLEEP,
/* Monitors */
......@@ -105,6 +107,7 @@ enum {
static TrackerConfigMigrationEntry migration[] = {
{ G_TYPE_ENUM, "General", "Verbosity", "verbosity" },
{ G_TYPE_ENUM, "General", "SchedIdle", "sched-idle" },
{ G_TYPE_INT, "General", "InitialSleep", "initial-sleep" },
{ G_TYPE_BOOLEAN, "Monitors", "EnableMonitors", "enable-monitors" },
{ G_TYPE_INT, "Indexing", "Throttle", "throttle" },
......@@ -143,7 +146,15 @@ tracker_config_class_init (TrackerConfigClass *klass)
"Log verbosity",
"Log verbosity (0=errors, 1=minimal, 2=detailed, 3=debug)",
TRACKER_TYPE_VERBOSITY,
TRACKER_VERBOSITY_ERRORS,
DEFAULT_VERBOSITY,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SCHED_IDLE,
g_param_spec_enum ("sched-idle",
"Scheduler priority when idle",
"Scheduler priority when idle (0=always, 1=first-index, 2=never)",
TRACKER_TYPE_SCHED_IDLE,
DEFAULT_SCHED_IDLE,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_INITIAL_SLEEP,
......@@ -310,6 +321,10 @@ config_set_property (GObject *object,
tracker_config_set_verbosity (TRACKER_CONFIG (object),
g_value_get_enum (value));
break;
case PROP_SCHED_IDLE:
tracker_config_set_sched_idle (TRACKER_CONFIG (object),
g_value_get_enum (value));
break;
case PROP_INITIAL_SLEEP:
tracker_config_set_initial_sleep (TRACKER_CONFIG (object),
g_value_get_int (value));
......@@ -399,6 +414,9 @@ config_get_property (GObject *object,
case PROP_VERBOSITY:
g_value_set_enum (value, tracker_config_get_verbosity (config));
break;
case PROP_SCHED_IDLE:
g_value_set_enum (value, tracker_config_get_sched_idle (config));
break;
case PROP_INITIAL_SLEEP:
g_value_set_int (value, tracker_config_get_initial_sleep (config));
break;
......@@ -834,6 +852,14 @@ tracker_config_get_verbosity (TrackerConfig *config)
return g_settings_get_enum (G_SETTINGS (config), "verbosity");
}
gint
tracker_config_get_sched_idle (TrackerConfig *config)
{
g_return_val_if_fail (TRACKER_IS_CONFIG (config), DEFAULT_SCHED_IDLE);
return g_settings_get_enum (G_SETTINGS (config), "sched-idle");
}
gint
tracker_config_get_initial_sleep (TrackerConfig *config)
{
......@@ -1017,6 +1043,17 @@ tracker_config_set_verbosity (TrackerConfig *config,
g_object_notify (G_OBJECT (config), "verbosity");
}
void
tracker_config_set_sched_idle (TrackerConfig *config,
gint value)
{
g_return_if_fail (TRACKER_IS_CONFIG (config));
g_settings_set_enum (G_SETTINGS (config), "sched-idle", value);
g_object_notify (G_OBJECT (config), "sched-idle");
}
void
tracker_config_set_initial_sleep (TrackerConfig *config,
gint value)
......
......@@ -51,6 +51,7 @@ TrackerConfig *tracker_config_new (void);
gboolean tracker_config_save (TrackerConfig *config);
gint tracker_config_get_verbosity (TrackerConfig *config);
gint tracker_config_get_sched_idle (TrackerConfig *config);
gint tracker_config_get_initial_sleep (TrackerConfig *config);
gboolean tracker_config_get_enable_monitors (TrackerConfig *config);
gint tracker_config_get_throttle (TrackerConfig *config);
......@@ -73,6 +74,8 @@ gboolean tracker_config_get_enable_writeback (TrackerConfi
void tracker_config_set_verbosity (TrackerConfig *config,
gint value);
void tracker_config_set_sched_idle (TrackerConfig *config,
gint value);
void tracker_config_set_initial_sleep (TrackerConfig *config,
gint value);
void tracker_config_set_enable_monitors (TrackerConfig *config,
......
......@@ -36,6 +36,7 @@
#include <libtracker-common/tracker-ontologies.h>
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-sched.h>
#include <libtracker-common/tracker-enums.h>
#include <libtracker-miner/tracker-miner.h>
......@@ -104,6 +105,8 @@ sanity_check_option_values (TrackerConfig *config)
g_message ("General options:");
g_message (" Verbosity ............................ %d",
tracker_config_get_verbosity (config));
g_message (" Sched Idle ........................... %d",
tracker_config_get_sched_idle (config));
g_message (" Initial Sleep ........................ %d",
tracker_config_get_initial_sleep (config));
......@@ -169,10 +172,14 @@ initialize_signal_handler (void)
}
static void
initialize_priority_and_scheduling (void)
initialize_priority_and_scheduling (TrackerSchedIdle sched_idle,
gboolean first_time_index)
{
/* Set CPU priority */
tracker_sched_idle ();
if (sched_idle == TRACKER_SCHED_IDLE_ALWAYS ||
(sched_idle == TRACKER_SCHED_IDLE_FIRST_INDEX && first_time_index)) {
tracker_sched_idle ();
}
/* Set disk IO priority and scheduling */
tracker_ioprio_init ();
......@@ -185,6 +192,8 @@ initialize_priority_and_scheduling (void)
* Stupid...
*/
g_message ("Setting priority nice level to 19");
errno = 0;
if (nice (19) == -1 && errno != 0) {
const gchar *str = g_strerror (errno);
......@@ -733,7 +742,8 @@ main (gint argc, gchar *argv[])
sanity_check_option_values (config);
/* This makes sure we don't steal all the system's resources */
initialize_priority_and_scheduling ();
initialize_priority_and_scheduling (tracker_config_get_sched_idle (config),
tracker_db_manager_get_first_index_done () == FALSE);
main_loop = g_main_loop_new (NULL, FALSE);
......
......@@ -39,11 +39,13 @@ static void config_constructed (GObject *object);
enum {
PROP_0,
PROP_VERBOSITY,
PROP_SCHED_IDLE,
PROP_MAX_BYTES
};
static TrackerConfigMigrationEntry migration[] = {
{ G_TYPE_ENUM, "General", "Verbosity", "verbosity" },
{ G_TYPE_ENUM, "General", "SchedIdle", "sched-idle" },
{ G_TYPE_INT, "General", "MaxBytes", "max-bytes" },
{ 0 }
};
......@@ -69,6 +71,14 @@ tracker_config_class_init (TrackerConfigClass *klass)
TRACKER_TYPE_VERBOSITY,
TRACKER_VERBOSITY_ERRORS,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SCHED_IDLE,
g_param_spec_enum ("sched-idle",
"Scheduler priority when idle",
"Scheduler priority when idle (0=always, 1=first-index, 2=never)",
TRACKER_TYPE_SCHED_IDLE,
TRACKER_SCHED_IDLE_FIRST_INDEX,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_MAX_BYTES,
......@@ -97,6 +107,11 @@ config_set_property (GObject *object,
g_value_get_enum (value));
break;
case PROP_SCHED_IDLE:
g_settings_set_enum (G_SETTINGS (object), "sched-idle",
g_value_get_enum (value));
break;
case PROP_MAX_BYTES:
g_settings_set_int (G_SETTINGS (object), "max-bytes",
g_value_get_int (value));
......@@ -120,6 +135,11 @@ config_get_property (GObject *object,
g_settings_get_enum (G_SETTINGS (object), "verbosity"));
break;
case PROP_SCHED_IDLE:
g_value_set_enum (value,
g_settings_get_enum (G_SETTINGS (object), "sched-idle"));
break;
case PROP_MAX_BYTES:
g_value_set_int (value,
g_settings_get_int (G_SETTINGS (object), "max-bytes"));
......@@ -189,6 +209,24 @@ tracker_config_set_verbosity (TrackerConfig *config,
g_object_set (G_OBJECT (config), "verbosity", value, NULL);
}
gint
tracker_config_get_sched_idle (TrackerConfig *config)
{
g_return_val_if_fail (TRACKER_IS_CONFIG (config), TRACKER_SCHED_IDLE_FIRST_INDEX);
return g_settings_get_enum (G_SETTINGS (config), "sched-idle");
}
void
tracker_config_set_sched_idle (TrackerConfig *config,
gint value)
{
g_return_if_fail (TRACKER_IS_CONFIG (config));
g_settings_set_enum (G_SETTINGS (config), "sched-idle", value);
g_object_notify (G_OBJECT (config), "sched-idle");
}
gint
tracker_config_get_max_bytes (TrackerConfig *config)
......
......@@ -45,17 +45,18 @@ struct TrackerConfigClass {
GSettingsClass parent_class;
};
GType tracker_config_get_type (void) G_GNUC_CONST;
GType tracker_config_get_type (void) G_GNUC_CONST;
TrackerConfig *tracker_config_new (void);
gint tracker_config_get_verbosity (TrackerConfig *config);
gint tracker_config_get_max_bytes (TrackerConfig *config);
void tracker_config_set_verbosity (TrackerConfig *config,
gint value);
void tracker_config_set_max_bytes (TrackerConfig *config,
gint value);
TrackerConfig *tracker_config_new (void);
gint tracker_config_get_verbosity (TrackerConfig *config);
gint tracker_config_get_sched_idle (TrackerConfig *config);
gint tracker_config_get_max_bytes (TrackerConfig *config);
void tracker_config_set_verbosity (TrackerConfig *config,
gint value);
void tracker_config_set_sched_idle (TrackerConfig *config,
gint value);
void tracker_config_set_max_bytes (TrackerConfig *config,
gint value);
G_END_DECLS
......
......@@ -45,6 +45,8 @@
#include <libtracker-common/tracker-locale.h>
#include <libtracker-common/tracker-sched.h>
#include <libtracker-data/tracker-db-manager.h>
#include "tracker-albumart.h"
#include "tracker-config.h"
#include "tracker-main.h"
......@@ -115,10 +117,14 @@ static GOptionEntry entries[] = {
};
static void
initialize_priority_and_scheduling (void)
initialize_priority_and_scheduling (TrackerSchedIdle sched_idle,
gboolean first_time_index)
{
/* Set CPU priority */
tracker_sched_idle ();
if (sched_idle == TRACKER_SCHED_IDLE_ALWAYS ||
(sched_idle == TRACKER_SCHED_IDLE_FIRST_INDEX && first_time_index)) {
tracker_sched_idle ();
}
/* Set disk IO priority and scheduling */
tracker_ioprio_init ();
......@@ -130,7 +136,7 @@ initialize_priority_and_scheduling (void)
* successful call so we have to check value of errno too.
* Stupid...
*/
g_message ("Setting process priority");
g_message ("Setting priority nice level to 19");
if (nice (19) == -1) {
const gchar *str = g_strerror (errno);
......@@ -244,6 +250,8 @@ sanity_check_option_values (TrackerConfig *config)
g_message ("General options:");
g_message (" Verbosity ............................ %d",
tracker_config_get_verbosity (config));
g_message (" Sched Idle ........................... %d",
tracker_config_get_sched_idle (config));
g_message (" Max bytes (per file) ................. %d",
tracker_config_get_max_bytes (config));
}
......@@ -255,7 +263,7 @@ tracker_main_get_config (void)
}
static int
run_standalone (void)
run_standalone (TrackerConfig *config)
{
TrackerExtract *object;
GFile *file;
......@@ -273,7 +281,8 @@ run_standalone (void)
tracker_albumart_init ();
/* This makes sure we don't steal all the system's resources */
initialize_priority_and_scheduling ();
initialize_priority_and_scheduling (tracker_config_get_sched_idle (config),
tracker_db_manager_get_first_index_done () == FALSE);
file = g_file_new_for_commandline_arg (filename);
uri = g_file_get_uri (file);
......@@ -380,7 +389,7 @@ main (int argc, char *argv[])
/* Set conditions when we use stand alone settings */
if (filename) {
return run_standalone ();
return run_standalone (config);
}
/* Initialize subsystems */
......@@ -398,7 +407,8 @@ main (int argc, char *argv[])
sanity_check_option_values (config);
/* This makes sure we don't steal all the system's resources */
initialize_priority_and_scheduling ();
initialize_priority_and_scheduling (tracker_config_get_sched_idle (config),
tracker_db_manager_get_first_index_done () == FALSE);
tracker_memory_setrlimits ();
if (disable_shutdown) {
......
......@@ -29,7 +29,8 @@ extern static const string UIDIR;
extern static const string SRCDIR;
public class Tracker.Preferences {
private GLib.Settings settings = null;
private GLib.Settings settings_miner_fs = null;
private GLib.Settings settings_extract = null;
private const string UI_FILE = "tracker-preferences.ui";
private const string HOME_STRING = "$HOME";
......@@ -43,7 +44,10 @@ public class Tracker.Preferences {
private CheckButton checkbutton_index_removable_media;
private CheckButton checkbutton_index_optical_discs;
private Scale hscale_disk_space_limit;
private Scale hscale_throttle;
//private Scale hscale_throttle;
private RadioButton radiobutton_sched_idle_always;
private RadioButton radiobutton_sched_idle_first_index;
private RadioButton radiobutton_sched_idle_never;
private Scale hscale_drop_device_threshold;
private ListStore liststore_index;
private ListStore liststore_ignored_directories;
......@@ -69,12 +73,16 @@ public class Tracker.Preferences {
HOME_STRING_EVALUATED = dir_from_config (HOME_STRING);
//config = new Config ();
settings = new GLib.Settings ("org.freedesktop.Tracker.Miner.Files");
settings_miner_fs = new GLib.Settings ("org.freedesktop.Tracker.Miner.Files");
settings_extract = new GLib.Settings ("org.freedesktop.Tracker.Extract");
// Change notification for any key in the schema
settings.changed.connect ((key) => {
print ("Key '%s' changed\n", key);
settings_miner_fs.changed.connect ((key) => {
print ("tracker-miner-fs: Key '%s' changed\n", key);
});
settings_extract.changed.connect ((key) => {
print ("tracker-extract: Key '%s' changed\n", key);
});
}
......@@ -113,7 +121,10 @@ public class Tracker.Preferences {
checkbutton_index_optical_discs = builder.get_object ("checkbutton_index_optical_discs") as CheckButton;
checkbutton_index_optical_discs.set_sensitive (checkbutton_index_removable_media.active);
hscale_disk_space_limit = builder.get_object ("hscale_disk_space_limit") as Scale;
hscale_throttle = builder.get_object ("hscale_throttle") as Scale;
//hscale_throttle = builder.get_object ("hscale_throttle") as Scale;
radiobutton_sched_idle_always = builder.get_object ("radiobutton_sched_idle_always") as RadioButton;
radiobutton_sched_idle_first_index = builder.get_object ("radiobutton_sched_idle_first_index") as RadioButton;
radiobutton_sched_idle_never = builder.get_object ("radiobutton_sched_idle_never") as RadioButton;
hscale_drop_device_threshold = builder.get_object ("hscale_drop_device_threshold") as Scale;
togglebutton_home = builder.get_object ("togglebutton_home") as ToggleButton;
togglebutton_desktop = builder.get_object ("togglebutton_desktop") as ToggleButton;
......@@ -142,23 +153,40 @@ public class Tracker.Preferences {
liststore_ignored_directories_with_content = builder.get_object ("liststore_ignored_directories_with_content") as ListStore;
// Set initial values
checkbutton_enable_index_on_battery.active = settings.get_boolean ("index-on-battery");
checkbutton_enable_index_on_battery.active = settings_miner_fs.get_boolean ("index-on-battery");
checkbutton_enable_index_on_battery_first_time.set_sensitive (!checkbutton_enable_index_on_battery.active);
checkbutton_enable_index_on_battery_first_time.active = settings.get_boolean ("index-on-battery-first-time");
checkbutton_enable_index_on_battery_first_time.active = settings_miner_fs.get_boolean ("index-on-battery-first-time");
spinbutton_delay.set_increments (1, 1);
spinbutton_delay.value = (double) settings.get_int ("initial-sleep");
checkbutton_enable_monitoring.active = settings.get_boolean ("enable-monitors");
checkbutton_index_removable_media.active = settings.get_boolean ("index-removable-devices");
checkbutton_index_optical_discs.active = settings.get_boolean ("index-optical-discs");
hscale_disk_space_limit.set_value ((double) settings.get_int ("low-disk-space-limit"));
hscale_throttle.set_value ((double) settings.get_int ("throttle"));
hscale_drop_device_threshold.set_value ((double) settings.get_int ("removable-days-threshold"));
model_populate (liststore_index, settings.get_strv ("index-recursive-directories"), true, true);
model_populate (liststore_index, settings.get_strv ("index-single-directories"), true, false);
model_populate (liststore_ignored_directories, settings.get_strv ("ignored-directories"), false, false);
model_populate (liststore_ignored_files, settings.get_strv ("ignored-files"), false, false);
model_populate (liststore_ignored_directories_with_content, settings.get_strv ("ignored-directories-with-content"), false, false);
spinbutton_delay.value = (double) settings_miner_fs.get_int ("initial-sleep");
checkbutton_enable_monitoring.active = settings_miner_fs.get_boolean ("enable-monitors");
checkbutton_index_removable_media.active = settings_miner_fs.get_boolean ("index-removable-devices");
checkbutton_index_optical_discs.active = settings_miner_fs.get_boolean ("index-optical-discs");
hscale_disk_space_limit.set_value ((double) settings_miner_fs.get_int ("low-disk-space-limit"));
//thscale_throttle.set_value ((double) settings_miner_fs.get_int ("throttle"));
hscale_drop_device_threshold.set_value ((double) settings_miner_fs.get_int ("removable-days-threshold"));
// What do we do here if extract/miner-fs are different, we
// could use inconsistent states for radiobuttons, but instead
// we're going to just assume miner-fs is the lead here and
// overwrite the extract config with anything we change here.
int sched_idle = settings_miner_fs.get_enum ("sched-idle");
if (sched_idle == 0) {
radiobutton_sched_idle_always.active = true;
} else if (sched_idle == 1) {
radiobutton_sched_idle_first_index.active = true;
} else if (sched_idle == 2) {
radiobutton_sched_idle_never.active = true;
} else {
// If broken value set, use default.
radiobutton_sched_idle_first_index.active = true;
}
model_populate (liststore_index, settings_miner_fs.get_strv ("index-recursive-directories"), true, true);
model_populate (liststore_index, settings_miner_fs.get_strv ("index-single-directories"), true, false);
model_populate (liststore_ignored_directories, settings_miner_fs.get_strv ("ignored-directories"), false, false);
model_populate (liststore_ignored_files, settings_miner_fs.get_strv ("ignored-files"), false, false);
model_populate (liststore_ignored_directories_with_content, settings_miner_fs.get_strv ("ignored-directories-with-content"), false, false);
togglebutton_home.active = model_contains (liststore_index, HOME_STRING_EVALUATED);
togglebutton_desktop.active = model_contains (liststore_index, "&DESKTOP");
......@@ -208,19 +236,40 @@ public class Tracker.Preferences {
case ResponseType.APPLY:
debug ("Converting directories for storage");
settings.set_strv ("index-single-directories", model_to_strv (liststore_index, true, false));
settings.set_strv ("index-recursive-directories", model_to_strv (liststore_index, true, true));
settings.set_strv ("ignored-directories", model_to_strv (liststore_ignored_directories, false, false));
settings.set_strv ("ignored-files", model_to_strv (liststore_ignored_files, false, false));
settings.set_strv ("ignored-directories-with-content", model_to_strv (liststore_ignored_directories_with_content, false, false));
settings_miner_fs.set_strv ("index-single-directories", model_to_strv (liststore_index, true, false));
settings_miner_fs.set_strv ("index-recursive-directories", model_to_strv (liststore_index, true, true));
settings_miner_fs.set_strv ("ignored-directories", model_to_strv (liststore_ignored_directories, false, false));
settings_miner_fs.set_strv ("ignored-files", model_to_strv (liststore_ignored_files, false, false));
settings_miner_fs.set_strv ("ignored-directories-with-content", model_to_strv (liststore_ignored_directories_with_content, false, false));
settings_miner_fs.set_int ("low-disk-space-limit", (int) hscale_disk_space_limit.get_value ());
//settings_miner_fs.set_int ("throttle", (int) hscale_throttle.get_value ());
settings_miner_fs.set_int ("removable-days-threshold", (int) hscale_drop_device_threshold.get_value ());
int sched_idle;
if (radiobutton_sched_idle_always.active) {
sched_idle = 0;
} else if (radiobutton_sched_idle_first_index.active) {
sched_idle = 1;
} else if (radiobutton_sched_idle_never.active) {
sched_idle = 2;
} else {
assert_not_reached ();
}
settings.set_int ("low-disk-space-limit", (int) hscale_disk_space_limit.get_value ());
settings.set_int ("throttle", (int) hscale_throttle.get_value ());
settings.set_int ("removable-days-threshold", (int) hscale_drop_device_threshold.get_value ());
// What do we do here if extract/miner-fs are different, we
// could use inconsistent states for radiobuttons, but instead
// we're going to just assume miner-fs is the lead here and
// overwrite the extract config with anything we change here.
settings_miner_fs.set_enum ("sched-idle", sched_idle);
settings_extract.set_enum ("sched-idle", sched_idle);
debug ("Saving settings...");
settings.apply ();
debug ("Done");
settings_miner_fs.apply ();
debug (" tracker-miner-fs: Done");
settings_extract.apply ();
debug (" tracker-extract: Done");
// TODO: restart the Application and Files miner (no idea how to cleanly do this atm)
return;
......@@ -234,34 +283,34 @@ public class Tracker.Preferences {
[CCode (instance_pos = -1)]
public void spinbutton_delay_value_changed_cb (SpinButton source) {
settings.set_int ("initial-sleep", source.get_value_as_int ());
settings_miner_fs.set_int ("initial-sleep", source.get_value_as_int ());
}
[CCode (instance_pos = -1)]
public void checkbutton_enable_monitoring_toggled_cb (CheckButton source) {
settings.set_boolean ("enable-monitors", source.active);
settings_miner_fs.set_boolean ("enable-monitors", source.active);
}
[CCode (instance_pos = -1)]
public void checkbutton_enable_index_on_battery_toggled_cb (CheckButton source) {
settings.set_boolean ("index-on-battery", source.active);
settings_miner_fs.set_boolean ("index-on-battery", source.active);
checkbutton_enable_index_on_battery_first_time.set_sensitive (!source.active);
}
[CCode (instance_pos = -1)]
public void checkbutton_enable_index_on_battery_first_time_toggled_cb (CheckButton source) {
settings.set_boolean ("index-on-battery-first-time", source.active);
settings_miner_fs.set_boolean ("index-on-battery-first-time", source.active);
}
[CCode (instance_pos = -1)]
public void checkbutton_index_removable_media_toggled_cb (CheckButton source) {
settings.set_boolean ("index-removable-devices", source.active);
settings_miner_fs.set_boolean ("index-removable-devices", source.active);
checkbutton_index_optical_discs.set_sensitive (source.active);
}
[CCode (instance_pos = -1)]
public void checkbutton_index_optical_discs_toggled_cb (CheckButton source) {
settings.set_boolean ("index-optical-discs", source.active);
settings_miner_fs.set_boolean ("index-optical-discs", source.active);
}
[CCode (instance_pos = -1)]
......@@ -273,10 +322,10 @@ public class Tracker.Preferences {
return _("%d%%").printf ((int) value);
}
[CCode (instance_pos = -1)]
public string hscale_throttle_format_value_cb (Scale source, double value) {
return _("%d/20").printf ((int) value);
}
//[CCode (instance_pos = -1)]
//public string hscale_throttle_format_value_cb (Scale source, double value) {
// return _("%d/20").printf ((int) value);
//}
[CCode (instance_pos = -1)]
public string hscale_drop_device_threshold_format_value_cb (Scale source, double value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment