QTfrontend/gameuiconfig.cpp
changeset 2334 3cf9290a518e
parent 2276 d4d9e490d534
child 2377 f3fab2b09e0c
equal deleted inserted replaced
2333:f53a208e9637 2334:3cf9290a518e
    19 #include <QMessageBox>
    19 #include <QMessageBox>
    20 #include <QCheckBox>
    20 #include <QCheckBox>
    21 #include <QLineEdit>
    21 #include <QLineEdit>
    22 #include <QDesktopWidget>
    22 #include <QDesktopWidget>
    23 #include <QApplication>
    23 #include <QApplication>
       
    24 #include <QInputDialog>
    24 
    25 
    25 #include "gameuiconfig.h"
    26 #include "gameuiconfig.h"
    26 #include "hwform.h"
    27 #include "hwform.h"
    27 #include "pages.h"
    28 #include "pages.h"
    28 #include "hwconsts.h"
    29 #include "hwconsts.h"
    48 	Form->ui.pageOptions->CBFrontendEffects->setChecked(frontendEffects);
    49 	Form->ui.pageOptions->CBFrontendEffects->setChecked(frontendEffects);
    49 	Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
    50 	Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
    50 	Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool());
    51 	Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool());
    51 	Form->ui.pageOptions->volumeBox->setValue(value("audio/volume", 100).toUInt());
    52 	Form->ui.pageOptions->volumeBox->setValue(value("audio/volume", 100).toUInt());
    52 
    53 
    53 	Form->ui.pageOptions->editNetNick->setText(value("net/nick", QLineEdit::tr("unnamed")).toString());
    54 	QString netNick = value("net/nick", "").toString();
       
    55 	if (netNick.isEmpty())
       
    56 		netNick = QInputDialog::getText(Form,
       
    57 				QObject::tr("Nickname"),
       
    58 				QObject::tr("Please, enter your nickname"),
       
    59 				QLineEdit::Normal,
       
    60 				QDir::home().dirName());
       
    61 	
       
    62 	Form->ui.pageOptions->editNetNick->setText(netNick);
    54 
    63 
    55 	delete netHost;
    64 	delete netHost;
    56 	netHost = new QString(value("net/ip", "").toString());
    65 	netHost = new QString(value("net/ip", "").toString());
    57 	netPort = value("net/port", 46631).toUInt();
    66 	netPort = value("net/port", 46631).toUInt();
    58 
    67