« December 2007 | Archives index | February 2008 »
January 31, 2008
Accept nil as internal link prefix (wikitext, b0a54b8)
This will be interpreted to mean "no prefix".
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:59 PM
First specs showing functioning internal links (wikitext, 5675b24)
These specs show that valid input is correctly handled. I'll still need to make further changes in order to correctly handle invalid input.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:53 PM
Actually prepend internal link prefix if available (wikitext, f20cf4b)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:49 PM
Prepare for prepending internal link prefixes to internal links (wikitext, b796dcc)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:47 PM
Move link encoding function and make it easier to call (wikitext, b5b252b)
Just pass a VALUE (Ruby string) rather than a pointer and a length, and move the function up near the top of the file where it can be used without needing a forward declaration.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:42 PM
Add spec for unterminated nowiki span in external link text (wikitext, 0380619)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:36 PM
Add code for terminating internal links on hitting line endings (wikitext, 9dd814f)
Another step towards getting internal links working; still a few more to go.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:33 PM
Fix typo in unordered list specs (wikitext, 2e7ed73)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:33 PM
Sanitize link targets when rolling back failed internal links (wikitext, 8da0a08)
We have to do this because the parser is actually just a simple stream-based transformer. It doesn't (and can't) have any lookahead so it acts upon tokens as soon as they are received.
This in turn means that we accept things like QUOT tokens while scanning the internal link target. If we later hit a syntax error before the link is finished then we can't backtrack and instead have to rollback (or re-apply) the stuff we've scanned so far. This in turn means sanitizing things like those QUOT tokens (turning them into named entities) and and other non-printables.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:58 PM
Raise range errors for invalid link text (wikitext, b5ad8d6)
Raise an error if link text includes ">" or "<". In practice this should never happen because the only intended caller is the Wikitext::Parser itself, but put this in just in case.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:55 PM
First version of link sanitization function (wikitext, 0a857f1)
Still have to implement the code that raises an exception for inacceptable input, but the basic set of specs already passes.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:51 PM
Split link encoding specs into separate file, and rename the function (wikitext, b8cd333)
As this method is useful for both internal and external links, drop "internal" from the name.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:35 PM
Rakefile: make "rake spec" emit color by default (wikitext, ab5dead)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:23 PM
Split specs up into separate files (wikitext, 8ef9a25)
The number of specs was starting to get unmanageably large for a single file so split them up into multiple files, grouped according to tag or general functionality.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:10 PM
Some more specs for invalid missing external link targets (wikitext, dcce3be)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:53 PM
More specs for unexpected link end tokens (wikitext, 584f03a)
Basically just testing in more scopes; some of the scopes that I thought didn't work (EM) actually did, it was just that my original specs had a typo in them.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:34 PM
Handle unexpected link end tokens (wikitext, de1f703)
In this case we want to just emit them literally. We only test a couple of basic scopes here. There are other cases that are known to fail at the moment (EM, for example), so specs for those and fixes will come in another commit.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:17 PM
Add specs for link tokens inside nowiki spans (wikitext, 3fb39a2)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:52 PM
Pass through "]]" literally in external link text (wikitext, 4033d84)
Another piece of the internal link implementation.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:50 PM
Pass through "[[" literally in external link text (wikitext, b0dd432)
This is actually the beginning of the internal link implementation.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:46 PM
Spec for unterminated links inside blockquotes (wikitext, 19472e3)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:54 PM
Upgrade to RSpec 1.1.3 (wincent.com, 7c1b89a)
This is necessary for compatability with ZenTest 3.9.0.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:49 PM
More specs for link text variations in external links (wikitext, 87e6041)
Test for automatic closing of unclosed spans, as well as handling of entities and non-ASCII characters in the link text.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:40 PM
Merge branch 'master' into ragel (wikitext, 6ea6705)
<unknown>
Posted 4:46 AM
Correct minor typo in Ragel README (wikitext, ca99f76)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:41 AM
Update copyright range and license headers (wikitext, a94f19b)
Extend range to 2008 in all files, and add the GPL license header to the files from which it was missing.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:35 AM
Add notes to "ragel" branch (wikitext, ea92373)
Add text file explaining what the "ragel" branch is and what it will be used for.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:31 AM
January 30, 2008
Add initial version of Articles controller (wincent.com, 2cbc65e)
Currently doesn't do anything; this is just an empty skeleton.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:10 AM
Complete Article model specs (wincent.com, ef8622f)
This includes one change to the database schema required to make the specs pass.
Although the specs are now "complete" (ie. all facets of the model's behaviour are now specified) there is still room for this to be fleshed out.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:06 AM
Add skeletal specs for models which were missing them (wincent.com, a65baf4)
These will need to be fleshed out.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:51 AM
Complete Link model specs (wincent.com, f80c10f)
These specs test all of the visible behaviour in the Link model and the migration that creates it in the database.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:43 AM
Remove db/schema.rb file (wincent.com, de09bc5)
The previous commit ignored it; but don't bother keeping it in the repository either.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:42 AM
Ignore db/schema.rb (wincent.com, d4c78a5)
This file is easily regenerated and just creates noise in the "git status" output seeing as it changes so often, so ignore it.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:41 AM
Update FixtureReplacement example data (wincent.com, d6ad037)
Add new models and provide attributes for Link model.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:24 AM
Cleanup whitespace in links routing spec (wincent.com, a7b7f59)
Although I actually question the value of these specs generated by the RSpec scaffolding; this is really just testing that map.resources :links with no other parameters does what it should, and that's already covered by Rails' own tests.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:04 AM
January 29, 2008
Add links/create action (wincent.com, 9d91051)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:27 PM
Set up links/new (wincent.com, bae2447)
And supporting CSS.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:14 PM
New models, lib additions and refactoring (wincent.com, a9173ba)
This is the "disappear into a cave" and come out days later with a bunch of changes commit. I really would have liked to break this up into chunks but the changes are far too intermixed to make that very straighfoward.
So in this commit we have a host of new stuff: new CSS, more view templates, the "acts as sortable" module, a refactoring of the authentication module that makes it far more elegant, changes to the links model and controller, additional graphics, notes, the beginnings of a bayesian classifier, and some a "searchable" module (think "acts as ferret").
From here on will try to be more disciplined and break up the changes a little more!
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:18 PM
Upgrade to Haml 1.8.1 (wincent.com, 55f9609)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:54 PM
Initial Sass stylesheet (wincent.com, 0d58fa2)
Just a few top level elements styled for now, as well as flashes and the beginnings of the header and footer.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:53 AM
Add "needles" model (wincent.com, 99bb491)
This is the model that provides site-wide search. "acts as ferret" gets good press but it is an external dependency; MySQL's own full-text search has a reputation for not scaling well.
So we roll our own model to give us what we want using a normal MySQL table of "needles" to be found in the "haystack", and it is a standard Active Record model class.
At this stage we provide simple AND searches (all the words in the query string must be present), OR searches (any of the words is enough to match), attribute searches (for example, "title:hello" finds models with the word "hello" in the "title" attribute), and user-scoped searches (admin users can find all results, anonymous users can find only public results, and other users can find only results which should be visible to them: their own records and any public records).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:49 AM
January 28, 2008
Upgrade to PCRE 7.6 (REnamer, f6f39c8)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:03 PM
January 26, 2008
Add Wincent logo to "public/images" folder (wincent.com, 10b947c)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:09 PM
Remove Rails graphic from "public/images" directory (wincent.com, 9c4a451)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:08 PM
Add QTrace to vendor/disabled (wincent.com, 7dbf482)
This is a useful plug-in for printing out stack traces for matching database queries but I don't want it installed all the time. Adding it to the "vendor/disabled" folder from which it can easily be deployed on an as-needs basis.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:31 PM
Override local_request? method for previewing errors (wincent.com, 9d5b9a1)
This is for testing what remote users would see in production mode in the event of an error.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:52 PM
Modify in_place_editor_field for better nested route support (wincent.com, e2ac00d)
Instead of requiring the caller to manually specify the URL, add a ":nested" option which can be passed a model name. The helper method then constructs a URL appropriately.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:55 PM
In-place editing for translations (wincent.com, 022faf3)
Note that as this is a nested resource I have to pass the URL explicitly. I can probably simplify this by further tweaking the in_place_editor_field method.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:36 PM
January 25, 2008
Add database-level constraints for uniqueness (wincent.com, 163821f)
Seeing as validates_uniqueness_of is vulnerable to race conditions, it is really only a bit of UI-level polish; at the level of database integrity we have to rely on real constraints.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:14 PM
Flesh out locales controller (wincent.com, 9bd9613)
Basic index and show actions.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:31 PM
Add usage notes for in_place_editor_field (wincent.com, 59cc4a8)
It isn't immediately obvious that the in_place_editor_field method expects a symbol or string parameter that indicates the name of an instance variable (normal locals won't work), so document that.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:27 PM
Extract in_place_editor_field_id function (wincent.com, 4539ee9)
Rather than hardcoding in two places the id of the field that will be replaced via AJAX, make a helper function that returns the id and call that.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:03 PM
Show alert if model validation fails for in-place editing (wincent.com, 21d51ba)
If validation fails we now display a JavaScript alert before reverting the field to its former value. I could look at instead updating the flash region of the layout but I actually think a dialog box is a little more usable in this case.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:55 PM
Perform validation during in-place editing (wincent.com, bc34e99)
This is the first step in making in-place editing play nicely with the validation system. Firstly, rather than blindly bypassing validation during AJAX in-place editing (what were they thinking?) we do validate. Secondly, in the event that saving (validation) fails we restore the old value of the field so that the user can see it.
The next step will be to see if we can get the parent controller to display a flash message explaining the cause of the validation failure.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:08 PM
Add update_attribute! to Active Record (wincent.com, cec57c5)
Just like update_attribute except calls save! instead of save.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:07 PM
Fix typo in in place editor helper (wincent.com, a29bd91)
Bad variable name.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:58 PM
Clean up in in place editor helper macros (wincent.com, 3fa763d)
The code can be made to read nicer by dumping an "a = a || b" construct in favor of a "a ||= b" one.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:27 PM
Teach the in place editor to play nicely with forgery protection (wincent.com, 2b5cbd0)
This requires me to commandeer the ":with" option for my own uses, but it seems a worthwhile trade-off (the alternative workaround is to disable forgery protection for in place editors, but that's opening too much of a hole).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:25 PM
Add in_place_editing_plugin (wincent.com, 209d96c)
Initial import (corresponds to Subversion revision 8717).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:08 PM
Move session reset up into controller (wincent.com, ab81739)
We must reset the session from inside the controller and not in authentication.rb (the current_user= method).
If we try the latter then we get ActionController::InvalidAuthenticityToken exceptions during login because the code is run in a before filter (specifically, we go to our sessions "new" action, this calls the session "create" action, the before filter runs and login_with_cookies is called and fails because we are not logged in yet, so the current_user is set to nil, which in turn resets the session and the filters continue running, eventually getting to the "protect_from_forgery" one which fails and throws an exception because just cleared our session).
We must only clear the session after the before filters run, and the correct place to do that is in the sessions controller "destroy" (logout) action.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:38 PM
Updates for session fixation attacks (wincent.com, ba7907d)
I've made the authentication mechanism even more secure against session fixation attacks by adding another couple of layers of "defense in depth".
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:18 PM
Provide nice redirection if lacking privileges (wincent.com, 0e41246)
Redirect the user to the login page if they request something for which they don't have privileges.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:16 PM
Require admin privileges in order to edit translations (wincent.com, 7fbf92c)
Could later open this up to the public but for now just keep it simple.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:51 AM
Pretty permalinks for locales (wincent.com, 2fccd09)
Show "en-US" and "es-ES" etc in the URI rather than "1", "2" and so on.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:51 AM
Only emit password to standard error, not to the log (wincent.com, c4b9b7e)
As mentioned in 75355bc, we can avoid emitting to the log and thus improve security a little bit.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:48 AM
Use color when logging admin password (wincent.com, 75355bc)
When the application is first boot strapped we create an initial user account with admin privileges and log the result to the console and to the log.
This is more secure than providing an account with a default password, although the log file should be cleaned up if there is any chance of a third-party viewing it. In a future commit I'll remove the logging and merely emit the password to standard error (this is more secure still, unless someone happens to be looking over your shoulder during the migration).
In this commit we add colorization (bold green) and some surrounding asterisks to make sure that the password is not drowned out amid all the other output.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:44 AM
Fix custom rake database tasks (wincent.com, 9e5a3d1)
Here I was doing stuff like "db:reset:all" (which drops the databases, creates them, and then sets up the tables from the old schema.rb) when I really meant to do "db:migrate:reset:all" (which does the same, except recreates the tables by running all the migrations again).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:22 AM
January 24, 2008
Set-up "Rename..." menu item (REnamer, 9a57ad3)
Now that we're document-based it makes sense to offer the user a menu item for opening new windows. This throws up a standard open panel and uses the selected items to populate a new window.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:13 PM
Nest translations inside locales (wincent.com, bb54bc7)
Nested routes make sense here seeing as translations always, always exist within the context of a given locale.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:55 AM
Split application README into two files (wincent.com, 9f3f65e)
Now we have setup notes and design notes.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:59 AM
January 23, 2008
Big reworking of authentication machinery (wincent.com, d9afad4)
Basically consists of massaging this into a working state in response to lots of manual testing.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:46 PM
Embed email address in footer (wincent.com, ac2ca7c)
Include clickable email address in footer. The spammers already have my address so there is no point in trying to hide it; better to make it as easy as possible for my customers to contact me.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:56 PM
Initial version of design prototype (wincent.com, 403b233)
At this stage this is just some basic Haml and graphics for the header, footer, and some notes on the navigation bar.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:54 PM
Fix irbrc file (wincent.com, 65d26e4)
The previously committed version wasn't functional (I committed an in-development version by mistake); this is the version I actually wanted to commit.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:41 PM
Add headers to release note sections (Synergy, d2da2bd)
Preface each section of the code-level release notes with a label that indicates the repository that the changes came from.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:29 PM
Remove diagnostic setting from distro script (Synergy, 2f8f6ae)
Remove temporary "set -x" from distro script which was in there for diagnostic purposes (didn't actually mean to include it).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:28 PM
Refactor distribution script (Synergy, a5bf93d)
Use a couple of temporary variables to make long lines fit on a single line, rather than splitting them across multiple lines.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:20 PM
Produce release notes from multiple repositories (Synergy, f50166c)
Don't just produce release notes from the Synergy repository itself, also include changes from the same period that took place in WOCommon, WOPublic and buildtools.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:12 PM
Append extra blank lines at end of output (buildtools, c71d3c1)
When emitting release notes for a project that is spread out across multiple repositories we may end up invoking the ReleaseNotes.sh script several time, successively appending more and more output to the generated notes.
Add two extra line feeds to make this easier: one because "git log" doesn't seem to emit one, and another to provide visual separation between sections.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:09 PM
Automatically append wildcard to tag prefix (buildtools, 579267c)
Make life slightly easier for callers by automatically appending the wildcard (asterisk) to the passed-in tag prefix, thus saving them from having to do it.
This assumes a convention that tags will following a "product name-product version" naming pattern.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:08 PM
Fix expansion error in release notes script (buildtools, 4688577)
This expansion was never going to work because the two components were back to front.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:07 PM
Use common tools for better diagnostic messages (buildtools, 4ac65e8)
In the release notes script, source Common.sh and use its functions for emitting diagnostic messages.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:06 PM
Always direct error and diagnostic output to the stderr (buildtools, 4654413)
Without this it may be harder to diagnose script failures (for example, in the ReleaseNotes.sh script we normally redirect the output to a file; in that case any error messages wind up in the file rather than in the Xcode build window where we want to see them).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:58 PM
Tag buildtools with each release (Synergy, 3079b00)
Also tag the buildtools repository for each release.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:11 PM
Teach release notes script to take an optional prefix parameter (buildtools, d78a5bf)
With this parameter and the help of a convention we can now produce release notes for projects spread across multiple repositories.
In the "main" project repository we just invoke the script as normal (without parameters) and it uses "git describe" to find the last tag, the previous tag, and emit the differences between them.
In the secondary repositories we pass a "tag prefix" which we use to locate the tags corresponding to the release of the "main" project; in other words this depends on a convention in which we create tags in the secondary repositories which have a unique prefix which identifies the main project.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:02 PM
Use non-dashed form of Git commands (buildtools, 43661e2)
For consistency, use "git describe" rather than git-describe.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:04 PM
Bump version number post-release (Synergy, 2b11423)
To 3.5a5+.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:57 PM
Update version numbers for release (Synergy, 64252fc)
Bump to 3.5a5.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:13 PM
Fix formatting in user specs (wincent.com, cedd461)
This is a whitespace-only fix (purely aesthetic).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:28 AM
Fix passphrase mass assignment specs (wincent.com, 3c019bc)
Must test the mass assignment of the passphrase and the passphrase confirmaton at once otherwise validation will prevent the spec from succeeding.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:27 AM
Autoload FixtureReplacement in the console (wincent.com, 6912254)
Add an .irbrc file which includes the FixtureReplacement module whenever firing up the Rails console.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:23 AM
Allow custom matcher to work with associations (wincent.com, b2c76ac)
This fixes some more spec failures; basically, associations don't appear in the attributes hash, so testing for mass assignment o such attributes won't work; we have to message the model object directly instead asking for the value of the attribute.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:14 AM
Fix failure in user spec (superuser mass assignment) (wincent.com, 7636e1d)
The spec failed because we were testing the first user, which is by default the superuser. So perform the test on the second user instead.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:02 AM
User spec fixes for mass assignment (wincent.com, ab7e57d)
Add a custom matcher to the spec helper to make testing for mass assignment a little easier.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:51 AM
January 22, 2008
Remove comment about RSpec bug (wincent.com, f7ebc62)
I sent in a patch for this some time ago and it's included in the currently released version of RSpec (and probably the version prior too; I'm not sure exactly when it was included).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:06 PM
Reset session on login/logout (wincent.com, 4a69b0d)
Rather than trying to nudge the session into the desired shape (which might be error prone), reset it entirely using reset_session.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:44 PM
Remove case-sensitive entry from index (REnamer, 66ca188)
Git exposes the problems in HFS+ with case sensitivity. In this case I renamed a folder from "Tool" to "tool", and because I wasn't careful Git wound up with two entries in the index which were actually the same file (Tool/main.m and tool/main.m).
I believe I've fixed this now by completely removing both entries from the index and then re-adding one of them; this shows up in the history as a simple deletion of one of the files, although in reality the work tree hasn't changed at all.
When Apple's port of ZFS goes final I'll be using it in case-sensitive mode, if they provide one.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:52 PM
Remove two redundant release messages (REnamer, 1ef4055)
There were still two release messages in the codebase that somehow escaped detection until now. These are useless under Garbage Collection, so remove them.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:32 PM
Note possible further renaming of error properties (REnamer, 962112a)
At the moment I don't have a substitution error string and location but I may wish to add it in the future. In that case I'll need to rename the current "errorString" and "errorLocation" to "patternErrorString" and "patternErrorLocation" so as to differentiate them.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:01 PM
Rename valid/isValid to patternValid/isPatternValid (REnamer, adea2c7)
For similar reasons to a99ffb9, rename this property for better consistency. We have a substitutionValid/isSubstitutionValid pair, so to properly differentiate the corresponding regular expression pattern property we should rename it.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:58 PM
Rename lastRegularExpressionError to lastPatternError (REnamer, a99ffb9)
For consistency, seeing as we have a lastSubstitutionError, it makes more sense to have a "lastPatternError". This means that the names for the two types of errors (one in the "Find" string, the other in the "Replace" string) are now more consistent.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:48 PM
Fix spelling error in WORegularExpressionMatch header (REnamer, 9c4ac0c)
Spelling error in code documentation comment.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:30 PM
Clean-up WOItemsValueTransformer header (REnamer, a0e8cc3)
Remove redundant import and add a pragma mark section header for macros.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:23 PM
Teach window controller to have cake and eat it too (REnamer, 457adee)
The docs suggest that the window controller should be the nib owner, but if you follow that recommendation it is very hard to set up bindings. You either have to pollute your window controller with model-like properties (it is supposed to be a view-controller, not a model-controller like NSDocument), or provide some kind of key path which allows you to get at your model properties from within the nib.
The docs do recognize that you might want to make something else your nib owner (your NSDocument model-controller, for example), but if you do that then your window controller won't have a reference to the window it is supposedly controlling (your "File's owner", the document class, is the one with the reference to the window).
The solution here is to do some special initialization in our NSWindowController subclass. We locate and instantiate the nib ourselves with the desired owner (the document subclass), find the "MainWindow" among the top-level objects, call super using initWithWindow: (so it gets a reference to the window). In this way we both get the owner that we want and the window controller properly gets a reference to the window it should control.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:01 PM
Flesh out NSDocumentController subclass (REnamer, ec996a1)
This finishes the refactoring, giving us a nicer separation of responsibilities between the application control, the document class, and now the new NSDocumentController subclass.
As noted in the code comments in the later, this could later be expanded to support the "re-opening" of "documents".
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:27 PM
Custom NSDocumentController subclass (REnamer, db7c7de)
At this stage this is just an empty subclass, but I've integrated it into the application launch procedure.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:27 PM
Force window to front on subsequent "open" events (REnamer, f8562dc)
Now we force the main window to the front on subsequent "open" events, which means that when you drop more files on the Dock icon the associated window becomes main/key, and its preview becomes visible (if appropriate).
I am not sure exactly why I have to force this in this way, nor why the controller's window message returns nil, but it works.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:58 AM
Force preview window to appear at launch (REnamer, 3c032fa)
The preview window won't necessarily appear at launch time unless we force it's associated window to become the main window.
This doesn't seem to work for subsequent "open" events, however (the new window doesn't become main).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:52 AM
Show preview window only for main window (REnamer, cd1b156)
Now that we support multiple "documents" it can be confusing to have multiple preview windows on screen at the same time; so, only show the preview window for the current main window.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:47 AM
January 20, 2008
Move progress text when resizing window (REnamer, b56f7e5)
Was a fixed distance from the left edge of the window; instead, keep it centered underneath the progress bar.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:56 PM
Observe changes in "find" and "replace" strings (REnamer, 1db4e0a)
These should trigger updates to the paths instance variable.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:48 PM
Use NSDocument close when user clicks Cancel button (REnamer, 0a3c7bb)
Rather than trying to effect manual clean-up, let the document system handle it.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:21 PM
Finish refactoring to document-based application (REnamer, 0ae1721)
"Finish" in the sense that the code compiles works, and 90% of the functionality is now hooked up. The most painful part of the refactoring is now done and all that's left are polish issues.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:18 PM
Migrate functionality into application controller (REnamer, 4066730)
Many things which were previously handled by WOREnamerController are now handled by the dedicated application controller class.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:54 PM
Create WOREnamerWindowController class (REnamer, 02706a4)
At the moment we don't actually override the default NSWindowController behaviour, but subsequently we will (to provide a custom title).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:53 PM
Defer to super if we don't handle the KVO message (REnamer, 0c0ac38)
I can't think of any reason why we would receive a message that we don't handle, but it doesn't hurt to check for this eventuality and defer to super if it ever arises.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:50 PM
Improve key/value observing of user defaults (REnamer, e229a72)
Instead of observing the controller, we can observe the defaults object directly.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:48 PM
Avoid void pointer arithmetic in WOCreateFSRefArrayFromAEDesc() (REnamer, 2fe20b9)
This code reads more nicely and is perhaps less error prone if we do it without void pointer arithmetic.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:38 AM
Rename fileCount member (REnamer, 51930fa)
For consistency with selectedFiles member, this should be called selectedFileCount. Also, move it up higher in the struct (it is more conventional for it to precede the selectedFiles member).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:25 AM
January 19, 2008
Fix LSOpenItemsWithRole usage (REnamer, 293cecc)
Function expects (a pointer to) an array of structs, not a pointer to an array of pointers to structs.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:34 PM
Free FSRef array in separate function (REnamer, ac28b68)
There are two places where we walk the FSRef array and free the references; extract this out into a separate function for consistency (in fact, the two different places were discrepant, and one of them didn't correctly NULLify the array after freeing so this is really a bug fix, not just a refactoring).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:16 PM
Teach plug-in to launch using LSOpenItemsWithRole() (REnamer, 20661f5)
This solves an issue with the old implementation which used execv() where it would allow multiple instances of the application to be launched.
As a nice side effect, this simplifies the code considerably and should run faster too with large numbers of files because we are basically working with FSRefs the whole time rather than converting them to path representations.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:56 PM
Change WOREnamerController to WOREnamerDocument (REnamer, 2b68e85)
The refactoring I was considering (making WOREnamerController an NSWindowController subclass) was a bit misguided; better to rename it to WOREnamerDocument and make it an NSDocument subclass.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:02 PM
Set up Info.plist to accept any dropped files/folders (REnamer, 2dd4997)
This will allow us to open a new REnamer "document" for any kind of dropped file or folder.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:42 PM
January 18, 2008
Automate build numbering with buildtools (REnamer, b489885)
Get rid of the hard-coded version number and integrate the standard buildtools workflow (auto-updated build numbers based on Git revision).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:52 PM
Remove unnecessary key/value observing (REnamer, 30a1b9e)
We were doing some unnecessary (but harmless) key/value observing; I suspect this is a legacy from a very old version of the codebase. Clean out the cruft.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:35 PM
Update Xcode project bundle for multi-window refactoring (REnamer, 4b88522)
Sync the project bundle with the other changes that have been made to support multi-window operation.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:31 PM
Split MainMenu.xib into two (REnamer, c4536d6)
Separate out the functionality that was in the MainMenu.xib into two segments: app-wide stuff (like the preference window) and per-window stuff (like the preview pane, the Find/Replace window etc).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:29 PM
Make WOREnamerController an NSWindowController subclass (REnamer, c598bef)
Remove some of the application-level functionality of WOREnamerController and make it an NSWindowController subclass; it will be repurposed as a per-window controller with the goal of being able to have multiple running instances.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:26 PM
Add WOApplicationController class (REnamer, d5f6402)
This is the first commit in a series which might turn out to be a somewhat painful migration. The end goal is to make a dedicated application controller class that works with per-window controllers, one for each rename operation in progress.
I didn't do this originally due to lack of foresight; but the truth is that a user can start one rename, then go to the Finder and start another before setting the first one in action, and so on indefinitely.
The nicest way to handle this is to have one application instance which uses a "document" model and opens one window for each batch of files to be renamed.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:23 PM
Prepare to copy PCRE license into application bundle (REnamer, d758e7c)
This is just setting up a symlink so that we can install future versions of PCRE and automatically pick up the latest license file.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:22 PM
Update "About" box text (REnamer, 8053cd7)
Update copyright years for PCRE, add author email address, and add hyperlink to the REnamer help.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:10 PM
Add substitution tests (REnamer, ebddafe)
Test a number of substitution variants in single-substitution mode.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:32 PM
Add tests for basic subpattern matching (REnamer, 6818826)
These are the tests that were used to discover the flaw fixed in 8c006bb.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:47 PM
Fix broken subpattern matching (REnamer, 8c006bb)
Subpatterns weren't being incorporated into the match objects because of an inverted conditional introduced when extracting the functionality out into the WORegularExpressionMatch class.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:44 PM
Simplify creation of WORegularExpressionMatch objects (REnamer, 1dd2077)
Rather than calling pcre_get_substring() just create the string directly ourselves; the total number of allocations is rougly the same but the code is simpler.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:28 PM
Test clean-up (REnamer, 8a5f9d1)
For consistency, convert some parts of the regular expression tests to use Objective-C 2.0 properties; these were missed during previous modifications to the tests.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:03 PM
Add tests for subsitution validity checks (REnamer, 54b1ceb)
These are tests for both the WORegularExpression class, and the NSString category upon which the substitution validity checks are built.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:54 PM
Avoid freeing static string when normalizing (REnamer, 33cbcd0)
When normalizing patterns we return a static string "" for the empty string. Given that the caller is expected to free normalized strings it will eventually try freeing the static string which will result in an warning being printed to the console.
We could dynamically allocate an empty string and return that instead (which the caller could then safely free), but this is in a performance-critical section of the code so we instead avoid the allocation and return a global static string.
As this is an internal-only API with just two call sites, we have those sites explicitly check for that global before invoking free.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:40 PM
Remove redundant object controller in main nib (REnamer, 8346fc7)
We don't need to go through a mediating NSObjectController here, we can just bind to the WOREnamerController instance directly.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:13 PM
Teach user interface about substitution errors (REnamer, 65c992a)
Previously the user interface only knew about regular expression pattern compilation errors. Now it knows about invalid replacement strings as well.
We display an alert triangle in next to the replacement field in this case with a tool-tip showing the error, and also log it to the log drawer.
In doing this I cleaned up the logging in general so that we no longer re-log the same error if the user adds more characters to one of the fields and the error remains constant.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:04 PM
Xcode project bundle updates (REnamer, cc55e06)
Update bundle with references to new files.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:07 PM
Add NSColor HUD category (REnamer, c338e66)
Not sure whether this is a good idea or not so I haven't included this code in the application, but it is a demonstration of how we could get rid of our macros (which re-instantiate the color objects on every use) and replace them with persistent singleton objects.
This is a space-for-time tradeoff which we probably only need to make if profiling indicates that it's required.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:07 PM
Update argument handling in main application (REnamer, 6340d58)
First up, under Garbage Collection we can use a shorter idiom to initialize the mutable arguments array.
Secondly, note that we can do this processing in application:openFiles: rather than in init.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:05 PM
Add code-level notes for plug-in (REnamer, 900e393)
These are just comments added when auditing the plug-in code; things to do, points to remember and so on.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:00 PM
Teach WORegularExpression to handle invalid substitution expressions (REnamer, 354d493)
If a substitution is invalid we return nil.
We check for substitution validity at the time when the substitution string is set, to avoid doing it repeatedly in a tight loop when working on many files.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:57 AM
Add NSString category for checking substitution validity (REnamer, 3e9e2db)
This adds a isValidSubstitutionExpression method to NSString.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:50 AM
Throw an exception if an unterminated substitution expression found (REnamer, bc345ad)
This brings us into line with the behaviour of Perl, which will emit a "Substitution replacement not terminated at line x" message in such a case.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:33 AM
Refactoring of bundle-locating code (REnamer, 2425af5)
Move bundle-locating code up to the top of the file, along with the other utility functions. Actually use the new code in more places.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:12 AM
Log tweaks (REnamer, 623a800)
Prefix all log messages with "REnamer" so as to distinguish them from other messages emitted by the Finder to the console.
We only want to use the log function to notify of real errors that impede functionality, so as to keep console noise down to a minimum.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:10 AM
Be defensive in WOREnamerApplicationIsFinder() (REnamer, 0d90c7c)
Be prepared for NULL return values from the CF function calls. It's possible that in applications other than the Finder we could receive NULL here.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:59 AM
Autosave adjustments (REnamer, 4428255)
Turn off column order and size autosaving for the preview table; it doesn't work properly because our preview table view sometimes has two columns and sometimes three, and the one whose presence is toggled is the first one.
At the same time, turn on autosaving for the preview pane itself.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:34 AM
Add NSDrawer delegate methods (REnamer, 921ccc5)
It appears that the automatic resizing of open drawers when the parent window resizes is broken on Leopard (at least, I can't remember it being like this under Tiger and I have seen one mailing list post from someone describing the same problem on Leopard).
The docs would suggest that the delegate should receive a drawerWillResizeContents:toSize: message whenever the parent window is resized, but no such messages are received.
I am not sure whether this is a big enough deal to implement a work around just yet, so for now just making note of this here and in the code.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:12 AM
Force way to front on launch (REnamer, 2670577)
This is necessary when launched from within the Finder plug-in because in that case we do not come to the front and the user may not even release that we've launched.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:10 AM
Minor formatting clean-up in main controller header (REnamer, 4f92fa7)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:09 AM
Remove test comments in NSApplication convenience category (WOCommon, 1656a77)
Testing has now confirmed that the "activate" method is indeed necessary so remove the comments about possibly removing it.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:05 AM
Fix pointer error in the plug-in (REnamer, 5eb12a6)
We were copying to argv[1] when we really wanted to copy to &argv[1].
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:47 AM
Throw up dialog if plug-in can't find main application (REnamer, fbfc2ad)
We first try by bundle identifier, but that won't work if the Launch Services database is out of date, so we fall back to looking in the Applications folder. If that doesn't work either we'd best notify the user; we do so and suggest that they try installing into the Applications folder, as that is probably the simplest and most appropriate bit of trouble-shooting advice that we can give under the circumstances.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:23 AM
January 17, 2008
Start conversion of help documentation (REnamer, ade7ded)
As a starting point I previously imported the documentation from Hextrapolate for use as a template. This is the first commit in the conversion which will turn all this into the documentation for REnamer.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:55 PM
Prepare icon graphics for help (REnamer, 3ffbd6d)
16x16 and 32x32 versions of the REnamer icon.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:52 PM
More CSS help changes for Leopard (REnamer, 29779b2)
These are the same changes alrady committed to the WOCommon repository, mostly for bringing the access page into line with the new look.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:51 PM
Updates for new Leopard "access" help pages (WOCommon, 68822d3)
Get rid of the splash image and tweak the rest of the CSS for better conformance with the new look in Apple's help pages on Leopard.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:56 PM
Reduce spacing between index items (REnamer, 18fdbb0)
Another change to match the new help documentation style in Leopard: reduce the spacing betwen items in the index.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:03 PM
Fix Index header misalignment (REnamer, 97fa977)
Not sure whether this was an issue before, but on Leopard in both Safari and Firefox the index page title was too low. Tweak the CSS to make it higher.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:52 PM
Fix whitespace damage in CSS files (REnamer, ba0d253)
This whitspace damage has been in there for some time but only just noticed it.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:41 PM
Import CSS updates into web help directory (REnamer, ecc32be)
Previously tweaked the CSS in the embedded in-application help; now copy those same changes into the web help directory.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:38 PM
Use CSS 3 border-image property in help documentation (REnamer, 2785b27)
When the property is not supported the box is shown without a visible border; this seems like an acceptable degradation, seeing as the box contents are still visually indented.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:35 PM
Tweak CSS to make help documentation match Leopard style (REnamer, ef59fa4)
These are simple, low-risk changes involving font size, color and weight.
A slightly higher-risk change would be using the CSS3 border-image property to replicate the new "box" style in the Leopard help documentation (higher-risk because it would only work with WebKit; it may be necessary to use it only in the embedded help, which will always be viewed with WebKit by definition, and not use it in the online version, where people might be browsing using Firefox or some other alternative). The alternative to using border-image is to do what Apple does and add a bunch of CSS for each corner and edge, but that's not a very attractive change as it would require lots of source files to be edited and kind of defeats the purpose of CSS.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:38 PM
Add convenience macro for double-checked locking pattern (WOCommon, c5ba560)
In the most common usage case of the double-checked locking pattern (lazy initialization of shared resources such as singletons) we almost always use the exact same repetitive code.
Make a macro for this use case, which uses double-checked locking with memory barriers for safety, synchronizes against "self" (which will work well in class methods for singletons, and well in instance methods for other types of lazy initialization), and returns the result.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:33 PM
Factor out color macros into WOHUD.h (REnamer, cd6174e)
The color macros were all defined in WOHUDTableView.h, seeing as that was the first class I made when starting work on the HUD controls.
This was a bit of an anomaly, as other HUD classes had to include the table view header even if they had nothing to do with it.
So extract the color macros out into a separate file, WOHUD.h, and have all classes which need to know about HUD colors import that.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:28 PM
Fix off-by-one error in corner view (REnamer, 12253da)
In the flipped coordinate system case, the border would be drawn one pixel too low.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:24 PM
Only draw border if visible in header cell (REnamer, 9e5b34a)
Check to see if the border would actually be visible before drawing it.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:23 PM
Simplify custom table header cell calculations (REnamer, df8c2af)
Rather than creating an entirely new rectangle and specifying all the dimensions, just modify an existing one.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:20 PM
Teach HUD corner view to draw lower border (REnamer, 8a39fdf)
This is for consistency with the custom table header cell. It should work equally well in unflipped (the default) and flipped coordinate systems.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:17 PM
Teach WOHUDTableView to use custom corner view (REnamer, d1e387b)
Use the new corner view class created in c1e39a4, thus eliminating the last non-HUD element from the preview window.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:11 PM
Add WOHUDTableCornerView class (REnamer, c1e39a4)
This replaces the standard corner view (which draws a silver gradient) with one suitable for use inside a HUD panel.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:06 PM
Remove custom HUD clip view (REnamer, f124cc7)
Looks like we can do what we want by setting up a custom corner view, so get rid of this unused NSClipView subclass.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:02 PM
Fix page-wise scrolling (REnamer, adc7584)
This is the fix anticipated in 655a288. I wasn't jumping far enough when doing page-up and page-down scrolling. The cause was treating horizontalPageScroll and verticalPageScroll like horizontalLineScroll and verticalLineScroll; they are not the same!
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:26 AM
Add HUD subgroup to Xcode project (REnamer, eca26a2)
There are now quite a few files related to the HUD functionality, so group these together in the Xcode project.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:16 AM
Implement click-and-hold in the non-knob part of the slot (REnamer, 655a288)
Previous clicking in the non-knob part of the lost resulted in a "page up" or "page down" movement. Now clicking-and-holding results in a repeated action, depending on which part of the slot the mouse is in at that moment. This brings the custom scroller behaviour completely in line to that of the rest of the system.
There is still one change I'd like to make (making the page up/down intervals larger), but that will have to be done in the NSScrollView subclass.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:14 AM
Move NSControl overrides to top of file (REnamer, 1f43be9)
This was originally to be part of c4bdee5; I wanted the scroller itself to monitor for frame changes, and so I want the overrides to be up the top of the file (I would be overriding either initWithFrame: or awakeFromNib).
It turned out that the cleaner way to do this was to register from within the scroll view (it knows whenever you give it a new document view).
All the same, keeping this change as the reordering was not necessarily a bad thing.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:51 AM
Avoid more glitches by monitoring for frame changes (REnamer, c4bdee5)
Have the scroll view advise the scrollers whenever its document view changes its frame or bounds. This is necessary to prevent glitches when, say, the user resizes the table columns (thus causing the scroll knobs to redraw).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:49 AM
Add trackKnob: and trackScrollButtons: implementations (REnamer, 3308124)
These are pixel-perfect implementations which eliminate all smearing artefacts that occurred when calling super. Unfortunately in order to guarantee this smear-free behaviour some overdrawing is required, but as the area of the scroller is so small this should not pose any performance problem.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:13 AM
January 16, 2008
Prepare for highlighting the knob in the WOHUDScroller class (REnamer, c1a4b63)
Add an instance variable to control the whether the knob is drawn highlighted or not in the WOHUDScroller class.
This is the first in a series of commits whose purpose is to work around an inconsistency in Cocoa, and while we're at it make the control behave a little more like the one in Interface Builder.
While rendering currently works great when the scroll arrows are apart, if the user wants them displayed next to each other then we get smearing glitches.
I've investigated the issue and determined that this is caused by the system calling drawRect: with an undersized rectangle. The problem doesn't occur when the arrows are apart.
I looked at various workarounds, including overriding private NSView methods and trying to force a redraw in a larger area but there was no obvious and straightforward solution.
So the only robust and future-proof solution seems to be to override mouseDown: completely and not call super. This commit is one step that lays the ground work for that change. More to follow.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:50 PM
Teach WOHUDScrollView how to scroll (REnamer, 46da7d1)
NSScrollView doesn't implement the scrollPageUp:, scrollPageDown:, scrollLineUp: and scrollLineDown: methods (not sure why; as such the embedded class generally has to do this). Seeing as our scroll view has all the information necessary to implement these methods, do so, thus keeping all the movement code to the scroll view itself.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:57 PM
January 15, 2008
Extract arrowsTogether method and other cleanup (REnamer, 4ed8742)
Things are slightly neater with the code that determines whether the scroll arrows are together or at opposite ends of the scroller is extracted out into a separate method.
By way of other cleanup, we also rename the knob variable to knobRect for consistency with the other variables in the rectForPart: method.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:21 PM
Fix button highlighting in vertical scrollbar (REnamer, 2722970)
Was passing the point in the scroller's coordinate system rather than in the window's, as is required by testPart:.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:15 PM
Remove redundant autotest require (Wincent Strings Utility, 4c1d9a0)
This was cruft left in from a temporary investigation. Harmless, but cruft nonetheless.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:07 PM
Teach autotest to re-run specs when executable changes (Wincent Strings Utility, 7cd221d)
Re-run all specs whenever any source file changes, the project file changes, or the built executable is produced.
This requires ZenTest 3.8.0, I believe.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:04 PM
Upgrade to RSpec 1.1.2 (wincent.com, 8e2cb5c)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:03 AM
Remove old code from WOHUDScroller (REnamer, 1bc1fc4)
The old drawing style was still present in the source files but was hidden from the compiler with preprocessor directives. Now that the alteranative implementation is up and running, remove the old one from the source to keep the files lean; if the old algorithm is ever needed in the future it can be consulted using Git.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:10 AM
Refactor arrow rendering (REnamer, 135bab7)
This is the possible refactoring mentioned in f3b70d5, which takes advantage of the fact that the code for drawing an up arrow in a flipped coordinate system is the same as that for drawing a down arrow in an unflipped one, and likewise in the case of the unflipped up arrow and flipped down arrow.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:06 AM
Teach WOHUDScroller to draw arrows in the scroller buttons (REnamer, f3b70d5)
There is still some scope for refactoring here; note that the up arrow in the flipped coordinate system is the same as the down arrow in the unflipped coordinate system, and the flipped down arrow is the same as the unflipped up arrow.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:55 AM
Eliminate smearing problems when dragging scroll knobs (REnamer, db0eecf)
I think I might have eliminated the smearing glitches described in 3e91d70 but using round() instead of floor(). Seems that these geometry calculations are a very sensitive beast indeed.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:57 AM
Draw rounded controls in HUD scroller class (REnamer, 3e91d70)
This replaces the original behaviour of the scroller (rectangular scroll knob, triangular buttons) with better-looking controls which match those seen in Interface Builder (rounded rectangle scroll knob, circular buttons).
In order to pull this off I've had to override the rectForPart: method. I originally investigated compensating for Cocoa's many, many quirks (for example, when the user has their preferences set to show the arrows separately there is an overlap of two pixels with the scroll knob, but if their preferences are set to show the arrows together then there is no overlap but there is a 4-pixel band of unused space at the other end of the scroll slot; buttons are non-square, the up/down and left/right pairs aren't necessarily the same size, and worse, their shape changes depending on the preferences; there are many, many other irregularities that I won't describe here).
In the end I decided that making adjustments for Cocoa's idiosyncrasies was too brittle and could break with any OS update, and so what I've done in the end is basically completely rewrite the rectForPart: method and do all of the geometry calculations from scratch, sans idiosyncrasies. Evidently the Interface Builer team also wrote their own from scratch, or at least it seems so, because their scrollers do not obey the user preference for displaying the arrows together.
There is still more to do: there is a minor visual smear when moving the vertical scrollbar (I think this may be due to a rounding issue), and at the moment I haven't yet added the arrows inside the circular buttons.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:44 AM
January 14, 2008
Grammar and whitespace fixed for WOHUDScroller (REnamer, 4a70d42)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:18 PM
Update TODO notes (REnamer, 2f4961d)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:17 PM
Teach WOHUDScroller about flipped coordinate systems (REnamer, 56c18f7)
Similiar to commit f19e388, here we teach WOHUDScroller to draw correctly depending on whether its coordinate system is flipped or not, in this case specifically with respect to the arrows.
Rather than eliminating repetition here, I think clarity is more important, so I've explicitly specified the path for each of the permutations of ascending/descending, horizontal/vertical, and flipped/unflipped.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:15 PM
Silence GCC warning about signed/unsigned comparison (REnamer, a5f6563)
The cast here is safe because the int should always be non-negative (confirm that with an assertion) and never large enough to overflow size_t.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:59 PM
Teach WOHUDTableHeaderCell about flipped coordinate systems (REnamer, f19e388)
Draw the sort indicator differently for flipped coordinate systems. Note that this commit is really only about technical correctness and forwards compatability seeing as the coordinate system is not actually flipped by default.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:57 PM
Do Universal PCRE builds in Release builds only (REnamer, b580c6d)
In Debug builds just build for the native architecture (i386).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:39 PM
Property overhaul for WORegularExpressions class (REnamer, ad1d5bb)
Replace hand-coded accessors with Objective-C 2.0 properties and synthesized accessors, remove unused accessors, cache normalized forms when the corresponding properties are set, replace usage of NSLog with WOLogManager.
This should probably be a series of commits but I the changes were made simultaneously seeing as they required pretty much each file to be swept over in its entirety.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:17 PM
Add WORegularExpressionMatch class (REnamer, 4d6aeb0)
This is a wrapper class that I initially intended as a mere optimization (avoid unnecessary object instantiations by using scalar instance variables rather than wrapping scalars in NSNumber instances and storing them in an NSDictionary), but it actually has a very nice usability and readability impact as well, as evidenced by the resulting clean-up visible in the unit tests.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:42 AM
January 13, 2008
More consistent normalization of Unicode forms (REnamer, a1ecf6e)
This commit includes tests to probe the Unicode normalization issues and fixes to get them all passing. I believe that normalization is now applied everywhere it needs to be.
The key change is that WOCreateMatchDictionary has been changed to work using byte ranges rather than character ranges. A nice side effect is that the WOCharacterCountForUTF8String function can be entirely removed.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:02 PM
Restore Edit menu to Synergy Preferences application (Synergy, ffaa428)
I was overly enthusiastic in removing this; it turns out that without it the keyboard shortcuts for Copy and Paste don't work, and that makes entering registration information unnecessarily painful.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:17 PM
Fix in-app regular expression failures (REnamer, 33a0178)
While the unit tests were working perfectly, the in-app functionality was broken for UTF-8 input. The unit tests worked because they were using precomposed UTF-8 for both subject and pattern, while the in-app use of the same functions was failing because the pattern supplied by the user was precomposed UTF-8 but the file name supplied by the system was decomposed UTF-8.
We work around this by using fileSystemRepresentation rather than UTF-8 string, thus normalizing inputs before performing the regular expression match.
This should be fine because we are operating on filesystem objects -- we know the original name will always be decomposed UTF-8 -- so there is no harm in always returning decomposed UTF-8 as well; in other words, this normalization will not lead to spurious rename operations (same file name merely composed differently).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:07 PM
Remove unnecessary use of objc_msgSend() (REnamer, 872e3a8)
There is really no need for this here as a normal message send can be used without provoking any GCC warnings.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:40 PM
Fix UTF-8 regular expression matching (REnamer, e1df3cb)
Add tests to explore known issues with matching UTF-8 text. Add an errorCode property so that callers can distinguish between non-fatal (eg. no match) and fatal (eg. bad UTF-8) errors in pcre_exec().
The actual cause of the problem was that I was passing in the string length in characters rather than bytes.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:14 PM
Disallow keyboard-based selection in preview table view (REnamer, f1ca6cc)
I'm not sure whether I'll keep this change but this at least shows how selection can easily be suppressed from within the delegate.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:24 AM
Implement button highlight in custom scroller (REnamer, 0bfde98)
Currently only works for the horizontal scroller; hopefully will find a way of making it work for the vertical scroller as well.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:56 AM
Custom NSScroller subclass (REnamer, 3fa4cd7)
Now we draw scrollers that are suitable for display in a HUD window. This really is only a preliminary draft: the colors and geometry will almost certainly be tweaked in the future.
This commit also includes an empty clip view subclass. This isn't hooked up because I can't seem to swap it in without breaking drawing entirely. But the eventual intention is to override NSClipView because I suspect it is responsible for drawing the unwanted "end cap" above the vertical scrollbar.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:17 AM
Use WOHUDScrollView class in main nib (REnamer, 755e2c3)
Start using the just-created WOHUDScrollView class in the main menu nib.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:13 AM
Add WOHUDScrollView class (REnamer, fecdc0c)
At this stage it does little more than swap in instances of WOHUDScroller for any configured scrollers.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:12 AM
Add WOHUDScroller class (REnamer, c6ffacd)
At this stage this is just an empty subclass which will be populated later. This is preliminary to the next step, the creation of a WOHUDScrollView class.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:00 AM
January 12, 2008
Tweak nib geometry to silence nib compilation warnings (REnamer, 090e5d1)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:54 PM
Move REnamer-specific behaviour down into subclass (REnamer, 593e1a6)
As mentioned in 97148f1, there was a bit of highly-specific behaviour implemented in my WOHUDTableView subclass. I've now extracted this into a subclass of its own so that the parent class is more or less limited to clean, general functionality that would be usable in any application that wants to put a table view in a HUD.
Application-specific behaviour that is now in the subclass includes the row-resizing behaviour (this requires the table view to be the NSWindow delegate, so it's not very generalizable) and the ability to drag the window by clicking in the table (this is not very generalizable because it makes row selection impossible and is thus suited to read-only/display-only tables).
These limitations work well for REnamer, so I've run with them; I am sure that there are other ways but they would be more complex so best to leave them unexplored until they are actually needed.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:46 PM
Snap window size to table view row height (REnamer, 97148f1)
When resizing, force window size to always coincide with the height of the rows in the table.
I've added the custom code for this into the WOHUDTableView class; if I ever want to extract that and make it a reusable class then this kind of custom code will need to be moved down into another subclass.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:36 PM
Refactoring drawing of row backgrounds (REnamer, e55ba3c)
This is the refactoring promised in 6fcc806 to eliminate repetition.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:32 PM
Draw alternating row backgrounds all the way to the bottom (REnamer, 6fcc806)
No need to do any further subclassing, can just overdraw until we hit the edge of the clip rectangle.
This is the initial implementation which clearly shows what's being done (draw existing rows, then overdraw past bottom of clip rectangle). I'm about to commit a refactored implementation that eliminates the repetition by combining the two phases.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:24 PM
Draw custom sort indicators in HUD table view (REnamer, cbd1796)
The default sort indicators are practically invisible with the HUD colors, so draw some custom ones instead.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:09 PM
Dim text in location column (REnamer, 02d4ca8)
Use a more subdued color in the location column seeing as this is really just supplemental information and we don't want to distract the user.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:50 PM
Use smaller font in preview window cells (REnamer, 4f40d3d)
By default the data cell font used in table views is quite a bit larger than that used in the header cells. While this might look fine in normal windows it looks bad in HUD panels, which also have a smaller font used in the title bar.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:42 PM
More color tweaks for the HUD (REnamer, 6fddabd)
Drop the customizable location color; there really are only a few colors that look good on HUDs so there is no sense in offering a preference for it.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:22 PM
Turn preview window resizing back on (REnamer, 413a463)
This was accidentally turned off in a prior commit.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:18 PM
Make window draggable by background (REnamer, e1f154b)
Seeing as the "background" of the window is actually the NSTableView subclass that fills the entire window, implementing this means overriding the mouseDown method in the subclass and running an event loop to allow the user to drag the window around.
In doing so I'm suppressing selection of table rows, which is not a bad thing seeing as they are not editable or reorderable anyway; I also conveniently sidestep the need to worry about overriding the default selection highlighting behaviour, which isn't appropriate for a HUD panel anyway.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:56 PM
Color tweaks for preview HUD (REnamer, eb57d8c)
Mostly just making everything darker.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:57 PM
Set default cell text color to white (REnamer, d347fdf)
White (or light grey) text is needed in HUD stlye windows, so change the text color to white in the table cells.
Even so, a NSTextField/NSTextFieldCell subclass will still be required, I believe, in order to suppress the unwanted blue selection highlighting.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:41 PM
Extract sort descriptor methods into NSTableColumn category (REnamer, a0bd9ee)
As mentioned in 9729ba7, clean things up by extracting the sort descriptor functionality into a separate category.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:36 PM
Refactoring for table header cell drawing (REnamer, 9729ba7)
This is just a pure refactoring with no behavioural changes for better readability and maintainability. In theory this could be refactored even further by splitting some of the functionality into a table column subclass, or perhaps into an NSTableColumn category.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:23 PM
Fix table sorting and column selection (REnamer, 6c7f8c7)
These are really two related changes to the nib file: firstly, removing the table view's content binding (this is redundant because each column has its value binding set up with the array controller); and secondly, specify column identifiers so that autosaving of column geometry can be turned on.
I originally had a third change here as well, enabling column selection, but that proved to be unnecessary in order to get sorting working.
Note that a few issues still remain: the sort indicators appear but do not change direction when sort direction is changed, and the highlighting behaviour is incorrect.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:29 PM
Add stack trace notes to WOHUDTableHeaderCell class (REnamer, 68eb428)
These stack traces were produced by setting breakpoints in critical methods in an otherwise-empty subclass to try and figure out the standard code paths.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:53 PM
January 11, 2008
Highlight on mouse click (REnamer, 0efec76)
Draw in different colors when the mouse is clicked. This is still only a partial solution, as we also want to have the selected column (or strictly speaking, the primary sort column) indicate its status permanently.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:32 PM
Avoid overriding the private method in NSTableHeaderCell (REnamer, 9c7a69e)
Refactor to achieve same results without relying on the override of a private method in NSTableHeaderCell.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:34 PM
Draw sort indicator only in primary sort column (REnamer, c5044f4)
This matches the behaviour described in the 10.3 release notes.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:12 PM
Draw sort indicators in HUD table header cells (REnamer, 1b8cd05)
Not sure if this is the best approach but it is a starting point. There may be better sites to call the superclass implementation, or we may be better off doing the drawing directly without calling super.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:45 PM
Teach table header header cells to draw transparent backgrounds (REnamer, ddda4fb)
This unfortuantely requires overriding a private method, but it seems to be the only way.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:58 PM
Add WOHUDTableHeaderCell class (REnamer, 595ca86)
Merely calling setTextColor: on the table header cell is not enough; the value is apparently ignored, so must create a new subclass with to enforce white text in the header cells, and swap the cells in when the table is instantiated.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:12 PM
Draw alternating row backgrounds in HUD table view (REnamer, ee06d30)
This is a preliminary implementation that only has effect in the populated rows. A subsequent commit will handle drawing the background in unpopulated rows.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:47 PM
Draw dark table view background in HUD (REnamer, dfab7f0)
This is a first cut in which all rows are drawn with a dark background. A subsequent cut will use alternating row backgrounds when appropriate.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:41 PM
Add WOHUDTableView class (REnamer, 86545a3)
At this stage just this is just a swap-in placeholder with no custom behaviour.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:32 PM
Add generated help files (REnamer, a32170d)
Add CSS and gfx files (static) as well as generated (dynamic) files produced during test run.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:57 PM
Fix swapped targets in help script (REnamer, 5a33ab4)
The original version of the help documentation generation script had the web and in-application targets back to front.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:59 PM
Correct relative path in front page template (REnamer, cede8a1)
This should have been part of 61819ca, but this one file was left out.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:50 PM
Fix typo in 5e08528 (Synergy, 4e616e0)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:33 PM
Don't rely on synthesized setter for mutable property (Synergy, 5e08528)
A synthesized setter on a mutable property, combined with the copy attribute, will send a copy message to any object passed in to it, thus converting it into an immutable object.
So in this case must provide a non-synthesized setter which correctly employs mutableCopy.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:16 PM
Mark failing spec as pending (Walrus, 1a4311d)
This is a spec that has long failed because of limitations in the boundary checking in the current algorithm. It's a non-critical limitation though so I've always let it slide.
But seeing as I'd like to roll out another release soon I'd like to have failure-free spec runs. Marking this one as pending.
In the long, long term this kind of issue will be solved by a total rewrite (either a Ragel lexer, or an ANTLR lexer/parser).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:49 PM
Better error handling when running under Xcode (Walrus, 4625397)
Prefix error messages with ":: error:" so that they will be highlighted in the build results window when walrus is run from within Xcode.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:35 PM
Update headers in help templates (REnamer, 61819ca)
Adjust relative paths in all the help templates (in REnamer the application code lives one level deeper in the hierarchy), update copyright ranges, and get rid of Subversion Id tags.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:15 PM
Prepare help script for extraction (REnamer, 9457239)
Generalize things in the help.sh script in preparatin for extraction into buildtools.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:00 PM
Add target for help documentaton regeneration (REnamer, 5dec45e)
Add help.sh script which is basically identical to the script used in Hextrapolate but with the three set-up variables changed. This is probably a good candidate for extaction into buildtools.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:52 PM
Add files from WOCommon needed by tool (REnamer, a2baec6)
The tool depends on some classes and categories from WOCommon.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:48 PM
Import help files from Hextrapolate (REnamer, 3b343f9)
The help files in REnamer predate Walrus, so move the old help files out of the way and import the Walrus-based help documents from Hextrapolate. These will serve as a basis for integrating Walrus into the help documentation generation for REnamer.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:42 PM
Sort files in Xcode listing (REnamer, e2ec52f)
Alphabetize.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:28 PM
Remove redundant autorelease calls (REnamer, 40bc948)
These no longer relevant under Garbage Collection.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:55 PM
Correct code comment in WOREnamerApplicationTestsController (REnamer, 78419ca)
Just reflect the updated source structure.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:25 AM
Update gitignores to ignore bak files (REnamer, 3eaf965)
These get produced during localizable string updates.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:22 AM
Replace assertions with checks in unit tests (REnamer, 1dd61f2)
We want these checks to be compiled in both Debug and Release builds in the unit tests, so use check macros rather than assertion ones (the latter get preprocessed away in Release builds).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:20 AM
Reorganization (REnamer, 0cff757)
Rename subdirectories (Application becomes app, Plug-in becomes plug-in, Tool becomes tool, and Tests becomes tests).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:06 AM
Fix silly #ifdef error in tool (REnamer, b6197fb)
Replace instances of #ifdef with #if.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:50 AM
Update NOTES and TODO files (REnamer, 8feb0b9)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:44 AM
Drop PCRE library tests from test suite (REnamer, ccce3a5)
The library gets tested at compile time, so there is no need to re-test it at runtime.
This change was motivated because the test apparatus is quite brittle, basically requiring that the pcretest tool be re-implemented from scratch to play with the WORegularExpression wrapper. There is risk of breakage every time a PCRE update is released, and the implementation did not capture a lot of nuances of the original tests anyway.
I will instead be adding more tests in "native" style (ie. hand-written tests rather than trying to leverage the PCRE ones).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:39 AM
Update application bundle identifier (REnamer, bec7018)
Drop the ".app" from the application bundle identifier. It is now the principal entity in the com.wincent.REnamer domain so it is redundant to specify its type.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:36 AM
Teach plug-in to find application executable (REnamer, 2f9bd1a)
This does the same thing for the plug-in that 9d7f325 did for the tool.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:35 AM
Teach tool to find main application executable (REnamer, 9d7f325)
Now that the application executable is no longer inside the plugin we have to use a different strategy.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:31 AM
January 10, 2008
Tell preview scroll view not to draw background (REnamer, a2c9e07)
This will be later used when making the tableview more HUD-friendly.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:17 PM
Use ISO-8859-1 (Latin 1) rather than Mac OS Roman encoding (REnamer, 73eaf15)
This seems to be closer to the actual encoding used in the test input files.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:10 PM
Test updates for PCRE 7.5 (REnamer, 6748f90)
Store test files in new directory and rather than trying to force them into UTF-8, instead allow for per-file encodings to be specified. Time will tell whether this level of granularity is enough because there could conceivably be mixed test files which contain both UTF-8 and ISO-8859-1 encodings.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:03 PM
Use anonymous category (REnamer, 52760f6)
This fixes the mysterious GCC issue mentioned in 7c20dd2. Evidently, the @synthesize directive only synthesizes accessors which have been declared in the exact same class or category interface. Anonymous categories are evidently an exception to this rule.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:00 PM
Update PCRE symlink (REnamer, 0fbcac9)
Point to the new version, 7.5.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:24 PM
Set up gitignore for PCRE 7.5 (REnamer, 869faff)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:24 PM
Add PCRE 7.5 archives (REnamer, 404d882)
For safe keeping, keep a copy of the original source archive in the repository.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:03 PM
Archive/unarchive colors used in NSUserDefaults (REnamer, 8865597)
Necessary because can only store NSData objects in NSUserDefaults, not NSColor instances.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:59 PM
Work around GCC property bug (REnamer, 7c20dd2)
GCC refuses to synthesize a write accessor for one of the properties, so lose the "declare readonly then redeclare as readwrite" pattern for that property only. It's not known why GCC should do this for one and only one of the properties.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:50 PM
Complete migration to Objective-C 2.0 properties in controller (REnamer, 69e0d1e)
Replace old instance variable accesses (via accessors) with new property syntax.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:34 PM
Migrate to Objective-C 2.0 properties in the controller (REnamer, 5197559)
This is the first phase of the migration: declaration and synthesis.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:25 PM
Fix typo in Doxygen comment (REnamer, c807063)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:24 PM
Header cleanup (REnamer, f222781)
Remove redundant import (covered by prefix header) and move class header import into implementation file.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:23 PM
Dump undeeded SetFrontProcess() call (REnamer, b1f9d41)
Now that this is not a background-only app we don't need this call any more.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:22 PM
Add notes on running multiple controller instances (REnamer, 8489ecc)
This would in theory allow us to have multiple windows and multiple renames in progress at the same time.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:10 PM
User defaults cleanup (REnamer, c210747)
Replace working but technically incorrect uses of NSUserDefaultsController with direct access to the NSUserDefaults. Also register the defaults at launch time, rather than just setting the initial values for the controller.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:06 PM
Add missing files from Rails 2.0.2 upgrade (wincent.com, ff52bbb)
These additional changes really should have been included in the Rails 2.0.2 upgrade commit.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:52 PM
Upgrade RSpec to 1.1.1 (wincent.com, 9adf928)
And update notes.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:50 PM
Upgrade to Rails 2.0.2 (wincent.com, 4bf1ec8)
And update app notes on upgrade procedure.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:44 PM
Upgrade to Haml 1.8.0 (wincent.com, 14c0c89)
And upgrade app notes to document the steps taken.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:05 AM
Fix initialization of mutable string in test rig (REnamer, 2b6cf06)
We should be starting with an empty string and populate it as we go. This fixes about 242 test failures.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:07 AM
Fix vertical tab detection (REnamer, 4c78079)
Correct wrong value for vertical tab.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:52 AM
Have fallback case for escapes (REnamer, 4c15966)
Although it's not mentioned in the pcretest manpage as far as I can tell, in addition to the list of supported escapes a fallback case is accepted (and expected to be implemented) that handles a backslash followed by any other character, as is common in most languages which incorporate some form of escapes.
Roll in support for this, thus fixing a bunch of different test failures.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:50 AM
Changes for PCRE_MATCH_LIMIT (REnamer, d297c67)
It appears that PCRE_MATCH_LIMIT and its companion, PCRE_MATCH_LIMIT_RECURSION, no longer appear in the test suite, so change the code comments accordingly to match.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:48 AM
Clean up in tests (REnamer, 93b2130)
Remove redundant if blocks.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:47 AM
January 9, 2008
Test updates (REnamer, f626ef3)
Modify tests to compile correctly on Leopard under Garbage Collection, add additional information to the expections raised in the event of a parsing error; I was able to use this information to fix a bug in the scanning of special UTF-8 hex escapes.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:55 PM
Create symlink to latest version of pcre.h header (REnamer, 3fdee73)
Located in the source root so that it can be found without changing the default header search path.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:54 PM
Remove UTF-8 BOM marker from test input files (REnamer, fe1dbad)
Shouldn't be necessary, and Xcode doesn't like it (tries to display it in the editor windows).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:54 PM
Update test inputs (REnamer, 779de20)
Use the latest test files from PCRE 7.4.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:52 PM
Ignore Xcode 3 index folder (WOTest, ff4cd1b)
Update the .gitignore file to include the index folder created by Xcode 3 in the source root.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:09 PM
Remove stale file reference (WOTest, 08076d2)
The project had a reference to the no-longer-used WOEnumerate.h header.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:08 PM
Update copyright years (WOTest, ecd1d65)
Extend to 2008.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:07 PM
Update headers (buildtools, e0fb6b4)
Update copyright years and trim some unnecessary whitespace.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:04 PM
Remove braindead diff invocations (buildtools, 88ead02)
Use the compare() helper function instead, and split it out into Common.sh so all scripts can use it if they want.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:01 PM
Make REnamer application appear in Dock (REnamer, 8744815)
This is part of a general style change. In the prototype, the principal object of interest was the contextual menu plugin and the application was a helper that was embedded inside the plugin bundle.
Now, the application is the star and the plugin lives inside the application bundle. This opens up some other possibilities for UI interaction, like responding to items dragged and dropped onto the Dock icon or the application in the Finder.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:51 PM
Use HUD style for preview panel (REnamer, 9aa3a3f)
This only affects the window bezel itself, not the content. I'll need to override the views responsible for drawing the table view to get them looking good in a HUD-style panel.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted