[jitsi-dev] Editting Jitsi configuration file


#1

Hello team,

I was working on a plugin that adds the functionallity of editting jitsi's
configuration file at runtime.

I'm sending you some screenshots and a patch of what I've done.

Any comments and notes will be appreciated.

P.S. I added 2 properties in resources/languages/resources.properties that
are not translated. What am I supposted to do in such situations?

Regards,
Marin

Property edittor plugin.patch (31.1 KB)


#2

Hey

I was working on a plugin that adds the functionallity of editting jitsi's
configuration file at runtime.

This looks very useful!

I'm sending you some screenshots and a patch of what I've done.

Any comments and notes will be appreciated.

- What about properties that need a restart? I don't think we can gracefully
handle this in the plugin (currently at least), so a note at the bottom that
"some" properties might require a restart should be enough.
- Not sure if it makes sense to show the encrypted password properties.
Maybe handle them specially and show a different dialog that
decrypts/encrypts them?
- Change the password that is shown in the screenshots - even if you use a
master password!
- The add/edit dialog in screenshot 3 has no title and the textboxes are not
aligned
- I'm missing some kind of warning to edit properties directly. Even the far
less dangerous ZRTP options have a big fat "Ninja" button.
- Some lines seem to exceed 80 characters
- Please take care that empty lines don't contain spaces (enable "Show
whitespace characters" in your IDE)
- And some specific code comments:

PropsTableModel.java:

-> The opening braces are on the same line as the condition, class, etc.
-> Why a VetoableChangeListener? You never veto. A normal listener is
sufficient.
-> System.out.println: either use a logger, or, in this case, remove them
completely

Resources.java:

-> Put this into the activator and remove the getI18NString wrapper

+# config editor
+plugin.propertiesedittor.PROPERTIESEDITTOR=Property Edittor

···

+

-> Spelling! At multiple locations.

Index: build.xml

--- build.xml (revision 10847)

-> Against which repository was this created? Obviously some SVN based, but
the SVN gateway of Github only shows something around 10k revisions...

+ /**
+ * Starts this bundle and adds the
+ * <td>PropertiesEdittorPanel</tt> contained in it to the configuration
+ * window obtained from the <tt>UIService</tt>.
+ * @param bc the <tt>BundleContext</tt>
+ * @throws Exception if one of the operation executed in the start
method
+ * fails
+ */
+ public void start(BundleContext bc) throws Exception
+ {
+ bundleContext = bc;
+ Dictionary<String, String> properties = new Hashtable<String,

();

+ properties.put(ConfigurationForm.FORM_TYPE,
+ ConfigurationForm.ADVANCED_TYPE);
+ bundleContext.registerService(
+ ConfigurationForm.class.getName(),
+ new LazyConfigurationForm(
+
"net.java.sip.communicator.plugin.propertiesedittor.PropertiesEdittorPanel",
+ getClass().getClassLoader(),
+ "",
+ "plugin.propertiesedittor.PROPERTIESEDITTOR",
+ 1002, true),
+ properties);
+ }

-> Don't use strings for class names, but rather
PropertiesEdittorPanel.class.getName() (this helps during refactoring or
when doing code searches)

SearchBoxPanel.java

-> Braces

P.S. I added 2 properties in resources/languages/resources.properties that
are not translated. What am I supposted to do in such situations?

Just add them. Pootle will import them and show it as missing for the
translations. The builds then just contain the English version until someone
translated it.

Regards,
Marin


#3

Adding to what Ingo said:

--sent from my mobile

Hey

> I was working on a plugin that adds the functionallity of editting

jitsi's

> configuration file at runtime.

This looks very useful!

+1

> I'm sending you some screenshots and a patch of what I've done.
>
> Any comments and notes will be appreciated.

- What about properties that need a restart? I don't think we can

gracefully

handle this in the plugin (currently at least), so a note at the bottom

that

"some" properties might require a restart should be enough.

Actually, we discussed the use of a warning dialog that would tell users
they should be careful with with what they do. Something similar to what
one gets with firefox when visiting "about:config". I think we can add a
warning about potentially necessary restarts there.

- Not sure if it makes sense to show the encrypted password properties.
Maybe handle them specially and show a different dialog that
decrypts/encrypts them?

I'd much rather we kept this as simple as possible so that we don't have to
worry too much about maintaining it. We already have the password edit form
so ...

- Change the password that is shown in the screenshots - even if you use a
master password!
- The add/edit dialog in screenshot 3 has no title and the textboxes are

not

aligned
- I'm missing some kind of warning to edit properties directly. Even the

far

less dangerous ZRTP options have a big fat "Ninja" button.

Agreed. (Also commented on this above)

- Some lines seem to exceed 80 characters

Naughty, naughty :wink:

- Please take care that empty lines don't contain spaces (enable "Show
whitespace characters" in your IDE)
- And some specific code comments:

PropsTableModel.java:

-> The opening braces are on the same line as the condition, class, etc.
-> Why a VetoableChangeListener? You never veto. A normal listener is
sufficient.
-> System.out.println: either use a logger, or, in this case, remove them
completely

Resources.java:

-> Put this into the activator and remove the getI18NString wrapper

+# config editor
+plugin.propertiesedittor.PROPERTIESEDITTOR=Property Edittor
+

-> Spelling! At multiple locations.

Index: build.xml

--- build.xml (revision 10847)

-> Against which repository was this created? Obviously some SVN based,

but

the SVN gateway of Github only shows something around 10k revisions...

+ /**
+ * Starts this bundle and adds the
+ * <td>PropertiesEdittorPanel</tt> contained in it to the

configuration

+ * window obtained from the <tt>UIService</tt>.
+ * @param bc the <tt>BundleContext</tt>
+ * @throws Exception if one of the operation executed in the start
method
+ * fails
+ */
+ public void start(BundleContext bc) throws Exception
+ {
+ bundleContext = bc;
+ Dictionary<String, String> properties = new Hashtable<String,
>();
+ properties.put(ConfigurationForm.FORM_TYPE,
+ ConfigurationForm.ADVANCED_TYPE);
+ bundleContext.registerService(
+ ConfigurationForm.class.getName(),
+ new LazyConfigurationForm(
+

"net.java.sip.communicator.plugin.propertiesedittor.PropertiesEdittorPanel",

+ getClass().getClassLoader(),
+ "",
+ "plugin.propertiesedittor.PROPERTIESEDITTOR",
+ 1002, true),
+ properties);
+ }

-> Don't use strings for class names, but rather
PropertiesEdittorPanel.class.getName() (this helps during refactoring or
when doing code searches)

SearchBoxPanel.java

-> Braces

> P.S. I added 2 properties in resources/languages/resources.properties

that

> are not translated. What am I supposted to do in such situations?

Just add them. Pootle will import them and show it as missing for the
translations. The builds then just contain the English version until

someone

translated it.

Thanks for your review Ingo. I suspect Yana would have additional comments
on the GUI, but Marin, could you please remove the "Search" label, then
add, within the field, the same magnifier that we use in the contact list
search field? Also, could you please add the "x" button that we habe there?

Thanks,

Emil

···

On Aug 3, 2013 6:42 PM, "Ingo Bauersachs" <ingo@jitsi.org> wrote:

> Regards,
> Marin

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev