/** * @brief Login::process_state * Calls the right function according to the state. * @date * Created: Filipe, 7 Mar 2014 * Modified: Filipe, 7 Mar 2014 */ void Login::process_state() { if(state == persistent) { request_persistent(); } else if(state == rsa) { request_rsa(); } else if(state == login) { request_login(); } else if(state == cookies) { request_cookies(); } else if(state == profile) { request_profile(); } else if(state == complete) { login_complete(); } }
TrayIcon::TrayIcon(MainWindow* parent) : QObject(parent) , MainWindow_(parent) , Icon_(new QSystemTrayIcon(this)) , Menu_(new ContextMenu(0)) , MessageAlert_(new RecentMessagesAlert(new Logic::RecentItemDelegate(this))) , Base_(new QIcon(":/resources/main_window/appicon.ico")) , Unreads_(new QIcon(":/resources/main_window/appicon_unread.ico")) #ifdef _WIN32 , TrayBase_(new QIcon(":/resources/main_window/appicon_tray.ico")) , TrayUnreads_(new QIcon(":/resources/main_window/appicon_tray_unread.ico")) #else , TrayBase_(new QIcon(":/resources/main_window/appicon.ico")) , TrayUnreads_(new QIcon(":/resources/main_window/appicon_unread.ico")) #endif //_WIN32 , TaskBarOverlay_(new QPixmap(":/resources/main_window/appicon_overlay.png")) , HaveUnreads_(false) #ifdef _WIN32 , ptbl(0) #endif //_WIN32 { #ifdef _WIN32 if (QSysInfo().windowsVersion() >= QSysInfo::WV_WINDOWS7) { HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ptbl)); if (FAILED(hr)) ptbl = 0; } #endif //_WIN32 init(); connect(Ui::GetDispatcher(), SIGNAL(login_complete()), this, SLOT(loggedIn()), Qt::QueuedConnection); connect(MessageAlert_, SIGNAL(messageClicked(QString)), this, SLOT(messageClicked(QString)), Qt::QueuedConnection); connect(Logic::GetContactListModel(), SIGNAL(selectedContactChanged(QString)), this, SLOT(clearNotifications(QString)), Qt::QueuedConnection); connect(Logic::GetContactListModel(), SIGNAL(contactChanged(QString)), this, SLOT(updateIcon()), Qt::QueuedConnection); connect(Ui::GetDispatcher(), SIGNAL(myInfo()), this, SLOT(myInfo())); connect(Ui::GetDispatcher(), SIGNAL(needLogin()), this, SLOT(loggedOut()), Qt::QueuedConnection); }