QTfrontend/gameuiconfig.cpp
changeset 8920 caa614af152d
parent 8799 44e520374cfc
child 8924 13ac59499066
equal deleted inserted replaced
8919:67214340fa53 8920:caa614af152d
    23 #include <QCryptographicHash>
    23 #include <QCryptographicHash>
    24 #include <QStandardItemModel>
    24 #include <QStandardItemModel>
    25 #include <QNetworkProxy>
    25 #include <QNetworkProxy>
    26 #include <QNetworkProxyFactory>
    26 #include <QNetworkProxyFactory>
    27 #include <utility>
    27 #include <utility>
       
    28 #include <QVariant>
    28 
    29 
    29 #include "gameuiconfig.h"
    30 #include "gameuiconfig.h"
    30 #include "hwform.h"
    31 #include "hwform.h"
    31 #include "pageoptions.h"
    32 #include "pageoptions.h"
    32 #include "pagevideos.h"
    33 #include "pagevideos.h"
   154     Form->ui.pageOptions->leProxyPassword->setText(value("proxy/password", "").toString());
   155     Form->ui.pageOptions->leProxyPassword->setText(value("proxy/password", "").toString());
   155 
   156 
   156     { // load colors
   157     { // load colors
   157         QStandardItemModel * model = DataManager::instance().colorsModel();
   158         QStandardItemModel * model = DataManager::instance().colorsModel();
   158         for(int i = model->rowCount() - 1; i >= 0; --i)
   159         for(int i = model->rowCount() - 1; i >= 0; --i)
   159             model->item(i)->setData(value(QString("colors/color%1").arg(i), model->item(i)->data()));
   160             model->item(i)->setData(QColor(value(QString("colors/color%1").arg(i), model->item(i)->data()).toString()));
   160     }
   161     }
   161 
   162 
   162     { // load binds
   163     { // load binds
   163         for(int i = 0; i < BINDS_NUMBER; i++)
   164         for(int i = 0; i < BINDS_NUMBER; i++)
   164         {
   165         {
   317     }
   318     }
   318 
   319 
   319     { // save colors
   320     { // save colors
   320         QStandardItemModel * model = DataManager::instance().colorsModel();
   321         QStandardItemModel * model = DataManager::instance().colorsModel();
   321         for(int i = model->rowCount() - 1; i >= 0; --i)
   322         for(int i = model->rowCount() - 1; i >= 0; --i)
   322             setValue(QString("colors/color%1").arg(i), model->item(i)->data());
   323             setValue(QString("colors/color%1").arg(i), model->item(i)->data().value<QColor>().name());
   323     }
   324     }
   324 
   325 
   325     sync();
   326     sync();
   326 }
   327 }
   327 
   328