Author Topic: Restart HippoEDIT option  (Read 5413 times)

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Restart HippoEDIT option
« on: October 30, 2009, 12:08:07 pm »
You know that HE didn't reload config files on the fly right now. We have to restart HE to see the changes.
For testing on different PCs, with a lot of other apps open, it is not always that nice to search for HE.exe to launch HE again.
(yes, i have shortcuts and QuickLaunch and launchers.... but ;-) ... often it is a bit of hassle )

So i may ask, ONLY if it not that much work!!!, if we can have an option like "File > Restart HE"

I know you don't want to add such stuff to keep HE clean.... so how about
an trick like holding CTRL+Shift-key while clicking on "File > Exit" to restart HE?
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

Offline Alain

  • Registered User
  • Jr. Member
  • *
  • Posts: 50
  • Karma: +1/-0
    • View Profile
Re: Restart HippoEDIT option
« Reply #1 on: October 30, 2009, 12:41:48 pm »
Hello

good idea when you are working on "syntax file"
I vote for CTRL+ALT with click on "File>Exit"    as "alternative exit"

But a new option as
"Edit>Refresh all"
"View>Refresh all"  can also do the job

Alain

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Restart HippoEDIT option
« Reply #2 on: October 30, 2009, 03:52:03 pm »
Hi,

the correct way, of course, if we talk about reloading of the syntax files, would be to reload internal representation of syntaxes every time as syntax schema changes. And this I am planning to add some when.

But adding of the restart option is also not problem. So I would add hidden option to restart:
if you close HE in any way (File-Exit, Close of main window) and keep Ctrl+Alt HippoEDIT would restart.

Would be added new beta 1.47. As usual, I have uploaded 738, but because I got some more bug reports I would like to postpone official publication of the new beta, an probably today tomorrow you would get 1.47.739 with this feature.

Best regards,
Alex.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Re: Restart HippoEDIT option
« Reply #3 on: October 31, 2009, 01:04:14 am »
Thanks, but use of ALT-key would not work nicely since ALT is an menu trigger-key.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Restart HippoEDIT option
« Reply #4 on: October 31, 2009, 01:39:11 am »
I have added both cases ;)

Code: [Select]
const BOOL bCtrl  = (GetKeyState(VK_CONTROL) & 0x8000);
const BOOL bShift = (GetKeyState(VK_SHIFT) & 0x8000);
const BOOL bAlt   = (GetKeyState(VK_MENU) & 0x8000);

// check for restart request
// hope now already everything is saved
if (bAlt && (bCtrl || bShift))
{
TCHAR path[_MAX_PATH + 2];
GetModuleFileName(NULL, path, MAX_PATH + 1);
::ShellExecute(NULL, NULL, path, m_lpCmdLine, NULL, m_nCmdShow);
}

Just paste and found a bug ;), new beta is once more delayed :))
And you are right... Probably I would remove Alt case...
« Last Edit: October 31, 2009, 01:42:47 am by alex »

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Re: Restart HippoEDIT option
« Reply #5 on: October 31, 2009, 02:41:35 am »
Take it easy ;)
Very nice to see how the code of such an idea looks about. Interesting and good to know in case of malfunction.

Offline Alain

  • Registered User
  • Jr. Member
  • *
  • Posts: 50
  • Karma: +1/-0
    • View Profile
FILE>EXIT and CRTL+SHIFT
« Reply #6 on: November 01, 2009, 11:31:14 am »
With new version 1.47.739

we have a alternative click "File>Exit" and press CTRL+SHIFT :  shut HE and reload HE
I think that idea behind is for working with a text file and test extension file (.xml) or ?

BUT
if you have a modification, HE normaly ask for "Save" "Don't save" or "Cancel"
if you click "Save" .... 
HE shutdown definitively.

I think the expected behavior is to reload HE with all (saved) files
What about ?

Have a good day
Alain

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: FILE>EXIT and CRTL+SHIFT
« Reply #7 on: November 02, 2009, 01:08:07 am »
Hi Alain,

generally check is done later, when already everything is closed and application is on the last step to exit. Because in this moment I am sure that most of stuff (configuration) is already saved, and when I start new instance it would overtake previous settings.

So, if you keep pressing Ctr+Shift after "Save dialog" HE would restart.

But from your post I got another idea... that I can save automatically, if Shift+Ctrl pressed, and do not bring dialog.
In this case you would not see a difference. Will be done next beta.

Best regards,
Alex.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Re: FILE>EXIT and CRTL+SHIFT
« Reply #8 on: November 02, 2009, 11:19:10 am »
A> that I can save automatically, if Shift+Ctrl pressed, and do not bring dialog.

You mean: i modify my document, change the syntax, restart HE, and my modifications on the docs are saved without any notice?

Now that would be an unexpected behavior and could mess up documents.


Then i think it's better if the auto restart simple not work, if i have to save files first.
Best of course would be if the restart continues after prompted for-and saving files.

I have not the time to test this really right now, but i think i would close or save open files first before i would do an AR (auto restart)
If HE automatically would save modified files for me, i could take care for this too and close files i don't want to save before AR,... but
i could may forget this and messed up my files this way.

SO i think we all should think some more about the right behavior first.

Offline Alain

  • Registered User
  • Jr. Member
  • *
  • Posts: 50
  • Karma: +1/-0
    • View Profile
Re: FILE>EXIT and CRTL+SHIFT
« Reply #9 on: November 02, 2009, 11:46:33 am »
Hello Alex

I agree with Sephan
I think that the "expected" behavior is restart continues AFTER prompted saving dialog.
Have a good day

Alain

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: FILE>EXIT and CRTL+SHIFT
« Reply #10 on: November 02, 2009, 12:38:39 pm »
Ok, I would remove code for automatic save ;)
And you just need to keep Ctrl+Shift pressed after selecting files and selecting something in Save Changes dialog. Because the check for restart is done AFTER this (after all user actions).

I do not want to spend more efforts to change/check this in all possible exit cases, so I would leave it like it is.

Best regards,
Alex.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Re: Restart HippoEDIT option
« Reply #11 on: November 09, 2009, 09:48:51 pm »
Quote
Version 739:
New. Restart HippoEDIT function.
Now if you close HE in any way, keeping buttons Ctrl+Shift pressed,
application would be restarted with same parameters were used for start initial instance

Works fine. Thank you Alex.

Usage:
hold Ctrl+Shift while f.ex. click on "File > Exit"
If you are prompted with an "save modified documents" dialog, just hold Ctrl+Shift again while clicking on an button.