Commit Graph

202 Commits

Author SHA1 Message Date
Cheng Zhao
ce1c1e1f88 Hide window before doing unload work.
In this way we can give user the feeling of quick close even though the
unloading could take some time.
2013-05-24 20:12:42 +08:00
Cheng Zhao
0dd823aa38 Merge branch 'master' into atom-shell 2013-05-24 19:12:47 +08:00
Cheng Zhao
20b53313af dimensions could be undefined. 2013-05-24 16:34:26 +08:00
Kevin Sawicki
e7df1f1f3d Use a dropdown button for package actions 2013-05-22 15:29:34 -07:00
probablycorey
0901e1a34c Allow spec window to store window state
It just stores window dimensions for now.
2013-05-22 11:56:33 -07:00
Cheng Zhao
61f8878e05 Merge branch 'master' into atom-shell
Conflicts:
	package.json
	script/bootstrap
	spec/app/window-spec.coffee
	src/app/window.coffee
2013-05-22 20:52:42 +08:00
probablycorey
b58fcc5395 Specs run (but fail hardcore) 2013-05-21 17:04:00 -07:00
probablycorey
d4b146d080 Serialize window dimensions 2013-05-21 14:33:45 -07:00
probablycorey
f65fbdf7ae Don't show window until it is finished loading 2013-05-21 14:32:12 -07:00
probablycorey
f23cb1aa79 Window state works now
The state is now stored in ~/.atom/.storage/SHA-OF-PATH. It is written
to every time it is set.
2013-05-21 14:12:15 -07:00
probablycorey
26094a5405 Use executedFrom command line option to resolve paths 2013-05-20 16:02:06 -07:00
Cheng Zhao
60fcb97a3e Send window commands instead of invoking window APIs directly.
For some events generated on the browser side, like reloading, closing
window, we should not handle those events directly, instead we should
send the corresponding commands to the renderer and let the renderer
deal with it.

The window.reload() is also moved to atom.reload(), because I saw things
like toggleFullScreen(), focus(), toggleDevTools() are also there.
2013-05-20 14:19:12 +08:00
Cheng Zhao
8be54136ed Use "shell.openExternal(url)" to open links in external browsers. 2013-05-20 10:12:40 +08:00
Cheng Zhao
6260d350ac Should always show devtools instead of toggling when getting error. 2013-05-17 23:07:34 +08:00
Cheng Zhao
26c89f71b2 Use BrowserWindow's 'close' event instead of 'beforeunload' to control closing.
Ideally both window closing and reloading should use 'beforeunload' to
control whether the unloading should continue, however since the save as
dialog is asynchronous, we have to prevent unloading first and then
continue after user's confirmation. And since we can not distinguish
whether the window is reloading or closing in the 'beforeunload'
handler, we do not know what to continue after user's confirmation. So I
have to rely on BrowserWindow's 'close' event to let user decide whether
window should be closed.
2013-05-17 22:30:14 +08:00
Cheng Zhao
f0448ba231 Trigger 'window:close' command in the 'beforeunload' event handler.
When user wants to close the window, the 'beforeunload' event would be
called, then the closing would be cancelled and the 'window:close'
command would be triggered. In the 'window:close' handler, a confirm
dialog could be showed if there are unsaved contents, and if the window
is really meant to be closed, the window would be tried to be closed
again and this time 'beforeunload' handler wont't prevent it.
2013-05-17 20:17:06 +08:00
Cheng Zhao
acf5e21f50 Do unload work in 'unload' event handler instead of 'beforeunload'.
In Atom, the 'beforeunload' event never prevents window from closing so
it in fact has the same effect with 'unload' event, I guess using
'beforeunload' instead of 'unload' is because the 'beforeunload' is
guarrenteed to happen when window is closing or application is quiting.
However in Atom Shell the 'unload' event is guarrenteed to happen on
both conditions, just like the 'beforeunload' in Atom, so it's safe to
replace the 'beforeunload' with 'unload' here.

And in Atom Shell, the 'beforeunload' event is mainly used for
preventing window from closing, just like the 'window:close' command in
Atom.
2013-05-17 20:17:03 +08:00
Cheng Zhao
d1ca0a8f8f Use toggleDevTools instead of showDevTools. Fixes atom/atom-shell#8.
Currently the toggleDevTools of atom-shell is simulated by keeping state
of devtools, because there is no way to know the state of devtools in
brightray, so it could not behave correctly sometimes.

This problem will be solved when brightray is patched and atom-shel gets
updated.
2013-05-17 19:02:03 +08:00
Kevin Sawicki
392ffce8c7 Remove unused requires 2013-05-16 15:54:10 -07:00
Kevin Sawicki
d7a238b5ec Guard against possibly null event handler 2013-05-16 15:49:53 -07:00
Kevin Sawicki & Nathan Sobo
76e7161608 Extract window event handling into separate class 2013-05-16 14:18:57 -07:00
Kevin Sawicki
61675c2e77 Install apm command when Atom starts
This changes the command installation to use symlinks instead
of copying over the contents of the file.
2013-05-15 10:29:27 -07:00
Garen Torikian
d4474e1d4d Merge pull request #512 from github/change-status-block-tag
Change status block tag
2013-05-02 13:50:06 -07:00
Kevin Sawicki
ee621bcace Bind link click handler in window.handleEvents() 2013-05-01 22:18:39 -07:00
Kevin Sawicki
c2118a8cb9 Remove unneeded trailing if 2013-05-01 21:55:37 -07:00
Kevin Sawicki
21f1579f73 Return early when href is a hash 2013-05-01 21:48:43 -07:00
Kevin Sawicki
4dce9d659f Open http/https links in an external browser
Listen for all links being clicked and open any http/https
hrefs by spawning a call to the 'open' command.

Closes #531
2013-05-01 21:36:36 -07:00
Garen Torikian
2357f46761 Fix block comments in src 2013-05-01 16:58:43 -07:00
Kevin Sawicki
78d8485243 Allow config window to be closed with meta-W
window.confirmClose() should close the window immediately when
there is no rootView which is the case in the config window.
2013-05-01 08:02:17 -07:00
Nathan Sobo
5afe0a758c Allow stylesheets with ' characters in their filename 2013-04-26 15:36:14 -07:00
Nathan Sobo
ac65e288df Pull config stylesheet into atom.less 2013-04-26 15:36:12 -07:00
Nathan Sobo
f0cddf9f32 Serialize the state of the config window on refresh 2013-04-26 15:36:11 -07:00
Nathan Sobo
8980a97895 Add atom.activatePackageConfig, which is called in config windows
This calls an optional `activateConfig` method on the package's main
module, which allows it to add a configuration interface to the
`configView`.
2013-04-26 15:32:47 -07:00
Nathan Sobo
160b80b47f Open a custom config window on 'open-user-configuration' event 2013-04-26 15:32:47 -07:00
Nathan Sobo
9d2d3d5c00 Rename window methods to distinguish editor window from config window 2013-04-26 15:32:46 -07:00
Kevin Sawicki
2f5a99fac2 Install atom command asynchronously 2013-04-24 10:12:29 -07:00
Garen Torikian
14a0010517 Keep updating Internal hiding 2013-04-18 14:58:19 -07:00
Garen Torikian
e478d9b7a0 Add more corrections off of the #Internal syntax 2013-04-18 13:38:26 -07:00
Garen Torikian
130baf2235 Merge branch 'master' into api/docs 2013-04-17 16:08:18 -07:00
Kevin Sawicki & Nathan Sobo
a1cab1a692 Log instead of re-throwing less parser errors 2013-04-16 12:10:07 -07:00
Nathan Sobo
bbf7c6ca1b Replace requireStylesheet calls w/ @import directives in atom.less 2013-04-15 20:45:54 -06:00
Nathan Sobo
2f008aa886 Use less NPM module instead of vendored less
We're currently using nathansobo's fork, which doesn't depend on
`window` being undefined to operate in Node mode.
2013-04-15 20:45:54 -06:00
Garen Torikian
4c56e8bb57 Merge branch 'master' into api/docs 2013-04-14 09:43:06 -07:00
Garen Torikian
8bd02358d2 Should I regret a lack of better commit messages? 2013-04-12 22:35:54 -05:00
Cheng Zhao
558e41f740 Make main window restart renderer process when reloaded for 4 times.
Fix #495.
2013-04-13 10:24:58 +08:00
Cheng Zhao
3c4966f6a3 Open the file dragged to window. 2013-04-09 15:37:30 +08:00
Cheng Zhao
f4161a1889 Restart interval of main window should be longer than specs window. 2013-04-08 12:00:52 +08:00
Cheng Zhao
17e9c6ea3b Restart renderer process when reloaded for 4 times.
Fix #481.
2013-04-08 12:00:52 +08:00
Cheng Zhao
f455379a17 No drag-drop by default. 2013-04-04 15:31:06 +08:00
Kevin Sawicki
5d2a0a0223 Use fs.chmod() to make atom.sh executable 2013-04-03 15:01:23 -07:00