//void MainWindow::logConnection(QString strConnDesc,bool bResult)
//{
//	QString strDebug = "Connection "+strConnDesc;
//	if (bResult)	strDebug+=" SUCCESS";	else	strDebug+=" FAIL";
//	printLog(eDebugLogLevel,eSlots,strDebug);
//	Q_ASSERT_X(bResult==true,"MainWindow::setConnections",QString("Connect %1").arg(strConnDesc).toAscii());
//}
void MainWindow::setConnections()
{
    bool bResult = false;
    m_ptrStatusBarSignalMapper = new QSignalMapper;
    m_ptrStatusBarSignalMapper->setMapping(m_actionNewConf,QString("New configuration"));
    m_ptrStatusBarSignalMapper->setMapping(m_actionOpenConf,QString("Opening configuration from file"));
    m_ptrStatusBarSignalMapper->setMapping(m_actionSaveConf,QString("Saving configuration to file"));
    m_ptrStatusBarSignalMapper->setMapping(m_actionRefreshConf,QString("Refreshing configuration"));
    bResult = connect(m_actionNewConf, SIGNAL(triggered(bool)) , m_ptrStatusBarSignalMapper, SLOT(map()));
    bResult = connect(m_actionOpenConf, SIGNAL(triggered(bool)) , m_ptrStatusBarSignalMapper, SLOT(map()));
    bResult = connect(m_actionSaveConf, SIGNAL(triggered(bool)) , m_ptrStatusBarSignalMapper, SLOT(map()));
    bResult = connect(m_actionRefreshConf, SIGNAL(triggered(bool)) , m_ptrStatusBarSignalMapper, SLOT(map()));
    bResult = connect(m_ptrStatusBarSignalMapper, SIGNAL(mapped(const QString &)), this, SLOT(onStatusBarMsgChange(const QString &)));


    bResult = connect(m_actionNewConf, SIGNAL(triggered(bool)), CDataThread::getInstance(), SLOT(onNewConf()));
    logConnection("MainWindow::setConnections","'m_actionNewConf::triggered' with 'CDataThread::onNewConf'", bResult);
    bResult = connect(m_actionRefreshConf, SIGNAL(triggered(bool)) ,this, SLOT(onRefreshConf()));
    logConnection("MainWindow::setConnections","'m_actionRefreshConf::triggered' with 'this::onRefreshConf'", bResult);
    bResult = connect(CDataThread::getInstance(), SIGNAL(refreshingFinished()), this, SLOT(onRefreshingFinished()));
    logConnection("MainWindow::setConnections","'CDataThread::getInstance::refreshingFinished' with 'this::onRefreshingFinished'", bResult);
    /////
    bResult = connect(m_actionOpenConf, SIGNAL(triggered(bool)), CDataThread::getInstance(), SLOT(onOpenConf()));
    logConnection("MainWindow::setConnections","'m_actionOpenConf::toggled' with 'CDataThread::onOpenConf'", bResult);
    bResult = connect(m_actionSaveConf, SIGNAL(triggered(bool)), CDataThread::getInstance(), SLOT(onSaveConf()));
    logConnection("MainWindow::setConnections","'m_actionSaveConf::toggled' with 'CDataThread::onSaveConf'", bResult);
    bResult = connect(m_actionSaveAsConf, SIGNAL(triggered(bool)), CDataThread::getInstance(), SLOT(onSaveAsConf()));
    logConnection("MainWindow::setConnections","'m_actionSaveAsConf::toggled' with 'CDataThread::onSaveAsConf'", bResult);
    bResult = connect(m_actionProxySettings, SIGNAL(triggered(bool)) ,this, SLOT(onProxySettings(bool)));
    logConnection("MainWindow::setConnections","'m_actionProxySettings::toggled' with 'this::onProxySettings'", bResult);
    //////////////////////////////////////////////////////////////////////////
    bResult = connect(m_ptrAddComp, SIGNAL(clicked(bool)), CDataThread::getInstance(), SLOT(onAddComp()));
    logConnection("MainWindow::setConnections","'m_ptrAddComp::clicked' with 'CDataThread::onAddComp'", bResult);
    bResult = connect(m_ptrAddShop, SIGNAL(clicked(bool)), CDataThread::getInstance(), SLOT(onAddShop()));
    logConnection("MainWindow::setConnections","'m_ptrAddShop::clicked' with 'CDataThread::onAddShop'", bResult);
    //////////////////////////////////////////////////////////////////////////
    bResult = connect(m_ptCompConfView, SIGNAL(removeShop(int)), CDataThread::getInstance(), SLOT(onRemShop(int)));
    logConnection("MainWindow::setConnections","'m_ptCompConfView::removeShop' with 'CDataThread::onRemShop'", bResult);
    //////////////////////////////////////////////////////////////////////////
    bResult = connect(m_ptCompConfView, SIGNAL(removeComponent(int)), CDataThread::getInstance(), SLOT(onRemComp(int)));
    logConnection("MainWindow::setConnections","'m_ptCompConfView::removeComponent' with 'CDataThread::onRemComp'", bResult);
    ////////////////////////////////////////////////////////////////////////////
    bResult = connect(m_ptCompConfView, SIGNAL(onOpenLink(QModelIndex)) ,
                      CDataThread::getInstance(), SLOT(onOpenLinkInExternalBrowser(QModelIndex)));
    logConnection("MainWindow::setConnections","'m_ptCompConfView::onOpenLink' with 'CDataThread::onOpenLinkInExternalBrowser'", bResult);
    ////////////////////////////////////////////////////////////////////////////
    bResult = connect(m_ptCompConfView, SIGNAL(onOpenSearchPage(QModelIndex)), CDataThread::getInstance(), SLOT(onOpenSearchInExternalBrowser(QModelIndex)));
    logConnection("MainWindow::setConnections","'m_ptCompConfView::onOpenSearchPage' with 'CDataThread::onOpenSerachInExternalBrowser'", bResult);
    ////////////////////////////////////////////////////////////////////////////
    bResult = connect(m_ptCompConfView, SIGNAL(resetFieldCache(QModelIndex)) ,
                      CDataThread::getInstance(), SLOT(onResetFieldCache(QModelIndex)));
    logConnection("MainWindow::setConnections","'m_ptCompConfView::onOpenSearchPage' with 'CDataThread::onOpenSerachInExternalBrowser'", bResult);
    ////////////////////////////////////////////////////////////////////////////
    bResult = connect(CDataThread::getInstance(), SIGNAL(onStatusBarMsg(const QString & )) ,
                      this , SLOT(onStatusBarMsgChange(const QString &)));
    logConnection("MainWindow::setConnections","'CDataThread::getInstance()::onStatusBarMsg' with 'this::onStatusBarMsgChange'", bResult);
    ////////////////////////////////////////////////////////////////////////////
    bResult = connect(CDataThread::getInstance(), SIGNAL(updateRecentFilesAction(const QStringList &)), this , SLOT(onUpdateRecentFileActions(const QStringList &)));
    logConnection("MainWindow::setConnections","'CDataThread::getInstance()::updateRecentFilesAction' with 'this::onUpdateRecentFileActions'", bResult);
}
Exemple #2
0
ConfirmBotGameBox::ConfirmBotGameBox(UserData *bot, const QString &url) : ConfirmBox(lng_allow_bot_pass(lt_bot_name, bot->name), lang(lng_allow_bot))
    , _bot(bot)
    , _url(url) {
    connect(this, SIGNAL(confirmed()), this, SLOT(onOpenLink()));
}
Exemple #3
0
ConfirmLinkBox::ConfirmLinkBox(const QString &url) : ConfirmBox(lang(lng_open_this_link) + qsl("\n\n") + url, lang(lng_open_link))
    , _url(url) {
    connect(this, SIGNAL(confirmed()), this, SLOT(onOpenLink()));
}