Variable Interface

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Variable Interface

Post by chris »

The "Add Group" bug is fixed now. I'll give an update when I get some time about the other features you mentioned.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Variable Interface

Post by chris »

Case insensitive ordering will eventually be put in. For the time being, I would like some other approaches to representing the interface itself so if you had time to make a nicer ui that would rock. I have a quick mockup that allows you to specify the type of the variable/value via a QToolButton, but it looks terrible.

The next stage is going to be the hidden variables (modifying table values actually doesn't affect anything, there's a check for this).

The case-insensitive sorting will be done later, but is actually sort of a pain to implement. I need to override the < operator, and since the treewidget is shared amongst triggers/aliases/etc, I'm going to have to think about how to best do this.

For this case:
it doesn't seem to be possible to add values to an indexed table (giving the key a value of a number and saving it reverts it to what it was before)
Could you give an example of this?

Thanks for your comments as well.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Variable Interface

Post by Vadi »

Sure, try doing this: make a new table, make a key 1, make a key 2, and then try remaking key 1 to be key 3 (nils, or holes, are valid in Lua tables). If you try to press 'Save', nothing will change, but if you click on the '1' in the variable list to save it, it goes back to a 1. I made a short video: http://ge.tt/90DIooD?c

Got another BT while fiddling with table names. Not sure how to reproduce it, hopefully you can deduce the issue from this:


#0 0x00007ffff481b3a5 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff481eb0b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff5b3d43b in qt_message_output(QtMsgType, char const*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3 0x00007ffff5b3d7ef in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4 0x00007ffff5b3d994 in qFatal(char const*, ...) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5 0x0000000000467019 in QList<QString>::operator[] (this=0x7fffffffbc10, i=3) at /usr/include/qt4/QtCore/qlist.h:464
#6 0x000000000062a80d in luaInterface::saveVar (this=0x36be720, pItem=0x3566d70, newName=..., newValue=..., force=<optimized out>) at luaInterface.cpp:264
#7 0x0000000000489089 in dlgTriggerEditor::saveVar (this=<optimized out>) at dlgTriggerEditor.cpp:4015
#8 0x00000000004b19d5 in dlgTriggerEditor::slot_itemClicked (this=0x245ce10, pItem=0x3566d70, column=<optimized out>) at dlgTriggerEditor.cpp:6097

(we could use with a working make debug...)

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Variable Interface

Post by chris »

What do you mean a working make debug? Launch in debug mode with Qt Creator.

Also, added hidden variables now and my terrible new UI. It has the core components to be active but is obviously hideous. Only the 'hidden' checkbox works, they other variable/value type setting are just placeholders right now and don't have any real functionality.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Variable Interface

Post by Vadi »

Okay. I worked on it today, here's a demonstration: http://ge.tt/9EViqqD

Please let me know what you think and whenever you'd like something improved.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Variable Interface

Post by chris »

That looks awesome. Can you attach it?

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Variable Interface

Post by Vadi »

Yep, here it is. Widget types changed, so some source adjustments might be necessary before it compiles.
Attachments
vars_main_area.ui
(19.67 KiB) Downloaded 527 times

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Variable Interface

Post by Vadi »

What do you think about relocating the 'toggle hidden variables' to be a checkbox under the yellow 'Variables' line in the variable-specific view?

I don't like the down arrow sticking out.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Variable Interface

Post by chris »

I actually like having the down arrow sticking out. There also appears to be a regression from the last update on renaming variables (rename a table key and the old one remains). In anycase, I'm at the point where the code is too messy for me so I'm also going to refactor the code a bit. Expect somethings to break, but in the end I'd rather have cleaner code.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Variable Interface

Post by Vadi »

I really don't like it - it adds borders to other buttons, visually doesn't belong in the 'main' menu either.

OK on the refactoring, thanks for the heads up :-)

Post Reply