[tracker/tracker-1.0] tracker-needle: Fixed deprecations where possible
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-1.0] tracker-needle: Fixed deprecations where possible
- Date: Tue, 2 Sep 2014 14:22:29 +0000 (UTC)
commit 0ee0cda378459862f6750745ba7e9ca312d4a122
Author: Martyn Russell <martyn lanedo com>
Date: Mon Aug 25 11:24:26 2014 +0100
tracker-needle: Fixed deprecations where possible
src/tracker-needle/tracker-needle.vala | 4 ++--
src/tracker-needle/tracker-stats.vala | 16 +++++++++++++++-
src/tracker-needle/tracker-tags-view.vala | 6 +++---
src/tracker-needle/tracker-view.vala | 4 ++--
4 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 35cf954..8ec6c5c 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -43,7 +43,7 @@ public class Tracker.Needle {
private ToolItem spinner_shell;
private ToggleToolButton show_tags;
private ToolButton show_stats;
- private HBox view;
+ private Box view;
private Tracker.View sw_noresults;
private Tracker.View sw_categories;
private Tracker.View sw_filelist;
@@ -318,7 +318,7 @@ public class Tracker.Needle {
show_stats = builder.get_object ("toolbutton_show_stats") as ToolButton;
show_stats.clicked.connect (show_stats_clicked);
- view = builder.get_object ("hbox_view") as HBox;
+ view = builder.get_object ("hbox_view") as Box;
// Set up views
TreeView treeview;
diff --git a/src/tracker-needle/tracker-stats.vala b/src/tracker-needle/tracker-stats.vala
index ffe930d..f86714e 100644
--- a/src/tracker-needle/tracker-stats.vala
+++ b/src/tracker-needle/tracker-stats.vala
@@ -70,7 +70,13 @@ public class Tracker.Stats : Dialog {
// Label for dialog
var label = new Label (_("The statistics represented here do not reflect their availability,
rather the total data stored:"));
label.set_line_wrap (true);
+ label.set_max_width_chars (50);
label.set_alignment (0.0f, 0.5f);
+
+ // NOTE: We can't use this NEW API because it doesn't work, GTK+ doesn't have a fix yet.
+ // label.set_halign (Gtk.Align.START);
+ // label.set_valign (Gtk.Align.CENTER);
+ // label.set_justify (Gtk.Justification.LEFT);
vbox.pack_start (label, true, true, 0);
// Size group to line up labels
@@ -142,8 +148,16 @@ public class Tracker.Stats : Dialog {
var label_key = new Label (key_used);
var label_val = new Label (val);
+ // NOTE: We can't use this NEW API because it doesn't work, GTK+ doesn't have
a fix yet.
+ // label_key.set_justify (Gtk.Justification.LEFT);
+ // label_key.set_halign (Gtk.Align.START);
+ // label_key.set_valign (Gtk.Align.CENTER);
+ // label_val.set_justify (Gtk.Justification.LEFT);
+ // label_val.set_halign (Gtk.Align.START);
+ // label_val.set_valign (Gtk.Align.CENTER);
label_key.set_alignment (0.0f, 0.5f);
label_val.set_alignment (0.0f, 0.5f);
+
box.pack_start (label_key, true, true, 0);
box.pack_start (label_val, false, true, 0);
@@ -159,7 +173,7 @@ public class Tracker.Stats : Dialog {
vbox.set_spacing (10);
// Add buttons to button area at the bottom
- add_button (Stock.CLOSE, ResponseType.CLOSE);
+ add_button ("_Close", ResponseType.CLOSE);
// Connect signals
this.response.connect (on_response);
diff --git a/src/tracker-needle/tracker-tags-view.vala b/src/tracker-needle/tracker-tags-view.vala
index 2bd97ad..cfae0fb 100644
--- a/src/tracker-needle/tracker-tags-view.vala
+++ b/src/tracker-needle/tracker-tags-view.vala
@@ -53,7 +53,7 @@ private class TagData {
}
}
-public class TrackerTagsView : VBox {
+public class TrackerTagsView : Box {
private Sparql.Connection connection;
private Cancellable cancellable;
@@ -64,7 +64,7 @@ public class TrackerTagsView : VBox {
private const string UI_FILE = "tracker-needle.ui";
- private VBox vbox;
+ private Box vbox;
private Label label;
private Entry entry;
private Button button_add;
@@ -280,7 +280,7 @@ public class TrackerTagsView : VBox {
}
// Get widgets from .ui file
- vbox = builder.get_object ("vbox_tags") as VBox;
+ vbox = builder.get_object ("vbox_tags") as Box;
label = builder.get_object ("label_tag") as Label;
entry = builder.get_object ("entry_tag") as Entry;
button_add = builder.get_object ("button_add") as Button;
diff --git a/src/tracker-needle/tracker-view.vala b/src/tracker-needle/tracker-view.vala
index f9f304c..58fa286 100644
--- a/src/tracker-needle/tracker-view.vala
+++ b/src/tracker-needle/tracker-view.vala
@@ -539,7 +539,7 @@ public class Tracker.View : ScrolledWindow {
Dialog dialog = new Dialog.with_buttons (_("Tags"),
(Window) this.get_toplevel (),
DialogFlags.MODAL | DialogFlags.DESTROY_WITH_PARENT,
- Stock.CLOSE, ResponseType.CLOSE,
+ "_Close", ResponseType.CLOSE,
null);
dialog.set_default_size (400, 300);
dialog.border_width = 12;
@@ -549,7 +549,7 @@ public class Tracker.View : ScrolledWindow {
List<string> files = null;
files.prepend (uri);
- VBox vbox = new TrackerTagsView ((owned) files);
+ Box vbox = new TrackerTagsView ((owned) files);
var content = dialog.get_content_area () as Box;
content.pack_start (vbox, true, true, 6);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]