tuned-switcher 1.1.0
Performance profile manager
Loading...
Searching...
No Matches
TrayIcon Class Reference

#include <trayicon.h>

Inheritance diagram for TrayIcon:
Collaboration diagram for TrayIcon:

Public Member Functions

 TrayIcon (QWidget *parent=nullptr)
 
void Show ()
 

Private Slots

void profileSelectedEvent (QAction *)
 
void profileAutoSelectedEvent (const bool)
 
void profileChangedEvent (const QString &, const bool, const QString &)
 
void serviceEnableEvent ()
 
void serviceDisableEvent ()
 
void serviceReloadEvent ()
 
void serviceShutdownEvent ()
 
void showSettingsEvent ()
 
void showAboutEvent ()
 
void exitEvent ()
 

Private Member Functions

void initializeSettings ()
 
void initializeNotifications ()
 
void initializeService ()
 
void initializeTuned ()
 
void tryToStartTuned ()
 
void checkServiceRunning ()
 
void checkTunedRunning ()
 
void serviceEnable ()
 
void serviceDisable ()
 
void serviceReload ()
 
void serviceShutdown ()
 
void setProfileExplicitly ()
 
void setTrayIcon ()
 
void resetCurrentProfile ()
 
void setCurrentProfile (const QString &)
 
void markCurrentProfile ()
 
void setAutoProfileMode (const bool)
 
void markAutoProfileMode ()
 
void markServiceMode ()
 
void setNotificationsMode ()
 
void subscribeToEvents ()
 
void exitApplication ()
 
QAction * getProfileAction (const QString &)
 
QAction * createAutoProfileAction (QWidget *)
 
QAction * createAboutAction (QWidget *)
 
QAction * createSettingsAction (QWidget *)
 
QAction * createQuitAction (QWidget *)
 
QMenu * createServiceControlSubmenu (QWidget *)
 
QMenu * createProfilesSubmenu (QWidget *)
 
QActionGroup * createProfilesMenuGroup (QWidget *)
 
QMenu * createTrayIconMenu ()
 

Private Attributes

QSystemTrayIcon * trayIcon
 
SettingsManagersettings
 
NotificationsManagernotifications
 
ServiceManagerserviceManager
 
TunedManagertunedManager
 
QActionGroup * profileActions
 
QAction * autoProfileAction
 

Detailed Description

Class for working with the Applet application.

Constructor & Destructor Documentation

◆ TrayIcon()

TrayIcon::TrayIcon ( QWidget * parent = nullptr)
explicit

Main constructor of the TrayIcon class.

Parameters
parentParent widget.

Member Function Documentation

◆ checkServiceRunning()

void TrayIcon::checkServiceRunning ( )
private

Check if the Tuned service is not running and try to start it with DBus methods.

◆ checkTunedRunning()

void TrayIcon::checkTunedRunning ( )
private

Check if the Tuned is not running and try to start it with DBus methods.

◆ createAboutAction()

QAction * TrayIcon::createAboutAction ( QWidget * parent)
private

Create a menu entry for the "Show About form" action.

Parameters
parentParent widget.
Returns
Pointer to the QAction instance.

◆ createAutoProfileAction()

QAction * TrayIcon::createAutoProfileAction ( QWidget * parent)
private

Create a menu entry for the "Auto-select profile" action.

Parameters
parentParent widget.
Returns
Pointer to the QAction instance.

◆ createProfilesMenuGroup()

QActionGroup * TrayIcon::createProfilesMenuGroup ( QWidget * parent)
private

Enumerate and add the available Tuned profiles to the Profiles submenu.

Parameters
parentParent widget.
Returns
Pointer to the QActionGroup instance.

◆ createProfilesSubmenu()

QMenu * TrayIcon::createProfilesSubmenu ( QWidget * parent)
private

Build and create a submenu with the list of available Tuned profiles.

Parameters
parentParent widget.
Returns
Pointer to the QMenu instance.

◆ createQuitAction()

QAction * TrayIcon::createQuitAction ( QWidget * parent)
private

Create a menu entry for the "Quit application" action.

Parameters
parentParent widget.
Returns
Pointer to the QAction instance.

◆ createServiceControlSubmenu()

QMenu * TrayIcon::createServiceControlSubmenu ( QWidget * parent)
private

Build and create submenu for service control functions.

Parameters
parentParent widget.
Returns
Pointer to the QMenu instance.

◆ createSettingsAction()

QAction * TrayIcon::createSettingsAction ( QWidget * parent)
private

Create a menu entry for the "Show settings" action.

Parameters
parentParent widget.
Returns
Pointer to the QAction instance.

◆ createTrayIconMenu()

QMenu * TrayIcon::createTrayIconMenu ( )
private

Build and create menu for the system tray icon.

Returns
Pointer to the QMenu instance.

◆ exitApplication()

void TrayIcon::exitApplication ( )
private

Exit the application immediately.

◆ exitEvent

void TrayIcon::exitEvent ( )
privateslot

"Exit application" menu item clicked event slot (handler).

◆ getProfileAction()

QAction * TrayIcon::getProfileAction ( const QString & profile)
private

Get the assigned Tuned profile action by name.

Parameters
profileProfile name.
Returns
Pointer to the QAction instance.

◆ initializeNotifications()

void TrayIcon::initializeNotifications ( )
private

Initialize the NotificationsManager class instance.

◆ initializeService()

void TrayIcon::initializeService ( )
private

Initialize the ServiceManager class instance.

◆ initializeSettings()

void TrayIcon::initializeSettings ( )
private

Initialize the SettingsManager class instance.

◆ initializeTuned()

void TrayIcon::initializeTuned ( )
private

Initialize the TunedManager class instance.

◆ markAutoProfileMode()

void TrayIcon::markAutoProfileMode ( )
private

Check if the automatic mode is enabled and mark the special checkbox.

◆ markCurrentProfile()

void TrayIcon::markCurrentProfile ( )
private

Get the active Tuned profile and mark it.

◆ markServiceMode()

void TrayIcon::markServiceMode ( )
private

Check whether the Tuned profile is running or not and enable or disable various form controls.

◆ profileAutoSelectedEvent

void TrayIcon::profileAutoSelectedEvent ( const bool autoMode)
privateslot

"Auto-select profile" clicked event slot (handler).

Parameters
autoMode"Auto-select profile" mode on or off.

◆ profileChangedEvent

void TrayIcon::profileChangedEvent ( const QString & profile,
const bool result,
const QString & message )
privateslot

"Tuned profile changed" DBus event slot (handler).

Parameters
profileRecently switched profile name.
resultSwitch result: true - success; false - failure.
messageResult message (OK on success).

◆ profileSelectedEvent

void TrayIcon::profileSelectedEvent ( QAction * action)
privateslot

"Tuned profile selected" event slot (handler).

Parameters
actionSystem tray menu action, caused this event.

◆ resetCurrentProfile()

void TrayIcon::resetCurrentProfile ( )
private

Reset the active Tuned profile.

◆ serviceDisable()

void TrayIcon::serviceDisable ( )
private

Disable the Tuned service with DBus methods.

◆ serviceDisableEvent

void TrayIcon::serviceDisableEvent ( )
privateslot

"Disable the service" menu item clicked event slot (handler).

◆ serviceEnable()

void TrayIcon::serviceEnable ( )
private

Enable the Tuned service with DBus methods.

◆ serviceEnableEvent

void TrayIcon::serviceEnableEvent ( )
privateslot

"Enable the service" menu item clicked event slot (handler).

◆ serviceReload()

void TrayIcon::serviceReload ( )
private

Reload the Tuned service with DBus methods.

◆ serviceReloadEvent

void TrayIcon::serviceReloadEvent ( )
privateslot

"Reload the service" menu item clicked event slot (handler).

◆ serviceShutdown()

void TrayIcon::serviceShutdown ( )
private

Shut down the Tuned service with DBus methods.

◆ serviceShutdownEvent

void TrayIcon::serviceShutdownEvent ( )
privateslot

"Shut down the service" menu item clicked event slot (handler).

◆ setAutoProfileMode()

void TrayIcon::setAutoProfileMode ( const bool autoMode)
private

Change the "Auto-select profile" mode checkbox.

Parameters
autoModeNew "Auto-select profile" mode value.

◆ setCurrentProfile()

void TrayIcon::setCurrentProfile ( const QString & profile)
private

Set the active Tuned profile.

◆ setNotificationsMode()

void TrayIcon::setNotificationsMode ( )
private

Set the notifications sound mode.

◆ setProfileExplicitly()

void TrayIcon::setProfileExplicitly ( )
private

Explicitly set the active profile if it is not selected.

◆ setTrayIcon()

void TrayIcon::setTrayIcon ( )
private

Create an instance of the QSystemTrayIcon and set its properties.

◆ Show()

void TrayIcon::Show ( )

Show the system tray icon.

◆ showAboutEvent

void TrayIcon::showAboutEvent ( )
privateslot

"Show About form" menu item clicked event slot (handler).

◆ showSettingsEvent

void TrayIcon::showSettingsEvent ( )
privateslot

"Show settings" menu item clicked event slot (handler).

◆ subscribeToEvents()

void TrayIcon::subscribeToEvents ( )
private

Subscribe to DBus events.

◆ tryToStartTuned()

void TrayIcon::tryToStartTuned ( )
private

Try to start the Tuned service if not running.

Member Data Documentation

◆ autoProfileAction

QAction* TrayIcon::autoProfileAction
private

Stores a pointer to the "Auto-select profile" menu action.

◆ notifications

NotificationsManager* TrayIcon::notifications
private

Stores pointer to the NotificationsManager class instance.

◆ profileActions

QActionGroup* TrayIcon::profileActions
private

Stores a pointer to a group of the Tuned profiles QMenu actions.

◆ serviceManager

ServiceManager* TrayIcon::serviceManager
private

Stores pointer to the ServiceManager class instance.

◆ settings

SettingsManager* TrayIcon::settings
private

Stores pointer to the SettingsManager class instance.

◆ trayIcon

QSystemTrayIcon* TrayIcon::trayIcon
private

Stores pointer to the QSystemTrayIcon class instance.

◆ tunedManager

TunedManager* TrayIcon::tunedManager
private

Stores pointer to the TunedManager class instance.


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