Commit e4c98df2 authored by Denis Khachko's avatar Denis Khachko

Pults Fixes.

parent af461501
......@@ -22,6 +22,7 @@ connect(BaseB,SIGNAL(valueChanged ( int )),this,SLOT(setMax()));
connect(pushButton,SIGNAL(clicked( )),this,SLOT(addFlag()));
connect(pushButton_2,SIGNAL(clicked( )),this,SLOT(removeFlag()));
connect(listWidget,SIGNAL(itemClicked (QListWidgetItem*)),this,SLOT(enableDelete()));
translateButtons();
};
void Dialog::setMax()
{
......
......@@ -110,6 +110,14 @@ class Dialog : public QDialog, Ui::Dialog
frame_3->setEnabled(true);
qDebug()<<"frame_3->ENABLED!";
};
void translateButtons()
{
QList<QAbstractButton *>btns = buttonBox->buttons();
for(int i=0;i<btns.count();i++)
{
if(buttonBox->buttonRole(btns[i])==QDialogButtonBox::RejectRole)btns[i]->setText(trUtf8("Отмена"));
}
}
public slots:
void setMax();
void addFlag();
......
......@@ -219,13 +219,6 @@
"type": "color",
"default": "#00008C",
"title": {"ascii": "Background color (edit mode)", "ru_RU": "Цвет поля (редактирование)"}
},
"CellSize": {
"type": "int",
"default": 20,
"minimum": 10,
"maximum": 40,
"title": {"ascii": "Cell size", "ru_RU": "Размер клетки"}
}
}
}
......@@ -3344,6 +3344,8 @@ void RobotModule::createGui()
connect(m_pultWidget, SIGNAL(hasRightWall()), this, SLOT(runGoRight()));
connect(m_pultWidget, SIGNAL(goUp()), this, SLOT(runGoUp()));
connect(m_pultWidget, SIGNAL(goDown()), this, SLOT(runGoDown()));
connect(m_pultWidget, SIGNAL(goLeft()), this, SLOT(runGoLeft()));
connect(m_pultWidget, SIGNAL(goRight()), this, SLOT(runGoRight()));
connect(m_pultWidget, SIGNAL(doPaint()), this, SLOT(runDoPaint()));
connect(m_pultWidget, SIGNAL(checkWallLeft()), this, SLOT(runIsWallAtLeft()));
connect(m_pultWidget, SIGNAL(checkWallRight()), this, SLOT(runIsWallAtRight()));
......@@ -3809,14 +3811,35 @@ bool RobotModule::runIsColor()
};
bool RobotModule::runMark(const int row, const int col)
{
if(row-1>field->rows() ||col-1>field->columns())
{
setError(trUtf8("Нет какой клетки!"));
return false;
}
return field->cellAt(row-1,col-1)->mark;
};
bool RobotModule::runColored(const int row, const int col)
{
return field->cellAt(row-1,col-1)->isColored();
if(row-1>field->rows() ||col-1>field->columns())
{
setError(trUtf8("Нет какой клетки!"));
return false;
}
return field->cellAt(row-1,col-1)->isColored();
};
void RobotModule::runRobotPos(int& row, int& col)
{
if(row-1>field->rows() ||col-1>field->columns())
{
setError(trUtf8("Нет какой клетки!"));
return;
}
col=field->robotX()+1;
row=field->robotY()+1;
};
......@@ -3859,7 +3882,15 @@ bool RobotModule::runIsColor()
};
QChar RobotModule::runDownChar(const int row, const int col)
{qDebug()<<field->cellAt(row-1,col-1)->downChar;
{
if(row-1>field->rows() ||col-1>field->columns())
{
setError(trUtf8("Нет какой клетки!"));
return ' ';
}
qDebug()<<field->cellAt(row-1,col-1)->downChar;
return field->cellAt(row-1,col-1)->downChar;
};
......@@ -4043,7 +4074,8 @@ void RobotModule::loadEnv()
QDialogButtonBox *buttonBox = new QDialogButtonBox(NewWindow);
btnOK1 = buttonBox->addButton(QDialogButtonBox::Ok);
btnCancel1 = buttonBox->addButton(QDialogButtonBox::Cancel);
btnCancel1 = new QPushButton(trUtf8("Отмена"));
buttonBox->addButton(btnCancel1,QDialogButtonBox::RejectRole);
nwl->addWidget(buttonBox, 3, 0, 1, 2, Qt::AlignRight);
connect ( btnCancel1, SIGNAL(clicked()), NewWindow, SLOT(close()));
......
//
// C++ Implementation: printDialog
// C++ Implementation: VodoleyDialog
//
// Description:
//
......@@ -20,6 +20,7 @@ setupUi(this);
connect(BaseA,SIGNAL(valueChanged ( int )),this,SLOT(setMax()));
connect(BaseB,SIGNAL(valueChanged ( int )),this,SLOT(setMax()));
connect(BaseC,SIGNAL(valueChanged ( int )),this,SLOT(setMax()));
translateButtons();
setMax();
};
void Dialog::setMax()
......
......@@ -66,6 +66,14 @@ class Dialog : public QDialog, Ui::Dialog
{
};
void translateButtons()
{
QList<QAbstractButton *>btns = buttonBox->buttons();
for(int i=0;i<btns.count();i++)
{
if(buttonBox->buttonRole(btns[i])==QDialogButtonBox::RejectRole)btns[i]->setText(trUtf8("Отмена"));
}
}
public slots:
void setMax();
......
......@@ -303,10 +303,10 @@ VodoleyPult::VodoleyPult ( QWidget* parent, Qt::WindowFlags fl )
buttTemp->setText(" ");
buttTemp->loadIcon(ActorVodoley::VodoleyModule::self->myResourcesDir().absoluteFilePath("b2a.png"));
QIcon toKumirIco(ActorVodoley::VodoleyModule::self->myResourcesDir().absoluteFilePath("edit-copy.png"));
QIcon toKumirIco(ActorVodoley::VodoleyModule::self->myResourcesDir().absoluteFilePath("kumir.png"));
toKumir->setIcon(toKumirIco);
toKumir->setEnabled(true);
ClearLog->setIcon(QIcon(ActorVodoley::VodoleyModule::self->myResourcesDir().absoluteFilePath("edit-clear-list.png")));
ClearLog->setIcon(QIcon(ActorVodoley::VodoleyModule::self->myResourcesDir().absoluteFilePath("edit-delete.png")));
FillA->hide();
......
......@@ -289,6 +289,9 @@ void Vodoley::CreateVodoley(void)
Btext->setPos(145,15+(maxSize()-Bsize())*literSize);
Ctext=scene->addSimpleText("C");
Ctext->setPos(255,15+(maxSize()-Csize())*literSize);
// Amen->move(20,20);
}
......@@ -365,6 +368,7 @@ Vodoley::~Vodoley()
void Vodoley::newZ()
{
Dialog* newZdialog=new Dialog();
newZdialog->setSizes(Asize(),Bsize(),Csize());
newZdialog->setFill(Afill,Bfill,Cfill);
newZdialog->setNeed(AfillR);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment