prefs: Remove preference for 'history length'

Also kinda pointless, and I've never heard of anyone actually
tweaking it.
This commit is contained in:
Cole Robinson 2013-04-23 13:18:21 -04:00
parent 974867189d
commit f84ccc0cf9
4 changed files with 69 additions and 174 deletions

View File

@ -104,12 +104,6 @@
<description>The statistics update interval in seconds</description>
</key>
<key name="history-length" type="i">
<default>120</default>
<summary>The statistics history length</summary>
<description>The number of samples to keep in the statistics history</description>
</key>
<key name="enable-disk-poll" type="b">
<default>false</default>
<summary>Poll disk i/o stats</summary>

View File

@ -165,25 +165,10 @@
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">2</property>
<property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
<object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">samples</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
@ -194,23 +179,6 @@
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="prefs-stats-history-len">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="adjustment">adjustment2</property>
<property name="climb_rate">0.01</property>
<signal name="value-changed" handler="on_prefs_stats_history_length_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
@ -230,21 +198,6 @@
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maintain h_istory of</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">prefs-stats-history-len</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
@ -258,6 +211,72 @@
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Poll _Disk I/O</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">prefs-stats-enable-disk</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="prefs-stats-enable-disk">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_prefs_stats_enable_disk_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label14">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Poll _Network I/O</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">prefs-stats-enable-net</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="prefs-stats-enable-net">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_prefs_stats_enable_net_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"/>
</packing>
</child>
</object>
</child>
</object>
@ -277,108 +296,6 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
<object class="GtkCheckButton" id="prefs-stats-enable-net">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_prefs_stats_enable_net_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_EXPAND</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="prefs-stats-enable-disk">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_prefs_stats_enable_disk_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_EXPAND</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label14">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Network I/O</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">prefs-stats-enable-net</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Disk I/O</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">prefs-stats-enable-disk</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Enable Stats Polling&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>

View File

@ -341,26 +341,17 @@ class vmmConfig(object):
# Stats history and interval length
def get_stats_history_length(self):
return 120
def get_stats_update_interval(self):
interval = self.conf.get("/stats/update-interval")
if interval < 1:
return 1
return interval
def get_stats_history_length(self):
history = self.conf.get("/stats/history-length")
if history < 10:
return 10
return history
def set_stats_update_interval(self, interval):
self.conf.set("/stats/update-interval", interval)
def set_stats_history_length(self, length):
self.conf.set("/stats/history-length", length)
def on_stats_update_interval_changed(self, cb):
return self.conf.notify_add("/stats/update-interval", cb)
def on_stats_history_length_changed(self, cb):
return self.conf.notify_add("/stats/history-length", cb)
# Disable/Enable different stats polling

View File

@ -37,7 +37,6 @@ class vmmPreferences(vmmGObjectUI):
self.refresh_view_system_tray()
self.refresh_update_interval()
self.refresh_history_length()
self.refresh_console_accels()
self.refresh_console_scaling()
self.refresh_sound_local()
@ -58,7 +57,6 @@ class vmmPreferences(vmmGObjectUI):
self.builder.connect_signals({
"on_prefs_system_tray_toggled" : self.change_view_system_tray,
"on_prefs_stats_update_interval_changed": self.change_update_interval,
"on_prefs_stats_history_length_changed": self.change_history_length,
"on_prefs_console_accels_toggled": self.change_console_accels,
"on_prefs_console_scaling_changed": self.change_console_scaling,
"on_prefs_close_clicked": self.close,
@ -104,9 +102,6 @@ class vmmPreferences(vmmGObjectUI):
def refresh_update_interval(self):
self.widget("prefs-stats-update-interval").set_value(
self.config.get_stats_update_interval())
def refresh_history_length(self):
self.widget("prefs-stats-history-len").set_value(
self.config.get_stats_history_length())
def refresh_console_accels(self):
self.widget("prefs-console-accels").set_active(
@ -262,8 +257,6 @@ class vmmPreferences(vmmGObjectUI):
def change_update_interval(self, src):
self.config.set_stats_update_interval(src.get_value_as_int())
def change_history_length(self, src):
self.config.set_stats_history_length(src.get_value_as_int())
def change_console_accels(self, src):
self.config.set_console_accels(src.get_active())