Skip to content
This repository has been archived by the owner on Mar 4, 2018. It is now read-only.
ColinDuquesnoy edited this page Dec 17, 2014 · 8 revisions

Welcome

Welcome to the OpenCobolIDE wiki!

This wiki is the main source of documentation for developers contributing to the OpenCobolIDE project. You are encouraged to come and share all kind of personal contributions: new pages, improvements to existing pages, or even simple corrections.

Project structure

This section briefly describes the project structure.

When you open the project, you will find a series of directories and files.

Directories:

  • doc: contains the sources for building the user documentation
  • forms: contains the Qt Designer ui files
  • open_cobol_ide: the source package that contains all the code of the application.
  • share: contains shared data for Linux and OS X (desktop files, icons, plist file)
  • test: contains integrations tests

The most important files are:

  • OpenCobolIDE: main script to use when running the program from source checkout
  • setup.py: setup file for installing the app on Linux and OS X
  • freeze.py: setup file for freezing the app on OS X and Windows.
  • runtests.py: run tests

Architecture

Here is a brief description of the architecture and the most important modules.

The source package, open_cobol_ide contains all the sources of the application. It is made up of two sub-packages and a series of modules.

The most important modules are:

  • main.py: this module contains the application entry point
  • app.py: this module contains the application object. This is where we create the main window and its controllers.
  • compiler.py: this module contains all the code used to interact with the GnuCobol compiler
  • settings.py: this module contains the application settings, stored in QSettings.

The logic of the application is contained in the controllers sub-package. There is one controller per perspective (home/edit) and per menu. A controller is just an object which takes a reference to the main window and connect its slots to the various signals it has to control. This architecture has been designed to move the logic out of the main window object and to separate the concerns. Controllers can talk to each other through the application object.

The view sub-package contains the gui objects of the application: the main window, the about and preferences dialogs and some custom widgets. The source code editor widgets and the splittable tab widget are coming from the pyQode project.

Note that this architecture has nothing to with the MVC pattern

Using Qt Designer

Our GUI is designed with Qt Designer. There is a .ui file for each window/dialog/widget. You can find them in the forms directory.

Those files need to be translated to python scripts before we can use them in the application. Each time you make a modification to a .ui file, you have to recompile the corresponding python script. You can do that automatically by running python3 setup.py build_ui. For that command to work, you need to install two additional development packages: pip3 install pyqt-distutils pyqode-uic