diff --git a/ide/misc/languages/ru/messages.ini b/ide/misc/languages/ru/messages.ini index 7af3a8e..78fa73f 100644 --- a/ide/misc/languages/ru/messages.ini +++ b/ide/misc/languages/ru/messages.ini @@ -1020,7 +1020,7 @@ wizard.x.position=Позиция X wizard.y.position=Позиция Y ide.settings.ide=Настройки IDE ide.settings.ide.themes=Тема IDE: -ide.settings.extensions=Разширения +ide.settings.extensions=Расширения ide.settings.save=Сохранить ide.settings.close=Закрыть ide.settings.default=По умолчанию diff --git a/ide/src/ide/commands/SettingsCommand.php b/ide/src/ide/commands/SettingsCommand.php index 0a2d137..5a5b042 100644 --- a/ide/src/ide/commands/SettingsCommand.php +++ b/ide/src/ide/commands/SettingsCommand.php @@ -3,6 +3,7 @@ namespace ide\commands; use ide\editors\AbstractEditor; +use ide\forms\AbstractIdeForm; use ide\forms\IdeSettingsForm; use ide\Ide; use ide\misc\AbstractCommand; @@ -10,6 +11,19 @@ class SettingsCommand extends AbstractCommand { + /** + * @var AbstractIdeForm + */ + private $form; + + + public function __construct() + { + parent::__construct(); + + $this->form = new IdeSettingsForm(); + } + public function getName() { return "common.settings"; @@ -27,8 +41,9 @@ public function getCategory() public function onExecute($e = null, AbstractEditor $editor = null) { - $form = new IdeSettingsForm(); - $form->showAndWait(); + if (!$this->form->visible) + $this->form->showAndWait(); + else $this->form->toFront(); } public function isAlways() diff --git a/ide/src/ide/forms/IdeSettingsForm.php b/ide/src/ide/forms/IdeSettingsForm.php index 4346c99..ebbb797 100644 --- a/ide/src/ide/forms/IdeSettingsForm.php +++ b/ide/src/ide/forms/IdeSettingsForm.php @@ -36,6 +36,15 @@ public function __construct() parent::__construct(); $this->title = _("common.settings"); + + // l10n for buttons + _($this->save_btn); + _($this->def_btn); + _($this->close_btn); + } + + public function updateUI() { + $this->setting_tabs->tabs->clear(); $this->settings = Ide::get()->getSettingsContainer()->getAll(); foreach ($this->settings as $setting) { @@ -47,11 +56,12 @@ public function __construct() $this->setting_tabs->tabs->add($tab); } + } - // l10n for buttons - _($this->save_btn); - _($this->def_btn); - _($this->close_btn); + public function showAndWait() + { + $this->updateUI(); + parent::showAndWait(); } /**