Commit Graph

55 Commits

Author SHA1 Message Date
Allan Odgaard
b049dd8892 Opening folder sets up window title/scope attributes 2012-09-18 22:57:03 +02:00
Ryan Maxwell
c24f365daa Use curly quotes in dialog text 2012-09-18 20:28:07 +02:00
Allan Odgaard
361d2daa5b Fix wrong document showing after session restore
Since documents are loaded asynchronously and we trigger a request for the first tab’s document, this might finish loading after the selected tab’s document, hence trigger a setDocument: after we loaded the selected document’s tab.
2012-09-18 19:38:01 +02:00
Allan Odgaard
48616a7ea1 Make document_t::scope private
Ideally should be removed entirely but as document presently does load/save where we need scopes (for import/export commands), we need it internally.
2012-09-18 19:38:01 +02:00
Allan Odgaard
79b0f7a14a Setup scope attributes for untitled documents
These are based on the potential save directory (i.e. the one showing in the file browser) and ensures pressing ⌥⌘N gives the new document proper project and SCM scopes (so ⌘Y and ⌘B works as expected).

This fixes issue #367.
2012-09-18 17:33:02 +02:00
Allan Odgaard
45763d4afc Don’t require file to get SCM info
We didn’t actually use the file itself, only its parent directory, and there are several places we want SCM info for an untitled file’s project directory, so removing the need for a file simplifies things.
2012-09-18 17:33:02 +02:00
Allan Odgaard
848d197f7a Use DocumentController over document_t 2012-09-18 17:33:01 +02:00
Allan Odgaard
c26e5c2d36 Scope attributes are now given to editor_t
While presently it works the same, it allows us to provide better scope attributes e.g. for untitled documents (which lack SCM attributes).
2012-09-18 17:33:01 +02:00
Allan Odgaard
dabcad588d Introduce OakTextViewDelegate 2012-09-18 17:33:00 +02:00
Allan Odgaard
08666a37ba Fix type error 2012-09-18 17:33:00 +02:00
Allan Odgaard
d5b4573694 Simplify closing tab/split action methods 2012-09-17 16:42:42 +02:00
Allan Odgaard
effa1577ac Don’t call setBottomCornerRounded:NO
This is private API and no longer seems necessary.
2012-09-17 16:42:42 +02:00
Allan Odgaard
d4f6cbacf3 Simplify code
If the window hadn’t been loaded yet, we previously had to delay opening the document when changing tab (in code).

Since we now create the window in the initializer, there is no longer need for this.
2012-09-16 17:03:03 +02:00
Allan Odgaard
7cd8ae4b8e Add safety checks
Since 10% of reported crashes are in synchronizeWindowTitle and seems to be about not having a proper document pointer, I am adding these checks and some debug output — don’t understand how we would get into this situation though.
2012-09-16 11:41:25 +02:00
Allan Odgaard
5ab65ea560 fixup! Constrain size of splits in main window
Forgot to enable ‘autorecalculatesKeyViewLoop’.
2012-09-16 11:41:24 +02:00
Allan Odgaard
d5a73dfca9 Don’t present dot files as having an extension
This is just for the dialog text when user is asked to select a file type.
2012-09-16 11:41:24 +02:00
Allan Odgaard
363ba94fb8 Fix format string in xib
Was using the (undefined) ‘Extension’ variable instead of ‘X’.
2012-09-16 11:41:23 +02:00
Allan Odgaard
1fafbecd54 Remove Chinese translation
It’s not feasible to maintain the old-style xib translations while we work on the UI. We’ll soon move fully to constraint-based layout which should allow translations to be purely string-based.
2012-09-16 11:41:23 +02:00
Allan Odgaard
84104c8d9b Constrain size of splits in main window
The main window has now moved fully to constraint based layout which makes it a lot easier to tweak the layout and fixes issue #145.

Presently the option to have HTML output on the right is not supported. It will likely be back with a few other options that have been requested.

The width of file browser and height of HTML output view is always read from defaults rather than restored from previous session. Effectively this results in the same behavior except when there are multiple windows with different sizing of these splits. Unsure if per-window sizes should be brought back.
2012-09-15 15:12:58 +02:00
Allan Odgaard
baae923414 Remove resize buttons
Going forward we only allow resizing views by grabbing the dividers.
2012-09-15 15:12:57 +02:00
Allan Odgaard
3d3e44e1a4 Add TM_CURRENT_THEME_PATH
There’s a few commands which want to read settings from the current theme. So far these have been reading the theme UUID from TextMate’s settings and scanned the disk to find the corresponding property list.

This is pretty bad because theme UUID can be set in different ways, themes can be in arbitrary bundles, and the property lists can be in delta format.

The latter is not solved, though we ensure the variable point to the base theme, incase a delta exist. TextMate could simply write a non-delta version of the theme to TMPDIR and let the variable point to that, so we’re not really limiting ourself by adding this variable.
2012-09-12 18:30:37 +02:00
Allan Odgaard
28f80a791d Use project’s window title settings for untitled documents
This includes setting up SCM variables and closes issue #298.
2012-09-11 00:05:05 +02:00
Allan Odgaard
cf5b5965da Don’t send theme bundle items to OakTextView
Since the text view delegates theme switching to its parent document view, we just send the theme (bundle item) directly to the document view.
2012-09-10 22:47:58 +02:00
Allan Odgaard
111c1acd11 Refactor: Remove code duplication 2012-09-10 14:24:05 +02:00
Allan Odgaard
b475bdfdef Refactoring 2012-09-10 14:24:04 +02:00
Allan Odgaard
521b981f09 fixup! Fix warning for literal strings used with NSAlert
Since we use another way to initialize the alert, the return codes are different.
2012-09-07 16:17:18 +02:00
Allan Odgaard
18175e455a Position filter lists relative to parent window
I am not sure if this is desired for the Go to Symbol as some people prefer to keep this open at all time.
2012-09-04 19:22:51 +02:00
Zach Drayer
99fd86dab6 Fix warning for literal strings used with NSAlert
__attribute__((format(...))) was added to NSAlert's class-based initializer in 10.7, and due to using string objects instead of literals as informative text, Clang is unable to guarantee the safety of the formatter, and, as such, issues a warning.
2012-09-03 16:42:16 +02:00
Adam Strzelecki
c28d2ec2fd Update window title when application is activated.
Variables customizing `windowTitle` such as `$TM_SCM_BRANCH` can change while TM is inactive, while user is working in command line or different app. So it is better to refresh `windowTitle` once we get back to TM.
2012-08-28 22:36:02 +02:00
Jacob Bandes-Storch
d4ce498f60 Use 64-bit: numeric type fixes
Unfortunately a printf precision specifier (‘%.*s’) can not come with a width specifier so we have to cast to int. The width specifier ‘t’ is used for ptrdiff_t.
The int → NSInteger change fixed a bug with popup menu positioning, but there was no associated warning or error. It's possible there are more such bugs that we haven't found yet!
2012-08-28 21:32:47 +02:00
Jacob Bandes-Storch
dfdde3283f Use 64-bit: explicit visibility where required 2012-08-28 21:32:47 +02:00
Jacob Bandes-Storch
0fcb4c2d2c Use libc++: don’t rely on implicit conversions 2012-08-28 20:10:55 +02:00
Jacob Bandes-Storch
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +02:00
Jacob Bandes-Storch
40db25c712 Title case tab context menu items 2012-08-27 01:03:16 +02:00
Lukasz Czekaj
19457ad2e8 Fixed negative height bug in htmlOutputView
After dragging the HTML Output window down below the bottom of the main
window it cannot be dragged back and negative height of HTML Output is
saved to file.
2012-08-26 17:48:47 +02:00
Allan Odgaard
6f45ee4a9c Use encoding::type for open related API 2012-08-26 17:06:38 +02:00
Allan Odgaard
d1de4a8854 Use encoding::type for save related API
There is also a new document_t::encoding_for_save_as_path which returns the encoding that would be used for the document, if saved at the given path. If the document was loaded from disk, it will return the encoding used during load, otherwise it will check tmProperties for which encoding should be used for the path provided. Save dialog for untitled documents will be pre-populated with the result of the above function.
2012-08-26 16:13:20 +02:00
Allan Odgaard
0ca407b72c Move user defaults keys to Keys.{mm,h} 2012-08-25 23:14:15 +02:00
Allan Odgaard
360f7a33bd Add context menu to tab bar
This can be used to close current, other, and tabs on the right. Additionally to create a new tab (to the right of the tab showing the menu) or open the tab in a new window.

Closes issue #191.
2012-08-25 17:54:24 +02:00
Allan Odgaard
3c79f275f1 Use constants for settings keys 2012-08-23 17:15:12 +02:00
Gerd Knops
9d17d74b1b File Browser will now remember it's width
This closes issue #5.
2012-08-22 15:48:34 +02:00
Paul Wilde
cd84a864d2 Added Retina icons for bottom bar and file browser
As all the icons have been remade some of them should look better on non-retina also.

This closes issue #42.
2012-08-22 14:34:25 +02:00
Allan Odgaard
4e9d9414f1 Add encoding options to save dialogs
A minor caveat is that if there are encoding or newline (folder specific) settings in effect for the chosen path, these trump what’s selected in the save dialog.

If we wish to solve this, the best would be to update the options (shown in the save panel) based on selected folder/filename (and the settings in effect for that).

This closes issue #163.
2012-08-21 23:45:45 +02:00
Allan Odgaard
4606e4bca5 Simplify creating an OakEncodingPopUpButton
We now do the (sort of required) sizeToFit in the initializer. Users can still bypass this by using initWithFrame:pullsDown: instead of init:.
2012-08-20 22:36:12 +02:00
Allan Odgaard
cf1b4750e4 Go to Current Document is now a toggle
This also works as a (quick) way to deselect all in the file browser (i.e. hit ⌃⌘R twice) which is useful when one wants to run commands on the entire project (e.g. Git → Show Uncommitted Changes).
2012-08-18 15:30:24 +02:00
Bo Xiao
96cb899b53 Initial commit of Simplified Chinese localization for xib files. 2012-08-14 21:29:51 +02:00
Allan Odgaard
e5c2daa05a Revert "Use current document when no URL given in txmt URL"
Pending improved implementation which also handle the case where frontmost document is untitled.

This reverts commit 2beac7080b.
2012-08-14 18:43:37 +02:00
jtbandes
bf2fa756ce Fix xib warnings 2012-08-11 23:04:00 -07:00
jtbandes
ee11103d2d Change deployment target of all xibs to OS X 10.7 2012-08-11 23:04:00 -07:00
jtbandes
45b68389f2 Save all xibs with Xcode 4.4.1 (4F1003) 2012-08-11 23:04:00 -07:00