Mathieu Tozer's Dev Blog

Cocoa, the development of Words, and other software projects (including those dang assessment tasks).




Dictionary Management to Drag and Drop

0 comments

Fixed the SVN commit but just creating a new folder for Words.

Seems like this skeleton I'm building should work in the end.

Does every language have a pivot language?

What if the array controller just fetched ALL dictionary objects, and I set a filter on it which can then further be filtered by the user searching with a search field to narrow it down?? If that was even needed. They will easily be able to see by looking at the table view which language the dictionary being reperesented will translate to. I don't need to do EVERYTHING for them!
That's the way to go about it!
Just chuck a dictionary into core data, and fetch it as I need it by setting the predicate on the arraycontroller.

Here's the pseudo code that creates dictionary objects
// interface action which gathers the needed data and creates a new dictionary object.
- (IBAction)createNewDictionary:(id)sender{
//get the currently selected language.
//create a new dict protocol dictionary (because that's the tab view that is selected)
// create a new dict protocol dictionary in the moc
// set the name, server, database etc
// test the connection
//if connection is bad, report error to errorField
// set the target language to current Language + xxx (for use in fetching)
//close the window (and dictionary should be fetched by the arraycontroller to show in
// "available dictionaries"
[customDictPanel close];
}

Working on drag and drop using sample code from mmalc and other Apple documentation.


System Apocalypse

0 comments

Boy did I have some nasty stuff going on for the last few days!
Installed Leopard, archive and installed Tiger, trying to migrate user info over from backups etc.

It still feels like I'm not using my own computer yet, but I'm getting there.

On the bright side (of XCode being broken, and taking 3 reinstalls and kills to fix it) I have somehow freed up 10 GB or so of space on my main drive, which is great considering I was always pushing up against FULL. Turns out all those libraries were adding up to a whole lot of crud.

It's not quite dlll, but it's certainly Library hell!

And it does feel refreshing because it feels like a new computer.

On the Words dev side, I have had a meeting with Jim Breen and discussed dictionary formats.

I'm going to support the EDICT format next.

But first I must have the dictionary management system up and running.


Dictionary Management Design Notes

0 comments

The UI of the dictionary management system.

As documented in my specifications document,

In the preferences menu, only the dictionaries that are applicable to the languages the user has defined should be shown, this is to avoid long lists of languages for the user to search through if the system actually supports many languages.

Disadvantage is that yes, you won't be able to 'browse what's available' but MOST people won't be bothered with that anyway.

The view will be bound to a something which will tell it which languages are defined. (The language array?) Something will take the language names and use them as keys or fields in a predicate which will fetch the dictionaries that are applicable to that language combination from the 'bag of dictionaries' in the managedObjectContext.

On the left hand side of the preferences pane will be a view displaying all these fetched dictionaries. On the right hand side will be a view of the objects on the left hand side that currently have their relationship set to the language object in question. Ie, it is being used in finding definitions. If the language is in the right hand view, then it should be visible, but greyed in the left hand side.

View:
The two 'available dictionary' tableviews
Language Chooser in the preferences - > dictionaries pane
The create new dictionary

Controllers:
This is always the tricky part.
I'll use the language array controller to see which languages are available.
The controller should manage the creation of the new dictionaries.

Model
Dictionary Objects
Some related to languages, some not.
A generic dictionary entity which more specific dictionary types can be children of.

I would also be nice to have the preferences in a separate nib file.

I need to decide which dictionaries I am going to support, and how. Actually, I should engineer it so that I don't have to make that decision at all. The software should be extensible.

So let's start by looking at managing whatever the dictionaries might become. Build the framework for the dictionaries and fill in the details later.

I have to think about what all dictionaries have in common.

Perhaps I should just directly bind the combo box to the languageArrayController, after all, it is likely that a user has been editing in a language and has decided to check or change the dictionary preferences. And there is no harm done in switching languages in the main view when changing preferences, in fact this could be a feature of the application. Kind of like a big context switch from language to language.


What To Do Next

0 comments

What should I do next?
I'm at a bit of a loss at which feature to attack next.
Dictionary lookup? This is the crux of the app, learning the meaning of words. So having the meaning there should be paramount!

There are core features, essential to the application, then there are the auxillary nicieties that yes, must be there, but are easier to implement when you have the product features there to prop them up.

For example, I couldn't hope to implement drag and drop before I had implemented the grouping system.
And before I have a dictionary management system, there isn't really any point in making a lovely preference pane or tool bar to hold the pretty icons.

So I could probably work on the dictionary lookup system.

Thinking about the problem.
Dictionaries are managed by core data. Their attributes and association to a language are set up so.
However, how am I going to make it possible to give suggested dictionaries to users, as well as allowing them to define their own custom dictionaries?
And I'm going to want to be able to see them in the same view.

Starting at the elemetary level of a dictionary object, I'm going to go right ahead and design the attributes I think each dictionary will need.

It's Name : JEDict
The Language it can translate to : ENG-JAP
The language it can translate from : ENG-JAP
It's own icon

Is there an industry standard for codifying this up?
I should discuss this with Jim this Friday if possible


+RSS | dev blog | Portfolio

About me

My status

Last posts

  • my del.icio.us
  • my flickr