1911 Commits

Author SHA1 Message Date
adamboduch
67fba37a7c Use super() in the ClassItem constructor. 2010-11-29 13:48:34 -05:00
adamboduch
b3e12d94c4 Use super() instead of calling three constructors in DiagramItem. 2010-11-29 13:41:29 -05:00
adamboduch
28a8d4fbcb Improved logging in diagramitem.py. 2010-11-29 13:39:15 -05:00
adamboduch
42f22c6973 Improved logging in connector.py. 2010-11-29 13:32:39 -05:00
adamboduch
6028f47b7e Improved the logging in connectors.py. 2010-11-29 13:23:33 -05:00
adamboduch
97f85aeae6 Improved logging in application.py. 2010-11-29 01:15:19 -05:00
adamboduch
c359bca15f Improved logging in the action manager service. 2010-11-29 01:11:04 -05:00
adamboduch
4b69eb526e Added some doc strings to the properties service. 2010-11-29 00:57:46 -05:00
adamboduch
24d37a04af FileBackend now uses with statements for file operations. 2010-11-26 10:56:13 -05:00
adamboduch
37b3ab8a44 Raise KeyError exception in a Python3-friendly way. 2010-11-26 10:09:22 -05:00
adamboduch
ff89edf50f Removed redundant imports from properties.py 2010-11-26 09:52:49 -05:00
adamboduch
c54811d284 Removed the redundant user_data_dir property from several modules by
introducing a new get_user_data_dir() utility function.
2010-11-26 09:43:33 -05:00
adamboduch
03881a23f2 A few minor changes.
Removed a print statement from application.py

Change the logging format in logger.py.  Instead of showing the asctime in
the message, we now show the logger name.  This isn't a web server so the
time really isn't that relevant.

The Logger constructor now has a name parameter which defaults to GAPHOR and
is displayed in the log messages.  This way new loggers that are created
can have a name and the messages carry more meaning.

The logger class has a new static attribute - level.  This can be set to
apply the logging level globally, for any Logger instances.  For now, this
doesn't have an effect since Logger is a singleton.  However, this is likely
to change.
2010-11-26 08:41:58 -05:00
adamboduch
4c511ea3b2 Made several improvements to __init__.py and the Gaphor application
initialization.

The major change is that Application now has an option parser for access
to command line options.  This means that plugins and services can add command
line options to the parser and have access to their values.  This is done
by creating the parser object inside main() and passing it to the application.
The application will then initialize all services before actually parsing
the options.  This gives them a chance to add their own.

The imports in __init__.py have also been re-arranged.  Logging is now set
when the application is initialized.

The launch() function in __init__.py has been simplified.  Instead of passing
a Gaphor file argument, launch() will now ask the Application instance if
there is a Gaphor model to load.

The main() function in __init__.py is also much smaller and simpler now
due to the above changes.
2010-11-26 08:08:13 -05:00
adamboduch
7183a1d1a0 Made several enhancements and fixes in the XMI Export plugin. 2010-11-25 12:52:27 -05:00
adamboduch
e9c73a774a Merge branch 'master' of http://github.com/amolenaar/gaphor 2010-10-15 11:12:25 -04:00
Arjan Molenaar
28672612f5 Fixed saving of model on exit. 2010-10-15 16:49:48 +02:00
Arjan Molenaar
30b9437404 Added close button on diagram tabs. Thanks to Mario Gonzalez <gonzalemario@gmail.com>. 2010-10-15 16:46:53 +02:00
adamboduch
ebeda97936 Started to implement a new version of the XMI plugin to support XMI 2.1. 2010-09-30 09:56:49 -04:00
adamboduch
56d9bd8720 Merge branch 'master' of http://github.com/amolenaar/gaphor 2010-09-24 08:29:05 -04:00
Arjan Molenaar
57402363eb Added missing layout.xml. 2010-09-20 21:39:56 +02:00
Antony N. Pavlov
64f79dd115 Fixed merge conflict that somehow made it into the repo. 2010-09-20 21:39:56 +02:00
adamboduch
d3c9524c17 Fixed and added documentation in elementeditor.py. 2010-09-16 04:00:46 +08:00
Arjan Molenaar
a52fb5dad5 Loosened rules on Properties in Namespace view.
[[#64] state:resolved]
2010-09-14 17:48:59 +02:00
adamboduch
b7e1fbd33b Fixed and added documentation in elementeditor.py. 2010-09-08 07:22:04 -04:00
Arjan Molenaar
b3512e7402 Merge branch 'master' of http://github.com/mamutti/gaphor 2010-09-08 08:45:46 +02:00
Arjan Molenaar
58c3a2125c Merge branch 'master' of git://github.com/adamboduch/gaphor 2010-09-08 08:45:10 +02:00
adamboduch
e9c760c8f2 The diagram export manager service now uses the FileDialog and
QuestionDialog classes.
2010-09-07 13:06:04 -04:00
adamboduch
a8254a0191 Added documentation to event.py. 2010-09-07 11:50:10 -04:00
Ygor Mutti
4e36574f89 Merge branch 'master' of git://github.com/amolenaar/gaphor 2010-09-06 13:18:51 -03:00
adamboduch
cc3fd415f7 The XMI Export plugin now uses the FileDialog class. 2010-09-01 09:49:06 -04:00
adamboduch
3b8964bb96 Added documentation to the transaction module. 2010-08-31 11:40:31 -04:00
adamboduch
ad8d8fd988 Fixed the generalization creation in the pynsource plugin. The
_create_generalization() method was trying to use an adapter to
connect the generalization item to the super class and child class
items.  This was expecting a port parameter.

However, this didn't fix the problem entirely because the generalization
items were not connected in the diagram.  I changed _create_generalization()
to use a connect() method instead.  This method is taken from the unit tests.
This seems to mostly resolve the issue.
2010-08-30 08:53:21 -04:00
adamboduch
96bb220648 Added better i18n support to the file manager service. 2010-08-30 07:59:18 -04:00
Arjan Molenaar
525e2e4021 Only make toolbox items insensitive when no diagrams are displayed.
[[#63] state:resolved]
2010-08-28 13:56:51 +02:00
adamboduch
a3e4b101b6 Added documentation and removed deprecated imports in diagram.py. 2010-08-27 10:25:41 -04:00
adamboduch
e2d4c61a94 Removed manual garbage collection from the new model action. 2010-08-27 09:31:08 -04:00
adamboduch
a730ae553d Removed deprecated imports from the file manager service. 2010-08-27 09:29:00 -04:00
adamboduch
2a39d81de8 Did some general cleanup in parse_file(). Added some documentation, Using
better variable names, removed commented-out code, better if-statement.
2010-08-27 08:53:27 -04:00
adamboduch
00d05b13ce Starting experimenting with a new ProgressGenerator class. This is intended
to read a buffer from the input and feed to to the output while yielding
the progress percentage.

It is just an experiment because it is intended to be generic enough to work
with several input and output types.  Currently, it needs an open file
object as input and a SAX parser as output.
2010-08-26 12:45:44 -04:00
Arjan Molenaar
39c70c34bd Revert "Added a new app property to the Element class. This will return the"
This reverts commit f38404380a441afffeb2cf4b298bec854567b8c7.
2010-08-26 10:22:25 +02:00
adamboduch
b4eaab3564 Merge branch 'master' of http://github.com/amolenaar/gaphor 2010-08-20 06:31:29 -04:00
adamboduch
6a579fb028 Created a generic FileDialog UI class used for saving and opening files.
This class takes a number of parameters that alter the way it is displayed
or behaves.

The selection property returns the file selection.  Accessing this property
is what displays the dialog, tests the response, and returns the file
selection if any.

The file manager service uses this new class for displaying dialogs.
2010-08-19 14:06:00 -04:00
Arjan Molenaar
7ea738bd92 Do explicit pygtk initialization on application startup. 2010-08-19 18:31:09 +02:00
adamboduch
f38404380a Added a new app property to the Element class. This will return the
Gaphor application instance if the element has been bound to a factory.
If the application instance exists, we can use its component methods
instead of calling zope.component directly.
2010-08-19 10:08:39 -04:00
adamboduch
dc9a2c2705 The pynsource plugin now uses a GTK FileChooserDialog instead of
a FileSelection dialog.  This is a better widget for all intents
and purposes.

Fixed an issue with a non-existent execute_button.
2010-08-18 16:13:16 -04:00
adamboduch
9438b3285d Improved the ElementFactory.flush() method by adding some documentation.
Also removed some manual garbage collection and assertions as they seemed
to serve no real purpose.

The ElementFactory.lselect() method is used for element retrieval instead
of wrapping select() in a list instance or accessing _elements directly.

The Gaphor application instance, if supplied, will handle the
ElementDeleteEvent instead of calling the _element_deleted component
adapter directly.
2010-08-18 15:04:22 -04:00
adamboduch
3fdf2e1558 Refactored the save() method of the file manager service. The method name
has changed from _save() to save().

The save() method verifies orphan references in the model before saving.
This functionality has been moved to its own method, verify_orphans().

The filename validation, which makes sure the filename has a valid
extension, has also been moved to a separate method - verify_filename().

The save() method has also been cleaned up.  If there is no supplied filename,
the method fails immediately.  It is no longer wrapped in a large if
statement.  The try/finally statement has also been removed.
2010-08-18 10:02:56 -04:00
adamboduch
b14b407048 Refactored the file manager service load() method. Removed the manual garbage
collection.  Removed the large try except that wrapped around the entire
method body.  Cleaned up some variables and expanded the documentation.
2010-08-17 14:34:14 -04:00
adamboduch
02ae821240 Cleaned up the file manager service initialization by adding more
documentation and using better variable names.  The initialization
also uses the MAX_RECENT constant.

Fixed the get_filename() method used by the filename property.  It
wasn't actually returning anything.

Added some documentation to the set_filename() method.
2010-08-17 13:53:51 -04:00