After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 642237 - Clean up history management between runDialog and lookingGlass.
Clean up history management between runDialog and lookingGlass.
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Low enhancement
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-02-13 16:51 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2011-02-19 19:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a common manager for saving and reading history from GSettings, to replace the individual managers in the panel and lookingGlass itself (3.08 KB, patch)
2011-02-13 16:52 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
runDialog: use new history manager implementation (4.21 KB, patch)
2011-02-13 16:52 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
lookingGlass: use new history manager implementation (6.13 KB, patch)
2011-02-13 16:52 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
Add a history manager (3.22 KB, patch)
2011-02-19 18:44 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Add a history manager (3.22 KB, patch)
2011-02-19 18:45 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Add a history manager (3.22 KB, patch)
2011-02-19 18:50 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
runDialog: use new history manager implementation (4.23 KB, patch)
2011-02-19 18:50 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
lookingGlass: use new history manager implementation (6.15 KB, patch)
2011-02-19 18:51 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-02-13 16:51:59 UTC
The runDialog and the lookingGlass both implement a home-made history manager,
each working differently than the other.

These patches simplify history management as in readline by adding a general
history manager supporting reading and writing to gsettings, and takes out
each history manager to use this.

In the future, a stock "HistoryEnabledEntry" component may be useful.
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-02-13 16:52:02 UTC
Created attachment 180779 [details] [review]
Add a common manager for saving and reading history from GSettings, to replace the individual managers in the panel and lookingGlass itself
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-02-13 16:52:05 UTC
Created attachment 180780 [details] [review]
runDialog: use new history manager implementation
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-02-13 16:52:09 UTC
Created attachment 180781 [details] [review]
lookingGlass: use new history manager implementation

This starts saving lookingGlass history in gsettings, and also adds
the ability to clear the text field by pressing 'down' on the last
entry, like the run dialog and readline allow.
Comment 4 drago01 2011-02-19 11:29:52 UTC
Review of attachment 180779 [details] [review]:

Overall looks good, some comments bellow though. 
And use a shorter subject line and add the details in the commit message itself.

::: js/Makefile.am
@@ +11,3 @@
 	misc/telepathy.js	\
 	misc/util.js		\
+	misc/history.js		\

This list is supposed to be ordered alphabetically.

::: js/misc/history.js
@@ +26,3 @@
+    },
+
+    up: function(text) {

I do not like the names "up" and "down" here they do represent the key used to access them in text entries but have no meaning out of this context.
I'd rather use "prev/next" or even "prevItem" and "nextItem".

@@ +41,3 @@
+    },
+
+    pushInput: function(input) {

Naming nitpick again ;) I would call this "addItem".

@@ +64,3 @@
+    },
+
+    save: function() {

Why is this public? You only access it from pushInput and I do not see a point in calling save() without actually adding new items.
Comment 5 drago01 2011-02-19 11:32:03 UTC
Review of attachment 180780 [details] [review]:

Looks good, will need adjustments once you fix up the previous patch though.
Comment 6 drago01 2011-02-19 11:36:43 UTC
Review of attachment 180781 [details] [review]:

Looks good, will need rebasing too.
Comment 7 Jasper St. Pierre (not reading bugmail) 2011-02-19 18:44:49 UTC
Created attachment 181349 [details] [review]
Add a history manager

runDialog and lookingGlass both implement a home-made history
manager, each working slightly differently than each other in
behavior and implementation.

Extract the behavior and implementation from runDialog, which
reads and saves to GSettings.
Comment 8 Jasper St. Pierre (not reading bugmail) 2011-02-19 18:45:01 UTC
Created attachment 181350 [details] [review]
Add a history manager

runDialog and lookingGlass both implement a home-made history
manager, each working slightly differently than each other in
behavior and implementation.

Extract the behavior and implementation from runDialog, which
reads and saves to GSettings.
Comment 9 Jasper St. Pierre (not reading bugmail) 2011-02-19 18:50:46 UTC
Created attachment 181352 [details] [review]
Add a history manager

runDialog and lookingGlass both implement a home-made history
manager, each working slightly differently than each other in
behavior and implementation.

Extract the behavior and implementation from runDialog, which
reads and saves to GSettings.



sorry about bugspam, was trying to wrangle git-bz under control
Comment 10 Jasper St. Pierre (not reading bugmail) 2011-02-19 18:50:53 UTC
Created attachment 181353 [details] [review]
runDialog: use new history manager implementation
Comment 11 Jasper St. Pierre (not reading bugmail) 2011-02-19 18:51:01 UTC
Created attachment 181354 [details] [review]
lookingGlass: use new history manager implementation

This starts saving lookingGlass history in gsettings, and also adds
the ability to clear the text field by pressing 'down' on the last
entry, like the run dialog and readline allow.
Comment 12 drago01 2011-02-19 18:57:24 UTC
Review of attachment 181352 [details] [review]:

Looks good.
Comment 13 drago01 2011-02-19 18:58:50 UTC
Review of attachment 181353 [details] [review]:

This one too.
Comment 14 drago01 2011-02-19 18:59:55 UTC
Review of attachment 181354 [details] [review]:

And this.
Comment 15 Jasper St. Pierre (not reading bugmail) 2011-02-19 19:26:53 UTC
Attachment 181352 [details] pushed as cf3c631 - Add a history manager
Attachment 181353 [details] pushed as 30da70a - runDialog: use new history manager implementation
Attachment 181354 [details] pushed as 4bedbca - lookingGlass: use new history manager implementation