← Back to team overview

zeitgeist team mailing list archive

[Merge] lp:~jbicha/activity-log-manager/fix-add-popup into lp:activity-log-manager

 

Jeremy Bicha has proposed merging lp:~jbicha/activity-log-manager/fix-add-popup into lp:activity-log-manager.

Requested reviews:
  Activity Log Manager (activity-log-manager)

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/fix-add-popup/+merge/173842

This way the Add menu drops down from the entire Add button instead of popping up wherever it's clicked.

I think it makes bug 1198367 less noticeable.
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/fix-add-popup/+merge/173842
Your team Activity Log Manager is requested to review the proposed merge of lp:~jbicha/activity-log-manager/fix-add-popup into lp:activity-log-manager.
=== modified file 'src/activity-log-manager.vala'
--- src/activity-log-manager.vala	2013-07-08 02:42:55 +0000
+++ src/activity-log-manager.vala	2013-07-09 23:13:24 +0000
@@ -5,7 +5,7 @@
  * Copyright (C) 2012 Manish Sinha <manishsinha@xxxxxxxxxx>
  * Copyright (C) 2012 Intel Corp.
  *               Authored by: Seif Lotfy <seif.lotfy@xxxxxxxxxxxxxxx>
- * Copyright (C) 2013 Jeremey Bicha <jbicha@xxxxxxxxxx>
+ * Copyright (C) 2013 Jeremy Bicha <jbicha@xxxxxxxxxx>
  * 
  * alm is free software: you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published

=== modified file 'src/unified-privacy.vala'
--- src/unified-privacy.vala	2013-07-09 01:34:49 +0000
+++ src/unified-privacy.vala	2013-07-09 23:13:24 +0000
@@ -299,15 +299,19 @@
 			exception_toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR);
 			exception_toolbar.get_style_context().set_junction_sides(Gtk.JunctionSides.TOP);
 
-			var exception_add = new ToolButton(null, _("Add Item"));
-			exception_add.set_icon_name("list-add-symbolic");
-			exception_add.clicked.connect(on_add_exception);
+			var container_add = new ToolItem();
+			var exception_add = new Gtk.MenuButton();
+			var icon = new Image.from_icon_name ("list-add-symbolic", Gtk.IconSize.MENU);
+			exception_add.set_image((Widget)icon);
+			exception_add.set_tooltip_text(_("Add Item"));
 
 			var exception_remove = new ToolButton(null, _("Remove Item"));
 			exception_remove.set_icon_name("list-remove-symbolic");
 			exception_remove.clicked.connect(on_remove_exception);
 
-			exception_toolbar.insert(exception_add, 0);
+			container_add.add(exception_add);
+			container_add.show_all();
+			exception_toolbar.insert(container_add, 0);
 			exception_toolbar.insert(exception_remove, 1);
 			
 			exception_menu = new Gtk.Menu ();
@@ -322,6 +326,7 @@
 			//exception_menu.append(file_menu);
 			exception_menu.append(app_menu);
 			exception_menu.show_all ();
+			exception_add.set_popup(exception_menu);
 
 			exception_vbox.pack_start(exception_toolbar, false, false);
 			
@@ -358,10 +363,6 @@
 				add_app_to_view(app);
 			}
 		}
-		
-		private void on_add_exception() {
-			exception_menu.popup (null, null, null, 1, get_current_event_time ());
-		}
 
 		private void on_remove_exception () {
 			TreeSelection sel = this.exception_list.get_selection ();
@@ -388,7 +389,7 @@
 		
 		private void on_add_folder() {
 			var chooser = new FileChooserDialog(
-				_("Select a directory to blacklist"), 
+				_("Select a folder to blacklist"), 
 				null, FileChooserAction.SELECT_FOLDER);
 			chooser.add_buttons (Stock.OK, ResponseType.OK, Stock.CANCEL, ResponseType.CANCEL);
 			int res = chooser.run();


Follow ups