push up calltip_ignore_arg.patch
[nedit-bw.git] / enhanced-transient.patch
bloba5532cf74830f28f3ea1697956eadd299b50a6e6
1 enhancements to the transient feature:
3 * saving an transient buffer removes the transient flag
4 * new transient windows get a "Transient" name instead of a "Untitled" name
5 * $transient macro variable
6 * modified transient windows don't get a "*" in the tabs/windows menu
7 * window title formatting support for transient windows (not complete)
9 ---
11 source/file.c | 45 +++++++++++++++++++++++++++++--------------
12 source/file.h | 2 -
13 source/highlightData.c | 2 -
14 source/macro.c | 11 ++++++++++
15 source/menu.c | 14 ++++++++-----
16 source/window.c | 32 ++++++++++++++----------------
17 source/windowTitle.c | 51 ++++++++++++++++++++++++++++++++++++++-----------
18 source/windowTitle.h | 1
19 8 files changed, 109 insertions(+), 49 deletions(-)
21 diff --quilt old/source/file.c new/source/file.c
22 --- old/source/file.c
23 +++ new/source/file.c
24 @@ -123,11 +123,11 @@ WindowInfo *EditNewFile(WindowInfo *inWi
25 WindowInfo *window;
27 /*... test for creatability? */
29 /* Find a (relatively) unique name for the new file */
30 - UniqueUntitledName(name);
31 + UniqueUntitledName(name, transient);
33 /* create new window/document */
34 if (inWindow)
35 window = CreateDocument(inWindow, name);
36 else
37 @@ -1070,10 +1070,20 @@ static int doSave(WindowInfo *window)
38 window->fileMissing = TRUE;
39 window->device = 0;
40 window->inode = 0;
43 + /* If the window was previously transient and the user saves it, than he
44 + obviously don't want the window to be transient anymore */
45 + if (window->transient) {
46 + /* Set the window to transient mode. */
47 + String apParams[1];
49 + apParams[0] = "0";
50 + XtCallActionProc(window->lastFocus, "set_transient", NULL, apParams, 1);
51 + }
53 fileNameArg.tag = STRING_TAG;
54 AllocNStringNCpy(&fileNameArg.val.str, fullname, MAXPATHLEN);
55 MacroApplyHook(window, "post_save_hook", 1, &fileNameArg, NULL);
57 return TRUE;
58 @@ -1551,28 +1561,35 @@ int PromptForNewFile(WindowInfo *window,
62 ** Find a name for an untitled file, unique in the name space of in the opened
63 ** files in this session, i.e. Untitled or Untitled_nn, and write it into
64 -** the string "name".
65 +** the string "name" (minimal length MAXPATHLEN).
67 -void UniqueUntitledName(char *name)
68 +void UniqueUntitledName(char *name, Boolean transient)
70 WindowInfo *w;
71 int i;
72 + const char *base = transient ? "Transient" : "Untitled";
73 + char *tail;
74 + size_t base_len = strlen(base);
75 + size_t total_space = MAXPATHLEN;
77 + snprintf(name, MAXPATHLEN, "%s", base);
78 + tail = name + base_len;
79 + total_space -= base_len;
81 + i = 0;
82 + do {
83 + for (w = WindowList; w != NULL; w = w->next)
84 + if (!strcmp(w->filename, name))
85 + break;
86 + if (w == NULL)
87 + break;
89 - for (i=0; i<INT_MAX; i++) {
90 - if (i == 0)
91 - sprintf(name, "Untitled");
92 - else
93 - sprintf(name, "Untitled_%d", i);
94 - for (w=WindowList; w!=NULL; w=w->next)
95 - if (!strcmp(w->filename, name))
96 - break;
97 - if (w == NULL)
98 - break;
99 - }
100 + snprintf(tail, total_space, "_%d", ++i);
101 + } while (i < INT_MAX);
105 ** Callback that guards us from trying to access a window after it has
106 ** been destroyed while a modal dialog is up.
107 diff --quilt old/source/file.h new/source/file.h
108 --- old/source/file.h
109 +++ new/source/file.h
110 @@ -63,9 +63,9 @@ int IncludeFile(WindowInfo *window, cons
111 int PromptForExistingFile(WindowInfo *window, char *prompt, char *fullname);
112 int PromptForNewFile(WindowInfo *window, char *prompt, char *fullname,
113 int *fileFormat, int *addWrap);
114 int CheckReadOnly(WindowInfo *window);
115 void RemoveBackupFile(WindowInfo *window);
116 -void UniqueUntitledName(char *name);
117 +void UniqueUntitledName(char *name, Boolean transient);
118 void CheckForChangesToFile(WindowInfo *window);
120 #endif /* NEDIT_FILE_H_INCLUDED */
121 diff --quilt old/source/highlightData.c new/source/highlightData.c
122 --- old/source/highlightData.c
123 +++ new/source/highlightData.c
124 @@ -546,11 +546,11 @@ static char *DefaultPatternSets[] = {
125 Wrong logical ops:\"&&|\\|\\|\":::Plain::\n\
126 Logical operators:\"~|&|\\|\":::Text Arg2::}",
127 "NEdit Macro:2:0{\n\
128 README:\"NEdit Macro syntax highlighting patterns, version 2.6, maintainer Thorsten Haude, nedit at thorstenhau.de\":::Flag::D\n\
129 Comment:\"#\":\"$\"::Comment::\n\
130 - Built-in Misc Vars:\"(?<!\\Y)\\$(?:active_pane|args|calltip_ID|column|cursor|display_width|empty_array|file_name|file_path|language_mode|line|locked|max_font_width|min_font_width|modified|n_display_lines|n_panes|rangeset_list|read_only|selection_(?:start|end|left|right)|server_name|text_length|top_line|VERSION|NEDIT_HOME)>\":::Identifier::\n\
131 + Built-in Misc Vars:\"(?<!\\Y)\\$(?:active_pane|args|calltip_ID|column|cursor|display_width|empty_array|file_name|file_path|language_mode|line|locked|max_font_width|min_font_width|modified|n_display_lines|n_panes|rangeset_list|read_only|selection_(?:start|end|left|right)|server_name|text_length|top_line|transient|VERSION|NEDIT_HOME)>\":::Identifier::\n\
132 Built-in Pref Vars:\"(?<!\\Y)\\$(?:auto_indent|em_tab_dist|file_format|font_name|font_name_bold|font_name_bold_italic|font_name_italic|highlight_syntax|incremental_backup|incremental_search_line|make_backup_copy|match_syntax_based|overtype_mode|show_line_numbers|show_matching|statistics_line|tab_dist|use_tabs|wrap_margin|wrap_text)>\":::Identifier2::\n\
133 Built-in Special Vars:\"(?<!\\Y)\\$(?:[1-9]|list_dialog_button|n_args|read_status|search_end|shell_cmd_status|string_dialog_button|sub_sep)>\":::String1::\n\
134 Built-in Subrs:\"<(?:append_file|beep|call|calltip|clipboard_to_string|dialog|filename_dialog|focus_window|get_character|get_pattern_(by_name|at_pos)|get_range|get_selection|get_style_(by_name|at_pos)|getenv|highlight_calltip_line|kill_calltip|length|list_dialog|max|min|rangeset_(?:add|create|destroy|get_by_name|includes|info|invert|range|set_color|set_mode|set_name|subtract)|read_file|replace_in_string|replace_range|replace_selection|replace_substring|search|search_string|select|select_rectangle|set_cursor_pos|set_transient|shell_command|split|string_compare|string_dialog|string_to_clipboard|substring|t_print|tolower|toupper|typeof|valid_number|write_file)(?=\\s*\\()\":::Subroutine::\n\
135 Menu Actions:\"<(?:new(?:_tab|_opposite)?|open|open-dialog|open_dialog|open-selected|open_selected|close|save|save-as|save_as|save-as-dialog|save_as_dialog|revert-to-saved|revert_to_saved|revert_to_saved_dialog|include-file|include_file|include-file-dialog|include_file_dialog|load-macro-file|load_macro_file|load-macro-file-dialog|load_macro_file_dialog|load-tags-file|load_tags_file|load-tags-file-dialog|load_tags_file_dialog|unload_tags_file|load_tips_file|load_tips_file_dialog|unload_tips_file|print|print-selection|print_selection|exit|undo|redo|delete|select-all|select_all|shift-left|shift_left|shift-left-by-tab|shift_left_by_tab|shift-right|shift_right|shift-right-by-tab|shift_right_by_tab|find|find-dialog|find_dialog|find-again|find_again|find-selection|find_selection|find_incremental|start_incremental_find|replace|replace-dialog|replace_dialog|replace-all|replace_all|replace-in-selection|replace_in_selection|replace-again|replace_again|replace_find|replace_find_same|replace_find_again|goto-line-number|goto_line_number|goto-line-number-dialog|goto_line_number_dialog|goto-selected|goto_selected|mark|mark-dialog|mark_dialog|goto-mark|goto_mark|goto-mark-dialog|goto_mark_dialog|match|select_to_matching|goto_matching|find-definition|find_definition|show_tip|split-pane|split_pane|close-pane|close_pane|detach_document(?:_dialog)?|move_document_dialog|(?:next|previous|last)_document|uppercase|lowercase|fill-paragraph|fill_paragraph|control-code-dialog|control_code_dialog|filter-selection-dialog|filter_selection_dialog|filter-selection|filter_selection|execute-command|execute_command|execute-command-dialog|execute_command_dialog|execute-command-line|execute_command_line|shell-menu-command|shell_menu_command|macro-menu-command|macro_menu_command|bg_menu_command|post_window_bg_menu|post_tab_context_menu|beginning-of-selection|beginning_of_selection|end-of-selection|end_of_selection|repeat_macro|repeat_dialog|raise_window|focus_pane|set_statistics_line|set_incremental_search_line|set_show_line_numbers|set_auto_indent|set_wrap_text|set_wrap_margin|set_highlight_syntax|set_make_backup_copy|set_incremental_backup|set_show_matching|set_match_syntax_based|set_overtype_mode|set_locked|set_tab_dist|set_em_tab_dist|set_use_tabs|set_fonts|set_language_mode)(?=\\s*\\()\":::Subroutine::\n\
136 Text Actions:\"<(?:self-insert|self_insert|grab-focus|grab_focus|extend-adjust|extend_adjust|extend-start|extend_start|extend-end|extend_end|secondary-adjust|secondary_adjust|secondary-or-drag-adjust|secondary_or_drag_adjust|secondary-start|secondary_start|secondary-or-drag-start|secondary_or_drag_start|process-bdrag|process_bdrag|move-destination|move_destination|move-to|move_to|move-to-or-end-drag|move_to_or_end_drag|end_drag|copy-to|copy_to|copy-to-or-end-drag|copy_to_or_end_drag|exchange|process-cancel|process_cancel|paste-clipboard|paste_clipboard|copy-clipboard|copy_clipboard|cut-clipboard|cut_clipboard|copy-primary|copy_primary|cut-primary|cut_primary|newline|newline-and-indent|newline_and_indent|newline-no-indent|newline_no_indent|delete-selection|delete_selection|delete-previous-character|delete_previous_character|delete-next-character|delete_next_character|delete-previous-word|delete_previous_word|delete-next-word|delete_next_word|delete-to-start-of-line|delete_to_start_of_line|delete-to-end-of-line|delete_to_end_of_line|forward-character|forward_character|backward-character|backward_character|key-select|key_select|process-up|process_up|process-down|process_down|process-shift-up|process_shift_up|process-shift-down|process_shift_down|process-home|process_home|forward-word|forward_word|backward-word|backward_word|forward-paragraph|forward_paragraph|backward-paragraph|backward_paragraph|beginning-of-line|beginning_of_line|end-of-line|end_of_line|beginning-of-file|beginning_of_file|end-of-file|end_of_file|next-page|next_page|previous-page|previous_page|page-left|page_left|page-right|page_right|toggle-overstrike|toggle_overstrike|scroll-up|scroll_up|scroll-down|scroll_down|scroll_left|scroll_right|scroll-to-line|scroll_to_line|select-all|select_all|deselect-all|deselect_all|focusIn|focusOut|process-return|process_return|process-tab|process_tab|insert-string|insert_string|mouse_pan)(?=\\s*\\()\":::Subroutine::\n\
137 diff --quilt old/source/macro.c new/source/macro.c
138 --- old/source/macro.c
139 +++ new/source/macro.c
140 @@ -344,10 +344,12 @@ static int emTabDistMV(WindowInfo *windo
141 DataValue *result, char **errMsg);
142 static int useTabsMV(WindowInfo *window, DataValue *argList, int nArgs,
143 DataValue *result, char **errMsg);
144 static int modifiedMV(WindowInfo *window, DataValue *argList, int nArgs,
145 DataValue *result, char **errMsg);
146 +static int transientMV(WindowInfo *window, DataValue *argList, int nArgs,
147 + DataValue *result, char **errMsg);
148 static int languageModeMV(WindowInfo *window, DataValue *argList, int nArgs,
149 DataValue *result, char **errMsg);
150 static int calltipIDMV(WindowInfo *window, DataValue *argList, int nArgs,
151 DataValue *result, char **errMsg);
152 static int readSearchArgs(DataValue *argList, int nArgs, int*searchDirection,
153 @@ -529,10 +531,11 @@ static const BuiltInSubrName SpecialVars
154 { "$backlight_string", backlightStringMV },
156 { "$rangeset_list", rangesetListMV },
157 { "$VERSION", versionMV },
158 { "$NEDIT_HOME", neditHomeMV },
159 + { "$transient", transientMV },
160 { NULL, NULL } /* sentinel */
163 /* Global symbols for "returning" secondary values from built-in functions */
164 static int STRING_DIALOG_BUTTON, SEARCH_END, READ_STATUS,
165 @@ -4758,10 +4761,18 @@ static int modifiedMV(WindowInfo *window
166 result->tag = INT_TAG;
167 result->val.n = window->fileChanged;
168 return True;
171 +static int transientMV(WindowInfo *window, DataValue *argList, int nArgs,
172 + DataValue *result, char **errMsg)
174 + result->tag = INT_TAG;
175 + result->val.n = window->transient;
176 + return True;
179 static int languageModeMV(WindowInfo *window, DataValue *argList, int nArgs,
180 DataValue *result, char **errMsg)
182 char *lmName = LanguageModeName(window->languageMode);
184 diff --quilt old/source/menu.c new/source/menu.c
185 --- old/source/menu.c
186 +++ new/source/menu.c
187 @@ -3212,11 +3212,12 @@ static void exitAP(Widget w, XEvent *eve
188 user really wants to exit */
189 ptr = exitMsg;
190 lineLen = 0;
191 strcpy(ptr, "Editing: "); ptr += 9; lineLen += 9;
192 for (win=WindowList; win!=NULL; win=win->next) {
193 - sprintf(filename, "%s%s", win->filename, win->fileChanged? "*": "");
194 + sprintf(filename, "%s%s", win->filename,
195 + (win->fileChanged && !win->transient) ? "*": "");
196 title = filename;
197 titleLen = strlen(title);
198 if (ptr - exitMsg + titleLen + 30 >= DF_MAX_MSG_LENGTH) {
199 strcpy(ptr, "..."); ptr += 3;
200 break;
201 @@ -4356,10 +4357,13 @@ static void setTransientAP(Widget text,
203 window->transient = newState;
204 if (IsTopDocument(window)) {
205 XmToggleButtonSetState(window->transientItem, window->transient, False);
208 + UpdateWindowTitle(window);
209 + RefreshTabState(window);
212 static void setTabDistAP(Widget w, XEvent *event, String *args,
213 Cardinal *nArgs)
215 @@ -4739,16 +4743,16 @@ void AddToPrevOpenMenu(const char *filen
217 /* Write the menu contents to disk to restore in later sessions */
218 WriteNEditDB();
221 -static char* getWindowsMenuEntry(const WindowInfo* window)
222 +static char *getWindowsMenuEntry(const WindowInfo *window)
224 - static char fullTitle[MAXPATHLEN * 2 + 3+ 1];
225 + static char fullTitle[MAXPATHLEN * 2 + 4 + 1];
227 - sprintf(fullTitle, "%s%s", window->filename,
228 - window->fileChanged? "*" : "");
229 + sprintf(fullTitle, "%s%s", window->filename,
230 + (window->fileChanged && !window->transient) ? "*" : "");
232 if (GetPrefShowPathInWindowsMenu() && window->filenameSet)
234 strcat(fullTitle, " - ");
235 strcat(fullTitle, window->path);
236 diff --quilt old/source/window.c new/source/window.c
237 --- old/source/window.c
238 +++ new/source/window.c
239 @@ -974,11 +974,11 @@ void CloseWindow(WindowInfo *window)
241 /* if this is the last window, or must be kept alive temporarily because
242 it's running the macro calling us, don't close it, make it Untitled */
243 if (keepWindow || (WindowList == window && window->next == NULL)) {
244 window->filename[0] = '\0';
245 - UniqueUntitledName(name);
246 + UniqueUntitledName(name, False);
247 CLEAR_ALL_LOCKS(window->lockReasons);
248 window->fileMode = 0;
249 window->fileUid = 0;
250 window->fileGid = 0;
251 strcpy(window->filename, name);
252 @@ -2072,27 +2072,28 @@ void UpdateWindowTitle(const WindowInfo
254 if (!IsTopDocument(window))
255 return;
257 title = FormatWindowTitle(window->filename,
258 - window->path,
259 + window->path,
260 #ifdef VMS
261 - NULL,
262 + NULL,
263 #else
264 - GetClearCaseViewTag(),
265 + GetClearCaseViewTag(),
266 #endif /* VMS */
267 - GetPrefServerName(),
268 - IsServer,
269 - window->filenameSet,
270 - window->lockReasons,
271 - window->fileChanged,
272 - GetPrefTitleFormat());
273 + GetPrefServerName(),
274 + IsServer,
275 + window->filenameSet,
276 + window->lockReasons,
277 + window->fileChanged,
278 + window->transient,
279 + GetPrefTitleFormat());
281 iconTitle = XtMalloc(strlen(window->filename) + 2); /* strlen("*")+1 */
283 strcpy(iconTitle, window->filename);
284 - if (window->fileChanged)
285 + if (window->fileChanged && !window->transient)
286 strcat(iconTitle, "*");
287 XtVaSetValues(window->shell, XmNtitle, title, XmNiconName, iconTitle, NULL);
289 /* If there's a find or replace dialog up in "Keep Up" mode, with a
290 file name in the title, update it too */
291 @@ -3709,22 +3710,19 @@ void RefreshTabState(WindowInfo *win)
293 XmString s1, tipString;
294 char labelString[MAXPATHLEN];
295 char *tag = XmFONTLIST_DEFAULT_TAG;
296 unsigned char alignment;
297 + const char *star = (win->fileChanged && !win->transient) ? "*" : "";
299 /* Set tab label to document's filename. Position of
300 "*" (modified) will change per label alignment setting */
301 XtVaGetValues(win->tab, XmNalignment, &alignment, NULL);
302 if (alignment != XmALIGNMENT_END) {
303 - sprintf(labelString, "%s%s",
304 - win->fileChanged? "*" : "",
305 - win->filename);
306 + sprintf(labelString, "%s%s", star, win->filename);
307 } else {
308 - sprintf(labelString, "%s%s",
309 - win->filename,
310 - win->fileChanged? "*" : "");
311 + sprintf(labelString, "%s%s", win->filename, star);
314 /* Make the top document stand out a little more */
315 if (IsTopDocument(win))
316 tag = "BOLD";
317 diff --quilt old/source/windowTitle.c new/source/windowTitle.c
318 --- old/source/windowTitle.c
319 +++ new/source/windowTitle.c
320 @@ -99,10 +99,11 @@ static struct {
322 Widget oDirW;
323 Widget oCcViewTagW;
324 Widget oServerNameW;
325 Widget oFileChangedW;
326 + Widget oTransientW;
327 Widget oFileLockedW;
328 Widget oFileReadOnlyW;
329 Widget oServerEqualViewW;
331 char filename[MAXPATHLEN];
332 @@ -111,15 +112,16 @@ static struct {
333 char serverName[MAXPATHLEN];
334 int isServer;
335 int filenameSet;
336 int lockReasons;
337 int fileChanged;
338 + int transient;
340 int suppressFormatUpdate;
341 } etDialog = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
342 - NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
343 - NULL,NULL,"","","","",0,0,0,0,0};
344 + NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
345 + NULL,NULL,"","","","",0,0,0,0,0,0};
349 static char* removeSequence(char* sourcePtr, char c)
351 @@ -257,10 +259,11 @@ char *FormatWindowTitle(const char* file
352 const char* serverName,
353 int isServer,
354 int filenameSet,
355 int lockReasons,
356 int fileChanged,
357 + int transient,
358 const char* titleFormat)
360 static char title[WINDOWTITLE_MAX_LEN];
361 char *titlePtr = title;
362 char* titleEnd = title + WINDOWTITLE_MAX_LEN - 1;
363 @@ -359,18 +362,20 @@ char *FormatWindowTitle(const char* file
364 titlePtr = safeStrCpy(titlePtr, titleEnd, GetNameOfHost());
365 break;
367 case 'S': /* file status */
368 fileStatusPresent = True;
369 - if (IS_ANY_LOCKED_IGNORING_USER(lockReasons) && fileChanged)
370 + if (IS_ANY_LOCKED_IGNORING_USER(lockReasons) && fileChanged && !transient)
371 titlePtr = safeStrCpy(titlePtr, titleEnd, "read only, modified");
372 else if (IS_ANY_LOCKED_IGNORING_USER(lockReasons))
373 titlePtr = safeStrCpy(titlePtr, titleEnd, "read only");
374 - else if (IS_USER_LOCKED(lockReasons) && fileChanged)
375 + else if (IS_USER_LOCKED(lockReasons) && fileChanged && !transient)
376 titlePtr = safeStrCpy(titlePtr, titleEnd, "locked, modified");
377 else if (IS_USER_LOCKED(lockReasons))
378 titlePtr = safeStrCpy(titlePtr, titleEnd, "locked");
379 + else if (transient)
380 + titlePtr = safeStrCpy(titlePtr, titleEnd, "transient");
381 else if (fileChanged)
382 titlePtr = safeStrCpy(titlePtr, titleEnd, "modified");
383 break;
385 case 'u': /* user name */
386 @@ -386,18 +391,20 @@ char *FormatWindowTitle(const char* file
387 fileStatusPresent = True;
388 if (*titleFormat && *titleFormat == 'S')
390 ++titleFormat;
391 shortStatus = True;
392 - if (IS_ANY_LOCKED_IGNORING_USER(lockReasons) && fileChanged)
393 + if (IS_ANY_LOCKED_IGNORING_USER(lockReasons) && fileChanged && !transient)
394 titlePtr = safeStrCpy(titlePtr, titleEnd, "RO*");
395 else if (IS_ANY_LOCKED_IGNORING_USER(lockReasons))
396 titlePtr = safeStrCpy(titlePtr, titleEnd, "RO");
397 - else if (IS_USER_LOCKED(lockReasons) && fileChanged)
398 + else if (IS_USER_LOCKED(lockReasons) && fileChanged && !transient)
399 titlePtr = safeStrCpy(titlePtr, titleEnd, "LO*");
400 else if (IS_USER_LOCKED(lockReasons))
401 titlePtr = safeStrCpy(titlePtr, titleEnd, "LO");
402 + else if (transient)
403 + titlePtr = safeStrCpy(titlePtr, titleEnd, "TR");
404 else if (fileChanged)
405 titlePtr = safeStrCpy(titlePtr, titleEnd, "*");
406 break;
408 /* fall-through */
409 @@ -462,10 +469,11 @@ char *FormatWindowTitle(const char* file
413 /* Enable/disable test buttons, depending on presence of codes */
414 XtSetSensitive(etDialog.oFileChangedW, fileStatusPresent);
415 + XtSetSensitive(etDialog.oTransientW, fileStatusPresent);
416 XtSetSensitive(etDialog.oFileReadOnlyW, fileStatusPresent);
417 XtSetSensitive(etDialog.oFileLockedW, fileStatusPresent &&
418 !IS_PERM_LOCKED(etDialog.lockReasons));
420 XtSetSensitive(etDialog.oServerNameW, serverNamePresent);
421 @@ -491,10 +499,12 @@ static void setToggleButtons(void)
423 XmToggleButtonSetState(etDialog.oDirW,
424 etDialog.filenameSet == True, False);
425 XmToggleButtonSetState(etDialog.oFileChangedW,
426 etDialog.fileChanged == True, False);
427 + XmToggleButtonSetState(etDialog.oTransientW,
428 + etDialog.transient == True, False);
429 XmToggleButtonSetState(etDialog.oFileReadOnlyW,
430 IS_PERM_LOCKED(etDialog.lockReasons), False);
431 XmToggleButtonSetState(etDialog.oFileLockedW,
432 IS_USER_LOCKED(etDialog.lockReasons), False);
433 /* Read-only takes precedence on locked */
434 @@ -557,10 +567,11 @@ static void formatChangedCB(Widget w, Xt
435 serverName,
436 etDialog.isServer,
437 filenameSet,
438 etDialog.lockReasons,
439 XmToggleButtonGetState(etDialog.oFileChangedW),
440 + XmToggleButtonGetState(etDialog.oTransientW),
441 format);
442 XtFree(format);
443 XmTextFieldSetString(etDialog.previewW, title);
446 @@ -587,10 +598,16 @@ static void fileChangedCB(Widget w, XtPo
448 etDialog.fileChanged = XmToggleButtonGetState(w);
449 formatChangedCB(w, clientData, callData);
452 +static void transientCB(Widget w, XtPointer clientData, XtPointer callData)
454 + etDialog.transient = XmToggleButtonGetState(w);
455 + formatChangedCB(w, clientData, callData);
458 static void fileLockedCB(Widget w, XtPointer clientData, XtPointer callData)
460 SET_USER_LOCKED(etDialog.lockReasons, XmToggleButtonGetState(w));
461 formatChangedCB(w, clientData, callData);
463 @@ -1274,39 +1291,50 @@ static void createEditTitleDialog(Widget
464 XmNtopWidget, testLbl,
465 XmNlabelString, s1=XmStringCreateSimple("File modified"),
466 XmNmnemonic, 'o', NULL);
467 XtAddCallback(etDialog.oFileChangedW, XmNvalueChangedCallback, fileChangedCB, NULL);
468 XmStringFree(s1);
470 - etDialog.oFileReadOnlyW = XtVaCreateManagedWidget("fileReadOnly",
471 - xmToggleButtonWidgetClass, previewBox,
473 + etDialog.oTransientW = XtVaCreateManagedWidget("transient",
474 + xmToggleButtonWidgetClass, previewBox,
475 XmNleftAttachment, XmATTACH_WIDGET,
476 XmNleftWidget, etDialog.oFileChangedW,
477 XmNtopAttachment, XmATTACH_WIDGET,
478 XmNtopWidget, testLbl,
479 + XmNlabelString, s1=XmStringCreateSimple("File transient"),
480 + XmNmnemonic, 't', NULL);
481 + XtAddCallback(etDialog.oTransientW, XmNvalueChangedCallback, transientCB, NULL);
482 + XmStringFree(s1);
484 + etDialog.oFileReadOnlyW = XtVaCreateManagedWidget("fileReadOnly",
485 + xmToggleButtonWidgetClass, previewBox,
486 + XmNleftAttachment, XmATTACH_POSITION,
487 + XmNleftPosition, RADIO_INDENT,
488 + XmNtopAttachment, XmATTACH_WIDGET,
489 + XmNtopWidget, etDialog.oFileChangedW,
490 XmNlabelString, s1=XmStringCreateSimple("File read only"),
491 XmNmnemonic, 'n', NULL);
492 XtAddCallback(etDialog.oFileReadOnlyW, XmNvalueChangedCallback, fileReadOnlyCB, NULL);
493 XmStringFree(s1);
495 etDialog.oFileLockedW = XtVaCreateManagedWidget("fileLocked",
496 xmToggleButtonWidgetClass, previewBox,
497 XmNleftAttachment, XmATTACH_WIDGET,
498 XmNleftWidget, etDialog.oFileReadOnlyW,
499 XmNtopAttachment, XmATTACH_WIDGET,
500 - XmNtopWidget, testLbl,
501 + XmNtopWidget, etDialog.oFileChangedW,
502 XmNlabelString, s1=XmStringCreateSimple("File locked"),
503 XmNmnemonic, 'l', NULL);
504 XtAddCallback(etDialog.oFileLockedW, XmNvalueChangedCallback, fileLockedCB, NULL);
505 XmStringFree(s1);
507 etDialog.oServerNameW = XtVaCreateManagedWidget("servernameSet",
508 xmToggleButtonWidgetClass, previewBox,
509 XmNleftAttachment, XmATTACH_POSITION,
510 XmNleftPosition, RADIO_INDENT,
511 XmNtopAttachment, XmATTACH_WIDGET,
512 - XmNtopWidget, etDialog.oFileChangedW,
513 + XmNtopWidget, etDialog.oFileReadOnlyW,
514 XmNlabelString, s1=XmStringCreateSimple("Server name present"),
515 XmNmnemonic, 'v', NULL);
516 XtAddCallback(etDialog.oServerNameW, XmNvalueChangedCallback, serverNameCB, NULL);
517 XmStringFree(s1);
519 @@ -1455,10 +1483,11 @@ void EditCustomTitleFormat(WindowInfo *w
520 "servername");
521 etDialog.isServer = IsServer;
522 etDialog.filenameSet = window->filenameSet;
523 etDialog.lockReasons = window->lockReasons;
524 etDialog.fileChanged = window->fileChanged;
525 + etDialog.transient = window->transient;
527 if (etDialog.window != window && etDialog.form)
529 /* Destroy the dialog owned by the other window.
530 Note: don't rely on the destroy event handler to reset the
531 diff --quilt old/source/windowTitle.h new/source/windowTitle.h
532 --- old/source/windowTitle.h
533 +++ new/source/windowTitle.h
534 @@ -40,10 +40,11 @@ char *FormatWindowTitle(const char* file
535 const char* serverName,
536 int isServer,
537 int filenameSet,
538 int lockReasons,
539 int fileChanged,
540 + int transient,
541 const char* titleFormat);
543 void EditCustomTitleFormat(WindowInfo *window);
545 #endif /* NEDIT_WINDOWTITLE_H_INCLUDED */