|
|
#1 |
|
Junior Member
Join Date: Jan 2003
Posts: 1
|
Programmatically return back to the previuos page
Hi everybody.
I'd like to obtain the following behaviour with NSIS 2.0 beta 0: When the user clicks "Next" on the directory choosing page, the path is verified (maybe in the next page creation function) and if it is not valid, a warning is displayed and the directory choosing page is displayed again. I'm not able to obtain it because in the creation callback function of a custom page it is not possible to return back to the previous page, but only to skip the current one with Abort. I can not user .onVerifyInstDir because it's called while the user is typing, and I don't like this behaviour.. as I said I'd like to check the path when the "next" button is pressed. Anyone can help please? Thanks Chocho |
|
|
|
|
|
#3 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Post function is called just before the page is shown, not after. I am working right now on a function that will do that because a lot of people requested it and because it will solve the radio buttons/checkbox on the license page problem.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
|
Gosh, never used it, so...
![]() Then it will propably become: Page license|directory|etc... [preshow_function] [postshow_function] [onleave_function] (chocho_rock, before copying my line here, this won't work yet!) - Claudia Pelsmaeker |
|
|
|
|
|
#5 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Precreate, preshow, and preleave.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#6 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
OK, I have finished this, but I want to test it a bit so I will release it only tomorrow.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Jan 2003
Posts: 2
|
PreLeave funtionality on a custom page
Is the preleave funtionality going to be implemented for a custom page?
|
|
|
|
|
|
#8 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
I am sorry, I forgot to let you know. It's already available in the latest CVS version.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Jan 2003
Posts: 2
|
Looking at code
After looking at the latest code, I don't see how to implement the 'preleave' function for a custom page. It only seems to be dealt with for the non-custom pages.
I don't know if it's a typo or not, but lines 785-788 in script.cpp look like they may not do what was inteded. Both of these 'if' statements set p.showfunc. Should the second one set p.leavefunc? |
|
|
|
|
|
#10 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Pre-leave function was not designed to work with custom pages, but now that I look at it again, it should. I'll add this in a couple of days.
Those lines indeed contain a typo. Thanks. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#11 |
|
Member
Join Date: Jan 2003
Posts: 78
|
Hi,
I was just wondering if the Pre-leave function is now available for custom pages? Thanks.
|
|
|
|
|
|
#12 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Oops... Thanks for reminding me. It's now in the todo list where I won't miss it
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#13 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,896
|
This means, now the installer can return to a previuos page automatically?
How? someone have a script example?
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4. |
|
|
|
|
|
#15 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Well, actually it's only not available for custom pages. For normal pages just use the leave callback function. If you call Abort from that function it won't leave the page.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#16 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Ready and waiting in CVS. Use NSIS Update to get it.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#17 |
|
Junior Member
Join Date: Apr 2003
Posts: 8
|
Is there any example code for the leave function in a custom page?
|
|
|
|
|
|
#18 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
This will work.
Use like so... Page Custom CustomPage code: -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#19 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Your example doens't use the new leave callback function. Contrib\InstallOptions\test.nsi contains such an example.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#20 |
|
Junior Member
Join Date: Apr 2003
Posts: 8
|
I think I'm confused. What exactly is the leave callback function. Can you use it in a .nsi script? Or do you have to edit the C code?
Afrow UK, I was able to use the code you posted. It does exactly what I want, but I would still like to know what the leave callback is. thanks for all the help! mlm (aka, digitalda) |
|
|
|
|
|
#21 |
|
Junior Member
Join Date: Apr 2003
Posts: 8
|
I'm having some problems. I tried to implement the above suggestion and I thought it was working, but now when I try to cancel before making a selection it forces me to make a selection before canceling.
PHP Code:
any suggestions? |
|
|
|
|
|
#22 |
|
Major Dude
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
|
A callback function is a function that is called when a particular event occures. The normal Page-instruction syntax is this:
PHP Code:
[show_function] is replaced by the name of the function that should be called after creating the page's components, but before showing it (allows some UI tweaking). [leave_function] is replaced by the name of the function that is called just before the page is made invisible, but after the 'Next' button is clicked. Something similar now exists for Custom pages: PHP Code:
[leave_function] is replaced by the name of the function that is called just before the page is made invisible, but after the 'Next' button of the custom page is clicked. This allows something like this (not tested): PHP Code:
- Claudia Pelsmaeker |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|