mirror of https://github.com/buggins/dlangide.git
Combobox to select project configuration
This commit is contained in:
parent
ed758dcdd8
commit
b9b1b0e10b
|
@ -16,6 +16,7 @@ enum IDEActions : int {
|
||||||
FileClose,
|
FileClose,
|
||||||
FileExit,
|
FileExit,
|
||||||
EditPreferences,
|
EditPreferences,
|
||||||
|
ProjectConfigurations,
|
||||||
BuildConfigurations,
|
BuildConfigurations,
|
||||||
BuildWorkspace,
|
BuildWorkspace,
|
||||||
RebuildWorkspace,
|
RebuildWorkspace,
|
||||||
|
@ -68,6 +69,7 @@ const Action ACTION_FILE_EXIT = new Action(IDEActions.FileExit, "MENU_FILE_EXIT"
|
||||||
const Action ACTION_WORKSPACE_BUILD = new Action(IDEActions.BuildWorkspace, "MENU_BUILD_WORKSPACE_BUILD"c);
|
const Action ACTION_WORKSPACE_BUILD = new Action(IDEActions.BuildWorkspace, "MENU_BUILD_WORKSPACE_BUILD"c);
|
||||||
const Action ACTION_WORKSPACE_REBUILD = new Action(IDEActions.RebuildWorkspace, "MENU_BUILD_WORKSPACE_REBUILD"c);
|
const Action ACTION_WORKSPACE_REBUILD = new Action(IDEActions.RebuildWorkspace, "MENU_BUILD_WORKSPACE_REBUILD"c);
|
||||||
const Action ACTION_WORKSPACE_CLEAN = new Action(IDEActions.CleanWorkspace, "MENU_BUILD_WORKSPACE_CLEAN"c);
|
const Action ACTION_WORKSPACE_CLEAN = new Action(IDEActions.CleanWorkspace, "MENU_BUILD_WORKSPACE_CLEAN"c);
|
||||||
|
const Action ACTION_PROJECT_CONFIGURATIONS = new Action(IDEActions.ProjectConfigurations, "MENU_PROJECT_CONFIGURATIONS"c);
|
||||||
const Action ACTION_BUILD_CONFIGURATIONS = new Action(IDEActions.BuildConfigurations, "MENU_BUILD_CONFIGURATIONS"c);
|
const Action ACTION_BUILD_CONFIGURATIONS = new Action(IDEActions.BuildConfigurations, "MENU_BUILD_CONFIGURATIONS"c);
|
||||||
const Action ACTION_PROJECT_BUILD = new Action(IDEActions.BuildProject, "MENU_BUILD_PROJECT_BUILD"c, "run-build", KeyCode.F7, 0);
|
const Action ACTION_PROJECT_BUILD = new Action(IDEActions.BuildProject, "MENU_BUILD_PROJECT_BUILD"c, "run-build", KeyCode.F7, 0);
|
||||||
const Action ACTION_PROJECT_REBUILD = new Action(IDEActions.RebuildProject, "MENU_BUILD_PROJECT_REBUILD"c, "run-build-clean", KeyCode.F7, KeyFlag.Control);
|
const Action ACTION_PROJECT_REBUILD = new Action(IDEActions.RebuildProject, "MENU_BUILD_PROJECT_REBUILD"c, "run-build-clean", KeyCode.F7, KeyFlag.Control);
|
||||||
|
|
|
@ -434,6 +434,17 @@ class IDEFrame : AppFrame {
|
||||||
tb.addButtons(ACTION_FILE_OPEN, ACTION_FILE_SAVE, ACTION_SEPARATOR);
|
tb.addButtons(ACTION_FILE_OPEN, ACTION_FILE_SAVE, ACTION_SEPARATOR);
|
||||||
|
|
||||||
tb.addButtons(ACTION_DEBUG_START);
|
tb.addButtons(ACTION_DEBUG_START);
|
||||||
|
|
||||||
|
ToolBarComboBox cbProjectConfiguration = new ToolBarComboBox("projectConfig", [DEFAULT_PROJECT_CONFIGURATION]);
|
||||||
|
cbProjectConfiguration.onItemClickListener = delegate(Widget source, int index) {
|
||||||
|
if (currentWorkspace) {
|
||||||
|
currentWorkspace.projectConfiguration = cbProjectConfiguration.text;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
cbProjectConfiguration.action = ACTION_PROJECT_CONFIGURATIONS;
|
||||||
|
tb.addControl(cbProjectConfiguration);
|
||||||
|
|
||||||
ToolBarComboBox cbBuildConfiguration = new ToolBarComboBox("buildConfig", ["Debug"d, "Release"d, "Unittest"d]);
|
ToolBarComboBox cbBuildConfiguration = new ToolBarComboBox("buildConfig", ["Debug"d, "Release"d, "Unittest"d]);
|
||||||
cbBuildConfiguration.onItemClickListener = delegate(Widget source, int index) {
|
cbBuildConfiguration.onItemClickListener = delegate(Widget source, int index) {
|
||||||
if (currentWorkspace && index < 3) {
|
if (currentWorkspace && index < 3) {
|
||||||
|
|
|
@ -35,6 +35,7 @@ class WorkspaceException : Exception
|
||||||
}
|
}
|
||||||
|
|
||||||
immutable string WORKSPACE_EXTENSION = ".dlangidews";
|
immutable string WORKSPACE_EXTENSION = ".dlangidews";
|
||||||
|
immutable dstring DEFAULT_PROJECT_CONFIGURATION = "default"d;
|
||||||
|
|
||||||
/// return true if filename matches rules for workspace file names
|
/// return true if filename matches rules for workspace file names
|
||||||
bool isWorkspaceFile(string filename) {
|
bool isWorkspaceFile(string filename) {
|
||||||
|
@ -46,6 +47,7 @@ class Workspace : WorkspaceItem {
|
||||||
protected Project[] _projects;
|
protected Project[] _projects;
|
||||||
|
|
||||||
protected BuildConfiguration _buildConfiguration;
|
protected BuildConfiguration _buildConfiguration;
|
||||||
|
protected dstring _projectConfiguration = DEFAULT_PROJECT_CONFIGURATION;
|
||||||
|
|
||||||
this(string fname = null) {
|
this(string fname = null) {
|
||||||
super(fname);
|
super(fname);
|
||||||
|
@ -58,6 +60,9 @@ class Workspace : WorkspaceItem {
|
||||||
@property BuildConfiguration buildConfiguration() { return _buildConfiguration; }
|
@property BuildConfiguration buildConfiguration() { return _buildConfiguration; }
|
||||||
@property void buildConfiguration(BuildConfiguration config) { _buildConfiguration = config; }
|
@property void buildConfiguration(BuildConfiguration config) { _buildConfiguration = config; }
|
||||||
|
|
||||||
|
@property dstring projectConfiguration() { return _projectConfiguration; }
|
||||||
|
@property void projectConfiguration(dstring config) { _projectConfiguration = config; }
|
||||||
|
|
||||||
protected Project _startupProject;
|
protected Project _startupProject;
|
||||||
|
|
||||||
@property Project startupProject() { return _startupProject; }
|
@property Project startupProject() { return _startupProject; }
|
||||||
|
|
|
@ -32,6 +32,7 @@ MENU_BUILD_PROJECT_BUILD=Build Project
|
||||||
MENU_BUILD_PROJECT_REBUILD=Rebuild Project
|
MENU_BUILD_PROJECT_REBUILD=Rebuild Project
|
||||||
MENU_BUILD_PROJECT_CLEAN=Clean Project
|
MENU_BUILD_PROJECT_CLEAN=Clean Project
|
||||||
MENU_PROJECT=&PROJECT
|
MENU_PROJECT=&PROJECT
|
||||||
|
MENU_PROJECT_CONFIGURATIONS=Project configurations
|
||||||
MENU_PROJECT_SET_AS_STARTUP=Set as Startup Project
|
MENU_PROJECT_SET_AS_STARTUP=Set as Startup Project
|
||||||
MENU_PROJECT_SETTINGS=Project Settings
|
MENU_PROJECT_SETTINGS=Project Settings
|
||||||
MENU_PROJECT_REFRESH=Refresh Workspace Items
|
MENU_PROJECT_REFRESH=Refresh Workspace Items
|
||||||
|
|
|
@ -11,6 +11,7 @@ MENU_EDIT_CUT=Вырезать
|
||||||
MENU_EDIT_UNDO=&Отмена
|
MENU_EDIT_UNDO=&Отмена
|
||||||
MENU_EDIT_REDO=&Повторить
|
MENU_EDIT_REDO=&Повторить
|
||||||
MENU_EDIT_PREFERENCES=&Настройки
|
MENU_EDIT_PREFERENCES=&Настройки
|
||||||
|
MENU_PROJECT_CONFIGURATIONS=Конфигурации проекта
|
||||||
MENU_VIEW=&Вид
|
MENU_VIEW=&Вид
|
||||||
MENU_VIEW_LANGUAGE=&Язык интерфейса
|
MENU_VIEW_LANGUAGE=&Язык интерфейса
|
||||||
MENU_VIEW_LANGUAGE_EN=English
|
MENU_VIEW_LANGUAGE_EN=English
|
||||||
|
|
Loading…
Reference in New Issue