You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
(58) |
May
(28) |
Jun
(308) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(3) |
Nov
(4) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(4) |
Feb
(8) |
Mar
(3) |
Apr
(3) |
May
(8) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2009 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ik...@us...> - 2007-06-24 10:54:56
|
Revision: 1538 http://tomoe.svn.sourceforge.net/tomoe/?rev=1538&view=rev Author: ikezoe Date: 2007-06-24 03:54:58 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * src/main.py, src/importutf.py, src/importlist.py: Remove semicolon. Modified Paths: -------------- stroke-editor/trunk/ChangeLog stroke-editor/trunk/src/importlist.py stroke-editor/trunk/src/importutf.py stroke-editor/trunk/src/main.py Modified: stroke-editor/trunk/ChangeLog =================================================================== --- stroke-editor/trunk/ChangeLog 2007-06-24 06:56:38 UTC (rev 1537) +++ stroke-editor/trunk/ChangeLog 2007-06-24 10:54:58 UTC (rev 1538) @@ -2,6 +2,7 @@ * src/main.py: Use get_action method of GtkAction instead GtkUIManager. + * src/main.py, src/importutf.py, src/importlist.py: Remove semicolon. 2007-06-20 Hiroyuki Ikezoe <poi...@ik...> Modified: stroke-editor/trunk/src/importlist.py =================================================================== --- stroke-editor/trunk/src/importlist.py 2007-06-24 06:56:38 UTC (rev 1537) +++ stroke-editor/trunk/src/importlist.py 2007-06-24 10:54:58 UTC (rev 1538) @@ -44,7 +44,7 @@ dialog.add_filter(allfilter) dialog.set_default_response (gtk.RESPONSE_OK) dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) - dialog.set_current_folder(os.getenv("PWD") + "/data"); + dialog.set_current_folder(os.getenv("PWD") + "/data") retval = dialog.run () if retval == gtk.RESPONSE_OK: self.import_listfile(dialog.get_filename()) Modified: stroke-editor/trunk/src/importutf.py =================================================================== --- stroke-editor/trunk/src/importutf.py 2007-06-24 06:56:38 UTC (rev 1537) +++ stroke-editor/trunk/src/importutf.py 2007-06-24 10:54:58 UTC (rev 1538) @@ -40,7 +40,7 @@ dialog.add_filter(allfilter) dialog.set_default_response (gtk.RESPONSE_OK) dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) - dialog.set_current_folder(os.getenv("PWD") + "/data"); + dialog.set_current_folder(os.getenv("PWD") + "/data") retval = dialog.run () if retval == gtk.RESPONSE_OK: self.import_utffile(dialog.get_filename()) Modified: stroke-editor/trunk/src/main.py =================================================================== --- stroke-editor/trunk/src/main.py 2007-06-24 06:56:38 UTC (rev 1537) +++ stroke-editor/trunk/src/main.py 2007-06-24 10:54:58 UTC (rev 1538) @@ -382,7 +382,7 @@ dialog.add_filter(allfilter) dialog.set_default_response (gtk.RESPONSE_OK) dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) - dialog.set_current_folder(os.getenv("PWD") + "/data"); + dialog.set_current_folder(os.getenv("PWD") + "/data") retval = dialog.run () if retval == gtk.RESPONSE_OK: self.open_xmlfile(dialog.get_filename()) @@ -438,7 +438,7 @@ dialog.set_do_overwrite_confirmation(True) dialog.set_default_response (gtk.RESPONSE_OK) dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) - dialog.set_current_folder(os.getenv("PWD") + "/data"); + dialog.set_current_folder(os.getenv("PWD") + "/data") retval = dialog.run () if retval == gtk.RESPONSE_OK: new_dict = tomoe.Dict("XML", filename = dialog.get_filename(), editable = True) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-24 06:56:37
|
Revision: 1537 http://tomoe.svn.sourceforge.net/tomoe/?rev=1537&view=rev Author: ikezoe Date: 2007-06-23 23:56:38 -0700 (Sat, 23 Jun 2007) Log Message: ----------- removed import saveXML. Modified Paths: -------------- stroke-editor/trunk/src/main.py Modified: stroke-editor/trunk/src/main.py =================================================================== --- stroke-editor/trunk/src/main.py 2007-06-24 06:54:40 UTC (rev 1536) +++ stroke-editor/trunk/src/main.py 2007-06-24 06:56:38 UTC (rev 1537) @@ -5,7 +5,6 @@ import os import tomoe from workview import WorkView -from savexml import SaveXML from configfile import ConfigFile from importutf import ImportUtf from importlist import ImportList This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-24 06:54:42
|
Revision: 1536 http://tomoe.svn.sourceforge.net/tomoe/?rev=1536&view=rev Author: ikezoe Date: 2007-06-23 23:54:40 -0700 (Sat, 23 Jun 2007) Log Message: ----------- * src/main.py: Use get_action method of GtkAction instead GtkUIManager. Modified Paths: -------------- stroke-editor/trunk/ChangeLog stroke-editor/trunk/src/main.py Modified: stroke-editor/trunk/ChangeLog =================================================================== --- stroke-editor/trunk/ChangeLog 2007-06-20 12:00:25 UTC (rev 1535) +++ stroke-editor/trunk/ChangeLog 2007-06-24 06:54:40 UTC (rev 1536) @@ -1,3 +1,8 @@ +2007-06-24 Hiroyuki Ikezoe <poi...@ik...> + + * src/main.py: Use get_action method of GtkAction instead + GtkUIManager. + 2007-06-20 Hiroyuki Ikezoe <poi...@ik...> * src/savexml.py: Removed. Modified: stroke-editor/trunk/src/main.py =================================================================== --- stroke-editor/trunk/src/main.py 2007-06-20 12:00:25 UTC (rev 1535) +++ stroke-editor/trunk/src/main.py 2007-06-24 06:54:40 UTC (rev 1536) @@ -148,7 +148,7 @@ hbox.pack_start(self.workview, True, True) self.statusbar = gtk.Statusbar() vbox.pack_start(self.statusbar, False) - self._manager.get_action("/MenuBar/EditMenu/StrokeMenu").set_sensitive(False) + self.actions.get_action("StrokeMenu").set_sensitive(False) self.update_statusbar() @@ -162,8 +162,8 @@ self.actions.get_action("SaveAs").set_sensitive(False) def create_charlist(self): - self._manager.get_action("/Toolbar/DeleteKey").set_sensitive(False) - self._manager.get_action("/Toolbar/EditKey").set_sensitive(False) + self.actions.get_action("DeleteKey").set_sensitive(False) + self.actions.get_action("EditKey").set_sensitive(False) self.char_liststore = gtk.ListStore(gobject.TYPE_STRING, object, gobject.TYPE_BOOLEAN) self.char_treeview = gtk.TreeView(self.char_liststore) charcolumn = gtk.TreeViewColumn("Key") @@ -188,8 +188,8 @@ def on_char_treeview_selected(self, treeselection): (model, iter) = treeselection.get_selected() - self._manager.get_action("/Toolbar/DeleteKey").set_sensitive(bool(iter)) - self._manager.get_action("/Toolbar/EditKey").set_sensitive(bool(iter)) + self.actions.get_action("DeleteKey").set_sensitive(bool(iter)) + self.actions.get_action("EditKey").set_sensitive(bool(iter)) if iter: if self.enable_network: if self._current_chars: @@ -239,7 +239,7 @@ if selection: list, rows = selection.get_selected_rows () sel = (len(rows) >= 1) - self._manager.get_action("/MenuBar/EditMenu/StrokeMenu").set_sensitive(sel) + self.actions.get_action("StrokeMenu").set_sensitive(sel) def do_connect(self, widget): dlg = gtk.Dialog ("Select Unit", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-20 12:00:23
|
Revision: 1535 http://tomoe.svn.sourceforge.net/tomoe/?rev=1535&view=rev Author: ikezoe Date: 2007-06-20 05:00:25 -0700 (Wed, 20 Jun 2007) Log Message: ----------- * src/savexml.py: Removed. * src/main.py: Use TOMOE's python binding for saving XML file. Add "SaveAs". * src/importutf.py, src/importlist.py: Create new TomoeDict. But it's workaround. Fix it! Modified Paths: -------------- stroke-editor/trunk/ChangeLog stroke-editor/trunk/src/importlist.py stroke-editor/trunk/src/importutf.py stroke-editor/trunk/src/main.py Removed Paths: ------------- stroke-editor/trunk/src/savexml.py Modified: stroke-editor/trunk/ChangeLog =================================================================== --- stroke-editor/trunk/ChangeLog 2007-06-20 11:53:14 UTC (rev 1534) +++ stroke-editor/trunk/ChangeLog 2007-06-20 12:00:25 UTC (rev 1535) @@ -1,3 +1,11 @@ +2007-06-20 Hiroyuki Ikezoe <poi...@ik...> + + * src/savexml.py: Removed. + * src/main.py: Use TOMOE's python binding for saving XML file. Add + "SaveAs". + * src/importutf.py, src/importlist.py: Create new TomoeDict. But it's + workaround. Fix it! + 2007-06-19 Hiroyuki Ikezoe <poi...@ik...> * src/main.py: Use TOMOE's python binding. * src/openxml.py: Removed. Modified: stroke-editor/trunk/src/importlist.py =================================================================== --- stroke-editor/trunk/src/importlist.py 2007-06-20 11:53:14 UTC (rev 1534) +++ stroke-editor/trunk/src/importlist.py 2007-06-20 12:00:25 UTC (rev 1535) @@ -3,6 +3,7 @@ import gobject import gtk import os +import tomoe class ImportList: def __init__(self, mainwin): @@ -11,6 +12,7 @@ def import_listfile(self, filename): self.mainwin.enable_network = False self.mainwin.char_liststore = gtk.ListStore(gobject.TYPE_STRING, object, gobject.TYPE_BOOLEAN) + self.mainwin.dict = tomoe.Dict("XML", editable = True) lines = file(filename).readlines() for line in lines: utf8str = "" @@ -20,7 +22,12 @@ utf8str += ch; if utf8str != "": self.mainwin.char_liststore.append([utf8str, [], False]) + tomoe_char = tomoe.Char(utf8 = utf8str) + self.mainwin.dict.register_char(tomoe_char) + self.mainwin.actions.get_action("Save").set_sensitive(False) + self.mainwin.actions.get_action("SaveAs").set_sensitive(True) + def do_import(self): dialog = gtk.FileChooserDialog ("Select list file", self.mainwin, Modified: stroke-editor/trunk/src/importutf.py =================================================================== --- stroke-editor/trunk/src/importutf.py 2007-06-20 11:53:14 UTC (rev 1534) +++ stroke-editor/trunk/src/importutf.py 2007-06-20 12:00:25 UTC (rev 1535) @@ -3,6 +3,7 @@ import gobject import gtk import os +import tomoe class ImportUtf: def __init__(self, mainwin): @@ -12,11 +13,17 @@ self.mainwin.enable_network = False self.mainwin.char_liststore = gtk.ListStore(gobject.TYPE_STRING, object, gobject.TYPE_BOOLEAN) content = unicode(file(filename).read(), "UTF-8") + self.mainwin.dict = tomoe.Dict("XML", editable = True) for uc in content: if uc != u'\n': utf8char = uc.encode("UTF-8") self.mainwin.char_liststore.append([utf8char, [], False]) + tomoe_char = tomoe.Char(utf8 = utf8char) + self.mainwin.dict.register_char(tomoe_char) + self.mainwin.actions.get_action("Save").set_sensitive(False) + self.mainwin.actions.get_action("SaveAs").set_sensitive(True) + def do_import(self): dialog = gtk.FileChooserDialog ("Select utf file", self.mainwin, Modified: stroke-editor/trunk/src/main.py =================================================================== --- stroke-editor/trunk/src/main.py 2007-06-20 11:53:14 UTC (rev 1534) +++ stroke-editor/trunk/src/main.py 2007-06-20 12:00:25 UTC (rev 1535) @@ -19,6 +19,7 @@ <menu action="FileMenu"> <menuitem action="Open"/> <menuitem action="Save"/> + <menuitem action="SaveAs"/> <menuitem action="ImportUtf"/> <menuitem action="ImportList"/> <menuitem action="ImportToServer"/> @@ -52,6 +53,7 @@ <toolbar name="Toolbar"> <toolitem action="Open"/> <toolitem action="Save"/> + <toolitem action="SaveAs"/> <toolitem action="Connect"/> <separator/> <toolitem action="Add"/> @@ -89,6 +91,8 @@ "Import To Server", None, None, self.do_import_to_server), ( "Save", gtk.STOCK_SAVE, None, None, None, self.do_save), + ( "SaveAs", gtk.STOCK_SAVE_AS, + None, None, None, self.do_save_as), ( "Connect", gtk.STOCK_CONNECT, None, None, None, self.do_connect), ( "Cut", gtk.STOCK_CUT, @@ -121,11 +125,11 @@ None, None, None, self.do_about), ) - actions = gtk.ActionGroup ("Actions") - actions.add_actions (self._entries) + self.actions = gtk.ActionGroup ("Actions") + self.actions.add_actions (self._entries) self._manager = gtk.UIManager () - self._manager.insert_action_group (actions, 1) + self._manager.insert_action_group (self.actions, 1) self.add_accel_group (self._manager.get_accel_group ()) self._manager.add_ui_from_string (_WINDOW_UI) @@ -153,6 +157,10 @@ self._unit = int(self.config.get("server", "unit", "0")) self._url = self.config.get("server", "url", "http://10.66.0.143:1980") + self.dict = None + self.actions.get_action("Save").set_sensitive(False) + self.actions.get_action("SaveAs").set_sensitive(False) + def create_charlist(self): self._manager.get_action("/Toolbar/DeleteKey").set_sensitive(False) self._manager.get_action("/Toolbar/EditKey").set_sensitive(False) @@ -196,13 +204,33 @@ self.workview.set_chars(unicode(model.get_value(iter, 0), "UTF-8"), model.get_value(iter, 1)) + def create_tomoe_writing_from_strokes(self, strokes): + writing = tomoe.Writing() + for stroke in strokes: + for i, point in enumerate(stroke): + if i == 0: + writing.move_to(int(point[0]), int(point[1])) + else: + writing.line_to(int(point[0]), int(point[1])) + return writing + def on_workview_strokes_changed(self, workview): treeselection = self.char_treeview.get_selection() (model, iter) = treeselection.get_selected() if iter: strokes = workview.get_strokes() model.set_value(iter, 1, strokes) + + # Update TomoeChar in TomoeDict + char_utf8 = model.get_value(iter, 0) + tomoe_char = self.dict.get_char(char_utf8) + writing = self.create_tomoe_writing_from_strokes(strokes) + tomoe_char.set_writing(writing) + self.dict.register_char(tomoe_char) b = bool(strokes) + + self.actions.get_action("Save").set_sensitive(True) + if model.get_value (iter, 2) != b: model.set_value(iter, 2, bool(strokes)) self.update_statusbar () @@ -329,8 +357,14 @@ self.dict = tomoe.Dict("XML", filename = filename, editable = True) query = tomoe.Query() for char in map(lambda cand: cand.get_char() , self.dict.search(query)): - self.char_liststore.append([char.get_utf8(), char.get_writing().get_strokes(), - bool(char.get_writing().get_n_strokes())]) + strokes = [] + n_strokes = 0 + writing = char.get_writing() + if writing: + strokes = writing.get_strokes() + n_strokes = writing.get_n_strokes() + self.char_liststore.append([char.get_utf8(), strokes, + bool(n_strokes)]) def do_open(self, widget): self.char_treeview.set_model(None) @@ -356,6 +390,8 @@ dialog.destroy () self.char_treeview.set_model(self.char_liststore) self.update_statusbar() + self.actions.get_action("Save").set_sensitive(False) + self.actions.get_action("SaveAs").set_sensitive(True) def do_copy (self, widget): self.workview.copy_selected_strokes () @@ -374,15 +410,45 @@ self.workview.select_all () def do_save (self, widget): + if (not self.dict): + return + if self.enable_network: for i in self.char_liststore: if i[2] and (bool(i[1]) == False): chars = unicode (i[0], "UTF-8") strokes = self.client.get_strokes (chars) i[1] = strokes - savexml = SaveXML(self.char_liststore) - savexml.do_save() + self.dict.flush() + def do_save_as (self, widget): + if (not self.dict): + return + + if self.enable_network: + for i in self.char_liststore: + if i[2] and (bool(i[1]) == False): + chars = unicode (i[0], "UTF-8") + strokes = self.client.get_strokes (chars) + i[1] = strokes + dialog = gtk.FileChooserDialog ("Save to tomoe XML file", + None, + gtk.FILE_CHOOSER_ACTION_SAVE, + (gtk.STOCK_SAVE, gtk.RESPONSE_OK, + gtk.STOCK_CANCEL, gtk.RESPONSE_CLOSE)) + dialog.set_do_overwrite_confirmation(True) + dialog.set_default_response (gtk.RESPONSE_OK) + dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) + dialog.set_current_folder(os.getenv("PWD") + "/data"); + retval = dialog.run () + if retval == gtk.RESPONSE_OK: + new_dict = tomoe.Dict("XML", filename = dialog.get_filename(), editable = True) + self.dict.copy(new_dict) + new_dict.flush() + self.dict = new_dict + dialog.destroy () + self.actions.get_action("Save").set_sensitive(False) + def do_about(self, widget): about = gtk.AboutDialog() about.set_name("Stroke Editor") Deleted: stroke-editor/trunk/src/savexml.py =================================================================== --- stroke-editor/trunk/src/savexml.py 2007-06-20 11:53:14 UTC (rev 1534) +++ stroke-editor/trunk/src/savexml.py 2007-06-20 12:00:25 UTC (rev 1535) @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- - -import gtk -import os - -class SaveXML: - def __init__(self, char_liststore): - self.liststore = char_liststore - - def write_strokes(self, model, path, iter, xmlfile): - utf8str = model.get_value(iter, 0) - strokes = model.get_value(iter, 1) - xmlfile.write(" <character>\n <utf8>") - unichars = unicode(utf8str, "UTF-8") - for unichar in unichars: - xmlfile.write("&#x%X;"%(ord(unichar))) - xmlfile.write("</utf8>\n <strokes>\n") - for stroke in strokes: - xmlfile.write(" <stroke>\n") - for points in stroke: - xmlfile.write(" <point x=\"") - xmlfile.write(str(int(points[0]))) - xmlfile.write("\" y=\"") - xmlfile.write(str(int(points[1]))) - xmlfile.write("\"/>\n") - xmlfile.write(" </stroke>\n") - xmlfile.write(" </strokes>\n </character>\n") - - def save_xmlfile(self, filename): - xmlfile = file(filename, 'w') - xmlfile.write("<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE dictionary SYSTEM \"dict.dtd\">\n<dictionary name=\"Tomoe Handwriting Dictionary\">\n") - self.liststore.foreach(self.write_strokes, xmlfile) - xmlfile.write("</dictionary>\n") - xmlfile.close() - - def do_save(self): - dialog = gtk.FileChooserDialog ("Save to tomoe XML file", - None, - gtk.FILE_CHOOSER_ACTION_SAVE, - (gtk.STOCK_SAVE, gtk.RESPONSE_OK, - gtk.STOCK_CANCEL, gtk.RESPONSE_CLOSE)) - dialog.set_do_overwrite_confirmation(True) - dialog.set_default_response (gtk.RESPONSE_OK) - dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) - dialog.set_current_folder(os.getenv("PWD") + "/data"); - retval = dialog.run () - if retval == gtk.RESPONSE_OK: - self.save_xmlfile(dialog.get_filename()) - dialog.destroy () - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-20 11:53:16
|
Revision: 1534 http://tomoe.svn.sourceforge.net/tomoe/?rev=1534&view=rev Author: ikezoe Date: 2007-06-20 04:53:14 -0700 (Wed, 20 Jun 2007) Log Message: ----------- * lib/tomoe-dict.c: Do not check availability of source dictionary. Modified Paths: -------------- tomoe/trunk/ChangeLog tomoe/trunk/lib/tomoe-dict.c Modified: tomoe/trunk/ChangeLog =================================================================== --- tomoe/trunk/ChangeLog 2007-06-20 11:26:27 UTC (rev 1533) +++ tomoe/trunk/ChangeLog 2007-06-20 11:53:14 UTC (rev 1534) @@ -6,6 +6,7 @@ * lib/tomoe-dict-ptr-array.c: Remove needless virtual functions. * lib/tomoe-dict-ptr-array.c: Set modified flag TRUE after copy(). * module/dict/tomoe-dict-xml.c: Save only if filename is not NULL. + * lib/tomoe-dict.c: Do not check availability of source dictionary. 2007-06-18 Hiroyuki Ikezoe <poi...@ik...> Modified: tomoe/trunk/lib/tomoe-dict.c =================================================================== --- tomoe/trunk/lib/tomoe-dict.c 2007-06-20 11:26:27 UTC (rev 1533) +++ tomoe/trunk/lib/tomoe-dict.c 2007-06-20 11:53:14 UTC (rev 1534) @@ -320,10 +320,6 @@ g_return_val_if_fail (TOMOE_IS_DICT (src_dict), FALSE); g_return_val_if_fail (TOMOE_IS_DICT (dest_dict), FALSE); - if (!tomoe_dict_is_available (src_dict)) { - g_warning ("source dictionary isn't available."); - return FALSE; - } if (!tomoe_dict_is_editable (dest_dict)) { g_warning ("destination dictionary isn't editable."); return FALSE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-20 11:26:27
|
Revision: 1533 http://tomoe.svn.sourceforge.net/tomoe/?rev=1533&view=rev Author: ikezoe Date: 2007-06-20 04:26:27 -0700 (Wed, 20 Jun 2007) Log Message: ----------- * module/dict/tomoe-dict-xml.c: Save only if filename is not NULL. Modified Paths: -------------- tomoe/trunk/ChangeLog tomoe/trunk/module/dict/tomoe-dict-xml.c Modified: tomoe/trunk/ChangeLog =================================================================== --- tomoe/trunk/ChangeLog 2007-06-20 11:04:05 UTC (rev 1532) +++ tomoe/trunk/ChangeLog 2007-06-20 11:26:27 UTC (rev 1533) @@ -5,6 +5,7 @@ * module/dict/tomoe-dict-xml.c: Follow the above change. * lib/tomoe-dict-ptr-array.c: Remove needless virtual functions. * lib/tomoe-dict-ptr-array.c: Set modified flag TRUE after copy(). + * module/dict/tomoe-dict-xml.c: Save only if filename is not NULL. 2007-06-18 Hiroyuki Ikezoe <poi...@ik...> Modified: tomoe/trunk/module/dict/tomoe-dict-xml.c =================================================================== --- tomoe/trunk/module/dict/tomoe-dict-xml.c 2007-06-20 11:04:05 UTC (rev 1532) +++ tomoe/trunk/module/dict/tomoe-dict-xml.c 2007-06-20 11:26:27 UTC (rev 1533) @@ -270,6 +270,9 @@ g_return_val_if_fail (TOMOE_IS_DICT_XML (dict), FALSE); + if (!dict->filename) + return FALSE; + return tomoe_dict_xml_save (dict); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-20 11:04:11
|
Revision: 1532 http://tomoe.svn.sourceforge.net/tomoe/?rev=1532&view=rev Author: ikezoe Date: 2007-06-20 04:04:05 -0700 (Wed, 20 Jun 2007) Log Message: ----------- * lib/tomoe-dict-ptr-array.c: Set modified flag TRUE after copy(). Modified Paths: -------------- tomoe/trunk/ChangeLog tomoe/trunk/lib/tomoe-dict-ptr-array.c Modified: tomoe/trunk/ChangeLog =================================================================== --- tomoe/trunk/ChangeLog 2007-06-20 10:48:33 UTC (rev 1531) +++ tomoe/trunk/ChangeLog 2007-06-20 11:04:05 UTC (rev 1532) @@ -4,6 +4,7 @@ modified property. * module/dict/tomoe-dict-xml.c: Follow the above change. * lib/tomoe-dict-ptr-array.c: Remove needless virtual functions. + * lib/tomoe-dict-ptr-array.c: Set modified flag TRUE after copy(). 2007-06-18 Hiroyuki Ikezoe <poi...@ik...> Modified: tomoe/trunk/lib/tomoe-dict-ptr-array.c =================================================================== --- tomoe/trunk/lib/tomoe-dict-ptr-array.c 2007-06-20 10:48:33 UTC (rev 1531) +++ tomoe/trunk/lib/tomoe-dict-ptr-array.c 2007-06-20 11:04:05 UTC (rev 1532) @@ -474,6 +474,8 @@ g_ptr_array_foreach_reverse (src_priv->chars, copy_all_chars, &dest_priv->chars); + dest_priv->modified = TRUE; + return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-20 10:48:46
|
Revision: 1531 http://tomoe.svn.sourceforge.net/tomoe/?rev=1531&view=rev Author: ikezoe Date: 2007-06-20 03:48:33 -0700 (Wed, 20 Jun 2007) Log Message: ----------- oops! I wrote changes is not commited yet. Modified Paths: -------------- stroke-editor/trunk/ChangeLog Modified: stroke-editor/trunk/ChangeLog =================================================================== --- stroke-editor/trunk/ChangeLog 2007-06-20 10:46:22 UTC (rev 1530) +++ stroke-editor/trunk/ChangeLog 2007-06-20 10:48:33 UTC (rev 1531) @@ -1,8 +1,3 @@ -2007-06-20 Hiroyuki Ikezoe <poi...@ik...> - - * src/savexml.py: Removed. - * src/main.py: Use TOMOE's python binding instead of SaveXML. - 2007-06-19 Hiroyuki Ikezoe <poi...@ik...> * src/main.py: Use TOMOE's python binding. * src/openxml.py: Removed. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-20 10:46:34
|
Revision: 1530 http://tomoe.svn.sourceforge.net/tomoe/?rev=1530&view=rev Author: ikezoe Date: 2007-06-20 03:46:22 -0700 (Wed, 20 Jun 2007) Log Message: ----------- change style. Modified Paths: -------------- stroke-editor/trunk/ChangeLog Modified: stroke-editor/trunk/ChangeLog =================================================================== --- stroke-editor/trunk/ChangeLog 2007-06-20 10:17:16 UTC (rev 1529) +++ stroke-editor/trunk/ChangeLog 2007-06-20 10:46:22 UTC (rev 1530) @@ -1,27 +1,32 @@ -2007.6.19 Hiroyuki Ikezoe <poi...@ik...> -- src/main.py: Use TOMOE's python binding. -- src/openxml.py: Removed. +2007-06-20 Hiroyuki Ikezoe <poi...@ik...> -2007.6.01 Hu Zheng <zh...@re...> -- handwriting-zh_CN-gb2312.xml is added after two months' work. -*version 1.3 released. + * src/savexml.py: Removed. + * src/main.py: Use TOMOE's python binding instead of SaveXML. -2007.5.08 Takuro Ashie <as...@ho...> -- Fix some Japanese handwriting entries which has multiple characters. -- Add Japanese .utf files. +2007-06-19 Hiroyuki Ikezoe <poi...@ik...> + * src/main.py: Use TOMOE's python binding. + * src/openxml.py: Removed. -2007.4.27 Hu Zheng <zh...@re...> -- Multiple characters support. -* Version 1.2 released. +2007-06-01 Hu Zheng <zh...@re...> + handwriting-zh_CN-gb2312.xml is added after two months' work. + version 1.3 released. -2007.4.19 Mathieu Blondel <mbl...@ru...> -- remove the "select all" stock and put a normal label instead -- put the options related to the strokes in a "stroke" submenu -- make the options sensitive only if they are available -* Version 1.1 released. +2007-05-08 Takuro Ashie <as...@ho...> + Fix some Japanese handwriting entries which has multiple characters. + Add Japanese .utf files. -2007.4.12 Hu Zheng <zh...@re...> -* Get the 1.0 version. Add into tomoe project. +2007-04-27 Hu Zheng <zh...@re...> + Multiple characters support. + Version 1.2 released. -2007.3.26 Hu Zheng <zh...@re...> -* Start the development. +2007-04-19 Mathieu Blondel <mbl...@ru...> + remove the "select all" stock and put a normal label instead + put the options related to the strokes in a "stroke" submenu + make the options sensitive only if they are available + Version 1.1 released. + +2007-04-12 Hu Zheng <zh...@re...> + Get the 1.0 version. Add into tomoe project. + +2007-03-26 Hu Zheng <zh...@re...> + Start the development. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-20 10:17:14
|
Revision: 1529 http://tomoe.svn.sourceforge.net/tomoe/?rev=1529&view=rev Author: ikezoe Date: 2007-06-20 03:17:16 -0700 (Wed, 20 Jun 2007) Log Message: ----------- matz. Modified Paths: -------------- tomoe/trunk/ChangeLog Modified: tomoe/trunk/ChangeLog =================================================================== --- tomoe/trunk/ChangeLog 2007-06-20 10:15:53 UTC (rev 1528) +++ tomoe/trunk/ChangeLog 2007-06-20 10:17:16 UTC (rev 1529) @@ -20,7 +20,7 @@ * macros/python.m4: - disabled Python bindings not error if pygobject-2.0 - package is not found. + package is not found. - removed needless spaces. - removed needless macros. - used $CPPFLAGS not $CFLAGS. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-20 10:15:55
|
Revision: 1528 http://tomoe.svn.sourceforge.net/tomoe/?rev=1528&view=rev Author: ikezoe Date: 2007-06-20 03:15:53 -0700 (Wed, 20 Jun 2007) Log Message: ----------- * lib/tomoe-dict-ptr-array.c: Remove needless virtual functions. Modified Paths: -------------- tomoe/trunk/ChangeLog tomoe/trunk/lib/tomoe-dict-ptr-array.c tomoe/trunk/lib/tomoe-dict-ptr-array.h Modified: tomoe/trunk/ChangeLog =================================================================== --- tomoe/trunk/ChangeLog 2007-06-20 10:14:09 UTC (rev 1527) +++ tomoe/trunk/ChangeLog 2007-06-20 10:15:53 UTC (rev 1528) @@ -3,6 +3,7 @@ * lib/tomoe-dict-ptr-array.c: TomoeDictPtrArray has editable and modified property. * module/dict/tomoe-dict-xml.c: Follow the above change. + * lib/tomoe-dict-ptr-array.c: Remove needless virtual functions. 2007-06-18 Hiroyuki Ikezoe <poi...@ik...> Modified: tomoe/trunk/lib/tomoe-dict-ptr-array.c =================================================================== --- tomoe/trunk/lib/tomoe-dict-ptr-array.c 2007-06-20 10:14:09 UTC (rev 1527) +++ tomoe/trunk/lib/tomoe-dict-ptr-array.c 2007-06-20 10:15:53 UTC (rev 1528) @@ -99,9 +99,6 @@ dict_class->is_available = NULL; dict_class->get_available_private_utf8 = get_available_private_utf8; - klass->register_char = register_char; - klass->unregister_char = unregister_char; - g_object_class_install_property( gobject_class, PROP_EDITABLE, Modified: tomoe/trunk/lib/tomoe-dict-ptr-array.h =================================================================== --- tomoe/trunk/lib/tomoe-dict-ptr-array.h 2007-06-20 10:14:09 UTC (rev 1527) +++ tomoe/trunk/lib/tomoe-dict-ptr-array.h 2007-06-20 10:15:53 UTC (rev 1528) @@ -47,11 +47,6 @@ struct _TomoeDictPtrArrayClass { TomoeDictClass parent_class; - - gboolean (*register_char) (TomoeDict *dict, - TomoeChar *chr); - gboolean (*unregister_char) (TomoeDict *dict, - const gchar *utf8); }; GType _tomoe_dict_ptr_array_get_type (void) G_GNUC_CONST; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-20 10:14:12
|
Revision: 1527 http://tomoe.svn.sourceforge.net/tomoe/?rev=1527&view=rev Author: ikezoe Date: 2007-06-20 03:14:09 -0700 (Wed, 20 Jun 2007) Log Message: ----------- * lib/tomoe-dict-ptr-array.c: TomoeDictPtrArray has editable and modified property. * module/dict/tomoe-dict-xml.c: Follow the above change. Modified Paths: -------------- tomoe/trunk/ChangeLog tomoe/trunk/lib/tomoe-dict-ptr-array.c tomoe/trunk/module/dict/tomoe-dict-xml.c Modified: tomoe/trunk/ChangeLog =================================================================== --- tomoe/trunk/ChangeLog 2007-06-19 10:59:06 UTC (rev 1526) +++ tomoe/trunk/ChangeLog 2007-06-20 10:14:09 UTC (rev 1527) @@ -1,3 +1,9 @@ +2007-06-20 Hiroyuki Ikezoe <poi...@ik...> + + * lib/tomoe-dict-ptr-array.c: TomoeDictPtrArray has editable and + modified property. + * module/dict/tomoe-dict-xml.c: Follow the above change. + 2007-06-18 Hiroyuki Ikezoe <poi...@ik...> * bindings/ruby/tomoe-rb-dict.c: Implement copy() function. Modified: tomoe/trunk/lib/tomoe-dict-ptr-array.c =================================================================== --- tomoe/trunk/lib/tomoe-dict-ptr-array.c 2007-06-19 10:59:06 UTC (rev 1526) +++ tomoe/trunk/lib/tomoe-dict-ptr-array.c 2007-06-20 10:14:09 UTC (rev 1527) @@ -34,10 +34,18 @@ #define TOMOE_DICT_PTR_ARRAY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TOMOE_TYPE_DICT_PTR_ARRAY, TomoeDictPtrArrayPrivate)) +enum { + PROP_0, + PROP_EDITABLE, + PROP_MODIFIED +}; + typedef struct _TomoeDictPtrArrayPrivate TomoeDictPtrArrayPrivate; struct _TomoeDictPtrArrayPrivate { GPtrArray *chars; + gboolean editable; + gboolean modified; }; static TomoeDictClass *parent_class; @@ -45,6 +53,14 @@ G_DEFINE_ABSTRACT_TYPE (TomoeDictPtrArray, _tomoe_dict_ptr_array, TOMOE_TYPE_DICT) static void dispose (GObject *object); +static void set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); static gboolean register_char (TomoeDict *dict, TomoeChar *chr); static gboolean unregister_char (TomoeDict *dict, @@ -55,6 +71,7 @@ TomoeQuery *query); static gboolean copy (TomoeDict *src_dict, TomoeDict *dest_dict); +static gboolean is_editable (TomoeDict *dict); static gchar *get_available_private_utf8 (TomoeDict *dict); static void @@ -65,6 +82,8 @@ gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = dispose; + gobject_class->set_property = set_property; + gobject_class->get_property = get_property; parent_class = g_type_class_peek_parent (klass); @@ -76,13 +95,33 @@ dict_class->search = search; dict_class->flush = NULL; dict_class->copy = copy; - dict_class->is_editable = NULL; + dict_class->is_editable = is_editable; dict_class->is_available = NULL; dict_class->get_available_private_utf8 = get_available_private_utf8; klass->register_char = register_char; klass->unregister_char = unregister_char; + g_object_class_install_property( + gobject_class, + PROP_EDITABLE, + g_param_spec_boolean( + "editable", + "Editable", + "Editable flag", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property( + gobject_class, + PROP_MODIFIED, + g_param_spec_boolean( + "modified", + "Modified", + "Modified flag", + FALSE, + G_PARAM_READWRITE)); + g_type_class_add_private (gobject_class, sizeof (TomoeDictPtrArrayPrivate)); } @@ -91,9 +130,54 @@ { TomoeDictPtrArrayPrivate *priv = TOMOE_DICT_PTR_ARRAY_GET_PRIVATE (dict); priv->chars = g_ptr_array_new(); + priv->editable = FALSE; + priv->modified = FALSE; } static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + TomoeDictPtrArrayPrivate *priv = TOMOE_DICT_PTR_ARRAY_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_EDITABLE: + priv->editable = g_value_get_boolean (value); + break; + case PROP_MODIFIED: + priv->modified = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + TomoeDictPtrArrayPrivate *priv = TOMOE_DICT_PTR_ARRAY_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_EDITABLE: + g_value_set_boolean (value, priv->editable); + break; + case PROP_MODIFIED: + g_value_set_boolean (value, priv->modified); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void dispose (GObject *object) { TomoeDictPtrArrayPrivate *priv = TOMOE_DICT_PTR_ARRAY_GET_PRIVATE (object); @@ -140,6 +224,8 @@ g_ptr_array_add (priv->chars, g_object_ref (G_OBJECT (chr))); _tomoe_dict_ptr_array_sort (TOMOE_DICT_PTR_ARRAY (dict)); + priv->modified = TRUE; + return TRUE; } @@ -168,6 +254,7 @@ if (index >= 0) { g_ptr_array_remove_index (priv->chars, index); g_object_unref (removed); + priv->modified = TRUE; return TRUE; } else { return FALSE; @@ -371,10 +458,14 @@ TomoeDictPtrArrayPrivate *src_priv, *dest_priv; g_return_val_if_fail (TOMOE_IS_DICT_PTR_ARRAY (src_dict), FALSE); + if (!tomoe_dict_is_editable (dest_dict)) + return FALSE; + if (!TOMOE_IS_DICT_PTR_ARRAY (dest_dict)) { tomoe_dict_plain_copy (src_dict, dest_dict); return TRUE; } + src_priv = TOMOE_DICT_PTR_ARRAY_GET_PRIVATE (src_dict); dest_priv = TOMOE_DICT_PTR_ARRAY_GET_PRIVATE (dest_dict); @@ -389,6 +480,14 @@ return TRUE; } +static gboolean +is_editable (TomoeDict *dict) +{ + g_return_val_if_fail (TOMOE_IS_DICT_PTR_ARRAY (dict), FALSE); + + return TOMOE_DICT_PTR_ARRAY_GET_PRIVATE (dict)->editable; +} + gchar * get_available_private_utf8 (TomoeDict *dict) { Modified: tomoe/trunk/module/dict/tomoe-dict-xml.c =================================================================== --- tomoe/trunk/module/dict/tomoe-dict-xml.c 2007-06-19 10:59:06 UTC (rev 1526) +++ tomoe/trunk/module/dict/tomoe-dict-xml.c 2007-06-20 10:14:09 UTC (rev 1527) @@ -53,8 +53,7 @@ enum { PROP_0, - PROP_FILENAME, - PROP_EDITABLE + PROP_FILENAME }; typedef struct _TomoeDictXML TomoeDictXML; @@ -64,9 +63,6 @@ TomoeDictPtrArray object; gchar *filename; gchar *name; - - gboolean editable; - gboolean modified; }; struct _TomoeDictXMLClass @@ -81,10 +77,6 @@ guint n_props, GObjectConstructParam *props); static void dispose (GObject *object); -static gboolean register_char (TomoeDict *dict, - TomoeChar *chr); -static gboolean unregister_char (TomoeDict *dict, - const gchar *utf8); static void set_property (GObject *object, guint prop_id, const GValue *value, @@ -95,7 +87,6 @@ GParamSpec *pspec); static const gchar *get_name (TomoeDict *dict); static gboolean flush (TomoeDict *dict); -static gboolean is_editable (TomoeDict *dict); static gboolean is_available (TomoeDict *dict); static gboolean tomoe_dict_xml_load (TomoeDictXML *dict); static gboolean tomoe_dict_xml_save (TomoeDictXML *dict); @@ -117,10 +108,7 @@ dict_class = TOMOE_DICT_CLASS (klass); dict_class->get_name = get_name; - dict_class->register_char = register_char; - dict_class->unregister_char = unregister_char; dict_class->flush = flush; - dict_class->is_editable = is_editable; dict_class->is_available = is_available; g_object_class_install_property ( @@ -132,15 +120,6 @@ "The filename of xml file", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property( - gobject_class, - PROP_EDITABLE, - g_param_spec_boolean( - "editable", - "Editable", - "Editable flag", - FALSE, - G_PARAM_READWRITE)); } static void @@ -148,8 +127,6 @@ { dict->filename = NULL; dict->name = NULL; - dict->modified = FALSE; - dict->editable = FALSE; } static void @@ -233,9 +210,6 @@ case PROP_FILENAME: dict->filename = g_value_dup_string (value); break; - case PROP_EDITABLE: - dict->editable = g_value_get_boolean (value); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -255,9 +229,6 @@ case PROP_FILENAME: g_value_set_string (value, dict->filename); break; - case PROP_EDITABLE: - g_value_set_boolean (value, dict->editable); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -284,30 +255,6 @@ G_OBJECT_CLASS (parent_class)->dispose (object); } -static gboolean -register_char (TomoeDict *dict, TomoeChar *chr) -{ - gboolean success; - - success = TOMOE_DICT_PTR_ARRAY_CLASS (parent_class)->register_char (dict, chr); - if (success) - TOMOE_DICT_XML (dict)->modified = TRUE; - - return success; -} - -static gboolean -unregister_char (TomoeDict *dict, const gchar *utf8) -{ - gboolean success; - - success = TOMOE_DICT_PTR_ARRAY_CLASS (parent_class)->unregister_char (dict, utf8); - if (success) - TOMOE_DICT_XML (dict)->modified = TRUE; - - return success; -} - static const gchar* get_name (TomoeDict *_dict) { @@ -327,26 +274,16 @@ } static gboolean -is_editable (TomoeDict *_dict) -{ - TomoeDictXML *dict = TOMOE_DICT_XML (_dict); - - g_return_val_if_fail (TOMOE_IS_DICT_XML (dict), FALSE); - - return dict->editable; -} - -static gboolean is_available (TomoeDict *_dict) { TomoeDictXML *dict = TOMOE_DICT_XML (_dict); g_return_val_if_fail (TOMOE_IS_DICT_XML (dict), FALSE); - if (dict->editable && !dict->filename) + if (tomoe_dict_is_editable (_dict) && !dict->filename) return FALSE; - if (!dict->editable && dict->filename && + if (!tomoe_dict_is_editable (_dict) && dict->filename && !g_file_test (dict->filename, G_FILE_TEST_EXISTS)) return FALSE; @@ -381,16 +318,18 @@ GString *xml; GError *error = NULL; gboolean success; + gboolean modified = FALSE; guint i; GPtrArray *chars; g_return_val_if_fail (TOMOE_IS_DICT_XML (dict), FALSE); - if (!dict->editable) return FALSE; + if (!tomoe_dict_is_editable (TOMOE_DICT (dict))) return FALSE; g_return_val_if_fail (dict->filename, FALSE); - if (!dict->modified) return TRUE; + g_object_get (dict, "modified", &modified, NULL); + if (!modified) return TRUE; xml = g_string_new ( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" @@ -417,7 +356,7 @@ success = g_file_set_contents (dict->filename, xml->str, xml->len, &error); if (success) - dict->modified = FALSE; + g_object_set (dict, "modified", FALSE, NULL); else TOMOE_HANDLE_ERROR (error); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-19 10:59:06
|
Revision: 1526 http://tomoe.svn.sourceforge.net/tomoe/?rev=1526&view=rev Author: ikezoe Date: 2007-06-19 03:59:06 -0700 (Tue, 19 Jun 2007) Log Message: ----------- update ignore property. Property Changed: ---------------- stroke-editor/trunk/src/ stroke-editor/trunk/src/net/ Property changes on: stroke-editor/trunk/src ___________________________________________________________________ Name: svn:ignore + *.pyc Property changes on: stroke-editor/trunk/src/net ___________________________________________________________________ Name: svn:ignore + *.pyc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-19 10:58:40
|
Revision: 1525 http://tomoe.svn.sourceforge.net/tomoe/?rev=1525&view=rev Author: ikezoe Date: 2007-06-19 03:56:16 -0700 (Tue, 19 Jun 2007) Log Message: ----------- - src/main.py: Use TOMOE's python binding. - src/openxml.py: Removed. Modified Paths: -------------- stroke-editor/trunk/ChangeLog stroke-editor/trunk/src/main.py Removed Paths: ------------- stroke-editor/trunk/src/openxml.py Modified: stroke-editor/trunk/ChangeLog =================================================================== --- stroke-editor/trunk/ChangeLog 2007-06-19 10:30:59 UTC (rev 1524) +++ stroke-editor/trunk/ChangeLog 2007-06-19 10:56:16 UTC (rev 1525) @@ -1,3 +1,7 @@ +2007.6.19 Hiroyuki Ikezoe <poi...@ik...> +- src/main.py: Use TOMOE's python binding. +- src/openxml.py: Removed. + 2007.6.01 Hu Zheng <zh...@re...> - handwriting-zh_CN-gb2312.xml is added after two months' work. *version 1.3 released. Modified: stroke-editor/trunk/src/main.py =================================================================== --- stroke-editor/trunk/src/main.py 2007-06-19 10:30:59 UTC (rev 1524) +++ stroke-editor/trunk/src/main.py 2007-06-19 10:56:16 UTC (rev 1525) @@ -2,8 +2,9 @@ import gobject import gtk +import os +import tomoe from workview import WorkView -from openxml import OpenXML from savexml import SaveXML from configfile import ConfigFile from importutf import ImportUtf @@ -320,10 +321,39 @@ self.config.save() gtk.main_quit() + def open_xmlfile(self, filename): + # When the column is sorted, it will become very slow, so create a new one. + self.enable_network = False + self.char_liststore = gtk.ListStore(gobject.TYPE_STRING, object, gobject.TYPE_BOOLEAN) + + self.dict = tomoe.Dict("XML", filename = filename, editable = True) + query = tomoe.Query() + for char in map(lambda cand: cand.get_char() , self.dict.search(query)): + self.char_liststore.append([char.get_utf8(), char.get_writing().get_strokes(), + bool(char.get_writing().get_n_strokes())]) + def do_open(self, widget): self.char_treeview.set_model(None) - openxml = OpenXML(self) - openxml.do_open() + dialog = gtk.FileChooserDialog ("Select tomoe XML file", + self, + gtk.FILE_CHOOSER_ACTION_OPEN, + (gtk.STOCK_OPEN, gtk.RESPONSE_OK, + gtk.STOCK_CANCEL, gtk.RESPONSE_CLOSE)) + xmlfilter = gtk.FileFilter() + xmlfilter.set_name("Tomoe XML file") + xmlfilter.add_pattern("*.xml") + allfilter = gtk.FileFilter() + allfilter.set_name("Any file") + allfilter.add_pattern("*") + dialog.add_filter(xmlfilter) + dialog.add_filter(allfilter) + dialog.set_default_response (gtk.RESPONSE_OK) + dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) + dialog.set_current_folder(os.getenv("PWD") + "/data"); + retval = dialog.run () + if retval == gtk.RESPONSE_OK: + self.open_xmlfile(dialog.get_filename()) + dialog.destroy () self.char_treeview.set_model(self.char_liststore) self.update_statusbar() Deleted: stroke-editor/trunk/src/openxml.py =================================================================== --- stroke-editor/trunk/src/openxml.py 2007-06-19 10:30:59 UTC (rev 1524) +++ stroke-editor/trunk/src/openxml.py 2007-06-19 10:56:16 UTC (rev 1525) @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- - -import gobject -import gtk -import xml.parsers.expat -import os - -class OpenXML: - def __init__(self, mainwin): - self.mainwin = mainwin - - def start_element(self, name, attrs): - if name == "character": - self.utf8chars = "" - elif name == "utf8": - self.in_utf8 = True - elif name == "strokes": - self.strokes = [] - elif name == "stroke": - self.stroke = [] - elif name == "point": - self.stroke.append((int(attrs["x"]), int(attrs["y"]))) - - def end_element(self, name): - if name == "character": - self.mainwin.char_liststore.append([self.utf8chars, self.strokes, bool(self.strokes)]) - elif name == "utf8": - self.in_utf8 = False - elif name == "strokes": - pass - elif name == "stroke": - self.strokes.append(self.stroke) - - def char_data(self, data): - if self.in_utf8: - self.utf8chars = self.utf8chars + data - - def open_xmlfile(self, filename): - # When the column is sorted, it will become very slow, so create a new one. - self.mainwin.enable_network = False - self.mainwin.char_liststore = gtk.ListStore(gobject.TYPE_STRING, object, gobject.TYPE_BOOLEAN) - self.in_utf8 = False - p = xml.parsers.expat.ParserCreate() - p.StartElementHandler = self.start_element - p.EndElementHandler = self.end_element - p.CharacterDataHandler = self.char_data - xmlfile = file(filename) - p.ParseFile(xmlfile) - - def do_open(self): - dialog = gtk.FileChooserDialog ("Select tomoe XML file", - self.mainwin, - gtk.FILE_CHOOSER_ACTION_OPEN, - (gtk.STOCK_OPEN, gtk.RESPONSE_OK, - gtk.STOCK_CANCEL, gtk.RESPONSE_CLOSE)) - xmlfilter = gtk.FileFilter() - xmlfilter.set_name("Tomoe XML file") - xmlfilter.add_pattern("*.xml") - allfilter = gtk.FileFilter() - allfilter.set_name("Any file") - allfilter.add_pattern("*") - dialog.add_filter(xmlfilter) - dialog.add_filter(allfilter) - dialog.set_default_response (gtk.RESPONSE_OK) - dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) - dialog.set_current_folder(os.getenv("PWD") + "/data"); - retval = dialog.run () - if retval == gtk.RESPONSE_OK: - self.open_xmlfile(dialog.get_filename()) - dialog.destroy () - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kt...@us...> - 2007-06-19 10:30:57
|
Revision: 1524 http://tomoe.svn.sourceforge.net/tomoe/?rev=1524&view=rev Author: ktou Date: 2007-06-19 03:30:59 -0700 (Tue, 19 Jun 2007) Log Message: ----------- * used a simple branch name. Added Paths: ----------- stroke-editor/branches/1.3/ Removed Paths: ------------- stroke-editor/branches/stroke-editor-1-3/ Copied: stroke-editor/branches/1.3 (from rev 1523, stroke-editor/branches/stroke-editor-1-3) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-19 10:23:29
|
Revision: 1523 http://tomoe.svn.sourceforge.net/tomoe/?rev=1523&view=rev Author: ikezoe Date: 2007-06-19 03:22:59 -0700 (Tue, 19 Jun 2007) Log Message: ----------- removed needless. Removed Paths: ------------- stroke-editor/trunk/branches/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-19 10:21:52
|
Revision: 1522 http://tomoe.svn.sourceforge.net/tomoe/?rev=1522&view=rev Author: ikezoe Date: 2007-06-19 03:21:53 -0700 (Tue, 19 Jun 2007) Log Message: ----------- moved to stroke-editor/trunk. Added Paths: ----------- stroke-editor/trunk/ Removed Paths: ------------- tools/stroke-editor/ Copied: stroke-editor/trunk (from rev 1521, tools/stroke-editor) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-19 10:21:18
|
Revision: 1521 http://tomoe.svn.sourceforge.net/tomoe/?rev=1521&view=rev Author: ikezoe Date: 2007-06-19 03:21:20 -0700 (Tue, 19 Jun 2007) Log Message: ----------- missed. Removed Paths: ------------- stroke-editor/trunk/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-19 10:20:45
|
Revision: 1520 http://tomoe.svn.sourceforge.net/tomoe/?rev=1520&view=rev Author: ikezoe Date: 2007-06-19 03:20:45 -0700 (Tue, 19 Jun 2007) Log Message: ----------- make a brach. Added Paths: ----------- stroke-editor/branches/stroke-editor-1-3/ Copied: stroke-editor/branches/stroke-editor-1-3 (from rev 1519, tools/stroke-editor) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-19 10:19:23
|
Revision: 1519 http://tomoe.svn.sourceforge.net/tomoe/?rev=1519&view=rev Author: ikezoe Date: 2007-06-19 03:19:22 -0700 (Tue, 19 Jun 2007) Log Message: ----------- added directories. Added Paths: ----------- stroke-editor/branches/ stroke-editor/tags/ stroke-editor/trunk/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-19 10:13:44
|
Revision: 1518 http://tomoe.svn.sourceforge.net/tomoe/?rev=1518&view=rev Author: ikezoe Date: 2007-06-19 03:13:45 -0700 (Tue, 19 Jun 2007) Log Message: ----------- make directory for stroke-editor. Added Paths: ----------- stroke-editor/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-18 22:38:28
|
Revision: 1517 http://tomoe.svn.sourceforge.net/tomoe/?rev=1517&view=rev Author: ikezoe Date: 2007-06-18 15:36:31 -0700 (Mon, 18 Jun 2007) Log Message: ----------- cleaning. Modified Paths: -------------- tomoe/trunk/module/dict/tomoe-dict-unihan.c Modified: tomoe/trunk/module/dict/tomoe-dict-unihan.c =================================================================== --- tomoe/trunk/module/dict/tomoe-dict-unihan.c 2007-06-18 12:14:44 UTC (rev 1516) +++ tomoe/trunk/module/dict/tomoe-dict-unihan.c 2007-06-18 22:36:31 UTC (rev 1517) @@ -195,7 +195,6 @@ chars = _tomoe_dict_ptr_array_get_array (TOMOE_DICT_PTR_ARRAY (object)); _tomoe_unihan_create (chars); - } else { object = g_object_ref (G_OBJECT (the_singleton)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-18 12:14:43
|
Revision: 1516 http://tomoe.svn.sourceforge.net/tomoe/?rev=1516&view=rev Author: ikezoe Date: 2007-06-18 05:14:44 -0700 (Mon, 18 Jun 2007) Log Message: ----------- make branches. Added Paths: ----------- tools/stroke-editor/branches/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-18 03:03:07
|
Revision: 1515 http://tomoe.svn.sourceforge.net/tomoe/?rev=1515&view=rev Author: ikezoe Date: 2007-06-17 20:03:08 -0700 (Sun, 17 Jun 2007) Log Message: ----------- * module/tomoe-dict-unihan.c: Fix critical typos. Modified Paths: -------------- tomoe/trunk/ChangeLog tomoe/trunk/module/dict/tomoe-dict-unihan.c Modified: tomoe/trunk/ChangeLog =================================================================== --- tomoe/trunk/ChangeLog 2007-06-18 02:56:58 UTC (rev 1514) +++ tomoe/trunk/ChangeLog 2007-06-18 03:03:08 UTC (rev 1515) @@ -5,6 +5,7 @@ functions. * module/tomoe-dict-xml.c: Invoke TomoeDictPtrArray::register_char to set modified flag. + * module/tomoe-dict-unihan.c: Fix critical typos. 2007-06-17 Kouhei Sutou <ko...@co...> Modified: tomoe/trunk/module/dict/tomoe-dict-unihan.c =================================================================== --- tomoe/trunk/module/dict/tomoe-dict-unihan.c 2007-06-18 02:56:58 UTC (rev 1514) +++ tomoe/trunk/module/dict/tomoe-dict-unihan.c 2007-06-18 03:03:08 UTC (rev 1515) @@ -58,13 +58,13 @@ typedef struct _TomoeDictUnihanClass TomoeDictUnihanClass; struct _TomoeDictUnihan { - TomoeDict object; + TomoeDictPtrArray object; gchar *name; }; struct _TomoeDictUnihanClass { - TomoeDictClass parent_class; + TomoeDictPtrArrayClass parent_class; }; static GType tomoe_type_dict_unihan = 0; @@ -145,9 +145,9 @@ }; tomoe_type_dict_unihan = g_type_module_register_type (type_module, - TOMOE_TYPE_DICT_PTR_ARRAY, - "TomoeDictUnihan", - &info, 0); + TOMOE_TYPE_DICT_PTR_ARRAY, + "TomoeDictUnihan", + &info, 0); } G_MODULE_EXPORT GList * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ik...@us...> - 2007-06-18 02:56:56
|
Revision: 1514 http://tomoe.svn.sourceforge.net/tomoe/?rev=1514&view=rev Author: ikezoe Date: 2007-06-17 19:56:58 -0700 (Sun, 17 Jun 2007) Log Message: ----------- * lib/tomoe-dict-ptr-array.[ch]: Added register and unregister virtual functions. * module/tomoe-dict-xml.c: Invoke TomoeDictPtrArray::register_char to set modified flag. Modified Paths: -------------- tomoe/trunk/ChangeLog tomoe/trunk/lib/tomoe-dict-ptr-array.c tomoe/trunk/lib/tomoe-dict-ptr-array.h tomoe/trunk/module/dict/tomoe-dict-xml.c Modified: tomoe/trunk/ChangeLog =================================================================== --- tomoe/trunk/ChangeLog 2007-06-18 02:45:43 UTC (rev 1513) +++ tomoe/trunk/ChangeLog 2007-06-18 02:56:58 UTC (rev 1514) @@ -1,6 +1,10 @@ 2007-06-18 Hiroyuki Ikezoe <poi...@ik...> * bindings/ruby/tomoe-rb-dict.c: Implement copy() function. + * lib/tomoe-dict-ptr-array.[ch]: Added register and unregister virtual + functions. + * module/tomoe-dict-xml.c: Invoke TomoeDictPtrArray::register_char + to set modified flag. 2007-06-17 Kouhei Sutou <ko...@co...> Modified: tomoe/trunk/lib/tomoe-dict-ptr-array.c =================================================================== --- tomoe/trunk/lib/tomoe-dict-ptr-array.c 2007-06-18 02:45:43 UTC (rev 1513) +++ tomoe/trunk/lib/tomoe-dict-ptr-array.c 2007-06-18 02:56:58 UTC (rev 1514) @@ -80,6 +80,9 @@ dict_class->is_available = NULL; dict_class->get_available_private_utf8 = get_available_private_utf8; + klass->register_char = register_char; + klass->unregister_char = unregister_char; + g_type_class_add_private (gobject_class, sizeof (TomoeDictPtrArrayPrivate)); } Modified: tomoe/trunk/lib/tomoe-dict-ptr-array.h =================================================================== --- tomoe/trunk/lib/tomoe-dict-ptr-array.h 2007-06-18 02:45:43 UTC (rev 1513) +++ tomoe/trunk/lib/tomoe-dict-ptr-array.h 2007-06-18 02:56:58 UTC (rev 1514) @@ -47,6 +47,11 @@ struct _TomoeDictPtrArrayClass { TomoeDictClass parent_class; + + gboolean (*register_char) (TomoeDict *dict, + TomoeChar *chr); + gboolean (*unregister_char) (TomoeDict *dict, + const gchar *utf8); }; GType _tomoe_dict_ptr_array_get_type (void) G_GNUC_CONST; Modified: tomoe/trunk/module/dict/tomoe-dict-xml.c =================================================================== --- tomoe/trunk/module/dict/tomoe-dict-xml.c 2007-06-18 02:45:43 UTC (rev 1513) +++ tomoe/trunk/module/dict/tomoe-dict-xml.c 2007-06-18 02:56:58 UTC (rev 1514) @@ -81,6 +81,10 @@ guint n_props, GObjectConstructParam *props); static void dispose (GObject *object); +static gboolean register_char (TomoeDict *dict, + TomoeChar *chr); +static gboolean unregister_char (TomoeDict *dict, + const gchar *utf8); static void set_property (GObject *object, guint prop_id, const GValue *value, @@ -113,6 +117,8 @@ dict_class = TOMOE_DICT_CLASS (klass); dict_class->get_name = get_name; + dict_class->register_char = register_char; + dict_class->unregister_char = unregister_char; dict_class->flush = flush; dict_class->is_editable = is_editable; dict_class->is_available = is_available; @@ -278,6 +284,30 @@ G_OBJECT_CLASS (parent_class)->dispose (object); } +static gboolean +register_char (TomoeDict *dict, TomoeChar *chr) +{ + gboolean success; + + success = TOMOE_DICT_PTR_ARRAY_CLASS (parent_class)->register_char (dict, chr); + if (success) + TOMOE_DICT_XML (dict)->modified = TRUE; + + return success; +} + +static gboolean +unregister_char (TomoeDict *dict, const gchar *utf8) +{ + gboolean success; + + success = TOMOE_DICT_PTR_ARRAY_CLASS (parent_class)->unregister_char (dict, utf8); + if (success) + TOMOE_DICT_XML (dict)->modified = TRUE; + + return success; +} + static const gchar* get_name (TomoeDict *_dict) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |