about summary refs log tree commit diff stats
path: root/src/ui/titlebar.c
Commit message (Expand)AuthorAgeFilesLines
* Add OMEMO state in titlebar in MUCPaul Fariello2019-04-101-0/+15
* Add OMEMO state in titlebarPaul Fariello2019-04-101-0/+15
* Update copyright to include 2019Michael Vetter2019-01-221-1/+1
* Update copyrightJames Booth2018-01-211-1/+1
* Update CopyrightJames Booth2017-01-281-1/+1
* Allow room display properies to be set by pluginsJames Booth2017-01-201-0/+26
* Add titlebar encryption text to plugins apiJames Booth2017-01-191-14/+34
* Allow vertical positioning of all windowsJames Booth2016-09-231-14/+5
* Add /inputwin top|bottom commandJames Booth2016-09-191-1/+17
* Tidy headersJames Booth2016-07-241-1/+1
* Moved roster_list.cJames Booth2016-07-241-1/+1
* Moved chat_session.cJames Booth2016-07-241-1/+1
* Update GPL link in headersJames Booth2016-07-241-1/+1
* Add session.cJames Booth2016-05-051-1/+1
* Removed #AX_PREFIX_CONFIG_HJames Booth2016-03-311-1/+1
* Merge branch 'master' into plugins-cJames Booth2016-02-141-1/+1
|\
| * Updated copyrightJames Booth2016-02-141-1/+1
* | Added C plugin code from plugins branchJames Booth2016-02-141-1/+1
|/
* Added roster struct, create and destroy roster on connect/disconnectJames Booth2016-01-051-8/+11
* Add preference for showing TLS indicator in titlebarJames Booth2015-10-141-1/+1
* Title bar TLS indicatorJames Booth2015-10-141-9/+71
* Split PGP incoming and outgoing message handlingJames Booth2015-08-301-50/+53
* Moved setting otr.warn -> enc.warnJames Booth2015-06-211-2/+1
* Tidied OTR and PGP combinations in client_events.cJames Booth2015-06-211-2/+0
* Added window encyption mode for PGPJames Booth2015-06-201-42/+55
* Moved ui/windows -> window_listJames Booth2015-06-151-1/+1
* Renamed otr trusted window propertyJames Booth2015-06-131-1/+1
* Use null check convention in titlebar.cJames Booth2015-05-041-3/+3
* Added enc_mode to ProfChatWinJames Booth2015-05-041-1/+1
* Updated copyrightJames Booth2015-02-101-1/+1
* Free GTimer on switch to consoleJames Booth2015-02-091-1/+4
* Added preferences for showing resource in titlebar and messagesJames Booth2015-01-101-1/+1
* Show resource in titlebar and on each messageJames Booth2015-01-101-6/+15
* Renamed resource -> resource_overrideJames Booth2015-01-101-4/+4
* Moved unread to window subtypesJames Booth2014-12-211-1/+0
* Added win_get_titleJames Booth2014-12-211-28/+8
* Tidy titlebar.cJames Booth2014-12-211-26/+18
* Refactoring window types, removing recipient and from references - wipJames Booth2014-12-181-6/+8
* Added new window and layout typesJames Booth2014-12-161-5/+6
* Renamed chat_resource -> resourceJames Booth2014-12-101-4/+4
* Moved chat resource to WIN_CHAT typeJames Booth2014-12-101-4/+4
* Moved otr properties to WIN_CHAT typeJames Booth2014-12-101-2/+2
* Added form to WIN_MUC_CONFIG typeJames Booth2014-12-101-1/+1
* Show resource presence with /resource commandJames Booth2014-12-021-51/+48
* Added /resource commandJames Booth2014-12-021-0/+23
* Tidied title bar drawJames Booth2014-12-021-96/+88
* Added ifdef to _show_privacy() functionJames Booth2014-12-011-1/+5
* Fix autocomplete clash, fix crash on opening window when recipient not in rosterJames Booth2014-11-221-30/+26
* Remove contact lookup when showing OTR privacyJames Booth2014-11-221-63/+51
* Renamed roster autocomplete functionsJames Booth2014-11-221-2/+2
ss="p">, ctrl('f')) alias(KEY_PPAGE, ctrl('b')) alias(KEY_HOME, 'gg') alias(KEY_END, 'G') def initialize_commands(command_list): """Initialize the commands for the main user interface""" bind, hint, alias = make_abbreviations(command_list) # -------------------------------------------------------- movement _vimlike_aliases(command_list) command_list.alias(KEY_LEFT, KEY_BACKSPACE, DEL) bind(KEY_DOWN, fm.move_pointer(relative=1)) bind(KEY_UP, fm.move_pointer(relative=-1)) bind(KEY_RIGHT, fm.move_right()) bind(KEY_LEFT, KEY_BACKSPACE, DEL, fm.move_left(1)) bind(KEY_HOME, fm.move_pointer(absolute=0)) bind(KEY_END, fm.move_pointer(absolute=-1)) bind(KEY_HOME, fm.move_pointer(absolute=0)) bind(KEY_END, fm.move_pointer(absolute=-1)) bind(KEY_ENTER, ctrl('j'), fm.move_right(mode=1)) bind('%', fm.move_pointer_by_percentage(absolute=50)) bind(KEY_NPAGE, fm.move_pointer_by_pages(1)) bind(KEY_PPAGE, fm.move_pointer_by_pages(-1)) bind(ctrl('d'), fm.move_pointer_by_pages(0.5)) bind(ctrl('u'), fm.move_pointer_by_pages(-0.5)) # --------------------------------------------------------- history bind('H', fm.history_go(-1)) bind('L', fm.history_go(1)) # ----------------------------------------------- tagging / marking bind('b', fm.tag_toggle()) bind('B', fm.tag_remove()) bind(' ', fm.mark(toggle=True)) bind('v', fm.mark(all=True, toggle=True)) bind('V', fm.mark(all=True, val=False)) # ------------------------------------------ file system operations bind('yy', fm.copy()) bind('dd', fm.cut()) bind('pp', fm.paste()) bind('pl', fm.paste_symlink()) hint('p', 'press //p// once again to confirm pasting' \ ', or //l// to create symlinks') # ---------------------------------------------------- run programs bind('s', fm.execute_command(os.environ['SHELL'])) bind('E', fm.edit_file()) bind('term', fm.execute_command('x-terminal-emulator', flags='d')) bind('du', fm.execute_command('du --max-depth=1 -h | less')) # -------------------------------------------------- toggle options hint('t', "show_//h//idden //p//review_files //d//irectories_first " \ "//c//ollapse_preview") bind('th', fm.toggle_boolean_option('show_hidden')) bind('tp', fm.toggle_boolean_option('preview_files')) bind('td', fm.toggle_boolean_option('directories_first')) bind('tc', fm.toggle_boolean_option('collapse_preview')) # ------------------------------------------------------------ sort hint('o', 'O', "//s//ize //b//ase//n//ame //m//time //t//ype //r//everse") sort_dict = { 's': 'size', 'b': 'basename', 'n': 'basename', 'm': 'mtime', 't': 'type', } for key, val in sort_dict.items(): for key, is_capital in ((key, False), (key.upper(), True)): # reverse if any of the two letters is capital bind('o' + key, fm.sort(func=val, reverse=is_capital)) bind('O' + key, fm.sort(func=val, reverse=True)) bind('or', 'Or', 'oR', 'OR', lambda arg: \ arg.fm.sort(reverse=not arg.fm.settings.reverse)) # ----------------------------------------------- console shortcuts bind('A', lambda arg: arg.fm.open_console(cmode.COMMAND, 'rename ' + arg.fm.env.cf.basename)) bind('cw', fm.open_console(cmode.COMMAND, 'rename ')) bind('cd', fm.open_console(cmode.COMMAND, 'cd ')) bind('f', fm.open_console(cmode.COMMAND_QUICK, 'find ')) bind('tf', fm.open_console(cmode.COMMAND, 'filter ')) hint('d', 'd//u// (disk usage) d//d// (cut)') # --------------------------------------------- jump to directories bind('gh', fm.enter_dir('~')) bind('ge', fm.enter_dir('etc')) bind('gu', fm.enter_dir('/usr')) bind('gd', fm.enter_dir('/dev')) bind('gl', fm.enter_dir('/lib')) bind('go', fm.enter_dir('/opt')) bind('gv', fm.enter_dir('/var')) bind('gr', 'g/', fm.enter_dir('/')) bind('gm', fm.enter_dir('/media')) bind('gn', fm.enter_dir('/mnt')) bind('gt', fm.enter_dir('/tmp')) bind('gs', fm.enter_dir('/srv')) bind('gR', fm.enter_dir(RANGERDIR)) # ------------------------------------------------------- searching bind('/', fm.open_console(cmode.SEARCH)) bind('n', fm.search()) bind('N', fm.search(forward=False)) bind(TAB, fm.search(order='tag')) bind('cc', fm.search(order='ctime')) bind('cm', fm.search(order='mimetype')) bind('cs', fm.search(order='size')) hint('c', '//c//time //m//imetype //s//ize') # ------------------------------------------------------- bookmarks for key in ALLOWED_BOOKMARK_KEYS: bind("`" + key, "'" + key, fm.enter_bookmark(key)) bind("m" + key, fm.set_bookmark(key)) bind("um" + key, fm.unset_bookmark(key)) # ---------------------------------------------------- change views bind('i', fm.display_file()) bind(ctrl('p'), fm.display_log()) bind('?', KEY_F1, fm.display_help()) bind('w', lambda arg: arg.fm.ui.open_taskview()) # ------------------------------------------------ system functions _system_functions(command_list) bind('ZZ', fm.exit()) bind(ctrl('R'), fm.reset()) bind('R', fm.reload_cwd()) bind(ctrl('C'), fm.exit()) bind(':', ';', fm.open_console(cmode.COMMAND)) bind('>', fm.open_console(cmode.COMMAND_QUICK)) bind('!', fm.open_console(cmode.OPEN)) bind('r', fm.open_console(cmode.OPEN_QUICK)) command_list.rebuild_paths() def initialize_console_commands(command_list): """Initialize the commands for the console widget only""" bind, hint, alias = make_abbreviations(command_list) # -------------------------------------------------------- movement bind(KEY_UP, wdg.history_move(-1)) bind(KEY_DOWN, wdg.history_move(1)) bind(ctrl('b'), KEY_LEFT, wdg.move(relative = -1)) bind(ctrl('f'), KEY_RIGHT, wdg.move(relative = 1)) bind(ctrl('a'), KEY_HOME, wdg.move(absolute = 0)) bind(ctrl('e'), KEY_END, wdg.move(absolute = -1)) # ----------------------------------------- deleting / pasting text bind(ctrl('d'), KEY_DC, wdg.delete(0)) bind(ctrl('h'), KEY_BACKSPACE, DEL, wdg.delete(-1)) bind(ctrl('w'), wdg.delete_word()) bind(ctrl('k'), wdg.delete_rest(1)) bind(ctrl('u'), wdg.delete_rest(-1)) bind(ctrl('y'), wdg.paste()) # ----------------------------------------------------- typing keys def type_key(arg): arg.wdg.type_key(arg.keys) for i in range(ord(' '), ord('~')+1): bind(i, type_key) # ------------------------------------------------ system functions _system_functions(command_list) bind(KEY_F1, lambda arg: arg.fm.display_command_help(arg.wdg)) bind(ctrl('c'), ESC, wdg.close()) bind(ctrl('j'), KEY_ENTER, wdg.execute()) bind(TAB, wdg.tab()) bind(KEY_BTAB, wdg.tab(-1)) command_list.rebuild_paths() def initialize_taskview_commands(command_list): """Initialize the commands for the TaskView widget""" bind, hint, alias = make_abbreviations(command_list) _basic_movement(command_list) _vimlike_aliases(command_list) _system_functions(command_list) # -------------------------------------------------- (re)move tasks bind('K', wdg.task_move(0)) bind('J', wdg.task_move(-1)) bind('dd', wdg.task_remove()) # ------------------------------------------------ system functions bind('?', fm.display_help()) bind('w', 'q', ESC, ctrl('d'), ctrl('c'), lambda arg: arg.fm.ui.close_taskview()) command_list.rebuild_paths() def initialize_pager_commands(command_list): bind, hint, alias = make_abbreviations(command_list) _base_pager_commands(command_list) bind('q', 'i', ESC, KEY_F1, lambda arg: arg.fm.ui.close_pager()) command_list.rebuild_paths() def initialize_embedded_pager_commands(command_list): bind, hint, alias = make_abbreviations(command_list) _base_pager_commands(command_list) bind('q', 'i', ESC, lambda arg: arg.fm.ui.close_embedded_pager()) command_list.rebuild_paths() def _base_pager_commands(command_list): bind, hint, alias = make_abbreviations(command_list) _basic_movement(command_list) _vimlike_aliases(command_list) _system_functions(command_list) # -------------------------------------------------------- movement bind(KEY_LEFT, wdg.move_horizontal(relative=-4)) bind(KEY_RIGHT, wdg.move_horizontal(relative=4)) bind(KEY_NPAGE, wdg.move(relative=1, pages=True)) bind(KEY_PPAGE, wdg.move(relative=-1, pages=True)) bind(ctrl('d'), wdg.move(relative=0.5, pages=True)) bind(ctrl('u'), wdg.move(relative=-0.5, pages=True)) # ---------------------------------------------------------- others bind('E', fm.edit_file()) bind('?', fm.display_help()) def _system_functions(command_list): # Each commandlist should have this bindings bind, hint, alias = make_abbreviations(command_list) bind(KEY_RESIZE, fm.resize()) bind(KEY_MOUSE, fm.handle_mouse()) bind('Q', fm.exit()) bind(ctrl('L'), fm.redraw_window()) def _basic_movement(command_list): bind, hint, alias = make_abbreviations(command_list) bind(KEY_DOWN, wdg.move(relative=1)) bind(KEY_UP, wdg.move(relative=-1)) bind(KEY_HOME, wdg.move(absolute=0)) bind(KEY_END, wdg.move(absolute=-1))