libyui
 
Loading...
Searching...
No Matches
YUILoader Class Reference

#include <YUILoader.h>

Static Public Member Functions

static void loadUI (bool withThreads=false)
 
static void deleteUI ()
 
static void loadRestAPIPlugin (const std::string &wantedGUI, bool withThreads=false)
 
static void loadPlugin (const std::string &name, bool withThreads=false)
 
static bool pluginExists (const std::string &pluginBaseName)
 
static void loadExternalWidgets (const std::string &name, const std::string &symbol="_Z21createExternalWidgetsPKc")
 

Detailed Description

Class to load one of the concrete UI plug-ins: Qt, NCurses, Gtk; or one of the corresponding REST APIs used for automated testing.

Member Function Documentation

◆ deleteUI()

void YUILoader::deleteUI ( )
static

This will make sure the UI singleton is deleted. If the UI is already destroyed, it will do nothing. If there still is a UI object, it will be deleted.

This is particularly important for the NCurses UI so that the terminal settings are properly restored.

◆ loadExternalWidgets()

void YUILoader::loadExternalWidgets ( const std::string & name,
const std::string & symbol = "_Z21createExternalWidgetsPKc" )
static

Load the given External Widgets plugin followed by its graphical extension implementation in the following order in the same way as loadUI:

  • Qt, Gtk or NCurses

'name' is the user defined plugin name, graphical extension implementations have to be called 'name'-qt, 'name'-gtk and 'name'-ncurses. Following this rule plugin file names are as libyui-XX-YY.so.VER where: XX is the user defined name YY is the UI used (ncurses, gtk, qt) VER is the libyui so version 'symbol' is the function symbol to be loaded, e.g. YExternalWidgets* 'symbol'(void) (e.g. default YExternalWidgets* createExternalWidgets(const char *) see createEWFunction_t definition)

◆ loadPlugin()

void YUILoader::loadPlugin ( const std::string & name,
bool withThreads = false )
static

Load a UI plug-in. 'name' is one of the YUIPlugin_ -defines above.

This might throw exceptions.

◆ loadRestAPIPlugin()

void YUILoader::loadRestAPIPlugin ( const std::string & wantedGUI,
bool withThreads = false )
static

Method handles loading integration test framework and load underlying GUI using hints from loadUI.

◆ loadUI()

void YUILoader::loadUI ( bool withThreads = false)
static

Load any of the available UI-plugins by this order and criteria:

  • Qt:
    • if $DISPLAY is set
    • NCurses is user-selected and stdout is not a TTY
  • Gtk:
    • if $DISPLAY is set and Qt is not available,
    • a GTK-based desktop environment is detected from the environment variable XDG_CURRENT_DESKTOP
    • any of the above pre-conditions are met and NCurses is user-selected, but stdout is not a TTY
  • NCurses:
    • if $DISPLAY is not set and stdout is a TTY
    • Qt and Gtk are not available and stdout is a TTY

This can be overridden by either:

  • specifing one of the switches on the command-line of the program
    • '–gtk',
    • '–ncurses', or
    • '–qt'
  • setting the environment variable YUI_PREFERED_BACKEND to one of
    • 'gtk',
    • 'ncurses', or
    • 'qt'

If a command-line switch is given to the program, the setting from the environment variable will be overridden by the UI-plugin chosen with the switch.

If the user-selected UI-plugin is not installed on the system, an installed UI-plugin will be chosen by the above criteria.

◆ pluginExists()

bool YUILoader::pluginExists ( const std::string & pluginBaseName)
static

Check if a plug-in exists.


The documentation for this class was generated from the following files: