Skip to content

Commit 3e165f8

Browse files
committed
Patch-A
1 parent 6b2f362 commit 3e165f8

14 files changed

+656
-551
lines changed

develnext/misc/history.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Patch-A
22
------------
33
- Исправлен баг удаления поведений в редакторе, иногда они не удалялись или удалялись поведения другого компонента.
4+
- Доработано создание проектов, форм, модулей и спрайтов - добавлена валидация названий на корректность для файловой системы.
5+
- Исправлено создание проекта, когда пользователь пытался дать проекту название с пробелами в начале или в конце.
46

57
Alpha-5
68
------------

develnext/src/.forms/BundleCheckListForm.fxml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<?import java.lang.*?>
88
<?import javafx.scene.layout.*?>
99

10-
1110
<AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
1211
<children>
1312
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="600.0" spacing="15.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
@@ -22,7 +21,7 @@
2221
<Font name="Tahoma Bold" size="12.0" />
2322
</font>
2423
</Label>
25-
<Label text="Выберите нужные нужные вам пакеты расширений в проекте" textFill="#5e5e5e" />
24+
<Label text="Выберите нужные вам пакеты расширений в проекте" textFill="#5e5e5e" />
2625
</children>
2726
</VBox>
2827
</children>

develnext/src/.forms/FontPropertyEditorForm.fxml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3+
<?import javafx.scene.effect.*?>
34
<?import javafx.geometry.*?>
45
<?import javafx.scene.*?>
56
<?import javafx.scene.text.*?>
67
<?import javafx.scene.control.*?>
78
<?import java.lang.*?>
89
<?import javafx.scene.layout.*?>
910

10-
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="198.0" prefWidth="439.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
11+
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="350.0" prefWidth="439.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
1112
<children>
12-
<ComboBox id="fontCombobox" editable="true" layoutX="14.0" layoutY="31.0" prefHeight="25.0" prefWidth="214.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="122.0" />
13+
<ComboBox id="fontCombobox" layoutX="14.0" layoutY="31.0" prefHeight="25.0" prefWidth="411.0" visibleRowCount="30" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" />
1314
<Label layoutX="14.0" layoutY="14.0" prefHeight="17.0" prefWidth="214.0" text="Шрифт:" />
14-
<Label layoutX="317.0" layoutY="14.0" prefHeight="17.0" prefWidth="90.0" text="Размер:" AnchorPane.rightAnchor="16.0" />
15-
<ComboBox id="fontSizeCombobox" editable="true" layoutX="240.0" layoutY="31.0" prefHeight="25.0" prefWidth="94.0" visibleRowCount="45" AnchorPane.rightAnchor="14.0" />
15+
<Label layoutX="14.0" layoutY="68.0" prefHeight="17.0" prefWidth="150.0" text="Размер:" AnchorPane.rightAnchor="275.0" />
1616
<Separator layoutX="14.0" layoutY="56.0" prefHeight="33.0" prefWidth="319.0" AnchorPane.bottomAnchor="46.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" />
1717
<Button id="applyButton" defaultButton="true" layoutX="14.0" layoutY="152.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="90.0" text="Применить" AnchorPane.bottomAnchor="16.0" AnchorPane.leftAnchor="14.0">
1818
<cursor>
@@ -24,7 +24,7 @@
2424
<Cursor fx:constant="HAND" />
2525
</cursor>
2626
</Button>
27-
<HBox layoutX="14.0" layoutY="84.0" prefHeight="30.0" prefWidth="322.0" spacing="7.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0">
27+
<HBox layoutX="14.0" layoutY="136.0" prefHeight="30.0" prefWidth="322.0" spacing="7.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0">
2828
<children>
2929
<ToggleButton id="thinWeightButton" maxHeight="1.7976931348623157E308" mnemonicParsing="false" selected="true" text="Обычный">
3030
<toggleGroup>
@@ -48,6 +48,8 @@
4848
</ToggleButton>
4949
</children>
5050
</HBox>
51-
<Label layoutX="14.0" layoutY="67.0" prefHeight="17.0" prefWidth="214.0" text="Стиль:" />
51+
<Label id="testLabel" alignment="CENTER" layoutX="14.0" layoutY="175.0" prefHeight="103.0" prefWidth="411.0" text="Test Text" AnchorPane.bottomAnchor="72.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="175.0" />
52+
<Slider id="sizeSlider" layoutX="10.0" layoutY="93.0" majorTickUnit="10.0" minorTickCount="10" prefHeight="25.0" prefWidth="355.0" showTickLabels="true" showTickMarks="true" snapToTicks="true" value="10.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="74.0" />
53+
<TextField id="sizeField" alignment="CENTER" layoutX="351.0" layoutY="91.0" prefHeight="30.0" prefWidth="49.0" AnchorPane.rightAnchor="18.0" />
5254
</children>
5355
</AnchorPane>

develnext/src/.forms/NewProjectForm.fxml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<?import java.lang.*?>
88
<?import javafx.scene.layout.*?>
99

10-
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="632.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
10+
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="509.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
1111
<children>
1212
<Label layoutX="54.0" layoutY="14.0" prefHeight="32.0" prefWidth="533.0" text="Новый проект" AnchorPane.leftAnchor="54.0" AnchorPane.rightAnchor="13.0">
1313
<font>
@@ -16,18 +16,18 @@
1616
</Label>
1717
<ImageView id="icon" fitHeight="32.0" fitWidth="32.0" layoutX="14.0" layoutY="14.0" pickOnBounds="true" preserveRatio="true" />
1818
<Separator layoutX="14.0" layoutY="46.0" prefHeight="32.0" prefWidth="573.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="13.0" />
19-
<Label layoutX="27.0" layoutY="129.0" prefHeight="24.0" prefWidth="221.0" text="Выберите шаблон:" />
20-
<ListView id="templateList" layoutX="27.0" layoutY="153.0" prefHeight="214.0" prefWidth="548.0" AnchorPane.bottomAnchor="162.0" AnchorPane.leftAnchor="27.0" AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="153.0" />
19+
<Label layoutX="26.0" layoutY="135.0" prefHeight="24.0" prefWidth="221.0" text="Выберите шаблон:" />
20+
<ListView id="templateList" layoutX="27.0" layoutY="159.0" prefHeight="188.0" prefWidth="548.0" AnchorPane.bottomAnchor="162.0" AnchorPane.leftAnchor="27.0" AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="159.0" />
2121
<Separator layoutX="14.0" layoutY="306.0" prefHeight="32.0" prefWidth="573.0" AnchorPane.bottomAnchor="62.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="13.0" />
22-
<Button id="createButton" layoutX="22.0" layoutY="344.0" mnemonicParsing="false" prefHeight="32.0" prefWidth="111.0" text="Создать" AnchorPane.bottomAnchor="24.0">
22+
<Button id="createButton" layoutX="22.0" layoutY="344.0" mnemonicParsing="false" prefHeight="35.0" prefWidth="111.0" styleClass="icon-ok" text="Создать" AnchorPane.bottomAnchor="24.0">
2323
<font>
2424
<Font name="System Bold" size="12.0" />
2525
</font>
2626
<cursor>
2727
<Cursor fx:constant="HAND" />
2828
</cursor>
2929
</Button>
30-
<Button id="cancelButton" layoutX="145.0" layoutY="344.0" mnemonicParsing="false" prefHeight="32.0" prefWidth="111.0" text="Отмена" AnchorPane.bottomAnchor="24.0">
30+
<Button id="cancelButton" layoutX="145.0" layoutY="344.0" mnemonicParsing="false" prefHeight="35.0" prefWidth="111.0" text="Отмена" AnchorPane.bottomAnchor="24.0">
3131
<cursor>
3232
<Cursor fx:constant="HAND" />
3333
</cursor></Button>
@@ -37,7 +37,13 @@
3737
<cursor>
3838
<Cursor fx:constant="HAND" />
3939
</cursor></Button>
40-
<Label layoutX="26.0" layoutY="72.0" prefHeight="24.0" prefWidth="221.0" text="Название проекта:" />
41-
<TextField id="nameField" layoutX="26.0" layoutY="96.0" prefHeight="25.0" prefWidth="548.0" AnchorPane.leftAnchor="26.0" AnchorPane.rightAnchor="26.0" />
40+
<Label layoutX="26.0" layoutY="72.0" prefHeight="24.0" prefWidth="221.0" text="Название проекта:">
41+
<font>
42+
<Font name="System Bold" size="12.0" />
43+
</font></Label>
44+
<TextField id="nameField" layoutX="26.0" layoutY="96.0" prefHeight="25.0" prefWidth="548.0" AnchorPane.leftAnchor="26.0" AnchorPane.rightAnchor="26.0">
45+
<font>
46+
<Font size="15.0" />
47+
</font></TextField>
4248
</children>
4349
</AnchorPane>

develnext/src/.system/application.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MAIN CONFIGURATION
22

33
app.name = DevelNext
4-
app.version = 2016 alpha-5
4+
app.version = 2016 alpha-5 (patched)
55
app.hash = 2016031212
66
app.uuid =
77
app.implicitExit = 0

develnext/src/ide/IdeConfiguration.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ public function getShortName()
5959
public function save()
6060
{
6161
try {
62+
fs::ensureParent($this->fileName);
63+
6264
parent::save($this->fileName);
6365

6466
Logger::info("Save [autoSave={$this->autoSave}] '$this->fileName'");
6567
} catch (IOException $e) {
66-
Logger::warn("Unable to save $this->fileName");
68+
Logger::warn("Unable to save $this->fileName, {$e->getMessage()}");
6769
}
6870
}
6971

Lines changed: 76 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,77 @@
1-
<?php
2-
namespace ide\commands;
3-
4-
use ide\editors\AbstractEditor;
5-
use ide\forms\BuildProgressForm;
6-
use ide\forms\MessageBoxForm;
7-
use ide\Ide;
8-
use ide\misc\AbstractCommand;
9-
use ide\project\behaviours\GradleProjectBehaviour;
10-
use ide\project\behaviours\GuiFrameworkProjectBehaviour;
11-
use ide\systems\FileSystem;
12-
use php\gui\UXDialog;
13-
use php\lang\Process;
14-
use php\lib\Str;
15-
use php\time\Time;
16-
17-
class CreateFormProjectCommand extends AbstractCommand
18-
{
19-
public function getName()
20-
{
21-
return 'Новая форма';
22-
}
23-
24-
public function getIcon()
25-
{
26-
return 'icons/window16.png';
27-
}
28-
29-
public function getCategory()
30-
{
31-
return 'create';
32-
}
33-
34-
public function onExecute($e = null, AbstractEditor $editor = null)
35-
{
36-
$ide = Ide::get();
37-
$project = $ide->getOpenedProject();
38-
39-
if ($project) {
40-
/** @var GuiFrameworkProjectBehaviour $guiBehaviour */
41-
$guiBehaviour = $project->getBehaviour(GuiFrameworkProjectBehaviour::class);
42-
43-
$name = UXDialog::input('Придумайте название для формы');
44-
45-
if ($name !== null) {
46-
if ($guiBehaviour->hasForm($name)) {
47-
$dialog = new MessageBoxForm("Форма '$name' уже существует, хотите её пересоздать?", ['Нет, оставить', 'Да, пересоздать']);
48-
if ($dialog->showDialog() && $dialog->getResultIndex() == 0) {
49-
return;
50-
}
51-
}
52-
53-
$file = $guiBehaviour->createForm($name);
54-
FileSystem::open($file);
55-
56-
if (!$guiBehaviour->getMainForm() && sizeof($guiBehaviour->getFormEditors()) < 2) {
57-
$dlg = new MessageBoxForm(
58-
"У вашего проекта нет главной формы, хотите сделать форму '$name' главной?", ['Да, сделать главной', 'Нет']
59-
);
60-
61-
if ($dlg->showDialog() && $dlg->getResultIndex() == 0) {
62-
$guiBehaviour->setMainForm($name);
63-
Ide::toast("Форма '$name' теперь главная в вашем проекте");
64-
}
65-
}
66-
}
67-
}
68-
}
1+
<?php
2+
namespace ide\commands;
3+
4+
use ide\editors\AbstractEditor;
5+
use ide\forms\BuildProgressForm;
6+
use ide\forms\MessageBoxForm;
7+
use ide\Ide;
8+
use ide\misc\AbstractCommand;
9+
use ide\project\behaviours\GradleProjectBehaviour;
10+
use ide\project\behaviours\GuiFrameworkProjectBehaviour;
11+
use ide\systems\FileSystem;
12+
use ide\utils\FileUtils;
13+
use php\gui\UXDialog;
14+
use php\lang\Process;
15+
use php\lib\fs;
16+
use php\lib\Str;
17+
use php\time\Time;
18+
19+
class CreateFormProjectCommand extends AbstractCommand
20+
{
21+
public function getName()
22+
{
23+
return 'Новая форма';
24+
}
25+
26+
public function getIcon()
27+
{
28+
return 'icons/window16.png';
29+
}
30+
31+
public function getCategory()
32+
{
33+
return 'create';
34+
}
35+
36+
public function onExecute($e = null, AbstractEditor $editor = null)
37+
{
38+
$ide = Ide::get();
39+
$project = $ide->getOpenedProject();
40+
41+
if ($project) {
42+
/** @var GuiFrameworkProjectBehaviour $guiBehaviour */
43+
$guiBehaviour = $project->getBehaviour(GuiFrameworkProjectBehaviour::class);
44+
45+
$name = UXDialog::input('Придумайте название для формы');
46+
47+
if ($name !== null) {
48+
$name = str::trim($name);
49+
50+
if (!FileUtils::validate($name)) {
51+
return;
52+
}
53+
54+
if ($guiBehaviour->hasForm($name)) {
55+
$dialog = new MessageBoxForm("Форма '$name' уже существует, хотите её пересоздать?", ['Нет, оставить', 'Да, пересоздать']);
56+
if ($dialog->showDialog() && $dialog->getResultIndex() == 0) {
57+
return;
58+
}
59+
}
60+
61+
$file = $guiBehaviour->createForm($name);
62+
FileSystem::open($file);
63+
64+
if (!$guiBehaviour->getMainForm() && sizeof($guiBehaviour->getFormEditors()) < 2) {
65+
$dlg = new MessageBoxForm(
66+
"У вашего проекта нет главной формы, хотите сделать форму '$name' главной?", ['Да, сделать главной', 'Нет']
67+
);
68+
69+
if ($dlg->showDialog() && $dlg->getResultIndex() == 0) {
70+
$guiBehaviour->setMainForm($name);
71+
Ide::toast("Форма '$name' теперь главная в вашем проекте");
72+
}
73+
}
74+
}
75+
}
76+
}
6977
}

0 commit comments

Comments
 (0)