Commit Graph

225 Commits

Author SHA1 Message Date
Kevin Sawicki & Nathan Sobo
4cba8ab48f Serialize project when editor window is unloaded 2013-07-22 18:39:32 -07:00
Kevin Sawicki & Nathan Sobo
fa59aafffb Relativize buffer paths for replication
TextBuffers now maintain a reference to their containing project to
make it easier to test replication of buffers between environments
without worrying about the value of the `project` global.

We're also starting the process of moving the `git` global into Project
as the `Project.repository` property.
2013-07-22 18:13:01 -06:00
Nathan Sobo
5246d4cd72 Add Project.getState() and make Project.serialize clone state 2013-07-20 21:24:32 -06:00
Kevin Sawicki & Nathan Sobo
cd4622fbeb Serialize project in window state 2013-06-28 04:39:27 -06:00
Kevin Sawicki & Nathan Sobo
0851b4d011 Replicate pane splitting and removal
We're using Peer.js to stream changes to shared telepath documents
between participants.

We're replacing the rootView of joiners in a somewhat hacky way,
but replication of pane splits and items is fully tested.
2013-06-28 04:39:26 -06:00
Kevin Sawicki & Nathan Sobo
6480e956af Keep resident window state object 2013-06-28 04:39:26 -06:00
Kevin Sawicki & Nathan Sobo
9c95a4751b Return telepath documents from getWindowState() 2013-06-28 04:39:25 -06:00
Cheng Zhao
45ce8e1d63 Ask for close confirmation in beforeunload handler. 2013-06-27 18:39:29 +08:00
Kevin Sawicki
6879f0d0ac Update initialPath on project path changes
atom.setPathToOpen() is now longer available and instead
the load settings should be updated.
2013-06-24 10:41:44 -07:00
Kevin Sawicki
82013b1970 Use path.join() instead of fsUtils.join() 2013-06-12 16:20:40 -07:00
Kevin Sawicki
d1cf839e53 Use correct less stylesheet path variable name 2013-06-12 15:53:47 -07:00
Kevin Sawicki
bdb641ec94 Use path.extname() instead of fsUtils.extension() 2013-06-12 15:43:58 -07:00
Corey Johnson & Kevin Sawicki
a4ee1eb785 Rename pathToOpen load setting to initialPath
Use the initialPath as the window state serialization key.

Also use the parent directory as the intitial path when the
path to open is a file.
2013-06-11 15:38:31 -07:00
Corey Johnson & Kevin Sawicki
fc52ee518e Wait for window:loaded before emitting window:open-path 2013-06-11 14:48:51 -07:00
Corey Johnson & Kevin Sawicki
dc53f387a6 Remove project serialization 2013-06-11 14:39:32 -07:00
Corey Johnson & Kevin Sawicki
1ce861c000 Don't save pathToOpen to window state 2013-06-11 14:17:20 -07:00
Corey Johnson & Kevin Sawicki
bcc16fbefe Remove hash params from url
Load settings are now stored on the browser window.
2013-06-11 11:17:16 -07:00
Kevin Sawicki
4fdaf6dead Always open untitled editor when no path to open
Refs #577
2013-06-07 10:54:51 -07:00
Kevin Sawicki
dea0e08d93 Use hash instead of query string for parameters
This allows the pathToOpen to be changed when the project
path changes.

Previously if the untitled window file was saved, the project
path would be forever associated with the undefined window.

Now when the project path changes, the pathToOpen changes so
that the state is persisted to the project area and the untitled
window never has a project.
2013-06-07 10:50:06 -07:00
Kevin Sawicki
3683f7e097 Move show() to atom.coffee
Co-locates it with hide() and focus() which are similar.
2013-06-03 10:43:43 -07:00
Cheng Zhao
db85792c59 Center the window by default, instead of position of (0, 0). 2013-05-30 22:16:15 +08:00
Cheng Zhao
e2a18e3487 Hide window when window is going to close, not when unloading.
Otherwise reloading window would also hide and then show window, which
makes things weird.
2013-05-24 21:58:14 +08:00
Cheng Zhao
7bb6a7c1e8 Restore window dimensions after atom.windowMode is set.
It's required to set atom.windowMode before getting window state.
2013-05-24 21:52:03 +08:00
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