From 82183449ff4854a49780d82301eb1085178450b3 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Tue, 10 Jul 2018 21:35:59 -0500 Subject: [PATCH] Remove orig files. --- .gitignore | 7 - AUTHORS | 28 - CHANGELOG | 358 ----- CMakeLists.txt | 244 --- CONTRIBUTING.md | 23 - Doxyfile | 1630 --------------------- LICENSE | 280 ---- README.md | 25 - qterminal.appdata.xml | 43 - qterminal.desktop | 65 - qterminal.pro | 53 - qterminal_drop.desktop | 66 - src/bookmarkswidget.cpp | 397 ----- src/bookmarkswidget.h | 76 - src/config.h | 120 -- src/dbusaddressable.cpp | 25 - src/dbusaddressable.h | 34 - src/fontdialog.cpp | 63 - src/fontdialog.h | 40 - src/forms/bookmarkswidget.ui | 50 - src/forms/fontdialog.ui | 114 -- src/forms/propertiesdialog.ui | 893 ----------- src/forms/qterminal.ui | 119 -- src/icons.qrc | 16 - src/icons/application-exit.png | Bin 1760 -> 0 bytes src/icons/document-close.png | Bin 1530 -> 0 bytes src/icons/edit-copy.png | Bin 860 -> 0 bytes src/icons/edit-paste.png | Bin 937 -> 0 bytes src/icons/index.theme | 31 - src/icons/list-add.png | Bin 1487 -> 0 bytes src/icons/list-remove.png | Bin 1065 -> 0 bytes src/icons/locked.png | Bin 561 -> 0 bytes src/icons/notlocked.png | Bin 541 -> 0 bytes src/icons/qterminal.png | Bin 2110 -> 0 bytes src/icons/zoom-in.png | Bin 1172 -> 0 bytes src/icons/zoom-out.png | Bin 1149 -> 0 bytes src/macosx/bundle.cmake.in | 60 - src/macosx/qterminal.icns | Bin 62744 -> 0 bytes src/main.cpp | 318 ---- src/mainwindow.cpp | 809 ---------- src/mainwindow.h | 123 -- src/org.lxqt.QTerminal.Process.xml | 23 - src/org.lxqt.QTerminal.Tab.xml | 17 - src/org.lxqt.QTerminal.Terminal.xml | 24 - src/org.lxqt.QTerminal.Window.xml | 20 - src/properties.cpp | 322 ---- src/properties.h | 124 -- src/propertiesdialog.cpp | 435 ------ src/propertiesdialog.h | 71 - src/qterminalapp.h | 62 - src/tabbar.cpp | 68 - src/tabbar.h | 47 - src/tabwidget.cpp | 511 ------- src/tabwidget.h | 121 -- src/terminalconfig.cpp | 105 -- src/terminalconfig.h | 38 - src/termwidget.cpp | 378 ----- src/termwidget.h | 104 -- src/termwidgetholder.cpp | 449 ------ src/termwidgetholder.h | 105 -- src/third-party/qxtglobal.h | 233 --- src/third-party/qxtglobalshortcut.cpp | 212 --- src/third-party/qxtglobalshortcut.h | 64 - src/third-party/qxtglobalshortcut_mac.cpp | 258 ---- src/third-party/qxtglobalshortcut_p.h | 76 - src/third-party/qxtglobalshortcut_win.cpp | 243 --- src/third-party/qxtglobalshortcut_x11.cpp | 224 --- 67 files changed, 10444 deletions(-) delete mode 100644 .gitignore delete mode 100644 AUTHORS delete mode 100644 CHANGELOG delete mode 100644 CMakeLists.txt delete mode 100644 CONTRIBUTING.md delete mode 100644 Doxyfile delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 qterminal.appdata.xml delete mode 100644 qterminal.desktop delete mode 100644 qterminal.pro delete mode 100644 qterminal_drop.desktop delete mode 100644 src/bookmarkswidget.cpp delete mode 100644 src/bookmarkswidget.h delete mode 100644 src/config.h delete mode 100644 src/dbusaddressable.cpp delete mode 100644 src/dbusaddressable.h delete mode 100644 src/fontdialog.cpp delete mode 100644 src/fontdialog.h delete mode 100644 src/forms/bookmarkswidget.ui delete mode 100644 src/forms/fontdialog.ui delete mode 100644 src/forms/propertiesdialog.ui delete mode 100644 src/forms/qterminal.ui delete mode 100644 src/icons.qrc delete mode 100644 src/icons/application-exit.png delete mode 100644 src/icons/document-close.png delete mode 100644 src/icons/edit-copy.png delete mode 100644 src/icons/edit-paste.png delete mode 100644 src/icons/index.theme delete mode 100644 src/icons/list-add.png delete mode 100644 src/icons/list-remove.png delete mode 100644 src/icons/locked.png delete mode 100644 src/icons/notlocked.png delete mode 100644 src/icons/qterminal.png delete mode 100644 src/icons/zoom-in.png delete mode 100644 src/icons/zoom-out.png delete mode 100644 src/macosx/bundle.cmake.in delete mode 100644 src/macosx/qterminal.icns delete mode 100644 src/main.cpp delete mode 100644 src/mainwindow.cpp delete mode 100644 src/mainwindow.h delete mode 100644 src/org.lxqt.QTerminal.Process.xml delete mode 100644 src/org.lxqt.QTerminal.Tab.xml delete mode 100644 src/org.lxqt.QTerminal.Terminal.xml delete mode 100644 src/org.lxqt.QTerminal.Window.xml delete mode 100644 src/properties.cpp delete mode 100644 src/properties.h delete mode 100644 src/propertiesdialog.cpp delete mode 100644 src/propertiesdialog.h delete mode 100644 src/qterminalapp.h delete mode 100644 src/tabbar.cpp delete mode 100644 src/tabbar.h delete mode 100644 src/tabwidget.cpp delete mode 100644 src/tabwidget.h delete mode 100644 src/terminalconfig.cpp delete mode 100644 src/terminalconfig.h delete mode 100644 src/termwidget.cpp delete mode 100644 src/termwidget.h delete mode 100644 src/termwidgetholder.cpp delete mode 100644 src/termwidgetholder.h delete mode 100644 src/third-party/qxtglobal.h delete mode 100644 src/third-party/qxtglobalshortcut.cpp delete mode 100644 src/third-party/qxtglobalshortcut.h delete mode 100644 src/third-party/qxtglobalshortcut_mac.cpp delete mode 100644 src/third-party/qxtglobalshortcut_p.h delete mode 100644 src/third-party/qxtglobalshortcut_win.cpp delete mode 100644 src/third-party/qxtglobalshortcut_x11.cpp diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 2c0ac3e..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/*.debhelper -/*.log -/*.substvars -/debhelper-build-stamp -/files - -/qterminal/ diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 60ebfae..0000000 --- a/AUTHORS +++ /dev/null @@ -1,28 +0,0 @@ -Project maintainer: Petr Vanek - -Contributors: - -Alexander Sokolov -Alf Gaida -Christian Surlykke -Daniel O'Neill -Erik Ridderby -Felix Schnizlein -Francisco Ballina -Ilya87 -Jerome Leclanche -Johannes Jordan -Ludger Krämer -Maxim Bourmitrov -Mikhail Ivchenko -Sweet Tea Dorminy -Vladimir Kuznetsov -Matteo Pasotti -@kulti - - -Translators: - -@pisculichi -Sérgio Marques -Valter Nazianzeno diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index bc00be6..0000000 --- a/CHANGELOG +++ /dev/null @@ -1,358 +0,0 @@ - -qterminal-0.9.0 / 2018-05-21 -============================ - - * Bump version to 0.9.0 - * Spanish translation update - * Now building out-of-source is mandatory - * Fix tab texts, especially for vertical tabs - * CMake: Prevent in-source builds - * Fixed some lxde mentions - * Sort color schemes alphabetically - * Support modifying $TERM and use xterm-256color by default - * Convert connect to the new syntax - termwidgetholder.cpp - * Convert connect to the new syntax - termwidget.cpp - * Convert connect to the new syntax - tabwidget.cpp - * Convert connect to the new syntax - propertiesdialog.cpp - * Convert connect to the new syntax - mainwindow.cpp, part 1 - * Convert connect to the new syntax - fontdialog.cpp - * Convert connect to the new syntax - bookmarkswidget.cpp - * Fix tabbar - * Close tab on middle clicking - * A real shortcut editor - * Allow to change tab title color - * Make tab closing button configurable - * Make active tab text bold to make it more visible - * Fix a typo - * Fixes an error in the d3fa804 fix of #304 - * new config: show terminal size on resize - * Fixes #304 - * Fix bracket paste - * Fixes tabAt() when tabBar is not at north position - * Fix terminal menubar - * Drop Qt foreach - * Set QTERMWIDGET_MINIMUM_VERSION - * Fix a typo in qterminal_drop.desktop - * Fix tab icon display in proxy style. - * Switch tab eliding to ElideMiddle. - * Adjust default tab width to 500 and enable limit by default. - * Forward declare TabBar. - * Add option for configuring tab width limit. - * Add maximum tab width and proper text eliding. - * Enable bidi by default - * Fix UI - * Add RTL support button - * Update Catalan translation - -0.8.0 / 2017-10-21 -================== - - * Release 0.8.0: Update changelog - * Set version to 0.8.0 - * Update information on distribution package - * Added legacy font setting support - * Made font in settings file human readable - * Fix action inconsistency when switching tabs - * Lithuanian translation - * Added Lithuanian language - * Don't export github templates - * correct spelling mistake - * Adapt to QTermWidget API changes after DECSCUSR handling - * liblxqt dont make sense here - * Copied issue template - * Drops Qt5Core_VERSION_STRING - * Update qterminal_drop.desktop - * Update qterminal.desktop - * Make disabled actions consistent at all times (#331) - * DBus DropMode (#325) - * Change subterminal shortcuts to avoid breaking qtermwidget scrolling (#327) - * Update main.cpp (#322) - * Fix toggle menu action. - * Focus highlight (#266) - * Replace numbered terminals with directional navigation (#255) - * Fix '1 Terminal' preset (#324) - * Change "Clear Current Tab" into "Clear Active Terminal" (#268) - * Fix duplicated items, rework MainWindow memory-management (#313) - * Fixed comment - needless compiler warnings are annoying (#321) - * DBus integration (#307) - * Restore filter actions (#310) - * New features: trim \n from pasted strings, confirm multiline pastes (#309) - * Support custom QSS styles - * Call QApp destructor (#306) - * Fixes (#318) - * Refactor dangling actions, delete windows on close - * Adds superbuild support - * Improve translation (.ts) handling - * Removes Qt5X11Extras_DEFINITIONS - * Stops adding not exist entries to CMAKE_MODULE_PATH - * Use the LXQtCompilerSettings module - * Adapt to QTermWidget improved CMake - * Fix a copy/paste error from 4afcc4d0d0922f526f89aadf16ec0517f6b5267e - * Update dependencies and cleanup trailing spaces - -0.7.1 / 2016-12-21 -================== - - * Release 0.7.1: Update changelog - * Bump patch version (#294) - * Add common shortcuts for switching tabs (#275) - * Fix tabstop order in properties dialog & add buddy relations for labels. (#290) - * Add preferences for background images (#273) - * Disable menu actions that are not applicable currently (#244) - * DEFINES += STR_VERSION=\\\"0.7.0\\\" - * Add context menu actions for URLs and E-Mail addresses (#276) - * Removed minimum size (#265) - * Set maxval of dropdown spinboxen to 100, instead of 99 - * Use the new lxqt-build-tools package - * Fix context menu actions being applied to the window opened last (#235) - * Show exit confirmation dialog when closing the last window tab (#242) - * remove "building with cpack" from CMakeLists.txt - not used anymore Added very basic .gitattributes - -0.7.0 / 2016-09-24 -================== - - * Release 0.7.0: Add changelog - * Bump version to 0.7.0 (#262) - * Update README.md - * Collapse splitter hierarchies containing a single terminal (#254) - * Make qterminal.appdata.xml valid (#257) - * Add config option for changing window's title/icon - * Add support for automatic title & icon modification - * Delete Properties instance on exit (#239) - * Fix compilation warning related to QXmlStreamReader (#247) - * Set the desktopFileName property - * Fix typo in the conditional expression - * Add location for custom color schemes (#234) - * CMake Support changes (#237) - * Add keyboard cursor shape setting (#228) - * made the .pro file work on openSUSE; #229 (#232) - * Fix renaming a tab from the menu - * Make the rename current session shortcut work and configurable - * build: Use external translations - * ts-files removal (#222) - * Add pt_BR (Brazilian Portuguese) translation (#215) - * Merge pull request #214 from f2404/212_collapse_segfault_fix - * Remove noisy qDebug() - * Fix jumbled prompt - * Add Greek (el) translation - * Missing equal symbol for xml template - * Delete MainWindow on exit - * Link to the current github projects and trackers - * Apply context menu to the tab that it was opened over - * Close tabs in reverse order - * Eliminate memory leaks by closing tabs on exit - * Russian translation update - * Fix menubar transparency - * Fix default settings width - * Fix bookmarks widget transparency - * Use the same icon for dropdown and regular terminal - * Fix license file - * Improve README and use markdown - * Fixed button focus in close confirmation (resolves #179). - * Updated german translation. - * Fix Simplified Chinese(zh_CN) - * Update japanese translation - * Add Japanese translation to *.desktop - * fixed #174 XDG_CONFIG_DIRS support - read system wide QSettings - * Fix license issues within qterminal - * Add chinese translation - * Require Qt 5.2 or higher - * fix private header dependency for X11 global shortcuts - * fix searching for Qt5 private headers - * make only terminal widget transparent, not the parent window - * Fix japanese translation - * Russian translation update - * Add Japanese translation - * fixed #160 FTBFS as of commit 4967123 - * Fixes for Portuguese language - * Fixes missing App Window icon - * Hungarian translation added - * Update qterminal_tr.ts - * Create qterminal_tr.ts - * do not overwrite settings in migrateSettings - * remove fullscreen patch - * migrateSettings add size and pos and rm geometry - * split geometry into size and position - * define saveGeomOnExit in properties.h - * add save geometry on exit - * Add Alt- shortcuts to all menu items. - * Make sure no settings are overwritten in migrateSettings(). - * Update index property of tabs when tabs are moved by drag-and-drop. - * Update german translation. - * Corrected terminology in settings (transparency vs. opacity). Now transparency instead of opacity is used in the whole application consistently. - * Migrate AlwaysShowTabs-setting. - * Move migrateSettings()-method to Properties-class and call it *before* loadSettings(). - * Update version number in settings. - * Renamed always show tabs setting. - * Portuguese update - * Add instructions to disable system qxt when building with Qt5. - * Changed position of font button in settings. - * Changed layout of font-setting to better fit to the other settings in the widget. - * Appdata file for QTerminal (resolves #60). - * Add view-menu actions to mainwindow, to make them available when menu bar is hidden. - * Add fullscreen mode. - * Ignore user-specific project files of QtCreator. - * Resolves #115: Store Actions of 'View'-menu in properties too and enable shorctus for them. - * Set shortcuts for 'Preferences...' and 'Quit' from settings on startup. - * Fixed #83: Add menu actions to main window. - * Fixed #93: Add 'Toggle Menu' and 'Preferences...' to context menu. - * Use GNUInstallDirs in CMakeLists.txt to stop hardcoding paths - * Make the left column expandable to get more space for translated text. - * Updated german translation - * Remove empty file - * Remove unnecessarily noisy qDebug calls - * Portuguese update - * Add Portuguese translation - * Update Russian translation - * slightly naive "layout/preset" implementation - * fixed build for Qt4 and Qt5.x < 5.2 - * Rework settings window - * Fixed translation (added tr() for some combo boxes in properties dialog). - -0.6.0 / 2014-10-21 -================== - - * Release 0.6.0 - * Add an initial CONTRIBUTING document - * Update AUTHORS - * Update README - * Add an INSTALL file - * CMakeLists.txt cleanup - * Russian translation improvements. - * Updated translation. - * Desktop icon theme support Use icons from current desktop theme (Qt functionality) Reformat icons.qrc into theme format and fallback to the provided theme if no system theme present in main.cpp Add more action icons according to the XDG Icon Naming Specification - * fixed translation (some spelling, some inconsistencies, some bad wording) used other applications to determine common practice for some of the terms - * qctions refactored a bit; copy/paste etc. shortcuts work in subterminals finally - * fixed #80 Wronge state on startup - * fix translation of termwidget context menu - * add german translation - * fixed #65 Typo in QTerminal Properties window - * fixed #74 Zoom reset option resets font back to Monospace - * Check Ctrl manually on activateUrl signal - * Fix for #63 - * Qt5 additional dependency and version number fix - * estonian translation - * Update termwidget.cpp - * Update termwidget.h - * Add Spanish translation - * Fixed install qterminal incon - * Simple profile support - -0.5.0 / 2014-05-27 -================== - - * basic Qt5 port - * implemented #54 Add option to hide tab bar if only one tab is open - * set focus to current terminal after bookmark command applied - * Update Russian translation - * fixed #51 Shortcuts broken after menu hiding - * fixed #50 Bookmarks panel always shows, even if the bookmarks are disabled - * fixed #49 Only show monospace fonts in the font picker - * save bookmars widget visibility; fix crash in some config circumstances - * Include QApplication where needed. Fixes #47 - * removed un-needed file - * changes required for new qtermwidget build/structure; includes fixed for qtermwidget Qt5 port - * bookmarks: key shortcut to open/close bookmarks widget - * bookmarks: saving/loading/editing - * initial support for extended bookmarks (read only for now) - * fixed #31 does not resize itself when screen resolution has changed - * implemented #41 Request: Ctrl+M Disable Menu Bar Option - * fix "save prefs on exit". Thanks Joseph A Philbrook for reporting and support ideas - * improvements for #28 Use system qxt-devel - * fixed #4 Open new tab in same working directory - * fixed #15 "Raw" -e params - * potential fix for height calculation regarding #31 does not resize itself when screen resolution has changed - * potential fix for screen size changed in drop down mode #31 does not resize itself when screen resolution has changed - * fixed #28 Use system qxt-devel - * fixed #37 Configuration AskOnExit should be editable via GUI - * Added Russian translation - * Clean up --help - * Don't forget highlight current terminal option - * fix #27 Ctrl+D on a new window closes all windows - * fix FSF address - * fixed #13 Window action names - * do not use conflicting shortcuts with vim/screen - * Added global tab rename (sessionRename) shortcut - * trivial shortcuts in a terminal-menu are a no-go because they ineterfere with several usual ncurses programs like nano, or weechat, even bash is interfered. - * allow only monospaced fonts in preferences dialog - * remove unused code in FindQTermWidget.cmake - * fixed main window ui file (manually edited probably) to work with designr again. Use "Preferences..." instead of "Configure QTerminal" - * compile also italian translations - * added italian translations - * get rid of contraproductive Ctrl-W to close a tab. Replaced that wieht Ctrl-Shift-W. Use nano in qterminal and try to search. You will see, what i mean ... * it takes a horizontal ruler to tile a terminal vertically and vice versa * make border of active terminal a litte bit thinner 3px -> 2px - * Added new action: "Paste Selection". Fixes #21 - * Handle migration "Paste Selection"->"Paste Clipboard" in settings - * Rename PASTE_SELECTION to PASTE_CLIPBOARD which is what it does - * ctrl+n opens new window - reimplemented #19 - * Added search functionality - * now with actual changes. - * fixed bad layout - * Reorganize menus (mostly fixes issue 8) - * Correction proposal for previous error - * Add zoom terminal. New option in PropertiesDialog - * return dropdown dsktop file because "desktop actions" are not supported almost anywhere - * Use standard utilities-terminal as default icon as a qterminal icon is not shipped - * Get rid of qterminal_drop.desktop, favouring a Desktop Action - * fixed #5 Tabs on top by default - * final fix for doubleclicks on tabwidget - * fixed #1 lost focus after close tab - * fix for lost custom tab labels when the tab is removed - * clear active terminal implemented - * wrong application domain fixed - * highlight current terminal is optional now - * fixed broken layouting from previous patches - * XDG standardized config place - * desktop files fixes - * install unix icon - * yakuake mode compile fix for X11 - * build on mac - * Switch to Qxt global shortcut - * "make lupdate" implemented; do ot delete ts files on "make clean"; fix translator loading - * DropDown mode - * allow translations - * tabs to spaces - * allow moving of tabs - * Added History size properties - * desktop file for XDG - * fixed shortcut defaults as it used wrong int into strings - * reverted misunderstood spaces in keys - it's used in shorcut widget display - * remove ' ' from config keys as it makes config file unreadable - * LIB_SUFFIX autodiscovery - * Added missing translatable string. Shortcut tableview in preferences dialogue now resizes columns to fit contents Disabled verticalHeader on shorcut tableview. Added 'copy' and 'paste' to configurable shortcuts list. Removed '1.0' branding from windowTitle to read only 'QTerminal'. - * qmake pro file (easier to use in creator than cmake, figured i'd share.) - * Support for keyboard shortcuts; free-form text entry style. - * -e|--execute implemented; minor help fixes - * sync from experimental - * sync with experimental "bundle" repository - * standardized icons and keyboard shortcuts - * set minimal window size for initial resizing - * remove annoying "close session?" dialog - * all actions are available from mainwindow's menu - * mac icon fix - * bundle the qtermwidget's kb-layout files too - * initial support for apple bundles - * key shorcut unified for x11/mac - * actions cleanup - * fix for session closing - * fix for sub-terminals switching/focuses (to stay in current window/tab) - * small refactoring of methods duplicities - * transparency and open/save session shortcuts removed - * better highlight of the current subterminal (wide line) - * fixed focus handling again - * implementation of sub-terminal shitch key-shortcut - * highlight current subwindow (work in progress) - * set correct focus when (sub)terminal opens - * patches to build on BSD by Christopher VdoP - * correct closing on linux - * include fixes; editable gui - * split and collapse progress - * case sensitive includes - * sub-terminals splitting and collapsing - * allow to change emulation type - * docs;build fixes - * preferences are split into regular dialog - * termwidget split; properties separated - * actions texts standardized; all Qt styles supported in menu - * font handling fix for macosx - * macosx port; cmake support - * initial import diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 6e45aa1..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,244 +0,0 @@ -cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) - -project(qterminal) - -include(GNUInstallDirs) - -# qterminal version -set(STR_VERSION "0.9.0") -set(LXQTBT_MINIMUM_VERSION "0.5.0") -set(QTERMWIDGET_MINIMUM_VERSION "0.9.0") - -option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) -endif() - -# we need qpa/qplatformnativeinterface.h for global shortcut -find_package(Qt5Gui REQUIRED) -find_package(Qt5Widgets REQUIRED) -find_package(Qt5LinguistTools REQUIRED) -if(APPLE) -elseif(UNIX) - find_package(Qt5X11Extras REQUIRED) - find_package(Qt5DBus) -endif() -find_package(QTermWidget5 ${QTERMWIDGET_MINIMUM_VERSION} REQUIRED) -find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED) - -include(LXQtPreventInSourceBuilds) -include(LXQtTranslateTs) -include(LXQtCompilerSettings NO_POLICY_SCOPE) -message(STATUS "Qt version: ${Qt5Core_VERSION}") - -# TODO remove Qxt -message(STATUS "Using bundled Qxt...") -set(QXT_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src/third-party") - - -if(APPLE) - find_library(CARBON_LIBRARY Carbon REQUIRED) - message(STATUS "CARBON_LIBRARY: ${CARBON_LIBRARY}") -elseif(UNIX) - find_package(X11 REQUIRED) - message(STATUS "X11_X11_LIB: ${X11_X11_LIB}") -endif() - -add_definitions( - -DSTR_VERSION=\"${STR_VERSION}\" - -DQT_NO_FOREACH -) - -set(EXE_NAME qterminal) - -set(QTERM_SRC - src/main.cpp - src/mainwindow.cpp - src/tabbar.cpp - src/tabwidget.cpp - src/termwidget.cpp - src/termwidgetholder.cpp - src/terminalconfig.cpp - src/properties.cpp - src/propertiesdialog.cpp - src/bookmarkswidget.cpp - src/fontdialog.cpp - src/dbusaddressable.cpp -) - -set(QTERM_MOC_SRC - src/qterminalapp.h - src/mainwindow.h - src/tabbar.h - src/tabwidget.h - src/termwidget.h - src/termwidgetholder.h - src/propertiesdialog.h - src/bookmarkswidget.h - src/fontdialog.h -) - - -if (Qt5DBus_FOUND) - add_definitions(-DHAVE_QDBUS) - QT5_ADD_DBUS_ADAPTOR(QTERM_SRC src/org.lxqt.QTerminal.Window.xml mainwindow.h MainWindow) - QT5_ADD_DBUS_ADAPTOR(QTERM_SRC src/org.lxqt.QTerminal.Tab.xml termwidgetholder.h TermWidgetHolder) - QT5_ADD_DBUS_ADAPTOR(QTERM_SRC src/org.lxqt.QTerminal.Terminal.xml termwidget.h TermWidget) - QT5_ADD_DBUS_ADAPTOR(QTERM_SRC src/org.lxqt.QTerminal.Process.xml qterminalapp.h QTerminalApp) - set(QTERM_MOC_SRC ${QTERM_MOC_SRC} src/dbusaddressable.h) - message(STATUS "Building with Qt5DBus support") -endif() - -if(NOT QXT_FOUND) - set(QTERM_SRC ${QTERM_SRC} src/third-party/qxtglobalshortcut.cpp) - set(QTERM_MOC_SRC ${QTERM_MOC_SRC} src/third-party/qxtglobalshortcut.h) - - if(WIN32) - set(QTERM_SRC ${QTERM_SRC} src/third-party/qxtglobalshortcut_win.cpp) - elseif(APPLE) - set(QTERM_SRC ${QTERM_SRC} src/third-party/qxtglobalshortcut_mac.cpp) - else() - set(QTERM_SRC ${QTERM_SRC} src/third-party/qxtglobalshortcut_x11.cpp) - endif() -endif() - -set(QTERM_UI_SRC - src/forms/qterminal.ui - src/forms/propertiesdialog.ui - src/forms/bookmarkswidget.ui - src/forms/fontdialog.ui -) - -set(QTERM_RCC_SRC - src/icons.qrc -) - -qt5_wrap_ui( QTERM_UI ${QTERM_UI_SRC} ) -qt5_wrap_cpp( QTERM_MOC ${QTERM_MOC_SRC} ) -qt5_add_resources( QTERM_RCC ${QTERM_RCC_SRC} ) -lxqt_translate_ts(QTERM_QM - UPDATE_TRANSLATIONS - ${UPDATE_TRANSLATIONS} - SOURCES - ${QTERM_SRC} - ${QTERM_UI_SRC} - ${QTERM_MOC_SRC} - TRANSLATION_DIR "src/translations" - PULL_TRANSLATIONS - ${PULL_TRANSLATIONS} - CLEAN_TRANSLATIONS - ${CLEAN_TRANSLATIONS} - TRANSLATIONS_REPO - ${TRANSLATIONS_REPO} - TRANSLATIONS_REFSPEC - ${TRANSLATIONS_REFSPEC} -) - -include_directories( - "${PROJECT_SOURCE_DIR}" - "${PROJECT_SOURCE_DIR}/src" - "${PROJECT_BINARY_DIR}" - ${QXT_INCLUDE_DIRS} -) -if(X11_FOUND) - include_directories("${X11_INCLUDE_DIR}") -endif() - - -# TODO/FIXME: apple bundle -set(GUI_TYPE "") -set(APPLE_BUNDLE_SOURCES "") -if(APPLEBUNDLE) - add_definitions(-DAPPLE_BUNDLE) - set(GUI_TYPE MACOSX_BUNDLE) - - # create Info.plist file - set(MACOSX_BUNDLE_ICON_FILE qterminal.icns) - set(MACOSX_BUNDLE_INFO_STRING "QTerminal ${STR_VERSION}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.qterminal") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${STR_VERSION}") - set(MACOSX_BUNDLE_BUNDLE_NAME "${EXE_NAME}") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${STR_VERSION}") - set(MACOSX_BUNDLE_BUNDLE_VERSION "${STR_VERSION}") - set(MACOSX_BUNDLE_COPYRIGHT "(c) Petr Vanek <petr@yarpen.cz>") - - set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/macosx/qterminal.icns" - PROPERTIES MACOSX_PACKAGE_LOCATION Resources - ) - # use icon for app bundle to be visible in finder - set(APPLE_BUNDLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/macosx/qterminal.icns") -else() - set(TRANSLATIONS_DIR "${CMAKE_INSTALL_FULL_DATADIR}/qterminal/translations") - add_definitions(-DTRANSLATIONS_DIR=\"${TRANSLATIONS_DIR}\") -endif() - -add_executable(${EXE_NAME} ${GUI_TYPE} - ${QTERM_SRC} - ${QTERM_UI} - ${QTERM_MOC} - ${QTERM_RCC} - ${APPLE_BUNDLE_SOURCES} - ${QTERM_QM} -) -target_link_libraries(${EXE_NAME} - Qt5::Gui - qtermwidget5 - util -) -if(QXT_FOUND) - target_link_libraries(${EXE_NAME} ${QXT_CORE_LIB} ${QXT_GUI_LIB}) -endif() - -if (Qt5DBus_FOUND) - target_link_libraries(${EXE_NAME} ${Qt5DBus_LIBRARIES}) -endif() - -if(APPLE) - target_link_libraries(${EXE_NAME} ${CARBON_LIBRARY}) -elseif(UNIX) - target_link_libraries(${EXE_NAME} Qt5::X11Extras) -endif() - -if(X11_FOUND) - target_link_libraries(${EXE_NAME} ${X11_X11_LIB}) -endif() - - -install(FILES - qterminal.desktop - qterminal_drop.desktop - DESTINATION "${CMAKE_INSTALL_DATADIR}/applications" -) - -install(FILES - qterminal.appdata.xml - DESTINATION "${CMAKE_INSTALL_DATADIR}/appdata" -) - -if(NOT APPLEBUNDLE) - install(TARGETS ${EXE_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - install(FILES ${QTERM_QM} DESTINATION ${TRANSLATIONS_DIR}) - install(FILES src/icons/qterminal.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps") -else() - message(STATUS "APPLEBUNDLE") - - install(CODE "message(STATUS \"Cleaning previously installed bundle (rm -r)\")") - install(CODE "execute_process(COMMAND rm -r ${CMAKE_INSTALL_PREFIX}/${EXE_NAME}.app)") - - install(TARGETS ${EXE_NAME} DESTINATION "${CMAKE_INSTALL_PREFIX}") - - # helper stuff to create real apple bundle. - # Black magic is summoned here... - if(APPLEBUNDLE_STANDALONE) - message(STATUS "APPLEBUNDLE_STANDALONE") - configure_file("${CMAKE_SOURCE_DIR}/bundle.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/bundle.cmake" @ONLY) - install(SCRIPT "${CMAKE_SOURCE_DIR}/bundle.cmake") - endif() - - # bundle required keytabs from the qtermwidget package as well - install(CODE "message(STATUS \"Bundling (cp) keytab files from ${QTERMWIDGET_SHARE}/qtermwidget/\")") - install(CODE "execute_process(COMMAND cp -r ${QTERMWIDGET_SHARE}/qtermwidget/ ${CMAKE_INSTALL_PREFIX}/${EXE_NAME}.app/Contents/Resources)") - - install(FILES ${QTERM_QM} DESTINATION ${CMAKE_INSTALL_PREFIX}/${EXE_NAME}.app/Contents/translations) -endif() diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index fb6604c..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,23 +0,0 @@ -# Bug reports - -Please file bugs on the qterminal github tracker: - https://github.com/lxqt/qterminal/issues - -Please file qtermwidget-related bugs on the qtermwidget github tracker: - https://github.com/lxqt/qtermwidget/issues - - -# Code contributions - -For all code contributions, please open a pull request on Github: - https://github.com/lxde/qterminal/ - -Make sure your code is clean, devoid of debug statements and respects the style -of the rest of the file (including line length and indentation). - -Do not pollute the git history with unnecessary commits! Make sure each of your -commits compiles to ensure ease of bisection and have clear separation of one -feature or bugfix per commit. - -Please also make sure you set your `git.name` and `git.email` options properly: - https://help.github.com/articles/setting-your-email-in-git/ diff --git a/Doxyfile b/Doxyfile deleted file mode 100644 index ed99210..0000000 --- a/Doxyfile +++ /dev/null @@ -1,1630 +0,0 @@ -# Doxyfile 1.7.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = QTerminal - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 0.2 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = docs - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = src - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.cpp *.h - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = YES - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans.ttf - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d8cf7d4..0000000 --- a/LICENSE +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md deleted file mode 100644 index e3e5389..0000000 --- a/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# QTerminal - -## Overview - -QTerminal is a lightweight Qt terminal emulator based on [QTermWidget](https://github.com/lxqt/qtermwidget). - -It is maintained by the LXQt project but can be used independently from this desktop environment. The only bonds are [lxqt-build-tools](https://github.com/lxqt/lxqt-build-tools) representing a build dependency and the localization files which were outsourced to LXQt repository [lxqt-l10n](https://github.com/lxqt/lxqt-l10n). - -This project is licensed under the terms of the [GPLv2](https://www.gnu.org/licenses/gpl-2.0.en.html) or any later version. See the LICENSE file for the full text of the license. - -## Installation - -### Compiling sources - -Dependencies are qtx11extras ≥ 5.2 and [QTermWidget](https://github.com/lxqt/qtermwidget). -In order to build CMake ≥ 3.0.2 and [lxqt-build-tools](https://github.com/lxqt/lxqt-build-tools) are needed as well as optionally Git to pull latest VCS checkouts. The localization files were outsourced to repository [lxqt-l10n](https://github.com/lxqt/lxqt-l10n) so the corresponding dependencies are needed, too. Please refer to this repository's `README.md` for further information. - -Code configuration is handled by CMake. Building out of source is required. CMake variable `CMAKE_INSTALL_PREFIX` will normally have to be set to `/usr`. - -To build run `make`, to install `make install` which accepts variable `DESTDIR` as usual. - -### Binary packages - -QTerminal is provided by all major Linux distributions like [Arch Linux](https://www.archlinux.org/packages/?q=qterminal), Debian (as of Debian stretch), Fedora and openSUSE. -Just use the distributions' package managers to search for string `qterminal`. diff --git a/qterminal.appdata.xml b/qterminal.appdata.xml deleted file mode 100644 index 706d539..0000000 --- a/qterminal.appdata.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - qterminal.desktop - CC0-1.0 - GPL-2 - QTerminal - A lightweight multiplatform terminal emulator. - -

- QTerminal is a lightweight multiplatform terminal emulator. -

-

- Its main features are: -

-
    -
  • Multiple tabs
  • -
  • Layout terminals side-by-side
  • -
  • Dropdown mode
  • -
  • Text search
  • -
  • Configurable uster interface
  • -
  • Integration of system clipboard
  • -
-
- - - http://worblehat.github.io/storage/qterminal_1.png - The default QTerminal window. - - - - - http://worblehat.github.io/storage/qterminal_2.png - QTerminal with multiple tabs, splitted terminals and highlighted text. - - - - - http://worblehat.github.io/storage/qterminal_3.png - Find bar and highlighted match. - - - https://github.com/lxqt/qterminal -
diff --git a/qterminal.desktop b/qterminal.desktop deleted file mode 100644 index f0f9a5a..0000000 --- a/qterminal.desktop +++ /dev/null @@ -1,65 +0,0 @@ -[Desktop Entry] -Name=QTerminal -Type=Application -GenericName=Terminal emulator -GenericName[es]=Emulador de terminal - -Comment=Terminal emulator -Comment[ca]=Emulador de terminal -Comment[de]=Befehlszeile verwenden -Comment[el]=Προσομοιωτής τερματικού -Comment[es]=Emulador de terminal -Comment[fr]=Terminal -Comment[lt]=Terminalo emuliatorius -Comment[pl]=Emulator terminala -Comment[pt]=Emulador de terminal -Comment[pt_BR]=Emulador de terminal -Comment[ru_RU]=Эмулятор терминала -Comment[ja]=ターミナル エミュレータ - -Icon=utilities-terminal -Exec=qterminal -Terminal=false -Categories=Qt;System;TerminalEmulator; -Actions=Dropdown; - -[Desktop Action Dropdown] -Name=Drop-down terminal -Exec=qterminal --drop -Icon=utilities-terminal - -Name[en_GB]=Drop-down Terminal -Name[bg]=Падащ терминал -Name[ca]=Terminal desplegable -Name[ca@valencia]=Terminal desplegable -Name[cs]=Vysouvací terminál -Name[da]=Terminal der ruller ned -Name[de]=Aufklapp-Terminal -Name[el]=Αναπτυσσόμενο τερματικό -Name[es]=Terminal desplegable -Name[et]=Lahtikeriv terminal -Name[fr]=Terminal déroulant -Name[hr]=Spuštajući terminal -Name[hu]=Legördülő terminál -Name[it]=Terminale a discesa -Name[ja]=ドロップダウン式ターミナル -Name[km]=ស្ថានីយ​ទម្លាក់​ចុះ -Name[ko]=위에서 내려오는 터미널 -Name[lt]=Išskleidžiamasis terminalas -Name[nb]=Nedtrekksterminal -Name[nds]=Utklapp-Konsool -Name[nl]=Uitvouwbare terminalemulator -Name[pa]=ਲਟਕਦਾ ਟਰਮੀਨਲ -Name[pl]=Rozwijany emulator terminala -Name[pt]=Terminal suspenso -Name[pt_BR]=Terminal suspenso -Name[ro]=Terminal derulant -Name[ru]=Выпадающий терминал -Name[sk]=Rozbaľovací terminál -Name[sv]=Rullgardinsterminal -Name[th]=เทอร์มินัลแบบหย่อนลง -Name[tr]=Yukarıdan Açılan Uçbirim -Name[uk]=Спадний термінал -Name[x-test]=xxDrop-down Terminalxx -Name[zh_CN]=拉幕式终端 -Name[zh_TW]=下拉式終端機 diff --git a/qterminal.pro b/qterminal.pro deleted file mode 100644 index 1f3d0bf..0000000 --- a/qterminal.pro +++ /dev/null @@ -1,53 +0,0 @@ -TARGET = qterminal -TEMPLATE = app -# qt5 only. Please use cmake - it's an official build tool for this software -QT += widgets - -CONFIG += link_pkgconfig \ - depend_includepath - -PKGCONFIG += qtermwidget5 - -DEFINES += STR_VERSION=\\\"0.9.0\\\" - -SOURCES += $$files(src/*.cpp) -HEADERS += $$files(src/*.h) - -INCLUDEPATH += src -INCLUDEPATH += src/third-party - -SOURCES += src/third-party/qxtglobalshortcut.cpp -HEADERS += src/third-party/qxtglobalshortcut.h -HEADERS += src/third-party/qxtglobalshortcut_p.h - -win32 { - SOURCES += src/third-party/qxtglobalshortcut_win.cpp -} - -unix:!macx { - SOURCES += src/third-party/qxtglobalshortcut_x11.cpp - LIBS += -L/usr/X11/lib -lX11 - QT += x11extras -} - -macx: { - SOURCES += src/third-party/qxtglobalshortcut_mac.cpp -} - -RESOURCES += src/icons.qrc -FORMS += $$files(src/forms/*.ui) - -unix { - isEmpty(PREFIX) { - PREFIX = /usr/local - } - BINDIR = $$PREFIX/bin - - INSTALLS += target shortcut - target.path = $$BINDIR - - DATADIR = $$PREFIX/share - shortcut.path = $$DATADIR/applications - shortcut.files = qterminal.desktop -} - diff --git a/qterminal_drop.desktop b/qterminal_drop.desktop deleted file mode 100644 index 08aeb87..0000000 --- a/qterminal_drop.desktop +++ /dev/null @@ -1,66 +0,0 @@ -[Desktop Entry] -Type=Application -Exec=qterminal --drop -Terminal=false -Categories=Qt;System;TerminalEmulator; -Icon=utilities-terminal - -Name=QTerminal drop down -Name[ca]=QTerminal desplegable -Name[de]=QTerminal herabhängend -Name[el]=QTerminal αναπτυσσόμενο -Name[es]=QTerminal desplegable -Name[lt]=QTerminal išskleidžiamasis -Name[pl]=QTerminal (tryb rozwijany) -Name[pt]=QTerminal suspenso -Name[pt_BR]=QTerminal suspenso -Name[ja]=QTerminal ドロップダウン - -GenericName=Drop-down Terminal -GenericName[bg]=Падащ терминал -GenericName[ca]=Terminal desplegable -GenericName[ca@valencia]=Terminal desplegable -GenericName[cs]=Vysouvací terminál -GenericName[da]=Terminal der ruller ned -GenericName[de]=Aufklapp-Terminal -GenericName[el]=Αναπτυσσόμενο τερματικό -GenericName[en_GB]=Drop-down Terminal -GenericName[es]=Terminal desplegable -GenericName[et]=Lahtikeriv terminal -GenericName[fr]=Terminal déroulant -GenericName[hr]=Spuštajući terminal -GenericName[hu]=Legördülő terminál -GenericName[it]=Terminale a discesa -GenericName[ja]=ドロップダウン式ターミナル -GenericName[km]=ស្ថានីយ​ទម្លាក់​ចុះ -GenericName[ko]=위에서 내려오는 터미널 -GenericName[lt]=Išskleidžiamasis terminalas -GenericName[nb]=Nedtrekksterminal -GenericName[nds]=Utklapp-Konsool -GenericName[nl]=Uitvouwbare terminalemulator -GenericName[pa]=ਲਟਕਦਾ ਟਰਮੀਨਲ -GenericName[pl]=Rozwijany emulator terminala -GenericName[pt]=Terminal suspenso -GenericName[pt_BR]=Terminal suspenso -GenericName[ro]=Terminal derulant -GenericName[ru]=Выпадающий терминал -GenericName[sk]=Rozbaľovací terminál -GenericName[sv]=Rullgardinsterminal -GenericName[th]=เทอร์มินัลแบบหย่อนลง -GenericName[tr]=Yukarıdan Açılan Uçbirim -GenericName[uk]=Спадний термінал -GenericName[x-test]=xxDrop-down Terminalxx -GenericName[zh_CN]=拉幕式终端 -GenericName[zh_TW]=下拉式終端機 - -Comment=A drop-down terminal emulator. -Comment[ca]=Un emulador de terminal desplegable. -Comment[de]=Ein Ausklapp-Terminalemulator. -Comment[el]=Ένας αναπτυσσόμενος προσομοιωτής τερματικού. -Comment[es]=Un emulador de terminal desplegable. -Comment[lt]=Išskleidžiamasis terminalo emuliatorius. -Comment[pt]=Um emulador de terminal suspenso. -Comment[pt_BR]=Um emulador de terminal suspenso. -Comment[ru]=Выпадающий эмулятор терминала. -Comment[ja]=ドロップダウン式 ターミナルエミュレータ - diff --git a/src/bookmarkswidget.cpp b/src/bookmarkswidget.cpp deleted file mode 100644 index 2834760..0000000 --- a/src/bookmarkswidget.cpp +++ /dev/null @@ -1,397 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include -#include - -#include "bookmarkswidget.h" -#include "properties.h" -#include "config.h" - - -class AbstractBookmarkItem -{ -public: - enum ItemType { - Root = 0, - Group = 1, - Command = 2 - }; - - AbstractBookmarkItem(AbstractBookmarkItem* parent = 0) - { - m_parent = parent; - } - ~AbstractBookmarkItem() - { - qDeleteAll(m_children); - } - - ItemType type() { return m_type; } - QString value() { return m_value; } - QString display() { return m_display; } - - void addChild(AbstractBookmarkItem* item) { m_children << item; } - int childCount() { return m_children.count(); } - QList children() { return m_children; } - AbstractBookmarkItem *child(int number) { return m_children.value(number); } - AbstractBookmarkItem *parent() { return m_parent; } - - int childNumber() const - { - if (m_parent) - return m_parent->children().indexOf(const_cast(this)); - - return 0; - } - -protected: - ItemType m_type; - AbstractBookmarkItem *m_parent; - QList m_children; - QString m_value; - QString m_display; -}; - -class BookmarkRootItem : public AbstractBookmarkItem -{ -public: - BookmarkRootItem() - : AbstractBookmarkItem() - { - m_type = AbstractBookmarkItem::Root; - m_value = m_display = "root"; - } -}; - -class BookmarkCommandItem : public AbstractBookmarkItem -{ -public: - BookmarkCommandItem(const QString &name, const QString &command, AbstractBookmarkItem *parent) - : AbstractBookmarkItem(parent) - { - m_type = AbstractBookmarkItem::Command; - m_value = command; - m_display = name; - } -}; - - -class BookmarkGroupItem : public AbstractBookmarkItem -{ -public: - BookmarkGroupItem(const QString &name, AbstractBookmarkItem *parent) - : AbstractBookmarkItem(parent) - { - m_type = AbstractBookmarkItem::Group; - m_display = name; - } -}; - -class BookmarkLocalGroupItem : public BookmarkGroupItem -{ -public: - BookmarkLocalGroupItem(AbstractBookmarkItem *parent) - : BookmarkGroupItem(QObject::tr("Local Bookmarks"), parent) - { - QList locations; - locations << QStandardPaths::DesktopLocation - << QStandardPaths::DocumentsLocation - << QStandardPaths::TempLocation - << QStandardPaths::HomeLocation - << QStandardPaths::MusicLocation - << QStandardPaths::PicturesLocation; - - QString path; - QString name; - QString cmd; - QDir d; - - // standard $HOME subdirs - for (const QStandardPaths::StandardLocation i : qAsConst(locations)) - { - path = QStandardPaths::writableLocation(i); - if (!d.exists(path)) - { - continue; - } - name = QStandardPaths::displayName(i); - - path.replace(" ", "\\ "); - cmd = "cd " + path; - - addChild(new BookmarkCommandItem(name, cmd, this)); - } - - // system env - include dirs in the tree - QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - const auto keys = env.keys(); - for (const QString &i : keys) - { - path = env.value(i); - if (!d.exists(path) || !QFileInfo(path).isDir()) - { - continue; - } - path.replace(" ", "\\ "); - cmd = "cd " + path; - addChild(new BookmarkCommandItem(i, cmd, this)); - } - } -}; - -class BookmarkFileGroupItem : public BookmarkGroupItem -{ - // hierarchy handling - // m_pos to group map. Example: group1.group2=item - QHash m_map; - // current position level. Example "group1", "group2" - QStringList m_pos; - -public: - BookmarkFileGroupItem(AbstractBookmarkItem *parent, const QString &fname) - : BookmarkGroupItem(QObject::tr("Synchronized Bookmarks"), parent) - { - QFile f(fname); - if (!f.open(QIODevice::ReadOnly)) - { - qDebug() << "Canot open file" << fname; - // TODO/FIXME: message box - return; - } - - QXmlStreamReader xml; - xml.setDevice(&f); - - while (true) - { - xml.readNext(); - - switch (xml.tokenType()) - { - case QXmlStreamReader::StartElement: - { - AbstractBookmarkItem *parent = m_map.contains(xmlPos()) ? m_map[xmlPos()] : this; - QString tag = xml.name().toString(); - if (tag == "group") - { - QString name = xml.attributes().value("name").toString(); - m_pos.append(name); - - BookmarkGroupItem *i = new BookmarkGroupItem(name, parent); - parent->addChild(i); - - m_map[xmlPos()] = i; - } - else if (tag == "command") - { - QString name = xml.attributes().value("name").toString(); - QString cmd = xml.attributes().value("value").toString(); - - BookmarkCommandItem *i = new BookmarkCommandItem(name, cmd, parent); - parent->addChild(i); - } - break; - } - case QXmlStreamReader::EndElement: - { - QString tag = xml.name().toString(); - if (tag == "group") - { - m_pos.removeLast(); - } - break; - } - case QXmlStreamReader::Invalid: - qDebug() << "XML error: " << xml.errorString().constData() - << xml.lineNumber() << xml.columnNumber(); - m_map.clear(); - return; - case QXmlStreamReader::EndDocument: - m_map.clear(); - return; - default: - break; - } // switch - } // while - } // constructor - - QString xmlPos() - { - return m_pos.join("."); - } -}; - - -BookmarksModel::BookmarksModel(QObject *parent) - : QAbstractItemModel(parent), - m_root(0) -{ - setup(); -} - -void BookmarksModel::setup() -{ - if (m_root) - delete m_root; - m_root = new BookmarkRootItem(); - m_root->addChild(new BookmarkLocalGroupItem(m_root)); - m_root->addChild(new BookmarkFileGroupItem(m_root, Properties::Instance()->bookmarksFile)); - beginResetModel(); - endResetModel(); -} - -BookmarksModel::~BookmarksModel() -{ - if (m_root) - delete m_root; -} - -int BookmarksModel::columnCount(const QModelIndex & /* parent */) const -{ - return 2; -} - -QVariant BookmarksModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid()) - return QVariant(); - - switch (role) - { - case Qt::DisplayRole: - case Qt::EditRole: - return index.column() == 0 ? getItem(index)->display() : getItem(index)->value(); - case Qt::FontRole: - { - QFont f; - if (static_cast(index.internalPointer())->type() == AbstractBookmarkItem::Group) - { - f.setBold(true); - } - return f; - } - default: - return QVariant(); - } -} - -AbstractBookmarkItem *BookmarksModel::getItem(const QModelIndex &index) const -{ - if (index.isValid()) - { - AbstractBookmarkItem *item = static_cast(index.internalPointer()); - if (item) - return item; - } - return m_root; - } - -QVariant BookmarksModel::headerData(int section, Qt::Orientation orientation, - int role) const -{ - return QVariant(); -} - -QModelIndex BookmarksModel::index(int row, int column, const QModelIndex &parent) const -{ - if (parent.isValid() && parent.column() != 0) - return QModelIndex(); - - AbstractBookmarkItem *parentItem = getItem(parent); - - AbstractBookmarkItem *childItem = parentItem->child(row); - if (childItem) - return createIndex(row, column, childItem); - else - return QModelIndex(); -} - - -QModelIndex BookmarksModel::parent(const QModelIndex &index) const -{ - if (!index.isValid()) - return QModelIndex(); - - AbstractBookmarkItem *childItem = getItem(index); - AbstractBookmarkItem *parentItem = childItem->parent(); - - if (parentItem == m_root) - return QModelIndex(); - - return createIndex(parentItem->childNumber(), 0, parentItem); -} - -int BookmarksModel::rowCount(const QModelIndex &parent) const -{ - AbstractBookmarkItem *parentItem = getItem(parent); - return parentItem->childCount(); -} - -#if 0 -bool BookmarksModel::setData(const QModelIndex &index, const QVariant &value, - int role) -{ - if (role != Qt::EditRole) - return false; - - AbstractBookmarkItem *item = getItem(index); - bool result = item->setData(index.column(), value); - - if (result) - emit dataChanged(index, index); - - return result; -} -#endif - - -BookmarksWidget::BookmarksWidget(QWidget *parent) - : QWidget(parent) -{ - setupUi(this); - - m_model = new BookmarksModel(this); - treeView->setModel(m_model); - treeView->header()->hide(); - - connect(treeView, &QTreeView::doubleClicked, - this, &BookmarksWidget::handleCommand); -} - -BookmarksWidget::~BookmarksWidget() -{ -} - -void BookmarksWidget::setup() -{ - m_model->setup(); - - treeView->expandAll(); - treeView->resizeColumnToContents(0); - treeView->resizeColumnToContents(1); -} - -void BookmarksWidget::handleCommand(const QModelIndex& index) -{ - AbstractBookmarkItem *item = static_cast(index.internalPointer()); - if (!item || item->type() != AbstractBookmarkItem::Command) - return; - - emit callCommand(item->value() + "\n"); // TODO/FIXME: decide how to handle EOL -} diff --git a/src/bookmarkswidget.h b/src/bookmarkswidget.h deleted file mode 100644 index c0b0f88..0000000 --- a/src/bookmarkswidget.h +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef BOOKMARKSWIDGET_H -#define BOOKMARKSWIDGET_H - -#include "ui_bookmarkswidget.h" - -class AbstractBookmarkItem; -class BookmarksModel; - - -class BookmarksWidget : public QWidget, Ui::BookmarksWidget -{ - Q_OBJECT - -public: - BookmarksWidget(QWidget *parent=NULL); - ~BookmarksWidget(); - - void setup(); - -signals: - void callCommand(const QString &cmd); - -private: - BookmarksModel *m_model; - -private slots: - void handleCommand(const QModelIndex& index); -}; - - -class BookmarksModel : public QAbstractItemModel -{ - Q_OBJECT - -public: - BookmarksModel(QObject *parent = 0); - ~BookmarksModel(); - - void setup(); - - QVariant data(const QModelIndex &index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const; - - QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; - - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - -private: - AbstractBookmarkItem *getItem(const QModelIndex &index) const; - AbstractBookmarkItem *m_root; -}; - -#endif - diff --git a/src/config.h b/src/config.h deleted file mode 100644 index 49a12a1..0000000 --- a/src/config.h +++ /dev/null @@ -1,120 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Vladimir Kuznetsov * - * vovanec@gmail.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - - -#ifndef CONFIG_H -#define CONFIG_H - -#define ADD_TAB "Add Tab" -#define RENAME_TAB "Rename Tab" -#define CLOSE_TAB "Close Tab" -#define NEW_WINDOW "New Window" - -#define QUIT "Quit" -#define PREFERENCES "Preferences..." - -#define TAB_NEXT "Next Tab" -#define TAB_PREV "Previous Tab" - -#define CLEAR_TERMINAL "Clear Active Terminal" - -#define SPLIT_HORIZONTAL "Split Terminal Horizontally" -#define SPLIT_VERTICAL "Split Terminal Vertically" - -#define SUB_COLLAPSE "Collapse Subterminal" -#define SUB_LEFT "Left Subterminal" -#define SUB_RIGHT "Right Subterminal" -#define SUB_TOP "Top Subterminal" -#define SUB_BOTTOM "Bottom Subterminal" - -#define MOVE_LEFT "Move Tab Left" -#define MOVE_RIGHT "Move Tab Right" - -#define COPY_SELECTION "Copy Selection" -#define PASTE_CLIPBOARD "Paste Clipboard" -#define PASTE_SELECTION "Paste Selection" - -#define ZOOM_IN "Zoom in" -#define ZOOM_OUT "Zoom out" -#define ZOOM_RESET "Zoom reset" - -#define FIND "Find" - -#define TOGGLE_MENU "Toggle Menu" -#define TOGGLE_BOOKMARKS "Toggle Bookmarks" - -#define HIDE_WINDOW_BORDERS "Hide Window Borders" -#define SHOW_TAB_BAR "Show Tab Bar" -#define RENAME_SESSION "Rename Session" -#define FULLSCREEN "Fullscreen" - -/* Some defaults for QTerminal application */ - -#define DEFAULT_WIDTH 800 -#define DEFAULT_HEIGHT 600 -#define DEFAULT_FONT "Monospace" - -// ACTIONS -#define CLEAR_TERMINAL_SHORTCUT "Ctrl+Shift+X" - -#define TAB_PREV_SHORTCUT "Ctrl+PgUp|Ctrl+Shift+Tab" -#define TAB_NEXT_SHORTCUT "Ctrl+PgDown|Ctrl+Tab" -#define SUB_BOTTOM_SHORTCUT "Alt+Down" -#define SUB_TOP_SHORTCUT "Alt+Up" -#define SUB_LEFT_SHORTCUT "Alt+Left" -#define SUB_RIGHT_SHORTCUT "Alt+Right" - -#ifdef Q_WS_MAC -// It's tricky - Ctrl is "command" key on mac's keyboards -#define COPY_SELECTION_SHORTCUT "Ctrl+C" -#define PASTE_CLIPBOARD_SHORTCUT "Ctrl+V" -#define FIND_SHORTCUT "Ctrl+F" -#define NEW_WINDOW_SHORTCUT "Ctrl+N" -#define ADD_TAB_SHORTCUT "Ctrl+T" -#define CLOSE_TAB_SHORTCUT "Ctrl+W" -#define TOGGLE_MENU_SHORTCUT "Ctrl+M" -#define TOGGLE_BOOKMARKS_SHORTCUT "Ctrl+B" -#else -#define COPY_SELECTION_SHORTCUT "Ctrl+Shift+C" -#define PASTE_CLIPBOARD_SHORTCUT "Ctrl+Shift+V" -#define PASTE_SELECTION_SHORTCUT "Shift+Ins" -#define FIND_SHORTCUT "Ctrl+Shift+F" -#define NEW_WINDOW_SHORTCUT "Ctrl+Shift+N" -#define ADD_TAB_SHORTCUT "Ctrl+Shift+T" -#define CLOSE_TAB_SHORTCUT "Ctrl+Shift+W" -#define TOGGLE_MENU_SHORTCUT "Ctrl+Shift+M" -#define TOGGLE_BOOKMARKS_SHORTCUT "Ctrl+Shift+B" -#endif - -#define ZOOM_IN_SHORTCUT "Ctrl++" -#define ZOOM_OUT_SHORTCUT "Ctrl+-" -#define ZOOM_RESET_SHORTCUT "Ctrl+0" - -#define MOVE_LEFT_SHORTCUT "Shift+Alt+Left|Ctrl+Shift+PgUp" -#define MOVE_RIGHT_SHORTCUT "Shift+Alt+Right|Ctrl+Shift+PgDown" - -#define RENAME_SESSION_SHORTCUT "Shift+Alt+S" - -#define FULLSCREEN_SHORTCUT "F11" - -// XON/XOFF features: - -#define FLOW_CONTROL_ENABLED false -#define FLOW_CONTROL_WARNING_ENABLED false - -#endif diff --git a/src/dbusaddressable.cpp b/src/dbusaddressable.cpp deleted file mode 100644 index a822f96..0000000 --- a/src/dbusaddressable.cpp +++ /dev/null @@ -1,25 +0,0 @@ - - -#include "dbusaddressable.h" - -#ifdef HAVE_QDBUS -Q_DECLARE_METATYPE(QList) - -QString DBusAddressable::getDbusPathString() -{ - return m_path; -} - -QDBusObjectPath DBusAddressable::getDbusPath() -{ - return QDBusObjectPath(m_path); -} -#endif - -DBusAddressable::DBusAddressable(QString prefix) -{ - #ifdef HAVE_QDBUS - QString uuidString = QUuid::createUuid().toString(); - m_path = prefix + "/" + uuidString.replace(QRegExp("[\\{\\}\\-]"), ""); - #endif -} diff --git a/src/dbusaddressable.h b/src/dbusaddressable.h deleted file mode 100644 index 1059bed..0000000 --- a/src/dbusaddressable.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef DBUSADDRESSABLE_H -#define DBUSADDRESSABLE_H - -#include -#ifdef HAVE_QDBUS -#include -#include -#endif - -class DBusAddressable -{ - #ifdef HAVE_QDBUS - private: - QString m_path; - #endif - public: - #ifdef HAVE_QDBUS - QDBusObjectPath getDbusPath(); - QString getDbusPathString(); - #endif - DBusAddressable(QString prefix); -}; - -#ifdef HAVE_QDBUS -template void registerAdapter(WClass *obj) -{ - new AClass(obj); - QString path = dynamic_cast(obj)->getDbusPathString(); - QDBusConnection::sessionBus().registerObject(path, obj); -} -#endif - - -#endif \ No newline at end of file diff --git a/src/fontdialog.cpp b/src/fontdialog.cpp deleted file mode 100644 index fe6b6f1..0000000 --- a/src/fontdialog.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "fontdialog.h" - -FontDialog::FontDialog(const QFont &f) - : QDialog(0) -{ - setupUi(this); - - fontComboBox->setFontFilters(QFontComboBox::MonospacedFonts - | QFontComboBox::NonScalableFonts - | QFontComboBox::ScalableFonts); - - fontComboBox->setCurrentFont(f); - fontComboBox->setEditable(false); - - sizeSpinBox->setValue(f.pointSize()); - - setFontSample(f); - - connect(fontComboBox, &QFontComboBox::currentFontChanged, - this, &FontDialog::setFontSample); - connect(sizeSpinBox, static_cast(&QSpinBox::valueChanged), - this, &FontDialog::setFontSize); -} - -QFont FontDialog::getFont() -{ - QFont f = fontComboBox->currentFont(); - f.setPointSize(sizeSpinBox->value()); - return f; -} - -void FontDialog::setFontSample(const QFont &f) -{ - previewLabel->setFont(f); - QString sample("%1 %2 pt"); - previewLabel->setText(sample.arg(f.family()).arg(f.pointSize())); -} - -void FontDialog::setFontSize() -{ - const QFont &f = getFont(); - previewLabel->setFont(f); - QString sample("%1 %2 pt"); - previewLabel->setText(sample.arg(f.family()).arg(f.pointSize())); -} diff --git a/src/fontdialog.h b/src/fontdialog.h deleted file mode 100644 index 19dc67c..0000000 --- a/src/fontdialog.h +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2014 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef FONT_DIALOG -#define FONT_DIALOG - -#include "ui_fontdialog.h" -#include "properties.h" - - - -class FontDialog : public QDialog, public Ui::FontDialog -{ - Q_OBJECT -public: - FontDialog(const QFont &f); - QFont getFont(); - -private slots: - void setFontSample(const QFont &f); - void setFontSize(); - -}; - -#endif diff --git a/src/forms/bookmarkswidget.ui b/src/forms/bookmarkswidget.ui deleted file mode 100644 index ee74a5e..0000000 --- a/src/forms/bookmarkswidget.ui +++ /dev/null @@ -1,50 +0,0 @@ - - - BookmarksWidget - - - - 0 - 0 - 323 - 450 - - - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - - - Filter: - - - - - - - - - - true - - - - - - - - diff --git a/src/forms/fontdialog.ui b/src/forms/fontdialog.ui deleted file mode 100644 index 964f48a..0000000 --- a/src/forms/fontdialog.ui +++ /dev/null @@ -1,114 +0,0 @@ - - - FontDialog - - - - 0 - 0 - 296 - 187 - - - - Select Terminal Font - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - Font: - - - - - - - - - - Size: - - - - - - - 6 - - - 10 - - - - - - - Preview - - - - - - - - - - - - - - Select Terminal Font - - - - - - - - - buttonBox - accepted() - FontDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - FontDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/src/forms/propertiesdialog.ui b/src/forms/propertiesdialog.ui deleted file mode 100644 index a7b0c35..0000000 --- a/src/forms/propertiesdialog.ui +++ /dev/null @@ -1,893 +0,0 @@ - - - PropertiesDialog - - - - 0 - 0 - 952 - 947 - - - - Terminal settings - - - - - - Qt::Horizontal - - - QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - - 180 - 16777215 - - - - Qt::ScrollBarAlwaysOff - - - - Appearance - - - - - Behavior - - - - - Shortcuts - - - - - Dropdown - - - - - Bookmarks - - - - - - - - QFrame::StyledPanel - - - 0 - - - - - - - Hide tab bar with only one tab - - - - - - - - - - Color scheme - - - colorSchemaCombo - - - - - - - Scrollbar position - - - scrollBarPos_comboBox - - - - - - - Start with preset: - - - terminalPresetComboBox - - - - - - - - - - - - - Show a border around the current terminal - - - - - - - Terminal transparency - - - termTransparencyBox - - - - - - - Application transparency - - - appTransparencyBox - - - - - - - - None (single terminal) - - - - - 2 terminals horizontally - - - - - 2 terminals vertically - - - - - 4 terminals - - - - - - - - % - - - 0 - - - 99 - - - 0 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Font - - - changeFontButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QFrame::StyledPanel - - - - - - false - - - - - - - &Change... - - - - - - - - - - - - - Tabs position - - - tabsPos_comboBox - - - - - - - - - - % - - - 0 - - - 100 - - - 0 - - - - - - - Widget style - - - styleComboBox - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - Show the menu bar - - - - - - - Keyboard cursor shape - - - keybCursorShape_comboBox - - - - - - - Change window title based on current terminal - - - - - - - Change window icon based on current terminal - - - - - - - Enable bi-directional text support - - - - - - - Background image: - - - - - - - - - - - - Select - - - - - - - - - Show terminal size on resize - - - - - - - Limit tab width: - - - - - - - false - - - px - - - 1000 - - - - - - - Show close button on each tab - - - false - - - - - - - - - - - Qt::Vertical - - - - 20 - 57 - - - - - - - - Emulation - - - - - - - - - <html><head/><body><p>Which behavior to emulate. Note that this does not have to match your operating system.</p><p>The <span style=" font-weight:600;">default</span> emulation is a fallback with a minimal featureset.</p></body></html> - - - Qt::RichText - - - true - - - - - - - - - - Behavior - - - - - - Action after paste - - - motionAfterPasting_comboBox - - - - - - - Confirm multiline paste - - - - - - - Trim trailing newlines in pasted text - - - - - - - 100 - - - 1000000 - - - 1000 - - - - - - - Qt::Vertical - - - - 150 - 139 - - - - - - - - Open new terminals in current working directory - - - - - - - Save Size when closing - - - - - - - Save Position when closing - - - - - - - Ask for confirmation when closing - - - - - - - - - - Unlimited history - - - - - - - History size (in lines) - - - - - - - Default $TERM - - - - - - - true - - - 1 - - - - xterm - - - - - xterm-256color - - - - - - - - - - - - - - - true - - - QAbstractItemView::ScrollPerPixel - - - QAbstractItemView::ScrollPerPixel - - - true - - - 105 - - - true - - - false - - - - Shortcut - - - - - Key - - - - - - - - - - - - Show on start - - - - - - - Size - - - - - - QFormLayout::ExpandingFieldsGrow - - - - - Height - - - dropHeightSpinBox - - - - - - - % - - - - - - - Width - - - dropWidthSpinBox - - - - - - - % - - - - - - - - - - - - - - Shortcut: - - - dropShortCutEdit - - - - - - - - - - - - Qt::Vertical - - - - 20 - 78 - - - - - - - - - - - - Edit bookmark file contents - - - - - - - Bera Sans Mono [bitstream] - 11 - - - - QPlainTextEdit::NoWrap - - - - - - - - - - Enable bookmarks - - - - - - - - - Bookmark file - - - bookmarksLineEdit - - - - - - - - - - Find... - - - - - - - - - You can specify your own bookmarks file location. It allows easy bookmark sharing with tools like OwnCloud or Dropbox. - - - true - - - - - - - - - - - listWidget - changeFontButton - colorSchemaCombo - styleComboBox - scrollBarPos_comboBox - tabsPos_comboBox - keybCursorShape_comboBox - showMenuCheckBox - hideTabBarCheckBox - highlightCurrentCheckBox - changeWindowTitleCheckBox - changeWindowIconCheckBox - enabledBidiSupportCheckBox - appTransparencyBox - termTransparencyBox - backgroundImageLineEdit - chooseBackgroundImageButton - terminalPresetComboBox - historyLimited - historyLimitedTo - historyUnlimited - motionAfterPasting_comboBox - askOnExitCheckBox - savePosOnExitCheckBox - saveSizeOnExitCheckBox - useCwdCheckBox - emulationComboBox - shortcutsWidget - dropShowOnStartCheckBox - dropHeightSpinBox - dropWidthSpinBox - dropShortCutEdit - useBookmarksCheckBox - bookmarksLineEdit - bookmarksButton - bookmarkPlainEdit - - - - - buttonBox - accepted() - PropertiesDialog - accept() - - - 224 - 227 - - - 157 - 248 - - - - - buttonBox - rejected() - PropertiesDialog - reject() - - - 292 - 233 - - - 286 - 248 - - - - - listWidget - currentRowChanged(int) - stackedWidget - setCurrentIndex(int) - - - 96 - 70 - - - 147 - 24 - - - - - limitTabWidthCheckBox - toggled(bool) - limitTabWidthSpinBox - setEnabled(bool) - - - 350 - 275 - - - 618 - 275 - - - - - diff --git a/src/forms/qterminal.ui b/src/forms/qterminal.ui deleted file mode 100644 index 2ecb45b..0000000 --- a/src/forms/qterminal.ui +++ /dev/null @@ -1,119 +0,0 @@ - - - mainWindow - - - - 0 - 0 - 600 - 420 - - - - MainWindow - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QTabWidget::South - - - QTabWidget::Rounded - - - -1 - - - Qt::ElideNone - - - - - - - - - 0 - 0 - 600 - 26 - - - - - &File - - - - - - - - &Actions - - - - - &Help - - - - - - - &View - - - - - &Edit - - - - - - - - - - - - - - - - &About... - - - - - About &Qt... - - - - - - TabWidget - QTabWidget -
tabwidget.h
- 1 -
-
- - -
diff --git a/src/icons.qrc b/src/icons.qrc deleted file mode 100644 index eafc173..0000000 --- a/src/icons.qrc +++ /dev/null @@ -1,16 +0,0 @@ - - - icons/index.theme - icons/qterminal.png - icons/list-add.png - icons/list-remove.png - icons/edit-copy.png - icons/edit-paste.png - icons/document-close.png - icons/application-exit.png - icons/locked.png - icons/notlocked.png - icons/zoom-in.png - icons/zoom-out.png - - diff --git a/src/icons/application-exit.png b/src/icons/application-exit.png deleted file mode 100644 index dd76354c4a49d07e81d9e701164cdc2caa439a47..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1760 zcmV<61|Ru}P)p00006VoOIv0RI600RN!9r;`8x25m`1 zK~#9!%~xA&R8B~-snS19x-23$A+!N!1U zpS{-J`^=dP{%cd7__wTFTq5L3n9C}U8AF>ylFu@&OUEOFlHLZ*uJlI%F%K>&s>$)B&E!`KG zJ$tfNRRvX1250a%%B@o5!oteTwQGA7U9W~=WQ2gMszz=dIg*H1RKPS%JV|pXxz=OH zDxW7#00RPS*VTHOn^irTgpDU_wqc-;TFjgv8>oQmsty1vlgSg%P0nrMFoNkc61vW< zd9*BD7mai_8;PKtVwUK-FCd%cgaxM*K;){;n>hmhvTZnt1Qu0SBTWK+JahUwJ8=R%=gy%}(+2iUliM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&?~3b2BwaYMm}?SJ^NAH#4A!*}f6^WCAweeX+Ez{pR*^OTg*wBPIXGB7Z} zgb5Rd;f=c+s#CzzJHUveNQ@v%9IzX9xn+C(@x%M}C$0Rsj^RkfDF&)d+w;bak8a*p zzyHgj%;j_6gu1Q|orI*!tuGy+X`tDNXoh#^_PRY^9W!^ke37fTO9`mt#mf)0SisW@ gkWzL5s{g%&aSRNao<4y_@t!dwA84$nDm^iti0?Ud-mSGd+*TU!{;wt=$+8pH(|o0 zX;Ws-o;`EUtOW}fE?u^4<;s<-R)fIWwQJX{Tep7w`VAX4Y}&MG+qP{xckbM^Z~yMy zyAK{bc<9if!$%IEIC0|i>CNOa=0fV<-@D2>#zkm1P<9i_Z00ti+;M2!XVDK3X zzJS43F!%-r-@)Jq2>kpBL_dH10-|5PeuKcDKY#xI{rm6VKaQJcPXWV4v?Rzcn1PXr zS=HLr+oz&&(u`&6wjKHY>)*eN6TfrB(jw)AHloTbu#r>pGZ z)!FsJ{M%%wv)syFD$0L6d~K`!jMI-rZtk8Hd*o?lMP>R;=6YTyWraVpVqAY;ZzwQd z++d^gTHpWkKCy&vjg7oYT2h$?I}S`ar4T=>L2{#*LuG=`qyUM)%d0jth_G}w+NjR= ziw<*b5#UPq+07TCyM~MVNQ{ACV@#1U+gc?igYDA}l^RUZnsp#1@8~KIrd+dp`Nl3R&BO%$Kq(IxQdk;ED~%W4xMCGBG*-g4)_irQGpazIMs?zOh~3vU*XI z{~_XWpmgo&>gTe~DWM4f5f#Qg diff --git a/src/icons/edit-paste.png b/src/icons/edit-paste.png deleted file mode 100644 index 4a109a164fdb846ad285950b6cf54555bf52d979..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 937 zcmV;a16KTrP)OhyY5q10W3=1t0xvk9N?~$xasmc`-|fKd?d|tyZaQ>-KmjlaTzOz= zX{k4e#&UbQEtyOj0}EJKShx|1MDF_i{uy*NaDw^ydFXUH%I&JIwWZT(!1-#P>ffr@ z>yI*-%)7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rr<2r5=kti-MtxbiG!z>=(FdH`NV6&tcazC{JNQJPEI zv{m)BDegc$F+wgCQu}9=t@nT5+1`SK&1cv*xf;{RWNM1+{Am1Fk zxp{4%S2rrO=JOz9z(jbW`EkfVL1bhkVBSs*;7}JB=td_ zY)VB!7_kZ)b`#r$su)ltq=|u))?WxjAbnEy@(%|m*E8gf-ppW zejeNR?xAyZlo&Wj2QLNX;19J!@V8FZxwB^x-nxbO)hooc8ej~>gF*p<$R-#2li0rA86^YFt^tdRWC+M0ZJ z_wF>wy?5FHhwSupJh!^q%-p$S>sPLbxL&uSeEYWe;ObS|Y&1SU+SvH^pj`f_d2k^A zJpo6aP9h;6O`udVQ;UmxxrK#Q&yCjtYf&ie7>DOzw(IP>EZ@qqah_>^~ z@~lN|$U)+M(#931xrkx_Z#W#fbPBp%OtFHj?<1>JpUfi!9pw-VAhd?*^-bG}DnMMIxg;m0w2 zA%<7d-&YLaabFR`|3uErKo*M-9=}|LSt0;Xpw`qri#fBqtD`~BDm8M8HT30^4zPa0 z10Gr7j|9Hcr`|m6GQbG34jBfezu>w@zhwZA)G;?S7Ywij;5!3cW{adv zKdscyM-5h=o)6A`Aa?j~5qfZL6tKm;Z`!~wlBR0X&5S%Zo&k$A%F|dS2_(ZMk+3`M(OD2 z9Yv5rCebMj#9%CA8OvA(@+afpodyQ>k`4d>03v!+SaefwW^{L9a%BJjc-kv3FW1Y= j%Pvk%EJ)SMFG>dhHrNJO5L3!r00000NkvXXu0mjf3~BIB diff --git a/src/icons/locked.png b/src/icons/locked.png deleted file mode 100644 index c6d26f96527c5e246f60af7bf27f2bd89d44f542..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 561 zcmV-10?z%3P)N*h9Kr56x%7OHK=LYnWvB7z$9g!_JJ=XKR&1j6ffyX~}EEkBt| zrvI)d5{b9PV$tn%I`gHozDGfjmm(*--R|${bovV`X0ut(w(Xyu=jlsl&5snsB;+{G zjD@u+*)R-uKA+Rl2^B=qb)6ByG)>6+h`52z`1SKAK0EDWbTz?n_yGIX1A&n;x3GVt z;o$uVzSqad7pjC6fv@1R$f;{+t_5}(2?f~J0mESI?kU(kd?${NjgKHzh{Z@oCJ1s3 zsHzX5fE1n}TB0b}$UhZTU7o(FU?cyzKn=7JVKO8wa z+`G^J2SgMHps!_1qDe^NOCBYjD0mLQB^77S=*ieyeXw>ywDHewKT;DbA7&VS}I{2(G1tUxpx zJrt^-eB^gKGYeR9DwVpd z*Xxu_CT}B=$Wb^PK8(lXr9z=VnM|f=XJ!>_R4SD|uRT%}WpnKFyv`;4QmOQ6XPjpw zOln2bG;gg|GfdOe$0pDB&1N%g7)IO9IP$Iy4s>0oL?WS2`LQyy$S6*qO}A84rJo*$ zKLGT8`hw^?dyzb${k=Q1AG&C@OgudgAwcjg&SNd4Ah5lQt853yr)hyNO>AHhhkXW= zfesoF79_x{0-8qfuS)O-w>V?LDG5_$VQx-fG!kI(49KztA>fc}19yoe;aAO!$g=(Q zKNUFj&js>Cn-J)B186^a(Rwk_=?vK;Ecra>OCAK5Rel~!zXw7H4*=D{Jfkpzv6y#e f$h>_qurJpqz#AT>du&JO00000NkvXXu0mjf;1As@ diff --git a/src/icons/qterminal.png b/src/icons/qterminal.png deleted file mode 100644 index 8e2f3c17f81528ba01f5e9691bd00e2d3fba3ebf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2110 zcmV-E2*LM>P)CRA zF|Jw@V^`Hh)6Z3t#vkCOYZc^61&v7+)QA=6#x$~_#^|sDYbyyK^TEt}J?Hu^=W*|y zcX=AQ5S?t2q)T^IZiiA121LE~3cFym3iiUddED&JU;%*POGJd9Ht zVWlYE!xhAohgssCn3kHaMQkMW%2iNVkV8x&{^Q{iq9X-B%x*z!xq0*E&mA2d`_t)k zl|LR}nJ`~juQQLem)Tb(RmDXNhO=y;4as2BcD{xRMpDWdiG%@N+5J zExZk_I!-)#yvo4G>ySYaJHqVjtl3nV7Nv|}G5zpu1T8Hs!Wz`z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VZ%MX2q7mX@JzuaJHBpza`K3z$*(=JMCh^hE_Qka6_Mlk${EiMT~ zmE=)FE5_!*()y$|tPkI5t0ErPon`@tl_G0&t&M3?rYW74-=PO+XSX+;p~KA4PhsDb{%Ir6jj1j}WX zE{CgD*092Iy0Bu96wN&IW>x-z@Btvz+POTO9&CNu_;6QVW|&}d0ME2qVAs+&(_QX47DBgRsaxpCP}zFON5fhuk*Z}gr!;P} zf(F}5r4P=kEYrV*@X7r+TS!r|IfG)n<$rPE#h;?~M( zB!l(`V_a_dqEp7B6*H<7JKj@9h2%kt%AQQp^M^zt*HYhu{ho**K+F~wh4K1Ox|)t^ zM%nW_JZC(#*CIR&ls8{k zQ4Yp;xZ~&_Di%BIf^w*5!##Dlrw;ej z;r|bHSeG|ny2I13=q)?+v9y&BC52u~#oaPLyOtss2GX@gAMFyMAlV10fP3wZ2gy~84gdfE diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index 170b9af..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,318 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Vladimir Kuznetsov * - * vovanec@gmail.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#ifdef HAVE_QDBUS - #include - #include - #include "processadaptor.h" -#endif - - -#include "mainwindow.h" -#include "qterminalapp.h" -#include "terminalconfig.h" - -#define out - -const char* const short_options = "vhw:e:dp:"; - -const struct option long_options[] = { - {"version", 0, NULL, 'v'}, - {"help", 0, NULL, 'h'}, - {"workdir", 1, NULL, 'w'}, - {"execute", 1, NULL, 'e'}, - {"drop", 0, NULL, 'd'}, - {"profile", 1, NULL, 'p'}, - {NULL, 0, NULL, 0} -}; - -QTerminalApp * QTerminalApp::m_instance = NULL; - -void print_usage_and_exit(int code) -{ - printf("QTerminal %s\n", STR_VERSION); - puts("Usage: qterminal [OPTION]...\n"); - puts(" -d, --drop Start in \"dropdown mode\" (like Yakuake or Tilda)"); - puts(" -e, --execute Execute command instead of shell"); - puts(" -h, --help Print this help"); - puts(" -p, --profile Load qterminal with specific options"); - puts(" -v, --version Prints application version and exits"); - puts(" -w, --workdir Start session with specified work directory"); - puts("\nHomepage: "); - puts("Report bugs to "); - exit(code); -} - -void print_version_and_exit(int code=0) -{ - printf("%s\n", STR_VERSION); - exit(code); -} - -void parse_args(int argc, char* argv[], QString& workdir, QString & shell_command, out bool& dropMode) -{ - int next_option; - dropMode = false; - do{ - next_option = getopt_long(argc, argv, short_options, long_options, NULL); - switch(next_option) - { - case 'h': - print_usage_and_exit(0); - case 'w': - workdir = QString(optarg); - break; - case 'e': - shell_command = QString(optarg); - // #15 "Raw" -e params - // Passing "raw" params (like konsole -e mcedit /tmp/tmp.txt") is more preferable - then I can call QString("qterminal -e ") + cmd_line in other programs - while (optind < argc) - { - //printf("arg: %d - %s\n", optind, argv[optind]); - shell_command += ' ' + QString(argv[optind++]); - } - break; - case 'd': - dropMode = true; - break; - case 'p': - Properties::Instance(QString(optarg)); - break; - case '?': - print_usage_and_exit(1); - case 'v': - print_version_and_exit(); - } - } - while(next_option != -1); -} - -int main(int argc, char *argv[]) -{ - QApplication::setApplicationName("qterminal"); - QApplication::setApplicationVersion(STR_VERSION); - QApplication::setOrganizationDomain("qterminal.org"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) - QApplication::setDesktopFileName(QLatin1String("qterminal.desktop")); -#endif - // Warning: do not change settings format. It can screw bookmarks later. - QSettings::setDefaultFormat(QSettings::IniFormat); - - QTerminalApp *app = QTerminalApp::Instance(argc, argv); - #ifdef HAVE_QDBUS - app->registerOnDbus(); - #endif - - QString workdir, shell_command; - bool dropMode; - parse_args(argc, argv, workdir, shell_command, dropMode); - - Properties::Instance()->migrate_settings(); - Properties::Instance()->loadSettings(); - - qputenv("TERM", Properties::Instance()->term.toLatin1()); - - if (workdir.isEmpty()) - workdir = QDir::currentPath(); - app->setWorkingDirectory(workdir); - - const QSettings settings; - const QFileInfo customStyle = QFileInfo( - QFileInfo(settings.fileName()).canonicalPath() + - "/style.qss" - ); - if (customStyle.isFile() && customStyle.isReadable()) - { - QFile style(customStyle.canonicalFilePath()); - style.open(QFile::ReadOnly); - QString styleString = QLatin1String(style.readAll()); - app->setStyleSheet(styleString); - } - - // icons - /* setup our custom icon theme if there is no system theme (OS X, Windows) */ - QCoreApplication::instance()->setAttribute(Qt::AA_UseHighDpiPixmaps); //Fix for High-DPI systems - if (QIcon::themeName().isEmpty()) - QIcon::setThemeName("QTerminal"); - - // translations - QString fname = QString("qterminal_%1.qm").arg(QLocale::system().name().left(5)); - QTranslator translator; -#ifdef TRANSLATIONS_DIR - qDebug() << "TRANSLATIONS_DIR: Loading translation file" << fname << "from dir" << TRANSLATIONS_DIR; - qDebug() << "load success:" << translator.load(fname, TRANSLATIONS_DIR, "_"); -#endif -#ifdef APPLE_BUNDLE - qDebug() << "APPLE_BUNDLE: Loading translator file" << fname << "from dir" << QApplication::applicationDirPath()+"../translations"; - qDebug() << "load success:" << translator.load(fname, QApplication::applicationDirPath()+"../translations", "_"); -#endif - app->installTranslator(&translator); - - TerminalConfig initConfig = TerminalConfig(workdir, shell_command); - app->newWindow(dropMode, initConfig); - - int ret = app->exec(); - delete Properties::Instance(); - app->cleanup(); - - return ret; -} - -MainWindow *QTerminalApp::newWindow(bool dropMode, TerminalConfig &cfg) -{ - MainWindow *window = NULL; - if (dropMode) - { - QWidget *hiddenPreviewParent = new QWidget(0, Qt::Tool); - window = new MainWindow(cfg, dropMode, hiddenPreviewParent); - if (Properties::Instance()->dropShowOnStart) - window->show(); - } - else - { - window = new MainWindow(cfg, dropMode); - window->show(); - } - return window; -} - -QTerminalApp *QTerminalApp::Instance() -{ - assert(m_instance != NULL); - return m_instance; -} - -QTerminalApp *QTerminalApp::Instance(int &argc, char **argv) -{ - assert(m_instance == NULL); - m_instance = new QTerminalApp(argc, argv); - return m_instance; -} - -QTerminalApp::QTerminalApp(int &argc, char **argv) - :QApplication(argc, argv) -{ -} - -QString &QTerminalApp::getWorkingDirectory() -{ - return m_workDir; -} - -void QTerminalApp::setWorkingDirectory(const QString &wd) -{ - m_workDir = wd; -} - -void QTerminalApp::cleanup() { - delete m_instance; - m_instance = NULL; -} - - -void QTerminalApp::addWindow(MainWindow *window) -{ - m_windowList.append(window); -} - -void QTerminalApp::removeWindow(MainWindow *window) -{ - m_windowList.removeOne(window); -} - -QList QTerminalApp::getWindowList() -{ - return m_windowList; -} - -#ifdef HAVE_QDBUS -void QTerminalApp::registerOnDbus() -{ - if (!QDBusConnection::sessionBus().isConnected()) - { - fprintf(stderr, "Cannot connect to the D-Bus session bus.\n" - "To start it, run:\n" - "\teval `dbus-launch --auto-syntax`\n"); - return; - } - QString serviceName = QStringLiteral("org.lxqt.QTerminal-%1").arg(getpid()); - if (!QDBusConnection::sessionBus().registerService(serviceName)) - { - fprintf(stderr, "%s\n", qPrintable(QDBusConnection::sessionBus().lastError().message())); - return; - } - new ProcessAdaptor(this); - QDBusConnection::sessionBus().registerObject("/", this); -} - -QList QTerminalApp::getWindows() -{ - QList windows; - for (MainWindow *wnd : qAsConst(m_windowList)) - { - windows.push_back(wnd->getDbusPath()); - } - return windows; -} - -QDBusObjectPath QTerminalApp::newWindow(const QHash &termArgs) -{ - TerminalConfig cfg = TerminalConfig::fromDbus(termArgs); - MainWindow *wnd = newWindow(false, cfg); - assert(wnd != NULL); - return wnd->getDbusPath(); -} - -QDBusObjectPath QTerminalApp::getActiveWindow() -{ - QWidget *aw = activeWindow(); - if (aw == NULL) - return QDBusObjectPath("/"); - return qobject_cast(aw)->getDbusPath(); -} - -bool QTerminalApp::isDropMode() { - if (m_windowList.count() == 0) { - return false; - } - MainWindow *wnd = m_windowList.at(0); - return wnd->dropMode(); -} - -bool QTerminalApp::toggleDropdown() { - if (m_windowList.count() == 0) { - return false; - } - MainWindow *wnd = m_windowList.at(0); - if (!wnd->dropMode()) { - return false; - } - wnd->showHide(); - return true; -} - - -#endif - diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp deleted file mode 100644 index b96fbe1..0000000 --- a/src/mainwindow.cpp +++ /dev/null @@ -1,809 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Vladimir Kuznetsov * - * vovanec@gmail.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include -#include -#include -#include -#include - -#ifdef HAVE_QDBUS - #include - #include "windowadaptor.h" -#endif - -#include "terminalconfig.h" -#include "mainwindow.h" -#include "tabwidget.h" -#include "termwidgetholder.h" -#include "config.h" -#include "properties.h" -#include "propertiesdialog.h" -#include "bookmarkswidget.h" -#include "qterminalapp.h" -#include "dbusaddressable.h" - -typedef std::function checkfn; -Q_DECLARE_METATYPE(checkfn) - -// TODO/FXIME: probably remove. QSS makes it unusable on mac... -#define QSS_DROP "MainWindow {border: 1px solid rgba(0, 0, 0, 50%);}\n" - -MainWindow::MainWindow(TerminalConfig &cfg, - bool dropMode, - QWidget * parent, - Qt::WindowFlags f) - : QMainWindow(parent,f), - DBusAddressable("/windows"), - tabPosition(NULL), - scrollBarPosition(NULL), - keyboardCursorShape(NULL), - tabPosMenu(NULL), - scrollPosMenu(NULL), - keyboardCursorShapeMenu(NULL), - settingOwner(NULL), - presetsMenu(NULL), - m_config(cfg), - m_dropLockButton(0), - m_dropMode(dropMode) -{ -#ifdef HAVE_QDBUS - registerAdapter(this); -#endif - m_removeFinished = false; - QTerminalApp::Instance()->addWindow(this); - // We want terminal translucency... - setAttribute(Qt::WA_TranslucentBackground); - // ... but neither a fully transparent nor a flat menubar - // with styles that have translucency and/or gradient. - setAttribute(Qt::WA_NoSystemBackground, false); - setAttribute(Qt::WA_DeleteOnClose); - - setupUi(this); - - m_bookmarksDock = new QDockWidget(tr("Bookmarks"), this); - m_bookmarksDock->setObjectName("BookmarksDockWidget"); - m_bookmarksDock->setAutoFillBackground(true); - BookmarksWidget *bookmarksWidget = new BookmarksWidget(m_bookmarksDock); - bookmarksWidget->setAutoFillBackground(true); - m_bookmarksDock->setWidget(bookmarksWidget); - addDockWidget(Qt::LeftDockWidgetArea, m_bookmarksDock); - connect(bookmarksWidget, &BookmarksWidget::callCommand, - this, &MainWindow::bookmarksWidget_callCommand); - - connect(m_bookmarksDock, &QDockWidget::visibilityChanged, - this, &MainWindow::bookmarksDock_visibilityChanged); - - connect(actAbout, &QAction::triggered, this, &MainWindow::actAbout_triggered); - connect(actAboutQt, &QAction::triggered, qApp, &QApplication::aboutQt); - connect(&m_dropShortcut, &QxtGlobalShortcut::activated, this, &MainWindow::showHide); - - setContentsMargins(0, 0, 0, 0); - if (m_dropMode) { - this->enableDropMode(); - setStyleSheet(QSS_DROP); - } - else { - if (Properties::Instance()->saveSizeOnExit) { - resize(Properties::Instance()->mainWindowSize); - } - if (Properties::Instance()->savePosOnExit) { - move(Properties::Instance()->mainWindowPosition); - } - restoreState(Properties::Instance()->mainWindowState); - } - - consoleTabulator->setAutoFillBackground(true); - connect(consoleTabulator, &TabWidget::closeTabNotification, this, &MainWindow::testClose); - consoleTabulator->setTabPosition((QTabWidget::TabPosition)Properties::Instance()->tabsPos); - //consoleTabulator->setShellProgram(command); - - // apply props - propertiesChanged(); - - setupCustomDirs(); - - connect(consoleTabulator, &TabWidget::currentTitleChanged, this, &MainWindow::onCurrentTitleChanged); - connect(menu_Actions, &QMenu::aboutToShow, this, &MainWindow::updateDisabledActions); - - /* The tab should be added after all changes are made to - the main window; otherwise, the initial prompt might - get jumbled because of changes in internal geometry. */ - consoleTabulator->addNewTab(m_config); -} - -void MainWindow::rebuildActions() -{ - // Delete all setting-related QObjects - delete settingOwner; - settingOwner = new QWidget(this); - settingOwner->setGeometry(0,0,0,0); - - // Then create them again - setup_FileMenu_Actions(); - setup_ActionsMenu_Actions(); - setup_ViewMenu_Actions(); -} - -MainWindow::~MainWindow() -{ - QTerminalApp::Instance()->removeWindow(this); -} - -void MainWindow::enableDropMode() -{ - setWindowFlags(Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint); - - m_dropLockButton = new QToolButton(this); - consoleTabulator->setCornerWidget(m_dropLockButton, Qt::BottomRightCorner); - m_dropLockButton->setCheckable(true); - m_dropLockButton->connect(m_dropLockButton, &QToolButton::clicked, this, &MainWindow::setKeepOpen); - setKeepOpen(Properties::Instance()->dropKeepOpen); - m_dropLockButton->setAutoRaise(true); - - setDropShortcut(Properties::Instance()->dropShortCut); - realign(); -} - -void MainWindow::setDropShortcut(QKeySequence dropShortCut) -{ - if (!m_dropMode) - return; - - if (m_dropShortcut.shortcut() != dropShortCut) - { - m_dropShortcut.setShortcut(dropShortCut); - qWarning() << tr("Press \"%1\" to see the terminal.").arg(dropShortCut.toString()); - } -} - -void MainWindow::setup_Action(const char *name, QAction *action, const char *defaultShortcut, const QObject *receiver, - const char *slot, QMenu *menu, const QVariant &data) -{ - QSettings settings; - settings.beginGroup("Shortcuts"); - - QList shortcuts; - - actions[name] = action; - const auto sequences = settings.value(name, defaultShortcut).toString().split('|'); - for (const QString &sequenceString : sequences) - shortcuts.append(QKeySequence::fromString(sequenceString)); - actions[name]->setShortcuts(shortcuts); - - if (receiver) - { - connect(actions[name], SIGNAL(triggered(bool)), receiver, slot); - addAction(actions[name]); - } - - if (menu) - menu->addAction(actions[name]); - - if (!data.isNull()) - actions[name]->setData(data); -} - -void MainWindow::setup_ActionsMenu_Actions() -{ - QVariant data; - - const checkfn checkTabs = &MainWindow::hasMultipleTabs; - const checkfn checkSubterminals = &MainWindow::hasMultipleSubterminals; - - menu_Actions->clear(); - - setup_Action(CLEAR_TERMINAL, new QAction(QIcon::fromTheme("edit-clear"), tr("&Clear Active Terminal"), settingOwner), - CLEAR_TERMINAL_SHORTCUT, consoleTabulator, SLOT(clearActiveTerminal()), menu_Actions); - - menu_Actions->addSeparator(); - - data.setValue(checkTabs); - - setup_Action(TAB_NEXT, new QAction(QIcon::fromTheme("go-next"), tr("&Next Tab"), settingOwner), - TAB_NEXT_SHORTCUT, consoleTabulator, SLOT(switchToRight()), menu_Actions, data); - - setup_Action(TAB_PREV, new QAction(QIcon::fromTheme("go-previous"), tr("&Previous Tab"), settingOwner), - TAB_PREV_SHORTCUT, consoleTabulator, SLOT(switchToLeft()), menu_Actions, data); - - setup_Action(MOVE_LEFT, new QAction(tr("Move Tab &Left"), settingOwner), - MOVE_LEFT_SHORTCUT, consoleTabulator, SLOT(moveLeft()), menu_Actions, data); - - setup_Action(MOVE_RIGHT, new QAction(tr("Move Tab &Right"), settingOwner), - MOVE_RIGHT_SHORTCUT, consoleTabulator, SLOT(moveRight()), menu_Actions, data); - - menu_Actions->addSeparator(); - - setup_Action(SPLIT_HORIZONTAL, new QAction(tr("Split Terminal &Horizontally"), settingOwner), - NULL, consoleTabulator, SLOT(splitHorizontally()), menu_Actions); - - setup_Action(SPLIT_VERTICAL, new QAction(tr("Split Terminal &Vertically"), settingOwner), - NULL, consoleTabulator, SLOT(splitVertically()), menu_Actions); - - data.setValue(checkSubterminals); - - setup_Action(SUB_COLLAPSE, new QAction(tr("&Collapse Subterminal"), settingOwner), - NULL, consoleTabulator, SLOT(splitCollapse()), menu_Actions, data); - - setup_Action(SUB_TOP, new QAction(QIcon::fromTheme("go-up"), tr("&Top Subterminal"), settingOwner), - SUB_TOP_SHORTCUT, consoleTabulator, SLOT(switchTopSubterminal()), menu_Actions, data); - - setup_Action(SUB_BOTTOM, new QAction(QIcon::fromTheme("go-down"), tr("&Bottom Subterminal"), settingOwner), - SUB_BOTTOM_SHORTCUT, consoleTabulator, SLOT(switchBottomSubterminal()), menu_Actions, data); - - setup_Action(SUB_LEFT, new QAction(QIcon::fromTheme("go-previous"), tr("L&eft Subterminal"), settingOwner), - SUB_LEFT_SHORTCUT, consoleTabulator, SLOT(switchLeftSubterminal()), menu_Actions, data); - - setup_Action(SUB_RIGHT, new QAction(QIcon::fromTheme("go-next"), tr("R&ight Subterminal"), settingOwner), - SUB_RIGHT_SHORTCUT, consoleTabulator, SLOT(switchRightSubterminal()), menu_Actions, data); - - - menu_Actions->addSeparator(); - - // Copy and Paste are only added to the table for the sake of bindings at the moment; there is no Edit menu, only a context menu. - setup_Action(COPY_SELECTION, new QAction(QIcon::fromTheme("edit-copy"), tr("Copy &Selection"), settingOwner), - COPY_SELECTION_SHORTCUT, consoleTabulator, SLOT(copySelection()), menu_Edit); - - setup_Action(PASTE_CLIPBOARD, new QAction(QIcon::fromTheme("edit-paste"), tr("Paste Clip&board"), settingOwner), - PASTE_CLIPBOARD_SHORTCUT, consoleTabulator, SLOT(pasteClipboard()), menu_Edit); - - setup_Action(PASTE_SELECTION, new QAction(QIcon::fromTheme("edit-paste"), tr("Paste S&election"), settingOwner), - PASTE_SELECTION_SHORTCUT, consoleTabulator, SLOT(pasteSelection()), menu_Edit); - - setup_Action(ZOOM_IN, new QAction(QIcon::fromTheme("zoom-in"), tr("Zoom &in"), settingOwner), - ZOOM_IN_SHORTCUT, consoleTabulator, SLOT(zoomIn()), menu_Edit); - - setup_Action(ZOOM_OUT, new QAction(QIcon::fromTheme("zoom-out"), tr("Zoom &out"), settingOwner), - ZOOM_OUT_SHORTCUT, consoleTabulator, SLOT(zoomOut()), menu_Edit); - - setup_Action(ZOOM_RESET, new QAction(QIcon::fromTheme("zoom-original"), tr("Zoom rese&t"), settingOwner), - ZOOM_RESET_SHORTCUT, consoleTabulator, SLOT(zoomReset()), menu_Edit); - - menu_Actions->addSeparator(); - - setup_Action(FIND, new QAction(QIcon::fromTheme("edit-find"), tr("&Find..."), settingOwner), - FIND_SHORTCUT, this, SLOT(find()), menu_Actions); - -#if 0 - act = new QAction(this); - act->setSeparator(true); - - // TODO/FIXME: unimplemented for now - act = new QAction(tr("&Save Session"), this); - // do not use sequences for this task - it collides with eg. mc shorcuts - // and mainly - it's not used too often - //act->setShortcut(QKeySequence::Save); - connect(act, SIGNAL(triggered()), consoleTabulator, SLOT(saveSession())); - - act = new QAction(tr("&Load Session"), this); - // do not use sequences for this task - it collides with eg. mc shorcuts - // and mainly - it's not used too often - //act->setShortcut(QKeySequence::Open); - connect(act, SIGNAL(triggered()), consoleTabulator, SLOT(loadSession())); -#endif - - setup_Action(TOGGLE_MENU, new QAction(tr("&Toggle Menu"), settingOwner), - TOGGLE_MENU_SHORTCUT, this, SLOT(toggleMenu())); - // this is correct - add action to main window - not to menu to keep toggle working - - // Add global rename current session shortcut - setup_Action(RENAME_SESSION, new QAction(tr("Rename session"), settingOwner), - RENAME_SESSION_SHORTCUT, consoleTabulator, SLOT(renameCurrentSession())); - // this is correct - add action to main window - not to menu - -} -void MainWindow::setup_FileMenu_Actions() -{ - menu_File->clear(); - setup_Action(ADD_TAB, new QAction(QIcon::fromTheme("list-add"), tr("&New Tab"), settingOwner), - ADD_TAB_SHORTCUT, this, SLOT(addNewTab()), menu_File); - - if (presetsMenu == NULL) { - presetsMenu = new QMenu(tr("New Tab From &Preset"), this); - presetsMenu->addAction(QIcon(), tr("1 &Terminal"), - this, SLOT(addNewTab())); - presetsMenu->addAction(QIcon(), tr("2 &Horizontal Terminals"), - consoleTabulator, SLOT(preset2Horizontal())); - presetsMenu->addAction(QIcon(), tr("2 &Vertical Terminals"), - consoleTabulator, SLOT(preset2Vertical())); - presetsMenu->addAction(QIcon(), tr("4 Terminal&s"), - consoleTabulator, SLOT(preset4Terminals())); - } - - menu_File->addMenu(presetsMenu); - - setup_Action(CLOSE_TAB, new QAction(QIcon::fromTheme("list-remove"), tr("&Close Tab"), settingOwner), - CLOSE_TAB_SHORTCUT, consoleTabulator, SLOT(removeCurrentTab()), menu_File); - - setup_Action(NEW_WINDOW, new QAction(QIcon::fromTheme("window-new"), tr("&New Window"), settingOwner), - NEW_WINDOW_SHORTCUT, this, SLOT(newTerminalWindow()), menu_File); - - menu_File->addSeparator(); - - setup_Action(PREFERENCES, new QAction(tr("&Preferences..."), settingOwner), "", this, SLOT(actProperties_triggered()), menu_File); - - menu_File->addSeparator(); - - setup_Action(QUIT, new QAction(QIcon::fromTheme("application-exit"), tr("&Quit"), settingOwner), "", this, SLOT(close()), menu_File); -} - -void MainWindow::setup_ViewMenu_Actions() -{ - menu_Window->clear(); - QAction *hideBordersAction = new QAction(tr("&Hide Window Borders"), settingOwner); - hideBordersAction->setCheckable(true); - hideBordersAction->setVisible(!m_dropMode); - setup_Action(HIDE_WINDOW_BORDERS, hideBordersAction, - NULL, this, SLOT(toggleBorderless()), menu_Window); - //Properties::Instance()->actions[HIDE_WINDOW_BORDERS]->setObjectName("toggle_Borderless"); -// TODO/FIXME: it's broken somehow. When I call toggleBorderless() here the non-responsive window appear -// actions[HIDE_WINDOW_BORDERS]->setChecked(Properties::Instance()->borderless); -// if (Properties::Instance()->borderless) -// toggleBorderless(); - - QAction *showTabBarAction = new QAction(tr("&Show Tab Bar"), settingOwner); - //toggleTabbar->setObjectName("toggle_TabBar"); - showTabBarAction->setCheckable(true); - showTabBarAction->setChecked(!Properties::Instance()->tabBarless); - setup_Action(SHOW_TAB_BAR, showTabBarAction, - NULL, this, SLOT(toggleTabBar()), menu_Window); - toggleTabBar(); - - QAction *toggleFullscreen = new QAction(tr("Fullscreen"), settingOwner); - toggleFullscreen->setCheckable(true); - toggleFullscreen->setChecked(false); - setup_Action(FULLSCREEN, toggleFullscreen, - FULLSCREEN_SHORTCUT, this, SLOT(showFullscreen(bool)), menu_Window); - - setup_Action(TOGGLE_BOOKMARKS, new QAction(tr("Toggle Bookmarks"), settingOwner), - TOGGLE_BOOKMARKS_SHORTCUT, NULL, NULL, menu_Window); - - menu_Window->addSeparator(); - - /* tabs position */ - if (tabPosition == NULL) { - tabPosition = new QActionGroup(this); - QAction *tabBottom = new QAction(tr("&Bottom"), this); - QAction *tabTop = new QAction(tr("&Top"), this); - QAction *tabRight = new QAction(tr("&Right"), this); - QAction *tabLeft = new QAction(tr("&Left"), this); - tabPosition->addAction(tabTop); - tabPosition->addAction(tabBottom); - tabPosition->addAction(tabLeft); - tabPosition->addAction(tabRight); - - for(int i = 0; i < tabPosition->actions().size(); ++i) - tabPosition->actions().at(i)->setCheckable(true); - } - - - if( tabPosition->actions().count() > Properties::Instance()->tabsPos ) - tabPosition->actions().at(Properties::Instance()->tabsPos)->setChecked(true); - - connect(tabPosition, &QActionGroup::triggered, - consoleTabulator, &TabWidget::changeTabPosition); - - if (tabPosMenu == NULL) { - tabPosMenu = new QMenu(tr("&Tabs Layout"), menu_Window); - tabPosMenu->setObjectName("tabPosMenu"); - - for(int i=0; i < tabPosition->actions().size(); ++i) { - tabPosMenu->addAction(tabPosition->actions().at(i)); - } - - connect(menu_Window, &QMenu::hovered, - this, &MainWindow::updateActionGroup); - } - menu_Window->addMenu(tabPosMenu); - /* */ - - /* Scrollbar */ - if (scrollBarPosition == NULL) { - scrollBarPosition = new QActionGroup(this); - QAction *scrollNone = new QAction(tr("&None"), this); - QAction *scrollRight = new QAction(tr("&Right"), this); - QAction *scrollLeft = new QAction(tr("&Left"), this); - /* order of insertion is dep. on QTermWidget::ScrollBarPosition enum */ - scrollBarPosition->addAction(scrollNone); - scrollBarPosition->addAction(scrollLeft); - scrollBarPosition->addAction(scrollRight); - - for(int i = 0; i < scrollBarPosition->actions().size(); ++i) - scrollBarPosition->actions().at(i)->setCheckable(true); - - if( Properties::Instance()->scrollBarPos < scrollBarPosition->actions().size() ) - scrollBarPosition->actions().at(Properties::Instance()->scrollBarPos)->setChecked(true); - connect(scrollBarPosition, &QActionGroup::triggered, - consoleTabulator, &TabWidget::changeScrollPosition); - - } - if (scrollPosMenu == NULL) { - scrollPosMenu = new QMenu(tr("S&crollbar Layout"), menu_Window); - scrollPosMenu->setObjectName("scrollPosMenu"); - - for(int i=0; i < scrollBarPosition->actions().size(); ++i) { - scrollPosMenu->addAction(scrollBarPosition->actions().at(i)); - } - } - - menu_Window->addMenu(scrollPosMenu); - - /* Keyboard cursor shape */ - if (keyboardCursorShape == NULL) { - keyboardCursorShape = new QActionGroup(this); - QAction *block = new QAction(tr("&BlockCursor"), this); - QAction *underline = new QAction(tr("&UnderlineCursor"), this); - QAction *ibeam = new QAction(tr("&IBeamCursor"), this); - - /* order of insertion is dep. on QTermWidget::KeyboardCursorShape enum */ - keyboardCursorShape->addAction(block); - keyboardCursorShape->addAction(underline); - keyboardCursorShape->addAction(ibeam); - for(int i = 0; i < keyboardCursorShape->actions().size(); ++i) - keyboardCursorShape->actions().at(i)->setCheckable(true); - - if( Properties::Instance()->keyboardCursorShape < keyboardCursorShape->actions().size() ) - keyboardCursorShape->actions().at(Properties::Instance()->keyboardCursorShape)->setChecked(true); - - connect(keyboardCursorShape, &QActionGroup::triggered, - consoleTabulator, &TabWidget::changeKeyboardCursorShape); - } - - if (keyboardCursorShapeMenu == NULL) { - keyboardCursorShapeMenu = new QMenu(tr("&Keyboard Cursor Shape"), menu_Window); - keyboardCursorShapeMenu->setObjectName("keyboardCursorShapeMenu"); - - for(int i=0; i < keyboardCursorShape->actions().size(); ++i) { - keyboardCursorShapeMenu->addAction(keyboardCursorShape->actions().at(i)); - } - } - - menu_Window->addMenu(keyboardCursorShapeMenu); -} - -void MainWindow::setupCustomDirs() -{ - const QSettings settings; - const QString dir = QFileInfo(settings.fileName()).canonicalPath() + "/color-schemes/"; - TermWidgetImpl::addCustomColorSchemeDir(dir); -} - -void MainWindow::on_consoleTabulator_currentChanged(int) -{ -} - -void MainWindow::toggleTabBar() -{ - Properties::Instance()->tabBarless - = !actions[SHOW_TAB_BAR]->isChecked(); - consoleTabulator->showHideTabBar(); -} - -void MainWindow::toggleBorderless() -{ - setWindowFlags(windowFlags() ^ Qt::FramelessWindowHint); - show(); - setWindowState(Qt::WindowActive); /* don't loose focus on the window */ - Properties::Instance()->borderless - = actions[HIDE_WINDOW_BORDERS]->isChecked(); realign(); -} - -void MainWindow::toggleMenu() -{ - m_menuBar->setVisible(!m_menuBar->isVisible()); - Properties::Instance()->menuVisible = m_menuBar->isVisible(); -} - -void MainWindow::showFullscreen(bool fullscreen) -{ - if(fullscreen) - setWindowState(windowState() | Qt::WindowFullScreen); - else - setWindowState(windowState() & ~Qt::WindowFullScreen); -} - -void MainWindow::testClose(bool removeFinished) -{ - - m_removeFinished = removeFinished; - close(); -} -void MainWindow::toggleBookmarks() -{ - m_bookmarksDock->toggleViewAction()->trigger(); -} - - -void MainWindow::closeEvent(QCloseEvent *ev) -{ - if (!Properties::Instance()->askOnExit - || !consoleTabulator->count()) - { - // #80 - do not save state and geometry in drop mode - if (!m_dropMode) { - if (Properties::Instance()->savePosOnExit) { - Properties::Instance()->mainWindowPosition = pos(); - } - if (Properties::Instance()->saveSizeOnExit) { - Properties::Instance()->mainWindowSize = size(); - } - Properties::Instance()->mainWindowState = saveState(); - } - Properties::Instance()->saveSettings(); - for (int i = consoleTabulator->count(); i > 0; --i) { - consoleTabulator->removeTab(i - 1); - } - ev->accept(); - return; - } - - // ask user for cancel only when there is at least one terminal active in this window - QDialog * dia = new QDialog(this); - dia->setObjectName("exitDialog"); - dia->setWindowTitle(tr("Exit QTerminal")); - - QCheckBox * dontAskCheck = new QCheckBox(tr("Do not ask again"), dia); - QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No, Qt::Horizontal, dia); - buttonBox->button(QDialogButtonBox::Yes)->setDefault(true); - - connect(buttonBox, &QDialogButtonBox::accepted, dia, &QDialog::accept); - connect(buttonBox, &QDialogButtonBox::rejected, dia, &QDialog::reject); - - QVBoxLayout * lay = new QVBoxLayout(); - lay->addWidget(new QLabel(tr("Are you sure you want to exit?"))); - lay->addWidget(dontAskCheck); - lay->addWidget(buttonBox); - dia->setLayout(lay); - - if (dia->exec() == QDialog::Accepted) { - Properties::Instance()->mainWindowPosition = pos(); - Properties::Instance()->mainWindowSize = size(); - Properties::Instance()->mainWindowState = saveState(); - Properties::Instance()->askOnExit = !dontAskCheck->isChecked(); - Properties::Instance()->saveSettings(); - for (int i = consoleTabulator->count(); i > 0; --i) { - consoleTabulator->removeTab(i - 1); - } - ev->accept(); - } else { - if(m_removeFinished) { - QWidget *w = consoleTabulator->widget(consoleTabulator->count()-1); - consoleTabulator->removeTab(consoleTabulator->count()-1); - delete w; // delete the widget because the window isn't closed - m_removeFinished = false; - } - ev->ignore(); - } - - dia->deleteLater(); -} - -void MainWindow::actAbout_triggered() -{ - QMessageBox::about(this, QString("QTerminal ") + STR_VERSION, tr("A lightweight multiplatform terminal emulator")); -} - -void MainWindow::actProperties_triggered() -{ - PropertiesDialog *p = new PropertiesDialog(this); - connect(p, &PropertiesDialog::propertiesChanged, this, &MainWindow::propertiesChanged); - p->exec(); -} - -void MainWindow::propertiesChanged() -{ - rebuildActions(); - - QApplication::setStyle(Properties::Instance()->guiStyle); - setWindowOpacity(1.0 - Properties::Instance()->appTransparency/100.0); - consoleTabulator->setTabPosition((QTabWidget::TabPosition)Properties::Instance()->tabsPos); - consoleTabulator->propertiesChanged(); - setDropShortcut(Properties::Instance()->dropShortCut); - - m_menuBar->setVisible(Properties::Instance()->menuVisible); - - m_bookmarksDock->setVisible(Properties::Instance()->useBookmarks - && Properties::Instance()->bookmarksVisible); - actions[TOGGLE_BOOKMARKS]->setVisible(Properties::Instance()->useBookmarks); - - if (Properties::Instance()->useBookmarks) - { - qobject_cast(m_bookmarksDock->widget())->setup(); - } - - onCurrentTitleChanged(consoleTabulator->currentIndex()); - - realign(); -} - -void MainWindow::realign() -{ - if (m_dropMode) - { - QRect desktop = QApplication::desktop()->availableGeometry(this); - QRect geometry = QRect(0, 0, - desktop.width() * Properties::Instance()->dropWidht / 100, - desktop.height() * Properties::Instance()->dropHeight / 100 - ); - geometry.moveCenter(desktop.center()); - // do not use 0 here - we need to calculate with potential panel on top - geometry.setTop(desktop.top()); - if (geometry != this->geometry()) { - setGeometry(geometry); - } - } -} - -void MainWindow::updateActionGroup(QAction *a) -{ - if (a->parent()->objectName() == tabPosMenu->objectName()) { - tabPosition->actions().at(Properties::Instance()->tabsPos)->setChecked(true); - } -} - -void MainWindow::showHide() -{ - if (isVisible()) - hide(); - else - { - realign(); - show(); - activateWindow(); - } -} - -void MainWindow::setKeepOpen(bool value) -{ - Properties::Instance()->dropKeepOpen = value; - if (!m_dropLockButton) - return; - - if (value) - m_dropLockButton->setIcon(QIcon::fromTheme("object-locked")); - else - m_dropLockButton->setIcon(QIcon::fromTheme("object-unlocked")); - - m_dropLockButton->setChecked(value); -} - -void MainWindow::find() -{ - // A bit ugly perhaps with 4 levels of indirection... - consoleTabulator->terminalHolder()->currentTerminal()->impl()->toggleShowSearchBar(); -} - - -bool MainWindow::event(QEvent *event) -{ - if (event->type() == QEvent::WindowDeactivate) - { - if (m_dropMode && - !Properties::Instance()->dropKeepOpen && - qApp->activeWindow() == 0 - ) - hide(); - } - return QMainWindow::event(event); -} - -void MainWindow::newTerminalWindow() -{ - TerminalConfig cfg; - TermWidgetHolder *ch = consoleTabulator->terminalHolder(); - if (ch) - cfg.provideCurrentDirectory(ch->currentTerminal()->impl()->workingDirectory()); - - MainWindow *w = new MainWindow(cfg, false); - w->show(); -} - -void MainWindow::bookmarksWidget_callCommand(const QString& cmd) -{ - consoleTabulator->terminalHolder()->currentTerminal()->impl()->sendText(cmd); - consoleTabulator->terminalHolder()->currentTerminal()->setFocus(); -} - -void MainWindow::bookmarksDock_visibilityChanged(bool visible) -{ - Properties::Instance()->bookmarksVisible = visible; -} - -void MainWindow::addNewTab() -{ - TerminalConfig cfg; - if (Properties::Instance()->terminalsPreset == 3) - consoleTabulator->preset4Terminals(); - else if (Properties::Instance()->terminalsPreset == 2) - consoleTabulator->preset2Vertical(); - else if (Properties::Instance()->terminalsPreset == 1) - consoleTabulator->preset2Horizontal(); - else - consoleTabulator->addNewTab(cfg); - updateDisabledActions(); -} - -void MainWindow::onCurrentTitleChanged(int index) -{ - QString title; - QIcon icon; - if (-1 != index) - { - title = consoleTabulator->tabText(index); - icon = consoleTabulator->tabIcon(index); - } - setWindowTitle(title.isEmpty() || !Properties::Instance()->changeWindowTitle ? QStringLiteral("QTerminal") : title); - setWindowIcon(icon.isNull() || !Properties::Instance()->changeWindowIcon ? QIcon::fromTheme("utilities-terminal") : icon); -} - -bool MainWindow::hasMultipleTabs() -{ - return consoleTabulator->findChildren().count() > 1; -} - -bool MainWindow::hasMultipleSubterminals() -{ - return consoleTabulator->terminalHolder()->findChildren().count() > 1; -} - -void MainWindow::updateDisabledActions() -{ - const QList actions = menu_Actions->actions(); - for (QAction *action : actions) { - if (!action->data().isNull()) { - const checkfn check = action->data().value(); - action->setEnabled(check(*this)); - } - } -} - - -QMap< QString, QAction * >& MainWindow::leaseActions() { - return actions; -} -#ifdef HAVE_QDBUS - -QDBusObjectPath MainWindow::getActiveTab() -{ - return qobject_cast(consoleTabulator->currentWidget())->getDbusPath(); -} - -QList MainWindow::getTabs() -{ - QList tabs; - for (int i = 0; icount(); ++i) - { - tabs.push_back(qobject_cast(consoleTabulator->widget(i))->getDbusPath()); - } - return tabs; - -} - -QDBusObjectPath MainWindow::newTab(const QHash &termArgs) -{ - TerminalConfig cfg = TerminalConfig::fromDbus(termArgs); - int idx = consoleTabulator->addNewTab(cfg); - return qobject_cast(consoleTabulator->widget(idx))->getDbusPath(); -} - -void MainWindow::closeWindow() -{ - close(); -} - -#endif diff --git a/src/mainwindow.h b/src/mainwindow.h deleted file mode 100644 index 1432d77..0000000 --- a/src/mainwindow.h +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Vladimir Kuznetsov * - * vovanec@gmail.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include "ui_qterminal.h" - -#include -#include - -#include "qxtglobalshortcut.h" -#include "terminalconfig.h" -#include "dbusaddressable.h" - - -class QToolButton; - -class MainWindow : public QMainWindow, private Ui::mainWindow, public DBusAddressable -{ - Q_OBJECT - -public: - MainWindow(TerminalConfig& cfg, - bool dropMode, - QWidget * parent = 0, Qt::WindowFlags f = 0); - ~MainWindow(); - - bool dropMode() { return m_dropMode; } - QMap & leaseActions(); - - #ifdef HAVE_QDBUS - QDBusObjectPath getActiveTab(); - QList getTabs(); - QDBusObjectPath newTab(const QHash &termArgs); - void closeWindow(); - #endif - -protected: - bool event(QEvent* event); - -private: - QActionGroup *tabPosition, *scrollBarPosition, *keyboardCursorShape; - QMenu *tabPosMenu, *scrollPosMenu, *keyboardCursorShapeMenu; - - // A parent object for QObjects that are created dynamically based on settings - // Used to simplify the setting cleanup on reconfiguration: deleting settingOwner frees all related QObjects - QWidget *settingOwner; - - QMenu *presetsMenu; - bool m_removeFinished; - TerminalConfig m_config; - - QDockWidget *m_bookmarksDock; - - void setup_Action(const char *name, QAction *action, const char *defaultShortcut, const QObject *receiver, - const char *slot, QMenu *menu = NULL, const QVariant &data = QVariant()); - QMap< QString, QAction * > actions; - - void rebuildActions(); - - void setup_FileMenu_Actions(); - void setup_ActionsMenu_Actions(); - void setup_ViewMenu_Actions(); - void setup_ContextMenu_Actions(); - void setupCustomDirs(); - - void closeEvent(QCloseEvent*); - - void enableDropMode(); - QToolButton *m_dropLockButton; - bool m_dropMode; - QxtGlobalShortcut m_dropShortcut; - void realign(); - void setDropShortcut(QKeySequence dropShortCut); - - bool hasMultipleTabs(); - bool hasMultipleSubterminals(); - -public slots: - void showHide(); - void updateDisabledActions(); - -private slots: - void on_consoleTabulator_currentChanged(int); - void propertiesChanged(); - void actAbout_triggered(); - void actProperties_triggered(); - void updateActionGroup(QAction *); - void testClose(bool removeFinished); - void toggleBookmarks(); - void toggleBorderless(); - void toggleTabBar(); - void toggleMenu(); - - void showFullscreen(bool fullscreen); - void setKeepOpen(bool value); - void find(); - - void newTerminalWindow(); - void bookmarksWidget_callCommand(const QString&); - void bookmarksDock_visibilityChanged(bool visible); - - void addNewTab(); - void onCurrentTitleChanged(int index); - -}; -#endif //MAINWINDOW_H diff --git a/src/org.lxqt.QTerminal.Process.xml b/src/org.lxqt.QTerminal.Process.xml deleted file mode 100644 index 7b231c8..0000000 --- a/src/org.lxqt.QTerminal.Process.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/org.lxqt.QTerminal.Tab.xml b/src/org.lxqt.QTerminal.Tab.xml deleted file mode 100644 index f11c703..0000000 --- a/src/org.lxqt.QTerminal.Tab.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/org.lxqt.QTerminal.Terminal.xml b/src/org.lxqt.QTerminal.Terminal.xml deleted file mode 100644 index 4b76d7f..0000000 --- a/src/org.lxqt.QTerminal.Terminal.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/org.lxqt.QTerminal.Window.xml b/src/org.lxqt.QTerminal.Window.xml deleted file mode 100644 index a791ea6..0000000 --- a/src/org.lxqt.QTerminal.Window.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/properties.cpp b/src/properties.cpp deleted file mode 100644 index 3ed1cff..0000000 --- a/src/properties.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include -#include - -#include "properties.h" -#include "config.h" -#include "mainwindow.h" -#include "qterminalapp.h" - -Properties * Properties::m_instance = 0; - - -Properties * Properties::Instance(const QString& filename) -{ - if (!m_instance) - m_instance = new Properties(filename); - return m_instance; -} - -Properties::Properties(const QString& filename) - : filename(filename) -{ - if (filename.isEmpty()) - m_settings = new QSettings(); - else - m_settings = new QSettings(filename); - qDebug("Properties constructor called"); -} - -Properties::~Properties() -{ - qDebug("Properties destructor called"); - delete m_settings; - m_instance = 0; -} - -QFont Properties::defaultFont() -{ - QFont default_font = QApplication::font(); - default_font.setFamily(DEFAULT_FONT); - default_font.setPointSize(12); - default_font.setStyleHint(QFont::TypeWriter); - return default_font; -} - -void Properties::loadSettings() -{ - guiStyle = m_settings->value("guiStyle", QString()).toString(); - if (!guiStyle.isNull()) - QApplication::setStyle(guiStyle); - - colorScheme = m_settings->value("colorScheme", "Linux").toString(); - - highlightCurrentTerminal = m_settings->value("highlightCurrentTerminal", true).toBool(); - showTerminalSizeHint = m_settings->value("showTerminalSizeHint", true).toBool(); - - font = QFont(qvariant_cast(m_settings->value("fontFamily", defaultFont().family())), - qvariant_cast(m_settings->value("fontSize", defaultFont().pointSize()))); - //Legacy font setting - font = qvariant_cast(m_settings->value("font", font)); - - mainWindowSize = m_settings->value("MainWindow/size").toSize(); - mainWindowPosition = m_settings->value("MainWindow/pos").toPoint(); - mainWindowState = m_settings->value("MainWindow/state").toByteArray(); - - historyLimited = m_settings->value("HistoryLimited", true).toBool(); - historyLimitedTo = m_settings->value("HistoryLimitedTo", 1000).toUInt(); - - emulation = m_settings->value("emulation", "default").toString(); - - // sessions - int size = m_settings->beginReadArray("Sessions"); - for (int i = 0; i < size; ++i) - { - m_settings->setArrayIndex(i); - QString name(m_settings->value("name").toString()); - if (name.isEmpty()) - continue; - sessions[name] = m_settings->value("state").toByteArray(); - } - m_settings->endArray(); - - appTransparency = m_settings->value("MainWindow/ApplicationTransparency", 0).toInt(); - termTransparency = m_settings->value("TerminalTransparency", 0).toInt(); - backgroundImage = m_settings->value("TerminalBackgroundImage", QString()).toString(); - - /* default to Right. see qtermwidget.h */ - scrollBarPos = m_settings->value("ScrollbarPosition", 2).toInt(); - /* default to North. I'd prefer South but North is standard (they say) */ - tabsPos = m_settings->value("TabsPosition", 0).toInt(); - /* default to BlockCursor */ - keyboardCursorShape = m_settings->value("KeyboardCursorShape", 0).toInt(); - hideTabBarWithOneTab = m_settings->value("HideTabBarWithOneTab", false).toBool(); - m_motionAfterPaste = m_settings->value("MotionAfterPaste", 0).toInt(); - - /* tab width limit */ - limitTabWidth = m_settings->value("LimitTabWidth", true).toBool(); - limitTabWidthValue = m_settings->value("LimitTabWidthValue", 500).toInt(); - showCloseTabButton = m_settings->value("ShowCloseTabButton", true).toBool(); - - /* toggles */ - borderless = m_settings->value("Borderless", false).toBool(); - tabBarless = m_settings->value("TabBarless", false).toBool(); - menuVisible = m_settings->value("MenuVisible", true).toBool(); - askOnExit = m_settings->value("AskOnExit", true).toBool(); - saveSizeOnExit = m_settings->value("SaveSizeOnExit", true).toBool(); - savePosOnExit = m_settings->value("SavePosOnExit", true).toBool(); - useCWD = m_settings->value("UseCWD", false).toBool(); - term = m_settings->value("Term", "xterm-256color").toString(); - - // bookmarks - useBookmarks = m_settings->value("UseBookmarks", false).toBool(); - bookmarksVisible = m_settings->value("BookmarksVisible", true).toBool(); - const QString s = QFileInfo(m_settings->fileName()).canonicalPath() + QString::fromLatin1("/qterminal_bookmarks.xml"); - bookmarksFile = m_settings->value("BookmarksFile", s).toString(); - - terminalsPreset = m_settings->value("TerminalsPreset", 0).toInt(); - - m_settings->beginGroup("DropMode"); - dropShortCut = QKeySequence(m_settings->value("ShortCut", "F12").toString()); - dropKeepOpen = m_settings->value("KeepOpen", false).toBool(); - dropShowOnStart = m_settings->value("ShowOnStart", true).toBool(); - dropWidht = m_settings->value("Width", 70).toInt(); - dropHeight = m_settings->value("Height", 45).toInt(); - m_settings->endGroup(); - - changeWindowTitle = m_settings->value("ChangeWindowTitle", true).toBool(); - changeWindowIcon = m_settings->value("ChangeWindowIcon", true).toBool(); - enabledBidiSupport = m_settings->value("enabledBidiSupport", true).toBool(); - - confirmMultilinePaste = m_settings->value("ConfirmMultilinePaste", false).toBool(); - trimPastedTrailingNewlines = m_settings->value("TrimPastedTrailingNewlines", false).toBool(); -} - -void Properties::saveSettings() -{ - m_settings->setValue("guiStyle", guiStyle); - m_settings->setValue("colorScheme", colorScheme); - m_settings->setValue("highlightCurrentTerminal", highlightCurrentTerminal); - m_settings->setValue("showTerminalSizeHint", showTerminalSizeHint); - m_settings->setValue("fontFamily", font.family()); - m_settings->setValue("fontSize", font.pointSize()); - //Clobber legacy setting - m_settings->remove("font"); - - m_settings->beginGroup("Shortcuts"); - MainWindow *mainWindow = QTerminalApp::Instance()->getWindowList()[0]; - assert(mainWindow != NULL); - - QMapIterator< QString, QAction * > it(mainWindow->leaseActions()); - while( it.hasNext() ) - { - it.next(); - QStringList sequenceStrings; - const auto shortcuts = it.value()->shortcuts(); - for (const QKeySequence &shortcut : shortcuts) - sequenceStrings.append(shortcut.toString()); - m_settings->setValue(it.key(), sequenceStrings.join('|')); - } - m_settings->endGroup(); - - m_settings->setValue("MainWindow/size", mainWindowSize); - m_settings->setValue("MainWindow/pos", mainWindowPosition); - m_settings->setValue("MainWindow/state", mainWindowState); - - m_settings->setValue("HistoryLimited", historyLimited); - m_settings->setValue("HistoryLimitedTo", historyLimitedTo); - - m_settings->setValue("emulation", emulation); - - // sessions - m_settings->beginWriteArray("Sessions"); - int i = 0; - Sessions::iterator sit = sessions.begin(); - while (sit != sessions.end()) - { - m_settings->setArrayIndex(i); - m_settings->setValue("name", sit.key()); - m_settings->setValue("state", sit.value()); - ++sit; - ++i; - } - m_settings->endArray(); - - m_settings->setValue("MainWindow/ApplicationTransparency", appTransparency); - m_settings->setValue("TerminalTransparency", termTransparency); - m_settings->setValue("TerminalBackgroundImage", backgroundImage); - m_settings->setValue("ScrollbarPosition", scrollBarPos); - m_settings->setValue("TabsPosition", tabsPos); - m_settings->setValue("KeyboardCursorShape", keyboardCursorShape); - m_settings->setValue("HideTabBarWithOneTab", hideTabBarWithOneTab); - m_settings->setValue("MotionAfterPaste", m_motionAfterPaste); - - m_settings->setValue("LimitTabWidth", limitTabWidth); - m_settings->setValue("LimitTabWidthValue", limitTabWidthValue); - m_settings->setValue("ShowCloseTabButton", showCloseTabButton); - - m_settings->setValue("Borderless", borderless); - m_settings->setValue("TabBarless", tabBarless); - m_settings->setValue("MenuVisible", menuVisible); - m_settings->setValue("AskOnExit", askOnExit); - m_settings->setValue("SavePosOnExit", savePosOnExit); - m_settings->setValue("SaveSizeOnExit", saveSizeOnExit); - m_settings->setValue("UseCWD", useCWD); - m_settings->setValue("Term", term); - - // bookmarks - m_settings->setValue("UseBookmarks", useBookmarks); - m_settings->setValue("BookmarksVisible", bookmarksVisible); - m_settings->setValue("BookmarksFile", bookmarksFile); - - m_settings->setValue("TerminalsPreset", terminalsPreset); - - m_settings->beginGroup("DropMode"); - m_settings->setValue("ShortCut", dropShortCut.toString()); - m_settings->setValue("KeepOpen", dropKeepOpen); - m_settings->setValue("ShowOnStart", dropShowOnStart); - m_settings->setValue("Width", dropWidht); - m_settings->setValue("Height", dropHeight); - m_settings->endGroup(); - - m_settings->setValue("ChangeWindowTitle", changeWindowTitle); - m_settings->setValue("ChangeWindowIcon", changeWindowIcon); - m_settings->setValue("enabledBidiSupport", enabledBidiSupport); - - - m_settings->setValue("ConfirmMultilinePaste", confirmMultilinePaste); - m_settings->setValue("TrimPastedTrailingNewlines", trimPastedTrailingNewlines); -} - -void Properties::migrate_settings() -{ - // Deal with rearrangements of settings. - // If this method becomes unbearably huge we should look at the config-update - // system used by kde and razor. - QSettings settings; - QString lastVersion = settings.value("version", "0.0.0").toString(); - QString currentVersion = STR_VERSION; - if (currentVersion < lastVersion) - { - qDebug() << "Warning: Configuration file was written by a newer version " - << "of QTerminal. Some settings might be incompatible"; - } - - if (lastVersion < "0.4.0") - { - // ===== Paste Selection -> Paste Clipboard ===== - settings.beginGroup("Shortcuts"); - if(!settings.contains(PASTE_CLIPBOARD)) - { - QString value = settings.value("Paste Selection", PASTE_CLIPBOARD_SHORTCUT).toString(); - settings.setValue(PASTE_CLIPBOARD, value); - } - settings.remove("Paste Selection"); - settings.endGroup(); - } - - if (lastVersion <= "0.6.0") - { - // ===== AlwaysShowTabs -> HideTabBarWithOneTab ===== - if(!settings.contains("HideTabBarWithOneTab")) - { - QString hideValue = settings.value("AlwaysShowTabs", false).toString(); - settings.setValue("HideTabBarWithOneTab", hideValue); - } - settings.remove("AlwaysShowTabs"); - - // ===== appOpacity -> ApplicationTransparency ===== - // - // Note: In 0.6.0 the opacity values had been erroneously - // restricted to [0,99] instead of [1,100]. We fix this here by - // setting the opacity to 100 if it was 99 and to 1 if it was 0. - // - if(!settings.contains("MainWindow/ApplicationTransparency")) - { - int appOpacityValue = settings.value("MainWindow/appOpacity", 100).toInt(); - appOpacityValue = appOpacityValue == 99 ? 100 : appOpacityValue; - appOpacityValue = appOpacityValue == 0 ? 1 : appOpacityValue; - settings.setValue("MainWindow/ApplicationTransparency", 100 - appOpacityValue); - } - settings.remove("MainWindow/appOpacity"); - - // ===== termOpacity -> TerminalTransparency ===== - if(!settings.contains("TerminalTransparency")) - { - int termOpacityValue = settings.value("termOpacity", 100).toInt(); - termOpacityValue = termOpacityValue == 99 ? 100 : termOpacityValue; - settings.setValue("TerminalTransparency", 100 - termOpacityValue); - } - settings.remove("termOpacity"); - // geometry -> size, pos - if (!settings.contains("MainWindow/size")) - { - QWidget geom; - geom.restoreGeometry(settings.value("MainWindow/geometry").toByteArray()); - settings.setValue("MainWindow/size", geom.size()); - settings.setValue("MainWindow/pos", geom.pos()); - settings.remove("MainWindow/geometry"); - } - } - - if (currentVersion > lastVersion) - settings.setValue("version", currentVersion); -} - diff --git a/src/properties.h b/src/properties.h deleted file mode 100644 index 872ab2e..0000000 --- a/src/properties.h +++ /dev/null @@ -1,124 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef PROPERTIES_H -#define PROPERTIES_H - -#include -#include -#include - -typedef QString Session; - -typedef QMap Sessions; - -typedef QMap ShortcutMap; - - -class Properties -{ - public: - static Properties *Instance(const QString& filename = QString()); - ~Properties(); - - QFont defaultFont(); - void saveSettings(); - void loadSettings(); - void migrate_settings(); - - QSize mainWindowSize; - QPoint mainWindowPosition; - QByteArray mainWindowState; - //ShortcutMap shortcuts; - QString shell; - QFont font; - QString colorScheme; - QString guiStyle; - bool highlightCurrentTerminal; - bool showTerminalSizeHint; - - bool historyLimited; - unsigned historyLimitedTo; - - QString emulation; - - Sessions sessions; - - int appTransparency; - int termTransparency; - QString backgroundImage; - - int scrollBarPos; - int tabsPos; - int keyboardCursorShape; - bool hideTabBarWithOneTab; - int m_motionAfterPaste; - - bool limitTabWidth; - int limitTabWidthValue; - - bool showCloseTabButton; - - bool borderless; - bool tabBarless; - bool menuVisible; - - bool askOnExit; - - bool saveSizeOnExit; - bool savePosOnExit; - - bool useCWD; - - QString term; - - bool useBookmarks; - bool bookmarksVisible; - QString bookmarksFile; - - int terminalsPreset; - - QKeySequence dropShortCut; - bool dropKeepOpen; - bool dropShowOnStart; - int dropWidht; - int dropHeight; - - bool changeWindowTitle; - bool changeWindowIcon; - bool enabledBidiSupport; - - bool confirmMultilinePaste; - bool trimPastedTrailingNewlines; - - - private: - - // Singleton handling - static Properties *m_instance; - QString filename; - - explicit Properties(const QString& filename); - Properties(const Properties &) {}; - - QSettings *m_settings; - -}; - -#endif - diff --git a/src/propertiesdialog.cpp b/src/propertiesdialog.cpp deleted file mode 100644 index 388e8d5..0000000 --- a/src/propertiesdialog.cpp +++ /dev/null @@ -1,435 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include - -#include -#include -#include -#include - -#include "propertiesdialog.h" -#include "properties.h" -#include "fontdialog.h" -#include "config.h" -#include "qterminalapp.h" - -Delegate::Delegate (QObject *parent) - : QStyledItemDelegate (parent) -{ -} - -QWidget* Delegate::createEditor(QWidget *parent, - const QStyleOptionViewItem& /*option*/, - const QModelIndex& /*index*/) const -{ - return new QKeySequenceEdit (parent); -} - -bool Delegate::eventFilter(QObject *object, QEvent *event) -{ - QWidget *editor = qobject_cast(object); - if (editor && event->type() == QEvent::KeyPress) { - int k = static_cast(event)->key(); - if (k == Qt::Key_Return || k == Qt::Key_Enter) { - emit QAbstractItemDelegate::commitData(editor); - emit QAbstractItemDelegate::closeEditor(editor); - return true; - } - } - return QStyledItemDelegate::eventFilter (object, event); -} - -PropertiesDialog::PropertiesDialog(QWidget *parent) - : QDialog(parent) -{ - setupUi(this); - - connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, - this, &PropertiesDialog::apply); - connect(changeFontButton, &QPushButton::clicked, - this, &PropertiesDialog::changeFontButton_clicked); - connect(chooseBackgroundImageButton, &QPushButton::clicked, - this, &PropertiesDialog::chooseBackgroundImageButton_clicked); - - QStringList emulations = QTermWidget::availableKeyBindings(); - QStringList colorSchemes = QTermWidget::availableColorSchemes(); - colorSchemes.sort(Qt::CaseInsensitive); - - listWidget->setCurrentRow(0); - listWidget->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow); - - colorSchemaCombo->addItems(colorSchemes); - int csix = colorSchemaCombo->findText(Properties::Instance()->colorScheme); - if (csix != -1) - colorSchemaCombo->setCurrentIndex(csix); - - backgroundImageLineEdit->setText(Properties::Instance()->backgroundImage); - - emulationComboBox->addItems(emulations); - int eix = emulationComboBox->findText(Properties::Instance()->emulation); - emulationComboBox->setCurrentIndex(eix != -1 ? eix : 0 ); - - /* set the delegate of shortcut widget as well as its contents */ - Delegate *del = new Delegate(shortcutsWidget); - shortcutsWidget->setItemDelegate(del); - shortcutsWidget->sortByColumn(0, Qt::AscendingOrder); - setupShortcuts(); - - /* scrollbar position */ - QStringList scrollBarPosList; - scrollBarPosList << tr("No scrollbar") << tr("Left") << tr("Right"); - scrollBarPos_comboBox->addItems(scrollBarPosList); - scrollBarPos_comboBox->setCurrentIndex(Properties::Instance()->scrollBarPos); - - /* tabs position */ - QStringList tabsPosList; - tabsPosList << tr("Top") << tr("Bottom") << tr("Left") << tr("Right"); - tabsPos_comboBox->addItems(tabsPosList); - tabsPos_comboBox->setCurrentIndex(Properties::Instance()->tabsPos); - - /* tab width */ - limitTabWidthCheckBox->setChecked(Properties::Instance()->limitTabWidth); - limitTabWidthSpinBox->setValue(Properties::Instance()->limitTabWidthValue); - closeTabButtonCheckBox->setChecked(Properties::Instance()->showCloseTabButton); - - /* keyboard cursor shape */ - QStringList keyboardCursorShapeList; - keyboardCursorShapeList << tr("BlockCursor") << tr("UnderlineCursor") << tr("IBeamCursor"); - keybCursorShape_comboBox->addItems(keyboardCursorShapeList); - keybCursorShape_comboBox->setCurrentIndex(Properties::Instance()->keyboardCursorShape); - - hideTabBarCheckBox->setChecked(Properties::Instance()->hideTabBarWithOneTab); - - // show main menu bar - showMenuCheckBox->setChecked(Properties::Instance()->menuVisible); - - /* actions by motion after paste */ - - QStringList motionAfter; - motionAfter << tr("No move") << tr("Move start") << tr("Move end"); - motionAfterPasting_comboBox->addItems(motionAfter); - motionAfterPasting_comboBox->setCurrentIndex(Properties::Instance()->m_motionAfterPaste); - - // Setting windows style actions - styleComboBox->addItem(tr("System Default")); - styleComboBox->addItems(QStyleFactory::keys()); - - int ix = styleComboBox->findText(Properties::Instance()->guiStyle); - if (ix != -1) - styleComboBox->setCurrentIndex(ix); - - setFontSample(Properties::Instance()->font); - - appTransparencyBox->setValue(Properties::Instance()->appTransparency); - - termTransparencyBox->setValue(Properties::Instance()->termTransparency); - - highlightCurrentCheckBox->setChecked(Properties::Instance()->highlightCurrentTerminal); - - showTerminalSizeHintCheckBox->setChecked(Properties::Instance()->showTerminalSizeHint); - - askOnExitCheckBox->setChecked(Properties::Instance()->askOnExit); - - savePosOnExitCheckBox->setChecked(Properties::Instance()->savePosOnExit); - saveSizeOnExitCheckBox->setChecked(Properties::Instance()->saveSizeOnExit); - - useCwdCheckBox->setChecked(Properties::Instance()->useCWD); - - termComboBox->setCurrentText(Properties::Instance()->term); - - historyLimited->setChecked(Properties::Instance()->historyLimited); - historyUnlimited->setChecked(!Properties::Instance()->historyLimited); - historyLimitedTo->setValue(Properties::Instance()->historyLimitedTo); - - dropShowOnStartCheckBox->setChecked(Properties::Instance()->dropShowOnStart); - - dropHeightSpinBox->setValue(Properties::Instance()->dropHeight); - dropHeightSpinBox->setMaximum(100); - dropWidthSpinBox->setValue(Properties::Instance()->dropWidht); - dropWidthSpinBox->setMaximum(100); - - dropShortCutEdit->setText(Properties::Instance()->dropShortCut.toString()); - - useBookmarksCheckBox->setChecked(Properties::Instance()->useBookmarks); - bookmarksLineEdit->setText(Properties::Instance()->bookmarksFile); - openBookmarksFile(Properties::Instance()->bookmarksFile); - connect(bookmarksButton, &QPushButton::clicked, - this, &PropertiesDialog::bookmarksButton_clicked); - - terminalPresetComboBox->setCurrentIndex(Properties::Instance()->terminalsPreset); - - changeWindowTitleCheckBox->setChecked(Properties::Instance()->changeWindowTitle); - changeWindowIconCheckBox->setChecked(Properties::Instance()->changeWindowIcon); - enabledBidiSupportCheckBox->setChecked(Properties::Instance()->enabledBidiSupport); - - trimPastedTrailingNewlinesCheckBox->setChecked(Properties::Instance()->trimPastedTrailingNewlines); - confirmMultilinePasteCheckBox->setChecked(Properties::Instance()->confirmMultilinePaste); -} - - -PropertiesDialog::~PropertiesDialog() -{ -} - -void PropertiesDialog::accept() -{ - apply(); - QDialog::accept(); -} - -void PropertiesDialog::apply() -{ - Properties::Instance()->colorScheme = colorSchemaCombo->currentText(); - Properties::Instance()->font = fontSampleLabel->font();//fontComboBox->currentFont(); - Properties::Instance()->guiStyle = (styleComboBox->currentText() == tr("System Default")) ? - QString() : styleComboBox->currentText(); - - Properties::Instance()->emulation = emulationComboBox->currentText(); - - /* do not allow to go above 99 or we lose transparency option */ - (appTransparencyBox->value() >= 100) ? - Properties::Instance()->appTransparency = 99 - : - Properties::Instance()->appTransparency = appTransparencyBox->value(); - - Properties::Instance()->termTransparency = termTransparencyBox->value(); - Properties::Instance()->highlightCurrentTerminal = highlightCurrentCheckBox->isChecked(); - Properties::Instance()->showTerminalSizeHint = showTerminalSizeHintCheckBox->isChecked(); - Properties::Instance()->backgroundImage = backgroundImageLineEdit->text(); - - Properties::Instance()->askOnExit = askOnExitCheckBox->isChecked(); - - Properties::Instance()->savePosOnExit = savePosOnExitCheckBox->isChecked(); - Properties::Instance()->saveSizeOnExit = saveSizeOnExitCheckBox->isChecked(); - - Properties::Instance()->useCWD = useCwdCheckBox->isChecked(); - - Properties::Instance()->term = termComboBox->currentText(); - - Properties::Instance()->scrollBarPos = scrollBarPos_comboBox->currentIndex(); - Properties::Instance()->tabsPos = tabsPos_comboBox->currentIndex(); - Properties::Instance()->limitTabWidth = limitTabWidthCheckBox->isChecked(); - Properties::Instance()->limitTabWidthValue = limitTabWidthSpinBox->value(); - Properties::Instance()->keyboardCursorShape = keybCursorShape_comboBox->currentIndex(); - Properties::Instance()->showCloseTabButton = closeTabButtonCheckBox->isChecked(); - Properties::Instance()->hideTabBarWithOneTab = hideTabBarCheckBox->isChecked(); - Properties::Instance()->menuVisible = showMenuCheckBox->isChecked(); - Properties::Instance()->m_motionAfterPaste = motionAfterPasting_comboBox->currentIndex(); - - Properties::Instance()->historyLimited = historyLimited->isChecked(); - Properties::Instance()->historyLimitedTo = historyLimitedTo->value(); - - saveShortcuts(); - - Properties::Instance()->saveSettings(); - - Properties::Instance()->dropShowOnStart = dropShowOnStartCheckBox->isChecked(); - Properties::Instance()->dropHeight = dropHeightSpinBox->value(); - Properties::Instance()->dropWidht = dropWidthSpinBox->value(); - Properties::Instance()->dropShortCut = QKeySequence(dropShortCutEdit->text()); - - Properties::Instance()->useBookmarks = useBookmarksCheckBox->isChecked(); - Properties::Instance()->bookmarksFile = bookmarksLineEdit->text(); - saveBookmarksFile(Properties::Instance()->bookmarksFile); - - Properties::Instance()->terminalsPreset = terminalPresetComboBox->currentIndex(); - - Properties::Instance()->changeWindowTitle = changeWindowTitleCheckBox->isChecked(); - Properties::Instance()->changeWindowIcon = changeWindowIconCheckBox->isChecked(); - Properties::Instance()->enabledBidiSupport = enabledBidiSupportCheckBox->isChecked(); - - Properties::Instance()->trimPastedTrailingNewlines = trimPastedTrailingNewlinesCheckBox->isChecked(); - Properties::Instance()->confirmMultilinePaste = confirmMultilinePasteCheckBox->isChecked(); - - emit propertiesChanged(); -} - -void PropertiesDialog::setFontSample(const QFont & f) -{ - fontSampleLabel->setFont(f); - QString sample("%1 %2 pt"); - fontSampleLabel->setText(sample.arg(f.family()).arg(f.pointSize())); -} - -void PropertiesDialog::changeFontButton_clicked() -{ - FontDialog dia(fontSampleLabel->font()); - if (!dia.exec()) - return; - QFont f = dia.getFont(); - if (QFontInfo(f).fixedPitch()) - setFontSample(f); -} - -void PropertiesDialog::chooseBackgroundImageButton_clicked() -{ - QString filename = QFileDialog::getOpenFileName( - this, tr("Choose a background image"), - QString(), tr("Images (*.bmp *.png *.xpm *.jpg)")); - if (!filename.isNull()) - backgroundImageLineEdit->setText(filename); -} - -void PropertiesDialog::saveShortcuts() -{ - QMap actions = QTerminalApp::Instance()->getWindowList()[0]->leaseActions(); - QList< QString > shortcutKeys = actions.keys(); - int shortcutCount = shortcutKeys.count(); - - shortcutsWidget->setRowCount( shortcutCount ); - - for( int x=0; x < shortcutCount; x++ ) - { - QString keyValue = shortcutKeys.at(x); - QAction *keyAction = actions[keyValue]; - - QTableWidgetItem *item = shortcutsWidget->item(x, 1); - QKeySequence sequence = QKeySequence(item->text()); - QString sequenceString = sequence.toString(); - - QList shortcuts; - const auto sequences = item->text().split('|'); - for (const QKeySequence& sequenceString : sequences) - shortcuts.append(QKeySequence(sequenceString)); - keyAction->setShortcuts(shortcuts); - } - Properties::Instance()->saveSettings(); -} - -void PropertiesDialog::setupShortcuts() -{ - QMap actions = QTerminalApp::Instance()->getWindowList()[0]->leaseActions(); - QList< QString > shortcutKeys = actions.keys(); - int shortcutCount = shortcutKeys.count(); - - shortcutsWidget->setRowCount( shortcutCount ); - - for( int x=0; x < shortcutCount; x++ ) - { - QString keyValue = shortcutKeys.at(x); - QAction *keyAction = actions[keyValue]; - QStringList sequenceStrings; - - const auto shortcuts = keyAction->shortcuts(); - for (const QKeySequence &shortcut : shortcuts) - sequenceStrings.append(shortcut.toString()); - - QTableWidgetItem *itemName = new QTableWidgetItem( tr(keyValue.toStdString().c_str()) ); - QTableWidgetItem *itemShortcut = new QTableWidgetItem( sequenceStrings.join('|') ); - - itemName->setFlags( itemName->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable ); - - shortcutsWidget->setItem(x, 0, itemName); - shortcutsWidget->setItem(x, 1, itemShortcut); - } - - shortcutsWidget->resizeColumnsToContents(); - - // No shortcut validation is needed with QKeySequenceEdit. -} - -void PropertiesDialog::bookmarksButton_clicked() -{ - QFileDialog dia(this, tr("Open or create bookmarks file")); - dia.setConfirmOverwrite(false); - dia.setFileMode(QFileDialog::AnyFile); - if (!dia.exec()) - return; - - QString fname = dia.selectedFiles().count() ? dia.selectedFiles().at(0) : QString(); - if (fname.isNull()) - return; - - bookmarksLineEdit->setText(fname); - openBookmarksFile(bookmarksLineEdit->text()); -} - -void PropertiesDialog::openBookmarksFile(const QString &fname) -{ - QFile f(fname); - QString content; - if (!f.open(QFile::ReadOnly)) - content = "\n \n \n \n"; - else - content = f.readAll(); - - bookmarkPlainEdit->setPlainText(content); - bookmarkPlainEdit->document()->setModified(false); -} - -void PropertiesDialog::saveBookmarksFile(const QString &fname) -{ - if (!bookmarkPlainEdit->document()->isModified()) - return; - - QFile f(fname); - if (!f.open(QFile::WriteOnly|QFile::Truncate)) - qDebug() << "Cannot write to file" << f.fileName(); - else - f.write(bookmarkPlainEdit->toPlainText().toUtf8()); -} - -/* -void PropertiesDialog::setupShortcuts() -{ - QList< QString > shortcutKeys = Properties::Instance()->shortcuts.keys(); - int shortcutCount = shortcutKeys.count(); - - shortcutsWidget->setRowCount( shortcutCount ); - - for( int x=0; x < shortcutCount; x++ ) - { - QString keyValue = shortcutKeys.at(x); - - QLabel *lblShortcut = new QLabel( keyValue, this ); - QPushButton *btnLaunch = new QPushButton( Properties::Instance()->shortcuts.value( keyValue ), this ); - - btnLaunch->setObjectName(keyValue); - connect( btnLaunch, SIGNAL(clicked()), this, SLOT(shortcutPrompt()) ); - - shortcutsWidget->setCellWidget( x, 0, lblShortcut ); - shortcutsWidget->setCellWidget( x, 1, btnLaunch ); - } -} - -void PropertiesDialog::shortcutPrompt() -{ - QObject *objectSender = sender(); - - if( !objectSender ) - return; - - QString name = objectSender->objectName(); - qDebug() << "shortcutPrompt(" << name << ")"; - - DialogShortcut *dlgShortcut = new DialogShortcut(this); - dlgShortcut->setTitle( tr("Select a key sequence for %1").arg(name) ); - - QString sequenceString = Properties::Instance()->shortcuts[name]; - dlgShortcut->setKey(sequenceString); - - int result = dlgShortcut->exec(); - if( result == QDialog::Accepted ) - { - sequenceString = dlgShortcut->getKey(); - Properties::Instance()->shortcuts[name] = sequenceString; - Properties::Instance()->saveSettings(); - } -} -*/ diff --git a/src/propertiesdialog.h b/src/propertiesdialog.h deleted file mode 100644 index 0ab78b9..0000000 --- a/src/propertiesdialog.h +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef PROPERTIESDIALOG_H -#define PROPERTIESDIALOG_H - -#include -#include "ui_propertiesdialog.h" - -class Delegate : public QStyledItemDelegate -{ - Q_OBJECT - -public: - Delegate (QObject *parent = 0); - - virtual QWidget* createEditor(QWidget *parent, - const QStyleOptionViewItem&, - const QModelIndex&) const; - virtual bool eventFilter(QObject *object, QEvent *event); -}; - -class PropertiesDialog : public QDialog, Ui::PropertiesDialog -{ - Q_OBJECT - - QString oldAccelText; // Placeholder when editing shortcut - - public: - PropertiesDialog(QWidget *parent=NULL); - ~PropertiesDialog(); - - signals: - void propertiesChanged(); - - private: - void setFontSample(const QFont & f); - void openBookmarksFile(const QString &fname); - void saveBookmarksFile(const QString &fname); - - private slots: - void apply(); - void accept(); - - void changeFontButton_clicked(); - void chooseBackgroundImageButton_clicked(); - void bookmarksButton_clicked(); - - protected: - void setupShortcuts(); - void saveShortcuts(); -}; - - -#endif - diff --git a/src/qterminalapp.h b/src/qterminalapp.h deleted file mode 100644 index 9cf952b..0000000 --- a/src/qterminalapp.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef QTERMINALAPP_H -#define QTERMINALAPP_H - -#include -#ifdef HAVE_QDBUS - #include -#endif - - -#include "mainwindow.h" - - -class QTerminalApp : public QApplication -{ -Q_OBJECT - -public: - MainWindow *newWindow(bool dropMode, TerminalConfig &cfg); - QList getWindowList(); - void addWindow(MainWindow *window); - void removeWindow(MainWindow *window); - static QTerminalApp *Instance(int &argc, char **argv); - static QTerminalApp *Instance(); - QString &getWorkingDirectory(); - void setWorkingDirectory(const QString &wd); - - #ifdef HAVE_QDBUS - void registerOnDbus(); - QList getWindows(); - QDBusObjectPath newWindow(const QHash &termArgs); - QDBusObjectPath getActiveWindow(); - bool isDropMode(); - bool toggleDropdown(); - #endif - - static void cleanup(); - -private: - QString m_workDir; - QList m_windowList; - static QTerminalApp *m_instance; - QTerminalApp(int &argc, char **argv); - ~QTerminalApp(){}; -}; - -template T* findParent(QObject *child) -{ - QObject *maybeT = child; - while (true) - { - if (maybeT == NULL) - { - return NULL; - } - T *holder = qobject_cast(maybeT); - if (holder) - return holder; - maybeT = maybeT->parent(); - } -} - -#endif \ No newline at end of file diff --git a/src/tabbar.cpp b/src/tabbar.cpp deleted file mode 100644 index 2dc4945..0000000 --- a/src/tabbar.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2017 by Nathan Osman * - * nathan@quickmediasolutions.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "tabbar.h" - -TabBar::TabBar(QWidget *parent) - : QTabBar(parent), - mLimitWidth(false), - mLimitWidthValue(0) -{ - // To make the selected tab text bold, first give a bold font to the tabbar - // for QStyle::sizeFromContents(QStyle::CT_TabBarTab, ...) to make room - // for the bold text, and then, set the non-selected tab text to normal. - QFont f = font(); - f.setBold(true); - setFont(f); - setStyleSheet("QTabBar::tab:!selected { font-weight: normal; }"); -} - -void TabBar::setLimitWidth(bool limitWidth) -{ - mLimitWidth = limitWidth; -} - -void TabBar::setLimitWidthValue(int value) -{ - mLimitWidthValue = value; -} - -void TabBar::updateWidth() -{ - // This seems to be the only way to trigger an update - setIconSize(iconSize()); - setElideMode(Qt::ElideMiddle); -} - -QSize TabBar::tabSizeHint(int index) const -{ - QSize size = QTabBar::tabSizeHint(index); - - // If the width is limited, use that for the width hint - if (mLimitWidth) { - if (shape() == QTabBar::RoundedEast || shape() == QTabBar::TriangularEast - || shape() == QTabBar::RoundedWest || shape() == QTabBar::TriangularWest) { - size.setHeight(mLimitWidthValue); - } - else { - size.setWidth(mLimitWidthValue); - } - } - - return size; -} diff --git a/src/tabbar.h b/src/tabbar.h deleted file mode 100644 index 91567e7..0000000 --- a/src/tabbar.h +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2017 by Nathan Osman * - * nathan@quickmediasolutions.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TABBAR_H -#define TABBAR_H - -#include -#include - -class TabBar : public QTabBar -{ - Q_OBJECT - -public: - - explicit TabBar(QWidget *parent); - - void setLimitWidth(bool limitWidth); - void setLimitWidthValue(int value); - void updateWidth(); - -protected: - - virtual QSize tabSizeHint(int index) const; - -private: - - bool mLimitWidth; - int mLimitWidthValue; -}; - -#endif // TABBAR_H diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp deleted file mode 100644 index b71283d..0000000 --- a/src/tabwidget.cpp +++ /dev/null @@ -1,511 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Vladimir Kuznetsov * - * vovanec@gmail.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include -#include -#include -#include -#include - -#include "mainwindow.h" -#include "termwidgetholder.h" -#include "tabbar.h" -#include "tabwidget.h" -#include "config.h" -#include "properties.h" -#include "qterminalapp.h" - - -#define TAB_INDEX_PROPERTY "tab_index" -#define TAB_CUSTOM_NAME_PROPERTY "custom_name" - - -TabWidget::TabWidget(QWidget* parent) : QTabWidget(parent), tabNumerator(0), mTabBar(new TabBar(this)) -{ - // Insert our own tab bar which overrides tab width and eliding - setTabBar(mTabBar); - - setFocusPolicy(Qt::NoFocus); - - /* On Mac OS X this will look similar to - * the tabs in Safari or Leopard's Terminal.app . - * I love this! - */ - setDocumentMode(true); - - tabBar()->setUsesScrollButtons(true); - - setMovable(true); - setUsesScrollButtons(true); - - tabBar()->installEventFilter(this); - - connect(this, &TabWidget::tabCloseRequested, this, &TabWidget::removeTab); - connect(tabBar(), &QTabBar::tabMoved, this, &TabWidget::updateTabIndices); - connect(this, &TabWidget::tabRenameRequested, this, &TabWidget::renameSession); - connect(this, &TabWidget::tabTitleColorChangeRequested, this, &TabWidget::setTitleColor); -} - -TermWidgetHolder * TabWidget::terminalHolder() -{ - return reinterpret_cast(widget(currentIndex())); -} - - -int TabWidget::addNewTab(TerminalConfig config) -{ - tabNumerator++; - QString label = QString(tr("Shell No. %1")).arg(tabNumerator); - - TermWidgetHolder *ch = terminalHolder(); - if (ch) - config.provideCurrentDirectory(ch->currentTerminal()->impl()->workingDirectory()); - - TermWidgetHolder *console = new TermWidgetHolder(config, this); - console->setWindowTitle(label); - connect(console, &TermWidgetHolder::finished, this, &TabWidget::removeFinished); - connect(console, &TermWidgetHolder::lastTerminalClosed, this, &TabWidget::removeFinished); - connect(console, &TermWidgetHolder::termTitleChanged, this, &TabWidget::onTermTitleChanged); - connect(this, &QTabWidget::currentChanged, this, &TabWidget::currentTitleChanged); - - int index = addTab(console, label); - console->setProperty(TAB_CUSTOM_NAME_PROPERTY, false); - updateTabIndices(); - setCurrentIndex(index); - console->setInitialFocus(); - - showHideTabBar(); - - return index; -} - -void TabWidget::switchLeftSubterminal() -{ - terminalHolder()->directionalNavigation(NavigationDirection::Left); -} - -void TabWidget::switchRightSubterminal() -{ - terminalHolder()->directionalNavigation(NavigationDirection::Right); -} - -void TabWidget::switchTopSubterminal() { - terminalHolder()->directionalNavigation(NavigationDirection::Top); -} - -void TabWidget::switchBottomSubterminal() { - terminalHolder()->directionalNavigation(NavigationDirection::Bottom); -} - -void TabWidget::splitHorizontally() -{ - terminalHolder()->splitHorizontal(terminalHolder()->currentTerminal()); - findParent(this)->updateDisabledActions(); -} - -void TabWidget::splitVertically() -{ - terminalHolder()->splitVertical(terminalHolder()->currentTerminal()); - findParent(this)->updateDisabledActions(); -} - -void TabWidget::splitCollapse() -{ - terminalHolder()->splitCollapse(terminalHolder()->currentTerminal()); - findParent(this)->updateDisabledActions(); -} - -void TabWidget::copySelection() -{ - terminalHolder()->currentTerminal()->impl()->copyClipboard(); -} - -void TabWidget::pasteClipboard() -{ - terminalHolder()->currentTerminal()->impl()->pasteClipboard(); -} - -void TabWidget::pasteSelection() -{ - terminalHolder()->currentTerminal()->impl()->pasteSelection(); -} - -void TabWidget::zoomIn() -{ - terminalHolder()->currentTerminal()->impl()->zoomIn(); -} - -void TabWidget::zoomOut() -{ - terminalHolder()->currentTerminal()->impl()->zoomOut(); -} - -void TabWidget::zoomReset() -{ - terminalHolder()->currentTerminal()->impl()->zoomReset(); -} - -void TabWidget::updateTabIndices() -{ - for(int i = 0; i < count(); i++) - widget(i)->setProperty(TAB_INDEX_PROPERTY, i); -} - -void TabWidget::onTermTitleChanged(QString title, QString icon) -{ - TermWidgetHolder * console = qobject_cast(sender()); - const bool custom_name = console->property(TAB_CUSTOM_NAME_PROPERTY).toBool(); - if (!custom_name) - { - const int index = console->property(TAB_INDEX_PROPERTY).toInt(); - - setTabIcon(index, QIcon::fromTheme(icon)); - setTabText(index, title); - if (currentIndex() == index) - emit currentTitleChanged(index); - } -} - -void TabWidget::renameSession(int index) -{ - bool ok = false; - QString text = QInputDialog::getText(this, tr("Tab name"), - tr("New tab name:"), QLineEdit::Normal, - QString(), &ok); - if(ok && !text.isEmpty()) - { - setTabIcon(index, QIcon{}); - setTabText(index, text); - widget(index)->setProperty(TAB_CUSTOM_NAME_PROPERTY, true); - if (currentIndex() == index) - emit currentTitleChanged(index); - } -} - -void TabWidget::renameCurrentSession() -{ - renameSession(currentIndex()); -} - -void TabWidget::setTitleColor(int index) -{ - QColor current = tabBar()->tabTextColor(index); - QColor color = QColorDialog::getColor(current, this, tr("Select new tab title color")); - - if (color.isValid()) - tabBar()->setTabTextColor(index, color); -} - -void TabWidget::renameTabsAfterRemove() -{ -// it breaks custom names - it replaces original/custom title with shell no # -#if 0 - for(int i = 0; i < count(); i++) { - setTabText(i, QString(tr("Shell No. %1")).arg(i+1)); - } -#endif -} - -void TabWidget::contextMenuEvent(QContextMenuEvent *event) -{ - QMenu menu(this); - QMap< QString, QAction * > actions = findParent(this)->leaseActions(); - - QAction *close = menu.addAction(QIcon::fromTheme("document-close"), tr("Close session")); - QAction *rename = menu.addAction(actions[RENAME_SESSION]->text()); - QAction *changeColor = menu.addAction(QIcon::fromTheme("color-management"), tr("Change title color")); - rename->setShortcut(actions[RENAME_SESSION]->shortcut()); - rename->blockSignals(true); - - int tabIndex = tabBar()->tabAt(tabBar()->mapFrom(this,event->pos())); - QAction *action = menu.exec(event->globalPos()); - if (action == close) { - emit tabCloseRequested(tabIndex); - } else if (action == rename) { - emit tabRenameRequested(tabIndex); - } else if (action == changeColor) { - emit tabTitleColorChangeRequested(tabIndex); - } -} - -bool TabWidget::eventFilter(QObject *obj, QEvent *event) -{ - QMouseEvent *e = reinterpret_cast(event); - if (e->button() == Qt::MidButton) { - if (event->type() == QEvent::MouseButtonRelease) { - // close the tab on middle clicking - int index = tabBar()->tabAt(e->pos()); - if (index > -1){ - removeTab(index); - return true; - } - } - } - else if (event->type() == QEvent::MouseButtonDblClick) - { - // if user doubleclicks on tab button - rename it. If user - // clicks on free space - open new tab - int index = tabBar()->tabAt(e->pos()); - if (index == -1) - { - TerminalConfig defaultConfig; - addNewTab(defaultConfig); - } - else - renameSession(index); - return true; - } - return QTabWidget::eventFilter(obj, event); -} - -void TabWidget::removeFinished() -{ - QObject* term = sender(); - QVariant prop = term->property(TAB_INDEX_PROPERTY); - if(prop.isValid() && prop.canConvert(QVariant::Int)) - { - int index = prop.toInt(); - removeTab(index); -// if (count() == 0) -// emit closeTabNotification(); - } -} - -void TabWidget::removeTab(int index) -{ - if (count() > 1) { - setUpdatesEnabled(false); - - QWidget * w = widget(index); - QTabWidget::removeTab(index); - w->deleteLater(); - - updateTabIndices(); - int current = currentIndex(); - if (current >= 0 ) - { - qobject_cast(widget(current))->setInitialFocus(); - } - // do not decrease it as renaming is disabled in renameTabsAfterRemove - // tabNumerator--; - setUpdatesEnabled(true); - } else { - emit closeTabNotification(true); - } - - renameTabsAfterRemove(); - showHideTabBar(); -} - -void TabWidget::removeCurrentTab() -{ - // question disabled due user requests. Yes I agree it was anoying. -// if (QMessageBox::question(this, -// tr("Close current session"), -// tr("Are you sure you want to close current sesstion?"), -// QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) -// { - if (count() > 1) { - removeTab(currentIndex()); - } else { - emit closeTabNotification(false); - } -} - -int TabWidget::switchToRight() -{ - int next_pos = currentIndex() + 1; - if (next_pos < count()) - setCurrentIndex(next_pos); - else - setCurrentIndex(0); - findParent(this)->updateDisabledActions(); - return currentIndex(); -} - -int TabWidget::switchToLeft() -{ - int previous_pos = currentIndex() - 1; - if (previous_pos < 0) - setCurrentIndex(count() - 1); - else - setCurrentIndex(previous_pos); - findParent(this)->updateDisabledActions(); - return currentIndex(); -} - - -void TabWidget::move(Direction dir) -{ - if(count() > 1) - { - int index = currentIndex(); - QWidget* child = widget(index); - QString label = tabText(index); - QString toolTip = tabToolTip(index); - QIcon icon = tabIcon(index); - - int newIndex = 0; - if(dir == Left) - if(index == 0) - newIndex = count() -1; - else - newIndex = index - 1; - else - if(index == count() - 1) - newIndex = 0; - else - newIndex = index + 1; - - setUpdatesEnabled(false); - QTabWidget::removeTab(index); - newIndex = insertTab(newIndex, child, label); - setTabToolTip(newIndex, toolTip); - setTabIcon(newIndex, icon); - setUpdatesEnabled(true); - setCurrentIndex(newIndex); - child->setFocus(); - updateTabIndices(); - } -} - -void TabWidget::moveLeft() -{ - move(Left); -} - -void TabWidget::moveRight() -{ - move(Right); -} - -void TabWidget::changeScrollPosition(QAction *triggered) -{ - QActionGroup *scrollPosition = static_cast(sender()); - if(!scrollPosition) - qFatal("scrollPosition is NULL"); - - Properties::Instance()->scrollBarPos = - scrollPosition->actions().indexOf(triggered); - - Properties::Instance()->saveSettings(); - propertiesChanged(); - -} - -void TabWidget::changeTabPosition(QAction *triggered) -{ - QActionGroup *tabPosition = static_cast(sender()); - if(!tabPosition) - qFatal("tabPosition is NULL"); - - Properties *prop = Properties::Instance(); - /* order is dictated from mainwindow.cpp */ - QTabWidget::TabPosition position = (QTabWidget::TabPosition)tabPosition->actions().indexOf(triggered); - setTabPosition(position); - prop->tabsPos = position; - prop->saveSettings(); -} - -void TabWidget::changeKeyboardCursorShape(QAction *triggered) -{ - QActionGroup *keyboardCursorShape = static_cast(sender()); - if(!keyboardCursorShape) - qFatal("keyboardCursorShape is NULL"); - - Properties::Instance()->keyboardCursorShape = - keyboardCursorShape->actions().indexOf(triggered); - - Properties::Instance()->saveSettings(); - propertiesChanged(); -} - -void TabWidget::propertiesChanged() -{ - for (int i = 0; i < count(); ++i) - { - TermWidgetHolder *console = static_cast(widget(i)); - console->propertiesChanged(); - } - showHideTabBar(); - - setTabsClosable(Properties::Instance()->showCloseTabButton); - - // Update the tab widths - mTabBar->setLimitWidth(Properties::Instance()->limitTabWidth); - mTabBar->setLimitWidthValue(Properties::Instance()->limitTabWidthValue); - mTabBar->updateWidth(); -} - -void TabWidget::clearActiveTerminal() -{ - reinterpret_cast(widget(currentIndex()))->clearActiveTerminal(); -} - -void TabWidget::saveSession() -{ - int ix = currentIndex(); - reinterpret_cast(widget(ix))->saveSession(tabText(ix)); -} - -void TabWidget::loadSession() -{ - reinterpret_cast(widget(currentIndex()))->loadSession(); -} - -void TabWidget::preset2Horizontal() -{ - TerminalConfig defaultConfig; - int ix = TabWidget::addNewTab(defaultConfig); - TermWidgetHolder* term = reinterpret_cast(widget(ix)); - term->splitHorizontal(term->currentTerminal()); - // switch to the 1st terminal - term->directionalNavigation(NavigationDirection::Left); -} - -void TabWidget::preset2Vertical() -{ - TerminalConfig defaultConfig; - int ix = TabWidget::addNewTab(defaultConfig); - TermWidgetHolder* term = reinterpret_cast(widget(ix)); - term->splitVertical(term->currentTerminal()); - // switch to the 1st terminal - term->directionalNavigation(NavigationDirection::Left); -} - -void TabWidget::preset4Terminals() -{ - TerminalConfig defaultConfig; - int ix = TabWidget::addNewTab(defaultConfig); - TermWidgetHolder* term = reinterpret_cast(widget(ix)); - term->splitVertical(term->currentTerminal()); - term->splitHorizontal(term->currentTerminal()); - term->directionalNavigation(NavigationDirection::Left); - - term->splitHorizontal(term->currentTerminal()); - // switch to the 1st terminal - term->directionalNavigation(NavigationDirection::Top); -} - -void TabWidget::showHideTabBar() -{ - if (Properties::Instance()->tabBarless) - tabBar()->setVisible(false); - else - tabBar()->setVisible(!Properties::Instance()->hideTabBarWithOneTab || count() > 1); -} diff --git a/src/tabwidget.h b/src/tabwidget.h deleted file mode 100644 index 930d4ab..0000000 --- a/src/tabwidget.h +++ /dev/null @@ -1,121 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Vladimir Kuznetsov * - * vovanec@gmail.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TAB_WIDGET -#define TAB_WIDGET - -#include -#include -#include - -#ifdef HAVE_QDBUS - #include - #include "dbusaddressable.h" -#endif - -#include "terminalconfig.h" -#include "properties.h" - -class TabBar; -class TermWidgetHolder; -class QAction; -class QActionGroup; - - -class TabWidget : public QTabWidget -{ -Q_OBJECT -public: - TabWidget(QWidget* parent = 0); - - TermWidgetHolder * terminalHolder(); - - void showHideTabBar(); - -public slots: - int addNewTab(TerminalConfig cfg); - void removeTab(int); - void removeCurrentTab(); - int switchToRight(); - int switchToLeft(); - void removeFinished(); - void moveLeft(); - void moveRight(); - void renameSession(int); - void renameCurrentSession(); - void setTitleColor(int); - - void switchLeftSubterminal(); - void switchRightSubterminal(); - void switchTopSubterminal(); - void switchBottomSubterminal(); - - void splitHorizontally(); - void splitVertically(); - void splitCollapse(); - - void copySelection(); - void pasteClipboard(); - void pasteSelection(); - void zoomIn(); - void zoomOut(); - void zoomReset(); - - void changeTabPosition(QAction *); - void changeScrollPosition(QAction *); - void changeKeyboardCursorShape(QAction *); - void propertiesChanged(); - - void clearActiveTerminal(); - - void saveSession(); - void loadSession(); - - void preset2Horizontal(); - void preset2Vertical(); - void preset4Terminals(); - -signals: - void closeTabNotification(bool); - void tabRenameRequested(int); - void tabTitleColorChangeRequested(int); - void currentTitleChanged(int); - -protected: - enum Direction{Left = 1, Right}; - void contextMenuEvent(QContextMenuEvent * event); - void move(Direction); - /*! Event filter for TabWidget's QTabBar. It's installed on tabBar() - in the constructor. - It's purpose is to handle doubleclicks on QTabBar for session - renaming or new tab opening - */ - bool eventFilter(QObject *obj, QEvent *event); -protected slots: - void updateTabIndices(); - void onTermTitleChanged(QString title, QString icon); - -private: - int tabNumerator; - /* re-order naming of the tabs then removeCurrentTab() */ - void renameTabsAfterRemove(); - - TabBar *mTabBar; -}; - -#endif diff --git a/src/terminalconfig.cpp b/src/terminalconfig.cpp deleted file mode 100644 index ca4f679..0000000 --- a/src/terminalconfig.cpp +++ /dev/null @@ -1,105 +0,0 @@ - - -#include -#include - -#include "qterminalapp.h" -#include "terminalconfig.h" -#include "properties.h" -#include "termwidget.h" - -TerminalConfig::TerminalConfig(const QString & wdir, const QString & shell) -{ - m_workingDirectory = wdir; - m_shell = shell; -} - -TerminalConfig::TerminalConfig() -{ -} - -TerminalConfig::TerminalConfig(const TerminalConfig &cfg) - : m_currentDirectory(cfg.m_currentDirectory), - m_workingDirectory(cfg.m_workingDirectory), - m_shell(cfg.m_shell) {} - -QString TerminalConfig::getWorkingDirectory() -{ - if (!m_workingDirectory.isEmpty()) - return m_workingDirectory; - if (Properties::Instance()->useCWD && !m_currentDirectory.isEmpty()) - return m_currentDirectory; - return QTerminalApp::Instance()->getWorkingDirectory(); -} - -QString TerminalConfig::getShell() -{ - if (!m_shell.isEmpty()) - return m_shell; - if (!Properties::Instance()->shell.isEmpty()) - return Properties::Instance()->shell; - QByteArray envShell = qgetenv("SHELL"); - if (envShell.constData() != NULL) - { - QString shellString = QString(envShell); - if (!shellString.isEmpty()) - return shellString; - } - return QString(); -} - -void TerminalConfig::setWorkingDirectory(const QString &val) -{ - m_workingDirectory = val; -} - -void TerminalConfig::setShell(const QString &val) -{ - m_shell = val; -} - -void TerminalConfig::provideCurrentDirectory(const QString &val) -{ - m_currentDirectory = val; -} - - - -#if HAVE_QDBUS - -#define DBUS_ARG_WORKDIR "workingDirectory" -#define DBUS_ARG_SHELL "shell" - -TerminalConfig TerminalConfig::fromDbus(const QHash &termArgsConst, TermWidget *toSplit) -{ - QHash termArgs(termArgsConst); - if (toSplit != NULL && !termArgs.contains(DBUS_ARG_WORKDIR)) - { - termArgs[DBUS_ARG_WORKDIR] = QVariant(toSplit->impl()->workingDirectory()); - } - return TerminalConfig::fromDbus(termArgs); -} - -static QString variantToString(QVariant variant, QString &defaultVal) -{ - if (variant.type() == QVariant::String) - return qvariant_cast(variant); - return defaultVal; -} - -TerminalConfig TerminalConfig::fromDbus(const QHash &termArgs) -{ - QString wdir(""); - QString shell(Properties::Instance()->shell); - if (termArgs.contains(DBUS_ARG_WORKDIR)) - { - wdir = variantToString(termArgs[DBUS_ARG_WORKDIR], wdir); - } - if (termArgs.contains(DBUS_ARG_SHELL)) { - shell = variantToString(termArgs[DBUS_ARG_SHELL], shell); - } - return TerminalConfig(wdir, shell); -} - -#endif - diff --git a/src/terminalconfig.h b/src/terminalconfig.h deleted file mode 100644 index 5823fae..0000000 --- a/src/terminalconfig.h +++ /dev/null @@ -1,38 +0,0 @@ - -#ifndef TERMINALCONFIG_H -#define TERMINALCONFIG_H - -#include -#include -#include - -class TermWidget; - -class TerminalConfig -{ - public: - TerminalConfig(const QString & wdir, const QString & shell); - TerminalConfig(const TerminalConfig &cfg); - TerminalConfig(); - - QString getWorkingDirectory(); - QString getShell(); - - void setWorkingDirectory(const QString &val); - void setShell(const QString &val); - void provideCurrentDirectory(const QString &val); - - #ifdef HAVE_QDBUS - static TerminalConfig fromDbus(const QHash &termArgs); - static TerminalConfig fromDbus(const QHash &termArgs, TermWidget *toSplit); - #endif - - - private: - // True when - QString m_currentDirectory; - QString m_workingDirectory; - QString m_shell; -}; - -#endif \ No newline at end of file diff --git a/src/termwidget.cpp b/src/termwidget.cpp deleted file mode 100644 index d43821d..0000000 --- a/src/termwidget.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_QDBUS - #include - #include "termwidgetholder.h" - #include "terminaladaptor.h" -#endif - - -#include "mainwindow.h" -#include "termwidget.h" -#include "config.h" -#include "properties.h" -#include "qterminalapp.h" - -static int TermWidgetCount = 0; - - -TermWidgetImpl::TermWidgetImpl(TerminalConfig &cfg, QWidget * parent) - : QTermWidget(0, parent) -{ - TermWidgetCount++; - QString name("TermWidget_%1"); - setObjectName(name.arg(TermWidgetCount)); - - setFlowControlEnabled(FLOW_CONTROL_ENABLED); - setFlowControlWarningEnabled(FLOW_CONTROL_WARNING_ENABLED); - - propertiesChanged(); - - setHistorySize(5000); - - setWorkingDirectory(cfg.getWorkingDirectory()); - - QString shell = cfg.getShell(); - if (!shell.isEmpty()) - { - qDebug() << "Shell program:" << shell; - QStringList parts = shell.split(QRegExp("\\s+"), QString::SkipEmptyParts); - qDebug() << parts; - setShellProgram(parts.at(0)); - parts.removeAt(0); - if (parts.count()) - setArgs(parts); - } - - setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste); - - setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, &QWidget::customContextMenuRequested, - this, &TermWidgetImpl::customContextMenuCall); - - connect(this, &QTermWidget::urlActivated, this, &TermWidgetImpl::activateUrl); - - startShellProgram(); -} - -void TermWidgetImpl::propertiesChanged() -{ - setColorScheme(Properties::Instance()->colorScheme); - setTerminalFont(Properties::Instance()->font); - setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste); - setTerminalSizeHint(Properties::Instance()->showTerminalSizeHint); - - if (Properties::Instance()->historyLimited) - { - setHistorySize(Properties::Instance()->historyLimitedTo); - } - else - { - // Unlimited history - setHistorySize(-1); - } - - setKeyBindings(Properties::Instance()->emulation); - setTerminalOpacity(1.0 - Properties::Instance()->termTransparency/100.0); - setTerminalBackgroundImage(Properties::Instance()->backgroundImage); - setBidiEnabled(Properties::Instance()->enabledBidiSupport); - - /* be consequent with qtermwidget.h here */ - switch(Properties::Instance()->scrollBarPos) { - case 0: - setScrollBarPosition(QTermWidget::NoScrollBar); - break; - case 1: - setScrollBarPosition(QTermWidget::ScrollBarLeft); - break; - case 2: - default: - setScrollBarPosition(QTermWidget::ScrollBarRight); - break; - } - - switch(Properties::Instance()->keyboardCursorShape) { - case 1: - setKeyboardCursorShape(QTermWidget::KeyboardCursorShape::UnderlineCursor); - break; - case 2: - setKeyboardCursorShape(QTermWidget::KeyboardCursorShape::IBeamCursor); - break; - default: - case 0: - setKeyboardCursorShape(QTermWidget::KeyboardCursorShape::BlockCursor); - break; - } - - update(); -} - -void TermWidgetImpl::customContextMenuCall(const QPoint & pos) -{ - QMenu menu; - QMap actions = findParent(this)->leaseActions(); - - QList extraActions = filterActions(pos); - for (auto& action : extraActions) - { - menu.addAction(action); - } - - if (!actions.isEmpty()) - { - menu.addSeparator(); - } - - menu.addAction(actions[COPY_SELECTION]); - menu.addAction(actions[PASTE_CLIPBOARD]); - menu.addAction(actions[PASTE_SELECTION]); - menu.addAction(actions[ZOOM_IN]); - menu.addAction(actions[ZOOM_OUT]); - menu.addAction(actions[ZOOM_RESET]); - menu.addSeparator(); - menu.addAction(actions[CLEAR_TERMINAL]); - menu.addAction(actions[SPLIT_HORIZONTAL]); - menu.addAction(actions[SPLIT_VERTICAL]); - // warning TODO/FIXME: disable the action when there is only one terminal - menu.addAction(actions[SUB_COLLAPSE]); - menu.addSeparator(); - menu.addAction(actions[TOGGLE_MENU]); - menu.addAction(actions[PREFERENCES]); - menu.exec(mapToGlobal(pos)); -} - -void TermWidgetImpl::zoomIn() -{ - emit QTermWidget::zoomIn(); -// note: do not save zoom here due the #74 Zoom reset option resets font back to Monospace -// Properties::Instance()->font = getTerminalFont(); -// Properties::Instance()->saveSettings(); -} - -void TermWidgetImpl::zoomOut() -{ - emit QTermWidget::zoomOut(); -// note: do not save zoom here due the #74 Zoom reset option resets font back to Monospace -// Properties::Instance()->font = getTerminalFont(); -// Properties::Instance()->saveSettings(); -} - -void TermWidgetImpl::zoomReset() -{ -// note: do not save zoom here due the #74 Zoom reset option resets font back to Monospace -// Properties::Instance()->font = Properties::Instance()->font; - setTerminalFont(Properties::Instance()->font); -// Properties::Instance()->saveSettings(); -} - -void TermWidgetImpl::activateUrl(const QUrl & url, bool fromContextMenu) { - if (QApplication::keyboardModifiers() & Qt::ControlModifier || fromContextMenu) { - QDesktopServices::openUrl(url); - } -} - -void TermWidgetImpl::pasteSelection() -{ - paste(QClipboard::Selection); -} - -void TermWidgetImpl::pasteClipboard() -{ - paste(QClipboard::Clipboard); -} - -void TermWidgetImpl::paste(QClipboard::Mode mode) -{ - // Paste Clipboard by simulating keypress events - QString text = QApplication::clipboard()->text(mode); - if ( ! text.isEmpty() ) - { - text.replace("\r\n", "\n"); - text.replace('\n', '\r'); - QString trimmedTrailingNl(text); - trimmedTrailingNl.replace(QRegExp("\\r+$"), ""); - bool isMultiline = trimmedTrailingNl.contains('\r'); - if (!isMultiline && Properties::Instance()->trimPastedTrailingNewlines) - { - text = trimmedTrailingNl; - } - if (Properties::Instance()->confirmMultilinePaste) - { - if (text.contains('\r') && Properties::Instance()->confirmMultilinePaste) - { - QMessageBox confirmation(this); - confirmation.setWindowTitle(tr("Paste multiline text")); - confirmation.setText(tr("Are you sure you want to paste this text?")); - confirmation.setDetailedText(text); - confirmation.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - // Click "Show details..." to show those by default - const auto buttons = confirmation.buttons(); - for( QAbstractButton * btn : buttons ) - { - if (confirmation.buttonRole(btn) == QMessageBox::ActionRole && btn->text() == QMessageBox::tr("Show Details...")) - { - btn->clicked(); - break; - } - } - confirmation.setDefaultButton(QMessageBox::Yes); - confirmation.exec(); - if (confirmation.standardButton(confirmation.clickedButton()) != QMessageBox::Yes) - { - return; - } - } - } - - bracketText(text); - sendText(text); - } -} - -bool TermWidget::eventFilter(QObject * obj, QEvent * ev) -{ - if (ev->type() == QEvent::MouseButtonPress) - { - QMouseEvent *mev = (QMouseEvent *)ev; - if ( mev->button() == Qt::MidButton ) - { - impl()->pasteSelection(); - return true; - } - } - return false; -} - -TermWidget::TermWidget(TerminalConfig &cfg, QWidget * parent) - : QWidget(parent), - DBusAddressable("/terminals") -{ - - #ifdef HAVE_QDBUS - registerAdapter(this); - #endif - m_border = palette().color(QPalette::Window); - m_term = new TermWidgetImpl(cfg, this); - setFocusProxy(m_term); - - m_layout = new QVBoxLayout; - setLayout(m_layout); - - m_layout->addWidget(m_term); - const auto objs = m_term->children(); - for (QObject *o : objs) - { - // Find TerminalDisplay - if (!o->isWidgetType() || qobject_cast(o)->isHidden()) - continue; - o->installEventFilter(this); - } - - - propertiesChanged(); - - connect(m_term, &QTermWidget::finished, this, &TermWidget::finished); - connect(m_term, &QTermWidget::termGetFocus, this, &TermWidget::term_termGetFocus); - connect(m_term, &QTermWidget::termLostFocus, this, &TermWidget::term_termLostFocus); - connect(m_term, &QTermWidget::titleChanged, this, [this] { emit termTitleChanged(m_term->title(), m_term->icon()); }); -} - -void TermWidget::propertiesChanged() -{ - if (Properties::Instance()->highlightCurrentTerminal) - m_layout->setContentsMargins(2, 2, 2, 2); - else - m_layout->setContentsMargins(0, 0, 0, 0); - - m_term->propertiesChanged(); -} - -void TermWidget::term_termGetFocus() -{ - m_border = palette().color(QPalette::Highlight); - emit termGetFocus(this); - update(); -} - -void TermWidget::term_termLostFocus() -{ - m_border = palette().color(QPalette::Window); - update(); -} - -void TermWidget::paintEvent (QPaintEvent *) -{ - if (Properties::Instance()->highlightCurrentTerminal) - { - QPainter p(this); - QPen pen(m_border); - pen.setWidth(3); - pen.setBrush(m_border); - p.setPen(pen); - p.drawRect(0, 0, width()-1, height()-1); - } -} - -#if HAVE_QDBUS - -QDBusObjectPath TermWidget::splitHorizontal(const QHash &termArgs) -{ - TermWidgetHolder *holder = findParent(this); - assert(holder != NULL); - TerminalConfig cfg = TerminalConfig::fromDbus(termArgs, this); - return holder->split(this, Qt::Horizontal, cfg)->getDbusPath(); -} - -QDBusObjectPath TermWidget::splitVertical(const QHash &termArgs) -{ - TermWidgetHolder *holder = findParent(this); - assert(holder != NULL); - TerminalConfig cfg = TerminalConfig::fromDbus(termArgs, this); - return holder->split(this, Qt::Vertical, cfg)->getDbusPath(); -} - -QDBusObjectPath TermWidget::getTab() -{ - return findParent(this)->getDbusPath(); -} - -void TermWidget::closeTerminal() -{ - TermWidgetHolder *holder = findParent(this); - holder->splitCollapse(this); -} - -void TermWidget::sendText(const QString text) -{ - if (impl()) - { - impl()->sendText(text); - } -} - -#endif diff --git a/src/termwidget.h b/src/termwidget.h deleted file mode 100644 index e7cb550..0000000 --- a/src/termwidget.h +++ /dev/null @@ -1,104 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TERMWIDGET_H -#define TERMWIDGET_H - -#include -#include "terminalconfig.h" - -#include -#include -#include "dbusaddressable.h" - -class TermWidgetImpl : public QTermWidget -{ - Q_OBJECT - -// QMap< QString, QAction * > actionMap; - - public: - - TermWidgetImpl(TerminalConfig &cfg, QWidget * parent=0); - void propertiesChanged(); - void paste(QClipboard::Mode mode); - - signals: - void renameSession(); - void removeCurrentSession(); - - public slots: - void zoomIn(); - void zoomOut(); - void zoomReset(); - void pasteSelection(); - void pasteClipboard(); - - private slots: - void customContextMenuCall(const QPoint & pos); - void activateUrl(const QUrl& url, bool fromContextMenu); -}; - - -class TermWidget : public QWidget, public DBusAddressable -{ - Q_OBJECT - - TermWidgetImpl * m_term; - QVBoxLayout * m_layout; - QColor m_border; - - public: - TermWidget(TerminalConfig &cfg, QWidget * parent=0); - - void propertiesChanged(); - QStringList availableKeyBindings() { return m_term->availableKeyBindings(); } - - TermWidgetImpl * impl() { return m_term; } - - #ifdef HAVE_QDBUS - QDBusObjectPath splitHorizontal(const QHash &termArgs); - QDBusObjectPath splitVertical(const QHash &termArgs); - QDBusObjectPath getTab(); - void sendText(const QString text); - void closeTerminal(); - #endif - - signals: - void finished(); - void renameSession(); - void removeCurrentSession(); - void splitHorizontal(TermWidget * self); - void splitVertical(TermWidget * self); - void splitCollapse(TermWidget * self); - void termGetFocus(TermWidget * self); - void termTitleChanged(QString titleText, QString icon); - - public slots: - - protected: - void paintEvent (QPaintEvent * event); - bool eventFilter(QObject * obj, QEvent * evt) override; - - private slots: - void term_termGetFocus(); - void term_termLostFocus(); -}; - -#endif - diff --git a/src/termwidgetholder.cpp b/src/termwidgetholder.cpp deleted file mode 100644 index 5fa6116..0000000 --- a/src/termwidgetholder.cpp +++ /dev/null @@ -1,449 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include -#include -#include - -#ifdef HAVE_QDBUS - #include - #include "tabadaptor.h" -#endif - -#include "qterminalapp.h" -#include "mainwindow.h" -#include "termwidgetholder.h" -#include "termwidget.h" -#include "properties.h" -#include -#include -#include - - -TermWidgetHolder::TermWidgetHolder(TerminalConfig &config, QWidget * parent) - : QWidget(parent) - #ifdef HAVE_QDBUS - , DBusAddressable("/tabs") - #endif -{ - #ifdef HAVE_QDBUS - new TabAdaptor(this); - QDBusConnection::sessionBus().registerObject(getDbusPathString(), this); - #endif - setFocusPolicy(Qt::NoFocus); - QGridLayout * lay = new QGridLayout(this); - lay->setSpacing(0); - lay->setContentsMargins(0, 0, 0, 0); - - QSplitter *s = new QSplitter(this); - s->setFocusPolicy(Qt::NoFocus); - TermWidget *w = newTerm(config); - s->addWidget(w); - lay->addWidget(s); - m_currentTerm = w; - - setLayout(lay); -} - -TermWidgetHolder::~TermWidgetHolder() -{ -} - -void TermWidgetHolder::setInitialFocus() -{ - QList list = findChildren(); - TermWidget * w = list.count() == 0 ? 0 : list.at(0); - if (w) - w->setFocus(Qt::OtherFocusReason); -} - -void TermWidgetHolder::loadSession() -{ - bool ok; - QString name = QInputDialog::getItem(this, tr("Load Session"), - tr("List of saved sessions:"), - Properties::Instance()->sessions.keys(), - 0, false, &ok); - if (!ok || name.isEmpty()) - return; -#if 0 - foreach (QWidget * w, findChildren()) - { - if (w) - { - delete w; - w = 0; - } - } - - qDebug() << "load" << name << QString(Properties::Instance()->sessions[name]); - QStringList splitters = QString(Properties::Instance()->sessions[name]).split("|", QString::SkipEmptyParts); - foreach (QString splitter, splitters) - { - QStringList components = splitter.split(","); - qDebug() << "comp" << components; - // orientation - Qt::Orientation orientation; - if (components.size() > 0) - orientation = components.takeAt(0).toInt(); - // sizes - QList sizes; - QList widgets; - foreach (QString s, components) - { - sizes << s.toInt(); - widgets << newTerm(); - } - // new terms - } -#endif -} - -void TermWidgetHolder::saveSession(const QString & name) -{ - Session dump; - QString num("%1"); - const auto ws = findChildren(); - for(QSplitter *w : ws) - { - dump += '|' + num.arg(w->orientation()); - const auto sizes = w->sizes(); - for (const int i : sizes) - dump += ',' + num.arg(i); - } - Properties::Instance()->sessions[name] = dump; - qDebug() << "dump" << dump; -} - -TermWidget* TermWidgetHolder::currentTerminal() -{ - return m_currentTerm; -} - -void TermWidgetHolder::setWDir(const QString & wdir) -{ - m_wdir = wdir; -} - -typedef struct { - QPoint topLeft; - QPoint middle; - QPoint bottomRight; -} NavigationData; - -static void transpose(QPoint *point) { - int x = point->x(); - point->setX(point->y()); - point->setY(x); -} - -static void transposeTransform(NavigationData *point) { - transpose(&point->topLeft); - transpose(&point->middle); - transpose(&point->bottomRight); -} - -static void flipTransform(NavigationData *point) { - QPoint oldTopLeft = point->topLeft; - point->topLeft = -(point->bottomRight); - point->bottomRight = -(oldTopLeft); - point->middle = -(point->middle); -} - -static void normalizeToRight(NavigationData *point, NavigationDirection dir) { - switch (dir) { - case Left: - flipTransform(point); - break; - case Right: - // No-op - break; - case Top: - flipTransform(point); - transposeTransform(point); - break; - case Bottom: - transposeTransform(point); - break; - default: - assert("Invalid navigation"); - return; - } -} - -static NavigationData getNormalizedDimensions(QWidget *w, NavigationDirection dir) { - NavigationData nd; - nd.topLeft = w->mapTo(w->window(), QPoint(0, 0)); - nd.middle = w->mapTo(w->window(), QPoint(w->width() / 2, w->height() / 2)); - nd.bottomRight = w->mapTo(w->window(), QPoint(w->width(), w->height())); - normalizeToRight(&nd, dir); - return nd; -} - - -void TermWidgetHolder::directionalNavigation(NavigationDirection dir) { - // Find an active widget - QList l = findChildren(); - int ix = -1; - for (TermWidget * w : qAsConst(l)) - { - ++ix; - if (w->impl()->hasFocus()) - { - break; - } - } - if (ix > l.count()) - { - l.at(0)->impl()->setFocus(Qt::OtherFocusReason); - return; - } - - // Found an active widget - TermWidget *w = l.at(ix); - NavigationData from = getNormalizedDimensions(w, dir); - - // Search parent that contains point of interest (right edge middlepoint) - QPoint poi = QPoint(from.bottomRight.x(), from.middle.y()); - - // Perform a search for a TermWidget, where x() is strictly higher than - // poi.x(), y() is strictly less than poi.y(), and prioritizing, in order, - // lower x(), and lower distance between poi.y() and corners. - - // Only "Right navigation" implementation is necessary -- other cases - // are normalized to this one. - - l = findChildren(); - int lowestX = INT_MAX; - int lowestMidpointDistance = INT_MAX; - TermWidget *fittest = NULL; - for (TermWidget * w : qAsConst(l)) - { - NavigationData contenderDims = getNormalizedDimensions(w, dir); - int midpointDistance = std::min( - abs(poi.y() - contenderDims.topLeft.y()), - abs(poi.y() - contenderDims.bottomRight.y()) - ); - if (contenderDims.topLeft.x() > poi.x()) - { - if (contenderDims.topLeft.x() > lowestX) - continue; - if (midpointDistance > lowestMidpointDistance) - continue; - lowestX = contenderDims.topLeft.x(); - lowestMidpointDistance = midpointDistance; - fittest = w; - } - } - if (fittest != NULL) { - fittest->impl()->setFocus(Qt::OtherFocusReason); - } -} - -void TermWidgetHolder::clearActiveTerminal() -{ - currentTerminal()->impl()->clear(); -} - -void TermWidgetHolder::propertiesChanged() -{ - const auto ws = findChildren(); - for(TermWidget *w : ws) - w->propertiesChanged(); -} - -void TermWidgetHolder::splitHorizontal(TermWidget * term) -{ - TerminalConfig defaultConfig; - split(term, Qt::Vertical, defaultConfig); -} - -void TermWidgetHolder::splitVertical(TermWidget * term) -{ - TerminalConfig defaultConfig; - split(term, Qt::Horizontal, defaultConfig); -} - -void TermWidgetHolder::splitCollapse(TermWidget * term) -{ - QSplitter * parent = qobject_cast(term->parent()); - assert(parent); - term->setParent(0); - delete term; - - QWidget *nextFocus = Q_NULLPTR; - - // Collapse splitters containing a single element, excluding the top one. - if (parent->count() == 1) - { - QSplitter *uselessSplitterParent = qobject_cast(parent->parent()); - if (uselessSplitterParent != Q_NULLPTR) { - int idx = uselessSplitterParent->indexOf(parent); - assert(idx != -1); - QWidget *singleHeir = parent->widget(0); - uselessSplitterParent->insertWidget(idx, singleHeir); - if (qobject_cast(singleHeir)) - { - nextFocus = singleHeir; - } - else - { - nextFocus = singleHeir->findChild(); - } - parent->setParent(0); - delete parent; - // Make sure there's no access to the removed parent - parent = uselessSplitterParent; - } - } - - if (parent->count() > 0) - { - if (nextFocus) - { - nextFocus->setFocus(Qt::OtherFocusReason); - } - else - { - parent->widget(0)->setFocus(Qt::OtherFocusReason); - } - parent->update(); - } - else - emit finished(); -} - -TermWidget * TermWidgetHolder::split(TermWidget *term, Qt::Orientation orientation, TerminalConfig cfg) -{ - QSplitter *parent = qobject_cast(term->parent()); - assert(parent); - - int ix = parent->indexOf(term); - QList parentSizes = parent->sizes(); - - QList sizes; - sizes << 1 << 1; - - QSplitter *s = new QSplitter(orientation, this); - s->setFocusPolicy(Qt::NoFocus); - s->insertWidget(0, term); - - cfg.provideCurrentDirectory(term->impl()->workingDirectory()); - - TermWidget * w = newTerm(cfg); - s->insertWidget(1, w); - s->setSizes(sizes); - - parent->insertWidget(ix, s); - parent->setSizes(parentSizes); - - w->setFocus(Qt::OtherFocusReason); - return w; -} - -TermWidget *TermWidgetHolder::newTerm(TerminalConfig &cfg) -{ - TermWidget *w = new TermWidget(cfg, this); - // proxy signals - connect(w, &TermWidget::renameSession, this, &TermWidgetHolder::renameSession); - connect(w, &TermWidget::removeCurrentSession, this, &TermWidgetHolder::lastTerminalClosed); - connect(w, &TermWidget::finished, this, &TermWidgetHolder::handle_finished); - // consume signals - - connect(w, static_cast(&TermWidget::splitHorizontal), - this, &TermWidgetHolder::splitHorizontal); - connect(w, static_cast(&TermWidget::splitVertical), - this, &TermWidgetHolder::splitVertical); - connect(w, &TermWidget::splitCollapse, this, &TermWidgetHolder::splitCollapse); - connect(w, &TermWidget::termGetFocus, this, &TermWidgetHolder::setCurrentTerminal); - connect(w, &TermWidget::termTitleChanged, this, &TermWidgetHolder::onTermTitleChanged); - - return w; -} - -void TermWidgetHolder::setCurrentTerminal(TermWidget* term) -{ - TermWidget * old_current = m_currentTerm; - m_currentTerm = term; - if (old_current != m_currentTerm) - { - if (m_currentTerm->impl()->isTitleChanged()) - { - emit termTitleChanged(m_currentTerm->impl()->title(), m_currentTerm->impl()->icon()); - } else - { - emit termTitleChanged(windowTitle(), QString{}); - } - } -} - -void TermWidgetHolder::handle_finished() -{ - TermWidget * w = qobject_cast(sender()); - if (!w) - { - qDebug() << "TermWidgetHolder::handle_finished: Unknown object to handle" << w; - assert(0); - } - splitCollapse(w); -} - -void TermWidgetHolder::onTermTitleChanged(QString title, QString icon) const -{ - TermWidget * term = qobject_cast(sender()); - if (m_currentTerm == term) - emit termTitleChanged(title, icon); -} - -#ifdef HAVE_QDBUS - -QDBusObjectPath TermWidgetHolder::getActiveTerminal() -{ - if (m_currentTerm != NULL) - { - return m_currentTerm->getDbusPath(); - } - return QDBusObjectPath(); -} - -QList TermWidgetHolder::getTerminals() -{ - QList terminals; - const auto ws = findChildren(); - for (TermWidget* w : ws) - { - terminals.push_back(w->getDbusPath()); - } - return terminals; -} - -QDBusObjectPath TermWidgetHolder::getWindow() -{ - return findParent(this)->getDbusPath(); -} - -void TermWidgetHolder::closeTab() -{ - QTabWidget *parent = findParent(this); - int idx = parent->indexOf(this); - assert(idx != -1); - parent->tabCloseRequested(idx); -} - -#endif - diff --git a/src/termwidgetholder.h b/src/termwidgetholder.h deleted file mode 100644 index 23bc881..0000000 --- a/src/termwidgetholder.h +++ /dev/null @@ -1,105 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Petr Vanek * - * petr@scribus.info * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TERMWIDGETHOLDER_H -#define TERMWIDGETHOLDER_H - -#include -#include "termwidget.h" -#include "terminalconfig.h" -#include "dbusaddressable.h" -class QSplitter; - - - -typedef enum NavigationDirection { - Left, - Right, - Top, - Bottom -} NavigationDirection; - - -/*! \brief TermWidget group/session manager. - -This widget (one per TabWidget tab) is a "proxy" widget beetween TabWidget and -unspecified count of TermWidgets. Basically it should look like a single TermWidget -for TabWidget - with its signals and slots. - -Splitting and collapsing of TermWidgets is done here. -*/ -class TermWidgetHolder : public QWidget -#ifdef HAVE_QDBUS - , public DBusAddressable -#endif -{ - Q_OBJECT - - public: - TermWidgetHolder(TerminalConfig &cfg, QWidget * parent=0); - ~TermWidgetHolder(); - - void propertiesChanged(); - void setInitialFocus(); - - void loadSession(); - void saveSession(const QString & name); - void zoomIn(uint step); - void zoomOut(uint step); - - TermWidget* currentTerminal(); - TermWidget* split(TermWidget * term, Qt::Orientation orientation, TerminalConfig cfg); - - #ifdef HAVE_QDBUS - QDBusObjectPath getActiveTerminal(); - QList getTerminals(); - QDBusObjectPath getWindow(); - void closeTab(); - #endif - - - public slots: - void splitHorizontal(TermWidget * term); - void splitVertical(TermWidget * term); - void splitCollapse(TermWidget * term); - void setWDir(const QString & wdir); - void directionalNavigation(NavigationDirection dir); - void clearActiveTerminal(); - void onTermTitleChanged(QString title, QString icon) const; - - signals: - void finished(); - void lastTerminalClosed(); - void renameSession(); - void termTitleChanged(QString title, QString icon) const; - - private: - QString m_wdir; - QString m_shell; - TermWidget * m_currentTerm; - - void split(TermWidget * term, Qt::Orientation orientation); - TermWidget * newTerm(TerminalConfig &cfg); - - private slots: - void setCurrentTerminal(TermWidget* term); - void handle_finished(); -}; - -#endif - diff --git a/src/third-party/qxtglobal.h b/src/third-party/qxtglobal.h deleted file mode 100644 index 7d5abfb..0000000 --- a/src/third-party/qxtglobal.h +++ /dev/null @@ -1,233 +0,0 @@ - -/**************************************************************************** -** Copyright (c) 2006 - 2011, the LibQxt project. -** See the Qxt AUTHORS file for a list of authors and copyright holders. -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** * Neither the name of the LibQxt project nor the -** names of its contributors may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -** -*****************************************************************************/ - -#ifndef QXTGLOBAL_H -#define QXTGLOBAL_H - -#include - -#define QXT_VERSION 0x000700 -#define QXT_VERSION_STR "0.7.0" - -//--------------------------global macros------------------------------ - -#ifndef QXT_NO_MACROS - -#ifndef _countof -#define _countof(x) (sizeof(x)/sizeof(*x)) -#endif - -#endif // QXT_NO_MACROS - -//--------------------------export macros------------------------------ - -#define QXT_DLLEXPORT DO_NOT_USE_THIS_ANYMORE - -#if !defined(QXT_STATIC) && !defined(QXT_DOXYGEN_RUN) -# if defined(BUILD_QXT_CORE) -# define QXT_CORE_EXPORT Q_DECL_EXPORT -# else -# define QXT_CORE_EXPORT Q_DECL_IMPORT -# endif -#else -# define QXT_CORE_EXPORT -#endif // BUILD_QXT_CORE - -#if !defined(QXT_STATIC) && !defined(QXT_DOXYGEN_RUN) -# if defined(BUILD_QXT_GUI) -# define QXT_GUI_EXPORT Q_DECL_EXPORT -# else -# define QXT_GUI_EXPORT Q_DECL_IMPORT -# endif -#else -# define QXT_GUI_EXPORT -#endif // BUILD_QXT_GUI - -#if !defined(QXT_STATIC) && !defined(QXT_DOXYGEN_RUN) -# if defined(BUILD_QXT_NETWORK) -# define QXT_NETWORK_EXPORT Q_DECL_EXPORT -# else -# define QXT_NETWORK_EXPORT Q_DECL_IMPORT -# endif -#else -# define QXT_NETWORK_EXPORT -#endif // BUILD_QXT_NETWORK - -#if !defined(QXT_STATIC) && !defined(QXT_DOXYGEN_RUN) -# if defined(BUILD_QXT_SQL) -# define QXT_SQL_EXPORT Q_DECL_EXPORT -# else -# define QXT_SQL_EXPORT Q_DECL_IMPORT -# endif -#else -# define QXT_SQL_EXPORT -#endif // BUILD_QXT_SQL - -#if !defined(QXT_STATIC) && !defined(QXT_DOXYGEN_RUN) -# if defined(BUILD_QXT_WEB) -# define QXT_WEB_EXPORT Q_DECL_EXPORT -# else -# define QXT_WEB_EXPORT Q_DECL_IMPORT -# endif -#else -# define QXT_WEB_EXPORT -#endif // BUILD_QXT_WEB - -#if !defined(QXT_STATIC) && !defined(QXT_DOXYGEN_RUN) -# if defined(BUILD_QXT_BERKELEY) -# define QXT_BERKELEY_EXPORT Q_DECL_EXPORT -# else -# define QXT_BERKELEY_EXPORT Q_DECL_IMPORT -# endif -#else -# define QXT_BERKELEY_EXPORT -#endif // BUILD_QXT_BERKELEY - -#if !defined(QXT_STATIC) && !defined(QXT_DOXYGEN_RUN) -# if defined(BUILD_QXT_ZEROCONF) -# define QXT_ZEROCONF_EXPORT Q_DECL_EXPORT -# else -# define QXT_ZEROCONF_EXPORT Q_DECL_IMPORT -# endif -#else -# define QXT_ZEROCONF_EXPORT -#endif // QXT_ZEROCONF_EXPORT - -#if defined(BUILD_QXT_CORE) || defined(BUILD_QXT_GUI) || defined(BUILD_QXT_SQL) || defined(BUILD_QXT_NETWORK) || defined(BUILD_QXT_WEB) || defined(BUILD_QXT_BERKELEY) || defined(BUILD_QXT_ZEROCONF) -# define BUILD_QXT -#endif - -QXT_CORE_EXPORT const char* qxtVersion(); - -#ifndef QT_BEGIN_NAMESPACE -#define QT_BEGIN_NAMESPACE -#endif - -#ifndef QT_END_NAMESPACE -#define QT_END_NAMESPACE -#endif - -#ifndef QT_FORWARD_DECLARE_CLASS -#define QT_FORWARD_DECLARE_CLASS(Class) class Class; -#endif - -/**************************************************************************** -** This file is derived from code bearing the following notice: -** The sole author of this file, Adam Higerd, has explicitly disclaimed all -** copyright interest and protection for the content within. This file has -** been placed in the public domain according to United States copyright -** statute and case law. In jurisdictions where this public domain dedication -** is not legally recognized, anyone who receives a copy of this file is -** permitted to use, modify, duplicate, and redistribute this file, in whole -** or in part, with no restrictions or conditions. In these jurisdictions, -** this file shall be copyright (C) 2006-2008 by Adam Higerd. -****************************************************************************/ - -#define QXT_DECLARE_PRIVATE(PUB) friend class PUB##Private; QxtPrivateInterface qxt_d; -#define QXT_DECLARE_PUBLIC(PUB) friend class PUB; -#define QXT_INIT_PRIVATE(PUB) qxt_d.setPublic(this); -#define QXT_D(PUB) PUB##Private& d = qxt_d() -#define QXT_P(PUB) PUB& p = qxt_p() - -template -class QxtPrivate -{ -public: - virtual ~QxtPrivate() - {} - inline void QXT_setPublic(PUB* pub) - { - qxt_p_ptr = pub; - } - -protected: - inline PUB& qxt_p() - { - return *qxt_p_ptr; - } - inline const PUB& qxt_p() const - { - return *qxt_p_ptr; - } - inline PUB* qxt_ptr() - { - return qxt_p_ptr; - } - inline const PUB* qxt_ptr() const - { - return qxt_p_ptr; - } - -private: - PUB* qxt_p_ptr; -}; - -template -class QxtPrivateInterface -{ - friend class QxtPrivate; -public: - QxtPrivateInterface() - { - pvt = new PVT; - } - ~QxtPrivateInterface() - { - delete pvt; - } - - inline void setPublic(PUB* pub) - { - pvt->QXT_setPublic(pub); - } - inline PVT& operator()() - { - return *static_cast(pvt); - } - inline const PVT& operator()() const - { - return *static_cast(pvt); - } - inline PVT * operator->() - { - return static_cast(pvt); - } - inline const PVT * operator->() const - { - return static_cast(pvt); - } -private: - QxtPrivateInterface(const QxtPrivateInterface&) { } - QxtPrivateInterface& operator=(const QxtPrivateInterface&) { } - QxtPrivate* pvt; -}; - -#endif // QXT_GLOBAL diff --git a/src/third-party/qxtglobalshortcut.cpp b/src/third-party/qxtglobalshortcut.cpp deleted file mode 100644 index 46cfe4b..0000000 --- a/src/third-party/qxtglobalshortcut.cpp +++ /dev/null @@ -1,212 +0,0 @@ -#include "qxtglobalshortcut.h" -/**************************************************************************** -** Copyright (c) 2006 - 2011, the LibQxt project. -** See the Qxt AUTHORS file for a list of authors and copyright holders. -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** * Neither the name of the LibQxt project nor the -** names of its contributors may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -** -*****************************************************************************/ - -#include "qxtglobalshortcut_p.h" -#include -#include - -#ifndef Q_OS_MAC -int QxtGlobalShortcutPrivate::ref = 0; -#endif -QHash, QxtGlobalShortcut*> QxtGlobalShortcutPrivate::shortcuts; - -QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() : enabled(true), key(Qt::Key(0)), mods(Qt::NoModifier) -{ -#ifndef Q_OS_MAC - if (ref == 0) { - QAbstractEventDispatcher::instance()->installNativeEventFilter(this); - } - ++ref; -#endif -} - -QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate() -{ -#ifndef Q_OS_MAC - --ref; - if (ref == 0) { - QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance(); - if (ed != 0) { - ed->removeNativeEventFilter(this); - } - } -#endif -} - -bool QxtGlobalShortcutPrivate::setShortcut(const QKeySequence& shortcut) -{ - Qt::KeyboardModifiers allMods = Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier; - key = shortcut.isEmpty() ? Qt::Key(0) : Qt::Key((shortcut[0] ^ allMods) & shortcut[0]); - mods = shortcut.isEmpty() ? Qt::KeyboardModifiers(0) : Qt::KeyboardModifiers(shortcut[0] & allMods); - const quint32 nativeKey = nativeKeycode(key); - const quint32 nativeMods = nativeModifiers(mods); - const bool res = registerShortcut(nativeKey, nativeMods); - if (res) - shortcuts.insert(qMakePair(nativeKey, nativeMods), &qxt_p()); - else - qWarning() << "QxtGlobalShortcut failed to register:" << QKeySequence(key + mods).toString(); - return res; -} - -bool QxtGlobalShortcutPrivate::unsetShortcut() -{ - bool res = false; - const quint32 nativeKey = nativeKeycode(key); - const quint32 nativeMods = nativeModifiers(mods); - if (shortcuts.value(qMakePair(nativeKey, nativeMods)) == &qxt_p()) - res = unregisterShortcut(nativeKey, nativeMods); - if (res) - shortcuts.remove(qMakePair(nativeKey, nativeMods)); - else - qWarning() << "QxtGlobalShortcut failed to unregister:" << QKeySequence(key + mods).toString(); - key = Qt::Key(0); - mods = Qt::KeyboardModifiers(0); - return res; -} - -void QxtGlobalShortcutPrivate::activateShortcut(quint32 nativeKey, quint32 nativeMods) -{ - QxtGlobalShortcut* shortcut = shortcuts.value(qMakePair(nativeKey, nativeMods)); - if (shortcut && shortcut->isEnabled()) - emit shortcut->activated(); -} - -/*! - \class QxtGlobalShortcut - \inmodule QxtWidgets - \brief The QxtGlobalShortcut class provides a global shortcut aka "hotkey". - - A global shortcut triggers even if the application is not active. This - makes it easy to implement applications that react to certain shortcuts - still if some other application is active or if the application is for - example minimized to the system tray. - - Example usage: - \code - QxtGlobalShortcut* shortcut = new QxtGlobalShortcut(window); - connect(shortcut, SIGNAL(activated()), window, SLOT(toggleVisibility())); - shortcut->setShortcut(QKeySequence("Ctrl+Shift+F12")); - \endcode - - \bold {Note:} Since Qxt 0.6 QxtGlobalShortcut no more requires QxtApplication. - */ - -/*! - \fn QxtGlobalShortcut::activated() - - This signal is emitted when the user types the shortcut's key sequence. - - \sa shortcut - */ - -/*! - Constructs a new QxtGlobalShortcut with \a parent. - */ -QxtGlobalShortcut::QxtGlobalShortcut(QObject* parent) - : QObject(parent) -{ - QXT_INIT_PRIVATE(QxtGlobalShortcut); -} - -/*! - Constructs a new QxtGlobalShortcut with \a shortcut and \a parent. - */ -QxtGlobalShortcut::QxtGlobalShortcut(const QKeySequence& shortcut, QObject* parent) - : QObject(parent) -{ - QXT_INIT_PRIVATE(QxtGlobalShortcut); - setShortcut(shortcut); -} - -/*! - Destructs the QxtGlobalShortcut. - */ -QxtGlobalShortcut::~QxtGlobalShortcut() -{ - if (qxt_d().key != 0) - qxt_d().unsetShortcut(); -} - -/*! - \property QxtGlobalShortcut::shortcut - \brief the shortcut key sequence - - \bold {Note:} Notice that corresponding key press and release events are not - delivered for registered global shortcuts even if they are disabled. - Also, comma separated key sequences are not supported. - Only the first part is used: - - \code - qxtShortcut->setShortcut(QKeySequence("Ctrl+Alt+A,Ctrl+Alt+B")); - Q_ASSERT(qxtShortcut->shortcut() == QKeySequence("Ctrl+Alt+A")); - \endcode - */ -QKeySequence QxtGlobalShortcut::shortcut() const -{ - return QKeySequence(qxt_d().key | qxt_d().mods); -} - -bool QxtGlobalShortcut::setShortcut(const QKeySequence& shortcut) -{ - if (qxt_d().key != 0) - qxt_d().unsetShortcut(); - return qxt_d().setShortcut(shortcut); -} - -/*! - \property QxtGlobalShortcut::enabled - \brief whether the shortcut is enabled - - A disabled shortcut does not get activated. - - The default value is \c true. - - \sa setDisabled() - */ -bool QxtGlobalShortcut::isEnabled() const -{ - return qxt_d().enabled; -} - -void QxtGlobalShortcut::setEnabled(bool enabled) -{ - qxt_d().enabled = enabled; -} - -/*! - Sets the shortcut \a disabled. - - \sa enabled - */ -void QxtGlobalShortcut::setDisabled(bool disabled) -{ - qxt_d().enabled = !disabled; -} diff --git a/src/third-party/qxtglobalshortcut.h b/src/third-party/qxtglobalshortcut.h deleted file mode 100644 index a81942d..0000000 --- a/src/third-party/qxtglobalshortcut.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef QXTGLOBALSHORTCUT_H -/**************************************************************************** -** Copyright (c) 2006 - 2011, the LibQxt project. -** See the Qxt AUTHORS file for a list of authors and copyright holders. -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** * Neither the name of the LibQxt project nor the -** names of its contributors may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -** -*****************************************************************************/ - -#define QXTGLOBALSHORTCUT_H - -#include "qxtglobal.h" -#include -#include -class QxtGlobalShortcutPrivate; - -class QXT_GUI_EXPORT QxtGlobalShortcut : public QObject -{ - Q_OBJECT - QXT_DECLARE_PRIVATE(QxtGlobalShortcut) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) - Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut) - -public: - explicit QxtGlobalShortcut(QObject* parent = 0); - explicit QxtGlobalShortcut(const QKeySequence& shortcut, QObject* parent = 0); - virtual ~QxtGlobalShortcut(); - - QKeySequence shortcut() const; - bool setShortcut(const QKeySequence& shortcut); - - bool isEnabled() const; - -public Q_SLOTS: - void setEnabled(bool enabled = true); - void setDisabled(bool disabled = true); - -Q_SIGNALS: - void activated(); -}; - -#endif // QXTGLOBALSHORTCUT_H diff --git a/src/third-party/qxtglobalshortcut_mac.cpp b/src/third-party/qxtglobalshortcut_mac.cpp deleted file mode 100644 index 58b9a90..0000000 --- a/src/third-party/qxtglobalshortcut_mac.cpp +++ /dev/null @@ -1,258 +0,0 @@ -#include -/**************************************************************************** -** Copyright (c) 2006 - 2011, the LibQxt project. -** See the Qxt AUTHORS file for a list of authors and copyright holders. -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** * Neither the name of the LibQxt project nor the -** names of its contributors may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -** -*****************************************************************************/ - -#include "qxtglobalshortcut_p.h" -#include -#include -#include -#include - -typedef QPair Identifier; -static QMap keyRefs; -static QHash keyIDs; -static quint32 hotKeySerial = 0; -static bool qxt_mac_handler_installed = false; - -OSStatus qxt_mac_handle_hot_key(EventHandlerCallRef nextHandler, EventRef event, void* data) -{ - Q_UNUSED(nextHandler); - Q_UNUSED(data); - if (GetEventClass(event) == kEventClassKeyboard && GetEventKind(event) == kEventHotKeyPressed) - { - EventHotKeyID keyID; - GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(keyID), NULL, &keyID); - Identifier id = keyIDs.key(keyID.id); - QxtGlobalShortcutPrivate::activateShortcut(id.second, id.first); - } - return noErr; -} - -quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers modifiers) -{ - quint32 native = 0; - if (modifiers & Qt::ShiftModifier) - native |= shiftKey; - if (modifiers & Qt::ControlModifier) - native |= cmdKey; - if (modifiers & Qt::AltModifier) - native |= optionKey; - if (modifiers & Qt::MetaModifier) - native |= controlKey; - if (modifiers & Qt::KeypadModifier) - native |= kEventKeyModifierNumLockMask; - return native; -} - -quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key) -{ - UTF16Char ch; - // Constants found in NSEvent.h from AppKit.framework - switch (key) - { - case Qt::Key_Return: - return kVK_Return; - case Qt::Key_Enter: - return kVK_ANSI_KeypadEnter; - case Qt::Key_Tab: - return kVK_Tab; - case Qt::Key_Space: - return kVK_Space; - case Qt::Key_Backspace: - return kVK_Delete; - case Qt::Key_Control: - return kVK_Command; - case Qt::Key_Shift: - return kVK_Shift; - case Qt::Key_CapsLock: - return kVK_CapsLock; - case Qt::Key_Option: - return kVK_Option; - case Qt::Key_Meta: - return kVK_Control; - case Qt::Key_F17: - return kVK_F17; - case Qt::Key_VolumeUp: - return kVK_VolumeUp; - case Qt::Key_VolumeDown: - return kVK_VolumeDown; - case Qt::Key_F18: - return kVK_F18; - case Qt::Key_F19: - return kVK_F19; - case Qt::Key_F20: - return kVK_F20; - case Qt::Key_F5: - return kVK_F5; - case Qt::Key_F6: - return kVK_F6; - case Qt::Key_F7: - return kVK_F7; - case Qt::Key_F3: - return kVK_F3; - case Qt::Key_F8: - return kVK_F8; - case Qt::Key_F9: - return kVK_F9; - case Qt::Key_F11: - return kVK_F11; - case Qt::Key_F13: - return kVK_F13; - case Qt::Key_F16: - return kVK_F16; - case Qt::Key_F14: - return kVK_F14; - case Qt::Key_F10: - return kVK_F10; - case Qt::Key_F12: - return kVK_F12; - case Qt::Key_F15: - return kVK_F15; - case Qt::Key_Help: - return kVK_Help; - case Qt::Key_Home: - return kVK_Home; - case Qt::Key_PageUp: - return kVK_PageUp; - case Qt::Key_Delete: - return kVK_ForwardDelete; - case Qt::Key_F4: - return kVK_F4; - case Qt::Key_End: - return kVK_End; - case Qt::Key_F2: - return kVK_F2; - case Qt::Key_PageDown: - return kVK_PageDown; - case Qt::Key_F1: - return kVK_F1; - case Qt::Key_Left: - return kVK_LeftArrow; - case Qt::Key_Right: - return kVK_RightArrow; - case Qt::Key_Down: - return kVK_DownArrow; - case Qt::Key_Up: - return kVK_UpArrow; - default: - ; - } - - if (key == Qt::Key_Escape) ch = 27; - else if (key == Qt::Key_Return) ch = 13; - else if (key == Qt::Key_Enter) ch = 3; - else if (key == Qt::Key_Tab) ch = 9; - else ch = key; - - CFDataRef currentLayoutData; - TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource(); - - if (currentKeyboard == NULL) - return 0; - - currentLayoutData = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData); - CFRelease(currentKeyboard); - if (currentLayoutData == NULL) - return 0; - - UCKeyboardLayout* header = (UCKeyboardLayout*)CFDataGetBytePtr(currentLayoutData); - UCKeyboardTypeHeader* table = header->keyboardTypeList; - - uint8_t *data = (uint8_t*)header; - // God, would a little documentation for this shit kill you... - for (quint32 i=0; i < header->keyboardTypeCount; i++) - { - UCKeyStateRecordsIndex* stateRec = 0; - if (table[i].keyStateRecordsIndexOffset != 0) - { - stateRec = reinterpret_cast(data + table[i].keyStateRecordsIndexOffset); - if (stateRec->keyStateRecordsIndexFormat != kUCKeyStateRecordsIndexFormat) stateRec = 0; - } - - UCKeyToCharTableIndex* charTable = reinterpret_cast(data + table[i].keyToCharTableIndexOffset); - if (charTable->keyToCharTableIndexFormat != kUCKeyToCharTableIndexFormat) continue; - - for (quint32 j=0; j < charTable->keyToCharTableCount; j++) - { - UCKeyOutput* keyToChar = reinterpret_cast(data + charTable->keyToCharTableOffsets[j]); - for (quint32 k=0; k < charTable->keyToCharTableSize; k++) - { - if (keyToChar[k] & kUCKeyOutputTestForIndexMask) - { - long idx = keyToChar[k] & kUCKeyOutputGetIndexMask; - if (stateRec && idx < stateRec->keyStateRecordCount) - { - UCKeyStateRecord* rec = reinterpret_cast(data + stateRec->keyStateRecordOffsets[idx]); - if (rec->stateZeroCharData == ch) return k; - } - } - else if (!(keyToChar[k] & kUCKeyOutputSequenceIndexMask) && keyToChar[k] < 0xFFFE) - { - if (keyToChar[k] == ch) return k; - } - } // for k - } // for j - } // for i - return 0; -} - -bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativeMods) -{ - if (!qxt_mac_handler_installed) - { - EventTypeSpec t; - t.eventClass = kEventClassKeyboard; - t.eventKind = kEventHotKeyPressed; - InstallApplicationEventHandler(&qxt_mac_handle_hot_key, 1, &t, NULL, NULL); - } - - EventHotKeyID keyID; - keyID.signature = 'cute'; - keyID.id = ++hotKeySerial; - - EventHotKeyRef ref = 0; - bool rv = !RegisterEventHotKey(nativeKey, nativeMods, keyID, GetApplicationEventTarget(), 0, &ref); - if (rv) - { - keyIDs.insert(Identifier(nativeMods, nativeKey), keyID.id); - keyRefs.insert(keyID.id, ref); - } - return rv; -} - -bool QxtGlobalShortcutPrivate::unregisterShortcut(quint32 nativeKey, quint32 nativeMods) -{ - Identifier id(nativeMods, nativeKey); - if (!keyIDs.contains(id)) return false; - - EventHotKeyRef ref = keyRefs.take(keyIDs[id]); - keyIDs.remove(id); - return !UnregisterEventHotKey(ref); -} diff --git a/src/third-party/qxtglobalshortcut_p.h b/src/third-party/qxtglobalshortcut_p.h deleted file mode 100644 index 9539a2d..0000000 --- a/src/third-party/qxtglobalshortcut_p.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef QXTGLOBALSHORTCUT_P_H -/**************************************************************************** -** Copyright (c) 2006 - 2011, the LibQxt project. -** See the Qxt AUTHORS file for a list of authors and copyright holders. -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** * Neither the name of the LibQxt project nor the -** names of its contributors may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -** -*****************************************************************************/ - -#define QXTGLOBALSHORTCUT_P_H - -#include "qxtglobalshortcut.h" -#include -#include -#include -#include - - -class QxtGlobalShortcutPrivate : public QxtPrivate -#if !defined(Q_OS_MAC) - ,public QAbstractNativeEventFilter -#endif -{ -public: - QXT_DECLARE_PUBLIC(QxtGlobalShortcut) - QxtGlobalShortcutPrivate(); - ~QxtGlobalShortcutPrivate(); - - bool enabled; - Qt::Key key; - Qt::KeyboardModifiers mods; - - bool setShortcut(const QKeySequence& shortcut); - bool unsetShortcut(); - - static bool error; -#ifndef Q_OS_MAC - static int ref; - virtual bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); -#endif - - static void activateShortcut(quint32 nativeKey, quint32 nativeMods); - -private: - static quint32 nativeKeycode(Qt::Key keycode); - static quint32 nativeModifiers(Qt::KeyboardModifiers modifiers); - - static bool registerShortcut(quint32 nativeKey, quint32 nativeMods); - static bool unregisterShortcut(quint32 nativeKey, quint32 nativeMods); - - static QHash, QxtGlobalShortcut*> shortcuts; -}; - -#endif // QXTGLOBALSHORTCUT_P_H diff --git a/src/third-party/qxtglobalshortcut_win.cpp b/src/third-party/qxtglobalshortcut_win.cpp deleted file mode 100644 index c8745b7..0000000 --- a/src/third-party/qxtglobalshortcut_win.cpp +++ /dev/null @@ -1,243 +0,0 @@ -#include "qxtglobalshortcut_p.h" -/**************************************************************************** -** Copyright (c) 2006 - 2011, the LibQxt project. -** See the Qxt AUTHORS file for a list of authors and copyright holders. -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** * Neither the name of the LibQxt project nor the -** names of its contributors may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -** -*****************************************************************************/ - -#include - - -bool QxtGlobalShortcutPrivate::nativeEventFilter(const QByteArray & eventType, - void * message, long * result) -{ - Q_UNUSED(eventType); - Q_UNUSED(result); - MSG* msg = static_cast(message); - if (msg->message == WM_HOTKEY) - { - const quint32 keycode = HIWORD(msg->lParam); - const quint32 modifiers = LOWORD(msg->lParam); - activateShortcut(keycode, modifiers); - } - - return false; -} - - -quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers modifiers) -{ - // MOD_ALT, MOD_CONTROL, (MOD_KEYUP), MOD_SHIFT, MOD_WIN - quint32 native = 0; - if (modifiers & Qt::ShiftModifier) - native |= MOD_SHIFT; - if (modifiers & Qt::ControlModifier) - native |= MOD_CONTROL; - if (modifiers & Qt::AltModifier) - native |= MOD_ALT; - if (modifiers & Qt::MetaModifier) - native |= MOD_WIN; - // TODO: resolve these? - //if (modifiers & Qt::KeypadModifier) - //if (modifiers & Qt::GroupSwitchModifier) - return native; -} - -quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key) -{ - switch (key) - { - case Qt::Key_Escape: - return VK_ESCAPE; - case Qt::Key_Tab: - case Qt::Key_Backtab: - return VK_TAB; - case Qt::Key_Backspace: - return VK_BACK; - case Qt::Key_Return: - case Qt::Key_Enter: - return VK_RETURN; - case Qt::Key_Insert: - return VK_INSERT; - case Qt::Key_Delete: - return VK_DELETE; - case Qt::Key_Pause: - return VK_PAUSE; - case Qt::Key_Print: - return VK_PRINT; - case Qt::Key_Clear: - return VK_CLEAR; - case Qt::Key_Home: - return VK_HOME; - case Qt::Key_End: - return VK_END; - case Qt::Key_Left: - return VK_LEFT; - case Qt::Key_Up: - return VK_UP; - case Qt::Key_Right: - return VK_RIGHT; - case Qt::Key_Down: - return VK_DOWN; - case Qt::Key_PageUp: - return VK_PRIOR; - case Qt::Key_PageDown: - return VK_NEXT; - case Qt::Key_F1: - return VK_F1; - case Qt::Key_F2: - return VK_F2; - case Qt::Key_F3: - return VK_F3; - case Qt::Key_F4: - return VK_F4; - case Qt::Key_F5: - return VK_F5; - case Qt::Key_F6: - return VK_F6; - case Qt::Key_F7: - return VK_F7; - case Qt::Key_F8: - return VK_F8; - case Qt::Key_F9: - return VK_F9; - case Qt::Key_F10: - return VK_F10; - case Qt::Key_F11: - return VK_F11; - case Qt::Key_F12: - return VK_F12; - case Qt::Key_F13: - return VK_F13; - case Qt::Key_F14: - return VK_F14; - case Qt::Key_F15: - return VK_F15; - case Qt::Key_F16: - return VK_F16; - case Qt::Key_F17: - return VK_F17; - case Qt::Key_F18: - return VK_F18; - case Qt::Key_F19: - return VK_F19; - case Qt::Key_F20: - return VK_F20; - case Qt::Key_F21: - return VK_F21; - case Qt::Key_F22: - return VK_F22; - case Qt::Key_F23: - return VK_F23; - case Qt::Key_F24: - return VK_F24; - case Qt::Key_Space: - return VK_SPACE; - case Qt::Key_Asterisk: - return VK_MULTIPLY; - case Qt::Key_Plus: - return VK_ADD; - case Qt::Key_Comma: - return VK_SEPARATOR; - case Qt::Key_Minus: - return VK_SUBTRACT; - case Qt::Key_Slash: - return VK_DIVIDE; - case Qt::Key_MediaNext: - return VK_MEDIA_NEXT_TRACK; - case Qt::Key_MediaPrevious: - return VK_MEDIA_PREV_TRACK; - case Qt::Key_MediaPlay: - return VK_MEDIA_PLAY_PAUSE; - case Qt::Key_MediaStop: - return VK_MEDIA_STOP; - // couldn't find those in VK_* - //case Qt::Key_MediaLast: - //case Qt::Key_MediaRecord: - case Qt::Key_VolumeDown: - return VK_VOLUME_DOWN; - case Qt::Key_VolumeUp: - return VK_VOLUME_UP; - case Qt::Key_VolumeMute: - return VK_VOLUME_MUTE; - - // numbers - case Qt::Key_0: - case Qt::Key_1: - case Qt::Key_2: - case Qt::Key_3: - case Qt::Key_4: - case Qt::Key_5: - case Qt::Key_6: - case Qt::Key_7: - case Qt::Key_8: - case Qt::Key_9: - return key; - - // letters - case Qt::Key_A: - case Qt::Key_B: - case Qt::Key_C: - case Qt::Key_D: - case Qt::Key_E: - case Qt::Key_F: - case Qt::Key_G: - case Qt::Key_H: - case Qt::Key_I: - case Qt::Key_J: - case Qt::Key_K: - case Qt::Key_L: - case Qt::Key_M: - case Qt::Key_N: - case Qt::Key_O: - case Qt::Key_P: - case Qt::Key_Q: - case Qt::Key_R: - case Qt::Key_S: - case Qt::Key_T: - case Qt::Key_U: - case Qt::Key_V: - case Qt::Key_W: - case Qt::Key_X: - case Qt::Key_Y: - case Qt::Key_Z: - return key; - - default: - return 0; - } -} - -bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativeMods) -{ - return RegisterHotKey(0, nativeMods ^ nativeKey, nativeMods, nativeKey); -} - -bool QxtGlobalShortcutPrivate::unregisterShortcut(quint32 nativeKey, quint32 nativeMods) -{ - return UnregisterHotKey(0, nativeMods ^ nativeKey); -} diff --git a/src/third-party/qxtglobalshortcut_x11.cpp b/src/third-party/qxtglobalshortcut_x11.cpp deleted file mode 100644 index ae70602..0000000 --- a/src/third-party/qxtglobalshortcut_x11.cpp +++ /dev/null @@ -1,224 +0,0 @@ -#include "qxtglobalshortcut_p.h" -/**************************************************************************** -** Copyright (c) 2006 - 2011, the LibQxt project. -** See the Qxt AUTHORS file for a list of authors and copyright holders. -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** * Neither the name of the LibQxt project nor the -** names of its contributors may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -** -*****************************************************************************/ - - -/**************************************************************************** - * - * Note: This file is a modified version for QTerminal! - * - ****************************************************************************/ - -#include -#include - -#include -#include - -namespace { - -const QVector maskModifiers = QVector() - << 0 << Mod2Mask << LockMask << (Mod2Mask | LockMask); - -typedef int (*X11ErrorHandler)(Display *display, XErrorEvent *event); - -class QxtX11ErrorHandler { -public: - static bool error; - - static int qxtX11ErrorHandler(Display *display, XErrorEvent *event) - { - Q_UNUSED(display); - switch (event->error_code) - { - case BadAccess: - case BadValue: - case BadWindow: - if (event->request_code == 33 /* X_GrabKey */ || - event->request_code == 34 /* X_UngrabKey */) - { - error = true; - //TODO: - //char errstr[256]; - //XGetErrorText(dpy, err->error_code, errstr, 256); - } - } - return 0; - } - - QxtX11ErrorHandler() - { - error = false; - m_previousErrorHandler = XSetErrorHandler(qxtX11ErrorHandler); - } - - ~QxtX11ErrorHandler() - { - XSetErrorHandler(m_previousErrorHandler); - } - -private: - X11ErrorHandler m_previousErrorHandler; -}; - -bool QxtX11ErrorHandler::error = false; - -class QxtX11Data { -public: - QxtX11Data() - { - m_display = QX11Info::display(); - } - - bool isValid() - { - return m_display != 0; - } - - Display *display() - { - Q_ASSERT(isValid()); - return m_display; - } - - Window rootWindow() - { - return DefaultRootWindow(display()); - } - - bool grabKey(quint32 keycode, quint32 modifiers, Window window) - { - QxtX11ErrorHandler errorHandler; - - for (int i = 0; !errorHandler.error && i < maskModifiers.size(); ++i) { - XGrabKey(display(), keycode, modifiers | maskModifiers[i], window, True, - GrabModeAsync, GrabModeAsync); - } - - if (errorHandler.error) { - ungrabKey(keycode, modifiers, window); - return false; - } - - return true; - } - - bool ungrabKey(quint32 keycode, quint32 modifiers, Window window) - { - QxtX11ErrorHandler errorHandler; - - for (const quint32& maskMods : qAsConst(maskModifiers)) { - XUngrabKey(display(), keycode, modifiers | maskMods, window); - } - - return !errorHandler.error; - } - -private: - Display *m_display; -}; - -} // namespace - -bool QxtGlobalShortcutPrivate::nativeEventFilter(const QByteArray & eventType, - void *message, long *result) -{ - Q_UNUSED(result); - - xcb_key_press_event_t *kev = 0; - if (eventType == "xcb_generic_event_t") { - xcb_generic_event_t *ev = static_cast(message); - if ((ev->response_type & 127) == XCB_KEY_PRESS) - kev = static_cast(message); - } - - if (kev != 0) { - unsigned int keycode = kev->detail; - unsigned int keystate = 0; - if(kev->state & XCB_MOD_MASK_1) - keystate |= Mod1Mask; - if(kev->state & XCB_MOD_MASK_CONTROL) - keystate |= ControlMask; - if(kev->state & XCB_MOD_MASK_4) - keystate |= Mod4Mask; - if(kev->state & XCB_MOD_MASK_SHIFT) - keystate |= ShiftMask; - activateShortcut(keycode, - // Mod1Mask == Alt, Mod4Mask == Meta - keystate & (ShiftMask | ControlMask | Mod1Mask | Mod4Mask)); - } - - return false; -} - -quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers modifiers) -{ - // ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, and Mod5Mask - quint32 native = 0; - if (modifiers & Qt::ShiftModifier) - native |= ShiftMask; - if (modifiers & Qt::ControlModifier) - native |= ControlMask; - if (modifiers & Qt::AltModifier) - native |= Mod1Mask; - if (modifiers & Qt::MetaModifier) - native |= Mod4Mask; - - // TODO: resolve these? - //if (modifiers & Qt::MetaModifier) - //if (modifiers & Qt::KeypadModifier) - //if (modifiers & Qt::GroupSwitchModifier) - return native; -} - -quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key) -{ - QxtX11Data x11; - if (!x11.isValid()) - return 0; - - KeySym keysym = XStringToKeysym(QKeySequence(key).toString().toLatin1().data()); - if (keysym == NoSymbol) - keysym = static_cast(key); - - return XKeysymToKeycode(x11.display(), keysym); -} - -bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativeMods) -{ - QxtX11Data x11; - return x11.isValid() && x11.grabKey(nativeKey, nativeMods, x11.rootWindow()); -} - -bool QxtGlobalShortcutPrivate::unregisterShortcut(quint32 nativeKey, quint32 nativeMods) -{ - QxtX11Data x11; - return x11.isValid() && x11.ungrabKey(nativeKey, nativeMods, x11.rootWindow()); -}