diff --git a/dlangide-monod-linux.dproj b/dlangide-monod-linux.dproj
index 602b037..9f628af 100644
--- a/dlangide-monod-linux.dproj
+++ b/dlangide-monod-linux.dproj
@@ -33,7 +33,6 @@
USE_OPENGL
USE_SDL
USE_FREETYPE
- USE_GDB_DEBUG
EmbedStandardResources
diff --git a/dlangide-monod-linux.sln b/dlangide-monod-linux.sln
index ba2f7dc..2adc559 100644
--- a/dlangide-monod-linux.sln
+++ b/dlangide-monod-linux.sln
@@ -125,4 +125,12 @@ Global
{FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.UnittestMinimal|Any CPU.ActiveCfg = Debug|Any CPU
{FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.UnittestMinimal|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ Policies = $0
+ $0.TextStylePolicy = $1
+ $1.FileWidth = 120
+ $1.inheritsSet = VisualStudio
+ $1.inheritsScope = text/plain
+ $1.scope = text/plain
+ EndGlobalSection
EndGlobal
diff --git a/src/dlangide/ui/commands.d b/src/dlangide/ui/commands.d
index fda7548..160a0e8 100644
--- a/src/dlangide/ui/commands.d
+++ b/src/dlangide/ui/commands.d
@@ -36,7 +36,7 @@ enum IDEActions : int {
HelpAbout,
WindowCloseAllDocuments,
CreateNewWorkspace,
- AddToCurrentWorkspace,
+ AddToCurrentWorkspace,
ProjectFolderAddItem,
ProjectFolderRemoveItem,
ProjectFolderOpenItem,
diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d
index d38e1a6..66d933a 100644
--- a/src/dlangide/ui/frame.d
+++ b/src/dlangide/ui/frame.d
@@ -20,6 +20,7 @@ import dlangui.core.files;
import dlangide.ui.commands;
import dlangide.ui.wspanel;
import dlangide.ui.outputpanel;
+import dlangide.ui.newproject;
import dlangide.ui.dsourceedit;
import dlangide.ui.homescreen;
import dlangide.ui.settings;
@@ -622,13 +623,29 @@ class IDEFrame : AppFrame {
searchPanel.focus();
}
return true;
- default:
+ case IDEActions.FileNewWorkspace:
+ createNewProject(true);
+ return true;
+ case IDEActions.FileNewProject:
+ createNewProject(false);
+ return true;
+ default:
return super.handleAction(a);
}
}
return false;
}
+ void createNewProject(bool newWorkspace) {
+ NewProjectDlg dlg = new NewProjectDlg(window, newWorkspace);
+ dlg.dialogResult = delegate(Dialog dlg, const Action result) {
+ if (result.id == ACTION_APPLY.id) {
+ //Log.d("settings after edit:\n", s.toJSON(true));
+ }
+ };
+ dlg.show();
+ }
+
void showPreferences() {
//Log.d("settings before copy:\n", _settings.setting.toJSON(true));
Setting s = _settings.copySettings();
diff --git a/src/dlangide/ui/newproject.d b/src/dlangide/ui/newproject.d
index deeabb6..165345e 100644
--- a/src/dlangide/ui/newproject.d
+++ b/src/dlangide/ui/newproject.d
@@ -8,14 +8,13 @@ import dlangui.widgets.widget;
import dlangui.widgets.layouts;
import dlangui.widgets.editors;
import dlangui.dml.parser;
+import dlangui.core.stdaction;
class NewProjectDlg : Dialog {
- this(UIString caption, Window parentWindow = null, uint flags = DialogFlag.Modal) {
- super(caption, parentWindow, flags);
- _caption = caption;
- _parentWindow = parentWindow;
- _flags = flags;
+ bool _newWorkspace;
+ this(Window parent, bool newWorkspace) {
+ super(newWorkspace ? UIString("New Workspace"d) : UIString("New Project"d), parent, DialogFlag.Modal);
_icon = "dlangui-logo1";
}
@@ -23,53 +22,58 @@ class NewProjectDlg : Dialog {
override void init() {
super.init();
Widget content = parseML(q{
- VerticalLayout {
- id: vlayout
- HorizontalLayout {
- VerticalLayout {
- layoutWidth: FILL_PARENT; layoutHeight: FILL_PARENT; layoutWidth: 1
- TextWidget {
- text: "Project type"
- }
- }
- VerticalLayout {
- layoutWidth: FILL_PARENT; layoutWeight: FILL_PARENT; layoutWidth: 1
- TextWidget {
- text: "Template"
- }
- }
- VerticalLayout {
- layoutWidth: FILL_PARENT; layoutWeight: FILL_PARENT; layoutWidth: 1
- TextWidget {
- text: "Description"
- }
- }
- }
- margins: Rect { left: 5; right: 3; top: 2; bottom: 4 }
- padding: Rect { 5, 4, 3, 2 } // same as Rect { left: 5; top: 4; right: 3; bottom: 2 }
- TextWidget {
- /* this widget can be accessed via id myLabel1
- e.g. w.childById!TextWidget("myLabel1")
- */
- id: myLabel1
- text: "Some text"; padding: 5
- enabled: false
- }
- TextWidget {
- id: myLabel2
- text: "More text"; margins: 5
- enabled: true
- }
- CheckBox{ id: cb1; text: "Some checkbox" }
- HorizontalLayout {
- RadioButton { id: rb1; text: "Radio Button 1" }
- RadioButton { id: rb1; text: "Radio Button 2" }
- }
- }
- });
- // you can access loaded items by id - e.g. to assign signal listeners
- auto edit1 = window.mainWidget.childById!EditLine("edit1");
+ VerticalLayout {
+ id: vlayout
+ margins: Rect { left: 5; right: 3; top: 2; bottom: 4 }
+ padding: Rect { 5, 4, 3, 2 } // same as Rect { left: 5; top: 4; right: 3; bottom: 2 }
+ layoutWidth: FILL_PARENT; layoutHeight: FILL_PARENT
+ HorizontalLayout {
+ layoutWidth: FILL_PARENT; layoutHeight: FILL_PARENT
+ VerticalLayout {
+ layoutWidth: FILL_PARENT; layoutHeight: FILL_PARENT
+ TextWidget {
+ text: "Project type"
+ }
+ EditBox {}
+ }
+ VerticalLayout {
+ layoutWidth: FILL_PARENT; layoutHeight: FILL_PARENT
+ TextWidget {
+ text: "Template"
+ }
+ EditBox {}
+ }
+ VerticalLayout {
+ layoutWidth: FILL_PARENT; layoutHeight: FILL_PARENT
+ TextWidget {
+ text: "Description"
+ }
+ EditBox {}
+ }
+ }
+ TableLayout {
+ colCount: 2
+ layoutWidth: FILL_PARENT; layoutHeight: FILL_PARENT
+ TextWidget { text: "Project name" }
+ EditLine {
+ id: edProjectName
+ }
+ TextWidget { text: "Solution name" }
+ EditLine {
+ id: edSolutionName
+ }
+ TextWidget { text: "Location" }
+ EditLine {
+ id: edLocation
+ }
+ TextWidget { text: "" }
+ CheckBox { id: cbCreateSubdir; text: "Create subdirectory for project" }
+ }
+ }
+ });
+ addChild(content);
+ addChild(createButtonsPanel([ACTION_OK, ACTION_CANCEL], 0, 0));
}
}