FET Forum

FET Development => Suggestions => Topic started by: Liviu Lalescu on September 12, 2011, 10:08:35 AM

Title: Choose setting: each dialog to be shown maximized?
Post by: Liviu Lalescu on September 12, 2011, 10:08:35 AM
Please let me know if you would like to have a check box setting: if it is selected, each FET window/dialog will be shown maximized.
Title: Re: Choose setting: each dialog to be shown maximized?
Post by: lalloso on September 12, 2011, 02:00:23 PM
No.
Title: Re: Choose setting: each dialog to be shown maximized?
Post by: Liviu Lalescu on September 12, 2011, 02:07:33 PM
OK, even myself, I thought after a while it was an ugly idea :-)
Title: Re: Choose setting: each dialog to be shown maximized?
Post by: Volker Dirr on September 12, 2011, 05:53:17 PM
hmm... there are a few windows/dialogs that are usefull to have them maximised. but many are not needed so big. so overall i think it shouldn't be added. (in particular if that guys have displays with more then 22" )
Title: Re: Choose setting: each dialog to be shown maximized?
Post by: Corfiot on September 12, 2011, 09:27:06 PM
A global setting is counter-productive. Ideally, it would be a 'remember dialog positions' checkbox instead. So if I maximize a dialog, it opens maximized next time.

Title: Re: Choose setting: each dialog to be shown maximized?
Post by: Liviu Lalescu on September 12, 2011, 09:37:51 PM
QuoteA global setting is counter-productive. Ideally, it would be a 'remember dialog positions' checkbox instead. So if I maximize a dialog, it opens maximized next time.


Yes, Corfiot, you are so right! I'll see if I can do anything. The problem is a bad design of the interface. There are 3 dialogs for each constraint, about 300 in total. A lot of work to add saving for each. And maybe I would do it. Then, I may see something is wrong - so go again and modify all 300 files :-)

Questions:

1) A Qt dialog, class, like "AddConstraintMinDaysBetweenActivitiesForm", how can I retrieve the name of the class in a C++ Qt program, and put it into a variable? To save the settings of the window in registry with class name.

2) I could make a class QDialogStoring, and

class AddConstraintMinDaysBetweenActivitiesForm: public QDialog, QDialogStoring,  AddConstraintMinDaysBetweenActivitiesForm_template
{
};


where QDialogStoring automatically stores settings on close of window?
Title: Re: Choose setting: each dialog to be shown maximized?
Post by: Corfiot on September 14, 2011, 02:39:10 PM
http://doc.qt.nokia.com/4.7-snapshot/restoring-geometry.html

See note at bottom. Using QSettings would be too much for 300 dialogs.

You could add the data to a .ini file. You could save settings on resize and on show for all dialogs by implementing this class you mention on all dialog classes you create and adding it as inherited. This class would probably override the resize/show events of the dialogs.

I am unsure as to the precise implementation details but it seems you're on the right track.

using onshow/onresize would be ok because windows never shown = windows never saving settings.
Title: Re: Choose setting: each dialog to be shown maximized?
Post by: Liviu Lalescu on September 14, 2011, 10:08:51 PM
Thank you for the link, I knew it but you reminded me about it.

It will be very easy to make this. After long testing/thinking, the idea: centerWidgetOnScreen will read settings, using Qt function className(), so only one file change. Then, in each file (from about 300 .cpp files), in destroyer, call a similar function. This will store settings in a similar way. Wonder why I didn't do it before? You'll love the behavior.

Corfiot, why shouldn't I store in QSettings? It is good, and Qt does the same with its dialogs.

So, I think it will be done. Maybe in a few weeks you'll have a snapshot. I'm working hard also on other things, like a new constraint and getting rid of Qt3Support, which already took 3 days and I did 33%.
Title: Re: Choose setting: each dialog to be shown maximized?
Post by: Liviu Lalescu on September 19, 2011, 07:03:02 PM
OK, great news, now almost all dialogs will retain their geometry :-)

Not yet a snapshot, cause I have more changes to do.