removed LCL deps in ce_common & ce_nativeproject, prerequisite for #30

This commit is contained in:
Basile Burg 2015-09-04 12:11:18 +02:00
parent 0863f89886
commit 5743f87761
14 changed files with 97 additions and 53 deletions

View File

@ -135,7 +135,7 @@
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item6> </Item6>
</RequiredPackages> </RequiredPackages>
<Units Count="40"> <Units Count="41">
<Unit0> <Unit0>
<Filename Value="coedit.lpr"/> <Filename Value="coedit.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
@ -345,6 +345,10 @@
<Filename Value="..\src\ce_dubproject.pas"/> <Filename Value="..\src\ce_dubproject.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
</Unit39> </Unit39>
<Unit40>
<Filename Value="..\src\ce_dialogs.pas"/>
<IsPartOfProject Value="True"/>
</Unit40>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -9,7 +9,7 @@ uses
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_sharedres, Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_sharedres,
ce_observer, ce_libman, ce_tools, ce_dcd, ce_main, ce_writableComponent, ce_observer, ce_libman, ce_tools, ce_dcd, ce_main, ce_writableComponent,
ce_symstring, ce_staticmacro, ce_inspectors, ce_editoroptions, ce_dockoptions, ce_symstring, ce_staticmacro, ce_inspectors, ce_editoroptions, ce_dockoptions,
ce_shortcutseditor, ce_mru, ce_processes, ce_dubproject; ce_shortcutseditor, ce_mru, ce_processes, ce_dubproject, ce_dialogs;
{$R *.res} {$R *.res}

View File

@ -13,11 +13,12 @@ uses
{$IFDEF LINUX} {$IFDEF LINUX}
ExtCtrls, FileUtil, ExtCtrls, FileUtil,
{$ENDIF} {$ENDIF}
dialogs, forms, process, asyncprocess; {$IFNDEF CEBUILD}
forms,
{$ENDIF}
process, asyncprocess;
const const
DdiagFilter = 'D source|*.d|D interface|*.di|All files|*.*';
exeExt = {$IFDEF WINDOWS} '.exe' {$ELSE} '' {$ENDIF}; exeExt = {$IFDEF WINDOWS} '.exe' {$ELSE} '' {$ENDIF};
objExt = {$IFDEF WINDOWS} '.obj' {$ELSE} '.o' {$ENDIF}; objExt = {$IFDEF WINDOWS} '.obj' {$ELSE} '.o' {$ENDIF};
libExt = {$IFDEF WINDOWS} '.lib' {$ELSE} '.a' {$ENDIF}; libExt = {$IFDEF WINDOWS} '.lib' {$ELSE} '.a' {$ENDIF};
@ -101,21 +102,6 @@ type
*) *)
function stripFileExt(const aFilename: string): string; function stripFileExt(const aFilename: string): string;
(**
* Ok/Cancel modal dialog
*)
function dlgOkCancel(const aMsg: string): TModalResult;
(**
* Info message
*)
function dlgOkInfo(const aMsg: string): TModalResult;
(**
* Error message
*)
function dlgOkError(const aMsg: string): TModalResult;
(** (**
* Returns an unique object identifier, based on its heap address. * Returns an unique object identifier, based on its heap address.
*) *)
@ -494,27 +480,6 @@ begin
exit(aFilename); exit(aFilename);
end; end;
function dlgOkCancel(const aMsg: string): TModalResult;
const
Btns = [mbOK,mbCancel];
begin
exit( MessageDlg('Coedit', aMsg, mtConfirmation, Btns, ''));
end;
function dlgOkInfo(const aMsg: string): TModalResult;
const
Btns = [mbOK];
begin
exit( MessageDlg('Coedit', aMsg, mtInformation, Btns, ''));
end;
function dlgOkError(const aMsg: string): TModalResult;
const
Btns = [mbOK];
begin
exit( MessageDlg('Coedit', aMsg, mtError, Btns, ''));
end;
function uniqueObjStr(const aObject: Tobject): string; function uniqueObjStr(const aObject: Tobject): string;
begin begin
{$HINTS OFF}{$WARNINGS OFF} {$HINTS OFF}{$WARNINGS OFF}
@ -753,8 +718,10 @@ begin
else else
begin begin
env := sysutils.GetEnvironmentVariable('PATH'); env := sysutils.GetEnvironmentVariable('PATH');
{$IFNDEF CEBUILD}
if Application <> nil then if Application <> nil then
env += PathSeparator + ExtractFileDir(ExtractFilePath(application.ExeName)); env += PathSeparator + ExtractFileDir(ExtractFilePath(application.ExeName));
{$ENDIF}
exit(ExeSearch(anExeName, env)); exit(ExeSearch(anExeName, env));
end; end;
end; end;

55
src/ce_dialogs.pas Normal file
View File

@ -0,0 +1,55 @@
unit ce_dialogs;
{$I ce_defines.inc}
interface
uses
classes, sysutils, forms, dialogs;
(**
* Ok/Cancel modal dialog
*)
function dlgOkCancel(const aMsg: string): TModalResult;
(**
* Info message
*)
function dlgOkInfo(const aMsg: string): TModalResult;
(**
* Error message
*)
function dlgOkError(const aMsg: string): TModalResult;
const
DdiagFilter = 'D source|*.d|D interface|*.di|All files|*.*';
implementation
function dlgOkCancel(const aMsg: string): TModalResult;
const
Btns = [mbOK,mbCancel];
begin
exit( MessageDlg('Coedit', aMsg, mtConfirmation, Btns, ''));
end;
function dlgOkInfo(const aMsg: string): TModalResult;
const
Btns = [mbOK];
begin
exit( MessageDlg('Coedit', aMsg, mtInformation, Btns, ''));
end;
function dlgOkError(const aMsg: string): TModalResult;
const
Btns = [mbOK];
begin
exit( MessageDlg('Coedit', aMsg, mtError, Btns, ''));
end;
end.

View File

@ -7,7 +7,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, ExtendedNotebook, Forms, Controls, lcltype, Classes, SysUtils, FileUtil, ExtendedNotebook, Forms, Controls, lcltype,
Graphics, SynEditKeyCmds, ComCtrls, SynEditHighlighter, ExtCtrls, Menus, Graphics, SynEditKeyCmds, ComCtrls, SynEditHighlighter, ExtCtrls, Menus,
SynMacroRecorder, SynPluginSyncroEdit, SynEdit, SynHighlighterMulti, SynMacroRecorder, SynPluginSyncroEdit, SynEdit, SynHighlighterMulti, ce_dialogs,
ce_widget, ce_interfaces, ce_synmemo, ce_dlang, ce_common, ce_dcd, ce_observer; ce_widget, ce_interfaces, ce_synmemo, ce_dlang, ce_common, ce_dcd, ce_observer;
type type

View File

@ -305,6 +305,16 @@ type
end; end;
(**
* Single service that allows objects with a short life-time
* to get the project information.
*)
//ICEProjectInfos = interface(ICESingleService)
// function getCurrentProjectInterface: ICECommonProject;
//end;
{ {
subject primitives: subject primitives:

View File

@ -5,7 +5,8 @@ unit ce_libman;
interface interface
uses uses
Classes, SysUtils, FileUtil, ce_common, ce_writableComponent, ce_dcd; Classes, SysUtils, FileUtil, ce_common, ce_writableComponent, ce_dcd,
ce_dialogs;
type type
@ -116,7 +117,7 @@ begin
end; end;
if fCol.Count = 0 then if fCol.Count = 0 then
begin begin
ce_common.dlgOkError( dlgOkError(
'Coedit failed to automatically add "druntime" and "phobos" to the library manager.' 'Coedit failed to automatically add "druntime" and "phobos" to the library manager.'
+ 'These two items have to be added manually following the procedure described in the wiki.' + 'These two items have to be added manually following the procedure described in the wiki.'
); );

View File

@ -7,7 +7,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Menus, ComCtrls, Buttons, ce_widget, ce_interfaces, ce_nativeproject, ce_dmdwrap, Menus, ComCtrls, Buttons, ce_widget, ce_interfaces, ce_nativeproject, ce_dmdwrap,
ce_common; ce_common, ce_dialogs;
type type

View File

@ -12,7 +12,7 @@ uses
ce_widget, ce_messages, ce_interfaces, ce_editor, ce_projinspect, ce_projconf, ce_widget, ce_messages, ce_interfaces, ce_editor, ce_projinspect, ce_projconf,
ce_search, ce_miniexplorer, ce_libman, ce_libmaneditor, ce_todolist, ce_observer, ce_search, ce_miniexplorer, ce_libman, ce_libmaneditor, ce_todolist, ce_observer,
ce_toolseditor, ce_procinput, ce_optionseditor, ce_symlist, ce_mru, ce_processes, ce_toolseditor, ce_procinput, ce_optionseditor, ce_symlist, ce_mru, ce_processes,
ce_infos, ce_dubproject; ce_infos, ce_dubproject, ce_dialogs;
type type
@ -911,7 +911,7 @@ end;
procedure TCEMainForm.ApplicationProperties1Exception(Sender: TObject;E: Exception); procedure TCEMainForm.ApplicationProperties1Exception(Sender: TObject;E: Exception);
begin begin
if fMesgWidg = nil then if fMesgWidg = nil then
ce_common.dlgOkError(E.Message) dlgOkError(E.Message)
else else
fMsgs.message(E.Message, nil, amcApp, amkErr); fMsgs.message(E.Message, nil, amcApp, amkErr);
end; end;
@ -923,7 +923,7 @@ begin
canClose := false; canClose := false;
SaveLastDocsAndProj; SaveLastDocsAndProj;
if fProjectInterface <> nil then if fProjectInterface.getIfModified then if fProjectInterface <> nil then if fProjectInterface.getIfModified then
if ce_common.dlgOkCancel( if dlgOkCancel(
'The project modifications are not saved, quit anyway ?') <> mrOK then 'The project modifications are not saved, quit anyway ?') <> mrOK then
exit; exit;
for i := fMultidoc.documentCount-1 downto 0 do for i := fMultidoc.documentCount-1 downto 0 do

View File

@ -8,6 +8,9 @@ uses
{$IFDEF DEBUG} {$IFDEF DEBUG}
LclProc, LclProc,
{$ENDIF} {$ENDIF}
{$IFNDEF CEBUILD}
ce_dialogs,
{$ENDIF}
Classes, SysUtils, process, strUtils, ce_common, ce_writableComponent, Classes, SysUtils, process, strUtils, ce_common, ce_writableComponent,
ce_dmdwrap, ce_observer, ce_interfaces, ce_processes; ce_dmdwrap, ce_observer, ce_interfaces, ce_processes;
@ -433,6 +436,7 @@ end;
procedure TCENativeProject.afterLoad; procedure TCENativeProject.afterLoad;
var var
hasPatched: Boolean; hasPatched: Boolean;
{$IFNDEF CEBUILD}
// either all the source files have moved or only the project file // either all the source files have moved or only the project file
procedure checkMissingAllSources; procedure checkMissingAllSources;
var var
@ -510,11 +514,13 @@ var
end; end;
end; end;
end; end;
{$ENDIF}
// //
begin begin
patchPlateformPaths(fSrcs); patchPlateformPaths(fSrcs);
fModified := false; fModified := false;
hasPatched := false; hasPatched := false;
{$IFNDEF CEBUILD}
// //
// TODO-cfeature: a modal form with the file list, green checkers and red crosses to indicate the state // TODO-cfeature: a modal form with the file list, green checkers and red crosses to indicate the state
// and some actions to apply to a particular selection: patch root, remove from project, replace, etc... // and some actions to apply to a particular selection: patch root, remove from project, replace, etc...
@ -526,6 +532,7 @@ begin
'paths or file may still exist (-of, -od, extraSources, etc)' + 'paths or file may still exist (-of, -od, extraSources, etc)' +
'but cannot be automatically handled. Note that the modifications have not been saved.'); 'but cannot be automatically handled. Note that the modifications have not been saved.');
end; end;
{$ENDIF}
// //
updateOutFilename; updateOutFilename;
endUpdate; endUpdate;

View File

@ -6,8 +6,8 @@ interface
uses uses
Classes, SysUtils, FileUtil, RTTIGrids, Forms, Controls, Graphics, ExtCtrls, Classes, SysUtils, FileUtil, RTTIGrids, Forms, Controls, Graphics, ExtCtrls,
Menus, ComCtrls, Buttons, ce_common, ce_widget, ce_interfaces, Menus, ComCtrls, Buttons, PropEdits, ObjectInspector,
ce_observer, PropEdits, ObjectInspector; ce_common, ce_widget, ce_interfaces, ce_observer, ce_dialogs;
type type

View File

@ -7,7 +7,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, TreeFilterEdit, Forms, Controls, Graphics, actnlist, Classes, SysUtils, FileUtil, TreeFilterEdit, Forms, Controls, Graphics, actnlist,
Dialogs, ExtCtrls, ComCtrls, Menus, Buttons, lcltype, ce_nativeproject, ce_interfaces, Dialogs, ExtCtrls, ComCtrls, Menus, Buttons, lcltype, ce_nativeproject, ce_interfaces,
ce_common, ce_widget, ce_observer; ce_common, ce_widget, ce_observer, ce_dialogs;
type type
TCEProjectInspectWidget = class(TCEWidget, ICEProjectObserver) TCEProjectInspectWidget = class(TCEWidget, ICEProjectObserver)

View File

@ -8,7 +8,7 @@ uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Menus, StdCtrls, actnList, Buttons, SynEdit, SynEditSearch, SynEditTypes, Menus, StdCtrls, actnList, Buttons, SynEdit, SynEditSearch, SynEditTypes,
ce_common, ce_mru, ce_widget, ce_synmemo, ce_interfaces, ce_observer, ce_common, ce_mru, ce_widget, ce_synmemo, ce_interfaces, ce_observer,
ce_writableComponent; ce_writableComponent, ce_dialogs;
type type

View File

@ -8,7 +8,7 @@ uses
Classes, SysUtils, controls,lcltype, Forms, graphics, ExtCtrls, crc, Classes, SysUtils, controls,lcltype, Forms, graphics, ExtCtrls, crc,
SynPluginSyncroEdit, SynCompletion, SynEditKeyCmds, LazSynEditText, SynEdit, SynPluginSyncroEdit, SynCompletion, SynEditKeyCmds, LazSynEditText, SynEdit,
SynHighlighterLFM, SynEditHighlighter, SynEditMouseCmds, SynEditFoldedView, SynHighlighterLFM, SynEditHighlighter, SynEditMouseCmds, SynEditFoldedView,
ce_common, ce_observer, ce_writableComponent, ce_d2syn, ce_txtsyn; ce_common, ce_observer, ce_writableComponent, ce_d2syn, ce_txtsyn, ce_dialogs;
type type