diff --git a/CHANGELOG.md b/CHANGELOG.md index 6982004..63e5922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add link to the Matrix room in the README (@MightyCreak) +### Changed + +- Replace `_` by `-` in the action names to be compatible with GTK action names (@MightyCreak) + +### Fixed + +- Some signals weren't properly renamed from the previous GTK3 migration (@MightyCreak) +- The syntax menu wasn't working anymore (@MightyCreak) + ## 0.8.1 - 2023-04-07 ### Changed diff --git a/data/usr/share/gnome/help/diffuse/C/diffuse.xml b/data/usr/share/gnome/help/diffuse/C/diffuse.xml index ef2563a..84f5bb4 100644 --- a/data/usr/share/gnome/help/diffuse/C/diffuse.xml +++ b/data/usr/share/gnome/help/diffuse/C/diffuse.xml @@ -644,7 +644,7 @@ - open_file + open-file FileOpen File... menu item Default: Ctrl+o @@ -652,7 +652,7 @@ - open_file_in_new_tab + open-file-in-new-tab FileOpen File In New Tab... menu item Default: Ctrl+t @@ -660,7 +660,7 @@ - open_modified_files + open-modified-files FileOpen Modified Files... menu item Default: Shift+Ctrl+O @@ -668,7 +668,7 @@ - open_commit + open-commit FileOpen Commit... menu item Default: Shift+Ctrl+T @@ -676,7 +676,7 @@ - reload_file + reload-file FileReload File menu item Default: Shift+Ctrl+R @@ -684,7 +684,7 @@ - save_file + save-file FileSave File menu item Default: Ctrl+s @@ -692,7 +692,7 @@ - save_file_as + save-file-as FileSave File As... menu item Default: Shift+Ctrl+A @@ -700,7 +700,7 @@ - save_all + save-all FileSave All menu item Default: Shift+Ctrl+S @@ -708,7 +708,7 @@ - new_2_way_file_merge + new-2-way-file-merge FileNew 2-Way File Merge menu item Default: Ctrl+2 @@ -716,7 +716,7 @@ - new_3_way_file_merge + new-3-way-file-merge FileNew 3-Way File Merge menu item Default: Ctrl+3 @@ -724,7 +724,7 @@ - new_n_way_file_merge + new-n-way-file-merge FileNew N-Way File Merge menu item Default: Ctrl+4 @@ -732,7 +732,7 @@ - close_tab + close-tab FileClose Tab menu item Default: Ctrl+w @@ -740,7 +740,7 @@ - undo_close_tab + undo-close-tab FileUndo Close Tab menu item Default: Shift+Ctrl+w @@ -796,7 +796,7 @@ - select_all + select-all EditSelect All menu item Default: Ctrl+a @@ -804,7 +804,7 @@ - clear_edits + clear-edits EditClear Edits menu item Default: Ctrl+r @@ -812,7 +812,7 @@ - dismiss_all_edits + dismiss-all-edits EditDismiss All Edits menu item Default: Ctrl+d @@ -828,7 +828,7 @@ - find_next + find-next EditFind Next menu item Default: Ctrl+g @@ -836,7 +836,7 @@ - find_previous + find-previous EditFind Previous menu item Default: Shift+Ctrl+G @@ -844,7 +844,7 @@ - go_to_line + go-to-line EditGo To Line... menu item Default: Shift+Ctrl+L @@ -860,7 +860,7 @@ - no_syntax_highlighting + no-syntax-highlighting ViewSyntax HighlightingNone menu item Default: None @@ -868,7 +868,7 @@ - syntax_highlighting_syntax + syntax-highlighting-syntax ViewSyntax Highlightingsyntax menu item Default: None @@ -876,7 +876,7 @@ - realign_all + realign-all ViewRealign All menu item Default: Ctrl+l @@ -892,7 +892,7 @@ - first_difference + first-difference ViewFirst Difference menu item Default: Shift+Ctrl+Up @@ -900,7 +900,7 @@ - previous_difference + previous-difference ViewPrevious Difference menu item Default: Ctrl+Up @@ -908,7 +908,7 @@ - next_difference + next-difference ViewNext Difference menu item Default: Ctrl+Down @@ -916,7 +916,7 @@ - last_difference + last-difference ViewLast Difference menu item Default: Shift+Ctrl+Down @@ -924,7 +924,7 @@ - first_tab + first-tab ViewFirst Tab menu item Default: Shift+Ctrl+Page_Up @@ -932,7 +932,7 @@ - previous_tab + previous-tab ViewPrevious Tab menu item Default: Ctrl+Page_Up @@ -940,7 +940,7 @@ - next_tab + next-tab ViewNext Tab menu item Default: Ctrl+Page_Down @@ -948,7 +948,7 @@ - last_tab + last-tab ViewLast Tab menu item Default: Shift+Ctrl+Page_Down @@ -956,7 +956,7 @@ - shift_pane_right + shift-pane-right ViewShift Pane Right menu item Default: Shift+Ctrl+parenleft @@ -964,7 +964,7 @@ - shift_pane_left + shift-pane-left ViewShift Pane Left menu item Default: Shift+Ctrl+parenright @@ -972,7 +972,7 @@ - convert_to_upper_case + convert-to-upper-case FormatConvert To Upper Case menu item Default: Ctrl+u @@ -980,7 +980,7 @@ - convert_to_lower_case + convert-to-lower-case FormatConvert To Lower Case menu item Default: Shift+Ctrl+U @@ -988,7 +988,7 @@ - sort_lines_in_ascending_order + sort-lines-in-ascending-order FormatSort Lines In Ascending Order menu item Default: Ctrl+y @@ -996,7 +996,7 @@ - sort_lines_in_descending_order + sort-lines-in-descending-order FormatSort Lines In Descending Order menu item Default: Shift+Ctrl+Y @@ -1004,7 +1004,7 @@ - remove_trailing_white_space + remove-trailing-white-space FormatRemove Trailing White Space menu item Default: Ctrl+k @@ -1012,7 +1012,7 @@ - convert_tabs_to_spaces + convert-tabs-to-spaces FormatConvert Tabs To Spaces menu item Default: Ctrl+b @@ -1020,7 +1020,7 @@ - convert_leading_spaces_to_tabs + convert-leading-spaces-to-tabs FormatConvert Leading Spaces To Tabs menu item Default: Shift+Ctrl+B @@ -1028,7 +1028,7 @@ - increase_indenting + increase-indenting FormatIncrease Indenting menu item Default: Shift+Ctrl+greater @@ -1036,7 +1036,7 @@ - decrease_indenting + decrease-indenting FormatDecrease Indenting menu item Default: Shift+Ctrl+less @@ -1044,7 +1044,7 @@ - convert_to_dos + convert-to-dos FormatConvert To DOS Format menu item Default: Shift+Ctrl+E @@ -1052,7 +1052,7 @@ - convert_to_mac + convert-to-mac FormatConvert To Mac Format menu item Default: Shift+Ctrl+C @@ -1060,7 +1060,7 @@ - convert_to_unix + convert-to-unix FormatConvert To Unix Format menu item Default: Ctrl+e @@ -1068,7 +1068,7 @@ - copy_selection_right + copy-selection-right MergeCopy Selection Right menu item Default: Shift+Ctrl+Right @@ -1076,7 +1076,7 @@ - copy_selection_left + copy-selection-left MergeCopy Selection Left menu item Default: Shift+Ctrl+Left @@ -1084,7 +1084,7 @@ - copy_left_into_selection + copy-left-into-selection MergeCopy Left Into Selection menu item Default: Ctrl+Right @@ -1092,7 +1092,7 @@ - copy_right_into_selection + copy-right-into-selection MergeCopy Right Into Selection menu item Default: Ctrl+Left @@ -1100,7 +1100,7 @@ - merge_from_left_then_right + merge-from-left-then-right MergeMerge From Left Then Right menu item Default: Ctrl+m @@ -1108,7 +1108,7 @@ - merge_from_right_then_left + merge-from-right-then-left MergeMerge From Right Then Left menu item Default: Shift+Ctrl+M @@ -1116,7 +1116,7 @@ - help_contents + help-contents HelpHelp Contents menu item Default: F1 @@ -1137,7 +1137,7 @@ Line Editing Mode Key Bindings - Use line_mode for the + Use line-mode for the context to define key bindings for line editing mode. The following values are valid for action: @@ -1145,7 +1145,7 @@ - enter_align_mode + enter-align-mode enter alignment editing mode Default: space @@ -1153,7 +1153,7 @@ - enter_character_mode + enter-character-mode enter character editing mode Defaults: Return, KP_Enter @@ -1161,7 +1161,7 @@ - first_line + first-line move cursor to the first line Defaults: Home, g @@ -1169,7 +1169,7 @@ - extend_first_line + extend-first-line move cursor to the first line, extending the selection Default: Shift+Home @@ -1177,7 +1177,7 @@ - last_line + last-line move cursor to the last line Defaults: End, Shift+G @@ -1185,7 +1185,7 @@ - extend_last_line + extend-last-line move cursor to the last line, extending the selection Default: Shift+End @@ -1201,7 +1201,7 @@ - extend_up + extend-up move cursor up one line, extending the selection Defaults: Shift+Up, Shift+K @@ -1217,7 +1217,7 @@ - extend_down + extend-down move cursor down one line, extending the selection Defaults: Shift+Down, Shift+J @@ -1233,7 +1233,7 @@ - extend_left + extend-left move cursor left one file, extending the selection Default: Shift+Left @@ -1249,7 +1249,7 @@ - extend_right + extend-right move cursor right one file, extending the selection Default: Shift+Right @@ -1257,7 +1257,7 @@ - page_up + page-up move cursor up one page Defaults: Page_Up, Ctrl+u @@ -1265,7 +1265,7 @@ - extend_page_up + extend-page-up move cursor up one page, extending the selection Defaults: Shift+Page_Up, Shift+Ctrl+u @@ -1273,7 +1273,7 @@ - page_down + page-down move cursor down one page Defaults: Page_Down, Ctrl+d @@ -1281,7 +1281,7 @@ - extend_page_down + extend-page-down move cursor down one page, extending the selection Defaults: Shift+Page_Down, Shift+Ctrl+d @@ -1289,7 +1289,7 @@ - delete_text + delete-text delete the selected text Defaults: BackSpace, Delete, x @@ -1297,7 +1297,7 @@ - first_difference + first-difference select the first difference Defaults: Ctrl+Home, Shift+P @@ -1305,7 +1305,7 @@ - previous_difference + previous-difference select the previous difference Default: p @@ -1313,7 +1313,7 @@ - next_difference + next-difference select the next difference Default: n @@ -1321,7 +1321,7 @@ - last_difference + last-difference select the last difference Defaults: Ctrl+End, Shift+N @@ -1329,7 +1329,7 @@ - clear_edits + clear-edits clear all edits from the selected lines Default: r @@ -1337,7 +1337,7 @@ - copy_selection_left + copy-selection-left copy lines from the selection into the file on the left Default: None @@ -1345,7 +1345,7 @@ - copy_selection_right + copy-selection-right copy lines from the selection into the file on the right Default: None @@ -1353,7 +1353,7 @@ - copy_left_into_selection + copy-left-into-selection copy lines from the file on the left into the selection Default: Shift+L @@ -1361,7 +1361,7 @@ - copy_right_into_selection + copy-right-into-selection copy lines from the file on the right into the selection Default: Shift+H @@ -1369,7 +1369,7 @@ - merge_from_left_then_right + merge-from-left-then-right merge lines from file on the left then file on the right Default: m @@ -1377,7 +1377,7 @@ - merge_from_right_then_left + merge-from-right-then-left merge lines from file on the right then file on the left Default: Shift+M @@ -1398,7 +1398,7 @@ Alignment Editing Mode Key Bindings - Use align_mode for the + Use align-mode for the context to define key bindings for alignment editing mode. The following values are valid for action: @@ -1406,7 +1406,7 @@ - enter_line_mode + enter-line-mode enter line editing mode Default: Escape @@ -1414,7 +1414,7 @@ - enter_character_mode + enter-character-mode enter character editing mode Defaults: Return, KP_Enter @@ -1422,7 +1422,7 @@ - first_line + first-line move cursor to the first line Default: g @@ -1430,7 +1430,7 @@ - last_line + last-line move cursor to the last line Default: Shift+G @@ -1470,7 +1470,7 @@ - page_up + page-up move cursor up one page Defaults: Page_Up, Ctrl+u @@ -1478,7 +1478,7 @@ - page_down + page-down move cursor down one page Defaults: Page_Down, Ctrl+d @@ -1499,7 +1499,7 @@ Character Editing Mode Key Bindings - Use character_mode for the + Use character-mode for the context to define key bindings for character editing mode. The following values are valid for action: @@ -1507,7 +1507,7 @@ - enter_line_mode + enter-line-mode enter line editing mode Default: Escape diff --git a/data/usr/share/gnome/help/diffuse/cs/diffuse.xml b/data/usr/share/gnome/help/diffuse/cs/diffuse.xml index 52e0ec8..43d5c2a 100644 --- a/data/usr/share/gnome/help/diffuse/cs/diffuse.xml +++ b/data/usr/share/gnome/help/diffuse/cs/diffuse.xml @@ -394,7 +394,7 @@ - open_file + open-file Položka nabídky SouborOtevřít soubor... Výchozí: Ctrl+o @@ -402,7 +402,7 @@ - open_file_in_new_tab + open-file-in-new-tab Položka nabídky SouborOtevřít v novém panelu... Výchozí: Ctrl+t @@ -410,7 +410,7 @@ - open_modified_files + open-modified-files Položka nabídky SouborOtevřít změněné soubory... Výchozí: Shift+Ctrl+O @@ -418,7 +418,7 @@ - open_commit + open-commit Položka nabídky SouborOtevřít revizi... menu item Výchozí: Shift+Ctrl+T @@ -426,7 +426,7 @@ - reload_file + reload-file Položka nabídky SouborZnovu načíst soubor Výchozí: Shift+Ctrl+R @@ -434,7 +434,7 @@ - save_file + save-file Položka nabídky SouborUložit soubor Výchozí: Ctrl+s @@ -442,7 +442,7 @@ - save_file_as + save-file-as Položka nabídky SouborUložit soubor jako... Výchozí: Shift+Ctrl+A @@ -450,7 +450,7 @@ - save_all + save-all Položka nabídky SouborUložit vše Výchozí: Shift+Ctrl+S @@ -458,7 +458,7 @@ - new_2_way_file_merge + new-2-way-file-merge Položka nabídky SouborNové 2směrné slučování Výchozí: Ctrl+2 @@ -466,7 +466,7 @@ - new_3_way_file_merge + new-3-way-file-merge Položka nabídky SouborNové 3směrné slučování Výchozí: Ctrl+3 @@ -474,7 +474,7 @@ - new_n_way_file_merge + new-n-way-file-merge Položka nabídky SouborNové Nsměrné slučování Výchozí: Ctrl+4 @@ -482,7 +482,7 @@ - close_tab + close-tab Položka nabídky SouborZavřít panel Výchozí: Ctrl+w @@ -490,7 +490,7 @@ - undo_close_tab + undo-close-tab Položka nabídky SouborObnovit zavřený panel Výchozí: Shift+Ctrl+w @@ -546,7 +546,7 @@ - select_all + select-all Položka nabídky ÚpravyOznačit vše Výchozí: Ctrl+a @@ -554,7 +554,7 @@ - clear_edits + clear-edits Položka nabídky ÚpravySmazat úpravy Výchozí: Ctrl+r @@ -562,7 +562,7 @@ - dismiss_all_edits + dismiss-all-edits Položka nabídky ÚpravyZrušit všechny úpravy Výchozí: Ctrl+d @@ -578,7 +578,7 @@ - find_next + find-next Položka nabídky ÚpravyNajít další Výchozí: Ctrl+g @@ -586,7 +586,7 @@ - find_previous + find-previous Položka nabídky ÚpravyNajít předchozí Výchozí: Shift+Ctrl+G @@ -594,7 +594,7 @@ - go_to_line + go-to-line Položka nabídky ÚpravyPřejít na řádek... Výchozí: Shift+Ctrl+L @@ -610,7 +610,7 @@ - no_syntax_highlighting + no-syntax-highlighting Položka nabídky ZobrazitZvýraznění syntaxeNic Výchozí: None @@ -618,7 +618,7 @@ - syntax_highlighting_syntaxe + syntax-highlighting-syntaxe Položka nabídky ZobrazitZvýraznění syntaxesyntaxe Výchozí: None @@ -626,7 +626,7 @@ - realign_all + realign-all Položka nabídky ZobrazitZnovu zarovnat Výchozí: Ctrl+l @@ -642,7 +642,7 @@ - first_difference + first-difference Položka nabídky ZobrazitPrvní rozdíl Výchozí: Shift+Ctrl+Up @@ -650,7 +650,7 @@ - previous_difference + previous-difference Položka nabídky ZobrazitPředchozí rozdíl Výchozí: Ctrl+Up @@ -658,7 +658,7 @@ - next_difference + next-difference Položka nabídky ZobrazitDalší rozdíl Výchozí: Ctrl+Down @@ -666,7 +666,7 @@ - last_difference + last-difference Položka nabídky ZobrazitPoslední rozdíl Výchozí: Shift+Ctrl+Down @@ -674,7 +674,7 @@ - first_tab + first-tab Položka nabídky ZobrazitPrvní panel Výchozí: Shift+Ctrl+Page_Up @@ -682,7 +682,7 @@ - previous_tab + previous-tab Položka nabídky ZobrazitPředchozí panel Výchozí: Ctrl+Page_Up @@ -690,7 +690,7 @@ - next_tab + next-tab Položka nabídky ZobrazitDalší panel Výchozí: Ctrl+Page_Down @@ -698,7 +698,7 @@ - last_tab + last-tab Položka nabídky ZobrazitPoslední panel Výchozí: Shift+Ctrl+Page_Down @@ -706,7 +706,7 @@ - shift_pane_right + shift-pane-right Položka nabídky ZobrazitPřesunout podokno doprava Výchozí: Shift+Ctrl+parenleft @@ -714,7 +714,7 @@ - shift_pane_left + shift-pane-left Položka nabídky ZobrazitPřesunout podokno doleva Výchozí: Shift+Ctrl+parenright @@ -722,7 +722,7 @@ - convert_to_upper_case + convert-to-upper-case Položka nabídky FormátPřevést na velká písmena Výchozí: Ctrl+u @@ -730,7 +730,7 @@ - convert_to_lower_case + convert-to-lower-case Položka nabídky FormátPřevést na malá písmena Výchozí: Shift+Ctrl+U @@ -738,7 +738,7 @@ - sort_lines_in_ascending_order + sort-lines-in-ascending-order Položka nabídky FormátSeřadit řádky vzestupně Výchozí: Ctrl+y @@ -746,7 +746,7 @@ - sort_lines_in_descending_order + sort-lines-in-descending-order Položka nabídky FormátSeřadit řádky sestupně Výchozí: Shift+Ctrl+Y @@ -754,7 +754,7 @@ - remove_trailing_white_space + remove-trailing-white-space Položka nabídky FormátOdstranit mezery na koncích řádků Výchozí: Ctrl+k @@ -762,7 +762,7 @@ - convert_tabs_to_spaces + convert-tabs-to-spaces Položka nabídky FormátNahradit tabulátory mezerami Výchozí: Ctrl+b @@ -770,7 +770,7 @@ - convert_leading_spaces_to_tabs + convert-leading-spaces-to-tabs Položka nabídky FormátNahradit úvodní mezery tabulátory Výchozí: Shift+Ctrl+B @@ -778,7 +778,7 @@ - increase_indenting + increase-indenting Položka nabídky FormátZvětšit odsazení Výchozí: Shift+Ctrl+> @@ -786,7 +786,7 @@ - decrease_indenting + decrease-indenting Položka nabídky FormátZmenšit odsazení Výchozí: Shift+Ctrl+< @@ -794,7 +794,7 @@ - convert_to_dos + convert-to-dos FormátPřevést na DOS formát Výchozí: Shift+Ctrl+E @@ -802,7 +802,7 @@ - convert_to_mac + convert-to-mac Položka nabídky FormátPřevést na Mac formát Výchozí: Shift+Ctrl+C @@ -810,7 +810,7 @@ - convert_to_unix + convert-to-unix Položka nabídky FormátPřevést na Unix formát Výchozí: Ctrl+e @@ -818,7 +818,7 @@ - copy_selection_right + copy-selection-right Položka nabídky SloučitKopírovat výběr doprava Výchozí: Shift+Ctrl+Right @@ -826,7 +826,7 @@ - copy_selection_left + copy-selection-left Položka nabídky SloučitKopírovat výběr doleva Výchozí: Shift+Ctrl+Left @@ -834,7 +834,7 @@ - copy_left_into_selection + copy-left-into-selection Položka nabídky SloučitKopírovat zleva do výběru Výchozí: Ctrl+Right @@ -842,7 +842,7 @@ - copy_right_into_selection + copy-right-into-selection Položka nabídky SloučitKopírovat zprava do výběru Výchozí: Ctrl+Left @@ -850,7 +850,7 @@ - merge_from_left_then_right + merge-from-left-then-right Položka nabídky SloučitSloučit zleva a poté zprava menu item Výchozí: Ctrl+m @@ -858,7 +858,7 @@ - merge_from_right_then_left + merge-from-right-then-left Položka nabídky SloučitSloučit zprava a poté zleva Výchozí: Shift+Ctrl+M @@ -866,7 +866,7 @@ - help_contents + help-contents Položka nabídky NápovědaZobrazit nápovědu Výchozí: F1 @@ -886,11 +886,11 @@ Přiřazení klávesových zkratek pro řádkový režim úprav - Pro přiřazení klávesových zkratek pro řádkový režim úprav použijte pro parametr kontext hodnotu line_mode. Platné hodnoty parametru akce jsou: + Pro přiřazení klávesových zkratek pro řádkový režim úprav použijte pro parametr kontext hodnotu line-mode. Platné hodnoty parametru akce jsou: - enter_align_mode + enter-align-mode aktivovat režim úprav zarovnání Výchozí: space @@ -898,7 +898,7 @@ - enter_character_mode + enter-character-mode aktivovat znakový režim úprav Výchozí: Return, KP_Enter @@ -906,7 +906,7 @@ - first_line + first-line přesunout kurzor na první řádek Výchozí: Home, g @@ -914,7 +914,7 @@ - extend_first_line + extend-first-line přesunout kurzor na první řádek a rozšířit výběr Výchozí: Shift+Home @@ -922,7 +922,7 @@ - last_line + last-line přesunout kurzor na poslední řádek Výchozí: End, Shift+G @@ -930,7 +930,7 @@ - extend_last_line + extend-last-line přesunout kurzor na poslední řádek a rozšířit výběr Výchozí: Shift+End @@ -946,7 +946,7 @@ - extend_up + extend-up posunout kurzor o jeden řádek nahoru a rozšířit výběr Výchozí: Shift+Up, Shift+K @@ -962,7 +962,7 @@ - extend_down + extend-down posunout kurzor o jeden řádek dolů a rozšířit výběr Výchozí: Shift+Down, Shift+J @@ -978,7 +978,7 @@ - extend_left + extend-left přesunout kurzor o soubor doleva a rozšířit výběr Výchozí: Shift+Left @@ -994,7 +994,7 @@ - extend_right + extend-right přesunout kurzor o soubor doprava a rozšířit výběr Výchozí: Shift+Right @@ -1002,7 +1002,7 @@ - page_up + page-up přesunout kurzor o stránku nahoru Výchozí: Page_Up, Ctrl+u @@ -1010,7 +1010,7 @@ - extend_page_up + extend-page-up přesunout kurzor o stránku nahoru a rozšířit výběr Výchozí: Shift+Page_Up, Shift+Ctrl+u @@ -1018,7 +1018,7 @@ - page_down + page-down přesunout kurzor o stránku dolů Výchozí: Page_Down, Ctrl+d @@ -1026,7 +1026,7 @@ - extend_page_down + extend-page-down přesunout kurzor o stránku dolů a rozšířit výběr Výchozí: Shift+Page_Down, Shift+Ctrl+d @@ -1034,7 +1034,7 @@ - delete_text + delete-text smazat vybraný text Výchozí: BackSpace, Delete, x @@ -1042,7 +1042,7 @@ - first_difference + first-difference vybrat první rozdíl Výchozí: Ctrl+Home, Shift+P @@ -1050,7 +1050,7 @@ - previous_difference + previous-difference vybrat předchozí rozdíl Výchozí: p @@ -1058,7 +1058,7 @@ - next_difference + next-difference vybrat další rozdíl Výchozí: n @@ -1066,7 +1066,7 @@ - last_difference + last-difference vybrat poslední rozdíl Výchozí: Ctrl+End, Shift+N @@ -1074,7 +1074,7 @@ - clear_edits + clear-edits smazat všechny úpravy ve vybraných řádcích Výchozí: r @@ -1082,7 +1082,7 @@ - copy_selection_left + copy-selection-left zkopírovat vybrané řádky do souboru nalevo Výchozí: None @@ -1090,7 +1090,7 @@ - copy_selection_right + copy-selection-right zkopírovat vybrané řádky do souboru napravo Výchozí: None @@ -1098,7 +1098,7 @@ - copy_left_into_selection + copy-left-into-selection zkopírovat do výběru řádky ze souboru nalevo Výchozí: Shift+L @@ -1106,7 +1106,7 @@ - copy_right_into_selection + copy-right-into-selection zkopírovat do výběru řádky ze souboru napravo Výchozí: Shift+H @@ -1114,7 +1114,7 @@ - merge_from_left_then_right + merge-from-left-then-right sloučit řádky ze souboru nalevo a poté ze souboru napravo Výchozí: m @@ -1122,7 +1122,7 @@ - merge_from_right_then_left + merge-from-right-then-left sloučit řádky ze souboru napravo a poté ze souboru nalevo Výchozí: Shift+M @@ -1142,11 +1142,11 @@ Přiřazení klávesových zkratek pro režim úprav zarovnání - Pro přiřazení klávesových zkratek pro režim úprav zarovnání použijte pro parametr kontext hodnotu align_mode. Platné hodnoty parametru akce jsou: + Pro přiřazení klávesových zkratek pro režim úprav zarovnání použijte pro parametr kontext hodnotu align-mode. Platné hodnoty parametru akce jsou: - enter_line_mode + enter-line-mode aktivovat řádkový režim úprav Výchozí: Escape @@ -1154,7 +1154,7 @@ - enter_character_mode + enter-character-mode aktivovat znakový režim úprav Výchozí: Return, KP_Enter @@ -1162,7 +1162,7 @@ - first_line + first-line přesunout kurzor na první řádek Výchozí: g @@ -1170,7 +1170,7 @@ - last_line + last-line přesunout kurzor na poslední řádek Výchozí: Shift+G @@ -1210,7 +1210,7 @@ - page_up + page-up přesunout kurzor o stránku nahoru Výchozí: Page_Up, Ctrl+u @@ -1218,7 +1218,7 @@ - page_down + page-down přesunout kurzor o stránku dolů Výchozí: Page_Down, Ctrl+d @@ -1238,11 +1238,11 @@ Přiřazení klávesových zkratek pro znakový režim úprav - Pro přiřazení klávesových zkratek pro znakový režim úprav použijte pro parametr kontext hodnotu character_mode. Platné hodnoty parametru akce jsou: + Pro přiřazení klávesových zkratek pro znakový režim úprav použijte pro parametr kontext hodnotu character-mode. Platné hodnoty parametru akce jsou: - enter_line_mode + enter-line-mode aktivovat řádkový režim úprav Výchozí: Escape diff --git a/data/usr/share/gnome/help/diffuse/it/diffuse.xml b/data/usr/share/gnome/help/diffuse/it/diffuse.xml index 231d6b5..cfc0a17 100644 --- a/data/usr/share/gnome/help/diffuse/it/diffuse.xml +++ b/data/usr/share/gnome/help/diffuse/it/diffuse.xml @@ -379,7 +379,7 @@ - open_file + open-file Voce di menu FileApri file Predefinito: Ctrl+o @@ -387,7 +387,7 @@ - open_file_in_new_tab + open-file-in-new-tab Voce di menu FileApri file in una nuova scheda... Predefinito: Ctrl+t @@ -395,7 +395,7 @@ - open_modified_files + open-modified-files Voce di menu FileApri file modificati... Predefinito: Shift+Ctrl+O @@ -403,7 +403,7 @@ - open_commit + open-commit Voce di menu FileApri commit... Predefinito: Shift+Ctrl+T @@ -411,7 +411,7 @@ - reload_file + reload-file Voce di menu FileRicarica file Predefinito: Shift+Ctrl+R @@ -419,7 +419,7 @@ - save_file + save-file Voce di menu FileSalva file Predefinito: Ctrl+s @@ -427,7 +427,7 @@ - save_file_as + save-file-as Voce di menu FileSalva con nome... Predefinito: Shift+Ctrl+A @@ -435,7 +435,7 @@ - save_all + save-all Voce di menu FileSalva tutti Predefinito: Shift+Ctrl+S @@ -443,7 +443,7 @@ - new_2_way_file_merge + new-2-way-file-merge Voce di menu FileNuova unione a 2 file Predefinito: Ctrl+2 @@ -451,7 +451,7 @@ - new_3_way_file_merge + new-3-way-file-merge Voce di menu FileNuova unione a 3 file Predefinito: Ctrl+3 @@ -459,7 +459,7 @@ - new_n_way_file_merge + new-n-way-file-merge Voce di menu FileNuova unione a N file Predefinito: Ctrl+4 @@ -467,7 +467,7 @@ - close_tab + close-tab Voce di menu FileChiudi scheda Predefinito: Ctrl+w @@ -475,7 +475,7 @@ - undo_close_tab + undo-close-tab Voce di menu FileAnnulla chiusura scheda Predefinito: Shift+Ctrl+w @@ -531,7 +531,7 @@ - select_all + select-all Voce di menu ModificaSeleziona tutto Predefinito: Ctrl+a @@ -539,7 +539,7 @@ - clear_edits + clear-edits Voce di menu ModificaAnnulla modifiche Predefinito: Ctrl+r @@ -547,7 +547,7 @@ - dismiss_all_edits + dismiss-all-edits Voce di menu ModificaScarta tutte le modifiche Predefinito: Ctrl+d @@ -563,7 +563,7 @@ - find_next + find-next Voce di menu ModificaTrova successivo Predefinito: Ctrl+g @@ -571,7 +571,7 @@ - find_previous + find-previous Voce di menu ModificaTrova precedente Predefinito: Shift+Ctrl+G @@ -579,7 +579,7 @@ - go_to_line + go-to-line Voce di menu ModificaVai alla riga... Predefinito: Shift+Ctrl+L @@ -595,7 +595,7 @@ - no_syntax_highlighting + no-syntax-highlighting Voce di menu VisualizzaSintassiNessuna Predefinito: Nessuno @@ -603,7 +603,7 @@ - syntax_highlighting_sintassi + syntax-highlighting-sintassi Voce di menu VisualizzaSintassisyntax Predefinito: Nessuno @@ -611,7 +611,7 @@ - realign_all + realign-all Voce di menu VisualizzaRiallinea tutto Predefinito: Ctrl+l @@ -627,7 +627,7 @@ - first_difference + first-difference Voce di menu VisualizzaPrima differenza Predefinito: Shift+Ctrl+Up @@ -635,7 +635,7 @@ - previous_difference + previous-difference Voce di menu VisualizzaDifferenza precedente Predefinito: Ctrl+Up @@ -643,7 +643,7 @@ - next_difference + next-difference Voce di menu VisualizzaDifferenza successiva Predefinito: Ctrl+Down @@ -651,7 +651,7 @@ - last_difference + last-difference Voce di menu VisualizzaUltima differenza Predefinito: Shift+Ctrl+Down @@ -659,7 +659,7 @@ - first_tab + first-tab Voce di menu VisualizzaPrima scheda Predefinito: Shift+Ctrl+Page_Up @@ -667,7 +667,7 @@ - previous_tab + previous-tab Voce di menu VisualizzaScheda precedente Predefinito: Ctrl+Page_Up @@ -675,7 +675,7 @@ - next_tab + next-tab Voce di menu VisualizzaScheda successiva Predefinito: Ctrl+Page_Down @@ -683,7 +683,7 @@ - last_tab + last-tab Voce di menu VisualizzaUltima scheda Predefinito: Shift+Ctrl+Page_Down @@ -691,7 +691,7 @@ - shift_pane_right + shift-pane-right Voce di menu VisualizzaSposta riquadro a destra Predefinito: Shift+Ctrl+parenleft @@ -699,7 +699,7 @@ - shift_pane_left + shift-pane-left Voce di menu VisualizzaSposta riquadro a sinistra Predefinito: Shift+Ctrl+parenright @@ -707,7 +707,7 @@ - convert_to_upper_case + convert-to-upper-case Voce di menu FormatoConverti in MAIUSCOLO Predefinito: Ctrl+u @@ -715,7 +715,7 @@ - convert_to_lower_case + convert-to-lower-case Voce di menu FormatoConverti in minuscolo Predefinito: Shift+Ctrl+U @@ -723,7 +723,7 @@ - sort_lines_in_ascending_order + sort-lines-in-ascending-order Voce di menu FormatoDisponi le righe in ordine ascendente Predefinito: Ctrl+y @@ -731,7 +731,7 @@ - sort_lines_in_descending_order + sort-lines-in-descending-order Voce di menu FormatoDisponi le righe in ordine discendente Predefinito: Shift+Ctrl+Y @@ -739,7 +739,7 @@ - remove_trailing_white_space + remove-trailing-white-space Voce di menu FormatoRimuovi gli spazi vuoti alla fine della riga Predefinito: Ctrl+k @@ -747,7 +747,7 @@ - convert_tabs_to_spaces + convert-tabs-to-spaces Voce di menu FormatoConverti le tabulazioni in spazi Predefinito: Ctrl+b @@ -755,7 +755,7 @@ - convert_leading_spaces_to_tabs + convert-leading-spaces-to-tabs Voce di menu FormatoConverti gli spazi iniziali in tabulazioni Predefinito: Shift+Ctrl+B @@ -763,7 +763,7 @@ - increase_indenting + increase-indenting Voce di menu FormatoAumenta indentazione Predefinito: Shift+Ctrl+greater @@ -771,7 +771,7 @@ - decrease_indenting + decrease-indenting Voce di menu FormatoDiminuisci indentazione Predefinito: Shift+Ctrl+less @@ -779,7 +779,7 @@ - convert_to_dos + convert-to-dos Voce di menu FormatoConverti nel formato DOS Predefinito: Shift+Ctrl+E @@ -787,7 +787,7 @@ - convert_to_mac + convert-to-mac Voce di menu FormatoConverti nel formato MAC Predefinito: Shift+Ctrl+C @@ -795,7 +795,7 @@ - convert_to_unix + convert-to-unix Voce di menu FormatoConverti nel formato Unix Predefinito: Ctrl+e @@ -803,7 +803,7 @@ - copy_selection_right + copy-selection-right Voce di menu UnioneCopia selezione a destra Predefinito: Shift+Ctrl+Right @@ -811,7 +811,7 @@ - copy_selection_left + copy-selection-left Voce di menu UnioneCopia selezione a sinistra Predefinito: Shift+Ctrl+Left @@ -819,7 +819,7 @@ - copy_left_into_selection + copy-left-into-selection Voce di menu UnioneCopia sinistra nella selezione Predefinito: Ctrl+Destra @@ -827,7 +827,7 @@ - copy_right_into_selection + copy-right-into-selection Voce di menu UnioneCopia destra nella selezione Predefinito: Ctrl+Sinistra @@ -835,7 +835,7 @@ - merge_from_left_then_right + merge-from-left-then-right Voce di menu UnioneUnisci sinistra poi destra Predefinito: Ctrl+m @@ -843,7 +843,7 @@ - merge_from_right_then_left + merge-from-right-then-left Voce di menu UnioneUnisci destra poi sinistra Predefinito: Shift+Ctrl+M @@ -851,7 +851,7 @@ - help_contents + help-contents Voce di menu AiutoSommario Predefinito: F1 @@ -871,11 +871,11 @@ Keybinding per la modalità di modifica delle righe - Usare line_mode come contesto per definire i keybinding per la modalità di modifica delle righe. I seguenti valori sono validi per il campo azione: + Usare line-mode come contesto per definire i keybinding per la modalità di modifica delle righe. I seguenti valori sono validi per il campo azione: - enter_align_mode + enter-align-mode Passa alla modalità di modifica dell'allineamento Predefinito: space @@ -883,7 +883,7 @@ - enter_character_mode + enter-character-mode Passa alla modalità di modifica del testo Predefiniti: Return, KP_Enter @@ -891,7 +891,7 @@ - first_line + first-line Sposta il cursore alla prima riga Predefiniti: Home, g @@ -899,7 +899,7 @@ - extend_first_line + extend-first-line Sposta il cursore alla prima riga, estendendo la selezione Predefinito: Shift+Home @@ -907,7 +907,7 @@ - last_line + last-line Sposta il cursore all'ultima riga Predefiniti: End, Shift+G @@ -915,7 +915,7 @@ - extend_last_line + extend-last-line Sposta il cursore all'ultima riga, estendendo la selezione Predefinito: Shift+End @@ -931,7 +931,7 @@ - extend_up + extend-up Sposta il cursore alla riga superiore, estendendo la selezione Predefiniti: Shift+Up, Shift+K @@ -947,7 +947,7 @@ - extend_down + extend-down Sposta il cursore alla riga inferiore, estendendo la selezione Predefiniti: Shift+Down, Shift+J @@ -963,7 +963,7 @@ - extend_left + extend-left Sposta il cursore a sinistra di un file, estendendo la selezione Predefinito: Shift+Left @@ -979,7 +979,7 @@ - extend_right + extend-right Sposta il cursore a destra di un file, estendendo la selezione Predefinito: Shift+Right @@ -987,7 +987,7 @@ - page_up + page-up Sposta il cursore alla pagina superiore Predefiniti: Page_Up, Ctrl+u @@ -995,7 +995,7 @@ - extend_page_up + extend-page-up Sposta il cursore alla pagina superiore, estendendo la selezione Predefiniti: Shift+Page_Up, Shift+Ctrl+u @@ -1003,7 +1003,7 @@ - page_down + page-down Sposta il cursore alla pagina inferiore Predefiniti: Page_Down, Ctrl+d @@ -1011,7 +1011,7 @@ - extend_page_down + extend-page-down Sposta il cursore alla pagina inferiore, estendendo la selezione Predefiniti: Shift+Page_Down, Shift+Ctrl+d @@ -1019,7 +1019,7 @@ - delete_text + delete-text Cancella il testo selezionato Predefiniti: BackSpace, Delete, x @@ -1027,7 +1027,7 @@ - first_difference + first-difference Seleziona la prima differenza Predefiniti: Ctrl+Home, Shift+P @@ -1035,7 +1035,7 @@ - previous_difference + previous-difference Seleziona la differenza precedente Predefinito: p @@ -1043,7 +1043,7 @@ - next_difference + next-difference Seleziona la differenza successiva Predefinito: n @@ -1051,7 +1051,7 @@ - last_difference + last-difference Seleziona l'ultima differenza Predefiniti: Ctrl+End, Shift+N @@ -1059,7 +1059,7 @@ - clear_edits + clear-edits Annulla tutte le modifiche alle righe selezionate Predefinito: r @@ -1067,7 +1067,7 @@ - copy_selection_left + copy-selection-left Copia le righe selezionate nel file di sinistra Predefinito: Nessuno @@ -1075,7 +1075,7 @@ - copy_selection_right + copy-selection-right Copia le righe selezionate nel file di destra Predefinito: Nessuno @@ -1083,7 +1083,7 @@ - copy_left_into_selection + copy-left-into-selection Copia le righe dal file a sinistra nella selezione Predefinito: Shift+L @@ -1091,7 +1091,7 @@ - copy_right_into_selection + copy-right-into-selection Copia le righe dal file a destra nella selezione Predefinito: Shift+H @@ -1099,7 +1099,7 @@ - merge_from_left_then_right + merge-from-left-then-right Unisce le righe dal file a sinistra poi da quello a destra Predefinito: m @@ -1107,7 +1107,7 @@ - merge_from_right_then_left + merge-from-right-then-left Unisce le righe dal file a destra poi da quello a sinistra Predefinito: Shift+M @@ -1127,11 +1127,11 @@ Keybinding per la modalità di modifica dell'allineamento - Usare align_mode come contesto per definire i keybinding per la modalità di modifica dell'allineamento. I seguenti valori sono validi per il campo azione: + Usare align-mode come contesto per definire i keybinding per la modalità di modifica dell'allineamento. I seguenti valori sono validi per il campo azione: - enter_line_mode + enter-line-mode Passa alla modalità di modifica riga Predefinito: Escape @@ -1139,7 +1139,7 @@ - enter_character_mode + enter-character-mode Passa alla modalità di modifica del testo Predefiniti: Return, KP_Enter @@ -1147,7 +1147,7 @@ - first_line + first-line Sposta il cursore alla prima riga Predefinito: g @@ -1155,7 +1155,7 @@ - last_line + last-line Sposta il cursore all'ultima riga Predefinito: Shift+G @@ -1195,7 +1195,7 @@ - page_up + page-up Sposta il cursore alla pagina superiore Predefiniti: Page_Up, Ctrl+u @@ -1203,7 +1203,7 @@ - page_down + page-down Sposta il cursore alla pagina inferiore Predefiniti: Page_Down, Ctrl+d @@ -1223,11 +1223,11 @@ Keybinding della modalità di modifica testo - Usare character_mode come contesto per definire i keybinding per la modalità di modifica testo. I seguenti valori sono validi per il campo azione: + Usare character-mode come contesto per definire i keybinding per la modalità di modifica testo. I seguenti valori sono validi per il campo azione: - enter_line_mode + enter-line-mode Passa alla modalità di modifica riga Predefinito: Escape diff --git a/data/usr/share/gnome/help/diffuse/ru/diffuse.xml b/data/usr/share/gnome/help/diffuse/ru/diffuse.xml index d08c1d6..8406207 100644 --- a/data/usr/share/gnome/help/diffuse/ru/diffuse.xml +++ b/data/usr/share/gnome/help/diffuse/ru/diffuse.xml @@ -658,7 +658,7 @@ - open_file + open-file Файл пункт меню Открыть Файл... По умолчанию: Ctrl+o @@ -666,7 +666,7 @@ - open_file_in_new_tab + open-file-in-new-tab ФайлОткрыть Файл в Новой Вкладке... По умолчанию: Ctrl+t @@ -674,7 +674,7 @@ - open_modified_files + open-modified-files ФайлОткрыть Измененные Файлы... По умолчанию: Shift+Ctrl+O @@ -682,7 +682,7 @@ - open_commit + open-commit ФайлОткрыть Зафиксированные... По умолчанию: Shift+Ctrl+T @@ -690,7 +690,7 @@ - reload_file + reload-file ФайлПерезагрузить Файл По умолчанию: Shift+Ctrl+R @@ -698,7 +698,7 @@ - save_file + save-file ФайлСохранить Файл По умолчанию: Ctrl+s @@ -706,7 +706,7 @@ - save_file_as + save-file-as ФайлСохранить Файл Как... По умолчанию: Shift+Ctrl+A @@ -714,7 +714,7 @@ - save_all + save-all ФайлСохранить Все По умолчанию: Shift+Ctrl+S @@ -722,7 +722,7 @@ - new_2_way_file_merge + new-2-way-file-merge ФайлНовое 2-Оконное Слияние Файлов По умолчанию: Ctrl+2 @@ -730,7 +730,7 @@ - new_3_way_file_merge + new-3-way-file-merge ФайлНовое 3-Оконное Слияние Файлов По умолчанию: Ctrl+3 @@ -738,7 +738,7 @@ - close_tab + close-tab ФайлЗакрыть Вкладку По умолчанию: Ctrl+w @@ -746,7 +746,7 @@ - undo_close_tab + undo-close-tab ФайлОтменить Закрытие Вкладки По умолчанию: Shift+Ctrl+w @@ -802,7 +802,7 @@ - select_all + select-all ПравкаВыбрать Все По умолчанию: Ctrl+a @@ -810,7 +810,7 @@ - clear_edits + clear-edits ПравкаОчистить Правки По умолчанию: Ctrl+r @@ -818,7 +818,7 @@ - dismiss_all_edits + dismiss-all-edits ПравкаСбросить Все Правки По умолчанию: Ctrl+d @@ -834,7 +834,7 @@ - find_next + find-next ПравкаНайти Следующее По умолчанию: Ctrl+g @@ -842,7 +842,7 @@ - find_previous + find-previous ПравкаНайти Предыдущее По умолчанию: Shift+Ctrl+G @@ -850,7 +850,7 @@ - go_to_line + go-to-line ПравкаПерейти на Строку... По умолчанию: Shift+Ctrl+L @@ -866,7 +866,7 @@ - no_syntax_highlighting + no-syntax-highlighting ВидПодсветка СинтаксисаНет По умолчанию: Нет @@ -874,7 +874,7 @@ - syntax_highlighting_syntax + syntax-highlighting-syntax ВидПодсветка Синтаксисаsyntax По умолчанию: Нет @@ -882,7 +882,7 @@ - realign_all + realign-all ВидПерестроить Все По умолчанию: Ctrl+l @@ -898,7 +898,7 @@ - first_difference + first-difference ВидПервое Различие По умолчанию: Shift+Ctrl+Up @@ -906,7 +906,7 @@ - previous_difference + previous-difference ВидПредыдущее Различие По умолчанию: Ctrl+Up @@ -914,7 +914,7 @@ - next_difference + next-difference ВидСледующее Различие По умолчанию: Ctrl+Down @@ -922,7 +922,7 @@ - last_difference + last-difference ВидПоследнее Различие По умолчанию: Shift+Ctrl+Down @@ -930,7 +930,7 @@ - first_tab + first-tab ВидПервая Вкладка По умолчанию: Shift+Ctrl+Page_Up @@ -938,7 +938,7 @@ - previous_tab + previous-tab ВидПредыдущая Вкладка По умолчанию: Ctrl+Page_Up @@ -946,7 +946,7 @@ - next_tab + next-tab ВидСледующая Вкладка По умолчанию: Ctrl+Page_Down @@ -954,7 +954,7 @@ - last_tab + last-tab ВидПоследняя Вкладка По умолчанию: Shift+Ctrl+Page_Down @@ -962,7 +962,7 @@ - shift_pane_right + shift-pane-right ВидПереместить Субокно Вправо По умолчанию: Shift+Ctrl+parenleft @@ -970,7 +970,7 @@ - shift_pane_left + shift-pane-left Видсместить выбранное субокно влево По умолчанию: Shift+Ctrl+parenright @@ -978,7 +978,7 @@ - convert_to_upper_case + convert-to-upper-case ФорматПреобразовать в Верхний Регистр По умолчанию: Ctrl+u @@ -986,7 +986,7 @@ - convert_to_lower_case + convert-to-lower-case ФорматПреобразовать в Нижний Регистр По умолчанию: Shift+Ctrl+U @@ -994,7 +994,7 @@ - sort_lines_in_ascending_order + sort-lines-in-ascending-order ФорматСортировать Строки в Порядке Возрастания По умолчанию: Ctrl+y @@ -1002,7 +1002,7 @@ - sort_lines_in_descending_order + sort-lines-in-descending-order ФорматСортировать Строки в Порядке Убывания По умолчанию: Shift+Ctrl+Y @@ -1010,7 +1010,7 @@ - remove_trailing_white_space + remove-trailing-white-space ФорматУдалить Замыкающие Пробелы По умолчанию: Ctrl+k @@ -1018,7 +1018,7 @@ - convert_tabs_to_spaces + convert-tabs-to-spaces ФорматПреобразовать Табуляторы в Пробелы По умолчанию: Ctrl+b @@ -1026,7 +1026,7 @@ - convert_leading_spaces_to_tabs + convert-leading-spaces-to-tabs ФорматПреобразовать Вводные Пробелы в Табуляторы По умолчанию: Shift+Ctrl+B @@ -1034,7 +1034,7 @@ - increase_indenting + increase-indenting ФорматУвеличить Отступ По умолчанию: Shift+Ctrl+greater @@ -1042,7 +1042,7 @@ - decrease_indenting + decrease-indenting ФорматУменьшить Отступ По умолчанию: Shift+Ctrl+less @@ -1050,7 +1050,7 @@ - convert_to_dos + convert-to-dos ФорматПреобразовать в DOS Формат По умолчанию: Shift+Ctrl+E @@ -1058,7 +1058,7 @@ - convert_to_mac + convert-to-mac ФорматПреобразовать в Maс Формат По умолчанию: Shift+Ctrl+C @@ -1066,7 +1066,7 @@ - convert_to_unix + convert-to-unix ФорматПреобразовать в Uniх Формат По умолчанию: Ctrl+e @@ -1074,7 +1074,7 @@ - copy_selection_right + copy-selection-right СлияниеКопировать Выборку Вправо По умолчанию: Shift+Ctrl+Right @@ -1082,7 +1082,7 @@ - copy_selection_left + copy-selection-left СлияниеКопировать Выборку Влево По умолчанию: Shift+Ctrl+Left @@ -1090,7 +1090,7 @@ - copy_left_into_selection + copy-left-into-selection СлияниеКопировать Слева в Выборку По умолчанию: Ctrl+Right @@ -1098,7 +1098,7 @@ - copy_right_into_selection + copy-right-into-selection СлияниеКопировать Справа в Выборку По умолчанию: Ctrl+Left @@ -1106,7 +1106,7 @@ - merge_from_left_then_right + merge-from-left-then-right СлияниеСлияние Слева Затем Справа По умолчанию: Ctrl+m @@ -1114,7 +1114,7 @@ - merge_from_right_then_left + merge-from-right-then-left СлияниеСлияние Справа Затем Слева По умолчанию: Shift+Ctrl+M @@ -1122,7 +1122,7 @@ - help_contents + help-contents СправкаСодержание Справки... По умолчанию: F1 @@ -1143,7 +1143,7 @@ Привязки Клавиш Режима Редактирования Строк - Используйте line_mode для + Используйте line-mode для context, чтобы определить привязки клавиш для режима редактирования строк. Следующие значения допустимы для action: @@ -1151,7 +1151,7 @@ - enter_align_mode + enter-align-mode ввести режим редактирования выравнивания По умолчанию: space @@ -1159,7 +1159,7 @@ - enter_character_mode + enter-character-mode ввести режим редактирования символов По умолчаниям: Return, KP_Enter @@ -1167,7 +1167,7 @@ - first_line + first-line переместить курсор на первую строку По умолчаниям: Home, g @@ -1175,7 +1175,7 @@ - extend_first_line + extend-first-line переместить курсор на первую строку, расширение выборки По умолчанию: Shift+Home @@ -1183,7 +1183,7 @@ - last_line + last-line переместить курсор на последнюю строку По умолчаниям: End, Shift+G @@ -1191,7 +1191,7 @@ - extend_last_line + extend-last-line переместить курсор на последнюю строку, расширение выборки По умолчанию: Shift+End @@ -1207,7 +1207,7 @@ - extend_up + extend-up переместить курсор на одну строку вверх, расширение выборки По умолчаниям: Shift+Up, Shift+K @@ -1223,7 +1223,7 @@ - extend_down + extend-down переместить курсор на одну строку вниз, расширение выборки По умолчаниям: Shift+Down, Shift+J @@ -1239,7 +1239,7 @@ - extend_left + extend-left переместить курсор влево на один файл, расширение выборки По умолчанию: Shift+Left @@ -1255,7 +1255,7 @@ - extend_right + extend-right переместить курсор вправо на один файл, расширение выборки По умолчанию: Shift+Right @@ -1263,7 +1263,7 @@ - page_up + page-up переместить курсор на одну страницу вверх По умолчаниям: Page_Up, Ctrl+u @@ -1271,7 +1271,7 @@ - extend_page_up + extend-page-up переместить курсор на одну страницу вверх, расширение выборки По умолчаниям: Shift+Page_Up, Shift+Ctrl+u @@ -1279,7 +1279,7 @@ - page_down + page-down переместить курсор на одну страницу вниз По умолчаниям: Page_Down, Ctrl+d @@ -1287,7 +1287,7 @@ - extend_page_down + extend-page-down переместить курсор на одну страницу вниз, расширение выборки По умолчаниям: Shift+Page_Down, Shift+Ctrl+d @@ -1295,7 +1295,7 @@ - delete_text + delete-text удалить выбранный текст По умолчаниям: BackSpace, Delete, x @@ -1303,7 +1303,7 @@ - first_difference + first-difference выбрать первое различие По умолчаниям: Ctrl+Home, Shift+P @@ -1311,7 +1311,7 @@ - previous_difference + previous-difference выбрать предыдущее различие По умолчанию: p @@ -1319,7 +1319,7 @@ - next_difference + next-difference выбрать следующее различие По умолчанию: n @@ -1327,7 +1327,7 @@ - last_difference + last-difference выбрать последнее различие По умолчаниям: Ctrl+End, Shift+N @@ -1335,7 +1335,7 @@ - clear_edits + clear-edits очистить все редактирования в выбранных строках По умолчанию: r @@ -1343,7 +1343,7 @@ - copy_selection_right + copy-selection-right СлияниеКопировать Выборку Вправо По умолчанию: Нет @@ -1351,7 +1351,7 @@ - copy_selection_left + copy-selection-left СлияниеКопировать Выборку Влево По умолчанию: Нет @@ -1359,7 +1359,7 @@ - copy_left_into_selection + copy-left-into-selection копировать строки из файла слева в выборку По умолчанию: Shift+L @@ -1367,7 +1367,7 @@ - copy_right_into_selection + copy-right-into-selection копировать строки из файла справа в выборку По умолчанию: Shift+H @@ -1375,7 +1375,7 @@ - merge_from_left_then_right + merge-from-left-then-right объединить строки из файла слева, затем из файла справа По умолчанию: m @@ -1383,7 +1383,7 @@ - merge_from_right_then_left + merge-from-right-then-left объединить строки из файла справа, затем из файла слева По умолчанию: Shift+M @@ -1404,7 +1404,7 @@ Привязки Клавиш Режима Редактирования Выравнивания - Используйте align_mode для + Используйте align-mode для context, чтобы определить привязки клавиш для режима редактирования выравнивания. Следующие значения допустимы для action: @@ -1412,7 +1412,7 @@ - enter_line_mode + enter-line-mode ввести режим редактирования строк По умолчанию: Escape @@ -1420,7 +1420,7 @@ - enter_character_mode + enter-character-mode ввести режим редактирования символов По умолчаниям: Return, KP_Enter @@ -1428,7 +1428,7 @@ - first_line + first-line переместить курсор на первую строку По умолчанию: g @@ -1436,7 +1436,7 @@ - last_line + last-line переместить курсор на последнюю строку По умолчанию: Shift+G @@ -1476,7 +1476,7 @@ - page_up + page-up переместить курсор на одну страницу вверх По умолчаниям: Page_Up, Ctrl+u @@ -1484,7 +1484,7 @@ - page_down + page-down переместить курсор на одну страницу вниз По умолчаниям: Page_Down, Ctrl+d @@ -1505,7 +1505,7 @@ Привязки Клавиш Режима Редактирования Символов - Используйте character_mode для + Используйте character-mode для context, чтобы определить привязки клавиш для режима редактирования символов. Следующие значения допустимы для action: @@ -1513,7 +1513,7 @@ - enter_line_mode + enter-line-mode ввести режим редактирования строк По умолчанию: Escape diff --git a/src/diffuse/resources.py b/src/diffuse/resources.py index 8b30d28..03e6c08 100644 --- a/src/diffuse/resources.py +++ b/src/diffuse/resources.py @@ -47,117 +47,117 @@ class Resources: defaultModKey = 'Cmd+' if platform.system() == 'Darwin' else 'Ctrl+' self.keybindings = {} self.keybindings_lookup = {} - self.setKeyBinding('menu', 'open_file', defaultModKey + 'o') - self.setKeyBinding('menu', 'open_file_in_new_tab', defaultModKey + 't') - self.setKeyBinding('menu', 'open_modified_files', 'Shift+Ctrl+O') - self.setKeyBinding('menu', 'open_commit', 'Shift+Ctrl+T') - self.setKeyBinding('menu', 'reload_file', 'Shift+Ctrl+R') - self.setKeyBinding('menu', 'save_file', defaultModKey + 's') - self.setKeyBinding('menu', 'save_file_as', defaultModKey + 'Shift+A') - self.setKeyBinding('menu', 'save_all', defaultModKey + 'Shift+S') - self.setKeyBinding('menu', 'new_2_way_file_merge', 'Ctrl+2') - self.setKeyBinding('menu', 'new_3_way_file_merge', 'Ctrl+3') - self.setKeyBinding('menu', 'new_n_way_file_merge', 'Ctrl+4') - self.setKeyBinding('menu', 'close_tab', defaultModKey + 'w') - self.setKeyBinding('menu', 'undo_close_tab', defaultModKey + 'Shift+W') + self.setKeyBinding('menu', 'open-file', defaultModKey + 'o') + self.setKeyBinding('menu', 'open-file-in-new-tab', defaultModKey + 't') + self.setKeyBinding('menu', 'open-modified-files', 'Shift+Ctrl+O') + self.setKeyBinding('menu', 'open-commit', 'Shift+Ctrl+T') + self.setKeyBinding('menu', 'reload-file', 'Shift+Ctrl+R') + self.setKeyBinding('menu', 'save-file', defaultModKey + 's') + self.setKeyBinding('menu', 'save-file-as', defaultModKey + 'Shift+A') + self.setKeyBinding('menu', 'save-all', defaultModKey + 'Shift+S') + self.setKeyBinding('menu', 'new-2-way-file-merge', 'Ctrl+2') + self.setKeyBinding('menu', 'new-3-way-file-merge', 'Ctrl+3') + self.setKeyBinding('menu', 'new-n-way-file-merge', 'Ctrl+4') + self.setKeyBinding('menu', 'close-tab', defaultModKey + 'w') + self.setKeyBinding('menu', 'undo-close-tab', defaultModKey + 'Shift+W') self.setKeyBinding('menu', 'quit', defaultModKey + 'q') self.setKeyBinding('menu', 'undo', defaultModKey + 'z') self.setKeyBinding('menu', 'redo', defaultModKey + 'Shift+Z') self.setKeyBinding('menu', 'cut', defaultModKey + 'x') self.setKeyBinding('menu', 'copy', defaultModKey + 'c') self.setKeyBinding('menu', 'paste', defaultModKey + 'v') - self.setKeyBinding('menu', 'select_all', defaultModKey + 'a') - self.setKeyBinding('menu', 'clear_edits', defaultModKey + 'r') - self.setKeyBinding('menu', 'dismiss_all_edits', defaultModKey + 'd') + self.setKeyBinding('menu', 'select-all', defaultModKey + 'a') + self.setKeyBinding('menu', 'clear-edits', defaultModKey + 'r') + self.setKeyBinding('menu', 'dismiss-all-edits', defaultModKey + 'd') self.setKeyBinding('menu', 'find', defaultModKey + 'f') - self.setKeyBinding('menu', 'find_next', defaultModKey + 'g') - self.setKeyBinding('menu', 'find_previous', defaultModKey + 'Shift+G') - self.setKeyBinding('menu', 'go_to_line', defaultModKey + 'Shift+l') - self.setKeyBinding('menu', 'realign_all', defaultModKey + 'l') + self.setKeyBinding('menu', 'find-next', defaultModKey + 'g') + self.setKeyBinding('menu', 'find-previous', defaultModKey + 'Shift+G') + self.setKeyBinding('menu', 'go-to-line', defaultModKey + 'Shift+l') + self.setKeyBinding('menu', 'realign-all', defaultModKey + 'l') self.setKeyBinding('menu', 'isolate', defaultModKey + 'i') - self.setKeyBinding('menu', 'first_difference', defaultModKey + 'Shift+Up') - self.setKeyBinding('menu', 'previous_difference', defaultModKey + 'Up') - self.setKeyBinding('menu', 'next_difference', defaultModKey + 'Down') - self.setKeyBinding('menu', 'last_difference', defaultModKey + 'Shift+Down') - self.setKeyBinding('menu', 'first_tab', 'Shift+Ctrl+Page_Up') - self.setKeyBinding('menu', 'previous_tab', 'Ctrl+Page_Up') - self.setKeyBinding('menu', 'next_tab', 'Ctrl+Page_Down') - self.setKeyBinding('menu', 'last_tab', 'Shift+Ctrl+Page_Down') - self.setKeyBinding('menu', 'shift_pane_right', 'Shift+Ctrl+parenright') - self.setKeyBinding('menu', 'shift_pane_left', 'Shift+Ctrl+parenleft') - self.setKeyBinding('menu', 'convert_to_upper_case', defaultModKey + 'u') - self.setKeyBinding('menu', 'convert_to_lower_case', defaultModKey + 'Shift+U') - self.setKeyBinding('menu', 'sort_lines_in_ascending_order', defaultModKey + 'y') - self.setKeyBinding('menu', 'sort_lines_in_descending_order', defaultModKey + 'Shift+Y') - self.setKeyBinding('menu', 'remove_trailing_white_space', defaultModKey + 'k') - self.setKeyBinding('menu', 'convert_tabs_to_spaces', defaultModKey + 'b') - self.setKeyBinding('menu', 'convert_leading_spaces_to_tabs', 'Shift+Ctrl+B') - self.setKeyBinding('menu', 'increase_indenting', defaultModKey + 'Shift+greater') - self.setKeyBinding('menu', 'decrease_indenting', defaultModKey + 'Shift+less') - self.setKeyBinding('menu', 'convert_to_dos', defaultModKey + 'Shift+E') - self.setKeyBinding('menu', 'convert_to_mac', defaultModKey + 'Shift+C') - self.setKeyBinding('menu', 'convert_to_unix', defaultModKey + 'e') - self.setKeyBinding('menu', 'copy_selection_right', defaultModKey + 'Shift+Right') - self.setKeyBinding('menu', 'copy_selection_left', defaultModKey + 'Shift+Left') - self.setKeyBinding('menu', 'copy_left_into_selection', defaultModKey + 'Right') - self.setKeyBinding('menu', 'copy_right_into_selection', defaultModKey + 'Left') - self.setKeyBinding('menu', 'merge_from_left_then_right', defaultModKey + 'm') - self.setKeyBinding('menu', 'merge_from_right_then_left', defaultModKey + 'Shift+M') - self.setKeyBinding('menu', 'help_contents', 'F1') - self.setKeyBinding('line_mode', 'enter_align_mode', 'space') - self.setKeyBinding('line_mode', 'enter_character_mode', 'Return') - self.setKeyBinding('line_mode', 'enter_character_mode', 'KP_Enter') - self.setKeyBinding('line_mode', 'first_line', 'Home') - self.setKeyBinding('line_mode', 'first_line', 'g') - self.setKeyBinding('line_mode', 'extend_first_line', 'Shift+Home') - self.setKeyBinding('line_mode', 'last_line', 'End') - self.setKeyBinding('line_mode', 'last_line', 'Shift+G') - self.setKeyBinding('line_mode', 'extend_last_line', 'Shift+End') + self.setKeyBinding('menu', 'first-difference', defaultModKey + 'Shift+Up') + self.setKeyBinding('menu', 'previous-difference', defaultModKey + 'Up') + self.setKeyBinding('menu', 'next-difference', defaultModKey + 'Down') + self.setKeyBinding('menu', 'last-difference', defaultModKey + 'Shift+Down') + self.setKeyBinding('menu', 'first-tab', 'Shift+Ctrl+Page_Up') + self.setKeyBinding('menu', 'previous-tab', 'Ctrl+Page_Up') + self.setKeyBinding('menu', 'next-tab', 'Ctrl+Page_Down') + self.setKeyBinding('menu', 'last-tab', 'Shift+Ctrl+Page_Down') + self.setKeyBinding('menu', 'shift-pane-right', 'Shift+Ctrl+parenright') + self.setKeyBinding('menu', 'shift-pane-left', 'Shift+Ctrl+parenleft') + self.setKeyBinding('menu', 'convert-to-upper-case', defaultModKey + 'u') + self.setKeyBinding('menu', 'convert-to-lower-case', defaultModKey + 'Shift+U') + self.setKeyBinding('menu', 'sort-lines-in-ascending-order', defaultModKey + 'y') + self.setKeyBinding('menu', 'sort-lines-in-descending-order', defaultModKey + 'Shift+Y') + self.setKeyBinding('menu', 'remove-trailing-white-space', defaultModKey + 'k') + self.setKeyBinding('menu', 'convert-tabs-to-spaces', defaultModKey + 'b') + self.setKeyBinding('menu', 'convert-leading-spaces-to-tabs', 'Shift+Ctrl+B') + self.setKeyBinding('menu', 'increase-indenting', defaultModKey + 'Shift+greater') + self.setKeyBinding('menu', 'decrease-indenting', defaultModKey + 'Shift+less') + self.setKeyBinding('menu', 'convert-to-dos', defaultModKey + 'Shift+E') + self.setKeyBinding('menu', 'convert-to-mac', defaultModKey + 'Shift+C') + self.setKeyBinding('menu', 'convert-to-unix', defaultModKey + 'e') + self.setKeyBinding('menu', 'copy-selection-right', defaultModKey + 'Shift+Right') + self.setKeyBinding('menu', 'copy-selection-left', defaultModKey + 'Shift+Left') + self.setKeyBinding('menu', 'copy-left-into-selection', defaultModKey + 'Right') + self.setKeyBinding('menu', 'copy-right-into-selection', defaultModKey + 'Left') + self.setKeyBinding('menu', 'merge-from-left-then-right', defaultModKey + 'm') + self.setKeyBinding('menu', 'merge-from-right-then-left', defaultModKey + 'Shift+M') + self.setKeyBinding('menu', 'help-contents', 'F1') + self.setKeyBinding('line_mode', 'enter-align-mode', 'space') + self.setKeyBinding('line_mode', 'enter-character-mode', 'Return') + self.setKeyBinding('line_mode', 'enter-character-mode', 'KP_Enter') + self.setKeyBinding('line_mode', 'first-line', 'Home') + self.setKeyBinding('line_mode', 'first-line', 'g') + self.setKeyBinding('line_mode', 'extend-first-line', 'Shift+Home') + self.setKeyBinding('line_mode', 'last-line', 'End') + self.setKeyBinding('line_mode', 'last-line', 'Shift+G') + self.setKeyBinding('line_mode', 'extend-last-line', 'Shift+End') self.setKeyBinding('line_mode', 'up', 'Up') self.setKeyBinding('line_mode', 'up', 'k') - self.setKeyBinding('line_mode', 'extend_up', 'Shift+Up') - self.setKeyBinding('line_mode', 'extend_up', 'Shift+K') + self.setKeyBinding('line_mode', 'extend-up', 'Shift+Up') + self.setKeyBinding('line_mode', 'extend-up', 'Shift+K') self.setKeyBinding('line_mode', 'down', 'Down') self.setKeyBinding('line_mode', 'down', 'j') - self.setKeyBinding('line_mode', 'extend_down', 'Shift+Down') - self.setKeyBinding('line_mode', 'extend_down', 'Shift+J') + self.setKeyBinding('line_mode', 'extend-down', 'Shift+Down') + self.setKeyBinding('line_mode', 'extend-down', 'Shift+J') self.setKeyBinding('line_mode', 'left', 'Left') self.setKeyBinding('line_mode', 'left', 'h') - self.setKeyBinding('line_mode', 'extend_left', 'Shift+Left') + self.setKeyBinding('line_mode', 'extend-left', 'Shift+Left') self.setKeyBinding('line_mode', 'right', 'Right') self.setKeyBinding('line_mode', 'right', 'l') - self.setKeyBinding('line_mode', 'extend_right', 'Shift+Right') - self.setKeyBinding('line_mode', 'page_up', 'Page_Up') - self.setKeyBinding('line_mode', 'page_up', defaultModKey + 'u') - self.setKeyBinding('line_mode', 'extend_page_up', 'Shift+Page_Up') - self.setKeyBinding('line_mode', 'extend_page_up', defaultModKey + 'Shift+U') - self.setKeyBinding('line_mode', 'page_down', 'Page_Down') - self.setKeyBinding('line_mode', 'page_down', defaultModKey + 'd') - self.setKeyBinding('line_mode', 'extend_page_down', 'Shift+Page_Down') - self.setKeyBinding('line_mode', 'extend_page_down', defaultModKey + 'Shift+D') - self.setKeyBinding('line_mode', 'delete_text', 'BackSpace') - self.setKeyBinding('line_mode', 'delete_text', 'Delete') - self.setKeyBinding('line_mode', 'delete_text', 'x') - self.setKeyBinding('line_mode', 'clear_edits', 'r') + self.setKeyBinding('line_mode', 'extend-right', 'Shift+Right') + self.setKeyBinding('line_mode', 'page-up', 'Page_Up') + self.setKeyBinding('line_mode', 'page-up', defaultModKey + 'u') + self.setKeyBinding('line_mode', 'extend-page-up', 'Shift+Page_Up') + self.setKeyBinding('line_mode', 'extend-page-up', defaultModKey + 'Shift+U') + self.setKeyBinding('line_mode', 'page-down', 'Page_Down') + self.setKeyBinding('line_mode', 'page-down', defaultModKey + 'd') + self.setKeyBinding('line_mode', 'extend-page-down', 'Shift+Page_Down') + self.setKeyBinding('line_mode', 'extend-page-down', defaultModKey + 'Shift+D') + self.setKeyBinding('line_mode', 'delete-text', 'BackSpace') + self.setKeyBinding('line_mode', 'delete-text', 'Delete') + self.setKeyBinding('line_mode', 'delete-text', 'x') + self.setKeyBinding('line_mode', 'clear-edits', 'r') self.setKeyBinding('line_mode', 'isolate', 'i') - self.setKeyBinding('line_mode', 'first_difference', 'Ctrl+Home') - self.setKeyBinding('line_mode', 'first_difference', 'Shift+P') - self.setKeyBinding('line_mode', 'previous_difference', 'p') - self.setKeyBinding('line_mode', 'next_difference', 'n') - self.setKeyBinding('line_mode', 'last_difference', 'Ctrl+End') - self.setKeyBinding('line_mode', 'last_difference', 'Shift+N') - # self.setKeyBinding('line_mode', 'copy_selection_right', 'Shift+L') - # self.setKeyBinding('line_mode', 'copy_selection_left', 'Shift+H') - self.setKeyBinding('line_mode', 'copy_left_into_selection', 'Shift+L') - self.setKeyBinding('line_mode', 'copy_right_into_selection', 'Shift+H') - self.setKeyBinding('line_mode', 'merge_from_left_then_right', 'm') - self.setKeyBinding('line_mode', 'merge_from_right_then_left', 'Shift+M') - self.setKeyBinding('align_mode', 'enter_line_mode', 'Escape') + self.setKeyBinding('line_mode', 'first-difference', 'Ctrl+Home') + self.setKeyBinding('line_mode', 'first-difference', 'Shift+P') + self.setKeyBinding('line_mode', 'previous-difference', 'p') + self.setKeyBinding('line_mode', 'next-difference', 'n') + self.setKeyBinding('line_mode', 'last-difference', 'Ctrl+End') + self.setKeyBinding('line_mode', 'last-difference', 'Shift+N') + # self.setKeyBinding('line_mode', 'copy-selection-right', 'Shift+L') + # self.setKeyBinding('line_mode', 'copy-selection-left', 'Shift+H') + self.setKeyBinding('line_mode', 'copy-left-into-selection', 'Shift+L') + self.setKeyBinding('line_mode', 'copy-right-into-selection', 'Shift+H') + self.setKeyBinding('line_mode', 'merge-from-left-then-right', 'm') + self.setKeyBinding('line_mode', 'merge-from-right-then-left', 'Shift+M') + self.setKeyBinding('align_mode', 'enter-line-mode', 'Escape') self.setKeyBinding('align_mode', 'align', 'space') - self.setKeyBinding('align_mode', 'enter_character_mode', 'Return') - self.setKeyBinding('align_mode', 'enter_character_mode', 'KP_Enter') - self.setKeyBinding('align_mode', 'first_line', 'g') - self.setKeyBinding('align_mode', 'last_line', 'Shift+G') + self.setKeyBinding('align_mode', 'enter-character-mode', 'Return') + self.setKeyBinding('align_mode', 'enter-character-mode', 'KP_Enter') + self.setKeyBinding('align_mode', 'first-line', 'g') + self.setKeyBinding('align_mode', 'last-line', 'Shift+G') self.setKeyBinding('align_mode', 'up', 'Up') self.setKeyBinding('align_mode', 'up', 'k') self.setKeyBinding('align_mode', 'down', 'Down') @@ -166,11 +166,11 @@ class Resources: self.setKeyBinding('align_mode', 'left', 'h') self.setKeyBinding('align_mode', 'right', 'Right') self.setKeyBinding('align_mode', 'right', 'l') - self.setKeyBinding('align_mode', 'page_up', 'Page_Up') - self.setKeyBinding('align_mode', 'page_up', defaultModKey + 'u') - self.setKeyBinding('align_mode', 'page_down', 'Page_Down') - self.setKeyBinding('align_mode', 'page_down', defaultModKey + 'd') - self.setKeyBinding('character_mode', 'enter_line_mode', 'Escape') + self.setKeyBinding('align_mode', 'page-up', 'Page_Up') + self.setKeyBinding('align_mode', 'page-up', defaultModKey + 'u') + self.setKeyBinding('align_mode', 'page-down', 'Page_Down') + self.setKeyBinding('align_mode', 'page-down', defaultModKey + 'd') + self.setKeyBinding('character_mode', 'enter-line-mode', 'Escape') # default colours self.colours: Dict[str, _Colour] = { @@ -225,29 +225,29 @@ class Resources: self.setDifferenceColours('difference_1 difference_2 difference_3') # keyboard action processing - def setKeyBinding(self, ctx: str, s: str, v: str) -> None: - action_tuple = (ctx, s) - modifiers = Gdk.ModifierType(0) + def setKeyBinding(self, ctx: str, name: str, modifiers: str) -> None: + action_tuple = (ctx, name) + modifier_flags = Gdk.ModifierType(0) key = None - for token in v.split('+'): + for token in modifiers.split('+'): if token == 'Shift': - modifiers |= Gdk.ModifierType.SHIFT_MASK + modifier_flags |= Gdk.ModifierType.SHIFT_MASK elif token == 'Ctrl': - modifiers |= Gdk.ModifierType.CONTROL_MASK + modifier_flags |= Gdk.ModifierType.CONTROL_MASK elif token == 'Cmd': - modifiers |= Gdk.ModifierType.META_MASK + modifier_flags |= Gdk.ModifierType.META_MASK elif token == 'Alt': - modifiers |= Gdk.ModifierType.MOD1_MASK + modifier_flags |= Gdk.ModifierType.MOD1_MASK elif len(token) == 0 or token[0] == '_': - raise ValueError(_('The key binding "{key}" is invalid').format(key=v)) + raise ValueError(_('The key binding "{key}" is invalid').format(key=modifiers)) else: token = 'KEY_' + token if not hasattr(Gdk, token): - raise ValueError(_('The key binding "{key}" is invalid').format(key=v)) + raise ValueError(_('The key binding "{key}" is invalid').format(key=modifiers)) key = getattr(Gdk, token) if key is None: - raise ValueError(_('The key binding "{key}" is invalid').format(key=v)) - key_tuple = (ctx, (key, modifiers)) + raise ValueError(_('The key binding "{key}" is invalid').format(key=modifiers)) + key_tuple = (ctx, (key, modifier_flags)) # remove any existing binding if key_tuple in self.keybindings_lookup: @@ -272,18 +272,18 @@ class Resources: del self.keybindings_lookup[key_tuple] del self.keybindings[action_tuple][key_tuple] + def getKeyBindings(self, ctx, name): + try: + return [t for _, t in self.keybindings[(ctx, name)].keys()] + except KeyError: + return [] + def getActionForKey(self, ctx, key, modifiers): try: return self.keybindings_lookup[(ctx, (key, modifiers))][1] except KeyError: return None - def getKeyBindings(self, ctx, s): - try: - return [t for c, t in self.keybindings[(ctx, s)].keys()] - except KeyError: - return [] - # colours used for indicating differences def setDifferenceColours(self, s: str) -> None: colours = s.split() diff --git a/src/diffuse/widgets.py b/src/diffuse/widgets.py index 3959a4d..f9379cb 100644 --- a/src/diffuse/widgets.py +++ b/src/diffuse/widgets.py @@ -215,7 +215,7 @@ class FileDiffViewerBase(Gtk.Grid): self.undoblock = None # cached data - self.syntax = None + self.syntax = '' self.diffmap_cache = None # editing mode @@ -231,53 +231,53 @@ class FileDiffViewerBase(Gtk.Grid): # keybindings self._line_mode_actions: Dict[str, Callable] = { - 'enter_align_mode': self._line_mode_enter_align_mode, - 'enter_character_mode': self.setCharMode, - 'first_line': self._first_line, - 'extend_first_line': self._extend_first_line, - 'last_line': self._last_line, - 'extend_last_line': self._extend_last_line, + 'enter-align-mode': self._line_mode_enter_align_mode, + 'enter-character-mode': self.setCharMode, + 'first-line': self._first_line, + 'extend-first-line': self._extend_first_line, + 'last-line': self._last_line, + 'extend-last-line': self._extend_last_line, 'up': self._line_mode_up, - 'extend_up': self._line_mode_extend_up, + 'extend-up': self._line_mode_extend_up, 'down': self._line_mode_down, - 'extend_down': self._line_mode_extend_down, + 'extend-down': self._line_mode_extend_down, 'left': self._line_mode_left, - 'extend_left': self._line_mode_extend_left, + 'extend-left': self._line_mode_extend_left, 'right': self._line_mode_right, - 'extend_right': self._line_mode_extend_right, - 'page_up': self._line_mode_page_up, - 'extend_page_up': self._line_mode_extend_page_up, - 'page_down': self._line_mode_page_down, - 'extend_page_down': self._line_mode_extend_page_down, - 'delete_text': self._delete_text, - 'clear_edits': self.clear_edits, + 'extend-right': self._line_mode_extend_right, + 'page-up': self._line_mode_page_up, + 'extend-page-up': self._line_mode_extend_page_up, + 'page-down': self._line_mode_page_down, + 'extend-page-down': self._line_mode_extend_page_down, + 'delete-text': self._delete_text, + 'clear-edits': self.clear_edits, 'isolate': self.isolate, - 'first_difference': self.first_difference, - 'previous_difference': self.previous_difference, - 'next_difference': self.next_difference, - 'last_difference': self.last_difference, - 'copy_selection_right': self.copy_selection_right, - 'copy_selection_left': self.copy_selection_left, - 'copy_left_into_selection': self.copy_left_into_selection, - 'copy_right_into_selection': self.copy_right_into_selection, - 'merge_from_left_then_right': self.merge_from_left_then_right, - 'merge_from_right_then_left': self.merge_from_right_then_left + 'first-difference': self.first_difference, + 'previous-difference': self.previous_difference, + 'next-difference': self.next_difference, + 'last-difference': self.last_difference, + 'copy-selection-right': self.copy_selection_right, + 'copy-selection-left': self.copy_selection_left, + 'copy-left-into-selection': self.copy_left_into_selection, + 'copy-right-into-selection': self.copy_right_into_selection, + 'merge-from-left-then-right': self.merge_from_left_then_right, + 'merge-from-right-then-left': self.merge_from_right_then_left } self._align_mode_actions: Dict[str, Callable] = { - 'enter_line_mode': self._align_mode_enter_line_mode, - 'enter_character_mode': self.setCharMode, - 'first_line': self._first_line, - 'last_line': self._last_line, + 'enter-line-mode': self._align_mode_enter_line_mode, + 'enter-character-mode': self.setCharMode, + 'first-line': self._first_line, + 'last-line': self._last_line, 'up': self._line_mode_up, 'down': self._line_mode_down, 'left': self._line_mode_left, 'right': self._line_mode_right, - 'page_up': self._line_mode_page_up, - 'page_down': self._line_mode_page_down, + 'page-up': self._line_mode_page_up, + 'page-down': self._line_mode_page_down, 'align': self._align_text } self._character_mode_actions: Dict[str, Callable] = { - 'enter_line_mode': self.setLineMode + 'enter-line-mode': self.setLineMode } self._button_actions: Dict[str, Callable] = { 'undo': self.undo, @@ -285,35 +285,35 @@ class FileDiffViewerBase(Gtk.Grid): 'cut': self.cut, 'copy': self.copy, 'paste': self.paste, - 'select_all': self.select_all, - 'clear_edits': self.clear_edits, - 'dismiss_all_edits': self.dismiss_all_edits, - 'realign_all': self.realign_all, + 'select-all': self.select_all, + 'clear-edits': self.clear_edits, + 'dismiss-all-edits': self.dismiss_all_edits, + 'realign-all': self.realign_all, 'isolate': self.isolate, - 'first_difference': self.first_difference, - 'previous_difference': self.previous_difference, - 'next_difference': self.next_difference, - 'last_difference': self.last_difference, - 'shift_pane_right': self.shift_pane_right, - 'shift_pane_left': self.shift_pane_left, - 'convert_to_upper_case': self.convert_to_upper_case, - 'convert_to_lower_case': self.convert_to_lower_case, - 'sort_lines_in_ascending_order': self.sort_lines_in_ascending_order, - 'sort_lines_in_descending_order': self.sort_lines_in_descending_order, - 'remove_trailing_white_space': self.remove_trailing_white_space, - 'convert_tabs_to_spaces': self.convert_tabs_to_spaces, - 'convert_leading_spaces_to_tabs': self.convert_leading_spaces_to_tabs, - 'increase_indenting': self.increase_indenting, - 'decrease_indenting': self.decrease_indenting, - 'convert_to_dos': self.convert_to_dos, - 'convert_to_mac': self.convert_to_mac, - 'convert_to_unix': self.convert_to_unix, - 'copy_selection_right': self.copy_selection_right, - 'copy_selection_left': self.copy_selection_left, - 'copy_left_into_selection': self.copy_left_into_selection, - 'copy_right_into_selection': self.copy_right_into_selection, - 'merge_from_left_then_right': self.merge_from_left_then_right, - 'merge_from_right_then_left': self.merge_from_right_then_left + 'first-difference': self.first_difference, + 'previous-difference': self.previous_difference, + 'next-difference': self.next_difference, + 'last-difference': self.last_difference, + 'shift-pane-right': self.shift_pane_right, + 'shift-pane-left': self.shift_pane_left, + 'convert-to-upper-case': self.convert_to_upper_case, + 'convert-to-lower-case': self.convert_to_lower_case, + 'sort-lines-in-ascending-order': self.sort_lines_in_ascending_order, + 'sort-lines-in-descending-order': self.sort_lines_in_descending_order, + 'remove-trailing-white-space': self.remove_trailing_white_space, + 'convert-tabs-to-spaces': self.convert_tabs_to_spaces, + 'convert-leading-spaces-to-tabs': self.convert_leading_spaces_to_tabs, + 'increase-indenting': self.increase_indenting, + 'decrease-indenting': self.decrease_indenting, + 'convert-to-dos': self.convert_to_dos, + 'convert-to-mac': self.convert_to_mac, + 'convert-to-unix': self.convert_to_unix, + 'copy-selection-right': self.copy_selection_right, + 'copy-selection-left': self.copy_selection_left, + 'copy-left-into-selection': self.copy_left_into_selection, + 'copy-right-into-selection': self.copy_right_into_selection, + 'merge-from-left-then-right': self.merge_from_left_then_right, + 'merge-from-right-then-left': self.merge_from_right_then_left } # create panes @@ -523,8 +523,8 @@ class FileDiffViewerBase(Gtk.Grid): self.align_pane = 0 self.align_line = 0 self.mode = EditMode.LINE - self.emit('cursor_changed') - self.emit('mode_changed') + self.emit('cursor-changed') + self.emit('mode-changed') # changes the viewer's mode to CHAR_MODE def setCharMode(self) -> None: @@ -541,17 +541,17 @@ class FileDiffViewerBase(Gtk.Grid): self._im_focus_in() self.im_context.reset() self.mode = EditMode.CHAR - self.emit('cursor_changed') - self.emit('mode_changed') + self.emit('cursor-changed') + self.emit('mode-changed') # sets the syntax highlighting rules - def setSyntax(self, s): - if self.syntax is not s: - self.syntax = s + def setSyntax(self, new_syntax: str) -> None: + if self.syntax is not new_syntax: + self.syntax = new_syntax # invalidate the syntax caches for pane in self.panes: pane.syntax_cache = [] - self.emit('syntax_changed', s) + self.emit('syntax-changed', new_syntax) # force all panes to redraw for darea in self.dareas: darea.queue_draw() @@ -733,7 +733,7 @@ class FileDiffViewerBase(Gtk.Grid): # create an Undo object for the action self.addUndo(FileDiffViewerBase.SetFormatUndo(f, fmt, pane.format)) pane.format = fmt - self.emit('format_changed', f, fmt) + self.emit('format-changed', f, fmt) # Undo for the creation of Line objects class InstanceLineUndo: @@ -806,7 +806,7 @@ class FileDiffViewerBase(Gtk.Grid): elif not is_modified and line.is_modified: pane.num_edits -= 1 if pane.num_edits != old_num_edits: - self.emit('num_edits_changed', f) + self.emit('num-edits-changed', f) line.is_modified = is_modified line.modified_text = text line.compare_string = None @@ -1061,7 +1061,7 @@ class FileDiffViewerBase(Gtk.Grid): if line is not None and line.is_modified: pane.num_edits += 1 if pane.num_edits != old_num_edits: - self.emit('num_edits_changed', f) + self.emit('num-edits-changed', f) del pane.syntax_cache[:] pane.max_line_number = new_max_num self.dareas[f].queue_draw() @@ -1541,8 +1541,8 @@ class FileDiffViewerBase(Gtk.Grid): self.setCurrentChar(self.current_line, self.current_char, True) else: self.setCurrentLine(self.current_pane, self.current_line, self.selection_line) - self.emit('cursor_changed') - self.emit('mode_changed') + self.emit('cursor-changed') + self.emit('mode-changed') # queue a redraw to show the updated selection self.dareas[old_f].queue_draw() @@ -1585,7 +1585,7 @@ class FileDiffViewerBase(Gtk.Grid): self.current_line = i self.selection_line = selection if selection is not None else i - self.emit('cursor_changed') + self.emit('cursor-changed') # invalidate old selection area self._queue_draw_lines(old_f, line0, line1) @@ -1697,7 +1697,7 @@ class FileDiffViewerBase(Gtk.Grid): self._set_clipboard_text(Gdk.SELECTION_PRIMARY, self.getSelectedText()) self._cursor_position_changed(True) - self.emit('cursor_changed') + self.emit('cursor-changed') # invalidate old selection area self._queue_draw_lines(f, line0, line1) @@ -1809,7 +1809,7 @@ class FileDiffViewerBase(Gtk.Grid): self.mode = EditMode.CHAR self._im_focus_in() self.button_press(f, x, y, False) - self.emit('mode_changed') + self.emit('mode-changed') elif self.mode == EditMode.CHAR and self.current_pane == f: # select word text = utils.strip_eol(self.getLineText(f, i)) @@ -1862,8 +1862,8 @@ class FileDiffViewerBase(Gtk.Grid): [_('Copy'), self.button_cb, 'copy', Gtk.STOCK_COPY, can_select], [_('Paste'), self.button_cb, 'paste', Gtk.STOCK_PASTE, can_select], [], - [_('Select All'), self.button_cb, 'select_all', None, can_select], - [_('Clear Edits'), self.button_cb, 'clear_edits', Gtk.STOCK_CLEAR, can_isolate], # noqa: E501 + [_('Select All'), self.button_cb, 'select-all', None, can_select], + [_('Clear Edits'), self.button_cb, 'clear-edits', Gtk.STOCK_CLEAR, can_isolate], # noqa: E501 [], [_('Swap with Selected Pane'), self.swap_panes_cb, f, None, can_swap] ]) @@ -2518,7 +2518,7 @@ class FileDiffViewerBase(Gtk.Grid): def getMaxCharPosition(self, i): return utils.len_minus_line_ending(self.getLineText(self.current_pane, i)) - # 'enter_align_mode' keybinding action + # 'enter-align-mode' keybinding action def _line_mode_enter_align_mode(self): if self.mode == EditMode.CHAR: self._im_focus_out() @@ -2528,23 +2528,23 @@ class FileDiffViewerBase(Gtk.Grid): self.selection_line = self.current_line self.align_pane = self.current_pane self.align_line = self.current_line - self.emit('mode_changed') + self.emit('mode-changed') self.dareas[self.align_pane].queue_draw() - # 'first_line' keybinding action + # 'first-line' keybinding action def _first_line(self): self.setCurrentLine(self.current_pane, 0) - # 'extend_first_line' keybinding action + # 'extend-first-line' keybinding action def _extend_first_line(self): self.setCurrentLine(self.current_pane, 0, self.selection_line) - # 'last_line' keybinding action + # 'last-line' keybinding action def _last_line(self): f = self.current_pane self.setCurrentLine(f, len(self.panes[f].lines)) - # 'extend_last_line' keybinding action + # 'extend-last-line' keybinding action def _extend_last_line(self): f = self.current_pane self.setCurrentLine(f, len(self.panes[f].lines), self.selection_line) @@ -2553,7 +2553,7 @@ class FileDiffViewerBase(Gtk.Grid): def _line_mode_up(self, selection=None): self.setCurrentLine(self.current_pane, self.current_line - 1, selection) - # 'extend_up' keybinding action + # 'extend-up' keybinding action def _line_mode_extend_up(self): self._line_mode_up(self.selection_line) @@ -2561,7 +2561,7 @@ class FileDiffViewerBase(Gtk.Grid): def _line_mode_down(self, selection=None): self.setCurrentLine(self.current_pane, self.current_line + 1, selection) - # 'extend_down' keybinding action + # 'extend-down' keybinding action def _line_mode_extend_down(self): self._line_mode_down(self.selection_line) @@ -2569,7 +2569,7 @@ class FileDiffViewerBase(Gtk.Grid): def _line_mode_left(self, selection=None): self.setCurrentLine(self.current_pane - 1, self.current_line, selection) - # 'extend_left' keybinding action + # 'extend-left' keybinding action def _line_mode_extend_left(self): self._line_mode_left(self.selection_line) @@ -2577,33 +2577,33 @@ class FileDiffViewerBase(Gtk.Grid): def _line_mode_right(self, selection=None): self.setCurrentLine(self.current_pane + 1, self.current_line, selection) - # 'extend_right' keybinding action + # 'extend-right' keybinding action def _line_mode_extend_right(self): self._line_mode_right(self.selection_line) - # 'page_up' keybinding action + # 'page-up' keybinding action def _line_mode_page_up(self, selection=None): delta = int(self.vadj.get_page_size() // self.font_height) self.setCurrentLine(self.current_pane, self.current_line - delta, selection) - # 'extend_page_up' keybinding action + # 'extend-page-up' keybinding action def _line_mode_extend_page_up(self) -> None: self._line_mode_page_up(self.selection_line) - # 'page_down' keybinding action + # 'page-down' keybinding action def _line_mode_page_down(self, selection=None): delta = int(self.vadj.get_page_size() // self.font_height) self.setCurrentLine(self.current_pane, self.current_line + delta, selection) - # 'extend_page_down' keybinding action + # 'extend-page-down' keybinding action def _line_mode_extend_page_down(self) -> None: self._line_mode_page_down(self.selection_line) - # 'delete_text' keybinding action + # 'delete-text' keybinding action def _delete_text(self) -> None: self.replaceText('') - # 'enter_line_mode' keybinding action + # 'enter-line-mode' keybinding action def _align_mode_enter_line_mode(self) -> None: self.selection_line = self.current_line self.setLineMode() @@ -2991,7 +2991,7 @@ class FileDiffViewerBase(Gtk.Grid): self.receive_clipboard_text_cb, None) - # 'clear_edits' action + # 'clear-edits' action def clear_edits(self) -> None: self.setLineMode() self.recordEditMode() @@ -3010,7 +3010,7 @@ class FileDiffViewerBase(Gtk.Grid): self.instanceLine(f, i, True) self.recordEditMode() - # 'dismiss_all_edits' action + # 'dismiss-all-edits' action def dismiss_all_edits(self) -> None: if self.mode in (EditMode.LINE, EditMode.CHAR): self.bakeEdits(self.current_pane) @@ -3102,13 +3102,13 @@ class FileDiffViewerBase(Gtk.Grid): for pane in self.panes: del pane.diff_cache[:] # tab width may have changed - self.emit('cursor_changed') + self.emit('cursor-changed') for darea in self.dareas: darea.queue_draw() self.diffmap_cache = None self.diffmap.queue_draw() - # 'realign_all' action + # 'realign-all' action def realign_all(self) -> None: self.setLineMode() f = self.current_pane @@ -3243,24 +3243,24 @@ class FileDiffViewerBase(Gtk.Grid): self.centre_view_about_y((start + i) * self.font_height / 2) self.setCurrentLine(f, start, i) - # 'first_difference' action + # 'first-difference' action def first_difference(self) -> None: self.setLineMode() self.go_to_difference(0, 1) - # 'previous_difference' action + # 'previous-difference' action def previous_difference(self) -> None: self.setLineMode() i = min(self.current_line, self.selection_line) - 1 self.go_to_difference(i, -1) - # 'next_difference' action + # 'next-difference' action def next_difference(self) -> None: self.setLineMode() i = max(self.current_line, self.selection_line) + 1 self.go_to_difference(i, 1) - # 'last_difference' action + # 'last-difference' action def last_difference(self) -> None: self.setLineMode() i = len(self.panes[self.current_pane].lines) @@ -3298,7 +3298,7 @@ class FileDiffViewerBase(Gtk.Grid): # queue redraw self.diffmap_cache = None self.diffmap.queue_draw() - self.emit('swapped_panes', f_dst, f_src) + self.emit('swapped-panes', f_dst, f_src) # swap the contents of two panes def swap_panes(self, f_dst: int, f_src: int) -> None: @@ -3315,17 +3315,17 @@ class FileDiffViewerBase(Gtk.Grid): self.swap_panes(data, self.current_pane) self.closeUndoBlock() - # 'shift_pane_left' action + # 'shift-pane-left' action def shift_pane_left(self) -> None: f = self.current_pane self.swap_panes(f - 1, f) - # 'shift_pane_right' action + # 'shift-pane-right' action def shift_pane_right(self) -> None: f = self.current_pane self.swap_panes(f + 1, f) - # 'convert_to_upper_case' action + # 'convert-to-upper-case' action def _convert_case(self, to_upper: bool) -> None: # find range of characters to operate upon if self.mode == EditMode.CHAR: @@ -3366,11 +3366,11 @@ class FileDiffViewerBase(Gtk.Grid): if s != text: self.updateText(f, i, s) - # 'convert_to_upper_case' action + # 'convert-to-upper-case' action def convert_to_upper_case(self) -> None: self._convert_case(True) - # 'convert_to_lower_case' action + # 'convert-to-lower-case' action def convert_to_lower_case(self) -> None: self._convert_case(False) @@ -3402,15 +3402,15 @@ class FileDiffViewerBase(Gtk.Grid): self.setCurrentChar(self.current_line, 0, self.selection_line, 0) self.recordEditMode() - # 'sort_lines_in_ascending_order' action + # 'sort-lines-in-ascending-order' action def sort_lines_in_ascending_order(self) -> None: self._sort_lines(False) - # 'sort_lines_in_descending_order' action + # 'sort-lines-in-descending-order' action def sort_lines_in_descending_order(self) -> None: self._sort_lines(True) - # 'remove_trailing_white_space' action + # 'remove-trailing-white-space' action def remove_trailing_white_space(self) -> None: if self.mode != EditMode.CHAR: self.setLineMode() @@ -3436,7 +3436,7 @@ class FileDiffViewerBase(Gtk.Grid): self.setCurrentChar(self.current_line, 0, self.selection_line, 0) self.recordEditMode() - # 'convert_tabs_to_spaces' action + # 'convert-tabs-to-spaces' action def convert_tabs_to_spaces(self) -> None: # find range of characters to operate upon if self.mode == EditMode.CHAR: @@ -3489,7 +3489,7 @@ class FileDiffViewerBase(Gtk.Grid): self.setCurrentChar(end, j1, start, j0) self.recordEditMode() - # 'convert_leading_spaces_to_tabs' action + # 'convert-leading-spaces-to-tabs' action def convert_leading_spaces_to_tabs(self) -> None: if self.mode != EditMode.CHAR: self.setLineMode() @@ -3552,11 +3552,11 @@ class FileDiffViewerBase(Gtk.Grid): self.setCurrentChar(self.current_line, 0, self.selection_line, 0) self.recordEditMode() - # 'increase_indenting' action + # 'increase-indenting' action def increase_indenting(self) -> None: self._adjust_indenting(1) - # 'decrease_indenting' action + # 'decrease-indenting' action def decrease_indenting(self) -> None: self._adjust_indenting(-1) @@ -3572,15 +3572,15 @@ class FileDiffViewerBase(Gtk.Grid): self.updateText(f, i, s) self.setFormat(f, fmt) - # 'convert_to_dos' action + # 'convert-to-dos' action def convert_to_dos(self) -> None: self.convert_format(LineEnding.DOS_FORMAT) - # 'convert_to_mac' action + # 'convert-to-mac' action def convert_to_mac(self) -> None: self.convert_format(LineEnding.MAC_FORMAT) - # 'convert_to_unix' action + # 'convert-to-unix' action def convert_to_unix(self) -> None: self.convert_format(LineEnding.UNIX_FORMAT) @@ -3614,25 +3614,25 @@ class FileDiffViewerBase(Gtk.Grid): self.merge_lines(data, self.current_pane) self.closeUndoBlock() - # 'copy_selection_right' action + # 'copy-selection-right' action def copy_selection_right(self) -> None: f = self.current_pane + 1 if 0 < f < len(self.panes): self.merge_lines(f, f - 1) - # 'copy_selection_left' action + # 'copy-selection-left' action def copy_selection_left(self) -> None: f = self.current_pane - 1 if f >= 0 and f + 1 < len(self.panes): self.merge_lines(f, f + 1) - # 'copy_left_into_selection' action + # 'copy-left-into-selection' action def copy_left_into_selection(self) -> None: f = self.current_pane if 0 < f < len(self.panes): self.merge_lines(f, f - 1) - # 'copy_right_into_selection' action + # 'copy-right-into-selection' action def copy_right_into_selection(self) -> None: f = self.current_pane if f >= 0 and f + 1 < len(self.panes): @@ -3720,11 +3720,11 @@ class FileDiffViewerBase(Gtk.Grid): self.setCurrentLine(f, end, start) self.recordEditMode() - # 'merge_from_left_then_right' keybinding action + # 'merge-from-left-then-right' keybinding action def merge_from_left_then_right(self): self._mergeBoth(False) - # 'merge_from_right_then_left' keybinding action + # 'merge-from-right-then-left' keybinding action def merge_from_right_then_left(self): self._mergeBoth(True) diff --git a/src/diffuse/window.py b/src/diffuse/window.py index cc4355f..8385e5a 100644 --- a/src/diffuse/window.py +++ b/src/diffuse/window.py @@ -146,7 +146,7 @@ class PaneHeader(Gtk.Box): self.show_all() # callback for buttons - def button_cb(self, widget, s): + def button_cb(self, widget: Gtk.Widget, s: str) -> None: self.emit(s) # creates an appropriate title for the pane header @@ -166,7 +166,7 @@ class PaneHeader(Gtk.Box): s = ' '.join(ss) self.label.set_text(s) self.label.set_tooltip_text(s) - self.emit('title_changed') + self.emit('title-changed') # set num edits def setEdits(self, has_edits: bool) -> None: @@ -373,7 +373,7 @@ class FileDiffViewer(FileDiffViewerBase): s = self.title if has_edits: s += ' *' - self.emit('title_changed', s) + self.emit('title-changed', s) def setEncoding(self, f, encoding): h = self.headers[f] @@ -653,7 +653,7 @@ class FileDiffViewer(FileDiffViewerBase): else: s = None self.status = s - self.emit('status_changed', s) + self.emit('status-changed', s) # gets the status bar text def getStatus(self) -> Optional[str]: @@ -779,22 +779,22 @@ class DiffuseWindow(Gtk.ApplicationWindow): menu_specs = [] menu_specs.append([_('_File'), [ [ - [_('_Open File...'), self.open_file_cb, None, 'open_file'], - [_('Open File In New _Tab...'), self.open_file_in_new_tab_cb, None, 'open_file_in_new_tab'], # noqa: E501 - [_('Open _Modified Files...'), self.open_modified_files_cb, None, 'open_modified_files'], # noqa: E501 - [_('Open Commi_t...'), self.open_commit_cb, None, 'open_commit'], - [_('_Reload File'), self.reload_file_cb, None, 'reload_file'], + [_('_Open File...'), self.open_file_cb, None, 'open-file'], + [_('Open File In New _Tab...'), self.open_file_in_new_tab_cb, None, 'open-file-in-new-tab'], # noqa: E501 + [_('Open _Modified Files...'), self.open_modified_files_cb, None, 'open-modified-files'], # noqa: E501 + [_('Open Commi_t...'), self.open_commit_cb, None, 'open-commit'], + [_('_Reload File'), self.reload_file_cb, None, 'reload-file'], ], [ - [_('_Save File'), self.save_file_cb, None, 'save_file'], - [_('Save File _As...'), self.save_file_as_cb, None, 'save_file_as'], - [_('Save A_ll'), self.save_all_cb, None, 'save_all'], + [_('_Save File'), self.save_file_cb, None, 'save-file'], + [_('Save File _As...'), self.save_file_as_cb, None, 'save-file-as'], + [_('Save A_ll'), self.save_all_cb, None, 'save-all'], ], [ - [_('New _2-Way File Merge'), self.new_2_way_file_merge_cb, None, 'new_2_way_file_merge'], # noqa: E501 - [_('New _3-Way File Merge'), self.new_3_way_file_merge_cb, None, 'new_3_way_file_merge'], # noqa: E501 - [_('New _N-Way File Merge...'), self.new_n_way_file_merge_cb, None, 'new_n_way_file_merge'], # noqa: E501 + [_('New _2-Way File Merge'), self.new_2_way_file_merge_cb, None, 'new-2-way-file-merge'], # noqa: E501 + [_('New _3-Way File Merge'), self.new_3_way_file_merge_cb, None, 'new-3-way-file-merge'], # noqa: E501 + [_('New _N-Way File Merge...'), self.new_n_way_file_merge_cb, None, 'new-n-way-file-merge'], # noqa: E501 ], [ - [_('_Close Tab'), self.close_tab_cb, None, 'close_tab'], - [_('_Undo Close Tab'), self.undo_close_tab_cb, None, 'undo_close_tab'], + [_('_Close Tab'), self.close_tab_cb, None, 'close-tab'], + [_('_Undo Close Tab'), self.undo_close_tab_cb, None, 'undo-close-tab'], [_('_Quit'), self.quit_cb, None, 'quit'] ] ]]) @@ -808,24 +808,24 @@ class DiffuseWindow(Gtk.ApplicationWindow): [_('_Copy'), self.menuitem_cb, 'copy', 'copy'], [_('_Paste'), self.menuitem_cb, 'paste', 'paste'], ], [ - [_('Select _All'), self.menuitem_cb, 'select_all', 'select_all'], - [_('C_lear Edits'), self.menuitem_cb, 'clear_edits', 'clear_edits'], - [_('_Dismiss All Edits'), self.menuitem_cb, 'dismiss_all_edits', 'dismiss_all_edits'], # noqa: E501 + [_('Select _All'), self.menuitem_cb, 'select-all', 'select-all'], + [_('C_lear Edits'), self.menuitem_cb, 'clear-edits', 'clear-edits'], + [_('_Dismiss All Edits'), self.menuitem_cb, 'dismiss-all-edits', 'dismiss-all-edits'], # noqa: E501 ], [ [_('_Find...'), self.find_cb, None, 'find'], - [_('Find _Next'), self.find_next_cb, None, 'find_next'], - [_('Find Pre_vious'), self.find_previous_cb, None, 'find_previous'], - [_('_Go To Line...'), self.go_to_line_cb, None, 'go_to_line'], + [_('Find _Next'), self.find_next_cb, None, 'find-next'], + [_('Find Pre_vious'), self.find_previous_cb, None, 'find-previous'], + [_('_Go To Line...'), self.go_to_line_cb, None, 'go-to-line'], ], [ [_('Pr_eferences...'), self.preferences_cb, None, 'preferences'] ] ]]) - syntax_menu = [[[_('None'), None, '', 'syntax_highlighting']]] + syntax_menu = [[[_('None'), None, '', 'syntax-highlighting']]] names = theResources.getSyntaxNames() variant = GLib.Variant.new_string('') self.syntax_action = Gio.SimpleAction.new_stateful( - 'syntax_highlighting', variant.get_type(), variant + 'syntax-highlighting', variant.get_type(), variant ) self.syntax_action.connect('change-state', self.syntax_cb) self.add_action(self.syntax_action) @@ -838,7 +838,7 @@ class DiffuseWindow(Gtk.ApplicationWindow): name, None, name, - 'syntax_highlighting', + 'syntax-highlighting', ] ) syntax_menu.append(syntax_section) @@ -847,68 +847,65 @@ class DiffuseWindow(Gtk.ApplicationWindow): [ [_('_Syntax Highlighting'), None, None, None, syntax_menu] ], [ - [_('Re_align All'), self.menuitem_cb, 'realign_all', 'realign_all'], + [_('Re_align All'), self.menuitem_cb, 'realign-all', 'realign-all'], [_('_Isolate'), self.menuitem_cb, 'isolate', 'isolate'], ], [ - [_('_First Difference'), self.menuitem_cb, 'first_difference', 'first_difference'], - [_('_Previous Difference'), self.menuitem_cb, 'previous_difference', 'previous_difference'], # noqa: E501 - [_('_Next Difference'), self.menuitem_cb, 'next_difference', 'next_difference'], - [_('_Last Difference'), self.menuitem_cb, 'last_difference', 'last_difference'], + [_('_First Difference'), self.menuitem_cb, 'first-difference', 'first-difference'], + [_('_Previous Difference'), self.menuitem_cb, 'previous-difference', 'previous-difference'], # noqa: E501 + [_('_Next Difference'), self.menuitem_cb, 'next-difference', 'next-difference'], + [_('_Last Difference'), self.menuitem_cb, 'last-difference', 'last-difference'], ], [ - [_('Fir_st Tab'), self.first_tab_cb, None, 'first_tab'], - [_('Pre_vious Tab'), self.previous_tab_cb, None, 'previous_tab'], - [_('Next _Tab'), self.next_tab_cb, None, 'next_tab'], - [_('Las_t Tab'), self.last_tab_cb, None, 'last_tab'], + [_('Fir_st Tab'), self.first_tab_cb, None, 'first-tab'], + [_('Pre_vious Tab'), self.previous_tab_cb, None, 'previous-tab'], + [_('Next _Tab'), self.next_tab_cb, None, 'next-tab'], + [_('Las_t Tab'), self.last_tab_cb, None, 'last-tab'], ], [ - [_('Shift Pane _Right'), self.menuitem_cb, 'shift_pane_right', 'shift_pane_right'], - [_('Shift Pane _Left'), self.menuitem_cb, 'shift_pane_left', 'shift_pane_left'] + [_('Shift Pane _Right'), self.menuitem_cb, 'shift-pane-right', 'shift-pane-right'], + [_('Shift Pane _Left'), self.menuitem_cb, 'shift-pane-left', 'shift-pane-left'] ] ]]) menu_specs.append([_('F_ormat'), [ [ - [_('Convert To _Upper Case'), self.menuitem_cb, 'convert_to_upper_case', 'convert_to_upper_case'], # noqa: E501 - [_('Convert To _Lower Case'), self.menuitem_cb, 'convert_to_lower_case', 'convert_to_lower_case'], # noqa: E501 + [_('Convert To _Upper Case'), self.menuitem_cb, 'convert-to-upper-case', 'convert-to-upper-case'], # noqa: E501 + [_('Convert To _Lower Case'), self.menuitem_cb, 'convert-to-lower-case', 'convert-to-lower-case'], # noqa: E501 ], [ - [_('Sort Lines In _Ascending Order'), self.menuitem_cb, 'sort_lines_in_ascending_order', 'sort_lines_in_ascending_order'], # noqa: E501 - [_('Sort Lines In D_escending Order'), self.menuitem_cb, 'sort_lines_in_descending_order', 'sort_lines_in_descending_order'], # noqa: E501 + [_('Sort Lines In _Ascending Order'), self.menuitem_cb, 'sort-lines-in-ascending-order', 'sort-lines-in-ascending-order'], # noqa: E501 + [_('Sort Lines In D_escending Order'), self.menuitem_cb, 'sort-lines-in-descending-order', 'sort-lines-in-descending-order'], # noqa: E501 ], [ - [_('Remove Trailing _White Space'), self.menuitem_cb, 'remove_trailing_white_space', 'remove_trailing_white_space'], # noqa: E501 - [_('Convert Tabs To _Spaces'), self.menuitem_cb, 'convert_tabs_to_spaces', 'convert_tabs_to_spaces'], # noqa: E501 - [_('Convert Leading Spaces To _Tabs'), self.menuitem_cb, 'convert_leading_spaces_to_tabs', 'convert_leading_spaces_to_tabs'], # noqa: E501 + [_('Remove Trailing _White Space'), self.menuitem_cb, 'remove-trailing-white-space', 'remove-trailing-white-space'], # noqa: E501 + [_('Convert Tabs To _Spaces'), self.menuitem_cb, 'convert-tabs-to-spaces', 'convert-tabs-to-spaces'], # noqa: E501 + [_('Convert Leading Spaces To _Tabs'), self.menuitem_cb, 'convert-leading-spaces-to-tabs', 'convert-leading-spaces-to-tabs'], # noqa: E501 ], [ - [_('_Increase Indenting'), self.menuitem_cb, 'increase_indenting', 'increase_indenting'], # noqa: E501 - [_('De_crease Indenting'), self.menuitem_cb, 'decrease_indenting', 'decrease_indenting'], # noqa: E501 + [_('_Increase Indenting'), self.menuitem_cb, 'increase-indenting', 'increase-indenting'], # noqa: E501 + [_('De_crease Indenting'), self.menuitem_cb, 'decrease-indenting', 'decrease-indenting'], # noqa: E501 ], [ - [_('Convert To _DOS Format'), self.menuitem_cb, 'convert_to_dos', 'convert_to_dos'], - [_('Convert To _Mac Format'), self.menuitem_cb, 'convert_to_mac', 'convert_to_mac'], - [_('Convert To Uni_x Format'), self.menuitem_cb, 'convert_to_unix', 'convert_to_unix'] # noqa: E501 + [_('Convert To _DOS Format'), self.menuitem_cb, 'convert-to-dos', 'convert-to-dos'], + [_('Convert To _Mac Format'), self.menuitem_cb, 'convert-to-mac', 'convert-to-mac'], + [_('Convert To Uni_x Format'), self.menuitem_cb, 'convert-to-unix', 'convert-to-unix'] # noqa: E501 ] ]]) menu_specs.append([_('_Merge'), [ [ - [_('Copy Selection _Right'), self.menuitem_cb, 'copy_selection_right', 'copy_selection_right'], # noqa: E501 - [_('Copy Selection _Left'), self.menuitem_cb, 'copy_selection_left', 'copy_selection_left'], # noqa: E501 + [_('Copy Selection _Right'), self.menuitem_cb, 'copy-selection-right', 'copy-selection-right'], # noqa: E501 + [_('Copy Selection _Left'), self.menuitem_cb, 'copy-selection-left', 'copy-selection-left'], # noqa: E501 ], [ - [_('Copy Left _Into Selection'), self.menuitem_cb, 'copy_left_into_selection', 'copy_left_into_selection'], # noqa: E501 - [_('Copy Right I_nto Selection'), self.menuitem_cb, 'copy_right_into_selection', 'copy_right_into_selection'], # noqa: E501 - [_('_Merge From Left Then Right'), self.menuitem_cb, 'merge_from_left_then_right', 'merge_from_left_then_right'], # noqa: E501 - [_('M_erge From Right Then Left'), self.menuitem_cb, 'merge_from_right_then_left', 'merge_from_right_then_left'] # noqa: E501 + [_('Copy Left _Into Selection'), self.menuitem_cb, 'copy-left-into-selection', 'copy-left-into-selection'], # noqa: E501 + [_('Copy Right I_nto Selection'), self.menuitem_cb, 'copy-right-into-selection', 'copy-right-into-selection'], # noqa: E501 + [_('_Merge From Left Then Right'), self.menuitem_cb, 'merge-from-left-then-right', 'merge-from-left-then-right'], # noqa: E501 + [_('M_erge From Right Then Left'), self.menuitem_cb, 'merge-from-right-then-left', 'merge-from-right-then-left'] # noqa: E501 ] ]]) menu_specs.append([_('_Help'), [ [ - [_('_Help Contents...'), self.help_contents_cb, None, 'help_contents'], + [_('_Help Contents...'), self.help_contents_cb, None, 'help-contents'], ], [ [_('_About %s...') % (constants.APP_NAME, ), self.about_cb, None, 'about'] ] ]]) - # used to disable menu events when switching tabs - self.menu_update_depth = 0 - menubar = Gio.Menu() for label, sections in menu_specs: menubar.append_submenu(label, self._create_menu(sections)) @@ -920,25 +917,25 @@ class DiffuseWindow(Gtk.ApplicationWindow): [DIFFUSE_STOCK_NEW_2WAY_MERGE, self.new_2_way_file_merge_cb, None, _('New 2-Way File Merge')], # noqa: E501 [DIFFUSE_STOCK_NEW_3WAY_MERGE, self.new_3_way_file_merge_cb, None, _('New 3-Way File Merge')], # noqa: E501 [], - [Gtk.STOCK_EXECUTE, self.button_cb, 'realign_all', _('Realign All')], - [Gtk.STOCK_GOTO_TOP, self.button_cb, 'first_difference', _('First Difference')], - [Gtk.STOCK_GO_UP, self.button_cb, 'previous_difference', _('Previous Difference')], - [Gtk.STOCK_GO_DOWN, self.button_cb, 'next_difference', _('Next Difference')], - [Gtk.STOCK_GOTO_BOTTOM, self.button_cb, 'last_difference', _('Last Difference')], + [Gtk.STOCK_EXECUTE, self.button_cb, 'realign-all', _('Realign All')], + [Gtk.STOCK_GOTO_TOP, self.button_cb, 'first-difference', _('First Difference')], + [Gtk.STOCK_GO_UP, self.button_cb, 'previous-difference', _('Previous Difference')], + [Gtk.STOCK_GO_DOWN, self.button_cb, 'next-difference', _('Next Difference')], + [Gtk.STOCK_GOTO_BOTTOM, self.button_cb, 'last-difference', _('Last Difference')], [], - [Gtk.STOCK_GOTO_LAST, self.button_cb, 'copy_selection_right', _('Copy Selection Right')], # noqa: E501 - [Gtk.STOCK_GOTO_FIRST, self.button_cb, 'copy_selection_left', _('Copy Selection Left')], - [Gtk.STOCK_GO_FORWARD, self.button_cb, 'copy_left_into_selection', _('Copy Left Into Selection')], # noqa: E501 - [Gtk.STOCK_GO_BACK, self.button_cb, 'copy_right_into_selection', _('Copy Right Into Selection')], # noqa: E501 - [DIFFUSE_STOCK_LEFT_RIGHT, self.button_cb, 'merge_from_left_then_right', _('Merge From Left Then Right')], # noqa: E501 - [DIFFUSE_STOCK_RIGHT_LEFT, self.button_cb, 'merge_from_right_then_left', _('Merge From Right Then Left')], # noqa: E501 + [Gtk.STOCK_GOTO_LAST, self.button_cb, 'copy-selection-right', _('Copy Selection Right')], # noqa: E501 + [Gtk.STOCK_GOTO_FIRST, self.button_cb, 'copy-selection-left', _('Copy Selection Left')], + [Gtk.STOCK_GO_FORWARD, self.button_cb, 'copy-left-into-selection', _('Copy Left Into Selection')], # noqa: E501 + [Gtk.STOCK_GO_BACK, self.button_cb, 'copy-right-into-selection', _('Copy Right Into Selection')], # noqa: E501 + [DIFFUSE_STOCK_LEFT_RIGHT, self.button_cb, 'merge-from-left-then-right', _('Merge From Left Then Right')], # noqa: E501 + [DIFFUSE_STOCK_RIGHT_LEFT, self.button_cb, 'merge-from-right-then-left', _('Merge From Right Then Left')], # noqa: E501 [], [Gtk.STOCK_UNDO, self.button_cb, 'undo', _('Undo')], [Gtk.STOCK_REDO, self.button_cb, 'redo', _('Redo')], [Gtk.STOCK_CUT, self.button_cb, 'cut', _('Cut')], [Gtk.STOCK_COPY, self.button_cb, 'copy', _('Copy')], [Gtk.STOCK_PASTE, self.button_cb, 'paste', _('Paste')], - [Gtk.STOCK_CLEAR, self.button_cb, 'clear_edits', _('Clear Edits')] + [Gtk.STOCK_CLEAR, self.button_cb, 'clear-edits', _('Clear Edits')] ] _append_buttons(hbox, Gtk.IconSize.LARGE_TOOLBAR, button_specs) # avoid the button bar from dictating the minimum window size @@ -966,28 +963,40 @@ class DiffuseWindow(Gtk.ApplicationWindow): menu = Gio.Menu.new() for section in sections: section_menu = Gio.Menu.new() - for label, cb, cb_data, accel, *submenu in section: + for label, cb, cb_data, action_name, *submenu in section: if submenu: (submenu,) = submenu section_menu.append_submenu(label, self._create_menu(submenu)) else: + # Convert cb_data to GLib.Variant if cb_data is not None: cb_data = GLib.Variant.new_string(cb_data) - gtk_compliant_accel = accel.replace('_', '-') + + # Create action (if callback is not null, which shouldn't happen) if cb is not None: cb_data_type = cb_data and cb_data.get_type() - action = Gio.SimpleAction.new(gtk_compliant_accel, cb_data_type) + action = Gio.SimpleAction.new(action_name, cb_data_type) action.connect('activate', cb) self.add_action(action) + + # Create menu item item = Gio.MenuItem.new(label) - item.set_action_and_target_value('win.' + gtk_compliant_accel, cb_data) - key_binding = theResources.getKeyBindings('menu', accel) + + # Attach action + win_action_name = 'win.' + action_name + item.set_action_and_target_value(win_action_name, cb_data) + + # Bind accelerator (in any) + key_binding = theResources.getKeyBindings('menu', action_name) if len(key_binding) > 0: - action_name = 'win.' + gtk_compliant_accel - detailed_action_name = Gio.Action.print_detailed_name(action_name, cb_data) + detailed_action_name = Gio.Action.print_detailed_name(win_action_name, cb_data) # noqa: 501 accels = [Gtk.accelerator_name(*key_binding[0])] self.get_application().set_accels_for_action(detailed_action_name, accels) + + # Append item to menu section_menu.append_item(item) + + # Append section to menu menu.append_section(None, section_menu) return menu @@ -1245,9 +1254,9 @@ class DiffuseWindow(Gtk.ApplicationWindow): sb.push(context, s) # update the label in the status bar - def setSyntax(self, s): + def setSyntax(self, s: str) -> None: # update menu - self.syntax_action.set_state(GLib.Variant.new_string(s or '')) + self.syntax_action.set_state(GLib.Variant.new_string(s)) # callback used when switching notebook pages def switch_page_cb(self, widget, ptr, page_num): @@ -1679,11 +1688,8 @@ class DiffuseWindow(Gtk.ApplicationWindow): self.preferences_updated() # callback for all of the syntax highlighting menu items - def syntax_cb(self, widget, data): - # ignore events while we update the menu when switching tabs - # also ignore notification of the newly disabled item - if self.menu_update_depth == 0 and widget.get_active(): - self.getCurrentViewer().setSyntax(data) + def syntax_cb(self, widget: Gtk.Widget, data: GLib.Variant) -> None: + self.getCurrentViewer().setSyntax(data.get_string()) # callback for the first tab menu item def first_tab_cb(self, widget, data):