Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
MWGuy committed Nov 16, 2018
1 parent 00a1292 commit 9239660
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ide/misc/languages/ru/messages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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=По умолчанию
Expand Down
19 changes: 17 additions & 2 deletions ide/src/ide/commands/SettingsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,27 @@
namespace ide\commands;

use ide\editors\AbstractEditor;
use ide\forms\AbstractIdeForm;
use ide\forms\IdeSettingsForm;
use ide\Ide;
use ide\misc\AbstractCommand;
use ide\themes\DarkTheme;

class SettingsCommand extends AbstractCommand
{
/**
* @var AbstractIdeForm
*/
private $form;


public function __construct()
{
parent::__construct();

$this->form = new IdeSettingsForm();
}

public function getName()
{
return "common.settings";
Expand All @@ -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()
Expand Down
18 changes: 14 additions & 4 deletions ide/src/ide/forms/IdeSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
}

/**
Expand Down

0 comments on commit 9239660

Please sign in to comment.