[gnome-usage/tracker-powered-storage-view-wip] storage: Remove old version of storage
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage/tracker-powered-storage-view-wip] storage: Remove old version of storage
- Date: Tue, 31 Jul 2018 16:46:42 +0000 (UTC)
commit d5c976abb469c40c2ec17f2850d21a8607572398
Author: Petr Štětka <pstetka redhat com>
Date: Tue Jun 12 14:42:25 2018 +0200
storage: Remove old version of storage
data/ui/header-bar.ui | 68 ----
src/header-bar.vala | 148 +-------
src/meson.build | 7 -
src/storage-actionbar.vala | 288 ----------------
src/storage-analyzer.vala | 841 ---------------------------------------------
src/storage-item.vala | 198 -----------
src/storage-list-box.vala | 370 --------------------
src/storage-row.vala | 456 ------------------------
src/storage-view.vala | 85 -----
src/storage-worker.vala | 86 -----
src/window.vala | 1 -
11 files changed, 1 insertion(+), 2547 deletions(-)
---
diff --git a/data/ui/header-bar.ui b/data/ui/header-bar.ui
index c264278..b5a6f35 100644
--- a/data/ui/header-bar.ui
+++ b/data/ui/header-bar.ui
@@ -5,49 +5,11 @@
<template class="UsageHeaderBar" parent="GtkHeaderBar">
<property name="visible">False</property>
<property name="show-close-button">True</property>
-
- <child>
- <object class="GtkButton" id="storage_back_button">
- <property name="visible">False</property>
- <property name="no-show-all">True</property>
- <signal name="clicked" handler="on_storage_back_button_clicked"/>
-
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">go-previous-symbolic</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="pack-type">start</property>
- </packing>
- </child>
-
<child type="title">
<object class="GtkStackSwitcher" id="stack_switcher">
<property name="visible">True</property>
</object>
</child>
-
- <child>
- <object class="GtkButton" id="storage_rescan_button">
- <property name="visible">False</property>
- <property name="no-show-all">True</property>
- <signal name="clicked" handler="on_storage_rescan_button_clicked"/>
-
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">view-refresh-symbolic</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="pack-type">end</property>
- </packing>
- </child>
-
<child>
<object class="GtkToggleButton" id="performance_search_button">
<property name="visible">True</property>
@@ -64,35 +26,5 @@
<property name="pack-type">end</property>
</packing>
</child>
-
- <child>
- <object class="GtkButton" id="storage_cancel_button">
- <property name="visible">False</property>
- <property name="no-show-all">True</property>
- <property name="label" translatable="yes">Cancel</property>
- <signal name="clicked" handler="on_storage_cancel_button_clicked"/>
- </object>
- <packing>
- <property name="pack-type">end</property>
- </packing>
- </child>
-
- <child>
- <object class="GtkButton" id="storage_select_button">
- <property name="visible">False</property>
- <property name="no-show-all">True</property>
- <signal name="clicked" handler="on_storage_select_button_clicked"/>
-
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">emblem-ok-symbolic</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="pack-type">end</property>
- </packing>
- </child>
</template>
</interface>
diff --git a/src/header-bar.vala b/src/header-bar.vala
index 1374098..cab69a3 100644
--- a/src/header-bar.vala
+++ b/src/header-bar.vala
@@ -37,27 +37,9 @@ namespace Usage
[GtkChild]
private Gtk.ToggleButton performance_search_button;
- [GtkChild]
- private Gtk.Button storage_back_button;
-
- [GtkChild]
- private Gtk.Button storage_rescan_button;
-
- [GtkChild]
- private Gtk.Button storage_select_button;
-
- [GtkChild]
- private Gtk.Button storage_cancel_button;
-
- private Gtk.MenuButton? storage_selection_menu;
private string title_text = "";
private HeaderBarMode mode;
- const GLib.ActionEntry[] select_action_entries = {
- { "select-all", select_all },
- { "select-none", select_none },
- };
-
public HeaderBar(Gtk.Stack stack)
{
mode = HeaderBarMode.PERFORMANCE;
@@ -74,10 +56,6 @@ namespace Usage
performance_search_button.hide ();
break;
case HeaderBarMode.STORAGE:
- storage_back_button.hide ();
- storage_rescan_button.hide ();
- storage_select_button.hide ();
- storage_cancel_button.hide ();
break;
}
@@ -89,14 +67,7 @@ namespace Usage
performance_search_button.show();
break;
case HeaderBarMode.STORAGE:
- if(title_text == "")
- show_stack_switcher();
- else
- show_title();
-
- storage_rescan_button.show ();
- storage_select_button.show ();
-
+ show_stack_switcher();
break;
}
this.mode = mode;
@@ -108,44 +79,6 @@ namespace Usage
((PerformanceView) (GLib.Application.get_default() as
Application).get_window().get_views()[Views.PERFORMANCE]).set_search_mode(performance_search_button.active);
}
- [GtkCallback]
- private void on_storage_back_button_clicked () {
- ((StorageView) (GLib.Application.get_default() as
Application).get_window().get_views()[Views.STORAGE]).get_storage_list_box().on_back_button_clicked();
- }
-
- [GtkCallback]
- private void on_storage_rescan_button_clicked () {
- stack_switcher.show ();
-
- storage_select_button.hide ();
- storage_rescan_button.hide ();
-
- storage_back_button.hide ();
- StorageAnalyzer.get_default().create_cache.begin(true);
- ((StorageView) (GLib.Application.get_default() as
Application).get_window().get_views()[Views.STORAGE]).get_storage_list_box().reload();
- }
-
- [GtkCallback]
- private void on_storage_cancel_button_clicked () {
- show_storage_selection_mode(false);
- }
-
- [GtkCallback]
- private void on_storage_select_button_clicked () {
- show_storage_selection_mode(true);
- }
-
- public void change_selected_items(uint count)
- {
- if(storage_selection_menu != null)
- {
- if(count > 0)
- storage_selection_menu.label = ngettext ("%u selected", "%u selected", count).printf
(count);
- else
- storage_selection_menu.label = _("Click on items to select them");
- }
- }
-
public HeaderBarMode get_mode()
{
return mode;
@@ -167,21 +100,6 @@ namespace Usage
set_custom_title(stack_switcher);
}
- public void show_storage_back_button(bool show)
- {
- storage_back_button.visible = show;
- }
-
- public void show_storage_rescan_button(bool show)
- {
- storage_rescan_button.visible = show;
- }
-
- public void show_storage_select_button(bool show)
- {
- storage_select_button.visible = show;
- }
-
public void action_on_search()
{
switch(mode)
@@ -193,69 +111,5 @@ namespace Usage
break;
}
}
-
- public void show_storage_selection_mode(bool show)
- {
- if(show)
- {
- storage_rescan_button.hide ();
- storage_select_button.hide ();
- storage_back_button.hide();
- storage_cancel_button.show();
- ((StorageView) (GLib.Application.get_default() as
Application).get_window().get_views()[Views.STORAGE]).show_action_bar(true);
- ((StorageView) (GLib.Application.get_default() as
Application).get_window().get_views()[Views.STORAGE]).get_storage_list_box().set_select_mode(true);
-
- var menu = new GLib.Menu ();
- var item = new GLib.MenuItem (_("Select all"), "headerbar.select-all");
- item.set_attribute("accel", "s", "<Primary>a");
- menu.append_item(item);
-
- item = new GLib.MenuItem (_("Select None"), "headerbar.select-none");
- menu.append_item(item);
-
- storage_selection_menu = new Gtk.MenuButton();
- storage_selection_menu.get_style_context().add_class("selection-menu");
- storage_selection_menu.set_menu_model(menu);
-
- var action_group = new GLib.SimpleActionGroup ();
- action_group.add_action_entries (select_action_entries, this);
- storage_selection_menu.get_popover().insert_action_group ("headerbar", action_group);
-
- storage_selection_menu.show();
- set_custom_title(storage_selection_menu);
- change_selected_items(0);
-
- this.get_style_context().add_class("selection-mode");
- this.show_close_button = false;
- }
- else
- {
- storage_back_button.show ();
-
- storage_rescan_button.show ();
- storage_select_button.show ();
- storage_cancel_button.hide();
- storage_selection_menu = null;
- if(title_text == "")
- show_stack_switcher();
- else
- show_title();
- ((StorageView) (GLib.Application.get_default() as
Application).get_window().get_views()[Views.STORAGE]).show_action_bar(false);
- ((StorageView) (GLib.Application.get_default() as
Application).get_window().get_views()[Views.STORAGE]).get_storage_list_box().set_select_mode(false);
- this.get_style_context().remove_class("selection-mode");
- this.show_close_button = true;
- }
- }
-
- private void select_all()
- {
- ((StorageView) (GLib.Application.get_default() as
Application).get_window().get_views()[Views.STORAGE]).get_storage_list_box().select_all_rows();
-
- }
-
- private void select_none()
- {
- ((StorageView) (GLib.Application.get_default() as
Application).get_window().get_views()[Views.STORAGE]).get_storage_list_box().unselect_all_rows();
- }
}
}
diff --git a/src/meson.build b/src/meson.build
index dc16b9f..1018a98 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -34,14 +34,7 @@ vala_sources = [
'storage/storage-view-row.vala',
'storage/tracker-controller.vala',
'storage/tracker-worker.vala',
- 'storage-actionbar.vala',
- 'storage-analyzer.vala',
'storage-graph.vala',
- 'storage-item.vala',
- 'storage-list-box.vala',
- 'storage-row.vala',
- 'storage-view.vala',
- 'storage-worker.vala',
'swap-speedometer.vala',
'system-monitor.vala',
'utils.vala',
diff --git a/src/window.vala b/src/window.vala
index c4278b6..169e14d 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -67,7 +67,6 @@ namespace Usage
else if(stack.visible_child_name == views[Views.STORAGE].name)
{
header_bar.set_mode(HeaderBarMode.STORAGE);
- StorageAnalyzer.get_default().create_cache.begin();
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]