AntiMicroX
Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes
MainWindow Class Reference

#include <mainwindow.h>

Inheritance diagram for MainWindow:
[legend]
Collaboration diagram for MainWindow:
[legend]

Public Slots

void checkEachTenMinutesBattery (QMap< SDL_JoystickID, InputDevice * > *joysticks)
 
void fillButtons ()
 
void makeJoystickTabs ()
 
void alterConfigFromSettings ()
 
void fillButtonsID (InputDevice *joystick)
 
void fillButtonsMap (QMap< SDL_JoystickID, InputDevice * > *joysticks)
 
void startJoystickRefresh ()
 
void hideWindow ()
 
void saveAppConfig ()
 
void loadAppConfig (bool forceRefresh=false)
 
void removeJoyTabs ()
 
void quitProgram ()
 
void changeWindowStatus ()
 
void refreshTabHelperThreads ()
 
void testMappingUpdateNow (int index, InputDevice *device)
 
void removeJoyTab (SDL_JoystickID deviceID)
 
void addJoyTab (InputDevice *device)
 
void selectControllerJoyTab (QString GUID)
 Select appropriate tab that has a device with the specified GUID. More...
 
void handleInstanceDisconnect ()
 

Signals

void joystickRefreshRequested ()
 
void readConfig (int index)
 
void mappingUpdated (QString mapping, InputDevice *device)
 

Public Member Functions

 MainWindow (QMap< SDL_JoystickID, InputDevice * > *joysticks, CommandLineUtility *cmdutility, AntiMicroSettings *settings, bool graphical=true, QWidget *parent=nullptr)
 
 ~MainWindow ()
 
bool getGraphicalStatus ()
 
void setTranslator (QTranslator *translator)
 
QTranslator * getTranslator () const
 
void setAppTranslator (QTranslator *translator)
 
QTranslator * getAppTranslator () const
 
const QMap< int, QList< QAction * > > & getProfileActions ()
 
bool isKeypadUnlocked ()
 

Protected Member Functions

virtual void showEvent (QShowEvent *event)
 
virtual void changeEvent (QEvent *event)
 
virtual void closeEvent (QCloseEvent *event)
 Check if the program should really quit or if it should be minimized. More...
 
bool eventFilter (QObject *obj, QEvent *event) override
 
void retranslateUi ()
 
void loadConfigFile (QString fileLocation, int joystickIndex=0)
 
void loadConfigFile (QString fileLocation, QString controllerID)
 
void unloadCurrentConfig (int joystickIndex=0)
 
void unloadCurrentConfig (QString controllerID)
 
void changeStartSetNumber (int startSetNumber, QString controllerID)
 
void changeStartSetNumber (int startSetNumber, int joystickIndex=0)
 
void convertGUIDtoUniqueID (InputDevice *currentDevice, QString controlEntryLastSelectedGUID)
 

Private Slots

void refreshTrayIconMenu ()
 
void trayIconClickAction (QSystemTrayIcon::ActivationReason reason)
 
void mainMenuChange (QMenu *tempMenu)
 
void disableFlashActions ()
 
void enableFlashActions ()
 
void joystickTrayShow (QMenu *tempmenu)
 
void singleTrayProfileMenuShow ()
 Display a version of the tray menu that shows all recent profiles for all controllers in one list. More...
 
void profileTrayActionTriggered (QAction *action, bool checked)
 
void populateTrayIcon ()
 
void openAboutDialog ()
 
void openJoystickStatusWindow ()
 
void openKeyCheckerDialog ()
 
void openGitHubPage ()
 
void openIssuesPage ()
 
void openWikiPage ()
 
void openCalibration ()
 
void propogateNameDisplayStatus (JoyTabWidget *tabwidget, bool displayNames)
 
void changeLanguage (QString language)
 Change language used by the application. More...
 
void openMainSettingsDialog ()
 Build list of current input devices and pass it to settings dialog instance. Open Settings dialog. More...
 
void showStickAssignmentDialog ()
 Show abstracted controller dialog for use in SDL 1.2. No longer used for versions of the program running SDL 2. In SDL 2, the Game Controller API is being used instead. More...
 
void checkHideEmptyOption ()
 
void propogateMappingUpdate (QString mapping, InputDevice *device)
 
void autoprofileLoad (AutoProfileInfo *info)
 
void checkAutoProfileWatcherTimer ()
 
void updateMenuOptions ()
 TODO: Check if method is save to remove. More...
 

Private Member Functions

void showBatteryLevel (SDL_JoystickPowerLevel powerLevSDL, QString batteryLev, QString percent, InputDevice *device)
 Check state of batteries in controllers and notify user (only when powerLevSDL matches current battery level) More...
 

Private Attributes

Ui::MainWindow * ui
 
QMap< SDL_JoystickID, InputDevice * > * m_joysticks
 
QMap< int, QList< QAction * > > profileActions
 
QSystemTrayIcon * trayIcon
 
QMenu * trayIconMenu
 
AboutDialogaboutDialog
 
CommandLineUtilitym_cmdutility
 
AntiMicroSettingsm_settings
 
QTranslator * m_translator
 
QTranslator * m_appTranslator
 
AutoProfileWatcherappWatcher
 
QAction * hideAction
 
QAction * restoreAction
 
QAction * closeAction
 
QAction * updateJoy
 
bool signalDisconnect
 
bool showTrayIcon
 
bool m_graphical
 

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QMap< SDL_JoystickID, InputDevice * > *  joysticks,
CommandLineUtility cmdutility,
AntiMicroSettings settings,
bool  graphical = true,
QWidget *  parent = nullptr 
)
Here is the call graph for this function:

◆ ~MainWindow()

MainWindow::~MainWindow ( )

Member Function Documentation

◆ addJoyTab

void MainWindow::addJoyTab ( InputDevice device)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ alterConfigFromSettings

void MainWindow::alterConfigFromSettings ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autoprofileLoad

void MainWindow::autoprofileLoad ( AutoProfileInfo info)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeEvent()

void MainWindow::changeEvent ( QEvent *  event)
protectedvirtual
Here is the call graph for this function:

◆ changeLanguage

void MainWindow::changeLanguage ( QString  language)
privateslot

Change language used by the application.

Parameters
Languagecode
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeStartSetNumber() [1/2]

void MainWindow::changeStartSetNumber ( int  startSetNumber,
int  joystickIndex = 0 
)
protected
Here is the call graph for this function:

◆ changeStartSetNumber() [2/2]

void MainWindow::changeStartSetNumber ( int  startSetNumber,
QString  controllerID 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeWindowStatus

void MainWindow::changeWindowStatus ( )
slot
Here is the call graph for this function:

◆ checkAutoProfileWatcherTimer

void MainWindow::checkAutoProfileWatcherTimer ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkEachTenMinutesBattery

void MainWindow::checkEachTenMinutesBattery ( QMap< SDL_JoystickID, InputDevice * > *  joysticks)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkHideEmptyOption

void MainWindow::checkHideEmptyOption ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ closeEvent()

void MainWindow::closeEvent ( QCloseEvent *  event)
protectedvirtual

Check if the program should really quit or if it should be minimized.

Parameters
QCloseEvent
Here is the call graph for this function:

◆ convertGUIDtoUniqueID()

void MainWindow::convertGUIDtoUniqueID ( InputDevice currentDevice,
QString  controlEntryLastSelectedGUID 
)
protected
Here is the call graph for this function:

◆ disableFlashActions

void MainWindow::disableFlashActions ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enableFlashActions

void MainWindow::enableFlashActions ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eventFilter()

bool MainWindow::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

◆ fillButtons

void MainWindow::fillButtons ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fillButtonsID

void MainWindow::fillButtonsID ( InputDevice joystick)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fillButtonsMap

void MainWindow::fillButtonsMap ( QMap< SDL_JoystickID, InputDevice * > *  joysticks)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAppTranslator()

QTranslator * MainWindow::getAppTranslator ( ) const

◆ getGraphicalStatus()

bool MainWindow::getGraphicalStatus ( )
Here is the caller graph for this function:

◆ getProfileActions()

const QMap< int, QList< QAction * > > & MainWindow::getProfileActions ( )
Here is the caller graph for this function:

◆ getTranslator()

QTranslator * MainWindow::getTranslator ( ) const

◆ handleInstanceDisconnect

void MainWindow::handleInstanceDisconnect ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hideWindow

void MainWindow::hideWindow ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isKeypadUnlocked()

bool MainWindow::isKeypadUnlocked ( )

◆ joystickRefreshRequested

void MainWindow::joystickRefreshRequested ( )
signal
Here is the caller graph for this function:

◆ joystickTrayShow

void MainWindow::joystickTrayShow ( QMenu *  tempmenu)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadAppConfig

void MainWindow::loadAppConfig ( bool  forceRefresh = false)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadConfigFile() [1/2]

void MainWindow::loadConfigFile ( QString  fileLocation,
int  joystickIndex = 0 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadConfigFile() [2/2]

void MainWindow::loadConfigFile ( QString  fileLocation,
QString  controllerID 
)
protected
Here is the call graph for this function:

◆ mainMenuChange

void MainWindow::mainMenuChange ( QMenu *  tempMenu)
privateslot

◆ makeJoystickTabs

void MainWindow::makeJoystickTabs ( )
slot
Here is the call graph for this function:

◆ mappingUpdated

void MainWindow::mappingUpdated ( QString  mapping,
InputDevice device 
)
signal
Here is the caller graph for this function:

◆ openAboutDialog

void MainWindow::openAboutDialog ( )
privateslot

◆ openCalibration

void MainWindow::openCalibration ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openGitHubPage

void MainWindow::openGitHubPage ( )
privateslot
Here is the caller graph for this function:

◆ openIssuesPage

void MainWindow::openIssuesPage ( )
privateslot
Here is the caller graph for this function:

◆ openJoystickStatusWindow

void MainWindow::openJoystickStatusWindow ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openKeyCheckerDialog

void MainWindow::openKeyCheckerDialog ( )
privateslot
Here is the caller graph for this function:

◆ openMainSettingsDialog

void MainWindow::openMainSettingsDialog ( )
privateslot

Build list of current input devices and pass it to settings dialog instance. Open Settings dialog.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openWikiPage

void MainWindow::openWikiPage ( )
privateslot
Here is the caller graph for this function:

◆ populateTrayIcon

void MainWindow::populateTrayIcon ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ profileTrayActionTriggered

void MainWindow::profileTrayActionTriggered ( QAction *  action,
bool  checked 
)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ propogateMappingUpdate

void MainWindow::propogateMappingUpdate ( QString  mapping,
InputDevice device 
)
privateslot
Here is the caller graph for this function:

◆ propogateNameDisplayStatus

void MainWindow::propogateNameDisplayStatus ( JoyTabWidget tabwidget,
bool  displayNames 
)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ quitProgram

void MainWindow::quitProgram ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readConfig

void MainWindow::readConfig ( int  index)
signal

◆ refreshTabHelperThreads

void MainWindow::refreshTabHelperThreads ( )
slot
Here is the call graph for this function:

◆ refreshTrayIconMenu

void MainWindow::refreshTrayIconMenu ( )
privateslot
Here is the caller graph for this function:

◆ removeJoyTab

void MainWindow::removeJoyTab ( SDL_JoystickID  deviceID)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeJoyTabs

void MainWindow::removeJoyTabs ( )
slot
Here is the caller graph for this function:

◆ retranslateUi()

void MainWindow::retranslateUi ( )
protected
Here is the caller graph for this function:

◆ saveAppConfig

void MainWindow::saveAppConfig ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectControllerJoyTab

void MainWindow::selectControllerJoyTab ( QString  GUID)
slot

Select appropriate tab that has a device with the specified GUID.

Parameters
GUIDof joystick device.
Here is the call graph for this function:

◆ setAppTranslator()

void MainWindow::setAppTranslator ( QTranslator *  translator)
Here is the caller graph for this function:

◆ setTranslator()

void MainWindow::setTranslator ( QTranslator *  translator)
Here is the caller graph for this function:

◆ showBatteryLevel()

void MainWindow::showBatteryLevel ( SDL_JoystickPowerLevel  powerLevSDL,
QString  batteryLev,
QString  percent,
InputDevice device 
)
private

Check state of batteries in controllers and notify user (only when powerLevSDL matches current battery level)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showEvent()

void MainWindow::showEvent ( QShowEvent *  event)
protectedvirtual
Here is the call graph for this function:

◆ showStickAssignmentDialog

void MainWindow::showStickAssignmentDialog ( )
privateslot

Show abstracted controller dialog for use in SDL 1.2. No longer used for versions of the program running SDL 2. In SDL 2, the Game Controller API is being used instead.

Here is the call graph for this function:

◆ singleTrayProfileMenuShow

void MainWindow::singleTrayProfileMenuShow ( )
privateslot

Display a version of the tray menu that shows all recent profiles for all controllers in one list.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startJoystickRefresh

void MainWindow::startJoystickRefresh ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ testMappingUpdateNow

void MainWindow::testMappingUpdateNow ( int  index,
InputDevice device 
)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ trayIconClickAction

void MainWindow::trayIconClickAction ( QSystemTrayIcon::ActivationReason  reason)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unloadCurrentConfig() [1/2]

void MainWindow::unloadCurrentConfig ( int  joystickIndex = 0)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unloadCurrentConfig() [2/2]

void MainWindow::unloadCurrentConfig ( QString  controllerID)
protected
Here is the call graph for this function:

◆ updateMenuOptions

void MainWindow::updateMenuOptions ( )
privateslot

TODO: Check if method is save to remove.

Here is the call graph for this function:

Field Documentation

◆ aboutDialog

AboutDialog* MainWindow::aboutDialog
private

◆ appWatcher

AutoProfileWatcher* MainWindow::appWatcher
private

◆ closeAction

QAction* MainWindow::closeAction
private

◆ hideAction

QAction* MainWindow::hideAction
private

◆ m_appTranslator

QTranslator* MainWindow::m_appTranslator
private

◆ m_cmdutility

CommandLineUtility* MainWindow::m_cmdutility
private

◆ m_graphical

bool MainWindow::m_graphical
private

◆ m_joysticks

QMap<SDL_JoystickID, InputDevice *>* MainWindow::m_joysticks
private

◆ m_settings

AntiMicroSettings* MainWindow::m_settings
private

◆ m_translator

QTranslator* MainWindow::m_translator
private

◆ profileActions

QMap<int, QList<QAction *> > MainWindow::profileActions
private

◆ restoreAction

QAction* MainWindow::restoreAction
private

◆ showTrayIcon

bool MainWindow::showTrayIcon
private

◆ signalDisconnect

bool MainWindow::signalDisconnect
private

◆ trayIcon

QSystemTrayIcon* MainWindow::trayIcon
private

◆ trayIconMenu

QMenu* MainWindow::trayIconMenu
private

◆ ui

Ui::MainWindow* MainWindow::ui
private

◆ updateJoy

QAction* MainWindow::updateJoy
private

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