QTfrontend/gameuiconfig.cpp
changeset 8346 3443e0de2c9d
parent 8325 ecd51650d5d8
child 8350 14b938faec69
equal deleted inserted replaced
8344:3d18f7f71d65 8346:3443e0de2c9d
    50 
    50 
    51     setIniCodec("UTF-8");
    51     setIniCodec("UTF-8");
    52 
    52 
    53     connect(Form->ui.pageOptions->CBFrontendMusic, SIGNAL(toggled(bool)), Form, SLOT(Music(bool)));
    53     connect(Form->ui.pageOptions->CBFrontendMusic, SIGNAL(toggled(bool)), Form, SLOT(Music(bool)));
    54 
    54 
       
    55     for(int i = 0; i < BINDS_NUMBER; i++)
       
    56     {
       
    57         m_binds.append(BindAction());
       
    58         m_binds[i].action = cbinds[i].action;
       
    59         m_binds[i].strbind = cbinds[i].strbind;
       
    60     }
       
    61 
    55     //Form->resize(value("frontend/width", 640).toUInt(), value("frontend/height", 450).toUInt());
    62     //Form->resize(value("frontend/width", 640).toUInt(), value("frontend/height", 450).toUInt());
    56     resizeToConfigValues();
    63     resizeToConfigValues();
    57 
    64 
    58     reloadValues();
    65     reloadValues();
    59 #ifdef VIDEOREC
    66 #ifdef VIDEOREC
   132 
   139 
   133     { // load colors
   140     { // load colors
   134         QStandardItemModel * model = DataManager::instance().colorsModel();
   141         QStandardItemModel * model = DataManager::instance().colorsModel();
   135         for(int i = model->rowCount() - 1; i >= 0; --i)
   142         for(int i = model->rowCount() - 1; i >= 0; --i)
   136             model->item(i)->setData(QColor(value(QString("colors/color%1").arg(i), model->item(i)->data().value<QColor>()).value<QColor>()));
   143             model->item(i)->setData(QColor(value(QString("colors/color%1").arg(i), model->item(i)->data().value<QColor>()).value<QColor>()));
       
   144     }
       
   145 
       
   146     { // load binds
       
   147         QStandardItemModel * binds = DataManager::instance().bindsModel();
       
   148         for(int i = 0; i < BINDS_NUMBER; i++)
       
   149         {
       
   150             m_binds[i].strbind = value(QString("Binds/%1").arg(m_binds[i].action), cbinds[i].strbind).toString();
       
   151             if (m_binds[i].strbind.isEmpty() || m_binds[i].strbind == "default") m_binds[i].strbind = cbinds[i].strbind;
       
   152         }
   137     }
   153     }
   138 }
   154 }
   139 
   155 
   140 void GameUIConfig::reloadVideosValues(void)
   156 void GameUIConfig::reloadVideosValues(void)
   141 {
   157 {
   579 
   595 
   580 bool GameUIConfig::recordAudio()
   596 bool GameUIConfig::recordAudio()
   581 {
   597 {
   582     return Form->ui.pageOptions->checkRecordAudio->isChecked();
   598     return Form->ui.pageOptions->checkRecordAudio->isChecked();
   583 }
   599 }
       
   600 
       
   601 // Gets a bind for a bindID
       
   602 QString GameUIConfig::bind(int bindID)
       
   603 {
       
   604     return m_binds[bindID].strbind;
       
   605 }
       
   606 
       
   607 // Sets a bind for a bindID and saves it
       
   608 void GameUIConfig::setBind(int bindID, QString & strbind)
       
   609 {
       
   610     m_binds[bindID].strbind = strbind;
       
   611     setValue(QString("Binds/%1").arg(m_binds[bindID].action), strbind);
       
   612 }