octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: renaming some classes and using the octave namespace in the GUI


From: Daniel J Sebald
Subject: Re: renaming some classes and using the octave namespace in the GUI
Date: Thu, 8 Feb 2018 11:43:23 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 02/08/2018 10:56 AM, John W. Eaton wrote:
We have a variety of class names in the GUI that are inconsistent and that I think are a bit worse than they could be. For example, we have variable_editor (OK) but terminal_dock_widget (not so OK). I propose the following changes to better reflect the purpose of each object and to drop the suffix that indicates the type of Qt object that we are inheriting from:

   doc_browser, not documentation_dock_widget
   file_browser, not files_dock_widget
   history_browser, not history_dock_widget
   command_terminal, not terminal_dock_widget
   workspace_browser, not workspace_view

I'm not sure about command_terminal.  Is there something better?

We are also inconsistent in the names passed to QObject::setObjectName. For exmaple, we have things like HistoryDockWidget, Shortcut_Manager, variable_editor, OctaveTerminal (and TerminalDockWidget!). What should these be? Does changing the name affect anything else?

No, not if object name is not seen. The "Title" is typically what is seen. In a changeset I'm creating, the object name is important because for the variable editor the object name matches exactly the Octave space variable name, so that when one tries to open the variable in the editor more than once it checks all the object names in the space to see it isn't already open.

That doesn't mean consistency isn't good, because often one does a QObject->findChild(Object *, QString name), and consistency makes memory recall easier.


I also propose to move all the GUI classes inside the octave namespace.

Any objections?

Could we wait a week on this? I'm right in the process of wrapping up some changes to the variable editor that turn it into a QMainWindow type of interface (as opposed to QTabWidget) and such a sweeping change would make a mess for patches. Also, I'm doing some restructuring to make things more in line with signals/slots and that might influence naming convention in the space.

I'm not sure about the "browser" name change. I prefer the names match what they are derived from. This is sort of how Qt is set up, e.g., here's one hierarchy of inheritance:

QAbstractButton
QPushButton
QCommandLinkButton

The reason this is a good thing to do is because the OOP philosophy is to build on previous classes (reuse), just adding a few new features at the next level. The name similarity aids in remembering what something is derived from and the member functions it would have inherited.

Dan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]