Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>pull/3/head
parent
a0148cf62f
commit
d017bd3725
@ -1,298 +1,298 @@
|
||||
2012-01-01 Version 1.2.0
|
||||
[add] The Linux version has a menu entry in the application development menu now.
|
||||
[add] The Linux version has a mime type association to some code files now, so that UiGUI is available as "open with".
|
||||
[add] Added support for the Visual Basic beautifier VBSBeautifier.
|
||||
[add] Added support for the SQL beautifier Pl/Sql tidy.
|
||||
[add] Updated the Artistic Style configuration to support Artistic Style version 2.02.1.
|
||||
[add] Updated the Uncrustify configuration to support Uncrustify version 0.59.
|
||||
[add] Updated the PerlTidy configuration to support PerlTidy version 1.74.
|
||||
[add] Updated the Ruby Script Beautifier to version 2.9.
|
||||
[fix] Bug ID 3021933: Updated the Artistic Style configuration to support Artistic Style version 2.01.
|
||||
[fix] Bug ID 3021931: Fixed calling of Artistic Style version 1.22 and later.
|
||||
[fix] Bug ID 3006513: Fixed compiling UiGUI using GCC 4.5 and later.
|
||||
[fix] Bug ID 2942381: When loading an indenter configuration file, the settings displayed in the docking widget were correctly updated, but the code wasn't.
|
||||
[fix] Bug ID 2135872: A zombie process kept on running if UiGUI was quit during the update check in background if no internet connection is available.
|
||||
[fix] Bug ID 3175027: Uncrustify had wrong pop-up comments for two check-boxes.
|
||||
[fix] Bug ID 2916163: The proxy settings are properly used and applied now.
|
||||
[fix] Made the JsDecoder integration be compatible with recent Qt versions.
|
||||
[change] Changed the created shell scripts indenter config file reference. Now each created shell script has a corresponding config file being created in the same dir as the shell script, with the same name but different suffix. But since the config file is referenced by "./", when calling the script the working directory must be the same as the directory containing the config file.
|
||||
[change] Using TCLAP as command line parser instead of own command line parsing.
|
||||
[change] Setting a file name as parameter on the command line without any prefix will load this file instead of the last opened one.
|
||||
[change] Rewritten and improved the internal way how settings are connected to the UI.
|
||||
[change] Refactored and cleaned up the code.
|
||||
[change] Will no longer deliver binary bundles linked against Qt statically. Instead delivering all dependent DLLs and libs.
|
||||
|
||||
2009-07-16 Version 1.1.0
|
||||
[add] Added a logging class, that can catch debug output and make trace backs if any problems occur possible.
|
||||
[add] Added an application icon for Mac OS X.
|
||||
[change] Feature Request ID 2596302 : Updated the greatcode.ini. Thanks to adxadx who has done this work!
|
||||
[change] Feature Request ID 2793216: Updated to Uncrustify 0.53.
|
||||
[change] Updated to JsDecoder version 1.1.0
|
||||
[fix] Bug ID 2791229: If UiGUI was located in a path containing Unicode characters or such a path needed to be handed over to a called indenter, the indenter could get confused on Windows. So using the Windows 8.3 short path notation.
|
||||
[fix] On Mac OS X the used default font wasn't monospaced. Switched back to use Courier on Mac.
|
||||
|
||||
2009-02-12 Version 1.0.2
|
||||
[add] Feature Request ID 2498654 : Added support for the Fortran indenter F90ppr. http://universalindent.sf.net/issue/feature/2498654
|
||||
[add] Made it possible to define "stdin" to be used for an indenter calling.
|
||||
[change] Made the source code be compilable with the slightly older QScintilla version 2.2.
|
||||
[change] When starting the very first time without any existing application settings, do not show the mainwindow at position 0,0. On Mac the window couldn't be moved because the window title bar was hidden under the Mac menu bar.
|
||||
[change] When using a non Windows system the default editor font type is now Monospace instead of Courier. The latter was not found properly.
|
||||
[change] For security reason using a randomly generated temporary directory name on Unix based systems.
|
||||
[change] Improved the GUI updates for the Notepad++ plugin a bit. Not what I would call "good" yet.
|
||||
[fix] Bug ID 2284777 : The Notepad++ plugin was falsely linked against Qt debug dlls, which were not included. http://universalindent.sf.net/issue/bug/2284777
|
||||
[fix] Bug ID 2594251 : The new version available check didn't work anymore since version 1.0.1. http://universalindent.sf.net/issue/bug/2594251
|
||||
[fix] Avoid a crash if an uigui ini file with faulty header info is read, where the indenter executable was empty.
|
||||
[fix] Some application settings were tried to be read from a wrong directory when running in multi user mode.
|
||||
|
||||
2008-10-14 Version 1.0.1
|
||||
[add] Feature Request ID 2161471 : Added support for the Python indenter pindent.
|
||||
[add] Feature Request ID 1883444 : Added support for the JSP indenter JSPPP.
|
||||
[add] Feature Request ID 1867563 : Added support for the XML indenter XML Indent.
|
||||
[add] Support for French language. Thanks to Erwan "leg".
|
||||
[change] Some small translation corrections.
|
||||
[change] Improved the "new version available" check.
|
||||
[change] On Mac and Linux a one pixel frame was shown around the whole screen when about dialog is visible. Removed that.
|
||||
[change] Updated to Uncrustify version 0.49 from SVN repository.
|
||||
[change] Using a new logo icon for UniversalIndentGUI. The logo was created by Erwan "leg". Thanks!
|
||||
[fix] Bug ID 2173527 : Could not load Artistic Style config file properly if both parameters "--brackets=linux" and "--brackets=break-closing" were set. http://universalindent.sf.net/issue/2173527
|
||||
[fix] The distributed version of GNU Indent was using a misspelled configuration file, thus lieve preview didn't correctly work. Using original GNU Win32 version now.
|
||||
[fix] In version 1.0.0 the creation of batch files for indenters undet Windows always created a bash/shell script instead of batch.
|
||||
[fix] Keyboard shortcuts for enabling/disabling "Live Preview" and syntax highlighting didn't work.
|
||||
|
||||
2008-09-30 Version 1.0.0 non public release. Only presented for Qt Centre programming contest.
|
||||
[add] Made it possible to start UiGUI in different modes via parameters: Normal (full UI), plugin (only indenter menu, server active), server only.
|
||||
[add] Added a server functionality. Future plan is to let UiGUI run also as server so plugins from other editors can send indent requests over TCP/IP to it. Very early state right now.
|
||||
[add] Created a plugin for Notepad++. This plugin shows the indenter parameter menu and lets the user indent the selected or whole text. Live preview works also. Still has some eventloop graphic update problems.
|
||||
[add] Added support for two (rather simple) Ruby beautifiers, ruby_formatter and rbeautify.
|
||||
[add] Feature Request ID 1985475 : Added the possibility to reset all indenter parameters to default values. http://universalindent.sf.net/issue/1985475
|
||||
[add] Feature Request ID 1989585 : Added a context menu in indenter parameters widget and moved all functions handling these actions from the main window to the indent handler. http://universalindent.sf.net/issue/1989585
|
||||
[add] Feature Request ID 1977033 : Now supporting the Cobol intender Cobol Beautifier. http://universalindent.sf.net/issue/1977033
|
||||
[add] Feature Request ID 2080832 : Now showing the cursors current line and column number in the statusbars down right corner. http://universalindent.sf.net/issue/2080832
|
||||
[change] Using Qt >= 4.4.x now and thereby implemented an animated 3D about dialog.
|
||||
[change] Using QScintilla >= 2.3 now and thereby added support for Cmake, Fortran[77], Pascal, PostScript, TCL, VHDL, XML and YAML.
|
||||
[change] Reformatted the about dialog to only contain one QTextEdit. Also added some more links to that text.
|
||||
[change] Limited the size of the combobox showing the indenters because with the supported programming languages in the name, the comobox was to large in width.
|
||||
[change] Prevent php file from being tried to be executed directly. That could happen if the file has the execution flag set. However that should never be the case, so this is a workaround.
|
||||
[change] Added a new class UiguiIniFileParser which will replace the currently used QSettings for reading the indenter parameters. Thus parameters appear in the menu in the same order as in the ini file and are no longer alphabetically sorted.
|
||||
[change] Redesigned the user interface and code a bit. The indenter selection combo box along with the manual button are now placed in docking widget where all indenter parameters are placed. This is done in preparation to pull out the complete indent handler, so it can be used as plugin for Notepad++ or Eclipse etc.]
|
||||
[change] Made reading the indenter config files more tolerant. If the user disobeys case sensitivity when editing the config file by hand, the values are correctly parsed anyway.
|
||||
[change] Feature Request ID 1989587 : There is no longer any need to have a current value setting in the ini files. A default value is enough. http://universalindent.sf.net/issue/1989587
|
||||
[change] Completely removed QT3Support functions.
|
||||
[change] Removed all compiler warnings.
|
||||
[change] Changed the way internal settings are handled. Using QObject propertys for connected setting name now.
|
||||
[fix] The by each indenter supported programming languages, written in braces, are removed from the created shell scripts name.
|
||||
[fix] Corrected the move/mv commands parameter in the created shell and batch script when calling recursive.
|
||||
[fix] Bug ID 1986471 : The file modification flag did not work properly. Reason was that QScintilla can not set its textedit component modified flag to true by a function call. http://universalindent.sf.net/issue/1986471
|
||||
|
||||
2008-05-26 Version 0.8.2
|
||||
[add] Feature Request ID 1971206 : Now showing by the indenter supported programming languages next to indenter name.
|
||||
[add] Feature Request ID 1971181 : Added support for the HTML indenter HTB.
|
||||
[add] Feature Request ID 1867562 : Added support for the HTML indenter hindent.
|
||||
[add] Added support for the php indenter phpStylist version 1.0.
|
||||
[add] Added the possibility to directly setting php files as indenter. The suffix .php is recognized and php used as default interpreter.
|
||||
[add] Extended the created batch/shell script so it is able to indent only one file given as parameter or a whole directory recursively with a defined file suffix.
|
||||
[add] Feature Request ID 1885911 : Added the possibility to open a file on applications start, that is handed over as parameter on the command line.
|
||||
[add] Feature Request ID 1729429 : Added the possibility to drag'n drop in any source code file for opening it.
|
||||
[change] Created indenter shell scripts now automatically have the executable flag set to true.
|
||||
[change] Completed the support for all perl tidy parameters.
|
||||
[change] Updated to uncrustify version 0.46.
|
||||
[fix] Bug ID 1933074 : On Unix systems the user config files were stored in his home dir in the subfolder ".config". Now they are directly stored in ".universalindentgui".
|
||||
[fix] Fixed a bug where the string "<html><body>" was prepended to the output code. Occurred for example when using the shell indenter.
|
||||
|
||||
2008-03-27 Version 0.8.1
|
||||
[add] Feature Request ID 1909450 : Added support for the PEAR PHP beautifier. Thus PHP beautifying is also possible on Linux and Mac OS X. (Needs the PEAR package "PHP_Beautifier" to be installed and a path entry pointing to the PHP dir.)
|
||||
[add] Added support and translations for Russian and Ukrainian language. Thanks to Oleksandr (http://korytskyy.lviv.ua).
|
||||
[add] Feature Request ID 1901935 : From now on files are saved with the same encoding as they were opened and no longer always UTF-8. Also it is possible to save the file with any other encoding.
|
||||
[change] The detection whether to run in portable mode now depends on where the "config" folder resides and no longer the "indenters" folder. This is needed to be able to correctly run on Windows multiuser systems.
|
||||
[change] Removed the word "beta" whereever it occurred, since UiGUI isn't that beta anymore.
|
||||
[fix] Bug ID 1910773 : On Unix systems the globally available files, like indenters, translations etc are not longer installed to /etc/universalindentgui but to /usr/share/universalindentgui.
|
||||
|
||||
2008-01-17 Version 0.8.0 Beta
|
||||
[add] Feature Request ID 1849297 : Added support for indenters written in JavaScript using an internal interpreter. Have a look into the README.txt to get to know, what steps are needed for that.
|
||||
[add] Added support for a simple JavaScript indenter written in JavaScript itself.
|
||||
[add] Added support for a simple shell code indenter written in awk.
|
||||
[add] Feature Request ID 1736946 : It is now possible to run any indenter that is available in the global environment via a path entry.
|
||||
[add] Feature Request ID 1852483 : Indenters written in script languages, like perl, are now also supported, if they have a correct shebang.
|
||||
[add] Added support for the well known perltidy. The uigui ini file is completed up to the category and including "Line Break Control". Rest needs to be done.
|
||||
[add] Feature Request ID 1866599 : Adapted the used paths for settings, temporary files and the one containing indenter ini files to be conform with systems that use strict user rights management. Most this concerns Linux, where the binary resides inside a bin dir and user specific settings are stored in his home dir. Short: now supporting multiuser systems and also have a portable mode, where modifications are only on local media.
|
||||
[add] Feature Request ID 1730360 : Along with real support for multiuser systems, each user can have his own indenter settings. These won't be overwritten by an update, what was the case before.
|
||||
[add] Feature Request ID 1867628 : Added a button to the toolbar near the indenter selection that opens the indenters online manual.
|
||||
[add] Feature Request ID 1867660 : Created a simple man page for unix based systems.
|
||||
[add] The by the qmake projekt file resulting makefile has a directive for install on unix based systems now.
|
||||
[add] Added example files for most supported programming languages, so each indenter can be tested.
|
||||
[change] The source code archive is now in a Unix conform format and naming convention.
|
||||
[change] The used paths have changed. The "data" directory has been renamed to indenters and includes only the uigui ini files and maybe some indenter binaries. Futher a config and a temp directory are used.
|
||||
[change] In case of an error during calling the indenter, its standard output is appended to the error dialog.
|
||||
[change] Corrected some misspelling.
|
||||
[change] Renamed htmltidy to tidy because that is its official name and also the name of the binary in all Linux packages.
|
||||
[fix] Bug ID 1855460 : The parameter settings of the indenter were only saved, if preview is turned on. Now the settings are always remembered.
|
||||
[fix] Bug ID 1854156 : The syntax highlighter did not switch to perl if a file with suffix .pl or .pm was loaded.
|
||||
|
||||
2007-11-22 Version 0.7.1 Beta
|
||||
[add] Feature Request ID 1833814 : Added support for building on MacOSX.
|
||||
[change] Feature Request ID 1836486 : Update to latest version of Uncrustify.
|
||||
[change] Update to latest version of Artistic Styler.
|
||||
|
||||
2007-11-11 Version 0.7.0 Beta
|
||||
[add] Feature Request ID 1826733 : If the called indenter returns an error message, you can chose to not show the same error again. Helpful for HTMLtidy since it often shows a long, repeating error list.
|
||||
[add] Feature Request ID 1805974 : Added an option to clear the list of recently opened files.
|
||||
[add] Feature Request ID 1760997 : Added some code lines to example.cpp to test whether an indenter correctly handles preprocessor defines.
|
||||
[add] Feature Request ID 1752551 : If the user manually checks for updates a progress/busy dialog will be shown.
|
||||
[add] Feature Request ID 1736932 : The user gets shown a dialog if he has manually checked for an update and no new one is available.
|
||||
[change] The update check is now enabled by default.
|
||||
[change] Slighty changes made to the settings dialog; put texts in front of the changed value.
|
||||
[fix] Bug ID 1807179 : GNU Indent didn't work properly on Windows system, after the dlls libiconv-2.dll and libintl-2.dll were removed. Readded them.
|
||||
[fix] Bug ID 1805976 : The HTML export didn't produce any output. Fixed that, but still has not syntax formatting.
|
||||
[fix] Bug ID 1815023 : Mixed traditional with simplified chinese translation. Now preferring to use english text instead of mixing if no traditional translation is available.
|
||||
[fix] Bug ID 1815120 : The font of the editor component was wrong (not monospaced), if syntax highlighting was turned off.
|
||||
|
||||
2007-06-13 Version 0.6.1 Beta
|
||||
[add] Feature Request ID 1729433 : Added a recently opened file menu.
|
||||
[add] Feature Request ID 1704290 : Added possibiltiy to integrate into an IDE, editor or other as external tool. This is donw by creating a batch/shell script which accepts a file as parameter and calls the indenter with the in UniversalIndentGUI made settings.
|
||||
[add] Feature Request ID 1673659 : The string parameter in the uigui ini files for each indenter can now also be a list of strings divided by "|" sign. As result the parameter name with value will be written to the indenter config file for each of the values.
|
||||
[add] Feature Request ID 1730180 : UniversalIndentGUI can automatically check on start, whether a new version is available. This setting is disabled by default and can be enabled in the settings.
|
||||
[add] Added support for HTML Tidy. The executable is contained in the release package.
|
||||
[add] Feature Request ID 1736432 : The width of the dock widget containing the indenter parameters is now restored on program start.
|
||||
[change] The about dialog shows now a credits scroller to say thanks to all people, who have helped me somehow.
|
||||
[fix] Bug ID 1733499 : UniversalIndentGui crashed if inside of an indenter ini file the category number of one parameter was higher than the available categories.
|
||||
[fix] Bug ID 1735586 : Some dialogs had untranslated buttons. For example yes, no, cancel were not translated.
|
||||
|
||||
2007-06-03 Version 0.6.0 Beta
|
||||
[add] Feature Request ID 1700557 : Added a settings dialog for handling more possible settings with better usabiltiy.
|
||||
[add] Feature Request ID 1700556 : Added option to load last file or not on startup.
|
||||
[add] Feature Request ID 1684011 : Added option to set the width used to display tabs (default is four spaces).
|
||||
[add] Feature Request ID 1651718 : Added multiple choices, for the indenter configuration, with for the user readable text. Before the text inside of the combo boxes for the indenter parameters was exactly the same text as the command line parameter of the indenter. Now with "ChoicesReadable" a list with the same length as "Choices" can be used to insert readable text into the combo box. If this list is not set, the content of "Choices" will be used.
|
||||
[add] Partly Japanese translation. Thanks to Nirvash.
|
||||
[add] The language selection show the countries flag in front of its name to identify the language faster.
|
||||
[add] Feature Request ID 1657253 : If now configuration ini file for any indenter can be found, a warning will be displayed.
|
||||
[change] Feature Request ID 1723228 : The default font for all syntax highlighters is now mono spaced, Courier.
|
||||
[change] Along with the settings dialog cleaned up the user interface. Moved some not that often needed settings away to the settings dialog.
|
||||
[change] The full text of the GPL in the about dialog did slow down the program startup and translation. Now only a hint and link to the GPL is given in the about dialog.
|
||||
[fix] Bug ID 1692511 : UniversalIndentGui crashed, if a by the syntax highlighter unsupported file extension was opened.
|
||||
[fix] Bug ID 1727538 : The setting for syntax highlighting was allways enabled on startup, even if disabled on closing.
|
||||
[fix] Bug ID 1729026 : The highlighting style was not correct when changed to another highlighter than the current. Only after toggling preview for example the style was correct.
|
||||
[fix] The editors column showing the line numbers did not adapt its width to the maximum line number.
|
||||
|
||||
2007-03-19 Version 0.5.1 Beta
|
||||
[add] Supporting syntax highlightning for the programming language D.
|
||||
[change] The live typing and indenting feature was not adapted to QScintilla. Now works again (depending on the used indenter).
|
||||
[fix] Bug ID 1678783 : Files other encoded than ascii were not displayed correctly. Now allways displaying files using UTF-8 encoding.
|
||||
[fix] Bug ID 1678783 : The new syntax highlighter selection menu was not translated.
|
||||
[fix] When file was reloaded with other encoding the file was allways set to be modified even if it wasn't.
|
||||
|
||||
2007-03-14 Version 0.5.0 Beta
|
||||
[add/change] Using QScintilla as editing component, which is by far more mighty than the before uses QTextEdit. Have a look inside the development area for details.
|
||||
[add] Because of QScintilla, added syntax highlightning for bash, batch, cpp, csharp, css, diff, html, idl, java, javascript, lua, makefile, perl, pov, ini, python, ruby, sql and tex.
|
||||
[add] Also added code folding for previously mentioned languages.
|
||||
[add] Added support for the indenter "phpCB" phpCodeBeatufier. (Thanks to Nelson Tai) The executable is not included in the UiGui release, because I am not sure about the license of phpCB right now.
|
||||
[add] The output of an indenter can now be read from stdout, by setting "stdout" for "outputFileParameter".
|
||||
[add] Feature Request ID 1673549 : The order of the indenter call parameters for input file, output file and options[file] is now selectable in three states: pio, ipo, iop.
|
||||
[add] Feature Request ID 1675503 : The last set encoding is being remembered and used on loading last file.
|
||||
[add] Feature Request ID 1669822 : The last window position, size and maximized state is stored in the settings and restored.
|
||||
[add] Feature Request ID 1673670 : Made it possible to switch between visible and invisible white space characters, like spaces and tabs.
|
||||
[change] The "personal" configuration files of each indenter (like gc.cfg) are no longer included in a release, so these settings can be loaded into UiGui after updating.
|
||||
[fix] Bug ID 1678783: If the current opened file had no save name yet, only the path was written to the settings file, causing an error on next start.
|
||||
|
||||
2007-02-25 Version 0.4.2 Beta
|
||||
[add] Support for the indenter CSSTidy has been added.
|
||||
[add] Support for new language: Taiwan (Chinese).
|
||||
[change] For easier translation the about dialog has been redesigned a bit.
|
||||
2007-02-11 Version 0.4.1 Beta
|
||||
[add] Support for the indenter Uncrustify has been added.
|
||||
[add] Feature Request ID 1651719: A binary release for Linux AMD64 is now available.
|
||||
[add] Feature Request ID 1657251: If only a win32 executable exists under Linux, wine will be used to call it. Now a test will be mad if wine is installed and an error message will show up if not installed.
|
||||
[change] Some changes mad to the Artistic Styler ini file as suggested by its author Jim Pattee.
|
||||
[change] Put the file open button at first position in the toolbar, because normally this is the first step one would do, if he tries to find the optimal indenter and settings for himself.
|
||||
[change] The background in the about dialog has been changed to look equal on all systems.
|
||||
[change] The error message dialogs had small optical enhancements to be more readable.
|
||||
[fix] Bug ID 1657255: If an error occurred during the try to call the indenter, a message box is being shown, but the mouse cursor still indicated that the application is being busy.
|
||||
[fix] Bug ID 1651071: Changing the file encoding did not affect the code sent to the indenter, so the code while preview turned on, had wrong encoding (still seems to have some encoding problems under Linux).
|
||||
[fix] Bug ID 1650222: On Windows systems there were two DLLs missing to run GNU Indent ("libiconv-2.dll" and "libintl-2.dll")
|
||||
[fix] Bug ID 1649918: The indenter was not called after first program start, so preview updated first after changing a setting or the code.
|
||||
|
||||
2007-02-01 Version 0.4 Beta
|
||||
[add] All parameters of GNU Indent have been added.
|
||||
[add] From now on the indenter BCPP is included.
|
||||
[add] The loaded source file encoding is now convertable by the menu entry "Reopen File with other Encoding". This way chinese encoding etc. is possible to load. (Suggest for this submitted by Nelson, Bug ID 1643541)
|
||||
[add] A subdirectory "doc" has been added, containing the file "iniFileFormat.html" with info how to write ini files for new indenters.
|
||||
[change] Updated the astyle executable and the ini file to version 1.20.1
|
||||
[change] Restructured the gui design a little bit. Using a moveable dock widget for the indenter settings now. Using a toolbar that can also be placed at the bottom.
|
||||
[change] Made it possible to change the language without the need to restart the application.
|
||||
[change] Line numbers are now geyed out, because this is more decent and selecting the numbers is no longer possible.
|
||||
[change] The link to the homepage in the about dialog now really opens the website.
|
||||
[change] The linux version is now statically linked against Qt so there should be no problems with wrong Qt versions installed or even no Qt libraries installed.
|
||||
[fix] Bug ID 1553601: If no uigui ini file was found the application stopped with an exception.
|
||||
|
||||
2006-09-04 Version 0.3.1 Beta
|
||||
[add] Language selector and german translation added.
|
||||
|
||||
2006-08-25 Version 0.3 Beta
|
||||
[add] A message box will show up at opening a source file or program exit, if the source code has been changed, and ask whether to save the file or not.
|
||||
[add] The symbol "*" will be shown in the window title in front of the source file name if the source code has been changed.
|
||||
[add] By a settings menu entry the tool tips for the indenter parameter settings can be en/disabled because they can be annoying.
|
||||
[add] A settings file is from now on used to remember the last selected indenter and last opened source code file.
|
||||
[add] The source code can now be exported as a PDF or HTML document.
|
||||
[add] Some commands are now faster available by keyboard shortcuts.
|
||||
[fix] The calling name in the indenter ini file for GreatCode was written lower case while the real file name was upper case, which resulted in a program calling error.
|
||||
[fix] Corrected the tab order for the gui elements.
|
||||
[change] Optimized speed when switching between the available indenters. If the indenters ini file is large, this still takes some time.
|
||||
|
||||
2006-08-11 Version 0.2.5 Alpha
|
||||
[add] when loading or saving either a source code or config file the load/save dialog will open in the files directory and not allways in the UniversalIndentGUI dir
|
||||
[add] currently made settings for the indenter can be saved to any file
|
||||
[add] the menue entries for loading and saving the indenter config file have now icons
|
||||
[add] the currently opened source code file name and path will be shown in the window title bar
|
||||
[add] a error dialog that will be shown once if the indenter executable for the selected indenter does not exist
|
||||
[fix] turning syntax highlight on/off did first take effect after toggle of preview
|
||||
[fix] the image in the about dialog box was not allways visible
|
||||
|
||||
2006-08-03 Version 0.2.4 Alpha
|
||||
[change] the windows version does no longer need any dlls due to static linking and removing bind to mingwm10.dll
|
||||
[change] the windows version of the GNU Indent is replaced by a DJGPP compiled GNU Indent version, that needs no further DLLs
|
||||
[add] possibility to save the shown/indented source code
|
||||
[fix] the file extension used to call the selected indenter. It is now equal to the loaded source file extension so the indenter recognizes the source code language
|
||||
[fix] unnecessary calls of the indenter removed
|
||||
[fix] indenter was not called if preview was activated and indenter changed
|
||||
[fix] under linux the file mask for the open source file dialog did not work correctly
|
||||
|
||||
2006-07-16 Version 0.2.3 Alpha
|
||||
[add] possibility to edit the source code while preview is active and see how it is formatted. So that is real live ;-)
|
||||
|
||||
2006-07-14 Version 0.2.2 Alpha
|
||||
[add] ini file for GNU Indent with some first settings (if any one wants to write more in it let me know)
|
||||
[add] a menu bar for more pleasent and common use of the program (some not yet used menu items are disabled)
|
||||
[add] an about dialog
|
||||
[add] some icons for better look and feel (can you feel it ;-) )
|
||||
[fix] a bug under linux which caused an endless loop if text was edited
|
||||
|
||||
2006-07-07 Version 0.2.1.1 Alpha (win32 only)
|
||||
- previously compiled using Visual Studio 2005 Express, whereby an additional installation of a redistributable package was needed to run UniversalIndentGUI. To avoid this and not force the user to install anything, now using mingw to compile.
|
||||
|
||||
2006-07-04 Version 0.2.1 Alpha
|
||||
[add] function to load config file (not the uigui ini file) of every indenter (and reenabled load config file button)
|
||||
[add] use of a default value when loading a indenter config file and not all parameters are set.
|
||||
[add] all documented default parameters of GreatCode and Astyle to their ini files.
|
||||
[fix] loading of file mask for source code file after changing indenter
|
||||
[fix] call of indenter failed under win32 if a linux binary exists.
|
||||
|
||||
2006-06-30 Version 0.2.0 Alpha
|
||||
[add] missing parameters for flexible indenter ini file format
|
||||
[add] complete Astyle ini file
|
||||
[add] multiple choice combobox for parameters
|
||||
[add] checkbox in front of numeric and string parameters to enable/disable them. If disabled indenters default value is used
|
||||
|
||||
2006-06-28
|
||||
[add] working ini file for Astyle (right now only few boolean parameters)
|
||||
[change] ini file format for booleans to reach the planned flexibility
|
||||
|
||||
2006-06-23
|
||||
[add] combobox in the upper left showing available indenters (found by searching for uigui_*.ini file). at the moment only GreatCode and testwise Astyle
|
||||
[add] more detailed info if the indenter call results in an error
|
||||
[add] icon for executable
|
||||
[change] style/format of the ini file. Still not all planned features implemented
|
||||
- some bugfixes, as you can say this in a preAlpha
|
||||
|
||||
2006-06-07
|
||||
[change] unnecessary gui menu removed
|
||||
[fix] corrected ini file for great code (only in executable release)
|
||||
[add] made call of windows version of GreatCode under Linux possible by using wine
|
||||
2012-01-01 Version 1.2.0
|
||||
[add] The Linux version has a menu entry in the application development menu now.
|
||||
[add] The Linux version has a mime type association to some code files now, so that UiGUI is available as "open with".
|
||||
[add] Added support for the Visual Basic beautifier VBSBeautifier.
|
||||
[add] Added support for the SQL beautifier Pl/Sql tidy.
|
||||
[add] Updated the Artistic Style configuration to support Artistic Style version 2.02.1.
|
||||
[add] Updated the Uncrustify configuration to support Uncrustify version 0.59.
|
||||
[add] Updated the PerlTidy configuration to support PerlTidy version 1.74.
|
||||
[add] Updated the Ruby Script Beautifier to version 2.9.
|
||||
[fix] Bug ID 3021933: Updated the Artistic Style configuration to support Artistic Style version 2.01.
|
||||
[fix] Bug ID 3021931: Fixed calling of Artistic Style version 1.22 and later.
|
||||
[fix] Bug ID 3006513: Fixed compiling UiGUI using GCC 4.5 and later.
|
||||
[fix] Bug ID 2942381: When loading an indenter configuration file, the settings displayed in the docking widget were correctly updated, but the code wasn't.
|
||||
[fix] Bug ID 2135872: A zombie process kept on running if UiGUI was quit during the update check in background if no internet connection is available.
|
||||
[fix] Bug ID 3175027: Uncrustify had wrong pop-up comments for two check-boxes.
|
||||
[fix] Bug ID 2916163: The proxy settings are properly used and applied now.
|
||||
[fix] Made the JsDecoder integration be compatible with recent Qt versions.
|
||||
[change] Changed the created shell scripts indenter config file reference. Now each created shell script has a corresponding config file being created in the same dir as the shell script, with the same name but different suffix. But since the config file is referenced by "./", when calling the script the working directory must be the same as the directory containing the config file.
|
||||
[change] Using TCLAP as command line parser instead of own command line parsing.
|
||||
[change] Setting a file name as parameter on the command line without any prefix will load this file instead of the last opened one.
|
||||
[change] Rewritten and improved the internal way how settings are connected to the UI.
|
||||
[change] Refactored and cleaned up the code.
|
||||
[change] Will no longer deliver binary bundles linked against Qt statically. Instead delivering all dependent DLLs and libs.
|
||||
|
||||
2009-07-16 Version 1.1.0
|
||||
[add] Added a logging class, that can catch debug output and make trace backs if any problems occur possible.
|
||||
[add] Added an application icon for Mac OS X.
|
||||
[change] Feature Request ID 2596302 : Updated the greatcode.ini. Thanks to adxadx who has done this work!
|
||||
[change] Feature Request ID 2793216: Updated to Uncrustify 0.53.
|
||||
[change] Updated to JsDecoder version 1.1.0
|
||||
[fix] Bug ID 2791229: If UiGUI was located in a path containing Unicode characters or such a path needed to be handed over to a called indenter, the indenter could get confused on Windows. So using the Windows 8.3 short path notation.
|
||||
[fix] On Mac OS X the used default font wasn't monospaced. Switched back to use Courier on Mac.
|
||||
|
||||
2009-02-12 Version 1.0.2
|
||||
[add] Feature Request ID 2498654 : Added support for the Fortran indenter F90ppr. http://universalindent.sf.net/issue/feature/2498654
|
||||
[add] Made it possible to define "stdin" to be used for an indenter calling.
|
||||
[change] Made the source code be compilable with the slightly older QScintilla version 2.2.
|
||||
[change] When starting the very first time without any existing application settings, do not show the mainwindow at position 0,0. On Mac the window couldn't be moved because the window title bar was hidden under the Mac menu bar.
|
||||
[change] When using a non Windows system the default editor font type is now Monospace instead of Courier. The latter was not found properly.
|
||||
[change] For security reason using a randomly generated temporary directory name on Unix based systems.
|
||||
[change] Improved the GUI updates for the Notepad++ plugin a bit. Not what I would call "good" yet.
|
||||
[fix] Bug ID 2284777 : The Notepad++ plugin was falsely linked against Qt debug dlls, which were not included. http://universalindent.sf.net/issue/bug/2284777
|
||||
[fix] Bug ID 2594251 : The new version available check didn't work anymore since version 1.0.1. http://universalindent.sf.net/issue/bug/2594251
|
||||
[fix] Avoid a crash if an uigui ini file with faulty header info is read, where the indenter executable was empty.
|
||||
[fix] Some application settings were tried to be read from a wrong directory when running in multi user mode.
|
||||
|
||||
2008-10-14 Version 1.0.1
|
||||
[add] Feature Request ID 2161471 : Added support for the Python indenter pindent.
|
||||
[add] Feature Request ID 1883444 : Added support for the JSP indenter JSPPP.
|
||||
[add] Feature Request ID 1867563 : Added support for the XML indenter XML Indent.
|
||||
[add] Support for French language. Thanks to Erwan "leg".
|
||||
[change] Some small translation corrections.
|
||||
[change] Improved the "new version available" check.
|
||||
[change] On Mac and Linux a one pixel frame was shown around the whole screen when about dialog is visible. Removed that.
|
||||
[change] Updated to Uncrustify version 0.49 from SVN repository.
|
||||
[change] Using a new logo icon for UniversalIndentGUI. The logo was created by Erwan "leg". Thanks!
|
||||
[fix] Bug ID 2173527 : Could not load Artistic Style config file properly if both parameters "--brackets=linux" and "--brackets=break-closing" were set. http://universalindent.sf.net/issue/2173527
|
||||
[fix] The distributed version of GNU Indent was using a misspelled configuration file, thus lieve preview didn't correctly work. Using original GNU Win32 version now.
|
||||
[fix] In version 1.0.0 the creation of batch files for indenters undet Windows always created a bash/shell script instead of batch.
|
||||
[fix] Keyboard shortcuts for enabling/disabling "Live Preview" and syntax highlighting didn't work.
|
||||
|
||||
2008-09-30 Version 1.0.0 non public release. Only presented for Qt Centre programming contest.
|
||||
[add] Made it possible to start UiGUI in different modes via parameters: Normal (full UI), plugin (only indenter menu, server active), server only.
|
||||
[add] Added a server functionality. Future plan is to let UiGUI run also as server so plugins from other editors can send indent requests over TCP/IP to it. Very early state right now.
|
||||
[add] Created a plugin for Notepad++. This plugin shows the indenter parameter menu and lets the user indent the selected or whole text. Live preview works also. Still has some eventloop graphic update problems.
|
||||
[add] Added support for two (rather simple) Ruby beautifiers, ruby_formatter and rbeautify.
|
||||
[add] Feature Request ID 1985475 : Added the possibility to reset all indenter parameters to default values. http://universalindent.sf.net/issue/1985475
|
||||
[add] Feature Request ID 1989585 : Added a context menu in indenter parameters widget and moved all functions handling these actions from the main window to the indent handler. http://universalindent.sf.net/issue/1989585
|
||||
[add] Feature Request ID 1977033 : Now supporting the Cobol intender Cobol Beautifier. http://universalindent.sf.net/issue/1977033
|
||||
[add] Feature Request ID 2080832 : Now showing the cursors current line and column number in the statusbars down right corner. http://universalindent.sf.net/issue/2080832
|
||||
[change] Using Qt >= 4.4.x now and thereby implemented an animated 3D about dialog.
|
||||
[change] Using QScintilla >= 2.3 now and thereby added support for Cmake, Fortran[77], Pascal, PostScript, TCL, VHDL, XML and YAML.
|
||||
[change] Reformatted the about dialog to only contain one QTextEdit. Also added some more links to that text.
|
||||
[change] Limited the size of the combobox showing the indenters because with the supported programming languages in the name, the comobox was to large in width.
|
||||
[change] Prevent php file from being tried to be executed directly. That could happen if the file has the execution flag set. However that should never be the case, so this is a workaround.
|
||||
[change] Added a new class UiguiIniFileParser which will replace the currently used QSettings for reading the indenter parameters. Thus parameters appear in the menu in the same order as in the ini file and are no longer alphabetically sorted.
|
||||
[change] Redesigned the user interface and code a bit. The indenter selection combo box along with the manual button are now placed in docking widget where all indenter parameters are placed. This is done in preparation to pull out the complete indent handler, so it can be used as plugin for Notepad++ or Eclipse etc.]
|
||||
[change] Made reading the indenter config files more tolerant. If the user disobeys case sensitivity when editing the config file by hand, the values are correctly parsed anyway.
|
||||
[change] Feature Request ID 1989587 : There is no longer any need to have a current value setting in the ini files. A default value is enough. http://universalindent.sf.net/issue/1989587
|
||||
[change] Completely removed QT3Support functions.
|
||||
[change] Removed all compiler warnings.
|
||||
[change] Changed the way internal settings are handled. Using QObject propertys for connected setting name now.
|
||||
[fix] The by each indenter supported programming languages, written in braces, are removed from the created shell scripts name.
|
||||
[fix] Corrected the move/mv commands parameter in the created shell and batch script when calling recursive.
|
||||
[fix] Bug ID 1986471 : The file modification flag did not work properly. Reason was that QScintilla can not set its textedit component modified flag to true by a function call. http://universalindent.sf.net/issue/1986471
|
||||
|
||||
2008-05-26 Version 0.8.2
|
||||
[add] Feature Request ID 1971206 : Now showing by the indenter supported programming languages next to indenter name.
|
||||
[add] Feature Request ID 1971181 : Added support for the HTML indenter HTB.
|
||||
[add] Feature Request ID 1867562 : Added support for the HTML indenter hindent.
|
||||
[add] Added support for the php indenter phpStylist version 1.0.
|
||||
[add] Added the possibility to directly setting php files as indenter. The suffix .php is recognized and php used as default interpreter.
|
||||
[add] Extended the created batch/shell script so it is able to indent only one file given as parameter or a whole directory recursively with a defined file suffix.
|
||||
[add] Feature Request ID 1885911 : Added the possibility to open a file on applications start, that is handed over as parameter on the command line.
|
||||
[add] Feature Request ID 1729429 : Added the possibility to drag'n drop in any source code file for opening it.
|
||||
[change] Created indenter shell scripts now automatically have the executable flag set to true.
|
||||
[change] Completed the support for all perl tidy parameters.
|
||||
[change] Updated to uncrustify version 0.46.
|
||||
[fix] Bug ID 1933074 : On Unix systems the user config files were stored in his home dir in the subfolder ".config". Now they are directly stored in ".universalindentgui".
|
||||
[fix] Fixed a bug where the string "<html><body>" was prepended to the output code. Occurred for example when using the shell indenter.
|
||||
|
||||
2008-03-27 Version 0.8.1
|
||||
[add] Feature Request ID 1909450 : Added support for the PEAR PHP beautifier. Thus PHP beautifying is also possible on Linux and Mac OS X. (Needs the PEAR package "PHP_Beautifier" to be installed and a path entry pointing to the PHP dir.)
|
||||
[add] Added support and translations for Russian and Ukrainian language. Thanks to Oleksandr (http://korytskyy.lviv.ua).
|
||||
[add] Feature Request ID 1901935 : From now on files are saved with the same encoding as they were opened and no longer always UTF-8. Also it is possible to save the file with any other encoding.
|
||||
[change] The detection whether to run in portable mode now depends on where the "config" folder resides and no longer the "indenters" folder. This is needed to be able to correctly run on Windows multiuser systems.
|
||||
[change] Removed the word "beta" whereever it occurred, since UiGUI isn't that beta anymore.
|
||||
[fix] Bug ID 1910773 : On Unix systems the globally available files, like indenters, translations etc are not longer installed to /etc/universalindentgui but to /usr/share/universalindentgui.
|
||||
|
||||
2008-01-17 Version 0.8.0 Beta
|
||||
[add] Feature Request ID 1849297 : Added support for indenters written in JavaScript using an internal interpreter. Have a look into the README.txt to get to know, what steps are needed for that.
|
||||
[add] Added support for a simple JavaScript indenter written in JavaScript itself.
|
||||
[add] Added support for a simple shell code indenter written in awk.
|
||||
[add] Feature Request ID 1736946 : It is now possible to run any indenter that is available in the global environment via a path entry.
|
||||
[add] Feature Request ID 1852483 : Indenters written in script languages, like perl, are now also supported, if they have a correct shebang.
|
||||
[add] Added support for the well known perltidy. The uigui ini file is completed up to the category and including "Line Break Control". Rest needs to be done.
|
||||
[add] Feature Request ID 1866599 : Adapted the used paths for settings, temporary files and the one containing indenter ini files to be conform with systems that use strict user rights management. Most this concerns Linux, where the binary resides inside a bin dir and user specific settings are stored in his home dir. Short: now supporting multiuser systems and also have a portable mode, where modifications are only on local media.
|
||||
[add] Feature Request ID 1730360 : Along with real support for multiuser systems, each user can have his own indenter settings. These won't be overwritten by an update, what was the case before.
|
||||
[add] Feature Request ID 1867628 : Added a button to the toolbar near the indenter selection that opens the indenters online manual.
|
||||
[add] Feature Request ID 1867660 : Created a simple man page for unix based systems.
|
||||
[add] The by the qmake projekt file resulting makefile has a directive for install on unix based systems now.
|
||||
[add] Added example files for most supported programming languages, so each indenter can be tested.
|
||||
[change] The source code archive is now in a Unix conform format and naming convention.
|
||||
[change] The used paths have changed. The "data" directory has been renamed to indenters and includes only the uigui ini files and maybe some indenter binaries. Futher a config and a temp directory are used.
|
||||
[change] In case of an error during calling the indenter, its standard output is appended to the error dialog.
|
||||
[change] Corrected some misspelling.
|
||||
[change] Renamed htmltidy to tidy because that is its official name and also the name of the binary in all Linux packages.
|
||||
[fix] Bug ID 1855460 : The parameter settings of the indenter were only saved, if preview is turned on. Now the settings are always remembered.
|
||||
[fix] Bug ID 1854156 : The syntax highlighter did not switch to perl if a file with suffix .pl or .pm was loaded.
|
||||
|
||||
2007-11-22 Version 0.7.1 Beta
|
||||
[add] Feature Request ID 1833814 : Added support for building on MacOSX.
|
||||
[change] Feature Request ID 1836486 : Update to latest version of Uncrustify.
|
||||
[change] Update to latest version of Artistic Styler.
|
||||
|
||||
2007-11-11 Version 0.7.0 Beta
|
||||
[add] Feature Request ID 1826733 : If the called indenter returns an error message, you can chose to not show the same error again. Helpful for HTMLtidy since it often shows a long, repeating error list.
|
||||
[add] Feature Request ID 1805974 : Added an option to clear the list of recently opened files.
|
||||
[add] Feature Request ID 1760997 : Added some code lines to example.cpp to test whether an indenter correctly handles preprocessor defines.
|
||||
[add] Feature Request ID 1752551 : If the user manually checks for updates a progress/busy dialog will be shown.
|
||||
[add] Feature Request ID 1736932 : The user gets shown a dialog if he has manually checked for an update and no new one is available.
|
||||
[change] The update check is now enabled by default.
|
||||
[change] Slighty changes made to the settings dialog; put texts in front of the changed value.
|
||||
[fix] Bug ID 1807179 : GNU Indent didn't work properly on Windows system, after the dlls libiconv-2.dll and libintl-2.dll were removed. Readded them.
|
||||
[fix] Bug ID 1805976 : The HTML export didn't produce any output. Fixed that, but still has not syntax formatting.
|
||||
[fix] Bug ID 1815023 : Mixed traditional with simplified chinese translation. Now preferring to use english text instead of mixing if no traditional translation is available.
|
||||
[fix] Bug ID 1815120 : The font of the editor component was wrong (not monospaced), if syntax highlighting was turned off.
|
||||
|
||||
2007-06-13 Version 0.6.1 Beta
|
||||
[add] Feature Request ID 1729433 : Added a recently opened file menu.
|
||||
[add] Feature Request ID 1704290 : Added possibiltiy to integrate into an IDE, editor or other as external tool. This is donw by creating a batch/shell script which accepts a file as parameter and calls the indenter with the in UniversalIndentGUI made settings.
|
||||
[add] Feature Request ID 1673659 : The string parameter in the uigui ini files for each indenter can now also be a list of strings divided by "|" sign. As result the parameter name with value will be written to the indenter config file for each of the values.
|
||||
[add] Feature Request ID 1730180 : UniversalIndentGUI can automatically check on start, whether a new version is available. This setting is disabled by default and can be enabled in the settings.
|
||||
[add] Added support for HTML Tidy. The executable is contained in the release package.
|
||||
[add] Feature Request ID 1736432 : The width of the dock widget containing the indenter parameters is now restored on program start.
|
||||
[change] The about dialog shows now a credits scroller to say thanks to all people, who have helped me somehow.
|
||||
[fix] Bug ID 1733499 : UniversalIndentGui crashed if inside of an indenter ini file the category number of one parameter was higher than the available categories.
|
||||
[fix] Bug ID 1735586 : Some dialogs had untranslated buttons. For example yes, no, cancel were not translated.
|
||||
|
||||
2007-06-03 Version 0.6.0 Beta
|
||||
[add] Feature Request ID 1700557 : Added a settings dialog for handling more possible settings with better usabiltiy.
|
||||
[add] Feature Request ID 1700556 : Added option to load last file or not on startup.
|
||||
[add] Feature Request ID 1684011 : Added option to set the width used to display tabs (default is four spaces).
|
||||
[add] Feature Request ID 1651718 : Added multiple choices, for the indenter configuration, with for the user readable text. Before the text inside of the combo boxes for the indenter parameters was exactly the same text as the command line parameter of the indenter. Now with "ChoicesReadable" a list with the same length as "Choices" can be used to insert readable text into the combo box. If this list is not set, the content of "Choices" will be used.
|
||||
[add] Partly Japanese translation. Thanks to Nirvash.
|
||||
[add] The language selection show the countries flag in front of its name to identify the language faster.
|
||||
[add] Feature Request ID 1657253 : If now configuration ini file for any indenter can be found, a warning will be displayed.
|
||||
[change] Feature Request ID 1723228 : The default font for all syntax highlighters is now mono spaced, Courier.
|
||||
[change] Along with the settings dialog cleaned up the user interface. Moved some not that often needed settings away to the settings dialog.
|
||||
[change] The full text of the GPL in the about dialog did slow down the program startup and translation. Now only a hint and link to the GPL is given in the about dialog.
|
||||
[fix] Bug ID 1692511 : UniversalIndentGui crashed, if a by the syntax highlighter unsupported file extension was opened.
|
||||
[fix] Bug ID 1727538 : The setting for syntax highlighting was allways enabled on startup, even if disabled on closing.
|
||||
[fix] Bug ID 1729026 : The highlighting style was not correct when changed to another highlighter than the current. Only after toggling preview for example the style was correct.
|
||||
[fix] The editors column showing the line numbers did not adapt its width to the maximum line number.
|
||||
|
||||
2007-03-19 Version 0.5.1 Beta
|
||||
[add] Supporting syntax highlightning for the programming language D.
|
||||
[change] The live typing and indenting feature was not adapted to QScintilla. Now works again (depending on the used indenter).
|
||||
[fix] Bug ID 1678783 : Files other encoded than ascii were not displayed correctly. Now allways displaying files using UTF-8 encoding.
|
||||
[fix] Bug ID 1678783 : The new syntax highlighter selection menu was not translated.
|
||||
[fix] When file was reloaded with other encoding the file was allways set to be modified even if it wasn't.
|
||||
|
||||
2007-03-14 Version 0.5.0 Beta
|
||||
[add/change] Using QScintilla as editing component, which is by far more mighty than the before uses QTextEdit. Have a look inside the development area for details.
|
||||
[add] Because of QScintilla, added syntax highlightning for bash, batch, cpp, csharp, css, diff, html, idl, java, javascript, lua, makefile, perl, pov, ini, python, ruby, sql and tex.
|
||||
[add] Also added code folding for previously mentioned languages.
|
||||
[add] Added support for the indenter "phpCB" phpCodeBeatufier. (Thanks to Nelson Tai) The executable is not included in the UiGui release, because I am not sure about the license of phpCB right now.
|
||||
[add] The output of an indenter can now be read from stdout, by setting "stdout" for "outputFileParameter".
|
||||
[add] Feature Request ID 1673549 : The order of the indenter call parameters for input file, output file and options[file] is now selectable in three states: pio, ipo, iop.
|
||||
[add] Feature Request ID 1675503 : The last set encoding is being remembered and used on loading last file.
|
||||
[add] Feature Request ID 1669822 : The last window position, size and maximized state is stored in the settings and restored.
|
||||
[add] Feature Request ID 1673670 : Made it possible to switch between visible and invisible white space characters, like spaces and tabs.
|
||||
[change] The "personal" configuration files of each indenter (like gc.cfg) are no longer included in a release, so these settings can be loaded into UiGui after updating.
|
||||
[fix] Bug ID 1678783: If the current opened file had no save name yet, only the path was written to the settings file, causing an error on next start.
|
||||
|
||||
2007-02-25 Version 0.4.2 Beta
|
||||
[add] Support for the indenter CSSTidy has been added.
|
||||
[add] Support for new language: Taiwan (Chinese).
|
||||
[change] For easier translation the about dialog has been redesigned a bit.
|
||||
2007-02-11 Version 0.4.1 Beta
|
||||
[add] Support for the indenter Uncrustify has been added.
|
||||
[add] Feature Request ID 1651719: A binary release for Linux AMD64 is now available.
|
||||
[add] Feature Request ID 1657251: If only a win32 executable exists under Linux, wine will be used to call it. Now a test will be mad if wine is installed and an error message will show up if not installed.
|
||||
[change] Some changes mad to the Artistic Styler ini file as suggested by its author Jim Pattee.
|
||||
[change] Put the file open button at first position in the toolbar, because normally this is the first step one would do, if he tries to find the optimal indenter and settings for himself.
|
||||
[change] The background in the about dialog has been changed to look equal on all systems.
|
||||
[change] The error message dialogs had small optical enhancements to be more readable.
|
||||
[fix] Bug ID 1657255: If an error occurred during the try to call the indenter, a message box is being shown, but the mouse cursor still indicated that the application is being busy.
|
||||
[fix] Bug ID 1651071: Changing the file encoding did not affect the code sent to the indenter, so the code while preview turned on, had wrong encoding (still seems to have some encoding problems under Linux).
|
||||
[fix] Bug ID 1650222: On Windows systems there were two DLLs missing to run GNU Indent ("libiconv-2.dll" and "libintl-2.dll")
|
||||
[fix] Bug ID 1649918: The indenter was not called after first program start, so preview updated first after changing a setting or the code.
|
||||
|
||||
2007-02-01 Version 0.4 Beta
|
||||
[add] All parameters of GNU Indent have been added.
|
||||
[add] From now on the indenter BCPP is included.
|
||||
[add] The loaded source file encoding is now convertable by the menu entry "Reopen File with other Encoding". This way chinese encoding etc. is possible to load. (Suggest for this submitted by Nelson, Bug ID 1643541)
|
||||
[add] A subdirectory "doc" has been added, containing the file "iniFileFormat.html" with info how to write ini files for new indenters.
|
||||
[change] Updated the astyle executable and the ini file to version 1.20.1
|
||||
[change] Restructured the gui design a little bit. Using a moveable dock widget for the indenter settings now. Using a toolbar that can also be placed at the bottom.
|
||||
[change] Made it possible to change the language without the need to restart the application.
|
||||
[change] Line numbers are now geyed out, because this is more decent and selecting the numbers is no longer possible.
|
||||
[change] The link to the homepage in the about dialog now really opens the website.
|
||||
[change] The linux version is now statically linked against Qt so there should be no problems with wrong Qt versions installed or even no Qt libraries installed.
|
||||
[fix] Bug ID 1553601: If no uigui ini file was found the application stopped with an exception.
|
||||
|
||||
2006-09-04 Version 0.3.1 Beta
|
||||
[add] Language selector and german translation added.
|
||||
|
||||
2006-08-25 Version 0.3 Beta
|
||||
[add] A message box will show up at opening a source file or program exit, if the source code has been changed, and ask whether to save the file or not.
|
||||
[add] The symbol "*" will be shown in the window title in front of the source file name if the source code has been changed.
|
||||
[add] By a settings menu entry the tool tips for the indenter parameter settings can be en/disabled because they can be annoying.
|
||||
[add] A settings file is from now on used to remember the last selected indenter and last opened source code file.
|
||||
[add] The source code can now be exported as a PDF or HTML document.
|
||||
[add] Some commands are now faster available by keyboard shortcuts.
|
||||
[fix] The calling name in the indenter ini file for GreatCode was written lower case while the real file name was upper case, which resulted in a program calling error.
|
||||
[fix] Corrected the tab order for the gui elements.
|
||||
[change] Optimized speed when switching between the available indenters. If the indenters ini file is large, this still takes some time.
|
||||
|
||||
2006-08-11 Version 0.2.5 Alpha
|
||||
[add] when loading or saving either a source code or config file the load/save dialog will open in the files directory and not allways in the UniversalIndentGUI dir
|
||||
[add] currently made settings for the indenter can be saved to any file
|
||||
[add] the menue entries for loading and saving the indenter config file have now icons
|
||||
[add] the currently opened source code file name and path will be shown in the window title bar
|
||||
[add] a error dialog that will be shown once if the indenter executable for the selected indenter does not exist
|
||||
[fix] turning syntax highlight on/off did first take effect after toggle of preview
|
||||
[fix] the image in the about dialog box was not allways visible
|
||||
|
||||
2006-08-03 Version 0.2.4 Alpha
|
||||
[change] the windows version does no longer need any dlls due to static linking and removing bind to mingwm10.dll
|
||||
[change] the windows version of the GNU Indent is replaced by a DJGPP compiled GNU Indent version, that needs no further DLLs
|
||||
[add] possibility to save the shown/indented source code
|
||||
[fix] the file extension used to call the selected indenter. It is now equal to the loaded source file extension so the indenter recognizes the source code language
|
||||
[fix] unnecessary calls of the indenter removed
|
||||
[fix] indenter was not called if preview was activated and indenter changed
|
||||
[fix] under linux the file mask for the open source file dialog did not work correctly
|
||||
|
||||
2006-07-16 Version 0.2.3 Alpha
|
||||
[add] possibility to edit the source code while preview is active and see how it is formatted. So that is real live ;-)
|
||||
|
||||
2006-07-14 Version 0.2.2 Alpha
|
||||
[add] ini file for GNU Indent with some first settings (if any one wants to write more in it let me know)
|
||||
[add] a menu bar for more pleasent and common use of the program (some not yet used menu items are disabled)
|
||||
[add] an about dialog
|
||||
[add] some icons for better look and feel (can you feel it ;-) )
|
||||
[fix] a bug under linux which caused an endless loop if text was edited
|
||||
|
||||
2006-07-07 Version 0.2.1.1 Alpha (win32 only)
|
||||
- previously compiled using Visual Studio 2005 Express, whereby an additional installation of a redistributable package was needed to run UniversalIndentGUI. To avoid this and not force the user to install anything, now using mingw to compile.
|
||||
|
||||
2006-07-04 Version 0.2.1 Alpha
|
||||
[add] function to load config file (not the uigui ini file) of every indenter (and reenabled load config file button)
|
||||
[add] use of a default value when loading a indenter config file and not all parameters are set.
|
||||
[add] all documented default parameters of GreatCode and Astyle to their ini files.
|
||||
[fix] loading of file mask for source code file after changing indenter
|
||||
[fix] call of indenter failed under win32 if a linux binary exists.
|
||||
|
||||
2006-06-30 Version 0.2.0 Alpha
|
||||
[add] missing parameters for flexible indenter ini file format
|
||||
[add] complete Astyle ini file
|
||||
[add] multiple choice combobox for parameters
|
||||
[add] checkbox in front of numeric and string parameters to enable/disable them. If disabled indenters default value is used
|
||||
|
||||
2006-06-28
|
||||
[add] working ini file for Astyle (right now only few boolean parameters)
|
||||
[change] ini file format for booleans to reach the planned flexibility
|
||||
|
||||
2006-06-23
|
||||
[add] combobox in the upper left showing available indenters (found by searching for uigui_*.ini file). at the moment only GreatCode and testwise Astyle
|
||||
[add] more detailed info if the indenter call results in an error
|
||||
[add] icon for executable
|
||||
[change] style/format of the ini file. Still not all planned features implemented
|
||||
- some bugfixes, as you can say this in a preAlpha
|
||||
|
||||
2006-06-07
|
||||
[change] unnecessary gui menu removed
|
||||
[fix] corrected ini file for great code (only in executable release)
|
||||
[add] made call of windows version of GreatCode under Linux possible by using wine
|
||||
|
@ -1,12 +1,12 @@
|
||||
How to install UniversalIndentGUI
|
||||
---------------------------------
|
||||
|
||||
Well, there is no need to install this application at all. While you are reading this file,
|
||||
you obviously already have unpacked the archive and thats all you need to do. You can start
|
||||
the program by calling its executable. On Windows thats "UniversalIndentGUI.exe" and on any
|
||||
other system it is "UniversalIndentGUI".
|
||||
|
||||
No additional libraries are needed.
|
||||
|
||||
For information about how to build UniversalIndentGUI from source, have a look into the
|
||||
How to install UniversalIndentGUI
|
||||
---------------------------------
|
||||
|
||||
Well, there is no need to install this application at all. While you are reading this file,
|
||||
you obviously already have unpacked the archive and thats all you need to do. You can start
|
||||
the program by calling its executable. On Windows thats "UniversalIndentGUI.exe" and on any
|
||||
other system it is "UniversalIndentGUI".
|
||||
|
||||
No additional libraries are needed.
|
||||
|
||||
For information about how to build UniversalIndentGUI from source, have a look into the
|
||||
file readme.html.
|
File diff suppressed because it is too large
Load Diff
@ -1,59 +1,59 @@
|
||||
000000* An example illustrating the use of a programmer defined paragraphs
|
||||
* and perform-thru
|
||||
identification division.
|
||||
program-id. level88.
|
||||
author. kik.
|
||||
environment division.
|
||||
configuration section.
|
||||
special-names.
|
||||
console is crt
|
||||
decimal-point is comma.
|
||||
data division.
|
||||
working-storage section.
|
||||
77 transaction-kode pic 99.
|
||||
88 valid-kode value 4, 8 thru 15.
|
||||
88 create value 10.
|
||||
88 destroy value 15.
|
||||
|
||||
procedure division.
|
||||
main section.
|
||||
*
|
||||
* Some code leading to "transacion-kode" getting a value
|
||||
*
|
||||
|
||||
move 10 to transaction-kode.
|
||||
|
||||
|
||||
*
|
||||
* Testing the conditions
|
||||
*
|
||||
|
||||
if valid-kode then
|
||||
if create then
|
||||
perform p-create thru p-create-end
|
||||
else
|
||||
if destroy then
|
||||
perform p-destroy thru p-destroy-end
|
||||
else
|
||||
perform ordinary-transaction
|
||||
thru ordinary-transaction-end.
|
||||
|
||||
*
|
||||
p-create.
|
||||
* some creation code
|
||||
p-create-end.
|
||||
exit.
|
||||
|
||||
p-destroy.
|
||||
* some destruction code
|
||||
p-destroy-end.
|
||||
exit.
|
||||
|
||||
ordinary-transaction.
|
||||
* some ordinary data processing code
|
||||
ord-trns-1.
|
||||
|
||||
ord-trns-2.
|
||||
|
||||
ordinary-transaction-end.
|
||||
000000* An example illustrating the use of a programmer defined paragraphs
|
||||
* and perform-thru
|
||||
identification division.
|
||||
program-id. level88.
|
||||
author. kik.
|
||||
environment division.
|
||||
configuration section.
|
||||
special-names.
|
||||
console is crt
|
||||
decimal-point is comma.
|
||||
data division.
|
||||
working-storage section.
|
||||
77 transaction-kode pic 99.
|
||||
88 valid-kode value 4, 8 thru 15.
|
||||
88 create value 10.
|
||||
88 destroy value 15.
|
||||
|
||||
procedure division.
|
||||
main section.
|
||||
*
|
||||
* Some code leading to "transacion-kode" getting a value
|
||||
*
|
||||
|
||||
move 10 to transaction-kode.
|
||||
|
||||
|
||||
*
|
||||
* Testing the conditions
|
||||
*
|
||||
|
||||
if valid-kode then
|
||||
if create then
|
||||
perform p-create thru p-create-end
|
||||
else
|
||||
if destroy then
|
||||
perform p-destroy thru p-destroy-end
|
||||
else
|
||||
perform ordinary-transaction
|
||||
thru ordinary-transaction-end.
|
||||
|
||||
*
|
||||
p-create.
|
||||
* some creation code
|
||||
p-create-end.
|
||||
exit.
|
||||
|
||||
p-destroy.
|
||||
* some destruction code
|
||||
p-destroy-end.
|
||||
exit.
|
||||
|
||||
ordinary-transaction.
|
||||
* some ordinary data processing code
|
||||
ord-trns-1.
|
||||
|
||||
ord-trns-2.
|
||||
|
||||
ordinary-transaction-end.
|
||||
exit.
|
@ -1,349 +1,349 @@
|
||||
#include <a.h>
|
||||
#include <a.h>
|
||||
#include <a.h>
|
||||
|
||||
using namespace a.b.c a;
|
||||
|
||||
PREPROCESSOR()
|
||||
|
||||
BEGIN_MESSAGE_MAP()
|
||||
ON_COMMAND()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
extern struct x y;
|
||||
|
||||
static const class Example :
|
||||
Int1, Int2, Int3
|
||||
{
|
||||
public:
|
||||
Example::~Example() :
|
||||
S1(),
|
||||
S2(),
|
||||
S3() {
|
||||
// if statements with empty braces
|
||||
if( x ) { }
|
||||
else if( x ) { }
|
||||
else { }
|
||||
|
||||
// if statements with exactly one braced statement
|
||||
if( x ) {
|
||||
statement;
|
||||
}
|
||||
else if( x ) {
|
||||
statement;
|
||||
}
|
||||
else {
|
||||
statement;
|
||||
}
|
||||
|
||||
// special 'if' cases
|
||||
if( x ) {
|
||||
statement;
|
||||
}
|
||||
else {
|
||||
statement;
|
||||
}
|
||||
|
||||
if( x ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
else {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
|
||||
// if statements with a single implicit substatement
|
||||
if( x )
|
||||
statement;
|
||||
|
||||
else if( x )
|
||||
statement;
|
||||
|
||||
else
|
||||
statement;
|
||||
|
||||
// if statements with multiple statements
|
||||
if( x ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
else if( x ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
else {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
|
||||
// while statements with a single implicit substatement
|
||||
while( x )
|
||||
statement;
|
||||
|
||||
// while statements with a single implicit 'if' substatement
|
||||
while( x )
|
||||
if( x )
|
||||
statement;
|
||||
|
||||
// while with multiple statements
|
||||
while( x ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
|
||||
// labeled statement
|
||||
label:
|
||||
statement;
|
||||
|
||||
// for statements with a single braced statement
|
||||
for ( x; x; x ) {
|
||||
statement;
|
||||
}
|
||||
|
||||
// do statements with a single braced substatement
|
||||
do {
|
||||
statement;
|
||||
} while ( false );
|
||||
|
||||
// do statement with an empty block
|
||||
do { } while ( x );
|
||||
|
||||
// local blocks
|
||||
{
|
||||
statement;
|
||||
}
|
||||
|
||||
/* Switch blocks:
|
||||
*
|
||||
* You can have case substatements be aligned by giving an example like:
|
||||
*
|
||||
* case 1: statement;
|
||||
*
|
||||
* statement;
|
||||
*
|
||||
* statement;
|
||||
*
|
||||
* etc...
|
||||
*/
|
||||
switch( c ) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
statement;
|
||||
|
||||
statement;
|
||||
|
||||
statement;
|
||||
|
||||
case 4:
|
||||
break; // case with exactly one substatement
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void method( const myClass<item> &x, int [][][] c, ... ) {
|
||||
// try-catch-finally with empty bodies
|
||||
try { }
|
||||
catch(Throwable e) { }
|
||||
finally { }
|
||||
|
||||
// try-catch-finally with exactly one statement
|
||||
try {
|
||||
statement;
|
||||
}
|
||||
catch( Throwable t ) {
|
||||
statement;
|
||||
}
|
||||
finally {
|
||||
statement;
|
||||
}
|
||||
|
||||
// try-catch-finally with multiple statements
|
||||
try {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
catch( Throwable e ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
finally {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// enum statement
|
||||
static typedef enum x
|
||||
{
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
};
|
||||
|
||||
// simple typedef
|
||||
typedef interface static short int x;
|
||||
|
||||
namespace x
|
||||
{
|
||||
// template header
|
||||
template <class T>
|
||||
x y z v() const;
|
||||
|
||||
// pure virtual function, using c-style formal parameters with double parens
|
||||
void v(()) = 0;
|
||||
|
||||
// function with one single line statement and c-style formal parameters
|
||||
void v(( int i )) {
|
||||
statement;
|
||||
};
|
||||
|
||||
// function with no statements
|
||||
myClass<myType>::method() { }
|
||||
};
|
||||
|
||||
template <T> class x
|
||||
{
|
||||
public:
|
||||
|
||||
// operator declarations
|
||||
int operator +();
|
||||
|
||||
int operator []();
|
||||
|
||||
// template method
|
||||
static void A<x>::method() [][][] {
|
||||
asm
|
||||
{
|
||||
- Assembler statements -
|
||||
|
||||
The outside braces are formatted but the asm code is passed through
|
||||
unchanged.
|
||||
}
|
||||
|
||||
asm Single line assembler statements are also just passed through
|
||||
}
|
||||
|
||||
extern void oldStyleFunction()
|
||||
int a;
|
||||
int b;
|
||||
int c; {
|
||||
// various simple statements
|
||||
long int a, b, c;
|
||||
|
||||
long double [] i;
|
||||
|
||||
goto x;
|
||||
|
||||
delete [] x;
|
||||
|
||||
delete [][][] x;
|
||||
|
||||
return x;
|
||||
|
||||
continue label;
|
||||
|
||||
throw e;
|
||||
|
||||
// c-style function calls with double parens
|
||||
b((a, b, c));
|
||||
|
||||
a(());
|
||||
|
||||
// expressions
|
||||
new Object()->field.method();
|
||||
|
||||
s = "string"
|
||||
"split across lines";
|
||||
|
||||
method(a, B::C, 'd');
|
||||
|
||||
z = j[0][0][0] || k * 3 >> ++i + "0" > i++ & (i) == !j;
|
||||
|
||||
int *v;
|
||||
|
||||
int &v;
|
||||
|
||||
x = x * *x;
|
||||
|
||||
(int *)x;
|
||||
|
||||
int (*functionPointer)( x, y, z );
|
||||
|
||||
h[0] += a ? b : ((int)c).d;
|
||||
|
||||
new Handler();
|
||||
}
|
||||
} a, b, c; // struct instances
|
||||
|
||||
class Class2
|
||||
{
|
||||
/* Array creation with multiple non-array elements.
|
||||
*
|
||||
* If you give this example with the elements on the same line, then
|
||||
* Polystyle will automatically vertically align them into a grid when it
|
||||
* fits your code to the page. An alternate style is to have each
|
||||
* element on its own line, like this:
|
||||
* {
|
||||
* x,
|
||||
* y
|
||||
* z
|
||||
* }
|
||||
*/
|
||||
boolean *bools1 =
|
||||
{
|
||||
x, y, z
|
||||
};
|
||||
|
||||
// array creation with a single element
|
||||
boolean bools2 = { x };
|
||||
|
||||
// array creation with no elements
|
||||
boolean bools3 = { };
|
||||
|
||||
// multidimensional array creation
|
||||
const int *** array =
|
||||
{
|
||||
{ 1, 2, 3 },
|
||||
{ 1, 2, 3 },
|
||||
{ 1, 2, 3 },
|
||||
};
|
||||
};
|
||||
|
||||
#if x
|
||||
|
||||
#define x
|
||||
|
||||
#elif a
|
||||
|
||||
#define x
|
||||
|
||||
#else
|
||||
|
||||
#define x
|
||||
|
||||
#define x
|
||||
|
||||
#define x
|
||||
|
||||
#endif
|
||||
|
||||
// see if multi line macros are safely handled:
|
||||
#define multilinemacro do { x= x+5; } while (0); \
|
||||
printf("a multilinemacro"); \
|
||||
printf("a multilinemacro2");
|
||||
#include <a.h>
|
||||
#include <a.h>
|
||||
#include <a.h>
|
||||
|
||||
using namespace a.b.c a;
|
||||
|
||||
PREPROCESSOR()
|
||||
|
||||
BEGIN_MESSAGE_MAP()
|
||||
ON_COMMAND()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
extern struct x y;
|
||||
|
||||
static const class Example :
|
||||
Int1, Int2, Int3
|
||||
{
|
||||
public:
|
||||
Example::~Example() :
|
||||
S1(),
|
||||
S2(),
|
||||
S3() {
|
||||
// if statements with empty braces
|
||||
if( x ) { }
|
||||
else if( x ) { }
|
||||
else { }
|
||||
|
||||
// if statements with exactly one braced statement
|
||||
if( x ) {
|
||||
statement;
|
||||
}
|
||||
else if( x ) {
|
||||
statement;
|
||||
}
|
||||
else {
|
||||
statement;
|
||||
}
|
||||
|
||||
// special 'if' cases
|
||||
if( x ) {
|
||||
statement;
|
||||
}
|
||||
else {
|
||||
statement;
|
||||
}
|
||||
|
||||
if( x ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
else {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
|
||||
// if statements with a single implicit substatement
|
||||
if( x )
|
||||
statement;
|
||||
|
||||
else if( x )
|
||||
statement;
|
||||
|
||||
else
|
||||
statement;
|
||||
|
||||
// if statements with multiple statements
|
||||
if( x ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
else if( x ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
else {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
|
||||
// while statements with a single implicit substatement
|
||||
while( x )
|
||||
statement;
|
||||
|
||||
// while statements with a single implicit 'if' substatement
|
||||
while( x )
|
||||
if( x )
|
||||
statement;
|
||||
|
||||
// while with multiple statements
|
||||
while( x ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
|
||||
// labeled statement
|
||||
label:
|
||||
statement;
|
||||
|
||||
// for statements with a single braced statement
|
||||
for ( x; x; x ) {
|
||||
statement;
|
||||
}
|
||||
|
||||
// do statements with a single braced substatement
|
||||
do {
|
||||
statement;
|
||||
} while ( false );
|
||||
|
||||
// do statement with an empty block
|
||||
do { } while ( x );
|
||||
|
||||
// local blocks
|
||||
{
|
||||
statement;
|
||||
}
|
||||
|
||||
/* Switch blocks:
|
||||
*
|
||||
* You can have case substatements be aligned by giving an example like:
|
||||
*
|
||||
* case 1: statement;
|
||||
*
|
||||
* statement;
|
||||
*
|
||||
* statement;
|
||||
*
|
||||
* etc...
|
||||
*/
|
||||
switch( c ) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
statement;
|
||||
|
||||
statement;
|
||||
|
||||
statement;
|
||||
|
||||
case 4:
|
||||
break; // case with exactly one substatement
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void method( const myClass<item> &x, int [][][] c, ... ) {
|
||||
// try-catch-finally with empty bodies
|
||||
try { }
|
||||
catch(Throwable e) { }
|
||||
finally { }
|
||||
|
||||
// try-catch-finally with exactly one statement
|
||||
try {
|
||||
statement;
|
||||
}
|
||||
catch( Throwable t ) {
|
||||
statement;
|
||||
}
|
||||
finally {
|
||||
statement;
|
||||
}
|
||||
|
||||
// try-catch-finally with multiple statements
|
||||
try {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
catch( Throwable e ) {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
finally {
|
||||
statement;
|
||||
|
||||
statement;
|
||||
|
||||
statement;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// enum statement
|
||||
static typedef enum x
|
||||
{
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
};
|
||||
|
||||
// simple typedef
|
||||
typedef interface static short int x;
|
||||
|
||||
namespace x
|
||||
{
|
||||
// template header
|
||||
template <class T>
|
||||
x y z v() const;
|
||||
|
||||
// pure virtual function, using c-style formal parameters with double parens
|
||||
void v(()) = 0;
|
||||
|
||||
// function with one single line statement and c-style formal parameters
|
||||
void v(( int i )) {
|
||||
statement;
|
||||
};
|
||||
|
||||
// function with no statements
|
||||
myClass<myType>::method() { }
|
||||
};
|
||||
|
||||
template <T> class x
|
||||
{
|
||||
public:
|
||||
|
||||
// operator declarations
|
||||
int operator +();
|
||||
|
||||
int operator []();
|
||||
|
||||
// template method
|
||||
static void A<x>::method() [][][] {
|
||||
asm
|
||||
{
|
||||
- Assembler statements -
|
||||
|
||||
The outside braces are formatted but the asm code is passed through
|
||||
unchanged.
|
||||
}
|
||||
|
||||
asm Single line assembler statements are also just passed through
|
||||
}
|
||||
|
||||
extern void oldStyleFunction()
|
||||
int a;
|
||||
int b;
|
||||
int c; {
|
||||
// various simple statements
|
||||
long int a, b, c;
|
||||
|
||||
long double [] i;
|
||||
|
||||
goto x;
|
||||
|
||||
delete [] x;
|
||||
|
||||
delete [][][] x;
|
||||
|
||||
return x;
|
||||
|
||||
continue label;
|
||||
|
||||
throw e;
|
||||
|
||||
// c-style function calls with double parens
|
||||
b((a, b, c));
|
||||
|
||||
a(());
|
||||
|
||||
// expressions
|
||||
new Object()->field.method();
|
||||
|
||||
s = "string"
|
||||
"split across lines";
|
||||
|
||||
method(a, B::C, 'd');
|
||||
|
||||
z = j[0][0][0] || k * 3 >> ++i + "0" > i++ & (i) == !j;
|
||||
|
||||
int *v;
|
||||
|
||||
int &v;
|
||||
|
||||
x = x * *x;
|
||||
|
||||
(int *)x;
|
||||
|
||||
int (*functionPointer)( x, y, z );
|
||||
|
||||
h[0] += a ? b : ((int)c).d;
|
||||
|
||||
new Handler();
|
||||
}
|
||||
} a, b, c; // struct instances
|
||||
|
||||
class Class2
|
||||
{
|
||||
/* Array creation with multiple non-array elements.
|
||||
*
|
||||
* If you give this example with the elements on the same line, then
|
||||
* Polystyle will automatically vertically align them into a grid when it
|
||||
* fits your code to the page. An alternate style is to have each
|
||||
* element on its own line, like this:
|
||||
* {
|
||||
* x,
|
||||
* y
|
||||
* z
|
||||
* }
|
||||
*/
|
||||
boolean *bools1 =
|
||||
{
|
||||
x, y, z
|
||||
};
|
||||
|
||||
// array creation with a single element
|
||||
boolean bools2 = { x };
|
||||
|
||||
// array creation with no elements
|
||||
boolean bools3 = { };
|
||||
|
||||
// multidimensional array creation
|
||||
const int *** array =
|
||||
{
|
||||
{ 1, 2, 3 },
|
||||
{ 1, 2, 3 },
|
||||
{ 1, 2, 3 },
|
||||
};
|
||||
};
|
||||
|
||||
#if x
|
||||
|
||||
#define x
|
||||
|
||||
#elif a
|
||||
|
||||
#define x
|
||||
|
||||
#else
|
||||
|
||||
#define x
|
||||
|
||||
#define x
|
||||
|
||||
#define x
|
||||
|
||||
#endif
|
||||
|
||||
// see if multi line macros are safely handled:
|
||||
#define multilinemacro do { x= x+5; } while (0); \
|
||||
printf("a multilinemacro"); \
|
||||
printf("a multilinemacro2");
|
||||
|
@ -1,272 +1,272 @@
|
||||
/* General
|
||||
/*******************************/
|
||||
body
|
||||
{
|
||||
font-size: Small;
|
||||
margin: 30px 0 20px 0;
|
||||
background: url(images/background.jpg);
|
||||
}
|
||||
|
||||
span
|
||||
{
|
||||
font-family: Tahoma,serif;
|
||||
}
|
||||
|
||||
/* Page
|
||||
/*******************************/
|
||||
#page
|
||||
{
|
||||
width: 808px;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
/* Links general
|
||||
/*******************************/
|
||||
a
|
||||
{
|
||||
color: #36b;
|
||||
}
|
||||
|
||||
a:link { text-decoration:none; }
|
||||
a:visited { text-decoration:none; }
|
||||
a:active { text-decoration:none; }
|
||||
a:focus { text-decoration:none; }
|
||||
a:hover { text-decoration:underline; }
|
||||
|
||||
/* Links external
|
||||
/*******************************/
|
||||
a.external
|
||||
{
|
||||
background: url("images/externallinks.png") center right no-repeat;
|
||||
padding-right: 13px;
|
||||
}
|
||||
|
||||
/* Header
|
||||
/*******************************/
|
||||
#header
|
||||
{
|
||||
float: left;
|
||||
width: 800px;
|
||||
height: 171px;
|
||||
background-image: url(images/banner.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: left bottom;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
/* Tabs
|
||||
/*******************************/
|
||||
#tabs
|
||||
{
|
||||
}
|
||||
|
||||
#tabs ul
|
||||
{
|
||||
list-style: none;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#tabs li
|
||||
{
|
||||
width: 125px;
|
||||
float: left;
|
||||
background-image: url(images/tab3.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#tabs li a
|
||||
{
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
font-weight: normal;
|
||||
color: black;
|
||||
height: 28px;
|
||||
padding: 21px 0 0 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#tabs li a:link { text-decoration:none; }
|
||||
#tabs li a:visited { text-decoration:none; }
|
||||
#tabs li a:active { text-decoration:none; }
|
||||
#tabs li a:focus { text-decoration:none; }
|
||||
#tabs li a:hover
|
||||
{
|
||||
width: 125px;
|
||||
float: left;
|
||||
background-image: url(images/tab3hover.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#tabs #current
|
||||
{
|
||||
background-image: url(images/tab3_selected.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
#tabs #current a
|
||||
{
|
||||
background-image: url(images/tab3_selected.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
padding: 27px 0;
|
||||
height: 17px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Main
|
||||
*******************************/
|
||||
#main
|
||||
{
|
||||
background-image: url(images/page_middle.png);
|
||||
background-repeat: repeat-y;
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* Content
|
||||
/*******************************/
|
||||
#content
|
||||
{
|
||||
padding: 22px;
|
||||
margin: 0;
|
||||
width: 541px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#content h1, h2, h3, h4, h5, h6, h7, #content h2 a
|
||||
{
|
||||
font-family: Tahoma,serif;
|
||||
margin-bottom: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#content h1
|
||||
{
|
||||
font-size: x-large;
|
||||
}
|
||||
|
||||
#content h2
|
||||
{
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
#content p, #content ul, #content a, #content ol
|
||||
{
|
||||
margin-top: 10px;
|
||||
font-family: verdana, sans-serif;
|
||||
}
|
||||
|
||||
/* Progress
|
||||
/*******************************/
|
||||
.progressframe
|
||||
{
|
||||
border: 1px black solid;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress
|
||||
{
|
||||
font-family: Tahoma,serif;
|
||||
font-weight: bold;
|
||||
/*padding-left: 10px;*/
|
||||
background-color: red;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.p0 { width: 0%; color: black; background-color: white; }
|
||||
.p5 { width: 5%; background-color: rgb(240,16,0); }
|
||||
.p10 { width: 10%; background-color: rgb(240,32,0); }
|
||||
.p15 { width: 15%; background-color: rgb(240,48,0); }
|
||||
.p20 { width: 20%; background-color: rgb(240,64,0); }
|
||||
.p25 { width: 25%; background-color: rgb(240,80,0); }
|
||||
.p30 { width: 30%; background-color: rgb(240,80,0); }
|
||||
.p35 { width: 35%; background-color: rgb(240,96,0); }
|
||||
.p40 { width: 40%; background-color: rgb(240,96,0); }
|
||||
.p45 { width: 45%; background-color: rgb(240,112,0); }
|
||||
.p50 { width: 50%; background-color: rgb(240,112,0); }
|
||||
.p55 { width: 55%; background-color: rgb(224,128,0); }
|
||||
.p60 { width: 60%; background-color: rgb(208,144,0); }
|
||||
.p65 { width: 65%; background-color: rgb(192,160,0); }
|
||||
.p70 { width: 70%; background-color: rgb(176,176,0); }
|
||||
.p75 { width: 75%; background-color: rgb(176,176,0); }
|
||||
.p80 { width: 80%; background-color: rgb(160,192,0); }
|
||||
.p85 { width: 85%; background-color: rgb(160,192,0); }
|
||||
.p90 { width: 90%; background-color: rgb(144,208,0); }
|
||||
.p95 { width: 95%; background-color: rgb(144,208,0); }
|
||||
.p100 { width: 100%; background-color: green; }
|
||||
|
||||
/* Sidebar
|
||||
/*******************************/
|
||||
#sidebar
|
||||
{
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
width: 195px;
|
||||
font-family: verdana, sans-serif;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#sidebar a
|
||||
{
|
||||
border : none;
|
||||
}
|
||||
|
||||
#sidebar a:link { text-decoration:none; }
|
||||
#sidebar a:visited { text-decoration:none; }
|
||||
#sidebar a:active { text-decoration:none; }
|
||||
#sidebar a:focus { text-decoration:none; }
|
||||
#sidebar a:hover { text-decoration:underline; }
|
||||
|
||||
#sidebar a img
|
||||
{
|
||||
border : none;
|
||||
}
|
||||
|
||||
#sidebar h1
|
||||
{
|
||||
font-size: 10pt;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#sidebar ul
|
||||
{
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#sidebar li
|
||||
{
|
||||
list-style-image: url(images/icon_page.gif);
|
||||
}
|
||||
|
||||
|
||||
/* Footer
|
||||
/*******************************/
|
||||
#footer
|
||||
{
|
||||
font-family: verdana, sans-serif;
|
||||
background: url(images/page_bottom.png);
|
||||
font-size: x-small;
|
||||
font-weight: bold;
|
||||
color: #CCCCCC;
|
||||
height: 44px;
|
||||
width: 800px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#footer p
|
||||
{
|
||||
padding: 0px 0 0 20px;
|
||||
}
|
||||
|
||||
#footer a
|
||||
{
|
||||
color: #CCE0F5;
|
||||
}
|
||||
/* General
|
||||
/*******************************/
|
||||
body
|
||||
{
|
||||
font-size: Small;
|
||||
margin: 30px 0 20px 0;
|
||||
background: url(images/background.jpg);
|
||||
}
|
||||
|
||||
span
|
||||
{
|
||||
font-family: Tahoma,serif;
|
||||
}
|
||||
|
||||
/* Page
|
||||
/*******************************/
|
||||
#page
|
||||
{
|
||||
width: 808px;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
/* Links general
|
||||
/*******************************/
|
||||
a
|
||||
{
|
||||
color: #36b;
|
||||
}
|
||||
|
||||
a:link { text-decoration:none; }
|
||||
a:visited { text-decoration:none; }
|
||||
a:active { text-decoration:none; }
|
||||
a:focus { text-decoration:none; }
|
||||
a:hover { text-decoration:underline; }
|
||||
|
||||
/* Links external
|
||||
/*******************************/
|
||||
a.external
|
||||
{
|
||||
background: url("images/externallinks.png") center right no-repeat;
|
||||
padding-right: 13px;
|
||||
}
|
||||
|
||||
/* Header
|
||||
/*******************************/
|
||||
#header
|
||||
{
|
||||
float: left;
|
||||
width: 800px;
|
||||
height: 171px;
|
||||
background-image: url(images/banner.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: left bottom;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
/* Tabs
|
||||
/*******************************/
|
||||
#tabs
|
||||
{
|
||||
}
|
||||
|
||||
#tabs ul
|
||||
{
|
||||
list-style: none;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#tabs li
|
||||
{
|
||||
width: 125px;
|
||||
float: left;
|
||||
background-image: url(images/tab3.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#tabs li a
|
||||
{
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
font-weight: normal;
|
||||
color: black;
|
||||
height: 28px;
|
||||
padding: 21px 0 0 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#tabs li a:link { text-decoration:none; }
|
||||
#tabs li a:visited { text-decoration:none; }
|
||||
#tabs li a:active { text-decoration:none; }
|
||||
#tabs li a:focus { text-decoration:none; }
|
||||
#tabs li a:hover
|
||||
{
|
||||
width: 125px;
|
||||
float: left;
|
||||
background-image: url(images/tab3hover.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#tabs #current
|
||||
{
|
||||
background-image: url(images/tab3_selected.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
#tabs #current a
|
||||
{
|
||||
background-image: url(images/tab3_selected.jpg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
padding: 27px 0;
|
||||
height: 17px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Main
|
||||
*******************************/
|
||||
#main
|
||||
{
|
||||
background-image: url(images/page_middle.png);
|
||||
background-repeat: repeat-y;
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* Content
|
||||
/*******************************/
|
||||
#content
|
||||
{
|
||||
padding: 22px;
|
||||
margin: 0;
|
||||
width: 541px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#content h1, h2, h3, h4, h5, h6, h7, #content h2 a
|
||||
{
|
||||
font-family: Tahoma,serif;
|
||||
margin-bottom: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#content h1
|
||||
{
|
||||
font-size: x-large;
|
||||
}
|
||||
|
||||
#content h2
|
||||
{
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
#content p, #content ul, #content a, #content ol
|
||||
{
|
||||
margin-top: 10px;
|
||||
font-family: verdana, sans-serif;
|
||||
}
|
||||
|
||||
/* Progress
|
||||
/*******************************/
|
||||
.progressframe
|
||||
{
|
||||
border: 1px black solid;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress
|
||||
{
|
||||
font-family: Tahoma,serif;
|
||||
font-weight: bold;
|
||||
/*padding-left: 10px;*/
|
||||
background-color: red;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.p0 { width: 0%; color: black; background-color: white; }
|
||||
.p5 { width: 5%; background-color: rgb(240,16,0); }
|
||||
.p10 { width: 10%; background-color: rgb(240,32,0); }
|
||||
.p15 { width: 15%; background-color: rgb(240,48,0); }
|
||||
.p20 { width: 20%; background-color: rgb(240,64,0); }
|
||||
.p25 { width: 25%; background-color: rgb(240,80,0); }
|
||||
.p30 { width: 30%; background-color: rgb(240,80,0); }
|
||||
.p35 { width: 35%; background-color: rgb(240,96,0); }
|
||||
.p40 { width: 40%; background-color: rgb(240,96,0); }
|
||||
.p45 { width: 45%; background-color: rgb(240,112,0); }
|
||||
.p50 { width: 50%; background-color: rgb(240,112,0); }
|
||||
.p55 { width: 55%; background-color: rgb(224,128,0); }
|
||||
.p60 { width: 60%; background-color: rgb(208,144,0); }
|
||||
.p65 { width: 65%; background-color: rgb(192,160,0); }
|
||||
.p70 { width: 70%; background-color: rgb(176,176,0); }
|
||||
.p75 { width: 75%; background-color: rgb(176,176,0); }
|
||||
.p80 { width: 80%; background-color: rgb(160,192,0); }
|
||||
.p85 { width: 85%; background-color: rgb(160,192,0); }
|
||||
.p90 { width: 90%; background-color: rgb(144,208,0); }
|
||||
.p95 { width: 95%; background-color: rgb(144,208,0); }
|
||||
.p100 { width: 100%; background-color: green; }
|
||||
|
||||
/* Sidebar
|
||||
/*******************************/
|
||||
#sidebar
|
||||
{
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
width: 195px;
|
||||
font-family: verdana, sans-serif;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#sidebar a
|
||||
{
|
||||
border : none;
|
||||
}
|
||||
|
||||
#sidebar a:link { text-decoration:none; }
|
||||
#sidebar a:visited { text-decoration:none; }
|
||||
#sidebar a:active { text-decoration:none; }
|
||||
#sidebar a:focus { text-decoration:none; }
|
||||
#sidebar a:hover { text-decoration:underline; }
|
||||
|
||||
#sidebar a img
|
||||
{
|
||||
border : none;
|
||||
}
|
||||
|
||||
#sidebar h1
|
||||
{
|
||||
font-size: 10pt;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#sidebar ul
|
||||
{
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#sidebar li
|
||||
{
|
||||
list-style-image: url(images/icon_page.gif);
|
||||
}
|
||||
|
||||
|
||||
/* Footer
|
||||
/*******************************/
|
||||
#footer
|
||||
{
|
||||
font-family: verdana, sans-serif;
|
||||
background: url(images/page_bottom.png);
|
||||
font-size: x-small;
|
||||
font-weight: bold;
|
||||
color: #CCCCCC;
|
||||
height: 44px;
|
||||
width: 800px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#footer p
|
||||
{
|
||||
padding: 0px 0 0 20px;
|
||||
}
|
||||
|
||||
#footer a
|
||||
{
|
||||
color: #CCE0F5;
|
||||
}
|
||||
|
@ -1,33 +1,33 @@
|
||||
module module1
|
||||
! Identity of a utility
|
||||
! ____________________________________________________________________
|
||||
character (len=*), parameter :: xyz = &
|
||||
"I am just a more or less long string."
|
||||
character (len=*), parameter :: zhlp = '( &
|
||||
&"This program is free software; you can redistribute it and/or modify"/&
|
||||
&"____________________________________________________________________")'
|
||||
integer:: n
|
||||
contains
|
||||
|
||||
recursive subroutine sub1(x)
|
||||
integer,intent(inout):: x
|
||||
integer:: y
|
||||
y=0
|
||||
if (x<n) then
|
||||
x= x + 1
|
||||
y =x**2
|
||||
print *, 'x = ', x,', y = ', y
|
||||
call sub1(x)
|
||||
print *, 'x = ', x,', y = ', y
|
||||
end if
|
||||
end subroutine sub1
|
||||
|
||||
end module module1
|
||||
|
||||
program main
|
||||
use module1
|
||||
integer:: x = 0
|
||||
print *, 'Enter number of repeats'
|
||||
read (*,*) n
|
||||
call sub1(x)
|
||||
module module1
|
||||
! Identity of a utility
|
||||
! ____________________________________________________________________
|
||||
character (len=*), parameter :: xyz = &
|
||||
"I am just a more or less long string."
|
||||
character (len=*), parameter :: zhlp = '( &
|
||||
&"This program is free software; you can redistribute it and/or modify"/&
|
||||
&"____________________________________________________________________")'
|
||||
integer:: n
|
||||
contains
|
||||
|
||||
recursive subroutine sub1(x)
|
||||
integer,intent(inout):: x
|
||||
integer:: y
|
||||
y=0
|
||||
if (x<n) then
|
||||
x= x + 1
|
||||
y =x**2
|
||||
print *, 'x = ', x,', y = ', y
|
||||
call sub1(x)
|
||||
print *, 'x = ', x,', y = ', y
|
||||
end if
|
||||
end subroutine sub1
|
||||
|
||||
end module module1
|
||||
|
||||
program main
|
||||
use module1
|
||||
integer:: x = 0
|
||||
print *, 'Enter number of repeats'
|
||||
read (*,*) n
|
||||
call sub1(x)
|
||||
end program main
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
if($code == BAD){$action = REWRITE;}else{$action = KEEP;}
|
||||
for($i=0; $i<10;$i++){while($j>0){$j++;doCall($i+$j);if($k){$k/=10;}}}
|
||||
<?php
|
||||
if($code == BAD){$action = REWRITE;}else{$action = KEEP;}
|
||||
for($i=0; $i<10;$i++){while($j>0){$j++;doCall($i+$j);if($k){$k/=10;}}}
|
||||
?>
|
@ -1,55 +1,55 @@
|
||||
print "Help Desk -- What Editor do you use?";
|
||||
chomp($editor = <STDIN>);
|
||||
if ($editor =~ /emacs/i) {
|
||||
print "Why aren't you using vi?\n";
|
||||
} elsif ($editor =~ /vi/i) {
|
||||
print "Why aren't you using emacs?\n";
|
||||
} else {
|
||||
print "I think that's the problem\n";
|
||||
}
|
||||
|
||||
{
|
||||
L9140:
|
||||
if ($msccom::obj==$msccom::food) {
|
||||
goto L8142;
|
||||
}
|
||||
if ($msccom::obj==$msccom::bird||$msccom::obj==$msccom::snake||$msccom::obj==$msccom::clam||$msccom::obj==$msccom::oyster||$msccom::obj==$msccom::dwarf||$msccom::obj==$msccom::dragon||$msccom::obj==$msccom::troll||$msccom::obj==$msccom::bear) {
|
||||
$msccom::spk=71;
|
||||
}
|
||||
goto L2011;
|
||||
#
|
||||
# DRINK. IF NO OBJECT, ASSUME WATER AND LOOK FOR IT HERE. IF WATER IS
|
||||
# THE BOTTLE, DRINK THAT, ELSE MUST BE AT A WATER LOC, SO DRINK STREAM.
|
||||
#
|
||||
L9150:
|
||||
if ($msccom::obj==0&&$liqloc->($placom::loc)!=$msccom::water&&($liq->(0)!=$msccom::water||!$here->($msccom::bottle))) {
|
||||
goto L8000;
|
||||
}
|
||||
if ($msccom::obj!=0&&$msccom::obj!=$msccom::water) {
|
||||
$msccom::spk=110;
|
||||
}
|
||||
if ($msccom::spk==110||$liq->(0)!=$msccom::water||!$here->($msccom::bottle)) {
|
||||
goto L2011;
|
||||
}
|
||||
$placom::prop->($msccom::bottle)=1;
|
||||
$placom::place->($msccom::water)=0;
|
||||
$msccom::spk=74;
|
||||
goto L2011;
|
||||
#
|
||||
# RUB. YIELDS VARIOUS SNIDE REMARKS.
|
||||
#
|
||||
L9160:
|
||||
if ($msccom::obj!=$placom::lamp) {
|
||||
$msccom::spk=76;
|
||||
}
|
||||
goto L2011;
|
||||
#
|
||||
# THROW. SAME AS DISCARD UNLESS AXE. THEN SAME AS ATTACK EXCEPT IGNOR
|
||||
# AND IF DWARF IS PRESENT THEN ONE MIGHT BE KILLED. (ONLY WAY TO DO SO
|
||||
# AXE ALSO SPECIAL FOR DRAGON, BEAR, AND TROLL. TREASURES SPECIAL FOR
|
||||
#
|
||||
L9170:
|
||||
if ($toting->($msccom::rod2)&&$msccom::obj==$msccom::rod&&!$toting->($msccom::rod)) {
|
||||
$msccom::obj=$msccom::rod2;
|
||||
}
|
||||
print "Help Desk -- What Editor do you use?";
|
||||
chomp($editor = <STDIN>);
|
||||
if ($editor =~ /emacs/i) {
|
||||
print "Why aren't you using vi?\n";
|
||||
} elsif ($editor =~ /vi/i) {
|
||||
print "Why aren't you using emacs?\n";
|
||||
} else {
|
||||
print "I think that's the problem\n";
|
||||
}
|
||||
|
||||
{
|
||||
L9140:
|
||||
if ($msccom::obj==$msccom::food) {
|
||||
goto L8142;
|
||||
}
|
||||
if ($msccom::obj==$msccom::bird||$msccom::obj==$msccom::snake||$msccom::obj==$msccom::clam||$msccom::obj==$msccom::oyster||$msccom::obj==$msccom::dwarf||$msccom::obj==$msccom::dragon||$msccom::obj==$msccom::troll||$msccom::obj==$msccom::bear) {
|
||||
$msccom::spk=71;
|
||||
}
|
||||
goto L2011;
|
||||
#
|
||||
# DRINK. IF NO OBJECT, ASSUME WATER AND LOOK FOR IT HERE. IF WATER IS
|
||||
# THE BOTTLE, DRINK THAT, ELSE MUST BE AT A WATER LOC, SO DRINK STREAM.
|
||||
#
|
||||
L9150:
|
||||
if ($msccom::obj==0&&$liqloc->($placom::loc)!=$msccom::water&&($liq->(0)!=$msccom::water||!$here->($msccom::bottle))) {
|
||||
goto L8000;
|
||||
}
|
||||
if ($msccom::obj!=0&&$msccom::obj!=$msccom::water) {
|
||||
$msccom::spk=110;
|
||||
}
|
||||
if ($msccom::spk==110||$liq->(0)!=$msccom::water||!$here->($msccom::bottle)) {
|
||||
goto L2011;
|
||||
}
|
||||
$placom::prop->($msccom::bottle)=1;
|
||||
$placom::place->($msccom::water)=0;
|
||||
$msccom::spk=74;
|
||||
goto L2011;
|
||||
#
|
||||
# RUB. YIELDS VARIOUS SNIDE REMARKS.
|
||||
#
|
||||
L9160:
|
||||
if ($msccom::obj!=$placom::lamp) {
|
||||
$msccom::spk=76;
|
||||
}
|
||||
goto L2011;
|
||||
#
|
||||
# THROW. SAME AS DISCARD UNLESS AXE. THEN SAME AS ATTACK EXCEPT IGNOR
|
||||
# AND IF DWARF IS PRESENT THEN ONE MIGHT BE KILLED. (ONLY WAY TO DO SO
|
||||
# AXE ALSO SPECIAL FOR DRAGON, BEAR, AND TROLL. TREASURES SPECIAL FOR
|
||||
#
|
||||
L9170:
|
||||
if ($toting->($msccom::rod2)&&$msccom::obj==$msccom::rod&&!$toting->($msccom::rod)) {
|
||||
$msccom::obj=$msccom::rod2;
|
||||
}
|
||||
}
|
@ -1,23 +1,23 @@
|
||||
#! /usr/bin/env python
|
||||
"Replace CRLF with LF in argument files. Print names of changed files."
|
||||
|
||||
import sys, os
|
||||
|
||||
def main():
|
||||
for filename in sys.argv[1:]:
|
||||
if os.path.isdir(filename):
|
||||
print filename, "Directory!"
|
||||
continue
|
||||
data = open(filename, "rb").read()
|
||||
if '\0' in data:
|
||||
print filename, "Binary!"
|
||||
continue
|
||||
newdata = data.replace("\r\n", "\n")
|
||||
if newdata != data:
|
||||
print filename
|
||||
f = open(filename, "wb")
|
||||
f.write(newdata)
|
||||
f.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
#! /usr/bin/env python
|
||||
"Replace CRLF with LF in argument files. Print names of changed files."
|
||||
|
||||
import sys, os
|
||||
|
||||
def main():
|
||||
for filename in sys.argv[1:]:
|
||||
if os.path.isdir(filename):
|
||||
print filename, "Directory!"
|
||||
continue
|
||||
data = open(filename, "rb").read()
|
||||
if '\0' in data:
|
||||
print filename, "Binary!"
|
||||
continue
|
||||
newdata = data.replace("\r\n", "\n")
|
||||
if newdata != data:
|
||||
print filename
|
||||
f = open(filename, "wb")
|
||||
f.write(newdata)
|
||||
f.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@ -1,37 +1,37 @@
|
||||
CREATE PACKAGE BODY b IS
|
||||
|
||||
PROCEDURE proc1 IS
|
||||
BEGIN
|
||||
IF 7 <> 5 THEN
|
||||
FOR rec IN (SELECT * FROM dual
|
||||
WHERE g = 5) LOOP
|
||||
NULL;
|
||||
END LOOP;
|
||||
END IF;
|
||||
END;
|
||||
|
||||
PROCEDURE recurse IS
|
||||
b number:=5;
|
||||
d456 number:=456;
|
||||
BEGIN
|
||||
recurse;
|
||||
proc1;
|
||||
a := (a + 1
|
||||
+4
|
||||
+ 5
|
||||
+ 8);
|
||||
c := f + 4 + 34;
|
||||
total := earth +sky;
|
||||
|
||||
--this is comment
|
||||
|
||||
uk:=h;
|
||||
g:=l;
|
||||
exception
|
||||
when no_data then
|
||||
hello;
|
||||
END;
|
||||
|
||||
BEGIN
|
||||
NULL;
|
||||
END;
|
||||
CREATE PACKAGE BODY b IS
|
||||
|
||||
PROCEDURE proc1 IS
|
||||
BEGIN
|
||||
IF 7 <> 5 THEN
|
||||
FOR rec IN (SELECT * FROM dual
|
||||
WHERE g = 5) LOOP
|
||||
NULL;
|
||||
END LOOP;
|
||||
END IF;
|
||||
END;
|
||||
|
||||
PROCEDURE recurse IS
|
||||
b number:=5;
|
||||
d456 number:=456;
|
||||
BEGIN
|
||||
recurse;
|
||||
proc1;
|
||||
a := (a + 1
|
||||
+4
|
||||
+ 5
|
||||
+ 8);
|
||||
c := f + 4 + 34;
|
||||
total := earth +sky;
|
||||
|
||||
--this is comment
|
||||
|
||||
uk:=h;
|
||||
g:=l;
|
||||
exception
|
||||
when no_data then
|
||||
hello;
|
||||
END;
|
||||
|
||||
BEGIN
|
||||
NULL;
|
||||
END;
|
||||
|
@ -1,50 +1,50 @@
|
||||
Dim docRoot As New ChilkatXml
|
||||
|
||||
Dim success As Long
|
||||
|
||||
docRoot.Tag = "myDoc"
|
||||
|
||||
' To zip compress the content, set this flag to 1
|
||||
Dim zipContent As Long
|
||||
zipContent = 0
|
||||
' To 128-bit AES encrypt the content, set this flag to 1
|
||||
Dim encryptContent As Long
|
||||
encryptContent = 0
|
||||
Dim encryptPassword As String
|
||||
encryptPassword = ""
|
||||
|
||||
Dim pdfNode As ChilkatXml
|
||||
|
||||
Set pdfNode = docRoot.NewChild("pdf","")
|
||||
|
||||
' Embed a PDF into XML
|
||||
success = pdfNode.SetBinaryContentFromFile("sample.pdf",zipContent,encryptContent,encryptPassword)
|
||||
If (success <> 1) Then
|
||||
MsgBox pdfNode.LastErrorText
|
||||
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
MsgBox pdfNode.LastErrorText
|
||||
|
||||
' Display the entire XML document:
|
||||
Text1.Text = Text1.Text & docRoot.GetXml() & vbCrLf
|
||||
|
||||
' Get the Base64-encoded content and display it:
|
||||
Text1.Text = Text1.Text & pdfNode.Content & vbCrLf
|
||||
|
||||
' Extract the binary content from XML:
|
||||
Dim unzipContent As Long
|
||||
unzipContent = 0
|
||||
Dim decryptContent As Long
|
||||
decryptContent = 0
|
||||
Dim decryptPassword As String
|
||||
decryptPassword = ""
|
||||
success = pdfNode.SaveBinaryContent("out.pdf",unzipContent,decryptContent,decryptPassword)
|
||||
If (success <> 1) Then
|
||||
MsgBox pdfNode.LastErrorText
|
||||
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim docRoot As New ChilkatXml
|
||||
|
||||
Dim success As Long
|
||||
|
||||
docRoot.Tag = "myDoc"
|
||||
|
||||
' To zip compress the content, set this flag to 1
|
||||
Dim zipContent As Long
|
||||
zipContent = 0
|
||||
' To 128-bit AES encrypt the content, set this flag to 1
|
||||
Dim encryptContent As Long
|
||||
encryptContent = 0
|
||||
Dim encryptPassword As String
|
||||
encryptPassword = ""
|
||||
|
||||
Dim pdfNode As ChilkatXml
|
||||
|
||||
Set pdfNode = docRoot.NewChild("pdf","")
|
||||
|
||||
' Embed a PDF into XML
|
||||
success = pdfNode.SetBinaryContentFromFile("sample.pdf",zipContent,encryptContent,encryptPassword)
|
||||
If (success <> 1) Then
|
||||
MsgBox pdfNode.LastErrorText
|
||||
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
MsgBox pdfNode.LastErrorText
|
||||
|
||||
' Display the entire XML document:
|
||||
Text1.Text = Text1.Text & docRoot.GetXml() & vbCrLf
|
||||
|
||||
' Get the Base64-encoded content and display it:
|
||||
Text1.Text = Text1.Text & pdfNode.Content & vbCrLf
|
||||
|
||||
' Extract the binary content from XML:
|
||||
Dim unzipContent As Long
|
||||
unzipContent = 0
|
||||
Dim decryptContent As Long
|
||||
decryptContent = 0
|
||||
Dim decryptPassword As String
|
||||
decryptPassword = ""
|
||||
success = pdfNode.SaveBinaryContent("out.pdf",unzipContent,decryptContent,decryptPassword)
|
||||
If (success <> 1) Then
|
||||
MsgBox pdfNode.LastErrorText
|
||||
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
MsgBox "Success!"
|
File diff suppressed because it is too large
Load Diff
@ -1,161 +1,161 @@
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* @product: phpStylist
|
||||
* @author: Mr. Milk (aka Marcelo Leite)
|
||||
* @email: mrmilk@anysoft.com.br
|
||||
* @version: 1.0
|
||||
* @date: 2007-11-22
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
CONTENTS
|
||||
--------
|
||||
Below you will find instructions on how to use phpStylist:
|
||||
|
||||
- Web Server Usage
|
||||
- Command Line Mode
|
||||
- PSPad Integration
|
||||
- Command Line Options
|
||||
|
||||
==============================================================================
|
||||
|
||||
WEB SERVER USAGE
|
||||
----------------
|
||||
|
||||
phpStylist runs as a single file on you web server. You don't need any special
|
||||
module or library. It has been tested with php from 4.4.2 to 5.2.2.
|
||||
|
||||
Save phpStylist.php to your web server folder and start it from the browser.
|
||||
For example, http://localhost/phpStylist.php.
|
||||
|
||||
On the left menu, you will see more than 30 options that you can use to adjust
|
||||
the application to your coding style. All options are sticky based on cookies.
|
||||
Select one of your files or click on the button "Use Sample" and try each
|
||||
option to see what it is all about.
|
||||
|
||||
If you want to type in or paste code directly into the app, first click on the
|
||||
option "SHOW EDITABLE TEXT BOX". The right panel will then become editable.
|
||||
|
||||
COMMAND LINE MODE
|
||||
-----------------
|
||||
|
||||
You can also use phpStylist through the command line to automatically format
|
||||
local files. You will still need php installed.
|
||||
|
||||
First, find the exact location of you php.exe and the exact location where you
|
||||
placed phpStylist. Let's say they are in
|
||||
"C:\Program Files\PHP\php.exe" and "C:\Program Files\Apache\htdocs\phpStylist.php"
|
||||
|
||||
You then must run php passing phpStylist.php along with the -f argument. At
|
||||
this point the command line would be like this:
|
||||
"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php"
|
||||
|
||||
But that's not all. You also need to add the full path of the source file you
|
||||
want to format and the options you want to be used. For each of those 34 options
|
||||
you see on the web server usage, there will be an option on the command line.
|
||||
You can use the "--help" option to see a list of options.
|
||||
|
||||
Use the --help switch to see all options (full list at the end of this file):
|
||||
"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php" --help
|
||||
|
||||
The first phpStylist paramenter MUST be the source file name you want to
|
||||
format. After the file name, you can add as many options as you want, in any
|
||||
order. It can get pretty big, but it works. Another example:
|
||||
"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php"
|
||||
"C:\Program Files\Apache\htdocs\source_file_to_format.php" --space_after_if
|
||||
--indent_case --indent_size 4 --space_after_comma --line_before_function
|
||||
|
||||
Output will be to STDOUT, so if you want to send it to a file, append "> filename"
|
||||
at the end of the command line. In our above example:
|
||||
"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php"
|
||||
"C:\Program Files\Apache\htdocs\source_file_to_format.php" --space_after_if
|
||||
--indent_case --indent_size 4 --line_before_comment_multi --vertical_array
|
||||
--line_before_function > "C:\Code Library\Formatted Code\destination_file.php"
|
||||
|
||||
Don't forget the quotes around long file names.
|
||||
|
||||
PSPAD INTEGRATION
|
||||
-----------------
|
||||
PSPad is a popular, powerful and free code editor. It can be extended through
|
||||
scripting. I have also created a script that will automatically format php code
|
||||
from inside the editor. In fact, the script runs phpStylist in command line
|
||||
mode, sending the current editor file name. It then get the results and replace
|
||||
the code in the editor.
|
||||
|
||||
Save the file phpStylist.js to your PSPad javascript folder, usually
|
||||
C:\Program Files\PSPad\Script\JScript.
|
||||
|
||||
Open the phpStylist.js file and edit the first two variables:
|
||||
php_path = "C:\\Program Files\\xampp\\php\\php.exe";
|
||||
stylist_path = "C:\\Program Files\\xampp\\htdocs\\phpStylist.php";
|
||||
|
||||
Replace the paths with the appropriate for your system. Don't forget to double
|
||||
backslashes.
|
||||
|
||||
You will also see all the options, some are commented out, some are active (the
|
||||
current setup is the one I use). Simply comment out or uncomment the options
|
||||
you want to use and save the file. Restart PSPad or use the the option Scripts,
|
||||
Recompile Scripts.
|
||||
|
||||
Now, just open a php file on the editor and select phpStylist from the menu.
|
||||
That's all. You can also select some block of code before using the option so
|
||||
you can reformat only that portion. Of course, try to select a full block such
|
||||
as a function.
|
||||
|
||||
If you don't use PSPad or don't want the integration you don't need the file
|
||||
phpStylist.js.
|
||||
|
||||
FULL LIST OF OPTIONS
|
||||
--------------------
|
||||
|
||||
Indentation and General Formatting:
|
||||
--indent_size n n characters per indentation level
|
||||
--indent_with_tabs Indent with tabs instead of spaces
|
||||
--keep_redundant_lines Keep redundant lines
|
||||
--space_inside_parentheses Space inside parentheses
|
||||
--space_outside_parentheses Space outside parentheses
|
||||
--space_after_comma Space after comma
|
||||
|
||||
Operators:
|
||||
--space_around_assignment Space around = .= += -= *= /= <<<
|
||||
--align_var_assignment Align block +3 assigned variables
|
||||
--space_around_comparison Space around == === != !== > >= < <=
|
||||
--space_around_arithmetic Space around - + * / %
|
||||
--space_around_logical Space around && || AND OR XOR << >>
|
||||
--space_around_colon_question Space around ? :
|
||||
|
||||
Functions, Classes and Objects:
|
||||
--line_before_function Blank line before keyword
|
||||
--line_before_curly_function Opening bracket on next line
|
||||
--line_after_curly_function Blank line below opening bracket
|
||||
--space_around_obj_operator Space around ->
|
||||
--space_around_double_colon Space around ::
|
||||
|
||||
Control Structures:
|
||||
--space_after_if Space between keyword and opening parentheses
|
||||
--else_along_curly Keep else/elseif along with bracket
|
||||
--line_before_curly Opening bracket on next line
|
||||
--add_missing_braces Add missing brackets to single line structs
|
||||
--line_after_break Blank line after case "break"
|
||||
--space_inside_for Space between "for" elements
|
||||
--indent_case Extra indent for "Case" and "Default"
|
||||
|
||||
Arrays and Concatenation:
|
||||
--line_before_array Opening array parentheses on next line
|
||||
--vertical_array Non-empty arrays as vertical block
|
||||
--align_array_assignment Align block +3 assigned array elements
|
||||
--space_around_double_arrow Space around double arrow
|
||||
--vertical_concat Concatenation as vertical block
|
||||
--space_around_concat Space around concat elements
|
||||
|
||||
Comments:
|
||||
--line_before_comment_multi Blank line before multi-line comment (/*)
|
||||
--line_after_comment_multi Blank line after multi-line comment (/*)
|
||||
--line_before_comment Blank line before single line comments (//)
|
||||
--line_after_comment Blank line after single line comments (//)
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* @product: phpStylist
|
||||
* @author: Mr. Milk (aka Marcelo Leite)
|
||||
* @email: mrmilk@anysoft.com.br
|
||||
* @version: 1.0
|
||||
* @date: 2007-11-22
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
CONTENTS
|
||||
--------
|
||||
Below you will find instructions on how to use phpStylist:
|
||||
|
||||
- Web Server Usage
|
||||
- Command Line Mode
|
||||
- PSPad Integration
|
||||
- Command Line Options
|
||||
|
||||
==============================================================================
|
||||
|
||||
WEB SERVER USAGE
|
||||
----------------
|
||||
|
||||
phpStylist runs as a single file on you web server. You don't need any special
|
||||
module or library. It has been tested with php from 4.4.2 to 5.2.2.
|
||||
|
||||
Save phpStylist.php to your web server folder and start it from the browser.
|
||||
For example, http://localhost/phpStylist.php.
|
||||
|
||||
On the left menu, you will see more than 30 options that you can use to adjust
|
||||
the application to your coding style. All options are sticky based on cookies.
|
||||
Select one of your files or click on the button "Use Sample" and try each
|
||||
option to see what it is all about.
|
||||
|
||||
If you want to type in or paste code directly into the app, first click on the
|
||||
option "SHOW EDITABLE TEXT BOX". The right panel will then become editable.
|
||||
|
||||
COMMAND LINE MODE
|
||||
-----------------
|
||||
|
||||
You can also use phpStylist through the command line to automatically format
|
||||
local files. You will still need php installed.
|
||||
|
||||
First, find the exact location of you php.exe and the exact location where you
|
||||
placed phpStylist. Let's say they are in
|
||||
"C:\Program Files\PHP\php.exe" and "C:\Program Files\Apache\htdocs\phpStylist.php"
|
||||
|
||||
You then must run php passing phpStylist.php along with the -f argument. At
|
||||
this point the command line would be like this:
|
||||
"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php"
|
||||
|
||||
But that's not all. You also need to add the full path of the source file you
|
||||
want to format and the options you want to be used. For each of those 34 options
|
||||
you see on the web server usage, there will be an option on the command line.
|
||||
You can use the "--help" option to see a list of options.
|
||||
|
||||
Use the --help switch to see all options (full list at the end of this file):
|
||||
"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php" --help
|
||||
|
||||
The first phpStylist paramenter MUST be the source file name you want to
|
||||
format. After the file name, you can add as many options as you want, in any
|
||||
order. It can get pretty big, but it works. Another example:
|
||||
"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php"
|
||||
"C:\Program Files\Apache\htdocs\source_file_to_format.php" --space_after_if
|
||||
--indent_case --indent_size 4 --space_after_comma --line_before_function
|
||||
|
||||
Output will be to STDOUT, so if you want to send it to a file, append "> filename"
|
||||
at the end of the command line. In our above example:
|
||||
"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php"
|
||||
"C:\Program Files\Apache\htdocs\source_file_to_format.php" --space_after_if
|
||||
--indent_case --indent_size 4 --line_before_comment_multi --vertical_array
|
||||
--line_before_function > "C:\Code Library\Formatted Code\destination_file.php"
|
||||
|
||||
Don't forget the quotes around long file names.
|
||||
|
||||
PSPAD INTEGRATION
|
||||
-----------------
|
||||
PSPad is a popular, powerful and free code editor. It can be extended through
|
||||
scripting. I have also created a script that will automatically format php code
|
||||
from inside the editor. In fact, the script runs phpStylist in command line
|
||||
mode, sending the current editor file name. It then get the results and replace
|
||||
the code in the editor.
|
||||
|
||||
Save the file phpStylist.js to your PSPad javascript folder, usually
|
||||
C:\Program Files\PSPad\Script\JScript.
|
||||
|
||||
Open the phpStylist.js file and edit the first two variables:
|
||||
php_path = "C:\\Program Files\\xampp\\php\\php.exe";
|
||||
stylist_path = "C:\\Program Files\\xampp\\htdocs\\phpStylist.php";
|
||||
|
||||
Replace the paths with the appropriate for your system. Don't forget to double
|
||||
backslashes.
|
||||
|
||||
You will also see all the options, some are commented out, some are active (the
|
||||
current setup is the one I use). Simply comment out or uncomment the options
|
||||
you want to use and save the file. Restart PSPad or use the the option Scripts,
|
||||
Recompile Scripts.
|
||||
|
||||
Now, just open a php file on the editor and select phpStylist from the menu.
|
||||
That's all. You can also select some block of code before using the option so
|
||||
you can reformat only that portion. Of course, try to select a full block such
|
||||
as a function.
|
||||
|
||||
If you don't use PSPad or don't want the integration you don't need the file
|
||||
phpStylist.js.
|
||||
|
||||
FULL LIST OF OPTIONS
|
||||
--------------------
|
||||
|
||||
Indentation and General Formatting:
|
||||
--indent_size n n characters per indentation level
|
||||
--indent_with_tabs Indent with tabs instead of spaces
|
||||
--keep_redundant_lines Keep redundant lines
|
||||
--space_inside_parentheses Space inside parentheses
|
||||
--space_outside_parentheses Space outside parentheses
|
||||
--space_after_comma Space after comma
|
||||
|
||||
Operators:
|
||||
--space_around_assignment Space around = .= += -= *= /= <<<
|
||||
--align_var_assignment Align block +3 assigned variables
|
||||
--space_around_comparison Space around == === != !== > >= < <=
|
||||
--space_around_arithmetic Space around - + * / %
|
||||
--space_around_logical Space around && || AND OR XOR << >>
|
||||
--space_around_colon_question Space around ? :
|
||||
|
||||
Functions, Classes and Objects:
|
||||
--line_before_function Blank line before keyword
|
||||
--line_before_curly_function Opening bracket on next line
|
||||
--line_after_curly_function Blank line below opening bracket
|
||||
--space_around_obj_operator Space around ->
|
||||
--space_around_double_colon Space around ::
|
||||
|
||||
Control Structures:
|
||||
--space_after_if Space between keyword and opening parentheses
|
||||
--else_along_curly Keep else/elseif along with bracket
|
||||
--line_before_curly Opening bracket on next line
|
||||
--add_missing_braces Add missing brackets to single line structs
|
||||
--line_after_break Blank line after case "break"
|
||||
--space_inside_for Space between "for" elements
|
||||
--indent_case Extra indent for "Case" and "Default"
|
||||
|
||||
Arrays and Concatenation:
|
||||
--line_before_array Opening array parentheses on next line
|
||||
--vertical_array Non-empty arrays as vertical block
|
||||
--align_array_assignment Align block +3 assigned array elements
|
||||
--space_around_double_arrow Space around double arrow
|
||||
--vertical_concat Concatenation as vertical block
|
||||
--space_around_concat Space around concat elements
|
||||
|
||||
Comments:
|
||||
--line_before_comment_multi Blank line before multi-line comment (/*)
|
||||
--line_after_comment_multi Blank line after multi-line comment (/*)
|
||||
--line_before_comment Blank line before single line comments (//)
|
||||
--line_after_comment Blank line after single line comments (//)
|
||||
|
@ -1,75 +1,75 @@
|
||||
# This file contains a class and a main program that perform three
|
||||
# related (though complimentary) formatting operations on Python
|
||||
# programs. When called as "pindent -c", it takes a valid Python
|
||||
# program as input and outputs a version augmented with block-closing
|
||||
# comments. When called as "pindent -d", it assumes its input is a
|
||||
# Python program with block-closing comments and outputs a commentless
|
||||
# version. When called as "pindent -r" it assumes its input is a
|
||||
# Python program with block-closing comments but with its indentation
|
||||
# messed up, and outputs a properly indented version.
|
||||
|
||||
# A "block-closing comment" is a comment of the form '# end <keyword>'
|
||||
# where <keyword> is the keyword that opened the block. If the
|
||||
# opening keyword is 'def' or 'class', the function or class name may
|
||||
# be repeated in the block-closing comment as well. Here is an
|
||||
# example of a program fully augmented with block-closing comments:
|
||||
|
||||
# def foobar(a, b):
|
||||
# if a == b:
|
||||
# a = a+1
|
||||
# elif a < b:
|
||||
# b = b-1
|
||||
# if b > a: a = a-1
|
||||
# # end if
|
||||
# else:
|
||||
# print 'oops!'
|
||||
# # end if
|
||||
# # end def foobar
|
||||
|
||||
# Note that only the last part of an if...elif...else... block needs a
|
||||
# block-closing comment; the same is true for other compound
|
||||
# statements (e.g. try...except). Also note that "short-form" blocks
|
||||
# like the second 'if' in the example must be closed as well;
|
||||
# otherwise the 'else' in the example would be ambiguous (remember
|
||||
# that indentation is not significant when interpreting block-closing
|
||||
# comments).
|
||||
|
||||
# The operations are idempotent (i.e. applied to their own output
|
||||
# they yield an identical result). Running first "pindent -c" and
|
||||
# then "pindent -r" on a valid Python program produces a program that
|
||||
# is semantically identical to the input (though its indentation may
|
||||
# be different). Running "pindent -e" on that output produces a
|
||||
# program that only differs from the original in indentation.
|
||||
|
||||
# Other options:
|
||||
# -s stepsize: set the indentation step size (default 8)
|
||||
# -t tabsize : set the number of spaces a tab character is worth (default 8)
|
||||
# -e : expand TABs into spaces
|
||||
# file ... : input file(s) (default standard input)
|
||||
# The results always go to standard output
|
||||
|
||||
# Caveats:
|
||||
# - comments ending in a backslash will be mistaken for continued lines
|
||||
# - continuations using backslash are always left unchanged
|
||||
# - continuations inside parentheses are not extra indented by -r
|
||||
# but must be indented for -c to work correctly (this breaks
|
||||
# idempotency!)
|
||||
# - continued lines inside triple-quoted strings are totally garbled
|
||||
|
||||
# Secret feature:
|
||||
# - On input, a block may also be closed with an "end statement" --
|
||||
# this is a block-closing comment without the '#' sign.
|
||||
|
||||
# Possible improvements:
|
||||
# - check syntax based on transitions in 'next' table
|
||||
# - better error reporting
|
||||
# - better error recovery
|
||||
# - check identifier after class/def
|
||||
|
||||
# The following wishes need a more complete tokenization of the source:
|
||||
# - Don't get fooled by comments ending in backslash
|
||||
# - reindent continuation lines indicated by backslash
|
||||
# - handle continuation lines inside parentheses/braces/brackets
|
||||
# - handle triple quoted strings spanning lines
|
||||
# - realign comments
|
||||
# - optionally do much more thorough reformatting, a la C indent
|
||||
# This file contains a class and a main program that perform three
|
||||
# related (though complimentary) formatting operations on Python
|
||||
# programs. When called as "pindent -c", it takes a valid Python
|
||||
# program as input and outputs a version augmented with block-closing
|
||||
# comments. When called as "pindent -d", it assumes its input is a
|
||||
# Python program with block-closing comments and outputs a commentless
|
||||
# version. When called as "pindent -r" it assumes its input is a
|
||||
# Python program with block-closing comments but with its indentation
|
||||
# messed up, and outputs a properly indented version.
|
||||
|
||||
# A "block-closing comment" is a comment of the form '# end <keyword>'
|
||||
# where <keyword> is the keyword that opened the block. If the
|
||||
# opening keyword is 'def' or 'class', the function or class name may
|
||||
# be repeated in the block-closing comment as well. Here is an
|
||||
# example of a program fully augmented with block-closing comments:
|
||||
|
||||
# def foobar(a, b):
|
||||
# if a == b:
|
||||
# a = a+1
|
||||
# elif a < b:
|
||||
# b = b-1
|
||||
# if b > a: a = a-1
|
||||
# # end if
|
||||
# else:
|
||||
# print 'oops!'
|
||||
# # end if
|
||||
# # end def foobar
|
||||
|
||||
# Note that only the last part of an if...elif...else... block needs a
|
||||
# block-closing comment; the same is true for other compound
|
||||
# statements (e.g. try...except). Also note that "short-form" blocks
|
||||
# like the second 'if' in the example must be closed as well;
|
||||
# otherwise the 'else' in the example would be ambiguous (remember
|
||||
# that indentation is not significant when interpreting block-closing
|
||||
# comments).
|
||||
|
||||
# The operations are idempotent (i.e. applied to their own output
|
||||
# they yield an identical result). Running first "pindent -c" and
|
||||
# then "pindent -r" on a valid Python program produces a program that
|
||||
# is semantically identical to the input (though its indentation may
|
||||
# be different). Running "pindent -e" on that output produces a
|
||||
# program that only differs from the original in indentation.
|
||||
|
||||
# Other options:
|
||||
# -s stepsize: set the indentation step size (default 8)
|
||||
# -t tabsize : set the number of spaces a tab character is worth (default 8)
|
||||
# -e : expand TABs into spaces
|
||||
# file ... : input file(s) (default standard input)
|
||||
# The results always go to standard output
|
||||
|
||||
# Caveats:
|
||||
# - comments ending in a backslash will be mistaken for continued lines
|
||||
# - continuations using backslash are always left unchanged
|
||||
# - continuations inside parentheses are not extra indented by -r
|
||||
# but must be indented for -c to work correctly (this breaks
|
||||
# idempotency!)
|
||||
# - continued lines inside triple-quoted strings are totally garbled
|
||||
|
||||
# Secret feature:
|
||||
# - On input, a block may also be closed with an "end statement" --
|
||||
# this is a block-closing comment without the '#' sign.
|
||||
|
||||
# Possible improvements:
|
||||
# - check syntax based on transitions in 'next' table
|
||||
# - better error reporting
|
||||
# - better error recovery
|
||||
# - check identifier after class/def
|
||||
|
||||
# The following wishes need a more complete tokenization of the source:
|
||||
# - Don't get fooled by comments ending in backslash
|
||||
# - reindent continuation lines indicated by backslash
|
||||
# - handle continuation lines inside parentheses/braces/brackets
|
||||
# - handle triple quoted strings spanning lines
|
||||
# - realign comments
|
||||
# - optionally do much more thorough reformatting, a la C indent
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,81 +1,81 @@
|
||||
[header]
|
||||
categories=General options
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.jsp|*.html|*.xml
|
||||
indenterFileName=jsppp
|
||||
indenterName=JSPPP (JSP)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://jsppp.sourceforge.net/
|
||||
outputFileName=indentinput
|
||||
outputFileParameter=none
|
||||
stringparaminquotes=false
|
||||
parameterOrder=pio
|
||||
showHelpParameter=-h
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=0.5.2a
|
||||
|
||||
[Spaces]
|
||||
Category=0
|
||||
Description="<html>If spaces is true, spaces, not tabs, will be used to indent the lines.</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse=|--tabs
|
||||
ValueDefault=1
|
||||
|
||||
[Number of spaces]
|
||||
Category=0
|
||||
Description="<html>If spaces are used for indenting, NUMSPACES is the number of spaces to use per indent level.</html>"
|
||||
Enabled=true
|
||||
EditorType=numeric
|
||||
CallName="--spaces="
|
||||
MinVal=0
|
||||
MaxVal=999
|
||||
ValueDefault=2
|
||||
|
||||
[Line length]
|
||||
Category=0
|
||||
Description="<html>The length, in bytes (JSPPP does not yet support Unicode input, no one has asked for it yet) of the soft line length limit. JavaScript, long element names, attributes, etc., that cannot be broken up will end up over the limit if they have already been indented too far.</html>"
|
||||
Enabled=false
|
||||
EditorType=numeric
|
||||
CallName="--length="
|
||||
MinVal=1
|
||||
MaxVal=9999
|
||||
ValueDefault=120
|
||||
|
||||
[Tabsize]
|
||||
Category=0
|
||||
Description="<html>The default number of spaces per tab is 8. This number is used to determine how much of the line has been used by a tab.</html>"
|
||||
Enabled=false
|
||||
EditorType=numeric
|
||||
CallName="--tab-size="
|
||||
MinVal=0
|
||||
MaxVal=999
|
||||
ValueDefault=8
|
||||
|
||||
[Punctuation]
|
||||
Category=0
|
||||
Description="<html>PUNCTUATION is a list of characters which should be handled specially after an anchor tag. If there is whitespace after a link tag but before one of these characters then the whitespace is removed. To have no special characters, use the line "PUNCTUATION=".</html>"
|
||||
Enabled=false
|
||||
CallName=PUNCTUATION=
|
||||
EditorType=string
|
||||
ValueDefault=",.!?"
|
||||
|
||||
[Loose or tight spacing]
|
||||
Category=0
|
||||
Description="<html>Use loose or tight spacing.</html>"
|
||||
Enabled=true
|
||||
EditorType=multiple
|
||||
Choices="--loose-spacing|--tight-spacing"
|
||||
ChoicesReadable="Loose spacing|Tight spacing"
|
||||
ValueDefault=0
|
||||
|
||||
[Backup file]
|
||||
Category=0
|
||||
Description="<html>Leave a backup file, which will be overwritten on a second run, or leave no backup file at all.</html>"
|
||||
Enabled=true
|
||||
EditorType=multiple
|
||||
Choices="--engage-safety|--disengage-safety"
|
||||
ChoicesReadable="Leave backup file|Leave NO backup file"
|
||||
ValueDefault=1
|
||||
[header]
|
||||
categories=General options
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.jsp|*.html|*.xml
|
||||
indenterFileName=jsppp
|
||||
indenterName=JSPPP (JSP)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://jsppp.sourceforge.net/
|
||||
outputFileName=indentinput
|
||||
outputFileParameter=none
|
||||
stringparaminquotes=false
|
||||
parameterOrder=pio
|
||||
showHelpParameter=-h
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=0.5.2a
|
||||
|
||||
[Spaces]
|
||||
Category=0
|
||||
Description="<html>If spaces is true, spaces, not tabs, will be used to indent the lines.</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse=|--tabs
|
||||
ValueDefault=1
|
||||
|
||||
[Number of spaces]
|
||||
Category=0
|
||||
Description="<html>If spaces are used for indenting, NUMSPACES is the number of spaces to use per indent level.</html>"
|
||||
Enabled=true
|
||||
EditorType=numeric
|
||||
CallName="--spaces="
|
||||
MinVal=0
|
||||
MaxVal=999
|
||||
ValueDefault=2
|
||||
|
||||
[Line length]
|
||||
Category=0
|
||||
Description="<html>The length, in bytes (JSPPP does not yet support Unicode input, no one has asked for it yet) of the soft line length limit. JavaScript, long element names, attributes, etc., that cannot be broken up will end up over the limit if they have already been indented too far.</html>"
|
||||
Enabled=false
|
||||
EditorType=numeric
|
||||
CallName="--length="
|
||||
MinVal=1
|
||||
MaxVal=9999
|
||||
ValueDefault=120
|
||||
|
||||
[Tabsize]
|
||||
Category=0
|
||||
Description="<html>The default number of spaces per tab is 8. This number is used to determine how much of the line has been used by a tab.</html>"
|
||||
Enabled=false
|
||||
EditorType=numeric
|
||||
CallName="--tab-size="
|
||||
MinVal=0
|
||||
MaxVal=999
|
||||
ValueDefault=8
|
||||
|
||||
[Punctuation]
|
||||
Category=0
|
||||
Description="<html>PUNCTUATION is a list of characters which should be handled specially after an anchor tag. If there is whitespace after a link tag but before one of these characters then the whitespace is removed. To have no special characters, use the line "PUNCTUATION=".</html>"
|
||||
Enabled=false
|
||||
CallName=PUNCTUATION=
|
||||
EditorType=string
|
||||
ValueDefault=",.!?"
|
||||
|
||||
[Loose or tight spacing]
|
||||
Category=0
|
||||
Description="<html>Use loose or tight spacing.</html>"
|
||||
Enabled=true
|
||||
EditorType=multiple
|
||||
Choices="--loose-spacing|--tight-spacing"
|
||||
ChoicesReadable="Loose spacing|Tight spacing"
|
||||
ValueDefault=0
|
||||
|
||||
[Backup file]
|
||||
Category=0
|
||||
Description="<html>Leave a backup file, which will be overwritten on a second run, or leave no backup file at all.</html>"
|
||||
Enabled=true
|
||||
EditorType=multiple
|
||||
Choices="--engage-safety|--disengage-safety"
|
||||
ChoicesReadable="Leave backup file|Leave NO backup file"
|
||||
ValueDefault=1
|
||||
|
@ -1,258 +1,258 @@
|
||||
[header]
|
||||
categories="General|Operators|Functions, Classes and Objects|Control Structures|Arrays and Concatenation|Comments"
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.php|*.phpt|*.phps
|
||||
indenterFileName=phpStylist.php
|
||||
indenterName=phpStylist (PHP)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=" "
|
||||
manual=http://sourceforge.net/projects/phpstylist/
|
||||
outputFileName=
|
||||
outputFileParameter=stdout
|
||||
parameterOrder=ipo
|
||||
showHelpParameter="-- --help"
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=1.0
|
||||
|
||||
[Indent size]
|
||||
CallName="--indent_size "
|
||||
Category=0
|
||||
Description="<html>Indent the code with the set number of spaces.</html>"
|
||||
EditorType=numeric
|
||||
Enabled=true
|
||||
MaxVal=99
|
||||
MinVal=0
|
||||
ValueDefault=4
|
||||
|
||||
[Indent with tabs]
|
||||
Category=0
|
||||
Description="<html>Indent with tabs instead of spaces</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--indent_with_tabs|"
|
||||
ValueDefault=0
|
||||
|
||||
[Keep redundant lines]
|
||||
Category=0
|
||||
Description="<html>Keep redundant lines</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--keep_redundant_lines|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space inside parentheses]
|
||||
Category=0
|
||||
Description="<html>Space inside parentheses</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_inside_parentheses|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space outside parentheses]
|
||||
Category=0
|
||||
Description="<html>Space outside parentheses</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_outside_parentheses|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space after comma]
|
||||
Category=0
|
||||
Description="<html>Space after comma</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_after_comma|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around assignment]
|
||||
Category=1
|
||||
Description="<html>Space around = .= += -= *= /= <<<</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_assignment|"
|
||||
ValueDefault=0
|
||||
|
||||
[Align block +3 assigned variables]
|
||||
Category=1
|
||||
Description="<html>Align block +3 assigned variables</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--align_var_assignment|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around comparison]
|
||||
Category=1
|
||||
Description="<html>Space around == === != !== > >= < <=</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_comparison|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around arithmetic]
|
||||
Category=1
|
||||
Description="<html>Space around - + * / %</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_arithmetic|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around logical]
|
||||
Category=1
|
||||
Description="<html>Space around && || AND OR XOR << >></html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_logical|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around colon and question]
|
||||
Category=1
|
||||
Description="<html>Space around ? :</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_colon_question|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line before keyword]
|
||||
Category=2
|
||||
Description="<html>Blank line before keyword</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_function|"
|
||||
ValueDefault=0
|
||||
|
||||
[Opening bracket on next line]
|
||||
Category=2
|
||||
Description="<html>Opening bracket on next line</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_curly_function|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line below opening bracket]
|
||||
Category=2
|
||||
Description="<html>Blank line below opening bracket</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_after_curly_function|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around ->]
|
||||
Category=2
|
||||
Description="<html>Space around -></html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_obj_operator|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around ::]
|
||||
Category=2
|
||||
Description="<html>Space around ::</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_double_colon|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space before parentheses]
|
||||
Category=3
|
||||
Description="<html>Space between keyword and opening parentheses</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_after_if|"
|
||||
ValueDefault=0
|
||||
|
||||
[Keep else/elseif along with bracket]
|
||||
Category=3
|
||||
Description="<html>Keep else/elseif along with bracket</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--else_along_curly|"
|
||||
ValueDefault=0
|
||||
|
||||
[Opening bracket on next line]
|
||||
Category=3
|
||||
Description="<html>Opening bracket on next line</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_curly|"
|
||||
ValueDefault=0
|
||||
|
||||
[Add missing brackets]
|
||||
Category=3
|
||||
Description="<html>Add missing brackets to single line structs</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--add_missing_braces|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line after case "break"]
|
||||
Category=3
|
||||
Description="<html>Blank line after case 'break'</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_after_break|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space between "for" elements]
|
||||
Category=3
|
||||
Description="<html>Space between 'for' elements</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_inside_for|"
|
||||
ValueDefault=0
|
||||
|
||||
[Extra indent for "Case" and "Default"]
|
||||
Category=3
|
||||
Description="<html>Extra indent for 'Case' and 'Default'</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--indent_case|"
|
||||
ValueDefault=0
|
||||
|
||||
[Opening array parentheses on next line]
|
||||
Category=4
|
||||
Description="<html>Opening array parentheses on next line</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_array|"
|
||||
ValueDefault=0
|
||||
|
||||
[Non-empty arrays as vertical block]
|
||||
Category=4
|
||||
Description="<html>Non-empty arrays as vertical block</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--vertical_array|"
|
||||
ValueDefault=0
|
||||
|
||||
[Align block +3 assigned array elements]
|
||||
Category=4
|
||||
Description="<html>Align block +3 assigned array elements</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--align_array_assignment|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around double arrow]
|
||||
Category=4
|
||||
Description="<html>Space around double arrow</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_double_arrow|"
|
||||
ValueDefault=0
|
||||
|
||||
[Concatenation as vertical block]
|
||||
Category=4
|
||||
Description="<html>Concatenation as vertical block</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--vertical_concat|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around concat elements]
|
||||
Category=4
|
||||
Description="<html>Space around concat elements</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_concat|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line before multi-line comment]
|
||||
Category=5
|
||||
Description="<html>Blank line before multi-line comment (/*)</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_comment_multi|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line after multi-line comment]
|
||||
Category=5
|
||||
Description="<html>Blank line after multi-line comment (/*)</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_after_comment_multi|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line before single line comments]
|
||||
Category=5
|
||||
Description="<html>Blank line before single line comments (//)</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_comment|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line after single line comments]
|
||||
Category=5
|
||||
Description="<html>Blank line after single line comments (//)</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_after_comment|"
|
||||
ValueDefault=0
|
||||
[header]
|
||||
categories="General|Operators|Functions, Classes and Objects|Control Structures|Arrays and Concatenation|Comments"
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.php|*.phpt|*.phps
|
||||
indenterFileName=phpStylist.php
|
||||
indenterName=phpStylist (PHP)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=" "
|
||||
manual=http://sourceforge.net/projects/phpstylist/
|
||||
outputFileName=
|
||||
outputFileParameter=stdout
|
||||
parameterOrder=ipo
|
||||
showHelpParameter="-- --help"
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=1.0
|
||||
|
||||
[Indent size]
|
||||
CallName="--indent_size "
|
||||
Category=0
|
||||
Description="<html>Indent the code with the set number of spaces.</html>"
|
||||
EditorType=numeric
|
||||
Enabled=true
|
||||
MaxVal=99
|
||||
MinVal=0
|
||||
ValueDefault=4
|
||||
|
||||
[Indent with tabs]
|
||||
Category=0
|
||||
Description="<html>Indent with tabs instead of spaces</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--indent_with_tabs|"
|
||||
ValueDefault=0
|
||||
|
||||
[Keep redundant lines]
|
||||
Category=0
|
||||
Description="<html>Keep redundant lines</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--keep_redundant_lines|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space inside parentheses]
|
||||
Category=0
|
||||
Description="<html>Space inside parentheses</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_inside_parentheses|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space outside parentheses]
|
||||
Category=0
|
||||
Description="<html>Space outside parentheses</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_outside_parentheses|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space after comma]
|
||||
Category=0
|
||||
Description="<html>Space after comma</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_after_comma|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around assignment]
|
||||
Category=1
|
||||
Description="<html>Space around = .= += -= *= /= <<<</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_assignment|"
|
||||
ValueDefault=0
|
||||
|
||||
[Align block +3 assigned variables]
|
||||
Category=1
|
||||
Description="<html>Align block +3 assigned variables</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--align_var_assignment|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around comparison]
|
||||
Category=1
|
||||
Description="<html>Space around == === != !== > >= < <=</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_comparison|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around arithmetic]
|
||||
Category=1
|
||||
Description="<html>Space around - + * / %</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_arithmetic|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around logical]
|
||||
Category=1
|
||||
Description="<html>Space around && || AND OR XOR << >></html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_logical|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around colon and question]
|
||||
Category=1
|
||||
Description="<html>Space around ? :</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_colon_question|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line before keyword]
|
||||
Category=2
|
||||
Description="<html>Blank line before keyword</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_function|"
|
||||
ValueDefault=0
|
||||
|
||||
[Opening bracket on next line]
|
||||
Category=2
|
||||
Description="<html>Opening bracket on next line</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_curly_function|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line below opening bracket]
|
||||
Category=2
|
||||
Description="<html>Blank line below opening bracket</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_after_curly_function|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around ->]
|
||||
Category=2
|
||||
Description="<html>Space around -></html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_obj_operator|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around ::]
|
||||
Category=2
|
||||
Description="<html>Space around ::</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_double_colon|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space before parentheses]
|
||||
Category=3
|
||||
Description="<html>Space between keyword and opening parentheses</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_after_if|"
|
||||
ValueDefault=0
|
||||
|
||||
[Keep else/elseif along with bracket]
|
||||
Category=3
|
||||
Description="<html>Keep else/elseif along with bracket</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--else_along_curly|"
|
||||
ValueDefault=0
|
||||
|
||||
[Opening bracket on next line]
|
||||
Category=3
|
||||
Description="<html>Opening bracket on next line</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_curly|"
|
||||
ValueDefault=0
|
||||
|
||||
[Add missing brackets]
|
||||
Category=3
|
||||
Description="<html>Add missing brackets to single line structs</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--add_missing_braces|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line after case "break"]
|
||||
Category=3
|
||||
Description="<html>Blank line after case 'break'</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_after_break|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space between "for" elements]
|
||||
Category=3
|
||||
Description="<html>Space between 'for' elements</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_inside_for|"
|
||||
ValueDefault=0
|
||||
|
||||
[Extra indent for "Case" and "Default"]
|
||||
Category=3
|
||||
Description="<html>Extra indent for 'Case' and 'Default'</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--indent_case|"
|
||||
ValueDefault=0
|
||||
|
||||
[Opening array parentheses on next line]
|
||||
Category=4
|
||||
Description="<html>Opening array parentheses on next line</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_array|"
|
||||
ValueDefault=0
|
||||
|
||||
[Non-empty arrays as vertical block]
|
||||
Category=4
|
||||
Description="<html>Non-empty arrays as vertical block</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--vertical_array|"
|
||||
ValueDefault=0
|
||||
|
||||
[Align block +3 assigned array elements]
|
||||
Category=4
|
||||
Description="<html>Align block +3 assigned array elements</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--align_array_assignment|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around double arrow]
|
||||
Category=4
|
||||
Description="<html>Space around double arrow</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_double_arrow|"
|
||||
ValueDefault=0
|
||||
|
||||
[Concatenation as vertical block]
|
||||
Category=4
|
||||
Description="<html>Concatenation as vertical block</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--vertical_concat|"
|
||||
ValueDefault=0
|
||||
|
||||
[Space around concat elements]
|
||||
Category=4
|
||||
Description="<html>Space around concat elements</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--space_around_concat|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line before multi-line comment]
|
||||
Category=5
|
||||
Description="<html>Blank line before multi-line comment (/*)</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_comment_multi|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line after multi-line comment]
|
||||
Category=5
|
||||
Description="<html>Blank line after multi-line comment (/*)</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_after_comment_multi|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line before single line comments]
|
||||
Category=5
|
||||
Description="<html>Blank line before single line comments (//)</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_before_comment|"
|
||||
ValueDefault=0
|
||||
|
||||
[Blank line after single line comments]
|
||||
Category=5
|
||||
Description="<html>Blank line after single line comments (//)</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse="--line_after_comment|"
|
||||
ValueDefault=0
|
||||
|
@ -1,108 +1,108 @@
|
||||
[header]
|
||||
categories=General
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.php|*.phpt|*.phps
|
||||
indenterFileName=php_beautifier
|
||||
indenterName=PHP_Beautifier (PHP)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter="-f "
|
||||
manual=http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/tutorial_PHP_Beautifier.howtouse.commandline.pkg.html
|
||||
outputFileName=indentoutput
|
||||
outputFileParameter="-o "
|
||||
parameterOrder=iop
|
||||
showHelpParameter=--help
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=0.1.13
|
||||
|
||||
[Indent With Spaces]
|
||||
CallName="-s"
|
||||
Category=1
|
||||
Description=<html>Indent the code with the set number of spaces.</html>
|
||||
EditorType=numeric
|
||||
Enabled=true
|
||||
MaxVal=99
|
||||
MinVal=0
|
||||
ValueDefault=4
|
||||
|
||||
[Indent With Tabs]
|
||||
CallName="-t"
|
||||
Category=1
|
||||
Description=<html>Indent the code with the set number of tabs.</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=99
|
||||
MinVal=0
|
||||
ValueDefault=1
|
||||
|
||||
[Add Header]
|
||||
Category=0
|
||||
Choices="-l \"Pear(add_header=php)\"|-l \"Pear(add_header=bsd)\"|-l \"Pear(add_header=apache)\"|-l \"Pear(add_header=lgpl)\"|-l \"Pear(add_header=pear)\""
|
||||
ChoicesReadable="PHP|BSD|Apache|LGPL|PEAR"
|
||||
Description="<html>Adds header information to a file. These can be Php, BSD, Apache, LGPL or Pear license info.</html>"
|
||||
EditorType=multiple
|
||||
Enabled=true
|
||||
ValueDefault=0
|
||||
|
||||
[Newline Class]
|
||||
Category=0
|
||||
Description=<html>Add a new line after class before opening brace.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse="-l \"Pear(newline_class=true)\"|-l \"Pear(newline_class=false)\""
|
||||
ValueDefault=1
|
||||
|
||||
[Newline Function]
|
||||
Category=0
|
||||
Description=<html>Add a new line after function before opening brace.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse="-l \"Pear(newline_function=true)\"|-l \"Pear(newline_function=false)\""
|
||||
ValueDefault=1
|
||||
|
||||
[New Lines Before]
|
||||
CallName="-l \"NewLines(before="
|
||||
Category=0
|
||||
Description="<html>Add new lines before specific keywords. Keywords are separated by a single colon. Example: if:switch:T_CLASS<br />The string MUST end with a closing brace and an escaped double quote.</html>"
|
||||
EditorType=string
|
||||
Enabled=false
|
||||
ValueDefault="if:switch:T_CLASS)\""
|
||||
|
||||
[New Lines After]
|
||||
CallName="-l \"NewLines(after="
|
||||
Category=0
|
||||
Description="<html>Add new lines after specific keywords. Keywords are separated by a single colon. Example: T_COMMENT:function<br />The string MUST end with a closing brace and an escaped double quote.</html>"
|
||||
EditorType=string
|
||||
Enabled=false
|
||||
ValueDefault="T_COMMENT:function)\""
|
||||
|
||||
[Arrays Nested]
|
||||
Category=0
|
||||
Description=<html></html>
|
||||
EditorType=boolean
|
||||
TrueFalse="-l \"ArrayNested()\"|"
|
||||
ValueDefault=0
|
||||
|
||||
[Lowercase]
|
||||
Category=0
|
||||
Description=<html>Lowercases all control structures.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse="-l \"Lowercase()\"|"
|
||||
ValueDefault=0
|
||||
|
||||
[List Class And Functions]
|
||||
Category=0
|
||||
Choices="-l \"ListClassFunction(list_classes=true)\"|-l \"ListClassFunction(list_functions=true)\"|-l \"ListClassFunction()\""
|
||||
ChoicesReadable="List Classes|List Functions|List Classes And Functions"
|
||||
Description=<html>Create a list of functions and classes in the script By default, this Filter puts the list at the beggining of the script. If you want it in another position, put a comment like that <pre> // Class and Function List </pre> The script lookup for the string 'Class and Function List' in a comment and replace the entire comment with the list.</html>
|
||||
EditorType=multiple
|
||||
Enabled=false
|
||||
ValueDefault=0
|
||||
|
||||
[Indent Styles]
|
||||
Category=0
|
||||
Choices="-l \"IndentStyles(style=k&r)\"|-l \"IndentStyles(style=allman)\"|-l \"IndentStyles(style=whitesmiths)\"|-l \"IndentStyles(style=gnu)\""
|
||||
ChoicesReadable="K&R|Allman|Whitesmiths|GNU"
|
||||
Description=<html></html>
|
||||
EditorType=multiple
|
||||
Enabled=false
|
||||
ValueDefault=0
|
||||
[header]
|
||||
categories=General
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.php|*.phpt|*.phps
|
||||
indenterFileName=php_beautifier
|
||||
indenterName=PHP_Beautifier (PHP)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter="-f "
|
||||
manual=http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/tutorial_PHP_Beautifier.howtouse.commandline.pkg.html
|
||||
outputFileName=indentoutput
|
||||
outputFileParameter="-o "
|
||||
parameterOrder=iop
|
||||
showHelpParameter=--help
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=0.1.13
|
||||
|
||||
[Indent With Spaces]
|
||||
CallName="-s"
|
||||
Category=1
|
||||
Description=<html>Indent the code with the set number of spaces.</html>
|
||||
EditorType=numeric
|
||||
Enabled=true
|
||||
MaxVal=99
|
||||
MinVal=0
|
||||
ValueDefault=4
|
||||
|
||||
[Indent With Tabs]
|
||||
CallName="-t"
|
||||
Category=1
|
||||
Description=<html>Indent the code with the set number of tabs.</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=99
|
||||
MinVal=0
|
||||
ValueDefault=1
|
||||
|
||||
[Add Header]
|
||||
Category=0
|
||||
Choices="-l \"Pear(add_header=php)\"|-l \"Pear(add_header=bsd)\"|-l \"Pear(add_header=apache)\"|-l \"Pear(add_header=lgpl)\"|-l \"Pear(add_header=pear)\""
|
||||
ChoicesReadable="PHP|BSD|Apache|LGPL|PEAR"
|
||||
Description="<html>Adds header information to a file. These can be Php, BSD, Apache, LGPL or Pear license info.</html>"
|
||||
EditorType=multiple
|
||||
Enabled=true
|
||||
ValueDefault=0
|
||||
|
||||
[Newline Class]
|
||||
Category=0
|
||||
Description=<html>Add a new line after class before opening brace.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse="-l \"Pear(newline_class=true)\"|-l \"Pear(newline_class=false)\""
|
||||
ValueDefault=1
|
||||
|
||||
[Newline Function]
|
||||
Category=0
|
||||
Description=<html>Add a new line after function before opening brace.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse="-l \"Pear(newline_function=true)\"|-l \"Pear(newline_function=false)\""
|
||||
ValueDefault=1
|
||||
|
||||
[New Lines Before]
|
||||
CallName="-l \"NewLines(before="
|
||||
Category=0
|
||||
Description="<html>Add new lines before specific keywords. Keywords are separated by a single colon. Example: if:switch:T_CLASS<br />The string MUST end with a closing brace and an escaped double quote.</html>"
|
||||
EditorType=string
|
||||
Enabled=false
|
||||
ValueDefault="if:switch:T_CLASS)\""
|
||||
|
||||
[New Lines After]
|
||||
CallName="-l \"NewLines(after="
|
||||
Category=0
|
||||
Description="<html>Add new lines after specific keywords. Keywords are separated by a single colon. Example: T_COMMENT:function<br />The string MUST end with a closing brace and an escaped double quote.</html>"
|
||||
EditorType=string
|
||||
Enabled=false
|
||||
ValueDefault="T_COMMENT:function)\""
|
||||
|
||||
[Arrays Nested]
|
||||
Category=0
|
||||
Description=<html></html>
|
||||
EditorType=boolean
|
||||
TrueFalse="-l \"ArrayNested()\"|"
|
||||
ValueDefault=0
|
||||
|
||||
[Lowercase]
|
||||
Category=0
|
||||
Description=<html>Lowercases all control structures.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse="-l \"Lowercase()\"|"
|
||||
ValueDefault=0
|
||||
|
||||
[List Class And Functions]
|
||||
Category=0
|
||||
Choices="-l \"ListClassFunction(list_classes=true)\"|-l \"ListClassFunction(list_functions=true)\"|-l \"ListClassFunction()\""
|
||||
ChoicesReadable="List Classes|List Functions|List Classes And Functions"
|
||||
Description=<html>Create a list of functions and classes in the script By default, this Filter puts the list at the beggining of the script. If you want it in another position, put a comment like that <pre> // Class and Function List </pre> The script lookup for the string 'Class and Function List' in a comment and replace the entire comment with the list.</html>
|
||||
EditorType=multiple
|
||||
Enabled=false
|
||||
ValueDefault=0
|
||||
|
||||
[Indent Styles]
|
||||
Category=0
|
||||
Choices="-l \"IndentStyles(style=k&r)\"|-l \"IndentStyles(style=allman)\"|-l \"IndentStyles(style=whitesmiths)\"|-l \"IndentStyles(style=gnu)\""
|
||||
ChoicesReadable="K&R|Allman|Whitesmiths|GNU"
|
||||
Description=<html></html>
|
||||
EditorType=multiple
|
||||
Enabled=false
|
||||
ValueDefault=0
|
||||
|
@ -1,54 +1,54 @@
|
||||
[header]
|
||||
categories=General options
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.py
|
||||
indenterFileName=pindent.py
|
||||
indenterName=PIndent (Python)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://coverage.livinglogic.de/Tools/scripts/pindent.py.html
|
||||
outputFileName=indentinput
|
||||
outputFileParameter=none
|
||||
stringparaminquotes=false
|
||||
parameterOrder=pio
|
||||
showHelpParameter=
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version="from Python 2.5.1 package"
|
||||
|
||||
[End directives]
|
||||
Category=0
|
||||
Description="<html>Complete takes a valid Python program as input and outputs a version augmented with block-closing comments (add #end directives).<br />Or Delete assumes its input is a Python program with block-closing comments and outputs a commentless version(delete #end directives).<br />Or Reformat assumes its input is a Python program with block-closing comments but with its indentation messed up, and outputs a properly indented version (use #end directives).</html>"
|
||||
Enabled=true
|
||||
EditorType=multiple
|
||||
Choices="-c|-d|-r"
|
||||
ChoicesReadable="Complete|Delete|Reformat"
|
||||
ValueDefault=0
|
||||
|
||||
[Step size]
|
||||
Category=0
|
||||
Description="<html>Sets the indentation step size.</html>"
|
||||
Enabled=true
|
||||
EditorType=numeric
|
||||
CallName="-s "
|
||||
MinVal=0
|
||||
MaxVal=999
|
||||
ValueDefault=8
|
||||
|
||||
[Tab size]
|
||||
Category=0
|
||||
Description="<html>Sets the number of spaces a tab character is worth.</html>"
|
||||
Enabled=true
|
||||
EditorType=numeric
|
||||
CallName="-t "
|
||||
MinVal=0
|
||||
MaxVal=999
|
||||
ValueDefault=8
|
||||
|
||||
[Convert Tabs]
|
||||
Category=0
|
||||
Description="<html>Expand TABs into spaces.</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse=-e|
|
||||
ValueDefault=0
|
||||
[header]
|
||||
categories=General options
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.py
|
||||
indenterFileName=pindent.py
|
||||
indenterName=PIndent (Python)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://coverage.livinglogic.de/Tools/scripts/pindent.py.html
|
||||
outputFileName=indentinput
|
||||
outputFileParameter=none
|
||||
stringparaminquotes=false
|
||||
parameterOrder=pio
|
||||
showHelpParameter=
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version="from Python 2.5.1 package"
|
||||
|
||||
[End directives]
|
||||
Category=0
|
||||
Description="<html>Complete takes a valid Python program as input and outputs a version augmented with block-closing comments (add #end directives).<br />Or Delete assumes its input is a Python program with block-closing comments and outputs a commentless version(delete #end directives).<br />Or Reformat assumes its input is a Python program with block-closing comments but with its indentation messed up, and outputs a properly indented version (use #end directives).</html>"
|
||||
Enabled=true
|
||||
EditorType=multiple
|
||||
Choices="-c|-d|-r"
|
||||
ChoicesReadable="Complete|Delete|Reformat"
|
||||
ValueDefault=0
|
||||
|
||||
[Step size]
|
||||
Category=0
|
||||
Description="<html>Sets the indentation step size.</html>"
|
||||
Enabled=true
|
||||
EditorType=numeric
|
||||
CallName="-s "
|
||||
MinVal=0
|
||||
MaxVal=999
|
||||
ValueDefault=8
|
||||
|
||||
[Tab size]
|
||||
Category=0
|
||||
Description="<html>Sets the number of spaces a tab character is worth.</html>"
|
||||
Enabled=true
|
||||
EditorType=numeric
|
||||
CallName="-t "
|
||||
MinVal=0
|
||||
MaxVal=999
|
||||
ValueDefault=8
|
||||
|
||||
[Convert Tabs]
|
||||
Category=0
|
||||
Description="<html>Expand TABs into spaces.</html>"
|
||||
EditorType=boolean
|
||||
TrueFalse=-e|
|
||||
ValueDefault=0
|
||||
|
@ -1,196 +1,196 @@
|
||||
[header]
|
||||
categories=General options|Spaces|Indentation|Alignments
|
||||
cfgFileParameterEnding=cr
|
||||
configFilename=psti.cfg
|
||||
fileTypes=*.sql
|
||||
indenterFileName=psti.exe
|
||||
indenterName=Pl/Sql tidy (Pl/Sql)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter="-i "
|
||||
manual=http://psti.equinoxbase.com/manual.html
|
||||
outputFileName=indentoutput
|
||||
outputFileParameter="-o "
|
||||
stringparaminquotes=false
|
||||
parameterOrder=iop
|
||||
showHelpParameter=-h
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter="-ls "
|
||||
version=1.2
|
||||
|
||||
[Disable all switches]
|
||||
Category=0
|
||||
Description="<html>Sets all switches to off.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-0|
|
||||
ValueDefault=0
|
||||
|
||||
[Uppercase Keywords]
|
||||
Category=0
|
||||
Description="<html>Uppercase Keywords.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-uk+|-uk-
|
||||
ValueDefault=0
|
||||
|
||||
[Capitalized Keywords]
|
||||
Category=0
|
||||
Description="<html>Capitalized Keywords.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-ck+|-ck-
|
||||
ValueDefault=0
|
||||
|
||||
[Lowercase Keywords]
|
||||
Category=0
|
||||
Description="<html>Lowercase Keywords.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-lk+|-lk-
|
||||
ValueDefault=0
|
||||
|
||||
[Uppercase Identifiers]
|
||||
Category=0
|
||||
Description="<html>Uppercase Identifiers.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-ui+|-ui-
|
||||
ValueDefault=0
|
||||
|
||||
[Lowercase Identifiers]
|
||||
Category=0
|
||||
Description="<html>Lowercase Identifiers.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-li+|-li-
|
||||
ValueDefault=0
|
||||
|
||||
[Capitalized Identifiers]
|
||||
Category=0
|
||||
Description="<html>Capitalized Identifiers.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-ci+|-ci-
|
||||
ValueDefault=0
|
||||
|
||||
[Compactify]
|
||||
Category=1
|
||||
Description="<html>Compactify, remove redundant spaces/keep.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-c+|-c-
|
||||
ValueDefault=0
|
||||
|
||||
[Remove Operation Spaces]
|
||||
Category=1
|
||||
Description="<html>Remove spaces around operations (+,- etcdo nothing/).</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-co+|-co-
|
||||
ValueDefault=0
|
||||
|
||||
[Add Operation Spaces]
|
||||
Category=1
|
||||
Description="<html>Add space around operations/do nothing.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-sao+|-sao-
|
||||
ValueDefault=0
|
||||
|
||||
[Remove Space Open Bracket]
|
||||
Category=1
|
||||
Description="<html>Remove spaces after opening brackets/keep.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-rsaob+|-rsaob-
|
||||
ValueDefault=0
|
||||
|
||||
[Don't Remove Bracket Space]
|
||||
Category=1
|
||||
Description="<html>Don't remove spaces around brackets/do nothing.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-ncb+|-ncb-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent Size]
|
||||
Category=2
|
||||
Description="<html>Indent size in spaces or in tabs (generally).</html>"
|
||||
Enabled=true
|
||||
EditorType=numeric
|
||||
CallName="-is "
|
||||
MinVal=0
|
||||
MaxVal=1024
|
||||
ValueDefault=4
|
||||
|
||||
[Indent Lines]
|
||||
Category=2
|
||||
Description="<html>Whether to indent strings lines.</html>"
|
||||
Enabled=true
|
||||
EditorType=boolean
|
||||
TrueFalse=-in+|-in-
|
||||
ValueDefault=1
|
||||
|
||||
[Keep relative indentation]
|
||||
Category=2
|
||||
Description="<html>Keep the relative identation of an allowed sql/do nothing.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-rs+|-rs-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent after exception]
|
||||
Category=2
|
||||
Description="<html>Extra indentation after exception when yes/no.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-iaew+|-iaew-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent after case]
|
||||
Category=2
|
||||
Description="<html>Extra indentation after case when yes/no.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-iacw+|-iacw-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent after cursor]
|
||||
Category=2
|
||||
Description="<html>Extra indentation after cursor yes/no.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-iac+|-iac-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent comments]
|
||||
Category=2
|
||||
Description="<html>Indent standalone comments.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-isc+|-isc-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent comments special]
|
||||
Category=2
|
||||
Description="<html>Indent standalone comments in some special cases too.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-isc2+|-isc2-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent inside comments]
|
||||
Category=2
|
||||
Description="<html>Indent inside comments/do nothing.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-iic+|-iic-
|
||||
ValueDefault=0
|
||||
|
||||
[Column alignment]
|
||||
Category=3
|
||||
Description="<html>Column like lists inside brackets.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-clb+|-clb-
|
||||
ValueDefault=0
|
||||
[header]
|
||||
categories=General options|Spaces|Indentation|Alignments
|
||||
cfgFileParameterEnding=cr
|
||||
configFilename=psti.cfg
|
||||
fileTypes=*.sql
|
||||
indenterFileName=psti.exe
|
||||
indenterName=Pl/Sql tidy (Pl/Sql)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter="-i "
|
||||
manual=http://psti.equinoxbase.com/manual.html
|
||||
outputFileName=indentoutput
|
||||
outputFileParameter="-o "
|
||||
stringparaminquotes=false
|
||||
parameterOrder=iop
|
||||
showHelpParameter=-h
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter="-ls "
|
||||
version=1.2
|
||||
|
||||
[Disable all switches]
|
||||
Category=0
|
||||
Description="<html>Sets all switches to off.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-0|
|
||||
ValueDefault=0
|
||||
|
||||
[Uppercase Keywords]
|
||||
Category=0
|
||||
Description="<html>Uppercase Keywords.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-uk+|-uk-
|
||||
ValueDefault=0
|
||||
|
||||
[Capitalized Keywords]
|
||||
Category=0
|
||||
Description="<html>Capitalized Keywords.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-ck+|-ck-
|
||||
ValueDefault=0
|
||||
|
||||
[Lowercase Keywords]
|
||||
Category=0
|
||||
Description="<html>Lowercase Keywords.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-lk+|-lk-
|
||||
ValueDefault=0
|
||||
|
||||
[Uppercase Identifiers]
|
||||
Category=0
|
||||
Description="<html>Uppercase Identifiers.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-ui+|-ui-
|
||||
ValueDefault=0
|
||||
|
||||
[Lowercase Identifiers]
|
||||
Category=0
|
||||
Description="<html>Lowercase Identifiers.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-li+|-li-
|
||||
ValueDefault=0
|
||||
|
||||
[Capitalized Identifiers]
|
||||
Category=0
|
||||
Description="<html>Capitalized Identifiers.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-ci+|-ci-
|
||||
ValueDefault=0
|
||||
|
||||
[Compactify]
|
||||
Category=1
|
||||
Description="<html>Compactify, remove redundant spaces/keep.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-c+|-c-
|
||||
ValueDefault=0
|
||||
|
||||
[Remove Operation Spaces]
|
||||
Category=1
|
||||
Description="<html>Remove spaces around operations (+,- etcdo nothing/).</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-co+|-co-
|
||||
ValueDefault=0
|
||||
|
||||
[Add Operation Spaces]
|
||||
Category=1
|
||||
Description="<html>Add space around operations/do nothing.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-sao+|-sao-
|
||||
ValueDefault=0
|
||||
|
||||
[Remove Space Open Bracket]
|
||||
Category=1
|
||||
Description="<html>Remove spaces after opening brackets/keep.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-rsaob+|-rsaob-
|
||||
ValueDefault=0
|
||||
|
||||
[Don't Remove Bracket Space]
|
||||
Category=1
|
||||
Description="<html>Don't remove spaces around brackets/do nothing.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-ncb+|-ncb-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent Size]
|
||||
Category=2
|
||||
Description="<html>Indent size in spaces or in tabs (generally).</html>"
|
||||
Enabled=true
|
||||
EditorType=numeric
|
||||
CallName="-is "
|
||||
MinVal=0
|
||||
MaxVal=1024
|
||||
ValueDefault=4
|
||||
|
||||
[Indent Lines]
|
||||
Category=2
|
||||
Description="<html>Whether to indent strings lines.</html>"
|
||||
Enabled=true
|
||||
EditorType=boolean
|
||||
TrueFalse=-in+|-in-
|
||||
ValueDefault=1
|
||||
|
||||
[Keep relative indentation]
|
||||
Category=2
|
||||
Description="<html>Keep the relative identation of an allowed sql/do nothing.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-rs+|-rs-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent after exception]
|
||||
Category=2
|
||||
Description="<html>Extra indentation after exception when yes/no.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-iaew+|-iaew-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent after case]
|
||||
Category=2
|
||||
Description="<html>Extra indentation after case when yes/no.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-iacw+|-iacw-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent after cursor]
|
||||
Category=2
|
||||
Description="<html>Extra indentation after cursor yes/no.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-iac+|-iac-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent comments]
|
||||
Category=2
|
||||
Description="<html>Indent standalone comments.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-isc+|-isc-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent comments special]
|
||||
Category=2
|
||||
Description="<html>Indent standalone comments in some special cases too.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-isc2+|-isc2-
|
||||
ValueDefault=0
|
||||
|
||||
[Indent inside comments]
|
||||
Category=2
|
||||
Description="<html>Indent inside comments/do nothing.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-iic+|-iic-
|
||||
ValueDefault=0
|
||||
|
||||
[Column alignment]
|
||||
Category=3
|
||||
Description="<html>Column like lists inside brackets.</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=-clb+|-clb-
|
||||
ValueDefault=0
|
||||
|
@ -1,27 +1,27 @@
|
||||
[header]
|
||||
categories=General
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.rb
|
||||
indenterFileName=ruby_formatter.rb
|
||||
indenterName=Simple Ruby Formatter (Ruby)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://raa.ruby-lang.org/project/ruby_formatter/
|
||||
outputFileName=indentinput
|
||||
outputFileParameter=none
|
||||
parameterOrder=pio
|
||||
showHelpParameter=
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=Rev 0.6.1
|
||||
|
||||
[indent spaces]
|
||||
CallName="-s "
|
||||
Category=0
|
||||
Description=<html>Indent using # spaces per indent</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=20
|
||||
MinVal=2
|
||||
[header]
|
||||
categories=General
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.rb
|
||||
indenterFileName=ruby_formatter.rb
|
||||
indenterName=Simple Ruby Formatter (Ruby)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://raa.ruby-lang.org/project/ruby_formatter/
|
||||
outputFileName=indentinput
|
||||
outputFileParameter=none
|
||||
parameterOrder=pio
|
||||
showHelpParameter=
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=Rev 0.6.1
|
||||
|
||||
[indent spaces]
|
||||
CallName="-s "
|
||||
Category=0
|
||||
Description=<html>Indent using # spaces per indent</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=20
|
||||
MinVal=2
|
||||
ValueDefault=4
|
@ -1,17 +1,17 @@
|
||||
[header]
|
||||
categories=
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.sh
|
||||
indenterFileName=shellindent.awk
|
||||
indenterName=Shell Code Indent (sh)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://www.bolthole.com/AWK.html
|
||||
outputFileName=
|
||||
outputFileParameter=stdout
|
||||
parameterOrder=pio
|
||||
showHelpParameter=
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=2008-01-10
|
||||
[header]
|
||||
categories=
|
||||
cfgFileParameterEnding=" "
|
||||
configFilename=
|
||||
fileTypes=*.sh
|
||||
indenterFileName=shellindent.awk
|
||||
indenterName=Shell Code Indent (sh)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://www.bolthole.com/AWK.html
|
||||
outputFileName=
|
||||
outputFileParameter=stdout
|
||||
parameterOrder=pio
|
||||
showHelpParameter=
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=2008-01-10
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,45 +1,45 @@
|
||||
[header]
|
||||
categories=General
|
||||
cfgFileParameterEnding=cr
|
||||
configFilename=
|
||||
fileTypes=*.vb
|
||||
indenterFileName=vbsbeaut.bat
|
||||
indenterName=VBSBeautifier (VB)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=" "
|
||||
manual=http://www.daansystems.com/vbsbeaut/
|
||||
outputFileName=indentinput
|
||||
outputFileParameter=none
|
||||
parameterOrder=pio
|
||||
showHelpParameter=
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=1.10
|
||||
|
||||
|
||||
[Spaces]
|
||||
Category=0
|
||||
Description="<html>Replace tabs by this number of spaces</html>"
|
||||
Enabled=false
|
||||
EditorType=numeric
|
||||
CallName="-s"
|
||||
MinVal=0
|
||||
MaxVal=1024
|
||||
ValueDefault=4
|
||||
|
||||
[Keywords]
|
||||
Category=0
|
||||
Description="<html>Change keywords</html>"
|
||||
Enabled=false
|
||||
EditorType=multiple
|
||||
Choices="|-u|-l|-n"
|
||||
ChoicesReadable="Properize keywords|Make keywords uppercase|Make keywords lowercase|Don't change keywords"
|
||||
ValueDefault=0
|
||||
|
||||
[Split Dim]
|
||||
Category=0
|
||||
Description="<html>Split Dim statements</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=|-d
|
||||
ValueDefault=0
|
||||
[header]
|
||||
categories=General
|
||||
cfgFileParameterEnding=cr
|
||||
configFilename=
|
||||
fileTypes=*.vb
|
||||
indenterFileName=vbsbeaut.bat
|
||||
indenterName=VBSBeautifier (VB)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=" "
|
||||
manual=http://www.daansystems.com/vbsbeaut/
|
||||
outputFileName=indentinput
|
||||
outputFileParameter=none
|
||||
parameterOrder=pio
|
||||
showHelpParameter=
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=
|
||||
version=1.10
|
||||
|
||||
|
||||
[Spaces]
|
||||
Category=0
|
||||
Description="<html>Replace tabs by this number of spaces</html>"
|
||||
Enabled=false
|
||||
EditorType=numeric
|
||||
CallName="-s"
|
||||
MinVal=0
|
||||
MaxVal=1024
|
||||
ValueDefault=4
|
||||
|
||||
[Keywords]
|
||||
Category=0
|
||||
Description="<html>Change keywords</html>"
|
||||
Enabled=false
|
||||
EditorType=multiple
|
||||
Choices="|-u|-l|-n"
|
||||
ChoicesReadable="Properize keywords|Make keywords uppercase|Make keywords lowercase|Don't change keywords"
|
||||
ValueDefault=0
|
||||
|
||||
[Split Dim]
|
||||
Category=0
|
||||
Description="<html>Split Dim statements</html>"
|
||||
Enabled=false
|
||||
EditorType=boolean
|
||||
TrueFalse=|-d
|
||||
ValueDefault=0
|
||||
|
@ -1,61 +1,61 @@
|
||||
[header]
|
||||
categories=General
|
||||
cfgFileParameterEnding=cr
|
||||
configFilename=
|
||||
fileTypes=*.xml|*.xslt
|
||||
indenterFileName=xmlindent
|
||||
indenterName=XML Indent (XML, XSL)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://universalindent.sf.net/indentermanuals/xmlindent.txt
|
||||
outputFileName=indentoutput
|
||||
outputFileParameter="-o "
|
||||
parameterOrder=poi
|
||||
showHelpParameter=-h
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=none
|
||||
version=0.2.17
|
||||
|
||||
[Indent level]
|
||||
CallName="-i "
|
||||
Category=0
|
||||
Description=<html>Indent using n spaces or tabs.</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=120
|
||||
MinVal=0
|
||||
ValueDefault=4
|
||||
|
||||
[Use tabs]
|
||||
Category=0
|
||||
Description=<html>Use tabs instead of spaces for indent.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse=-t|
|
||||
ValueDefault=0
|
||||
|
||||
[Maximum wrap columns]
|
||||
CallName="-l "
|
||||
Category=0
|
||||
Description=<html>Maximum columns for line wrapping.</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=120
|
||||
MinVal=0
|
||||
ValueDefault=80
|
||||
|
||||
[Suppress newline at pos]
|
||||
CallName="-n "
|
||||
Category=0
|
||||
Description=<html>Suppress newline at position.</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=120
|
||||
MinVal=0
|
||||
ValueDefault=80
|
||||
|
||||
[Force newline]
|
||||
Category=0
|
||||
Description=<html>Force newline on elements without children.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse=-f|
|
||||
ValueDefault=0
|
||||
[header]
|
||||
categories=General
|
||||
cfgFileParameterEnding=cr
|
||||
configFilename=
|
||||
fileTypes=*.xml|*.xslt
|
||||
indenterFileName=xmlindent
|
||||
indenterName=XML Indent (XML, XSL)
|
||||
inputFileName=indentinput
|
||||
inputFileParameter=
|
||||
manual=http://universalindent.sf.net/indentermanuals/xmlindent.txt
|
||||
outputFileName=indentoutput
|
||||
outputFileParameter="-o "
|
||||
parameterOrder=poi
|
||||
showHelpParameter=-h
|
||||
stringparaminquotes=false
|
||||
useCfgFileParameter=none
|
||||
version=0.2.17
|
||||
|
||||
[Indent level]
|
||||
CallName="-i "
|
||||
Category=0
|
||||
Description=<html>Indent using n spaces or tabs.</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=120
|
||||
MinVal=0
|
||||
ValueDefault=4
|
||||
|
||||
[Use tabs]
|
||||
Category=0
|
||||
Description=<html>Use tabs instead of spaces for indent.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse=-t|
|
||||
ValueDefault=0
|
||||
|
||||
[Maximum wrap columns]
|
||||
CallName="-l "
|
||||
Category=0
|
||||
Description=<html>Maximum columns for line wrapping.</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=120
|
||||
MinVal=0
|
||||
ValueDefault=80
|
||||
|
||||
[Suppress newline at pos]
|
||||
CallName="-n "
|
||||
Category=0
|
||||
Description=<html>Suppress newline at position.</html>
|
||||
EditorType=numeric
|
||||
Enabled=false
|
||||
MaxVal=120
|
||||
MinVal=0
|
||||
ValueDefault=80
|
||||
|
||||
[Force newline]
|
||||
Category=0
|
||||
Description=<html>Force newline on elements without children.</html>
|
||||
EditorType=boolean
|
||||
TrueFalse=-f|
|
||||
ValueDefault=0
|
||||
|
@ -1,121 +1,121 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FindDialog</class>
|
||||
<widget class="QDialog" name="FindDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>347</width>
|
||||
<height>227</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Find</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Find what:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Find options</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Match case</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="text">
|
||||
<string>Match whole word</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="text">
|
||||
<string>Search forward</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_4">
|
||||
<property name="text">
|
||||
<string>Use Regular Expressions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Find Next</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FindDialog</class>
|
||||
<widget class="QDialog" name="FindDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>347</width>
|
||||
<height>227</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Find</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Find what:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Find options</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Match case</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="text">
|
||||
<string>Match whole word</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="text">
|
||||
<string>Search forward</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_4">
|
||||
<property name="text">
|
||||
<string>Use Regular Expressions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Find Next</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -1,275 +1,275 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "SettingsPaths.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QStack>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
//! \defgroup grp_Settings All concerning applications settings.
|
||||
|
||||
/*!
|
||||
\class SettingsPaths
|
||||
\ingroup grp_Settings
|
||||
\brief SettingsPaths is a pure static functions class from which info about the
|
||||
paths needed for settings can be retrieved.
|
||||
*/
|
||||
|
||||
bool SettingsPaths::_alreadyInitialized = false;
|
||||
QString SettingsPaths::_applicationBinaryPath = "";
|
||||
QString SettingsPaths::_settingsPath = "";
|
||||
QString SettingsPaths::_globalFilesPath = "";
|
||||
QString SettingsPaths::_indenterPath = "";
|
||||
QString SettingsPaths::_tempPath = "";
|
||||
bool SettingsPaths::_portableMode = false;
|
||||
|
||||
|
||||
/*!
|
||||
\brief Initializes all available information about the paths.
|
||||
|
||||
Mainly during this init it is detected whether to start in portable mode or not. This is
|
||||
done by testing whether the directory "config" is in the same directory as this
|
||||
applications executable file.
|
||||
In portable mode all data is ONLY written to subdirectories of the applications executable file.
|
||||
Means also that the directory "indenters" has to be there.
|
||||
In not portable mode (multiuser mode) only users home directory is used for writing config data.
|
||||
*/
|
||||
void SettingsPaths::init() {
|
||||
_alreadyInitialized = true;
|
||||
|
||||
qDebug() << __LINE__ << " " << __FUNCTION__ << ": Initializing application paths.";
|
||||
|
||||
// Get the applications binary path, with respect to MacOSXs use of the .app folder.
|
||||
_applicationBinaryPath = QCoreApplication::applicationDirPath();
|
||||
// Remove any trailing slashes
|
||||
while ( _applicationBinaryPath.right(1) == "/" ) {
|
||||
_applicationBinaryPath.chop(1);
|
||||
}
|
||||
|
||||
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
|
||||
_applicationBinaryPath += "/plugins/uigui";
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
// Because on Mac universal binaries are used, the binary path is not equal
|
||||
// to the applications (.app) path. So get the .apps path here.
|
||||
int indexOfDotApp = _applicationBinaryPath.indexOf(".app");
|
||||
if ( indexOfDotApp != -1 ) {
|
||||
// Cut off after the dot of ".app".
|
||||
_applicationBinaryPath = _applicationBinaryPath.left( indexOfDotApp-1 );
|
||||
// Cut off after the first slash that was in front of ".app" (normally this is the word "UniversalIndentGUI")
|
||||
_applicationBinaryPath = _applicationBinaryPath.left( _applicationBinaryPath.lastIndexOf("/") );
|
||||
}
|
||||
#endif
|
||||
|
||||
// If the "config" directory is a subdir of the applications binary path, use this one (portable mode)
|
||||
_settingsPath = _applicationBinaryPath + "/config";
|
||||
if ( QFile::exists( _settingsPath ) ) {
|
||||
_portableMode = true;
|
||||
QDir dirCreator;
|
||||
_globalFilesPath = _applicationBinaryPath;
|
||||
_indenterPath = _applicationBinaryPath + "/indenters";
|
||||
dirCreator.mkpath( _settingsPath );
|
||||
_tempPath = _applicationBinaryPath + "/temp";
|
||||
//TODO: If the portable drive has write protection, use local temp path and clean it up on exit.
|
||||
dirCreator.mkpath( _tempPath );
|
||||
}
|
||||
// ... otherwise use the system specific global application data path.
|
||||
else {
|
||||
_portableMode = false;
|
||||
QDir dirCreator;
|
||||
#ifdef Q_OS_WIN
|
||||
// Get the local users application settings directory.
|
||||
// Remove any trailing slashes.
|
||||
_settingsPath = QDir::fromNativeSeparators( qgetenv("APPDATA") );
|
||||
while ( _settingsPath.right(1) == "/" ) {
|
||||
_settingsPath.chop(1);
|
||||
}
|
||||
_settingsPath = _settingsPath + "/UniversalIndentGUI";
|
||||
|
||||
// On windows systems the directories "indenters", "translations" are subdirs of the _applicationBinaryPath.
|
||||
_globalFilesPath = _applicationBinaryPath;
|
||||
#else
|
||||
// Remove any trailing slashes.
|
||||
_settingsPath = QDir::homePath();
|
||||
while ( _settingsPath.right(1) == "/" ) {
|
||||
_settingsPath.chop(1);
|
||||
}
|
||||
_settingsPath = _settingsPath + "/.universalindentgui";
|
||||
_globalFilesPath = "/usr/share/universalindentgui";
|
||||
#endif
|
||||
dirCreator.mkpath( _settingsPath );
|
||||
// If a highlighter config file does not exist in the users home config dir
|
||||
// copy the default config file over there.
|
||||
if ( !QFile::exists(_settingsPath+"/UiGuiSyntaxHighlightConfig.ini") ) {
|
||||
QFile::copy( _globalFilesPath+"/config/UiGuiSyntaxHighlightConfig.ini", _settingsPath+"/UiGuiSyntaxHighlightConfig.ini" );
|
||||
}
|
||||
_indenterPath = _globalFilesPath + "/indenters";
|
||||
|
||||
// On different systems it may be that "QDir::tempPath()" ends with a "/" or not. So check this.
|
||||
// Remove any trailing slashes.
|
||||
_tempPath = QDir::tempPath();
|
||||
while ( _tempPath.right(1) == "/" ) {
|
||||
_tempPath.chop(1);
|
||||
}
|
||||
_tempPath = _tempPath + "/UniversalIndentGUI";
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
dirCreator.mkpath( _tempPath );
|
||||
#else
|
||||
// On Unix based systems create a random temporary directory for security
|
||||
// reasons. Otherwise an evil human being could create a symbolic link
|
||||
// to an important existing file which gets overwritten when UiGUI writes
|
||||
// into this normally temporary but linked file.
|
||||
char *pathTemplate = new char[_tempPath.length()+8];
|
||||
QByteArray pathTemplateQBA = QString(_tempPath + "-XXXXXX").toAscii();
|
||||
delete [] pathTemplate;
|
||||
pathTemplate = pathTemplateQBA.data();
|
||||
pathTemplate = mkdtemp( pathTemplate );
|
||||
_tempPath = pathTemplate;
|
||||
#endif
|
||||
}
|
||||
|
||||
qDebug() << __LINE__ << " " << __FUNCTION__ << ": Paths are:" \
|
||||
"<ul><li>_applicationBinaryPath=" << _applicationBinaryPath \
|
||||
<< "</li><li>_settingsPath=" << _settingsPath \
|
||||
<< "</li><li>_globalFilesPath=" << _globalFilesPath \
|
||||
<< "</li><li>_indenterPath=" << _indenterPath \
|
||||
<< "</li><li>_tempPath=" << _tempPath \
|
||||
<< "</li><li>Running in portable mode=" << _portableMode << "</li></ul>";
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path of the applications executable.
|
||||
*/
|
||||
const QString SettingsPaths::getApplicationBinaryPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _applicationBinaryPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path where all settings are being/should be written to.
|
||||
*/
|
||||
const QString SettingsPaths::getSettingsPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _settingsPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path where the files concerning all users reside. For example translations.
|
||||
*/
|
||||
const QString SettingsPaths::getGlobalFilesPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _globalFilesPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path where the indenter executables reside.
|
||||
*/
|
||||
const QString SettingsPaths::getIndenterPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _indenterPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path where the where all temporary data should be written to.
|
||||
*/
|
||||
const QString SettingsPaths::getTempPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _tempPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns true if portable mode shall be used.
|
||||
*/
|
||||
bool SettingsPaths::getPortableMode() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _portableMode;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Completely deletes the created temporary directory with all of its content.
|
||||
*/
|
||||
void SettingsPaths::cleanAndRemoveTempDir() {
|
||||
QDirIterator dirIterator(_tempPath, QDirIterator::Subdirectories);
|
||||
QStack<QString> directoryStack;
|
||||
bool noErrorsOccurred = true;
|
||||
|
||||
while ( dirIterator.hasNext() ) {
|
||||
QString currentDirOrFile = dirIterator.next();
|
||||
// If this dummy call isn't done here, calling "dirIterator.fileInfo().isDir()" later somehow fails.
|
||||
dirIterator.fileInfo();
|
||||
|
||||
if ( !currentDirOrFile.isEmpty() && dirIterator.fileName() != "." && dirIterator.fileName() != ".." ) {
|
||||
// There is a path on the stack but the current path doesn't start with that path.
|
||||
// So we changed into another parent directory and the one on the stack can be deleted
|
||||
// since it must be empty.
|
||||
if ( !directoryStack.isEmpty() && !currentDirOrFile.startsWith(directoryStack.top()) ) {
|
||||
QString dirToBeRemoved = directoryStack.pop();
|
||||
bool couldRemoveDir = QDir(dirToBeRemoved).rmdir(dirToBeRemoved);
|
||||
noErrorsOccurred &= couldRemoveDir;
|
||||
if ( couldRemoveDir == false )
|
||||
qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the directory: " << dirToBeRemoved;
|
||||
//qDebug() << "Removing Dir " << directoryStack.pop();
|
||||
}
|
||||
|
||||
// If the iterator currently points to a directory push it onto the stack.
|
||||
if ( dirIterator.fileInfo().isDir() ) {
|
||||
directoryStack.push( currentDirOrFile );
|
||||
//qDebug() << "Pushing onto Stack " << currentDirOrFile;
|
||||
}
|
||||
// otherwise it must be a file, so delete it.
|
||||
else {
|
||||
bool couldRemoveFile = QFile::remove( currentDirOrFile );
|
||||
noErrorsOccurred &= couldRemoveFile;
|
||||
if ( couldRemoveFile == false )
|
||||
qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the file: " << currentDirOrFile;
|
||||
//qDebug() << "Removing File " << currentDirOrFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
noErrorsOccurred &= QDir(_tempPath).rmdir(_tempPath);
|
||||
if ( noErrorsOccurred == false )
|
||||
qWarning() << __LINE__ << " " << __FUNCTION__ << "While cleaning up the temp dir an error occurred.";
|
||||
}
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "SettingsPaths.h"
|
||||
|
||||
#include <tqcoreapplication.h>
|
||||
#include <tqfile.h>
|
||||
#include <tqdir.h>
|
||||
#include <tqdiriterator.h>
|
||||
#include <tqstack.h>
|
||||
#include <tqtdebug.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
//! \defgroup grp_Settings All concerning applications settings.
|
||||
|
||||
/*!
|
||||
\class SettingsPaths
|
||||
\ingroup grp_Settings
|
||||
\brief SettingsPaths is a pure static functions class from which info about the
|
||||
paths needed for settings can be retrieved.
|
||||
*/
|
||||
|
||||
bool SettingsPaths::_alreadyInitialized = false;
|
||||
QString SettingsPaths::_applicationBinaryPath = "";
|
||||
QString SettingsPaths::_settingsPath = "";
|
||||
QString SettingsPaths::_globalFilesPath = "";
|
||||
QString SettingsPaths::_indenterPath = "";
|
||||
QString SettingsPaths::_tempPath = "";
|
||||
bool SettingsPaths::_portableMode = false;
|
||||
|
||||
|
||||
/*!
|
||||
\brief Initializes all available information about the paths.
|
||||
|
||||
Mainly during this init it is detected whether to start in portable mode or not. This is
|
||||
done by testing whether the directory "config" is in the same directory as this
|
||||
applications executable file.
|
||||
In portable mode all data is ONLY written to subdirectories of the applications executable file.
|
||||
Means also that the directory "indenters" has to be there.
|
||||
In not portable mode (multiuser mode) only users home directory is used for writing config data.
|
||||
*/
|
||||
void SettingsPaths::init() {
|
||||
_alreadyInitialized = true;
|
||||
|
||||
qDebug() << __LINE__ << " " << __FUNCTION__ << ": Initializing application paths.";
|
||||
|
||||
// Get the applications binary path, with respect to MacOSXs use of the .app folder.
|
||||
_applicationBinaryPath = QCoreApplication::applicationDirPath();
|
||||
// Remove any trailing slashes
|
||||
while ( _applicationBinaryPath.right(1) == "/" ) {
|
||||
_applicationBinaryPath.chop(1);
|
||||
}
|
||||
|
||||
#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
|
||||
_applicationBinaryPath += "/plugins/uigui";
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
// Because on Mac universal binaries are used, the binary path is not equal
|
||||
// to the applications (.app) path. So get the .apps path here.
|
||||
int indexOfDotApp = _applicationBinaryPath.indexOf(".app");
|
||||
if ( indexOfDotApp != -1 ) {
|
||||
// Cut off after the dot of ".app".
|
||||
_applicationBinaryPath = _applicationBinaryPath.left( indexOfDotApp-1 );
|
||||
// Cut off after the first slash that was in front of ".app" (normally this is the word "UniversalIndentGUI")
|
||||
_applicationBinaryPath = _applicationBinaryPath.left( _applicationBinaryPath.lastIndexOf("/") );
|
||||
}
|
||||
#endif
|
||||
|
||||
// If the "config" directory is a subdir of the applications binary path, use this one (portable mode)
|
||||
_settingsPath = _applicationBinaryPath + "/config";
|
||||
if ( QFile::exists( _settingsPath ) ) {
|
||||
_portableMode = true;
|
||||
QDir dirCreator;
|
||||
_globalFilesPath = _applicationBinaryPath;
|
||||
_indenterPath = _applicationBinaryPath + "/indenters";
|
||||
dirCreator.mkpath( _settingsPath );
|
||||
_tempPath = _applicationBinaryPath + "/temp";
|
||||
//TODO: If the portable drive has write protection, use local temp path and clean it up on exit.
|
||||
dirCreator.mkpath( _tempPath );
|
||||
}
|
||||
// ... otherwise use the system specific global application data path.
|
||||
else {
|
||||
_portableMode = false;
|
||||
QDir dirCreator;
|
||||
#ifdef Q_OS_WIN
|
||||
// Get the local users application settings directory.
|
||||
// Remove any trailing slashes.
|
||||
_settingsPath = QDir::fromNativeSeparators( qgetenv("APPDATA") );
|
||||
while ( _settingsPath.right(1) == "/" ) {
|
||||
_settingsPath.chop(1);
|
||||
}
|
||||
_settingsPath = _settingsPath + "/UniversalIndentGUI";
|
||||
|
||||
// On windows systems the directories "indenters", "translations" are subdirs of the _applicationBinaryPath.
|
||||
_globalFilesPath = _applicationBinaryPath;
|
||||
#else
|
||||
// Remove any trailing slashes.
|
||||
_settingsPath = QDir::homePath();
|
||||
while ( _settingsPath.right(1) == "/" ) {
|
||||
_settingsPath.chop(1);
|
||||
}
|
||||
_settingsPath = _settingsPath + "/.universalindentgui";
|
||||
_globalFilesPath = "/usr/share/universalindentgui";
|
||||
#endif
|
||||
dirCreator.mkpath( _settingsPath );
|
||||
// If a highlighter config file does not exist in the users home config dir
|
||||
// copy the default config file over there.
|
||||
if ( !QFile::exists(_settingsPath+"/UiGuiSyntaxHighlightConfig.ini") ) {
|
||||
QFile::copy( _globalFilesPath+"/config/UiGuiSyntaxHighlightConfig.ini", _settingsPath+"/UiGuiSyntaxHighlightConfig.ini" );
|
||||
}
|
||||
_indenterPath = _globalFilesPath + "/indenters";
|
||||
|
||||
// On different systems it may be that "QDir::tempPath()" ends with a "/" or not. So check this.
|
||||
// Remove any trailing slashes.
|
||||
_tempPath = QDir::tempPath();
|
||||
while ( _tempPath.right(1) == "/" ) {
|
||||
_tempPath.chop(1);
|
||||
}
|
||||
_tempPath = _tempPath + "/UniversalIndentGUI";
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
dirCreator.mkpath( _tempPath );
|
||||
#else
|
||||
// On Unix based systems create a random temporary directory for security
|
||||
// reasons. Otherwise an evil human being could create a symbolic link
|
||||
// to an important existing file which gets overwritten when UiGUI writes
|
||||
// into this normally temporary but linked file.
|
||||
char *pathTemplate = new char[_tempPath.length()+8];
|
||||
QByteArray pathTemplateQBA = QString(_tempPath + "-XXXXXX").toAscii();
|
||||
delete [] pathTemplate;
|
||||
pathTemplate = pathTemplateQBA.data();
|
||||
pathTemplate = mkdtemp( pathTemplate );
|
||||
_tempPath = pathTemplate;
|
||||
#endif
|
||||
}
|
||||
|
||||
qDebug() << __LINE__ << " " << __FUNCTION__ << ": Paths are:" \
|
||||
"<ul><li>_applicationBinaryPath=" << _applicationBinaryPath \
|
||||
<< "</li><li>_settingsPath=" << _settingsPath \
|
||||
<< "</li><li>_globalFilesPath=" << _globalFilesPath \
|
||||
<< "</li><li>_indenterPath=" << _indenterPath \
|
||||
<< "</li><li>_tempPath=" << _tempPath \
|
||||
<< "</li><li>Running in portable mode=" << _portableMode << "</li></ul>";
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path of the applications executable.
|
||||
*/
|
||||
const QString SettingsPaths::getApplicationBinaryPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _applicationBinaryPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path where all settings are being/should be written to.
|
||||
*/
|
||||
const QString SettingsPaths::getSettingsPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _settingsPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path where the files concerning all users reside. For example translations.
|
||||
*/
|
||||
const QString SettingsPaths::getGlobalFilesPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _globalFilesPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path where the indenter executables reside.
|
||||
*/
|
||||
const QString SettingsPaths::getIndenterPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _indenterPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the path where the where all temporary data should be written to.
|
||||
*/
|
||||
const QString SettingsPaths::getTempPath() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _tempPath;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns true if portable mode shall be used.
|
||||
*/
|
||||
bool SettingsPaths::getPortableMode() {
|
||||
if ( !_alreadyInitialized ) {
|
||||
SettingsPaths::init();
|
||||
}
|
||||
return _portableMode;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Completely deletes the created temporary directory with all of its content.
|
||||
*/
|
||||
void SettingsPaths::cleanAndRemoveTempDir() {
|
||||
QDirIterator dirIterator(_tempPath, QDirIterator::Subdirectories);
|
||||
QStack<QString> directoryStack;
|
||||
bool noErrorsOccurred = true;
|
||||
|
||||
while ( dirIterator.hasNext() ) {
|
||||
QString currentDirOrFile = dirIterator.next();
|
||||
// If this dummy call isn't done here, calling "dirIterator.fileInfo().isDir()" later somehow fails.
|
||||
dirIterator.fileInfo();
|
||||
|
||||
if ( !currentDirOrFile.isEmpty() && dirIterator.fileName() != "." && dirIterator.fileName() != ".." ) {
|
||||
// There is a path on the stack but the current path doesn't start with that path.
|
||||
// So we changed into another parent directory and the one on the stack can be deleted
|
||||
// since it must be empty.
|
||||
if ( !directoryStack.isEmpty() && !currentDirOrFile.startsWith(directoryStack.top()) ) {
|
||||
QString dirToBeRemoved = directoryStack.pop();
|
||||
bool couldRemoveDir = QDir(dirToBeRemoved).rmdir(dirToBeRemoved);
|
||||
noErrorsOccurred &= couldRemoveDir;
|
||||
if ( couldRemoveDir == false )
|
||||
qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the directory: " << dirToBeRemoved;
|
||||
//qDebug() << "Removing Dir " << directoryStack.pop();
|
||||
}
|
||||
|
||||
// If the iterator currently points to a directory push it onto the stack.
|
||||
if ( dirIterator.fileInfo().isDir() ) {
|
||||
directoryStack.push( currentDirOrFile );
|
||||
//qDebug() << "Pushing onto Stack " << currentDirOrFile;
|
||||
}
|
||||
// otherwise it must be a file, so delete it.
|
||||
else {
|
||||
bool couldRemoveFile = QFile::remove( currentDirOrFile );
|
||||
noErrorsOccurred &= couldRemoveFile;
|
||||
if ( couldRemoveFile == false )
|
||||
qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the file: " << currentDirOrFile;
|
||||
//qDebug() << "Removing File " << currentDirOrFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
noErrorsOccurred &= QDir(_tempPath).rmdir(_tempPath);
|
||||
if ( noErrorsOccurred == false )
|
||||
qWarning() << __LINE__ << " " << __FUNCTION__ << "While cleaning up the temp dir an error occurred.";
|
||||
}
|
||||
|
@ -1,50 +1,50 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SETTINGSPATHS_H
|
||||
#define SETTINGSPATHS_H
|
||||
|
||||
class QString;
|
||||
|
||||
|
||||
class SettingsPaths
|
||||
{
|
||||
public:
|
||||
static void init();
|
||||
static const QString getApplicationBinaryPath();
|
||||
static const QString getSettingsPath();
|
||||
static const QString getGlobalFilesPath();
|
||||
static const QString getIndenterPath();
|
||||
static const QString getTempPath();
|
||||
static bool getPortableMode();
|
||||
static void cleanAndRemoveTempDir();
|
||||
|
||||
private:
|
||||
SettingsPaths();
|
||||
|
||||
static bool _alreadyInitialized;
|
||||
static QString _applicationBinaryPath;
|
||||
static QString _settingsPath;
|
||||
static QString _globalFilesPath;
|
||||
static QString _indenterPath;
|
||||
static QString _tempPath;
|
||||
static bool _portableMode;
|
||||
};
|
||||
|
||||
#endif // SETTINGSPATHS_H
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SETTINGSPATHS_H
|
||||
#define SETTINGSPATHS_H
|
||||
|
||||
class QString;
|
||||
|
||||
|
||||
class SettingsPaths
|
||||
{
|
||||
public:
|
||||
static void init();
|
||||
static const QString getApplicationBinaryPath();
|
||||
static const QString getSettingsPath();
|
||||
static const QString getGlobalFilesPath();
|
||||
static const QString getIndenterPath();
|
||||
static const QString getTempPath();
|
||||
static bool getPortableMode();
|
||||
static void cleanAndRemoveTempDir();
|
||||
|
||||
private:
|
||||
SettingsPaths();
|
||||
|
||||
static bool _alreadyInitialized;
|
||||
static QString _applicationBinaryPath;
|
||||
static QString _settingsPath;
|
||||
static QString _globalFilesPath;
|
||||
static QString _indenterPath;
|
||||
static QString _tempPath;
|
||||
static bool _portableMode;
|
||||
};
|
||||
|
||||
#endif // SETTINGSPATHS_H
|
||||
|
@ -1,31 +1,31 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef TEMPLATEBATCHSCRIPT_H
|
||||
#define TEMPLATEBATCHSCRIPT_H
|
||||
|
||||
class TemplateBatchScript
|
||||
{
|
||||
private:
|
||||
TemplateBatchScript();
|
||||
public:
|
||||
static const char* getTemplateBatchScript();
|
||||
};
|
||||
|
||||
#endif // TEMPLATEBATCHSCRIPT_H
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef TEMPLATEBATCHSCRIPT_H
|
||||
#define TEMPLATEBATCHSCRIPT_H
|
||||
|
||||
class TemplateBatchScript
|
||||
{
|
||||
private:
|
||||
TemplateBatchScript();
|
||||
public:
|
||||
static const char* getTemplateBatchScript();
|
||||
};
|
||||
|
||||
#endif // TEMPLATEBATCHSCRIPT_H
|
||||
|
@ -1,43 +1,43 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUIERRORMESSAGE_H
|
||||
#define UIGUIERRORMESSAGE_H
|
||||
|
||||
#include <QErrorMessage>
|
||||
|
||||
class QCheckBox;
|
||||
|
||||
|
||||
class UiGuiErrorMessage : public QErrorMessage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UiGuiErrorMessage(QWidget *parent = 0);
|
||||
~UiGuiErrorMessage(void);
|
||||
void showMessage( const QString &message );
|
||||
void showMessage( const QString &title, const QString &message );
|
||||
|
||||
private:
|
||||
QCheckBox *_showAgainCheckBox;
|
||||
QStringList _errorMessageList;
|
||||
};
|
||||
|
||||
#endif // UIGUIERRORMESSAGE_H
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUIERRORMESSAGE_H
|
||||
#define UIGUIERRORMESSAGE_H
|
||||
|
||||
#include <tqerrormessage.h>
|
||||
|
||||
class QCheckBox;
|
||||
|
||||
|
||||
class UiGuiErrorMessage : public QErrorMessage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UiGuiErrorMessage(QWidget *parent = 0);
|
||||
~UiGuiErrorMessage(void);
|
||||
void showMessage( const QString &message );
|
||||
void showMessage( const QString &title, const QString &message );
|
||||
|
||||
private:
|
||||
QCheckBox *_showAgainCheckBox;
|
||||
QStringList _errorMessageList;
|
||||
};
|
||||
|
||||
#endif // UIGUIERRORMESSAGE_H
|
||||
|
@ -1,55 +1,55 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUIINDENTSERVER_H
|
||||
#define UIGUIINDENTSERVER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QTcpServer;
|
||||
class QTcpSocket;
|
||||
|
||||
|
||||
class UiGuiIndentServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UiGuiIndentServer(void);
|
||||
~UiGuiIndentServer(void);
|
||||
|
||||
public slots:
|
||||
void startServer();
|
||||
void stopServer();
|
||||
|
||||
private slots:
|
||||
void handleNewConnection();
|
||||
void handleReceivedData();
|
||||
void sendMessage(const QString &message);
|
||||
void checkIfReadyForHandleRequest();
|
||||
|
||||
private:
|
||||
QTcpServer *_tcpServer;
|
||||
QByteArray _dataToSend;
|
||||
bool _readyForHandleRequest;
|
||||
QTcpSocket *_currentClientConnection;
|
||||
quint32 _blockSize;
|
||||
};
|
||||
|
||||
#endif // UIGUIINDENTSERVER_H
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUIINDENTSERVER_H
|
||||
#define UIGUIINDENTSERVER_H
|
||||
|
||||
#include <tqobject.h>
|
||||
|
||||
class QTcpServer;
|
||||
class QTcpSocket;
|
||||
|
||||
|
||||
class UiGuiIndentServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UiGuiIndentServer(void);
|
||||
~UiGuiIndentServer(void);
|
||||
|
||||
public slots:
|
||||
void startServer();
|
||||
void stopServer();
|
||||
|
||||
private slots:
|
||||
void handleNewConnection();
|
||||
void handleReceivedData();
|
||||
void sendMessage(const QString &message);
|
||||
void checkIfReadyForHandleRequest();
|
||||
|
||||
private:
|
||||
QTcpServer *_tcpServer;
|
||||
QByteArray _dataToSend;
|
||||
bool _readyForHandleRequest;
|
||||
QTcpSocket *_currentClientConnection;
|
||||
quint32 _blockSize;
|
||||
};
|
||||
|
||||
#endif // UIGUIINDENTSERVER_H
|
||||
|
@ -1,52 +1,52 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUIINIFILEPARSER_H
|
||||
#define UIGUIINIFILEPARSER_H
|
||||
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
|
||||
|
||||
class UiGuiIniFileParser
|
||||
{
|
||||
public:
|
||||
UiGuiIniFileParser(void);
|
||||
UiGuiIniFileParser(const QString &iniFileName);
|
||||
~UiGuiIniFileParser(void);
|
||||
QVariant value(const QString &keyName, const QString &defaultValue = "");
|
||||
QStringList childGroups();
|
||||
|
||||
protected:
|
||||
void init();
|
||||
|
||||
private:
|
||||
void parseIniFile();
|
||||
|
||||
QString _iniFileName;
|
||||
std::vector<QString> _sections;
|
||||
QMap<QString, QVariant> _keyValueMap;
|
||||
};
|
||||
|
||||
#endif // UIGUIINIFILEPARSER_H
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUIINIFILEPARSER_H
|
||||
#define UIGUIINIFILEPARSER_H
|
||||
|
||||
#include <tqmap.h>
|
||||
#include <tqstring.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
|
||||
|
||||
class UiGuiIniFileParser
|
||||
{
|
||||
public:
|
||||
UiGuiIniFileParser(void);
|
||||
UiGuiIniFileParser(const QString &iniFileName);
|
||||
~UiGuiIniFileParser(void);
|
||||
QVariant value(const QString &keyName, const QString &defaultValue = "");
|
||||
QStringList childGroups();
|
||||
|
||||
protected:
|
||||
void init();
|
||||
|
||||
private:
|
||||
void parseIniFile();
|
||||
|
||||
QString _iniFileName;
|
||||
std::vector<QString> _sections;
|
||||
QMap<QString, QVariant> _keyValueMap;
|
||||
};
|
||||
|
||||
#endif // UIGUIINIFILEPARSER_H
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,83 +1,83 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUISETTINGS_H
|
||||
#define UIGUISETTINGS_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QMultiMap>
|
||||
#include <QSharedPointer>
|
||||
|
||||
class QSettings;
|
||||
|
||||
|
||||
class UiGuiSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
UiGuiSettings();
|
||||
static QWeakPointer<UiGuiSettings> _instance;
|
||||
|
||||
public:
|
||||
static QSharedPointer<UiGuiSettings> getInstance();
|
||||
~UiGuiSettings();
|
||||
|
||||
bool registerObjectProperty(QObject *obj, const QString &propertyName, const QString &settingName);
|
||||
bool registerObjectPropertyRecursive(QObject *obj);
|
||||
bool setObjectPropertyToSettingValue(QObject *obj, const QString &propertyName, const QString &settingName);
|
||||
bool setObjectPropertyToSettingValueRecursive(QObject *obj);
|
||||
bool setSettingToObjectPropertyValue(QObject *obj, const QString &propertyName, const QString &settingName);
|
||||
bool setSettingToObjectPropertyValueRecursive(QObject *obj);
|
||||
bool registerObjectSlot(QObject *obj, const QString &slotName, const QString &settingName);
|
||||
QVariant getValueByName(QString settingName);
|
||||
QStringList getAvailableTranslations();
|
||||
|
||||
public slots:
|
||||
void setValueByName(const QString &settingName, const QVariant &value);
|
||||
void unregisterObjectProperty(QObject *obj);
|
||||
void unregisterObjectSlot(QObject *obj, const QString &slotName = "", const QString &settingName = "");
|
||||
|
||||
protected:
|
||||
bool initSettings();
|
||||
bool invokeMethodWithValue(QObject *obj, QMetaMethod mMethod, QVariant value);
|
||||
bool checkCustomPropertiesAndCallFunction(QObject *obj, bool (UiGuiSettings::*callBackFunc)(QObject *obj, const QString &propertyName, const QString &settingName));
|
||||
|
||||
private slots:
|
||||
void handleObjectPropertyChange();
|
||||
|
||||
private:
|
||||
void readAvailableTranslations();
|
||||
|
||||
//! Stores the mnemonics of the available translations.
|
||||
QStringList _availableTranslations;
|
||||
|
||||
//! The settings file.
|
||||
QSettings *_qsettings;
|
||||
|
||||
//! Maps an QObject to a string list containing the property name and the associated setting name.
|
||||
QMap<QObject*, QStringList> _registeredObjectProperties;
|
||||
|
||||
//! Maps QObjects to a string list containing the method name and the associated setting name.
|
||||
QMultiMap<QObject*, QStringList> _registeredObjectSlots;
|
||||
|
||||
QString _indenterDirctoryStr;
|
||||
};
|
||||
|
||||
#endif // UIGUISETTINGS_H
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUISETTINGS_H
|
||||
#define UIGUISETTINGS_H
|
||||
|
||||
#include <tqobject.h>
|
||||
#include <tqstringlist.h>
|
||||
#include <tqmultimap.h>
|
||||
#include <tqsharedpointer.h>
|
||||
|
||||
class QSettings;
|
||||
|
||||
|
||||
class UiGuiSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
UiGuiSettings();
|
||||
static QWeakPointer<UiGuiSettings> _instance;
|
||||
|
||||
public:
|
||||
static QSharedPointer<UiGuiSettings> getInstance();
|
||||
~UiGuiSettings();
|
||||
|
||||
bool registerObjectProperty(QObject *obj, const QString &propertyName, const QString &settingName);
|
||||
bool registerObjectPropertyRecursive(QObject *obj);
|
||||
bool setObjectPropertyToSettingValue(QObject *obj, const QString &propertyName, const QString &settingName);
|
||||
bool setObjectPropertyToSettingValueRecursive(QObject *obj);
|
||||
bool setSettingToObjectPropertyValue(QObject *obj, const QString &propertyName, const QString &settingName);
|
||||
bool setSettingToObjectPropertyValueRecursive(QObject *obj);
|
||||
bool registerObjectSlot(QObject *obj, const QString &slotName, const QString &settingName);
|
||||
QVariant getValueByName(QString settingName);
|
||||
QStringList getAvailableTranslations();
|
||||
|
||||
public slots:
|
||||
void setValueByName(const QString &settingName, const QVariant &value);
|
||||
void unregisterObjectProperty(QObject *obj);
|
||||
void unregisterObjectSlot(QObject *obj, const QString &slotName = "", const QString &settingName = "");
|
||||
|
||||
protected:
|
||||
bool initSettings();
|
||||
bool invokeMethodWithValue(QObject *obj, QMetaMethod mMethod, QVariant value);
|
||||
bool checkCustomPropertiesAndCallFunction(QObject *obj, bool (UiGuiSettings::*callBackFunc)(QObject *obj, const QString &propertyName, const QString &settingName));
|
||||
|
||||
private slots:
|
||||
void handleObjectPropertyChange();
|
||||
|
||||
private:
|
||||
void readAvailableTranslations();
|
||||
|
||||
//! Stores the mnemonics of the available translations.
|
||||
QStringList _availableTranslations;
|
||||
|
||||
//! The settings file.
|
||||
QSettings *_qsettings;
|
||||
|
||||
//! Maps an QObject to a string list containing the property name and the associated setting name.
|
||||
QMap<QObject*, QStringList> _registeredObjectProperties;
|
||||
|
||||
//! Maps QObjects to a string list containing the method name and the associated setting name.
|
||||
QMultiMap<QObject*, QStringList> _registeredObjectSlots;
|
||||
|
||||
QString _indenterDirctoryStr;
|
||||
};
|
||||
|
||||
#endif // UIGUISETTINGS_H
|
||||
|
@ -1,227 +1,227 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "UiGuiSystemInfo.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QSysInfo>
|
||||
#include <QProcess>
|
||||
#include <QFile>
|
||||
|
||||
UiGuiSystemInfo::UiGuiSystemInfo() {
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the operating system UiGUI is currently running on as one string.
|
||||
|
||||
The String contains name and version of the os. E.g. Linux Ubuntu 9.04.
|
||||
*/
|
||||
QString UiGuiSystemInfo::getOperatingSystem() {
|
||||
QString operatingSystemString = "";
|
||||
|
||||
#if defined(Q_WS_WIN)
|
||||
switch ( QSysInfo::WindowsVersion ) {
|
||||
case QSysInfo::WV_32s :
|
||||
operatingSystemString = "Windows 3.1 with Win 32s";
|
||||
break;
|
||||
case QSysInfo::WV_95 :
|
||||
operatingSystemString = "Windows 95";
|
||||
break;
|
||||
case QSysInfo::WV_98 :
|
||||
operatingSystemString = "Windows 98";
|
||||
break;
|
||||
case QSysInfo::WV_Me :
|
||||
operatingSystemString = "Windows Me";
|
||||
break;
|
||||
case QSysInfo::WV_NT :
|
||||
operatingSystemString = "Windows NT (operating system version 4.0)";
|
||||
break;
|
||||
case QSysInfo::WV_2000 :
|
||||
operatingSystemString = "Windows 2000 (operating system version 5.0)";
|
||||
break;
|
||||
case QSysInfo::WV_XP :
|
||||
operatingSystemString = "Windows XP (operating system version 5.1)";
|
||||
break;
|
||||
case QSysInfo::WV_2003 :
|
||||
operatingSystemString = "Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (operating system version 5.2)";
|
||||
break;
|
||||
case QSysInfo::WV_VISTA :
|
||||
operatingSystemString = "Windows Vista, Windows Server 2008 (operating system version 6.0)";
|
||||
break;
|
||||
case QSysInfo::WV_WINDOWS7 :
|
||||
operatingSystemString = "Windows 7 (operating system version 6.1)";
|
||||
break;
|
||||
case QSysInfo::WV_CE :
|
||||
operatingSystemString = "Windows CE";
|
||||
break;
|
||||
case QSysInfo::WV_CENET :
|
||||
operatingSystemString = "Windows CE .NET";
|
||||
break;
|
||||
case QSysInfo::WV_CE_5 :
|
||||
operatingSystemString = "Windows CE 5.x";
|
||||
break;
|
||||
case QSysInfo::WV_CE_6 :
|
||||
operatingSystemString = "Windows CE 6.x";
|
||||
break;
|
||||
default :
|
||||
operatingSystemString = "Unknown Windows operating system.";
|
||||
break;
|
||||
}
|
||||
#elif defined(Q_WS_MAC)
|
||||
switch ( QSysInfo::MacintoshVersion ) {
|
||||
case QSysInfo::MV_9 :
|
||||
operatingSystemString = "Mac OS 9 (unsupported)";
|
||||
break;
|
||||
case QSysInfo::MV_10_0 :
|
||||
operatingSystemString = "Mac OS X 10.0 Cheetah (unsupported)";
|
||||
break;
|
||||
case QSysInfo::MV_10_1 :
|
||||
operatingSystemString = "Mac OS X 10.1 Puma (unsupported)";
|
||||
break;
|
||||
case QSysInfo::MV_10_2 :
|
||||
operatingSystemString = "Mac OS X 10.2 Jaguar (unsupported)";
|
||||
break;
|
||||
case QSysInfo::MV_10_3 :
|
||||
operatingSystemString = "Mac OS X 10.3 Panther";
|
||||
break;
|
||||
case QSysInfo::MV_10_4 :
|
||||
operatingSystemString = "Mac OS X 10.4 Tiger";
|
||||
break;
|
||||
case QSysInfo::MV_10_5 :
|
||||
operatingSystemString = "Mac OS X 10.5 Leopard";
|
||||
break;
|
||||
case QSysInfo::MV_10_6 :
|
||||
operatingSystemString = "Mac OS X 10.6 Snow Leopard";
|
||||
break;
|
||||
case QSysInfo::MV_Unknown :
|
||||
operatingSystemString = "An unknown and currently unsupported platform";
|
||||
break;
|
||||
default :
|
||||
operatingSystemString = "Unknown Mac operating system.";
|
||||
break;
|
||||
}
|
||||
#else
|
||||
//TODO: Detect Unix, Linux etc. distro as described on http://www.novell.com/coolsolutions/feature/11251.html
|
||||
operatingSystemString = "Linux";
|
||||
QProcess process;
|
||||
|
||||
process.start("uname -s");
|
||||
bool result = process.waitForFinished(1000);
|
||||
QString os = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("uname -r");
|
||||
result = process.waitForFinished(1000);
|
||||
QString rev = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("uname -m");
|
||||
result = process.waitForFinished(1000);
|
||||
QString mach = process.readAllStandardOutput().trimmed();
|
||||
|
||||
if ( os == "SunOS" ) {
|
||||
os = "Solaris";
|
||||
|
||||
process.start("uname -p");
|
||||
result = process.waitForFinished(1000);
|
||||
QString arch = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("uname -v");
|
||||
result = process.waitForFinished(1000);
|
||||
QString timestamp = process.readAllStandardOutput().trimmed();
|
||||
|
||||
operatingSystemString = os + " " + rev + " (" + arch + " " + timestamp + ")";
|
||||
}
|
||||
else if ( os == "AIX" ) {
|
||||
process.start("oslevel -r");
|
||||
result = process.waitForFinished(1000);
|
||||
QString oslevel = process.readAllStandardOutput().trimmed();
|
||||
|
||||
operatingSystemString = os + "oslevel " + oslevel;
|
||||
}
|
||||
else if ( os == "Linux" ) {
|
||||
QString dist;
|
||||
QString pseudoname;
|
||||
QString kernel = rev;
|
||||
|
||||
if ( QFile::exists("/etc/redhat-release") ) {
|
||||
dist = "RedHat";
|
||||
|
||||
process.start("sh -c \"cat /etc/redhat-release | sed s/.*\\(// | sed s/\\)//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
pseudoname = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("sh -c \"cat /etc/redhat-release | sed s/.*release\\ // | sed s/\\ .*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
rev = process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
else if ( QFile::exists("/etc/SUSE-release") ) {
|
||||
process.start("sh -c \"cat /etc/SUSE-release | tr '\\n' ' '| sed s/VERSION.*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
dist = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("sh -c \"cat /etc/SUSE-release | tr '\\n' ' ' | sed s/.*=\\ //\"");
|
||||
result = process.waitForFinished(1000);
|
||||
rev = process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
else if ( QFile::exists("/etc/mandrake-release") ) {
|
||||
dist = "Mandrake";
|
||||
|
||||
process.start("sh -c \"cat /etc/mandrake-release | sed s/.*\\(// | sed s/\\)//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
pseudoname = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("sh -c \"cat /etc/mandrake-release | sed s/.*release\\ // | sed s/\\ .*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
rev = process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
else if ( QFile::exists("/etc/lsb-release") ) {
|
||||
dist = "Ubuntu";
|
||||
|
||||
QString processCall = "sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_RELEASE=// | sed s/\\ .*//\"";
|
||||
process.start( processCall );
|
||||
result = process.waitForFinished(1000);
|
||||
rev = process.readAllStandardOutput().trimmed();
|
||||
QString errorStr = process.readAllStandardError();
|
||||
|
||||
process.start("sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_CODENAME=// | sed s/\\ .*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
pseudoname = process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
else if ( QFile::exists("/etc/debian_version") ) {
|
||||
dist = "Debian";
|
||||
|
||||
process.start("cat /etc/debian_version");
|
||||
result = process.waitForFinished(1000);
|
||||
dist += process.readAllStandardOutput().trimmed();
|
||||
|
||||
rev = "";
|
||||
}
|
||||
|
||||
if ( QFile::exists("/etc/UnitedLinux-release") ) {
|
||||
process.start("sh -c \"cat /etc/UnitedLinux-release | tr '\\n' ' ' | sed s/VERSION.*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
dist += process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
|
||||
operatingSystemString = os + " " + dist + " " + rev + " (" + pseudoname + " " + kernel + " " + mach + ")";
|
||||
}
|
||||
#endif
|
||||
|
||||
return operatingSystemString;
|
||||
}
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "UiGuiSystemInfo.h"
|
||||
|
||||
#include <tqstring.h>
|
||||
#include <tqsysinfo.h>
|
||||
#include <tqprocess.h>
|
||||
#include <tqfile.h>
|
||||
|
||||
UiGuiSystemInfo::UiGuiSystemInfo() {
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the operating system UiGUI is currently running on as one string.
|
||||
|
||||
The String contains name and version of the os. E.g. Linux Ubuntu 9.04.
|
||||
*/
|
||||
QString UiGuiSystemInfo::getOperatingSystem() {
|
||||
QString operatingSystemString = "";
|
||||
|
||||
#if defined(Q_WS_WIN)
|
||||
switch ( QSysInfo::WindowsVersion ) {
|
||||
case QSysInfo::WV_32s :
|
||||
operatingSystemString = "Windows 3.1 with Win 32s";
|
||||
break;
|
||||
case QSysInfo::WV_95 :
|
||||
operatingSystemString = "Windows 95";
|
||||
break;
|
||||
case QSysInfo::WV_98 :
|
||||
operatingSystemString = "Windows 98";
|
||||
break;
|
||||
case QSysInfo::WV_Me :
|
||||
operatingSystemString = "Windows Me";
|
||||
break;
|
||||
case QSysInfo::WV_NT :
|
||||
operatingSystemString = "Windows NT (operating system version 4.0)";
|
||||
break;
|
||||
case QSysInfo::WV_2000 :
|
||||
operatingSystemString = "Windows 2000 (operating system version 5.0)";
|
||||
break;
|
||||
case QSysInfo::WV_XP :
|
||||
operatingSystemString = "Windows XP (operating system version 5.1)";
|
||||
break;
|
||||
case QSysInfo::WV_2003 :
|
||||
operatingSystemString = "Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (operating system version 5.2)";
|
||||
break;
|
||||
case QSysInfo::WV_VISTA :
|
||||
operatingSystemString = "Windows Vista, Windows Server 2008 (operating system version 6.0)";
|
||||
break;
|
||||
case QSysInfo::WV_WINDOWS7 :
|
||||
operatingSystemString = "Windows 7 (operating system version 6.1)";
|
||||
break;
|
||||
case QSysInfo::WV_CE :
|
||||
operatingSystemString = "Windows CE";
|
||||
break;
|
||||
case QSysInfo::WV_CENET :
|
||||
operatingSystemString = "Windows CE .NET";
|
||||
break;
|
||||
case QSysInfo::WV_CE_5 :
|
||||
operatingSystemString = "Windows CE 5.x";
|
||||
break;
|
||||
case QSysInfo::WV_CE_6 :
|
||||
operatingSystemString = "Windows CE 6.x";
|
||||
break;
|
||||
default :
|
||||
operatingSystemString = "Unknown Windows operating system.";
|
||||
break;
|
||||
}
|
||||
#elif defined(Q_WS_MAC)
|
||||
switch ( QSysInfo::MacintoshVersion ) {
|
||||
case QSysInfo::MV_9 :
|
||||
operatingSystemString = "Mac OS 9 (unsupported)";
|
||||
break;
|
||||
case QSysInfo::MV_10_0 :
|
||||
operatingSystemString = "Mac OS X 10.0 Cheetah (unsupported)";
|
||||
break;
|
||||
case QSysInfo::MV_10_1 :
|
||||
operatingSystemString = "Mac OS X 10.1 Puma (unsupported)";
|
||||
break;
|
||||
case QSysInfo::MV_10_2 :
|
||||
operatingSystemString = "Mac OS X 10.2 Jaguar (unsupported)";
|
||||
break;
|
||||
case QSysInfo::MV_10_3 :
|
||||
operatingSystemString = "Mac OS X 10.3 Panther";
|
||||
break;
|
||||
case QSysInfo::MV_10_4 :
|
||||
operatingSystemString = "Mac OS X 10.4 Tiger";
|
||||
break;
|
||||
case QSysInfo::MV_10_5 :
|
||||
operatingSystemString = "Mac OS X 10.5 Leopard";
|
||||
break;
|
||||
case QSysInfo::MV_10_6 :
|
||||
operatingSystemString = "Mac OS X 10.6 Snow Leopard";
|
||||
break;
|
||||
case QSysInfo::MV_Unknown :
|
||||
operatingSystemString = "An unknown and currently unsupported platform";
|
||||
break;
|
||||
default :
|
||||
operatingSystemString = "Unknown Mac operating system.";
|
||||
break;
|
||||
}
|
||||
#else
|
||||
//TODO: Detect Unix, Linux etc. distro as described on http://www.novell.com/coolsolutions/feature/11251.html
|
||||
operatingSystemString = "Linux";
|
||||
QProcess process;
|
||||
|
||||
process.start("uname -s");
|
||||
bool result = process.waitForFinished(1000);
|
||||
QString os = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("uname -r");
|
||||
result = process.waitForFinished(1000);
|
||||
QString rev = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("uname -m");
|
||||
result = process.waitForFinished(1000);
|
||||
QString mach = process.readAllStandardOutput().trimmed();
|
||||
|
||||
if ( os == "SunOS" ) {
|
||||
os = "Solaris";
|
||||
|
||||
process.start("uname -p");
|
||||
result = process.waitForFinished(1000);
|
||||
QString arch = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("uname -v");
|
||||
result = process.waitForFinished(1000);
|
||||
QString timestamp = process.readAllStandardOutput().trimmed();
|
||||
|
||||
operatingSystemString = os + " " + rev + " (" + arch + " " + timestamp + ")";
|
||||
}
|
||||
else if ( os == "AIX" ) {
|
||||
process.start("oslevel -r");
|
||||
result = process.waitForFinished(1000);
|
||||
QString oslevel = process.readAllStandardOutput().trimmed();
|
||||
|
||||
operatingSystemString = os + "oslevel " + oslevel;
|
||||
}
|
||||
else if ( os == "Linux" ) {
|
||||
QString dist;
|
||||
QString pseudoname;
|
||||
QString kernel = rev;
|
||||
|
||||
if ( QFile::exists("/etc/redhat-release") ) {
|
||||
dist = "RedHat";
|
||||
|
||||
process.start("sh -c \"cat /etc/redhat-release | sed s/.*\\(// | sed s/\\)//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
pseudoname = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("sh -c \"cat /etc/redhat-release | sed s/.*release\\ // | sed s/\\ .*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
rev = process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
else if ( QFile::exists("/etc/SUSE-release") ) {
|
||||
process.start("sh -c \"cat /etc/SUSE-release | tr '\\n' ' '| sed s/VERSION.*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
dist = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("sh -c \"cat /etc/SUSE-release | tr '\\n' ' ' | sed s/.*=\\ //\"");
|
||||
result = process.waitForFinished(1000);
|
||||
rev = process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
else if ( QFile::exists("/etc/mandrake-release") ) {
|
||||
dist = "Mandrake";
|
||||
|
||||
process.start("sh -c \"cat /etc/mandrake-release | sed s/.*\\(// | sed s/\\)//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
pseudoname = process.readAllStandardOutput().trimmed();
|
||||
|
||||
process.start("sh -c \"cat /etc/mandrake-release | sed s/.*release\\ // | sed s/\\ .*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
rev = process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
else if ( QFile::exists("/etc/lsb-release") ) {
|
||||
dist = "Ubuntu";
|
||||
|
||||
QString processCall = "sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_RELEASE=// | sed s/\\ .*//\"";
|
||||
process.start( processCall );
|
||||
result = process.waitForFinished(1000);
|
||||
rev = process.readAllStandardOutput().trimmed();
|
||||
QString errorStr = process.readAllStandardError();
|
||||
|
||||
process.start("sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_CODENAME=// | sed s/\\ .*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
pseudoname = process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
else if ( QFile::exists("/etc/debian_version") ) {
|
||||
dist = "Debian";
|
||||
|
||||
process.start("cat /etc/debian_version");
|
||||
result = process.waitForFinished(1000);
|
||||
dist += process.readAllStandardOutput().trimmed();
|
||||
|
||||
rev = "";
|
||||
}
|
||||
|
||||
if ( QFile::exists("/etc/UnitedLinux-release") ) {
|
||||
process.start("sh -c \"cat /etc/UnitedLinux-release | tr '\\n' ' ' | sed s/VERSION.*//\"");
|
||||
result = process.waitForFinished(1000);
|
||||
dist += process.readAllStandardOutput().trimmed();
|
||||
}
|
||||
|
||||
operatingSystemString = os + " " + dist + " " + rev + " (" + pseudoname + " " + kernel + " " + mach + ")";
|
||||
}
|
||||
#endif
|
||||
|
||||
return operatingSystemString;
|
||||
}
|
||||
|
@ -1,35 +1,35 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUISYSTEMINFO_H
|
||||
#define UIGUISYSTEMINFO_H
|
||||
|
||||
class QString;
|
||||
|
||||
|
||||
class UiGuiSystemInfo
|
||||
{
|
||||
public:
|
||||
static QString getOperatingSystem();
|
||||
|
||||
private:
|
||||
UiGuiSystemInfo();
|
||||
};
|
||||
|
||||
#endif // UIGUISYSTEMINFO_H
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUISYSTEMINFO_H
|
||||
#define UIGUISYSTEMINFO_H
|
||||
|
||||
class QString;
|
||||
|
||||
|
||||
class UiGuiSystemInfo
|
||||
{
|
||||
public:
|
||||
static QString getOperatingSystem();
|
||||
|
||||
private:
|
||||
UiGuiSystemInfo();
|
||||
};
|
||||
|
||||
#endif // UIGUISYSTEMINFO_H
|
||||
|
@ -1,61 +1,61 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "UiGuiVersion.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QDate>
|
||||
|
||||
namespace UiGuiVersion {
|
||||
/*!
|
||||
\brief Returns the build date as a localized string, e.g. "9. Februar 2009". If
|
||||
there was some kind of error, the returned string is empty.
|
||||
*/
|
||||
QString getBuildDate() {
|
||||
QStringList monthNames;
|
||||
QString buildDateString = "";
|
||||
|
||||
monthNames << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dez";
|
||||
QStringList buildDateStringList = QString(__DATE__).simplified().split(' '); // __DATE__ returns eg "Feb 4 2009"
|
||||
|
||||
if ( buildDateStringList.count() == 3 ) {
|
||||
QDate buildDate(buildDateStringList.last().toInt(), monthNames.indexOf( buildDateStringList.first() )+1, buildDateStringList.at(1).toInt());
|
||||
buildDateString = buildDate.toString("d. MMMM yyyy");
|
||||
}
|
||||
|
||||
return buildDateString;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the revision number, that the current build is based on, as string. If
|
||||
there was some kind of error, the returned string is empty.
|
||||
*/
|
||||
QString getBuildRevision() {
|
||||
QString buildRevision = "";
|
||||
QStringList buildRevisionStringList = QString(PROGRAM_REVISION).simplified().split(' ');
|
||||
|
||||
if ( buildRevisionStringList.count() == 3 ) {
|
||||
buildRevision = buildRevisionStringList.at(1); // PROGRAM_REVISION is eg "$Revision: 907 $"
|
||||
}
|
||||
|
||||
return buildRevision;
|
||||
}
|
||||
} // namespace UiGuiVersion
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "UiGuiVersion.h"
|
||||
|
||||
#include <tqstring.h>
|
||||
#include <tqstringlist.h>
|
||||
#include <tqdate.h>
|
||||
|
||||
namespace UiGuiVersion {
|
||||
/*!
|
||||
\brief Returns the build date as a localized string, e.g. "9. Februar 2009". If
|
||||
there was some kind of error, the returned string is empty.
|
||||
*/
|
||||
QString getBuildDate() {
|
||||
QStringList monthNames;
|
||||
QString buildDateString = "";
|
||||
|
||||
monthNames << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dez";
|
||||
QStringList buildDateStringList = QString(__DATE__).simplified().split(' '); // __DATE__ returns eg "Feb 4 2009"
|
||||
|
||||
if ( buildDateStringList.count() == 3 ) {
|
||||
QDate buildDate(buildDateStringList.last().toInt(), monthNames.indexOf( buildDateStringList.first() )+1, buildDateStringList.at(1).toInt());
|
||||
buildDateString = buildDate.toString("d. MMMM yyyy");
|
||||
}
|
||||
|
||||
return buildDateString;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the revision number, that the current build is based on, as string. If
|
||||
there was some kind of error, the returned string is empty.
|
||||
*/
|
||||
QString getBuildRevision() {
|
||||
QString buildRevision = "";
|
||||
QStringList buildRevisionStringList = QString(PROGRAM_REVISION).simplified().split(' ');
|
||||
|
||||
if ( buildRevisionStringList.count() == 3 ) {
|
||||
buildRevision = buildRevisionStringList.at(1); // PROGRAM_REVISION is eg "$Revision: 907 $"
|
||||
}
|
||||
|
||||
return buildRevision;
|
||||
}
|
||||
} // namespace UiGuiVersion
|
||||
|
@ -1,39 +1,39 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUIVERSION_H
|
||||
#define UIGUIVERSION_H
|
||||
|
||||
class QString;
|
||||
|
||||
// Define the version number here. Update this as the last file before a release.
|
||||
#define PROGRAM_VERSION 1.2.0
|
||||
#define PROGRAM_VERSION_STRING "1.2.0"
|
||||
#define RESOURCE_VERSION 1,2,0,0
|
||||
#define RESOURCE_VERSION_STRING "1,2,0,0\0"
|
||||
#define PROGRAM_REVISION "$Revision: 1070 $"
|
||||
|
||||
namespace UiGuiVersion {
|
||||
|
||||
QString getBuildDate();
|
||||
QString getBuildRevision();
|
||||
|
||||
}
|
||||
|
||||
#endif // UIGUIVERSION_H
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UIGUIVERSION_H
|
||||
#define UIGUIVERSION_H
|
||||
|
||||
class QString;
|
||||
|
||||
// Define the version number here. Update this as the last file before a release.
|
||||
#define PROGRAM_VERSION 1.2.0
|
||||
#define PROGRAM_VERSION_STRING "1.2.0"
|
||||
#define RESOURCE_VERSION 1,2,0,0
|
||||
#define RESOURCE_VERSION_STRING "1,2,0,0\0"
|
||||
#define PROGRAM_REVISION "$Revision: 1070 $"
|
||||
|
||||
namespace UiGuiVersion {
|
||||
|
||||
QString getBuildDate();
|
||||
QString getBuildRevision();
|
||||
|
||||
}
|
||||
|
||||
#endif // UIGUIVERSION_H
|
||||
|
@ -1,73 +1,73 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UPDATECHECKDIALOG_H
|
||||
#define UPDATECHECKDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
class UiGuiSettings;
|
||||
namespace Ui {
|
||||
class UpdateCheckDialog;
|
||||
}
|
||||
|
||||
class QTimer;
|
||||
class QDesktopServices;
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
|
||||
|
||||
class UpdateCheckDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UpdateCheckDialog(QSharedPointer<UiGuiSettings> settings, QWidget *parent = NULL);
|
||||
~UpdateCheckDialog();
|
||||
|
||||
public slots:
|
||||
void checkForUpdateAndShowDialog();
|
||||
void checkForUpdate();
|
||||
|
||||
private slots:
|
||||
void checkResultsOfFetchedPadXMLFile(QNetworkReply *networkReply);
|
||||
void handleUpdateCheckDialogButtonClicked(QAbstractButton *clickedButton);
|
||||
void updateUpdateCheckProgressBar();
|
||||
void initProxySettings();
|
||||
|
||||
private:
|
||||
Ui::UpdateCheckDialog *_updateCheckDialogForm;
|
||||
|
||||
void getPadXMLFile();
|
||||
void showCheckingForUpdateDialog();
|
||||
void showNewVersionAvailableDialog(QString newVersion);
|
||||
void showNoNewVersionAvailableDialog();
|
||||
int convertVersionStringToNumber(QString versionString);
|
||||
|
||||
QSharedPointer<UiGuiSettings> _settings;
|
||||
bool _manualUpdateRequested;
|
||||
QNetworkAccessManager *_networkAccessManager;
|
||||
QNetworkReply *_currentNetworkReply;
|
||||
QDialogButtonBox::ButtonRole _roleOfClickedButton;
|
||||
QTimer *_updateCheckProgressTimer;
|
||||
int _updateCheckProgressCounter;
|
||||
};
|
||||
|
||||
#endif // UPDATECHECKDIALOG_H
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UPDATECHECKDIALOG_H
|
||||
#define UPDATECHECKDIALOG_H
|
||||
|
||||
#include <tqdialog.h>
|
||||
#include <tqdialogbuttonbox.h>
|
||||
|
||||
class UiGuiSettings;
|
||||
namespace Ui {
|
||||
class UpdateCheckDialog;
|
||||
}
|
||||
|
||||
class QTimer;
|
||||
class QDesktopServices;
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
|
||||
|
||||
class UpdateCheckDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UpdateCheckDialog(QSharedPointer<UiGuiSettings> settings, QWidget *parent = NULL);
|
||||
~UpdateCheckDialog();
|
||||
|
||||
public slots:
|
||||
void checkForUpdateAndShowDialog();
|
||||
void checkForUpdate();
|
||||
|
||||
private slots:
|
||||
void checkResultsOfFetchedPadXMLFile(QNetworkReply *networkReply);
|
||||
void handleUpdateCheckDialogButtonClicked(QAbstractButton *clickedButton);
|
||||
void updateUpdateCheckProgressBar();
|
||||
void initProxySettings();
|
||||
|
||||
private:
|
||||
Ui::UpdateCheckDialog *_updateCheckDialogForm;
|
||||
|
||||
void getPadXMLFile();
|
||||
void showCheckingForUpdateDialog();
|
||||
void showNewVersionAvailableDialog(QString newVersion);
|
||||
void showNoNewVersionAvailableDialog();
|
||||
int convertVersionStringToNumber(QString versionString);
|
||||
|
||||
QSharedPointer<UiGuiSettings> _settings;
|
||||
bool _manualUpdateRequested;
|
||||
QNetworkAccessManager *_networkAccessManager;
|
||||
QNetworkReply *_currentNetworkReply;
|
||||
QDialogButtonBox::ButtonRole _roleOfClickedButton;
|
||||
QTimer *_updateCheckProgressTimer;
|
||||
int _updateCheckProgressCounter;
|
||||
};
|
||||
|
||||
#endif // UPDATECHECKDIALOG_H
|
||||
|
@ -1,251 +1,251 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "TSLogger.h"
|
||||
#include "ui_TSLoggerDialog.h"
|
||||
|
||||
#include "SettingsPaths.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QUrl>
|
||||
#include <QTextStream>
|
||||
#include <QDesktopServices>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <ctime>
|
||||
|
||||
using namespace tschweitzer;
|
||||
using namespace tschweitzer::debugging;
|
||||
|
||||
TSLogger* TSLogger::_instance = NULL;
|
||||
|
||||
/*!
|
||||
\class TSLogger
|
||||
\brief This class handles any kind of data logging, for debugging and whatever purpose.
|
||||
|
||||
Beneath being able of displaying a dialog window containing all log messages of the
|
||||
current session, a log file in the systems temporary directory is used. Its name
|
||||
is "UiGUI_log.html".
|
||||
|
||||
Setting a verbose level allows to only write messages that have the selected minimum
|
||||
priority to the log.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\brief Returns the only existing instance of TSLogger. If the instance doesn't exist, it will be created.
|
||||
*/
|
||||
TSLogger* TSLogger::getInstance(int verboseLevel) {
|
||||
if ( _instance == NULL )
|
||||
_instance = new TSLogger(verboseLevel);
|
||||
|
||||
return _instance;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the only existing instance of TSLogger. If the instance doesn't exist, it will be created.
|
||||
*/
|
||||
TSLogger* TSLogger::getInstance() {
|
||||
#ifdef _DEBUG
|
||||
return TSLogger::getInstance(QtDebugMsg);
|
||||
#else
|
||||
return TSLogger::getInstance(QtWarningMsg);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Initializes the dialog and sets the path to the log file in the systems temporary directory.
|
||||
Sets the default verbose level to warning level.
|
||||
*/
|
||||
TSLogger::TSLogger(int verboseLevel) : QDialog() {
|
||||
_TSLoggerDialogForm = new Ui::TSLoggerDialog();
|
||||
_TSLoggerDialogForm->setupUi(this);
|
||||
#ifdef _DEBUG
|
||||
_verboseLevel = QtDebugMsg;
|
||||
#else
|
||||
_verboseLevel = QtMsgType(verboseLevel);
|
||||
#endif
|
||||
|
||||
_logFileInitState = NOTINITIALZED;
|
||||
|
||||
connect( _TSLoggerDialogForm->openLogFileFolderToolButton, SIGNAL(clicked()), this, SLOT(openLogFileFolder()) );
|
||||
|
||||
// Make the main application not to wait for the logging window to close.
|
||||
setAttribute(Qt::WA_QuitOnClose, false);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Logs all incoming messages \a msg to the dialogs text edit and to the log file.
|
||||
|
||||
Only messages whos \a type have a higher priority than the set verbose level are logged.
|
||||
*/
|
||||
void TSLogger::messageHandler(QtMsgType type, const char *msg) {
|
||||
if ( _instance == NULL )
|
||||
_instance = TSLogger::getInstance();
|
||||
|
||||
/*
|
||||
QMessageBox messageBox;
|
||||
QString messageBoxText = QString::fromUtf8( msg );
|
||||
messageBox.setText( messageBoxText );
|
||||
messageBox.setWindowModality( Qt::ApplicationModal );
|
||||
messageBox.exec();
|
||||
*/
|
||||
|
||||
// Only log messages that have a higher or equal priority than set with the verbose level.
|
||||
if ( type < _instance->_verboseLevel )
|
||||
return;
|
||||
|
||||
// Init log message with prepended date and time.
|
||||
QString message = QDateTime::currentDateTime().toString();
|
||||
|
||||
// Depending on the QtMsgType prepend a different colored Debug, Warning, Critical or Fatal.
|
||||
switch (type) {
|
||||
case QtDebugMsg :
|
||||
message += " <span style=\"font-weight:bold; color:black;\">Debug:</span> ";
|
||||
break;
|
||||
case QtWarningMsg :
|
||||
message += " <span style=\"font-weight:bold; color:gold;\">Warning:</span> ";
|
||||
break;
|
||||
case QtCriticalMsg :
|
||||
message += "<span style=\"font-weight:bold; color:red;\">Critical:</span> ";
|
||||
break;
|
||||
case QtFatalMsg :
|
||||
message += " <span style=\"font-weight:bold; color:#D60000;\">Fatal:</span> ";
|
||||
// This one is no Qt message type, but can be used to send info messages to the log
|
||||
// by calling TSLogger::messageHandler() directly.
|
||||
case TSLoggerInfoMsg :
|
||||
message += " <span style=\"font-weight:bold; color:darkgray;\">Info:</span> ";
|
||||
break;
|
||||
}
|
||||
|
||||
// Append the to UTF-8 back converted message parameter.
|
||||
message += QString::fromUtf8( msg ) + "<br/>\n";
|
||||
|
||||
// Write the message to the log windows text edit.
|
||||
_instance->_TSLoggerDialogForm->logTextEdit->append( message );
|
||||
|
||||
// Write/append the log message to the log file.
|
||||
_instance->writeToLogFile( message );
|
||||
|
||||
// In case of a fatal error abort the application.
|
||||
if ( type == QtFatalMsg )
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Calling this the verbose level can be set in a range from 0 to 3
|
||||
which is equal to debug, warning, critical and fatal priority.
|
||||
*/
|
||||
void TSLogger::setVerboseLevel(int level) {
|
||||
if ( level < 0 )
|
||||
_verboseLevel = QtDebugMsg;
|
||||
if ( level > 3 )
|
||||
_verboseLevel = QtFatalMsg;
|
||||
else
|
||||
_verboseLevel = QtMsgType(level);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Deletes the existing _instance of TSLogger.
|
||||
*/
|
||||
void TSLogger::deleteInstance() {
|
||||
if ( _instance != NULL ) {
|
||||
delete _instance;
|
||||
_instance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Opens the folder that contains the created log file with the name "UiGUI_log.html".
|
||||
*/
|
||||
void TSLogger::openLogFileFolder() {
|
||||
QDesktopServices::openUrl( QFileInfo( _logFile ).absolutePath() );
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Writes the \a message to the used log file.
|
||||
*/
|
||||
void TSLogger::writeToLogFile(const QString &message) {
|
||||
// If the file where all logging messages should go to isn't initilized yet, do that now.
|
||||
if ( _logFileInitState == NOTINITIALZED ) {
|
||||
_logFileInitState = INITIALIZING;
|
||||
|
||||
// On different systems it may be that "QDir::tempPath()" ends with a "/" or not. So check this.
|
||||
// Remove any trailing slashes.
|
||||
QString tempPath = QFileInfo( SettingsPaths::getTempPath() ).absolutePath();
|
||||
while ( tempPath.right(1) == "/" ) {
|
||||
tempPath.chop(1);
|
||||
}
|
||||
|
||||
// To make the temporary log file invulnerable against file symbolic link hacks
|
||||
// append the current date and time up to milliseconds to its name and a random character.
|
||||
QString logFileName = "UiGUI_log_" + QDateTime::currentDateTime().toString("yyyyMMdd");
|
||||
logFileName += "-" + QDateTime::currentDateTime().toString("hhmmsszzz");
|
||||
// By random decide whether to append a number or an upper or lower case character.
|
||||
qsrand( time(NULL) );
|
||||
unsigned char randomChar;
|
||||
switch ( qrand() % 3 ) {
|
||||
// Append a number from 0 to 9.
|
||||
case 0 :
|
||||
randomChar = qrand() % 10 + '0';
|
||||
break;
|
||||
// Append a upper case characer between A and Z.
|
||||
case 1 :
|
||||
randomChar = qrand() % 26 + 'A';
|
||||
break;
|
||||
// Append a lower case characer between a and z.
|
||||
default :
|
||||
randomChar = qrand() % 26 + 'a';
|
||||
break;
|
||||
}
|
||||
logFileName += "_" + QString(randomChar) + ".html";
|
||||
|
||||
_logFile.setFileName( tempPath + "/" + logFileName );
|
||||
|
||||
// Set the tooltip of the open log file folder button to show the unique name of the log file.
|
||||
_TSLoggerDialogForm->openLogFileFolderToolButton->setToolTip( _TSLoggerDialogForm->openLogFileFolderToolButton->toolTip() + " (" + logFileName + ")" );
|
||||
|
||||
_logFileInitState = INITIALZED;
|
||||
}
|
||||
|
||||
// Add the message to the message queue.
|
||||
_messageQueue << message;
|
||||
|
||||
// If the logging file is initialzed, write all messages contained in the message queue into the file.
|
||||
if ( _logFileInitState == INITIALZED ) {
|
||||
// Write/append the log message to the log file.
|
||||
if ( _logFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append) ) {
|
||||
QTextStream out(&_logFile);
|
||||
|
||||
while ( !_messageQueue.isEmpty() ) {
|
||||
out << _messageQueue.takeFirst() << "\n";
|
||||
}
|
||||
|
||||
_logFile.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2006-2012 by Thomas Schweitzer *
|
||||
* thomas-schweitzer(at)arcor.de *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License version 2.0 as *
|
||||
* published by the Free Software Foundation. *
|
||||
* *
|
||||
* 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 in the file LICENSE.GPL; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "TSLogger.h"
|
||||
#include "ui_TSLoggerDialog.h"
|
||||
|
||||
#include "SettingsPaths.h"
|
||||
|
||||
#include <tqdatetime.h>
|
||||
#include <tqfile.h>
|
||||
#include <tqfileinfo.h>
|
||||
#include <tqurl.h>
|
||||
#include <tqtextstream.h>
|
||||
#include <tqdesktopservices.h>
|
||||
#include <tqmessagebox.h>
|
||||
|
||||
#include <ctime>
|
||||
|
||||
using namespace tschweitzer;
|
||||
using namespace tschweitzer::debugging;
|
||||
|
||||
TSLogger* TSLogger::_instance = NULL;
|
||||
|
||||
/*!
|
||||
\class TSLogger
|
||||
\brief This class handles any kind of data logging, for debugging and whatever purpose.
|
||||
|
||||
Beneath being able of displaying a dialog window containing all log messages of the
|
||||
current session, a log file in the systems temporary directory is used. Its name
|
||||
is "UiGUI_log.html".
|
||||
|
||||
Setting a verbose level allows to only write messages that have the selected minimum
|
||||
priority to the log.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\brief Returns the only existing instance of TSLogger. If the instance doesn't exist, it will be created.
|
||||
*/
|
||||
TSLogger* TSLogger::getInstance(int verboseLevel) {
|
||||
if ( _instance == NULL )
|
||||
_instance = new TSLogger(verboseLevel);
|
||||
|
||||
return _instance;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns the only existing instance of TSLogger. If the instance doesn't exist, it will be created.
|
||||
*/
|
||||
TSLogger* TSLogger::getInstance() {
|
||||
#ifdef _DEBUG
|
||||
return TSLogger::getInstance(QtDebugMsg);
|
||||
#else
|
||||
return TSLogger::getInstance(QtWarningMsg);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Initializes the dialog and sets the path to the log file in the systems temporary directory.
|
||||
Sets the default verbose level to warning level.
|
||||
*/
|
||||
TSLogger::TSLogger(int verboseLevel) : QDialog() {
|
||||
_TSLoggerDialogForm = new Ui::TSLoggerDialog();
|
||||
_TSLoggerDialogForm->setupUi(this);
|
||||
#ifdef _DEBUG
|
||||
_verboseLevel = QtDebugMsg;
|
||||
#else
|
||||
_verboseLevel = QtMsgType(verboseLevel);
|
||||
#endif
|
||||
|
||||
_logFileInitState = NOTINITIALZED;
|
||||
|
||||
connect( _TSLoggerDialogForm->openLogFileFolderToolButton, SIGNAL(clicked()), this, SLOT(openLogFileFolder()) );
|
||||
|
||||
// Make the main application not to wait for the logging window to close.
|
||||
setAttribute(Qt::WA_QuitOnClose, false);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Logs all incoming messages \a msg to the dialogs text edit and to the log file.
|
||||
|
||||
Only messages whos \a type have a higher priority than the set verbose level are logged.
|
||||
*/
|
||||
void TSLogger::messageHandler(QtMsgType type, const char *msg) {
|
||||
if ( _instance == NULL )
|
||||
_instance = TSLogger::getInstance();
|
||||
|
||||
/*
|
||||
QMessageBox messageBox;
|
||||
QString messageBoxText = QString::fromUtf8( msg );
|
||||
messageBox.setText( messageBoxText );
|
||||
messageBox.setWindowModality( Qt::ApplicationModal );
|
||||
messageBox.exec();
|
||||
*/
|
||||
|
||||
// Only log messages that have a higher or equal priority than set with the verbose level.
|
||||
if ( type < _instance->_verboseLevel )
|
||||
return;
|
||||
|
||||
// Init log message with prepended date and time.
|
||||
QString message = QDateTime::currentDateTime().toString();
|
||||
|
||||
// Depending on the QtMsgType prepend a different colored Debug, Warning, Critical or Fatal.
|
||||
switch (type) {
|
||||
case QtDebugMsg :
|
||||
message += " <span style=\"font-weight:bold; color:black;\">Debug:</span> ";
|
||||
break;
|
||||
case QtWarningMsg :
|
||||
message += " <span style=\"font-weight:bold; color:gold;\">Warning:</span> ";
|
||||
break;
|
||||
case QtCriticalMsg :
|
||||
message += "<span style=\"font-weight:bold; color:red;\">Critical:</span> ";
|
||||
break;
|
||||
case QtFatalMsg :
|
||||
message += " <span style=\"font-weight:bold; color:#D60000;\">Fatal:</span> ";
|
||||
// This one is no Qt message type, but can be used to send info messages to the log
|
||||
// by calling TSLogger::messageHandler() directly.
|
||||
case TSLoggerInfoMsg :
|
||||
message += " <span style=\"font-weight:bold; color:darkgray;\">Info:</span> ";
|
||||
break;
|
||||
}
|
||||
|
||||
// Append the to UTF-8 back converted message parameter.
|
||||
message += QString::fromUtf8( msg ) + "<br/>\n";
|
||||
|
||||
// Write the message to the log windows text edit.
|
||||
_instance->_TSLoggerDialogForm->logTextEdit->append( message );
|
||||
|
||||
// Write/append the log message to the log file.
|
||||
_instance->writeToLogFile( message );
|
||||
|
||||
// In case of a fatal error abort the application.
|
||||
if ( type == QtFatalMsg )
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Calling this the verbose level can be set in a range from 0 to 3
|
||||
which is equal to debug, warning, critical and fatal priority.
|
||||
*/
|
||||
void TSLogger::setVerboseLevel(int level) {
|
||||
if ( level < 0 )
|
||||
_verboseLevel = QtDebugMsg;
|
||||
if ( level > 3 )
|
||||
_verboseLevel = QtFatalMsg;
|
||||
else
|
||||
_verboseLevel = QtMsgType(level);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Deletes the existing _instance of TSLogger.
|
||||
*/
|
||||
void TSLogger::deleteInstance() {
|
||||
if ( _instance != NULL ) {
|
||||
delete _instance;
|
||||
_instance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Opens the folder that contains the created log file with the name "UiGUI_log.html".
|
||||
*/
|
||||
void TSLogger::openLogFileFolder() {
|
||||
QDesktopServices::openUrl( QFileInfo( _logFile ).absolutePath() );
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Writes the \a message to the used log file.
|
||||
*/
|
||||
void TSLogger::writeToLogFile(const QString &message) {
|
||||
// If the file where all logging messages should go to isn't initilized yet, do that now.
|
||||
if ( _logFileInitState == NOTINITIALZED ) {
|
||||
_logFileInitState = INITIALIZING;
|
||||
|
||||
// On different systems it may be that "QDir::tempPath()" ends with a "/" or not. So check this.
|
||||
// Remove any trailing slashes.
|
||||
QString tempPath = QFileInfo( SettingsPaths::getTempPath() ).absolutePath();
|
||||
while ( tempPath.right(1) == "/" ) {
|
||||
tempPath.chop(1);
|
||||
}
|
||||
|
||||
// To make the temporary log file invulnerable against file symbolic link hacks
|
||||
// append the current date and time up to milliseconds to its name and a random character.
|
||||
QString logFileName = "UiGUI_log_" + QDateTime::currentDateTime().toString("yyyyMMdd");
|
||||
logFileName += "-" + QDateTime::currentDateTime().toString("hhmmsszzz");
|
||||
// By random decide whether to append a number or an upper or lower case character.
|
||||
qsrand( time(NULL) );
|
||||
unsigned char randomChar;
|
||||
switch ( qrand() % 3 ) {
|
||||
// Append a number from 0 to 9.
|
||||
case 0 :
|
||||
randomChar = qrand() % 10 + '0';
|
||||
break;
|
||||
// Append a upper case characer between A and Z.
|
||||
case 1 :
|
||||
randomChar = qrand() % 26 + 'A';
|
||||
break;
|
||||
// Append a lower case characer between a and z.
|
||||
default :
|
||||
randomChar = qrand() % 26 + 'a';
|
||||
break;
|
||||
}
|
||||
logFileName += "_" + QString(randomChar) + ".html";
|
||||
|
||||
_logFile.setFileName( tempPath + "/" + logFileName );
|
||||
|
||||
// Set the tooltip of the open log file folder button to show the unique name of the log file.
|
||||
_TSLoggerDialogForm->openLogFileFolderToolButton->setToolTip( _TSLoggerDialogForm->openLogFileFolderToolButton->toolTip() + " (" + logFileName + ")" );
|
||||
|
||||
_logFileInitState = INITIALZED;
|
||||
}
|
||||
|
||||
// Add the message to the message queue.
|
||||
_messageQueue << message;
|
||||
|
||||
// If the logging file is initialzed, write all messages contained in the message queue into the file.
|
||||
if ( _logFileInitState == INITIALZED ) {
|
||||
// Write/append the log message to the log file.
|
||||
if ( _logFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append) ) {
|
||||
QTextStream out(&_logFile);
|
||||
|
||||
while ( !_messageQueue.isEmpty() ) {
|
||||
out << _messageQueue.takeFirst() << "\n";
|
||||
}
|
||||
|
||||
_logFile.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue