Application::~Application() { // NOTE: It is necessary to cleanup to make sure all shells are destroyed. Queue.clear(); // hShell = {}; // NOTE: All shells must have been released. YAssert(!hShell, "Active shell found."); if(ApplicationExit) ApplicationExit(); }
NotificationIcon::NotificationIcon() { currentState = STARTING; consumptionTraffic = 0; alertWasShowed = false; p_settingsData = new ApplicationSettings(); p_settingsData ->restoreSaved(); p_settingsDialog = new FullSettingsDialog(); QObject::connect(p_settingsDialog, SIGNAL(new_settings()), this, SIGNAL(new_settings())); QAction *showSettings = new QAction("Settings", this); QAction *showAuthors = new QAction("About" , this); QAction *appExit = new QAction("Exit" , this); p_trayMenu = new QMenu(); p_trayMenu ->addAction(showSettings); p_trayMenu ->addAction(showAuthors); p_trayMenu ->addAction(appExit); QObject::connect(showSettings, SIGNAL(triggered()), this, SLOT(SettingsDialog())); QObject::connect(showAuthors , SIGNAL(triggered()), this, SLOT(about_dialog()) ); QObject::connect(appExit , SIGNAL(triggered()), this, SLOT(ApplicationExit())); p_iconImage = new QPixmap; p_iconImage->load(AttentionPath); p_toolTipText = new QString("Starting..."); p_trayIcon = new QSystemTrayIcon(this); p_trayIcon->setContextMenu(p_trayMenu); p_trayIcon->setIcon( *p_iconImage ); p_trayIcon->setToolTip( *p_toolTipText ); p_trayIcon->show(); }