[Kde-bindings] Can I define a custom namespace for UICS?

IBBoard ibboard at gmail.com
Sat Jan 23 16:04:34 UTC 2010


On 23/01/10 15:47, Arno Rehn wrote:
> On Saturday 23 January 2010 15:54:03 IBBoard wrote:
>> I'm scripting up a build command for MonoDevelop so that it will compile
>> my .ui files to C# using uics whenever I build the project (not quite as
>> good as auto-build on change, but better than nothing :) ).
> You could implement an md5sum check, so it will only recompile when the ui 
> file was changed. AFAIK the framework has an implementation of md5.

The problem isn't really recompiles when they're not needed, it was
having to manually (or via a hook on a specific event) recompile. I've
found I don't need QyotoDevelop for editing .ui files because
MonoDevelop already picks up the associated editor, but QyotoDevelop
would recompile the file when it identified a change. All I can do with
MonoDevelop is use the "Before build" hook, which requires me to not
just save the .ui file but also to rebuild the project.

It is only a minor niggle really, though, as the build hook is usable
as-is. I just need to remember to build the project after I edit .ui
files or my variables won't be up to date.

>> So, is it possible to change the namespace that UICS compiles to, or
>> should I add a feature request for a command-line parameter?
> No, currently the namespace is hardcoded in uics. We can add it as a command 
> line option, if you require that. Please file a wishlist bug, then.
> Another possibility would be to create an alias in C# with
> 
> using Foo = Ui;
> 
> You can then access your user interfaces with Foo.MyForm.
> 
> What's the problem with the Ui namespace? Do you already have a Ui namespace?
> 

It's not a problem yet, just one that I can foresee. Using the "Ui."
namespace and the default namespace dumps everything in the same
locations, which can potentially lead to class name collisions.

There's also a "tidyness" aspect to it as well - all of my code for the
UI is in IBBoard.WarFoundry.GUI.QtSharp, but the actual Qyoto layouts
are in the empty namespace or Ui. It'd be better contained/structured if
the namespace usage was consistent within a project so I could put the
compiled UIs in IBBoard.WarFoundry.GUI.QtSharp.UiLayout (for example).

I've filed a wish in the bug tracker now: bug 223941 :)

Thanks.



More information about the Kde-bindings mailing list