Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-09

Patch for win32 : ShowModal and Lazconf

10 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Karl Brandt
to Karl Brandt: Two patches are attached: - fix ShowModal after being closed by X button - small…
Mattias Gaertner wrote 6 lines
On Wed, 10 Sep 2003 19:21:04 -0300 Karl Brandt wrote: >Mattias Gaertner wrote: >

<snip>

Show quoted text 26 lines
>>The secondary config file is for templates. For example admins can setup >>some default values for all users. > >So, the user must copy/make a config secondary file manually? > >The sequence i had in mind was: > >Check if secondary exits >if no, create one and save to disk Normally the secondary config path is not writable for the user. >Check if primary exists >if no, copy from secondary to primary > >This way in first run both files will be automatically generated and if >desired, the user can change/edit the secondary/template file. The primary is for the user. Most primary files are created on first use of the IDE. When the primary exists, the secondary is ignored. So, why should the user want to edit the secondary?

Sorry, I meant admin edit/create secondary file.
The primary config files are not being created at disk,here, after the first use. I was trying to copy from secondary which doesn't exist. I'll update and see if now they are being created.

Show quoted text 14 lines
>But look that this is not the desired behavior > > > >>Can you tell me, where the exception is raised? >> > >Inside CopySecondaryConfigFile function(lazconf.inc) >at SrcFS:=TFileStream.Create(SecondaryFilename,fmOpenRead); Even with the FileExists addition?

I didn't updated CVS after this change

karl

Reply by email

Mattias Gaertner
to Karl Brandt: Two patches are attached: - fix ShowModal after being closed by X button - small…
Show quoted text 34 lines
Mattias Gaertner wrote: > On Tue, 09 Sep 2003 21:11:10 -0300 > Karl Brandt wrote: > > >>Mattias Gaertner wrote: >> >>>On Tue, 09 Sep 2003 00:56:44 -0300 >>>Karl Brandt wrote: >>> >>>>BTW: When Creating config files, if Primary file is not found, is >tried >>>to copy from secondary file to primary file. This creates a >exception >>>because primary file also not exists. Maybe can be checked >if primary >>>file exists and if no, created a default one. >> >>Sorry,i mean secondary config file. >> >> >>>There is an try..except around the copy. And defaults are always >>>created. >> >>At least in my system, this default secondary config is not saved to >disk. > > > The secondary config file is for templates. For example admins can setup > some default values for all users. So, the user must copy/make a config secondary file manually? The sequence i had in mind was: Check if secondary exits if no, create one and save to disk

Normally the secondary config path is not writable for the user.

Show quoted text 5 lines
Check if primary exists if no, copy from secondary to primary This way in first run both files will be automatically generated and if desired, the user can change/edit the secondary/template file.

The primary is for the user. Most primary files are created on first use of the IDE. When the primary exists, the secondary is ignored. So, why should the user want to edit the secondary?

Show quoted text 8 lines
But look that this is not the desired behavior > Can you tell me, where the exception is raised? > Inside CopySecondaryConfigFile function(lazconf.inc) at SrcFS:=TFileStream.Create(SecondaryFilename,fmOpenRead);

Even with the FileExists addition?

Mattias

Reply by email

Mattias Gaertner
to Karl Brandt: Two patches are attached: - fix ShowModal after being closed by X button - small…
Two patches are attached:

Applied.

Show quoted text 11 lines
- fix ShowModal after being closed by X button - small improvements/fixes to the LazConf functionns (include/win32/lazconf.inc). The primary path is set to lazarus dir and the secondary to windows dir. Maybe we can change it to the profile dir (under NT/XP/2000) and AppData dir\lazarus (default place for App files). Any suggestions? BTW: When Creating config files, if Primary file is not found, is tried to copy from secondary file to primary file. This creates a exception because primary file also not exists. Maybe can be checked if primary file exists and if no, created a default one.

There is an try..except around the copy. And defaults are always created. Even if the file exists.
I added a FileExists, so that debugging will show an exception less.

Mattias

Reply by email

Karl Brandt

Two patches are attached:

- fix ShowModal after being closed by X button
- small improvements/fixes to the LazConf functionns (include/win32/lazconf.inc). The primary path is set to lazarus dir and the secondary to windows dir. Maybe we can change it to the profile dir (under NT/XP/2000) and AppData dir\lazarus (default place for App files). Any suggestions?

BTW: When Creating config files, if Primary file is not found, is tried to copy from secondary file to primary file. This creates a exception because primary file also not exists. Maybe can be checked if primary file exists and if no, created a default one.

karl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip00036.zip
Type: application/octet-stream
Size: 1137 bytes
Desc: "intf.zip"
Url : http://localhost/pipermail/lazarus/attachments/20030908/c4cee5d6/zip00036.obj

Reply by email

Karl Brandt
to Karl Brandt
Prof. Roberto A. Berrospe Machin wrote 5 lines
Hi everyone. I have one question, maybe im ignorant :) jeje but, �How can i patch lazarus sources under windows? im using cvs with TortoiseCVS, but i download lasts updates using console.. i dont know how patch windows version...

Download patch.exe,diff.exe from cygwin or mingw.
You can make a diff with cvs using -rdiff file versions (See docs) or you can save the older file/dir and make the changes at one copy.Then do diff -c oldfile newfile > patchfile to create the diff. To aplly the diff , in the dir where are the files to be patched do: patch < patchfile

karl

Reply by email

Karl Brandt
to Karl Brandt: Two patches are attached: - fix ShowModal after being closed by X button - small…
Mattias Gaertner wrote 25 lines
On Tue, 09 Sep 2003 21:11:10 -0300 Karl Brandt wrote: >Mattias Gaertner wrote: > >>On Tue, 09 Sep 2003 00:56:44 -0300 >>Karl Brandt wrote: >> >>>BTW: When Creating config files, if Primary file is not found, is tried >>>to copy from secondary file to primary file. This creates a exception >>>because primary file also not exists. Maybe can be checked if primary >>>file exists and if no, created a default one. > >Sorry,i mean secondary config file. > > >>There is an try..except around the copy. And defaults are always >>created. > >At least in my system, this default secondary config is not saved to disk. The secondary config file is for templates. For example admins can setup some default values for all users.

So, the user must copy/make a config secondary file manually?

The sequence i had in mind was:

Check if secondary exits
if no, create one and save to disk
Check if primary exists
if no, copy from secondary to primary

This way in first run both files will be automatically generated and if desired, the user can change/edit the secondary/template file.

But look that this is not the desired behavior

Can you tell me, where the exception is raised?
Inside CopySecondaryConfigFile function(lazconf.inc)
at SrcFS:=TFileStream.Create(SecondaryFilename,fmOpenRead);

karl

Reply by email

Mattias Gaertner
to Karl Brandt: Two patches are attached: - fix ShowModal after being closed by X button - small…
Show quoted text 12 lines
[...] > > The primary is for the user. Most primary files are created on first use > of the IDE. When the primary exists, the secondary is ignored. So, why > should the user want to edit the secondary? > > Sorry, I meant admin edit/create secondary file. The primary config files are not being created at disk,here, after the first use. I was trying to copy from secondary which doesn't exist. I'll update and see if now they are being created.

First starting and closing the IDE creates only a few configs. Like the environmentoptions.xml. (If not, then there is a bug) There are no useful values, because the IDE only saves differences to the defaults. At the moment the xml config units also saves empty parent nodes, so the config files contain some unneeded nodes. This is a ToDo.

To create the secondary configs, the admin can do: Start the IDE as a user, setup up some things and close the IDE. Use a xml or text editor and delete what you don't need. Copy the files to the secondary config directory (Probably only environmentoptions.xml).

Mattias

Reply by email

Karl Brandt
to Karl Brandt: Two patches are attached: - fix ShowModal after being closed by X button - small…
Mattias Gaertner wrote 6 lines
On Tue, 09 Sep 2003 00:56:44 -0300 Karl Brandt wrote: >BTW: When Creating config files, if Primary file is not found, is tried >to copy from secondary file to primary file. This creates a exception >because primary file also not exists. Maybe can be checked if primary >file exists and if no, created a default one.

Sorry,i mean secondary config file.

There is an try..except around the copy. And defaults are always created.

At least in my system, this default secondary config is not saved to disk. I looked at the values of the Paths, and they are valid ones.

Even if the file exists. I added a FileExists, so that debugging will show an exception less.

karl

Reply by email

Mattias Gaertner
to Karl Brandt: Two patches are attached: - fix ShowModal after being closed by X button - small…
Show quoted text 14 lines
Mattias Gaertner wrote: > On Tue, 09 Sep 2003 00:56:44 -0300 > Karl Brandt wrote: >>BTW: When Creating config files, if Primary file is not found, is tried >>to copy from secondary file to primary file. This creates a exception >>because primary file also not exists. Maybe can be checked if primary >>file exists and if no, created a default one. Sorry,i mean secondary config file. > There is an try..except around the copy. And defaults are always > created. At least in my system, this default secondary config is not saved to disk.

The secondary config file is for templates. For example admins can setup some default values for all users.
Can you tell me, where the exception is raised?

Mattias

Show quoted text 11 lines
I looked at the values of the Paths, and they are valid ones. > Even if the file exists. > I added a FileExists, so that debugging will show an exception less. karl _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email