diff --git a/CMakeLists.txt b/CMakeLists.txt index 393ab5a..2ee264b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,8 +151,8 @@ # FILENAME_EXTRA # Default is blank. ocelotgui passes -DFILENAME_EXTRA="qt4" when building with qt4, -# so the final package name will look like ocelotgui_2.3.0qt4-1_amd64.deb or -# ocelotgui-2.3.0qt4-1.x86_64.rpm. Ordinarily it should not be specified. +# so the final package name will look like ocelotgui_2.4.0qt4-1_amd64.deb or +# ocelotgui-2.4.0qt4-1.x86_64.rpm. Ordinarily it should not be specified. # FILENAME_RELEASE # Default is "1". Ordinarily it doesn't need to be changed. @@ -164,13 +164,13 @@ # e.g. to generate .deb file and install with dpkg: # deb_build.sh, which copies files and invokes debian/rules, which uses CMakeLists.txt -# sudo dpkg -i ocelotgui_2.3.0-1_amd64.deb +# sudo dpkg -i ocelotgui_2.4.0-1_amd64.deb # but see also comments in deb_build.sh and debian/README.Debian # e.g. to generate .rpm file and install with rpm: # rpm_build.sh, which copies files and invokes ocelotgui.spec, which uses CMakeLists.txt -# rpmlint ocelotgui-2.3.0-1.x86_64.rpm -# rpm -i ocelotgui-2.3.0-1.x86_64.rpm +# rpmlint ocelotgui-2.4.0-1.x86_64.rpm +# rpm -i ocelotgui-2.4.0-1.x86_64.rpm # but see also comments in rpm_build.sh # Todo: We only check if CMAKE_SYSTEM_PROCESSOR = x86_64. On FreeBSD 12, uname -p says amd64. @@ -178,7 +178,7 @@ # Todo: We do not install README_tarantool.htm or the *_tarantool.png files, though we put them on github. # Todo: We do not install ocelotgui-logo.png, we only install ocelotgui_logo.png. -message("-- CmakeLists.txt for ocelotgui 2.3.0") +message("-- CmakeLists.txt for ocelotgui 2.4.0") message("-- see comments in CMakeLists.txt for special instructions") message("-- see README.md for general instructions for building") @@ -528,6 +528,8 @@ install(FILES special-vertical.png DESTINATION ${CMAKE_INSTALL_DOCDIR}) install(FILES starting-dialog.png DESTINATION ${CMAKE_INSTALL_DOCDIR}) install(FILES starting.png DESTINATION ${CMAKE_INSTALL_DOCDIR}) install(FILES statement-widget-example.png DESTINATION ${CMAKE_INSTALL_DOCDIR}) +install(FILES menunew.png DESTINATION ${CMAKE_INSTALL_DOCDIR}) +install(FILES plugin.c DESTINATION ${CMAKE_INSTALL_DOCDIR}) # Debian packages would gzip .txt and .md files anyway. if (NOT PACKAGE_TYPE MATCHES "DEB") if (NOT PACKAGE_TYPE MATCHES "RPM") @@ -573,14 +575,14 @@ if (PACKAGE_TYPE MATCHES "RPM") install(FILES ocelotgui.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) endif (PACKAGE_TYPE MATCHES "RPM") -# version = 2.3.0 +# version = 2.4.0 set(CPACK_PACKAGE_VERSION_MAJOR "2") set(CPACK_PACKAGE_VERSION_MINOR "3") set(CPACK_PACKAGE_VERSION_PATCH "0") -# I assume nobody wants package names like ocelotgui_2.3.0-Linux.deb +# I assume nobody wants package names like ocelotgui_2.4.0-Linux.deb # but that's what I get if CMAKE_SYSTEM_NAME = "Linux". -# I'd prefer ocelotgui_2.3.0-1_amd64.deb or ocelotgui-2.3.0.x86_64.rpm +# I'd prefer ocelotgui_2.4.0-1_amd64.deb or ocelotgui-2.4.0.x86_64.rpm # If it's neither "DEB" nor "RPM", = default. set(FILENAME_PLATFORM_FOR_DEB "Linux") set(FILENAME_PLATFORM_FOR_RPM "Linux") diff --git a/PKGBUILD b/PKGBUILD index f38b0fe..f973c56 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -31,7 +31,7 @@ # Otherwise if running makepkg a second time it may be necessary to say makepkg -f #Re cmake: This is an out-of-source build and produces a RelWithDebInfo executable with an -O2 flag. # For other options read CMakeLists.txt. -#Re version: In fact all the source files now are for version 2.1.0 but leaving pkgver=1.7.0 might save hassle. +#Re version: In fact all the source files now are for version 2.4.0 but leaving pkgver=1.7.0 might save hassle. pkgname=ocelotgui pkgver=1.7.0 pkgrel=1 diff --git a/README.htm b/README.htm index 18bd1ef..c5e8391 100644 --- a/README.htm +++ b/README.htm @@ -1,7 +1,7 @@ ocelotgui -

Version 2.3.0

+

Version 2.4.0

The ocelotgui GUI, a database client, allows users to connect to a MySQL or MariaDB DBMS server, enter SQL statements, and receive results. @@ -48,6 +48,8 @@

Using

... Explorer widget ... ERDiagram ... Charts +... Make your own menus +... Make your own plugins/A> ... Contact

Appendixes

... Appendix 1 Details about ocelotgui options @@ -123,21 +125,21 @@

Getting the ocelotgui executab cut and paste the corresponding pair of instructions onto your computer and you can be up and running in about 15 seconds.

For 32-bit, Debian-like, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0-1_i386.deb
-sudo apt install ./ocelotgui_2.3.0-1_i386.deb
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0-1_i386.deb +sudo apt install ./ocelotgui_2.4.0-1_i386.deb For 64-bit, Debian-like, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0-1_amd64.deb
-sudo apt install ./ocelotgui_2.3.0-1_amd64.deb
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0-1_amd64.deb +sudo apt install ./ocelotgui_2.4.0-1_amd64.deb For 64-bit, RPM-like, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0-1.x86_64.rpm
-sudo rpm -i ocelotgui-2.3.0-1.x86_64.rpm
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0-1.x86_64.rpm +sudo rpm -i ocelotgui-2.4.0-1.x86_64.rpm For 64-bit, any Linux, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0.tar.gz
-tar zxvf ocelotgui-2.3.0.tar.gz
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0.tar.gz
+tar zxvf ocelotgui-2.4.0.tar.gz
 ocelotgui/ocelotgui-qt5
For 64-bit, any Linux, Qt4 (deprecated)
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0.tar.gz
-tar zxvf ocelotgui-2.3.0.tar.gz
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0.tar.gz
+tar zxvf ocelotgui-2.4.0.tar.gz
 ocelotgui/ocelotgui-qt4

@@ -172,7 +174,7 @@

Some screenshots


User Manual



-

Version 2.3.0, March 18 2024

+

Version 2.4.0, June 4 2024

Copyright (c) 2024 by Peter Gulutzan. All rights reserved.

@@ -196,7 +198,7 @@

Executive Summary


a MySQL or MariaDB DBMS server, enter SQL statements, and receive results. Some of its features are: syntax highlighting, user-settable colors and fonts for each part of the screen, and result-set displays -with multi-line rows and resizable columns, and a debugger.

+with multi-line rows and resizable columns, plugins, and a debugger.

The developer, the product, and the status


@@ -995,6 +997,99 @@

Charts


and the Qwt library is no longer necessary.

+

Make your own menus


+

+There are SQL-like statements for manipulating the main menus. +They all begin with SET ocelot_query =, and they are all client statements. +You can execute them without being connected to a DBMS server.

+SET ocelot_query =
+  SELECT * FROM menus;
+SET ocelot_query =
+  DELETE FROM menus WHERE id = 'id';
+SET ocelot_query =
+  UPDATE menus SET menuitem | shortcut | action = 'literal' WHERE id = 'id';
+SET ocelot_query =
+  INSERT INTO menus VALUES ('id', 'menu-title', 'menu-item', 'action');
+

+

+SELECT result columns are ID (a unique value which you need to know for the WHERE clause in +other menu statements), MENU_TITLE (the name of a menu), MENU_ITEM (the name of a menu item +within a menu), ACTION (what happens when you select a menu item), SHORTCUT (a keysequence +that does the same thing as selecting the menu item). Initially the ACTION column will have +"[menu]" for a menu, "[separator]" for a line that sometimes is drawn between menu items, +and function names for every menu item. (You would see the same function names if you looked +at the ocelotgui source code.) +

+

+Suppose you want to remove the File|Exit menu item. You would first use SELECT to see that +the ID is action_file_exit. Then SET ocelot_query = DELETE FROM menus WHERE id = 'action_file_exit'; +will remove it. But you could put it back later with SET ocelot_query = INSERT INTO menus +VALUES ('action_file_exit', 'File', 'Exit', 'action_file_exit');. +

+

+Suppose you want to change the Edit|Cut menu item to Edit|Couper. You would first use SELECT +to find that the ID is action_edit_cut. Then SET ocelot_query = UPDATE menus SET menu_item += 'Couper' WHERE id = 'action_edit_cut'; will change it. Then you can change the shortcut, +with SET ocelot_query = UPDATE menus SET shortcut = 'Ctrl+Shift+X' WHERE id = 'action_edit_cut'; +as described earlier. +

+

+Suppose you want to make a completely new menu with your own names and actions. +You don't need to insert a "[menu]" row, that will happen automatically when you insert a menu item. +So SET ocelot_query = INSERT INTO menus VALUES ('new_cut', 'NEW', 'Cut!', 'action_edit_cut'); will +make a new menu and a new menu item NEW|Cut! with an action that does the same thing as Edit|cut. +Then SET ocelot_query = INSERT INTO menus VALUES ('new_sql', 'NEW', 'SQL!', 'SELECT 5 AS five, 6 AS six UNION ALL SELECT 5, 6;'); will make a new menu item NEW|SQL! that causes an SQL statement. +So now the menu looks like this:
+menunew.png
+So whenever you have stock SQL statements, or a series of SQL statements, that you might want to +repeat frequently, you don't have to store them in a file and read the file with SOURCE. You can +have them in the menu. Just remember: they must end with a semicolon. +

+

+You can also make a menu whose action is a plugin. Plugins are described in the next section. +

+

Make your own plugins


+

+A plugin is a routine in a library. +There are SQL-like statements for manipulating the plugins. +They all begin with SET ocelot_query =, and they are all client statements. +You can execute them without being connected to a DBMS server.

+SET ocelot_query =
+  SELECT * FROM plugins;
+SET ocelot_query =
+  DELETE FROM plugins WHERE action = 'action';
+SET ocelot_query =
+  INSERT INTO plugins VALUES ('library', 'action');
+... where ACTION is the name of the routine in the library. +What the routine does is up to you, you have to write it, in C or C++. +The description here is only about the SQL-like statements. +

+Again, SELECT is useful for seeing what plugins have been inserted, and DELETE is useful for undoing. +The INSERT will cause ocelotgui to search for a library (called a .so with Linux or a .dll with Windows), +and within that to search for a routine. There are two kinds of plugins: "trigger plugins" and "menu plugins". +

+When ocelotgui reaches one of a certain set of preset points in its code, it calls a +trigger plugin with a structured parameter that contains a lot of information about +state, values of current variables, and permanent settings. The trigger plugin can +act on the information, and in some cases can change it. For example, ocelotgui can call a trigger +plugin whenever it is about to pass an SQL statement to the server, and the plugin can log the +request then change the SQL statement to something completely different. +

+

+When a menu item has an action that is not one of the 'action_*' routines within the ocelotgui code, +and is not an SQL statement ending with ';', it looks for a menu plugin and calls it. For example, +after SET ocelot_query = INSERT INTO plugins VALUES ('/home/pgulutzan/plugin/libplugin.so', 'menu_action'); +and after SET ocelot_query = INSERT INTO menus VALUES ('menu_action', 'NEW', 'The Example', 'menu_action'); +and after SET ocelot_query = UPDATE menus SET shortcut = 'Shift+F12' WHERE id = 'menu_action'; +and after the user either clicks the NEW/The Example menu item or types Shift+F12, the menu_action +function in libplugin.so will run. +

+

+This is not a manual about C/C++ coding so the rest is up to you. +But to make it as simple as possible, ocelotgui is packaged with a file named plugin.c. +It contains several example functions and several hundred words of commentary. +

+

Contact


We need feedback!

@@ -1421,7 +1516,10 @@

Appendix 1 Details about ocelotgui options


ocelot_shortcut_connect, ocelot_shortcut_exit, etc. ... You can change what the shortcut is, for any menu item, by specifying its name and a new keysequence. -For example: SET ocelot_shortcut_paste = 'Ctrl+Shift+K'; +For example: SET ocelot_shortcut_paste = 'Ctrl+Shift+K'; +but since verson 2.4 it is better to say +SET ocelot_query = UPDATE menus SET shortcut='Ctrl+Shift+K' +WHERE id = 'action_edit_paste'; @@ -2141,7 +2239,7 @@

Appendix 3 Tarantool


Tarantool library, its code is embedded in ocelotgui.exe.

You need the latest ocelotgui client. -The Release 2.3.0 version is okay at the time of release, +The Release 2.4.0 version is okay at the time of release, but some things might not be up to date. It may be better to build it from source. Download from github.com/ocelot-inc/ocelotgui.

@@ -2302,11 +2400,11 @@

Appendix 4 Windows


* Download the ocelotgui zip file from github. Check https://github.com/ocelot-inc/ocelotgui/blob/master/README.md to see where the latest release is. For example it might be - https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0-1.ocelotgui.zip
+ https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0-1.ocelotgui.zip
* Unzip. It was zipped with 7-zip from http://www.7-zip.org, but other utilities should work. For example, on Windows command prompt, if you have the PowerShell utility on your path: - PowerShell Expand-Archive ocelotgui-2.3.0-1.ocelotgui.zip c:\ocelotgui
+ PowerShell Expand-Archive ocelotgui-2.4.0-1.ocelotgui.zip c:\ocelotgui
* Read the COPYING and LICENSE arrangements. On Windows ocelotgui is statically linked to Qt and MariaDB libraries, so the copyright and licensing is not the same as for Linux.
@@ -2548,9 +2646,9 @@

Building ocelotgui.exe from source

: Make sure you can unzip ocelotgui.zip with both 7-zip and winzip. copy release\ocelotgui.exe ocelotgui.exe del ocelotui.zip -"C:\Program Files (x86)\7-Zip\7z" a -tzip ocelotgui.zip ocelotgui.exe changelog manual.htm ocelotgui-logo.png ocelotgui_logo.png shot8.jpg CMakeLists.txt menu-debug.png ocelotgui.pro shot9.jpg codeeditor.h menu-edit.png ocelotgui.ui special-detach.png COPYING menu-file.png options.txt shot10.jpg special-images.png COPYING.thirdparty menu-help.png ostrings.h shot11.png special-settings.png copyright menu-options.png README.htm shot1.jpg special-vertical.png debugger.png menu-run.png README.md shot2.jpg starting-dialog.png debugger_reference.txt menu-settings.png README.txt shot3.png starting.png example.cnf PKGBUILD ocelotgui.1 readmylogin.c shot4.jpg statement-widget-example.png hparse.h ocelotgui.cpp result-widget-example.png shot5.jpg third_party.h install_sql.cpp ocelotgui.desktop rpmchangelog shot6.jpg windows.txt LICENSE.GPL ocelotgui.h shot7.jpg tarantool.txt rpm_build.sh ocelotgui.spec completer_1.png completer_2.png completer_3.png conditional.png explorer1.png explorer2.png explorer3.png explorer4.png explorer5.png explorer6.png explorer7.png explorer8.png explorer9.png +"C:\Program Files (x86)\7-Zip\7z" a -tzip ocelotgui.zip ocelotgui.exe changelog manual.htm ocelotgui-logo.png ocelotgui_logo.png shot8.jpg CMakeLists.txt menu-debug.png ocelotgui.pro shot9.jpg codeeditor.h menu-edit.png ocelotgui.ui special-detach.png COPYING menu-file.png options.txt shot10.jpg special-images.png COPYING.thirdparty menu-help.png ostrings.h shot11.png special-settings.png copyright menu-options.png README.htm shot1.jpg special-vertical.png debugger.png menu-run.png README.md shot2.jpg starting-dialog.png debugger_reference.txt menu-settings.png README.txt shot3.png starting.png example.cnf PKGBUILD ocelotgui.1 readmylogin.c shot4.jpg statement-widget-example.png hparse.h ocelotgui.cpp result-widget-example.png shot5.jpg third_party.h install_sql.cpp ocelotgui.desktop rpmchangelog shot6.jpg windows.txt LICENSE.GPL ocelotgui.h shot7.jpg tarantool.txt rpm_build.sh ocelotgui.spec completer_1.png completer_2.png completer_3.png conditional.png explorer1.png explorer2.png explorer3.png explorer4.png explorer5.png explorer6.png explorer7.png explorer8.png explorer9.png menunew.png plugin.c -: What we actually put in the release looks like ocelotgui-2.3.0-1.ocelotgui.zip, so rename the .zip file at some point. +: What we actually put in the release looks like ocelotgui-2.4.0-1.ocelotgui.zip, so rename the .zip file at some point. : (Dynamic linking) @@ -2628,14 +2726,14 @@

Appendix 5 Getting and using the by github and is named ocelotgui-[version].tar.gz. Since version 1.0.9, there is also a release file named ocelotgui_[version].orig.tar.gz which is preferable because it does not contain unnecessary executables. -Thus release 2.3.0 is at -https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0.orig.tar.gz. +Thus release 2.4.0 is at +https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0.orig.tar.gz. Typically, to get it, one would cd to a download directory, then
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0.orig.tar.gz
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0.orig.tar.gz
 
or use a browser to go to https://github.com/ocelot-inc/ocelotgui/releases -and click ocelotgui_2.3.0.orig.tar.gz.

+and click ocelotgui_2.4.0.orig.tar.gz.

On Debian-like systems some packages must be installed first. For example on Ubuntu:

@@ -2649,7 +2747,8 @@ 

Appendix 5 Getting and using the #It is okay if qt5-default is absent sudo apt-get install qt5-default qtbase5-dev qt5-qmake qtbase5-dev-tools #Do the following if and only if build is for use with Qt6 - sudo apt-get install qt-6-base-dev qt-6-base-dev-tools

+ #It might be qt-6-base-dev and qt-6-base-dev-tools + sudo apt-get install qt6-base-dev qt6-base-dev-tools

On RPM-like systems some packages must be installed first with "yum install" or "dnf install" or "urpmi". @@ -2676,8 +2775,8 @@

Appendix 5 Getting and using the

(Package builds on ArchLinux-like systems can also be done with the PKGBUILD file in the ocelotgui github repository.)

Unpack all the source files by saying:

- tar -zxvf ocelotgui_2.3.0.orig.tar.gz
- cd ocelotgui-2.3.0
+ tar -zxvf ocelotgui_2.4.0.orig.tar.gz + cd ocelotgui-2.4.0 At this point it is a good idea to examine the file CMakeLists.txt. This file has comments about options which are available to customize the build process: CMAKE_PREFIX_PATH, CMAKE_INSTALL_PREFIX, @@ -2701,12 +2800,12 @@

Appendix 5 Getting and using the Please read the comments in the scripts before using them. For Debian-like platforms say
  ./deb_build.sh
- sudo apt install /tmp/debian3/ocelotgui_2.3.0-1_amd64.deb
- #or sudo apt install /tmp/debian3/ocelotgui_2.3.0-1_i386.deb
+ sudo apt install /tmp/debian3/ocelotgui_2.4.0-1_amd64.deb + #or sudo apt install /tmp/debian3/ocelotgui_2.4.0-1_i386.deb For RPM-like platforms say
  ./rpm_build.sh
- sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.x86_64.rpm
- #or sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.i686.rpm
+ sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.x86_64.rpm + #or sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.i686.rpm Usually the result will go to subdirectories of /usr, in which case, if /usr/bin is on your PATH, then saying ocelotgui will start the program.

diff --git a/README.md b/README.md index 18bd1ef..075f2f9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ocelotgui -

Version 2.3.0

+

Version 2.4.0

The ocelotgui GUI, a database client, allows users to connect to a MySQL or MariaDB DBMS server, enter SQL statements, and receive results. @@ -48,6 +48,8 @@ All rights reserved.

... Explorer widget ... ERDiagram ... Charts +... Make your own menus +... Make your own plugins/A> ... Contact

Appendixes

... Appendix 1 Details about ocelotgui options @@ -123,21 +125,21 @@ If one of the following ocelotgui binary packages is compatible with your platfo cut and paste the corresponding pair of instructions onto your computer and you can be up and running in about 15 seconds.

For 32-bit, Debian-like, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0-1_i386.deb
-sudo apt install ./ocelotgui_2.3.0-1_i386.deb
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0-1_i386.deb +sudo apt install ./ocelotgui_2.4.0-1_i386.deb For 64-bit, Debian-like, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0-1_amd64.deb
-sudo apt install ./ocelotgui_2.3.0-1_amd64.deb
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0-1_amd64.deb +sudo apt install ./ocelotgui_2.4.0-1_amd64.deb For 64-bit, RPM-like, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0-1.x86_64.rpm
-sudo rpm -i ocelotgui-2.3.0-1.x86_64.rpm
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0-1.x86_64.rpm +sudo rpm -i ocelotgui-2.4.0-1.x86_64.rpm For 64-bit, any Linux, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0.tar.gz
-tar zxvf ocelotgui-2.3.0.tar.gz
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0.tar.gz
+tar zxvf ocelotgui-2.4.0.tar.gz
 ocelotgui/ocelotgui-qt5
For 64-bit, any Linux, Qt4 (deprecated)
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0.tar.gz
-tar zxvf ocelotgui-2.3.0.tar.gz
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0.tar.gz
+tar zxvf ocelotgui-2.4.0.tar.gz
 ocelotgui/ocelotgui-qt4

@@ -172,7 +174,7 @@ Stop again with File|Exit or control-Q.

User Manual



-

Version 2.3.0, March 18 2024

+

Version 2.4.0, March 18 2024

Copyright (c) 2024 by Peter Gulutzan. All rights reserved.

@@ -196,7 +198,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

a MySQL or MariaDB DBMS server, enter SQL statements, and receive results. Some of its features are: syntax highlighting, user-settable colors and fonts for each part of the screen, and result-set displays -with multi-line rows and resizable columns, and a debugger.

+with multi-line rows and resizable columns, plugins, and a debugger.

The developer, the product, and the status


@@ -995,6 +997,99 @@ The current output may look slightly different from the illustrations there, and the Qwt library is no longer necessary.

+

Make your own menus


+

+There are SQL-like statements for manipulating the main menus. +They all begin with SET ocelot_query =, and they are all client statements. +You can execute them without being connected to a DBMS server.

+SET ocelot_query =
+  SELECT * FROM menus;
+SET ocelot_query =
+  DELETE FROM menus WHERE id = 'id';
+SET ocelot_query =
+  UPDATE menus SET menuitem | shortcut | action = 'literal' WHERE id = 'id';
+SET ocelot_query =
+  INSERT INTO menus VALUES ('id', 'menu-title', 'menu-item', 'action');
+

+

+SELECT result columns are ID (a unique value which you need to know for the WHERE clause in +other menu statements), MENU_TITLE (the name of a menu), MENU_ITEM (the name of a menu item +within a menu), ACTION (what happens when you select a menu item), SHORTCUT (a keysequence +that does the same thing as selecting the menu item). Initially the ACTION column will have +"[menu]" for a menu, "[separator]" for a line that sometimes is drawn between menu items, +and function names for every menu item. (You would see the same function names if you looked +at the ocelotgui source code.) +

+

+Suppose you want to remove the File|Exit menu item. You would first use SELECT to see that +the ID is action_file_exit. Then SET ocelot_query = DELETE FROM menus WHERE id = 'action_file_exit'; +will remove it. But you could put it back later with SET ocelot_query = INSERT INTO menus +VALUES ('action_file_exit', 'File', 'Exit', 'action_file_exit');. +

+

+Suppose you want to change the Edit|Cut menu item to Edit|Couper. You would first use SELECT +to find that the ID is action_edit_cut. Then SET ocelot_query = UPDATE menus SET menu_item += 'Couper' WHERE id = 'action_edit_cut'; will change it. Then you can change the shortcut, +with SET ocelot_query = UPDATE menus SET shortcut = 'Ctrl+Shift+X' WHERE id = 'action_edit_cut'; +as described earlier. +

+

+Suppose you want to make a completely new menu with your own names and actions. +You don't need to insert a "[menu]" row, that will happen automatically when you insert a menu item. +So SET ocelot_query = INSERT INTO menus VALUES ('new_cut', 'NEW', 'Cut!', 'action_edit_cut'); will +make a new menu and a new menu item NEW|Cut! with an action that does the same thing as Edit|cut. +Then SET ocelot_query = INSERT INTO menus VALUES ('new_sql', 'NEW', 'SQL!', 'SELECT 5 AS five, 6 AS six UNION ALL SELECT 5, 6;'); will make a new menu item NEW|SQL! that causes an SQL statement. +So now the menu looks like this:
+menunew.png
+So whenever you have stock SQL statements, or a series of SQL statements, that you might want to +repeat frequently, you don't have to store them in a file and read the file with SOURCE. You can +have them in the menu. Just remember: they must end with a semicolon. +

+

+You can also make a menu whose action is a plugin. Plugins are described in the next section. +

+

Make your own plugins


+

+A plugin is a routine in a library. +There are SQL-like statements for manipulating the plugins. +They all begin with SET ocelot_query =, and they are all client statements. +You can execute them without being connected to a DBMS server.

+SET ocelot_query =
+  SELECT * FROM plugins;
+SET ocelot_query =
+  DELETE FROM plugins WHERE action = 'action';
+SET ocelot_query =
+  INSERT INTO plugins VALUES ('library', 'action');
+... where ACTION is the name of the routine in the library. +What the routine does is up to you, you have to write it, in C or C++. +The description here is only about the SQL-like statements. +

+Again, SELECT is useful for seeing what plugins have been inserted, and DELETE is useful for undoing. +The INSERT will cause ocelotgui to search for a library (called a .so with Linux or a .dll with Windows), +and within that to search for a routine. There are two kinds of plugins: "trigger plugins" and "menu plugins". +

+When ocelotgui reaches one of a certain set of preset points in its code, it calls a +trigger plugin with a structured parameter that contains a lot of information about +state, values of current variables, and permanent settings. The trigger plugin can +act on the information, and in some cases can change it. For example, ocelotgui can call a trigger +plugin whenever it is about to pass an SQL statement to the server, and the plugin can log the +request then change the SQL statement to something completely different. +

+

+When a menu item has an action that is not one of the 'action_*' routines within the ocelotgui code, +and is not an SQL statement ending with ';', it looks for a menu plugin and calls it. For example, +after SET ocelot_query = INSERT INTO plugins VALUES ('/home/pgulutzan/plugin/libplugin.so', 'menu_action'); +and after SET ocelot_query = INSERT INTO menus VALUES ('menu_action', 'NEW', 'The Example', 'menu_action'); +and after SET ocelot_query = UPDATE menus SET shortcut = 'Shift+F12' WHERE id = 'menu_action'; +and after the user either clicks the NEW/The Example menu item or types Shift+F12, the menu_action +function in libplugin.so will run. +

+

+This is not a manual about C/C++ coding so the rest is up to you. +But to make it as simple as possible, ocelotgui is packaged with a file named plugin.c. +It contains several example functions and several hundred words of commentary. +

+

Contact


We need feedback!

@@ -1421,7 +1516,10 @@ will appear. The default is 1. ocelot_shortcut_connect, ocelot_shortcut_exit, etc. ... You can change what the shortcut is, for any menu item, by specifying its name and a new keysequence. -For example: SET ocelot_shortcut_paste = 'Ctrl+Shift+K'; +For example: SET ocelot_shortcut_paste = 'Ctrl+Shift+K'; +but since verson 2.4 it is better to say +SET ocelot_query = UPDATE menus SET shortcut='Ctrl+Shift+K' +WHERE id = 'action_edit_paste'; @@ -2141,7 +2239,7 @@ On Windows you do not need to install a Tarantool library, its code is embedded in ocelotgui.exe.

You need the latest ocelotgui client. -The Release 2.3.0 version is okay at the time of release, +The Release 2.4.0 version is okay at the time of release, but some things might not be up to date. It may be better to build it from source. Download from github.com/ocelot-inc/ocelotgui.

@@ -2302,11 +2400,11 @@ How to get it:
* Download the ocelotgui zip file from github. Check https://github.com/ocelot-inc/ocelotgui/blob/master/README.md to see where the latest release is. For example it might be - https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0-1.ocelotgui.zip
+ https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0-1.ocelotgui.zip
* Unzip. It was zipped with 7-zip from http://www.7-zip.org, but other utilities should work. For example, on Windows command prompt, if you have the PowerShell utility on your path: - PowerShell Expand-Archive ocelotgui-2.3.0-1.ocelotgui.zip c:\ocelotgui
+ PowerShell Expand-Archive ocelotgui-2.4.0-1.ocelotgui.zip c:\ocelotgui
* Read the COPYING and LICENSE arrangements. On Windows ocelotgui is statically linked to Qt and MariaDB libraries, so the copyright and licensing is not the same as for Linux.
@@ -2550,7 +2648,7 @@ copy release\ocelotgui.exe ocelotgui.exe del ocelotui.zip "C:\Program Files (x86)\7-Zip\7z" a -tzip ocelotgui.zip ocelotgui.exe changelog manual.htm ocelotgui-logo.png ocelotgui_logo.png shot8.jpg CMakeLists.txt menu-debug.png ocelotgui.pro shot9.jpg codeeditor.h menu-edit.png ocelotgui.ui special-detach.png COPYING menu-file.png options.txt shot10.jpg special-images.png COPYING.thirdparty menu-help.png ostrings.h shot11.png special-settings.png copyright menu-options.png README.htm shot1.jpg special-vertical.png debugger.png menu-run.png README.md shot2.jpg starting-dialog.png debugger_reference.txt menu-settings.png README.txt shot3.png starting.png example.cnf PKGBUILD ocelotgui.1 readmylogin.c shot4.jpg statement-widget-example.png hparse.h ocelotgui.cpp result-widget-example.png shot5.jpg third_party.h install_sql.cpp ocelotgui.desktop rpmchangelog shot6.jpg windows.txt LICENSE.GPL ocelotgui.h shot7.jpg tarantool.txt rpm_build.sh ocelotgui.spec completer_1.png completer_2.png completer_3.png conditional.png explorer1.png explorer2.png explorer3.png explorer4.png explorer5.png explorer6.png explorer7.png explorer8.png explorer9.png -: What we actually put in the release looks like ocelotgui-2.3.0-1.ocelotgui.zip, so rename the .zip file at some point. +: What we actually put in the release looks like ocelotgui-2.4.0-1.ocelotgui.zip, so rename the .zip file at some point. : (Dynamic linking) @@ -2628,14 +2726,14 @@ A release file is highlighted in green by github and is named ocelotgui-[version].tar.gz. Since version 1.0.9, there is also a release file named ocelotgui_[version].orig.tar.gz which is preferable because it does not contain unnecessary executables. -Thus release 2.3.0 is at -https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0.orig.tar.gz. +Thus release 2.4.0 is at +https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0.orig.tar.gz. Typically, to get it, one would cd to a download directory, then
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0.orig.tar.gz
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0.orig.tar.gz
 
or use a browser to go to https://github.com/ocelot-inc/ocelotgui/releases -and click ocelotgui_2.3.0.orig.tar.gz.

+and click ocelotgui_2.4.0.orig.tar.gz.

On Debian-like systems some packages must be installed first. For example on Ubuntu:

@@ -2649,7 +2747,8 @@ For example on Ubuntu:
  #It is okay if qt5-default is absent
  sudo apt-get install qt5-default qtbase5-dev qt5-qmake qtbase5-dev-tools
  #Do the following if and only if build is for use with Qt6
- sudo apt-get install qt-6-base-dev qt-6-base-dev-tools

+ #It might be qt-6-base-dev and qt-6-base-dev-tools + sudo apt-get install qt6-base-dev qt6-base-dev-tools

On RPM-like systems some packages must be installed first with "yum install" or "dnf install" or "urpmi". @@ -2676,8 +2775,8 @@ sudo pacman -S mariadb-clients

(Package builds on ArchLinux-like systems can also be done with the PKGBUILD file in the ocelotgui github repository.)

Unpack all the source files by saying:

- tar -zxvf ocelotgui_2.3.0.orig.tar.gz
- cd ocelotgui-2.3.0
+ tar -zxvf ocelotgui_2.4.0.orig.tar.gz + cd ocelotgui-2.4.0 At this point it is a good idea to examine the file CMakeLists.txt. This file has comments about options which are available to customize the build process: CMAKE_PREFIX_PATH, CMAKE_INSTALL_PREFIX, @@ -2701,12 +2800,12 @@ Peter Gulutzan provides scripts that will create .deb or .rpm packages. Please read the comments in the scripts before using them. For Debian-like platforms say
  ./deb_build.sh
- sudo apt install /tmp/debian3/ocelotgui_2.3.0-1_amd64.deb
- #or sudo apt install /tmp/debian3/ocelotgui_2.3.0-1_i386.deb
+ sudo apt install /tmp/debian3/ocelotgui_2.4.0-1_amd64.deb + #or sudo apt install /tmp/debian3/ocelotgui_2.4.0-1_i386.deb For RPM-like platforms say
  ./rpm_build.sh
- sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.x86_64.rpm
- #or sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.i686.rpm
+ sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.x86_64.rpm + #or sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.i686.rpm Usually the result will go to subdirectories of /usr, in which case, if /usr/bin is on your PATH, then saying ocelotgui will start the program.

diff --git a/README.txt b/README.txt index 18bd1ef..075f2f9 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ ocelotgui -

Version 2.3.0

+

Version 2.4.0

The ocelotgui GUI, a database client, allows users to connect to a MySQL or MariaDB DBMS server, enter SQL statements, and receive results. @@ -48,6 +48,8 @@ All rights reserved.

... Explorer widget ... ERDiagram ... Charts +... Make your own menus +... Make your own plugins/A> ... Contact

Appendixes

... Appendix 1 Details about ocelotgui options @@ -123,21 +125,21 @@ If one of the following ocelotgui binary packages is compatible with your platfo cut and paste the corresponding pair of instructions onto your computer and you can be up and running in about 15 seconds.

For 32-bit, Debian-like, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0-1_i386.deb
-sudo apt install ./ocelotgui_2.3.0-1_i386.deb
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0-1_i386.deb +sudo apt install ./ocelotgui_2.4.0-1_i386.deb For 64-bit, Debian-like, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0-1_amd64.deb
-sudo apt install ./ocelotgui_2.3.0-1_amd64.deb
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0-1_amd64.deb +sudo apt install ./ocelotgui_2.4.0-1_amd64.deb For 64-bit, RPM-like, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0-1.x86_64.rpm
-sudo rpm -i ocelotgui-2.3.0-1.x86_64.rpm
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0-1.x86_64.rpm +sudo rpm -i ocelotgui-2.4.0-1.x86_64.rpm For 64-bit, any Linux, Qt5
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0.tar.gz
-tar zxvf ocelotgui-2.3.0.tar.gz
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0.tar.gz
+tar zxvf ocelotgui-2.4.0.tar.gz
 ocelotgui/ocelotgui-qt5
For 64-bit, any Linux, Qt4 (deprecated)
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0.tar.gz
-tar zxvf ocelotgui-2.3.0.tar.gz
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0.tar.gz
+tar zxvf ocelotgui-2.4.0.tar.gz
 ocelotgui/ocelotgui-qt4

@@ -172,7 +174,7 @@ Stop again with File|Exit or control-Q.

User Manual



-

Version 2.3.0, March 18 2024

+

Version 2.4.0, March 18 2024

Copyright (c) 2024 by Peter Gulutzan. All rights reserved.

@@ -196,7 +198,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

a MySQL or MariaDB DBMS server, enter SQL statements, and receive results. Some of its features are: syntax highlighting, user-settable colors and fonts for each part of the screen, and result-set displays -with multi-line rows and resizable columns, and a debugger.

+with multi-line rows and resizable columns, plugins, and a debugger.

The developer, the product, and the status


@@ -995,6 +997,99 @@ The current output may look slightly different from the illustrations there, and the Qwt library is no longer necessary.

+

Make your own menus


+

+There are SQL-like statements for manipulating the main menus. +They all begin with SET ocelot_query =, and they are all client statements. +You can execute them without being connected to a DBMS server.

+SET ocelot_query =
+  SELECT * FROM menus;
+SET ocelot_query =
+  DELETE FROM menus WHERE id = 'id';
+SET ocelot_query =
+  UPDATE menus SET menuitem | shortcut | action = 'literal' WHERE id = 'id';
+SET ocelot_query =
+  INSERT INTO menus VALUES ('id', 'menu-title', 'menu-item', 'action');
+

+

+SELECT result columns are ID (a unique value which you need to know for the WHERE clause in +other menu statements), MENU_TITLE (the name of a menu), MENU_ITEM (the name of a menu item +within a menu), ACTION (what happens when you select a menu item), SHORTCUT (a keysequence +that does the same thing as selecting the menu item). Initially the ACTION column will have +"[menu]" for a menu, "[separator]" for a line that sometimes is drawn between menu items, +and function names for every menu item. (You would see the same function names if you looked +at the ocelotgui source code.) +

+

+Suppose you want to remove the File|Exit menu item. You would first use SELECT to see that +the ID is action_file_exit. Then SET ocelot_query = DELETE FROM menus WHERE id = 'action_file_exit'; +will remove it. But you could put it back later with SET ocelot_query = INSERT INTO menus +VALUES ('action_file_exit', 'File', 'Exit', 'action_file_exit');. +

+

+Suppose you want to change the Edit|Cut menu item to Edit|Couper. You would first use SELECT +to find that the ID is action_edit_cut. Then SET ocelot_query = UPDATE menus SET menu_item += 'Couper' WHERE id = 'action_edit_cut'; will change it. Then you can change the shortcut, +with SET ocelot_query = UPDATE menus SET shortcut = 'Ctrl+Shift+X' WHERE id = 'action_edit_cut'; +as described earlier. +

+

+Suppose you want to make a completely new menu with your own names and actions. +You don't need to insert a "[menu]" row, that will happen automatically when you insert a menu item. +So SET ocelot_query = INSERT INTO menus VALUES ('new_cut', 'NEW', 'Cut!', 'action_edit_cut'); will +make a new menu and a new menu item NEW|Cut! with an action that does the same thing as Edit|cut. +Then SET ocelot_query = INSERT INTO menus VALUES ('new_sql', 'NEW', 'SQL!', 'SELECT 5 AS five, 6 AS six UNION ALL SELECT 5, 6;'); will make a new menu item NEW|SQL! that causes an SQL statement. +So now the menu looks like this:
+menunew.png
+So whenever you have stock SQL statements, or a series of SQL statements, that you might want to +repeat frequently, you don't have to store them in a file and read the file with SOURCE. You can +have them in the menu. Just remember: they must end with a semicolon. +

+

+You can also make a menu whose action is a plugin. Plugins are described in the next section. +

+

Make your own plugins


+

+A plugin is a routine in a library. +There are SQL-like statements for manipulating the plugins. +They all begin with SET ocelot_query =, and they are all client statements. +You can execute them without being connected to a DBMS server.

+SET ocelot_query =
+  SELECT * FROM plugins;
+SET ocelot_query =
+  DELETE FROM plugins WHERE action = 'action';
+SET ocelot_query =
+  INSERT INTO plugins VALUES ('library', 'action');
+... where ACTION is the name of the routine in the library. +What the routine does is up to you, you have to write it, in C or C++. +The description here is only about the SQL-like statements. +

+Again, SELECT is useful for seeing what plugins have been inserted, and DELETE is useful for undoing. +The INSERT will cause ocelotgui to search for a library (called a .so with Linux or a .dll with Windows), +and within that to search for a routine. There are two kinds of plugins: "trigger plugins" and "menu plugins". +

+When ocelotgui reaches one of a certain set of preset points in its code, it calls a +trigger plugin with a structured parameter that contains a lot of information about +state, values of current variables, and permanent settings. The trigger plugin can +act on the information, and in some cases can change it. For example, ocelotgui can call a trigger +plugin whenever it is about to pass an SQL statement to the server, and the plugin can log the +request then change the SQL statement to something completely different. +

+

+When a menu item has an action that is not one of the 'action_*' routines within the ocelotgui code, +and is not an SQL statement ending with ';', it looks for a menu plugin and calls it. For example, +after SET ocelot_query = INSERT INTO plugins VALUES ('/home/pgulutzan/plugin/libplugin.so', 'menu_action'); +and after SET ocelot_query = INSERT INTO menus VALUES ('menu_action', 'NEW', 'The Example', 'menu_action'); +and after SET ocelot_query = UPDATE menus SET shortcut = 'Shift+F12' WHERE id = 'menu_action'; +and after the user either clicks the NEW/The Example menu item or types Shift+F12, the menu_action +function in libplugin.so will run. +

+

+This is not a manual about C/C++ coding so the rest is up to you. +But to make it as simple as possible, ocelotgui is packaged with a file named plugin.c. +It contains several example functions and several hundred words of commentary. +

+

Contact


We need feedback!

@@ -1421,7 +1516,10 @@ will appear. The default is 1. ocelot_shortcut_connect, ocelot_shortcut_exit, etc. ... You can change what the shortcut is, for any menu item, by specifying its name and a new keysequence. -For example: SET ocelot_shortcut_paste = 'Ctrl+Shift+K'; +For example: SET ocelot_shortcut_paste = 'Ctrl+Shift+K'; +but since verson 2.4 it is better to say +SET ocelot_query = UPDATE menus SET shortcut='Ctrl+Shift+K' +WHERE id = 'action_edit_paste'; @@ -2141,7 +2239,7 @@ On Windows you do not need to install a Tarantool library, its code is embedded in ocelotgui.exe.

You need the latest ocelotgui client. -The Release 2.3.0 version is okay at the time of release, +The Release 2.4.0 version is okay at the time of release, but some things might not be up to date. It may be better to build it from source. Download from github.com/ocelot-inc/ocelotgui.

@@ -2302,11 +2400,11 @@ How to get it:
* Download the ocelotgui zip file from github. Check https://github.com/ocelot-inc/ocelotgui/blob/master/README.md to see where the latest release is. For example it might be - https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0-1.ocelotgui.zip
+ https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0-1.ocelotgui.zip
* Unzip. It was zipped with 7-zip from http://www.7-zip.org, but other utilities should work. For example, on Windows command prompt, if you have the PowerShell utility on your path: - PowerShell Expand-Archive ocelotgui-2.3.0-1.ocelotgui.zip c:\ocelotgui
+ PowerShell Expand-Archive ocelotgui-2.4.0-1.ocelotgui.zip c:\ocelotgui
* Read the COPYING and LICENSE arrangements. On Windows ocelotgui is statically linked to Qt and MariaDB libraries, so the copyright and licensing is not the same as for Linux.
@@ -2550,7 +2648,7 @@ copy release\ocelotgui.exe ocelotgui.exe del ocelotui.zip "C:\Program Files (x86)\7-Zip\7z" a -tzip ocelotgui.zip ocelotgui.exe changelog manual.htm ocelotgui-logo.png ocelotgui_logo.png shot8.jpg CMakeLists.txt menu-debug.png ocelotgui.pro shot9.jpg codeeditor.h menu-edit.png ocelotgui.ui special-detach.png COPYING menu-file.png options.txt shot10.jpg special-images.png COPYING.thirdparty menu-help.png ostrings.h shot11.png special-settings.png copyright menu-options.png README.htm shot1.jpg special-vertical.png debugger.png menu-run.png README.md shot2.jpg starting-dialog.png debugger_reference.txt menu-settings.png README.txt shot3.png starting.png example.cnf PKGBUILD ocelotgui.1 readmylogin.c shot4.jpg statement-widget-example.png hparse.h ocelotgui.cpp result-widget-example.png shot5.jpg third_party.h install_sql.cpp ocelotgui.desktop rpmchangelog shot6.jpg windows.txt LICENSE.GPL ocelotgui.h shot7.jpg tarantool.txt rpm_build.sh ocelotgui.spec completer_1.png completer_2.png completer_3.png conditional.png explorer1.png explorer2.png explorer3.png explorer4.png explorer5.png explorer6.png explorer7.png explorer8.png explorer9.png -: What we actually put in the release looks like ocelotgui-2.3.0-1.ocelotgui.zip, so rename the .zip file at some point. +: What we actually put in the release looks like ocelotgui-2.4.0-1.ocelotgui.zip, so rename the .zip file at some point. : (Dynamic linking) @@ -2628,14 +2726,14 @@ A release file is highlighted in green by github and is named ocelotgui-[version].tar.gz. Since version 1.0.9, there is also a release file named ocelotgui_[version].orig.tar.gz which is preferable because it does not contain unnecessary executables. -Thus release 2.3.0 is at -https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0.orig.tar.gz. +Thus release 2.4.0 is at +https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0.orig.tar.gz. Typically, to get it, one would cd to a download directory, then
-wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui_2.3.0.orig.tar.gz
+wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui_2.4.0.orig.tar.gz
 
or use a browser to go to https://github.com/ocelot-inc/ocelotgui/releases -and click ocelotgui_2.3.0.orig.tar.gz.

+and click ocelotgui_2.4.0.orig.tar.gz.

On Debian-like systems some packages must be installed first. For example on Ubuntu:

@@ -2649,7 +2747,8 @@ For example on Ubuntu:
  #It is okay if qt5-default is absent
  sudo apt-get install qt5-default qtbase5-dev qt5-qmake qtbase5-dev-tools
  #Do the following if and only if build is for use with Qt6
- sudo apt-get install qt-6-base-dev qt-6-base-dev-tools

+ #It might be qt-6-base-dev and qt-6-base-dev-tools + sudo apt-get install qt6-base-dev qt6-base-dev-tools

On RPM-like systems some packages must be installed first with "yum install" or "dnf install" or "urpmi". @@ -2676,8 +2775,8 @@ sudo pacman -S mariadb-clients

(Package builds on ArchLinux-like systems can also be done with the PKGBUILD file in the ocelotgui github repository.)

Unpack all the source files by saying:

- tar -zxvf ocelotgui_2.3.0.orig.tar.gz
- cd ocelotgui-2.3.0
+ tar -zxvf ocelotgui_2.4.0.orig.tar.gz + cd ocelotgui-2.4.0 At this point it is a good idea to examine the file CMakeLists.txt. This file has comments about options which are available to customize the build process: CMAKE_PREFIX_PATH, CMAKE_INSTALL_PREFIX, @@ -2701,12 +2800,12 @@ Peter Gulutzan provides scripts that will create .deb or .rpm packages. Please read the comments in the scripts before using them. For Debian-like platforms say
  ./deb_build.sh
- sudo apt install /tmp/debian3/ocelotgui_2.3.0-1_amd64.deb
- #or sudo apt install /tmp/debian3/ocelotgui_2.3.0-1_i386.deb
+ sudo apt install /tmp/debian3/ocelotgui_2.4.0-1_amd64.deb + #or sudo apt install /tmp/debian3/ocelotgui_2.4.0-1_i386.deb For RPM-like platforms say
  ./rpm_build.sh
- sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.x86_64.rpm
- #or sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.i686.rpm
+ sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.x86_64.rpm + #or sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.i686.rpm Usually the result will go to subdirectories of /usr, in which case, if /usr/bin is on your PATH, then saying ocelotgui will start the program.

diff --git a/changelog b/changelog index 4460879..1d969c7 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,9 @@ +ocelotgui (2.4.0-1) UNRELEASED; urgency=low + + * Plugins + + -- Peter Gulutzan Tue, 04 Jun 2024 12:00:00 -0600 + ocelotgui (2.3.0-1) UNRELEASED; urgency=low * Make SHOW as good as SELECT diff --git a/deb_build.sh b/deb_build.sh index d5390e6..c999713 100755 --- a/deb_build.sh +++ b/deb_build.sh @@ -1,11 +1,11 @@ -# deb_build.sh -- produce ocelotgui-2.3.0 .deb from ~/ocelotgui +# deb_build.sh -- produce ocelotgui-2.4.0 .deb from ~/ocelotgui # The ocelotgui developer uses this script to produce a .deb file from a source directory ~/ocelotgui on Ubuntu xenial. # Only advanced users will want this, ordinary users will download the official-release .deb file or make with cmake. # An easy way to get ~/ocelotgui is "cd ~" + "git clone https://github.com/ocelot-inc/ocelotgui ocelotgui". # This script uses /tmp and cheerily deletes existing files in /tmp. -# The result will be /tmp/debian3/ocelotgui_2.3.0-1_amd64.deb or /tmp/debian3/ocelotgui_2.3.0-1_i386.deb. +# The result will be /tmp/debian3/ocelotgui_2.4.0-1_amd64.deb or /tmp/debian3/ocelotgui_2.4.0-1_i386.deb. # See also the comments in README.Debian. sudo apt-get install debhelper dpkg-dev devscripts @@ -15,7 +15,7 @@ sudo apt-get install qtbase5-dev sudo apt-get install default-libmysqlclient-dev sudo apt-get install piuparts -export VERSION=2.3.0 +export VERSION=2.4.0 export SOURCE=$HOME/ocelotgui cd /tmp @@ -109,6 +109,8 @@ cp -p $SOURCE/debian/watch /tmp/ocelotgui-$VERSION/debian/watch cp -p $SOURCE/debian/patches/series /tmp/ocelotgui-$VERSION/debian/patches/series cp -p $SOURCE/debian/source/format /tmp/ocelotgui-$VERSION/debian/source/format cp -p $SOURCE/deb_build.sh /tmp/ocelotgui-$VERSION/deb_build.sh +cp -p $SOURCE/menunew.png /tmp/ocelotgui-$VERSION/menunew.png +cp -p $SOURCE/plugin.c /tmp/ocelotgui-$VERSION/plugin.c cd /tmp diff --git a/debian/README.Debian b/debian/README.Debian index e4810d7..1daab20 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -12,15 +12,15 @@ The ocelotgui source package includes a script deb_build.sh which builds a .deb # Get the prerequisites for build: apt-get install git cmake g++ default-libmysqlclient-dev qtbase5-dev # Get the prerequisites for debuild: apt-get install devscripts build-essential lintian -# Get the latest source, including the debian subdirectory, compressed into a file named ocelotgui-2.3.0.tar.gz. -# (Internally Peter Gulutzan has a script for "Making a package" but we do not supply it, you must make your own tar.gz.) -# (Since release 1.0.9, you're able to simply download ocelotgui-2.3.0.tar.gz from the github release files.) +# Get the latest source, including the debian subdirectory, compressed into a file named ocelotgui-2.4.0.tar.gz. +# (Internally Peter Gulutzan has a script for "Making a package" but does not supply it, you must make your own tar.gz.) +# (Since release 1.0.9, you're able to simply download ocelotgui-2.4.0.tar.gz from the github release files.) cd ~ rm -r -f ~/debian2 mkdir ~/debian2 cd ~/debian2 -cp ~/ocelotgui-2.3.0.tar.gz ocelotgui_2.3.0.orig.tar.gz -tar -xvf ocelotgui_2.3.0.orig.tar.gz +cp ~/ocelotgui-2.4.0.tar.gz ocelotgui_2.4.0.orig.tar.gz +tar -xvf ocelotgui_2.4.0.orig.tar.gz cd ./ocelotgui/debian debuild @@ -29,7 +29,7 @@ dpkg-genchanges: info: including full source code in upload ... but source isn't .png files were subjected to normalizing by "dh_strip_nondeterminism" # Lintian results -After "debuild" and after "lintian -I ~/tmp/debian3/ocelotgui_2.3.0_amd64.deb": +After "debuild" and after "lintian -I ~/tmp/debian3/ocelotgui_2.4.0_amd64.deb": When we build: There are no errors. There are no warnings. There are no informative messages. Hurrah. But it depends on what the distro's version is. We deliberately build on an old version. This is how to get rid of warnings or informative messages that might appear on newer distros. diff --git a/debian/changelog b/debian/changelog index 5101e4a..e9d864f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ocelotgui (2.4.0-1) UNRELEASED; urgency=low + + * Plugins + + -- Peter Gulutzan Tue, 04 Jun 2024 12:00:00 -0600 + ocelotgui (2.3.0-1) UNRELEASED; urgency=low * Make SHOW as good as SELECT diff --git a/hparse.h b/hparse.h index fb3ecdc..21a59cf 100644 --- a/hparse.h +++ b/hparse.h @@ -14140,7 +14140,7 @@ int MainWindow::hparse_f_client_set_query() /* INSERT INTO plugins|menus VALUES (string[,string...]) -- SQLish but so restricted we won't use the main INSERT routine */ if (hparse_f_accept(FLAG_VERSION_ALL, TOKEN_REFTYPE_ANY,TOKEN_KEYWORD_INSERT, "INSERT") == 1) { - int table_type; /* 0 if menu, TOKEN_KEYWORD_PLUGINS if plugin */ + int table_type= 0; /* 0 if menu, TOKEN_KEYWORD_PLUGINS if plugin */ hparse_f_expect(FLAG_VERSION_ALL, TOKEN_REFTYPE_ANY,TOKEN_KEYWORD_INTO, "INTO"); if (hparse_errno > 0) return 1; if (hparse_f_accept(FLAG_VERSION_ALL, TOKEN_REFTYPE_TABLE,TOKEN_TYPE_IDENTIFIER, "PLUGINS") == 1) diff --git a/manual.htm b/manual.htm index 340bb1f..3c345d2 100644 --- a/manual.htm +++ b/manual.htm @@ -1,6 +1,6 @@

The ocelotgui user manual


-
Version 2.3.0, March 18 2024 +
Version 2.4.0, June 4 2024


Copyright (c) 2024 by Peter Gulutzan. All rights reserved. diff --git a/ocelotgui.cpp b/ocelotgui.cpp index 2035f66..2ca72de 100644 --- a/ocelotgui.cpp +++ b/ocelotgui.cpp @@ -1,8 +1,8 @@ /* ocelotgui -- GUI Front End for MySQL or MariaDB - Version: 2.3.0 - Last modified: May 30 2024 + Version: 2.4.0 + Last modified: June 4 2024 */ /* Copyright (c) 2024 by Peter Gulutzan. All rights reserved. @@ -258,10 +258,10 @@ static struct connect_arguments ocelot_ca { .opt_local_infile= 0, .log_level= 100, .max_conditions= 5, - .max_allowed_packet= 16777216, + .max_allowed_packet_arg= 16777216, .max_join_size= 1000000, .named_commands= 0, - .net_buffer_length= 16384, + .net_buffer_length_arg= 16384, .no_beep= 0, .no_defaults= 0, .one_database= 0, @@ -413,7 +413,7 @@ static struct plugin_pass ocelot_plugin_pass { int options_and_connect(unsigned int connection_number, char *database_as_utf8); /* This should correspond to the version number in the comment at the start of this program. */ - static const char ocelotgui_version[]="2.3.0"; /* For --version. Make sure it's in manual too. */ + static const char ocelotgui_version[]="2.4.0"; /* For --version. Make sure it's in manual too. */ static unsigned int dbms_version_mask= FLAG_VERSION_DEFAULT; /* Global mysql definitions */ @@ -1809,7 +1809,7 @@ QString MainWindow::import_export_rule_set(QString text) */ void MainWindow::export_set_checked() { - QAction *q; + QAction *q= NULL; if (main_exports.type == TOKEN_KEYWORD_TEXT) q= menu_spec_find_action("action_file_export_text"); if (main_exports.type == TOKEN_KEYWORD_TABLE) q= menu_spec_find_action("action_file_export_table"); if (main_exports.type == TOKEN_KEYWORD_HTML) q= menu_spec_find_action("action_file_export_html"); @@ -4323,7 +4323,9 @@ QMenu* MainWindow::menu_spec_add_menu(int i) { QMenu *qmenu= ui->menuBar->addMenu(menu_spec_struct_list[i].menu_title); menu_spec_struct_list[i].qmenu= qmenu; +#if (QT_VERSION >= 0x50000) connect(menu_spec_struct_list[i].qmenu,&QMenu::aboutToShow,this,&MainWindow::menu_about_to_show); +#endif return qmenu; } @@ -4351,10 +4353,12 @@ QAction* MainWindow::menu_spec_add_action(int i, QMenu *qmenu) Warning: if all that's happening is that the user is shifting the mouse around the top of the menu bar, menu_about_to_show will happen multiple times */ +#if (QT_VERSION >= 0x50000) void MainWindow::menu_about_to_show() { /* printf("**** menu_about_to_show!\n"); */ } +#endif /* menu_spec_reset cancels that menu_spec_make_menu made new QActions + QMenus + separators, and connected to slots. @@ -5285,10 +5289,10 @@ void MainWindow::action_file_connect_once(QString message) row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_LINE_NUMBERS].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.line_numbers); row_form_width[i]= '\x05'; row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_LOCAL_INFILE].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.opt_local_infile); row_form_width[i]= '\x05'; row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_LOGIN_PATH].chars).toLower();; row_form_type[i]= 0; row_form_is_password[i]= 0; row_form_data[i]= ocelot_login_path; row_form_width[i]= '\x05'; - row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_MAX_ALLOWED_PACKET].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.max_allowed_packet); row_form_width[i]= '\x05'; + row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_MAX_ALLOWED_PACKET].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.max_allowed_packet_arg); row_form_width[i]= '\x05'; row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_MAX_JOIN_SIZE].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.max_join_size); row_form_width[i]= '\x05'; row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_NAMED_COMMANDS].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.named_commands); row_form_width[i]= '\x05'; - row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_NET_BUFFER_LENGTH].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.net_buffer_length); row_form_width[i]= '\x05'; + row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_NET_BUFFER_LENGTH].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.net_buffer_length_arg); row_form_width[i]= '\x05'; row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_NO_BEEP].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.no_beep); row_form_width[i]= '\x05'; row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_NO_DEFAULTS].chars).toLower(); row_form_type[i]= NUM_FLAG; row_form_is_password[i]= 0; row_form_data[i]= QString::number(ocelot_ca.no_defaults); row_form_width[i]= '\x05'; row_form_label[++i]= QString(strvalues[TOKEN_KEYWORD_OCELOT_DBMS].chars).toLower(); row_form_type[i]= 0; row_form_is_password[i]= 0; row_form_data[i]= ocelot_dbms; row_form_width[i]= '\x09'; @@ -5402,10 +5406,10 @@ void MainWindow::action_file_connect_once(QString message) ocelot_ca.line_numbers= to_long(row_form_data[i++].trimmed()); ocelot_ca.opt_local_infile= to_long(row_form_data[i++].trimmed()); ocelot_login_path= row_form_data[i++].trimmed(); - ocelot_ca.max_allowed_packet= to_long(row_form_data[i++].trimmed()); + ocelot_ca.max_allowed_packet_arg= to_long(row_form_data[i++].trimmed()); ocelot_ca.max_join_size= to_long(row_form_data[i++].trimmed()); ocelot_ca.named_commands= to_long(row_form_data[i++].trimmed()); - ocelot_ca.net_buffer_length= to_long(row_form_data[i++].trimmed()); + ocelot_ca.net_buffer_length_arg= to_long(row_form_data[i++].trimmed()); ocelot_ca.no_beep= to_long(row_form_data[i++].trimmed()); ocelot_ca.no_defaults= to_long(row_form_data[i++].trimmed()); connect_set_variable("ocelot_dbms", "=", row_form_data[i++].trimmed()); @@ -6426,7 +6430,7 @@ void MainWindow::action_help_the_manual(bool is_checked) QString the_text="\

ocelotgui

\
\ -
Version 2.3.0, April 19 2024 \ +
Version 2.4.0, June 4 2024 \
\
\
Copyright (c) 2024 by Peter Gulutzan. All rights reserved. \ @@ -11030,7 +11034,7 @@ int MainWindow::action_execute(int force) /* This makes the menu seem to blink. If that's not OK, turn off sub-items not main menu items. */ /* Todo: maybe other things should be disabled|enabled as we do with is_can_copy. */ QAction *menu_edit_action_copy= menu_spec_find_action("action_edit_copy"); - bool is_can_copy; if (menu_edit_action_copy != NULL) is_can_copy= menu_edit_action_copy->isEnabled(); + bool is_can_copy= false; if (menu_edit_action_copy != NULL) is_can_copy= menu_edit_action_copy->isEnabled(); QMenu *menu_file= menu_spec_find_menu("menu_file"); if (menu_file != NULL) menu_file->setEnabled(false); QMenu *menu_edit= menu_spec_find_menu("menu_edit"); @@ -17057,12 +17061,12 @@ int MainWindow::connect_tarantool(unsigned int connection_number, } { /* Todo: - I was setting TNT_OPT_SEND_BUF and TNT_OPT_RECV_BUF to (char*)ocelot_ca.net_buffer_length in + I was setting TNT_OPT_SEND_BUF and TNT_OPT_RECV_BUF to (char*)ocelot_ca.net_buffer_length_arg in ocelotgui.h. I said third arg is char*, so casting was goofy. The greater problem was that the default on startup is 16384 which is MySQL's default, not Tarantool's. The true solution is to change the default if --ocelot_dbms=tarantool, perhaps. But 0 turns buffering off, and I think that is convenient for sending or receiving images. - Warning: ocelot_ca.net_buffer_length is long. + Warning: ocelot_ca.net_buffer_length_arg is long. */ lmysql->ldbms_tnt_set(tnt[connection_number], TNT_OPT_SEND_BUF, 0); lmysql->ldbms_tnt_set(tnt[connection_number], TNT_OPT_RECV_BUF, 0); @@ -25271,14 +25275,14 @@ void MainWindow::connect_set_variable(QString token0, QString token1, QString to return; } if (keyword_index == TOKEN_KEYWORD_LOGIN_PATH) { ocelot_login_path= token2; return; } - if (keyword_index == TOKEN_KEYWORD_MAX_ALLOWED_PACKET) { ocelot_ca.max_allowed_packet= to_long(token2); return; } + if (keyword_index == TOKEN_KEYWORD_MAX_ALLOWED_PACKET) { ocelot_ca.max_allowed_packet_arg= to_long(token2); return; } if (keyword_index == TOKEN_KEYWORD_MAX_JOIN_SIZE) { ocelot_ca.max_join_size= to_long(token2); return; } if (keyword_index == TOKEN_KEYWORD_NAMED_COMMANDS) { ocelot_ca.named_commands= is_enable; return; } - if (keyword_index == TOKEN_KEYWORD_NET_BUFFER_LENGTH) { ocelot_ca.net_buffer_length= to_long(token2); return; } + if (keyword_index == TOKEN_KEYWORD_NET_BUFFER_LENGTH) { ocelot_ca.net_buffer_length_arg= to_long(token2); return; } if (keyword_index == TOKEN_KEYWORD_NO_AUTO_REHASH) { ocelot_ca.auto_rehash= 0; return; } if (keyword_index == TOKEN_KEYWORD_NO_BEEP) { @@ -42674,11 +42678,9 @@ int Chart::draw_group( } set_chart_width(); - /* Eventually rename numeric_column_count to number_of_columns_in_group */ /* Todo: maybe we can remove this */ int numeric_column_count= (chart_last_column_in_group - chart_first_column_in_group) + 1; - // QString column_value_as_utf8= QString(ocelot_grid_detail_char_column_start, v_length); // double column_value= QString::number(column_value_as_utf8); // printf("**** column_value=%f.\n", column_value); @@ -42766,7 +42768,6 @@ int Chart::draw_group( // } /* Now we have a series. One series entry per sub_group. Each series entry has one or more series_columns. One per column. */ - int max_series_column_count= 0; /* used for line and pie, might be obvious from some already-calculated item though */ for (int i_of_series= 0; i_of_series < series.size(); ++i_of_series) { @@ -42816,7 +42817,6 @@ int Chart::draw_group( QPainter pixmap_painter(&pixmap); pixmap_painter.setFont(chart_default_font); /* todo: a conditional setting might change this */ - /* Now set_chart_rects() might work, since we know series and series_columns. */ // bool is_horizontal= true; @@ -42898,7 +42898,6 @@ int Chart::draw_group( } } vertical_bar_count+= series.size() - 1; - /* So 2 numbers in the row cause 2 adjacent bars */ /* todo: consider looking at CHART_MARGIN_BETWEEN_BARS */ /* BAR, VERTICAL, GROUPED */ @@ -43073,6 +43072,7 @@ int Chart::draw_group( /* Paste the line "point" for each series */ if (chart_type == TOKEN_KEYWORD_LINE) { + if (vertical_bar_count <= 0) vertical_bar_count= 1; /* only one thing in the series? todo: line_width will be 0 too! */ int line_width= chart_canvas_rect.width() / vertical_bar_count; /* !!!! SHOULD BE LINE_WIDTH BUT WAIT TILL WE KNOW LINE_WIDTH !!!! set_chart_rects() is wrong now */ @@ -43083,7 +43083,6 @@ int Chart::draw_group( int line_point_height= 13; /* arbitrary */ QRect qr_of_last[100]; /* todo: dynamic allocation please */ - for (int i_of_series= 0; i_of_series < series.size(); ++i_of_series) { QVector series_columns= series.at(i_of_series); diff --git a/ocelotgui.h b/ocelotgui.h index 5fad73f..137588a 100644 --- a/ocelotgui.h +++ b/ocelotgui.h @@ -4371,10 +4371,10 @@ struct connect_arguments { /* QString login_path */ /* --login_path=s */ unsigned short int log_level; /* --ocelot_log_level */ unsigned short int max_conditions; - unsigned long int max_allowed_packet; /* --max_allowed_packet=n */ + unsigned long int max_allowed_packet_arg; /* --max_allowed_packet=n */ unsigned long int max_join_size; /* --max_join_size = n */ unsigned short named_commands; /* --named_commands */ - unsigned long int net_buffer_length; /* --net_buffer_length=n */ + unsigned long int net_buffer_length_arg; /* --net_buffer_length=n */ unsigned short no_beep; /* --no_beep */ unsigned short no_defaults; /* --no_defaults */ /* QString dbms */ @@ -5228,7 +5228,9 @@ class MainWindow : public QMainWindow void menu_spec_make_function(); void menu_spec_make_menu(); void menu_spec_reset_menu(); int menu_spec_insert_one(QString id, QString menu_name, QString menuitem_name, QString action); QMenu* menu_spec_add_menu(int i); QAction *menu_spec_add_action(int i, QMenu *qmenu); +#if (QT_VERSION >= 0x50000) void menu_about_to_show(); +#endif // void menu_spec_set_addresses(); QMenu* menu_spec_find_menu(QString menu_name); int menu_spec_find_id(QString id); diff --git a/ocelotgui.spec b/ocelotgui.spec index 7da4d42..fe17a40 100644 --- a/ocelotgui.spec +++ b/ocelotgui.spec @@ -1,4 +1,4 @@ -# ocelotgui.spec file for version 2.3.0 supplied by Peter Gulutzan as part of ocelotgui package +# ocelotgui.spec file for version 2.4.0 supplied by Peter Gulutzan as part of ocelotgui package #How to Build an .rpm file #------------------------- @@ -10,29 +10,29 @@ # sudo yum install rpm rpm-build rpmlint # 2. Copy the ocelotgui tar.gz file to your $HOME directory. # It is available on github. You might have downloaded it already. -# For example you might say: wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.3.0/ocelotgui-2.3.0.tar.gz +# For example you might say: wget https://github.com/ocelot-inc/ocelotgui/releases/download/2.4.0/ocelotgui-2.4.0.tar.gz # (For this step, we assume you know where you downloaded to. See later explanation in section "Re: Source".) -# You must copy it to $HOME/ocelotgui-2.3.0.tar.gz -- this is hard coded. -# If CmakeLists.txt was updated since the release, which is true for 2.3.0, Step #2 will not work -- use Step #2a instead. -# 2a. Alternative to step 2: make ocelotgui-2.3.0.tar.gz from a clone of the latest ocelotgui source. +# You must copy it to $HOME/ocelotgui-2.4.0.tar.gz -- this is hard coded. +# If CmakeLists.txt was updated since the release, which is true for 2.4.0, Step #2 will not work -- use Step #2a instead. +# 2a. Alternative to step 2: make ocelotgui-2.4.0.tar.gz from a clone of the latest ocelotgui source. # This is approximately the way that the ocelotgui developer makes new tar.gz files when making new releases. -# To produce $HOME/ocelotgui-2.3.0.tar.gz from the latest github source, say: +# To produce $HOME/ocelotgui-2.4.0.tar.gz from the latest github source, say: # cd /tmp # rm -r -f ocelotgui # git clone https://github.com/ocelot-inc/ocelotgui ocelotgui # rm -r -f ocelotgui/.git -# tar -zcvf $HOME/ocelotgui-2.3.0.tar.gz ocelotgui +# tar -zcvf $HOME/ocelotgui-2.4.0.tar.gz ocelotgui # rm -r -f ocelotgui -# 3. Remake ocelotgui-2.3.0.tar.gz so it will unpack to directory ocelotgui-2.3.0 rather than to ocelotgui. -# This step is necessary because ocelotgui.spec will look for files in ocelotgui-2.3.0. -# To change $HOME/ocelotgui-2.3.0.tar.gz to be ready for rpm, say: +# 3. Remake ocelotgui-2.4.0.tar.gz so it will unpack to directory ocelotgui-2.4.0 rather than to ocelotgui. +# This step is necessary because ocelotgui.spec will look for files in ocelotgui-2.4.0. +# To change $HOME/ocelotgui-2.4.0.tar.gz to be ready for rpm, say: # cd /tmp # rm -r -f ocelotgui -# rm -r -f ocelotgui-2.3.0 -# cp -p $HOME/ocelotgui-2.3.0.tar.gz ocelotgui-2.3.0.tar.gz -# tar -xf ocelotgui-2.3.0.tar.gz -# mv ocelotgui ocelotgui-2.3.0 -# tar -zcvf $HOME/ocelotgui-2.3.0.tar.gz ocelotgui-2.3.0 +# rm -r -f ocelotgui-2.4.0 +# cp -p $HOME/ocelotgui-2.4.0.tar.gz ocelotgui-2.4.0.tar.gz +# tar -xf ocelotgui-2.4.0.tar.gz +# mv ocelotgui ocelotgui-2.4.0 +# tar -zcvf $HOME/ocelotgui-2.4.0.tar.gz ocelotgui-2.4.0 # 4. Copy the ocelotgui.spec file to your $HOME directory. # (For this step, we assume you know where the spec file is. After all, it is what you are reading now.) # You must copy it to $HOME/ocelotgui.spec -- this is hard coded. @@ -43,11 +43,11 @@ # 6. Run rpmbuild using the $HOME/ocelotgui_rpm directory. Notice that we don't bother with an .rpmmacros file. # rpmbuild -ba $HOME/ocelotgui.spec --define "_topdir $HOME/ocelotgui_rpm/rp/rpmbuild" --define "_sourcedir $HOME" # 7. Find the resulting rpm in the RPMS subdirectory and check it. Here we assume the platform is x86-64. -# rpmlint ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.x86_64.rpm +# rpmlint ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.x86_64.rpm # If it says "0 errors, 0 warnings", you're done! # You can copy the .rpm file to a permanent location and remove the ~/ocelotgui_rpm directory. # 8. With the .rpm file you can say -# sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.x86_64.rpm +# sudo rpm -i ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.x86_64.rpm # Of course, the .rpm file name will be different on a 32-bit platform. # Todo: nowadays yum install or dnf install is probably better, we'll say that in the main README. @@ -65,7 +65,7 @@ #Re Source: # The URL here is in fact the source of the ocelotgui release. # However, we commented it out because setup doesn't download it -# and in any case it would unpack to ocelotgui not ocelotgui-2.3.0. +# and in any case it would unpack to ocelotgui not ocelotgui-2.4.0. # The assumption is that Source0: is the file name and the directory # is $HOME and the file needs pre-processing as described above. # Todo: Consider that this is possible: @@ -180,7 +180,7 @@ Summary: GUI client for MySQL or MariaDB Name: ocelotgui -Version: 2.3.0 +Version: 2.4.0 Release: 1 %if %{?suse_version:1}%{!?suse_version:0} @@ -200,8 +200,8 @@ Group: Databases %endif Vendor: Peter Gulutzan Url: http://ocelot.ca -#Source0: ocelotgui-2.3.0.tar.gz -Source: https://github.com/ocelot-inc/%name/releases/download/2.3.0/%name-%{version}.tar.gz +#Source0: ocelotgui-2.4.0.tar.gz +Source: https://github.com/ocelot-inc/%name/releases/download/2.4.0/%name-%{version}.tar.gz %if %{?suse_version:1}%{!?suse_version:0} BuildRequires: libqt5-qttools-devel @@ -316,11 +316,15 @@ cd %{_builddir}/%{name}-%{version}/build %doc special-vertical.png %doc starting-dialog.png %doc starting.png +%doc menunew.png +%doc plugin.c %doc statement-widget-example.png %{_datadir}/applications/ocelotgui.desktop %{_datadir}/pixmaps/ocelotgui-logo.png %changelog +* Tue Jun 04 2024 Peter Gulutzan - 2.4.0-1 + Plugins. * Mon Mar 18 2024 Peter Gulutzan - 2.3.0-1 Make SHOW as good as SELECT. * Thu Feb 15 2024 Peter Gulutzan - 2.2.0-1 diff --git a/rpm_build.sh b/rpm_build.sh index 58d52c0..c807e1b 100755 --- a/rpm_build.sh +++ b/rpm_build.sh @@ -1,15 +1,15 @@ -# rpmbuild.sh -- produce ocelotgui-2.3.0 .rpm from ~/ocelotgui +# rpmbuild.sh -- produce ocelotgui-2.4.0 .rpm from ~/ocelotgui # Peter Gulutzan uses this script to produce a .rpm file from a source directory ~/ocelotgui on Fedora 28. # Only advanced users will want this, ordinary users will download the official-release .rpm file or make with cmake. -# For 2.3.0 32-bit ocelotgui was on Fedora 26 from archives.fedoraproject.org/pub/archive/fedora-secondary/releases/26, with pae. +# For 2.4.0 32-bit ocelotgui was on Fedora 26 from archives.fedoraproject.org/pub/archive/fedora-secondary/releases/26, with pae. # An easy way to get ~/ocelotgui is "cd ~" + "git clone https://github.com/ocelot-inc/ocelotgui ocelotgui". # This script uses /tmp and cheerily deletes existing files in /tmp. # This script uses $HOME and cheerily overwrites $HOME/ocelotgui-$VERSION.tar.gz ocelotgui-$VERSION + $HOME/ocelotgui-$VERSION + $HOME/ocelotgui.spec. # This script uses $HOME/rpm_build and cheerily deletes existing files in $HOME/rpm_build. -# The result will be / ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.x86_64.rpm or ~/ocelotgui_rpm//rp/rpmbuild/RPMS/i686/ocelotgui-2.3.0-1.i686.rpm +# The result will be / ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.x86_64.rpm or ~/ocelotgui_rpm//rp/rpmbuild/RPMS/i686/ocelotgui-2.4.0-1.i686.rpm # See also the comments in ocelotgui.spec. #For SUSE, replace following line with sudo yum install libqt5-qttools-devel @@ -21,7 +21,7 @@ sudo yum install gcc gcc-c++ make cmake sudo yum install sed rpm rpm-build rpmlint desktop-file-utils sudo yum install python -export VERSION=2.3.0 +export VERSION=2.4.0 export SOURCE=$HOME/ocelotgui cd /tmp @@ -118,6 +118,10 @@ cp -p $SOURCE/debian/watch /tmp/ocelotgui-$VERSION/debian/watch cp -p $SOURCE/debian/patches/series /tmp/ocelotgui-$VERSION/debian/patches/series cp -p $SOURCE/debian/source/format /tmp/ocelotgui-$VERSION/debian/source/format cp -p $SOURCE/deb_build.sh /tmp/ocelotgui-$VERSION/deb_build.sh +cp -p $SOURCE/menunew.png /tmp/ocelotgui-$VERSION/menunew.png +cp -p $SOURCE/plugin.c /tmp/ocelotgui-$VERSION/plugin.c + + cd /tmp @@ -129,7 +133,7 @@ cd ~ tar -xf ocelotgui-$VERSION.tar.gz rm -r -f $HOME/ocelotgui_rpm -cp ~/ocelotgui-2.3.0/ocelotgui.spec $HOME/ocelotgui.spec +cp ~/ocelotgui-2.4.0/ocelotgui.spec $HOME/ocelotgui.spec rpmbuild -ba $HOME/ocelotgui.spec --define "_topdir $HOME/ocelotgui_rpm/rp/rpmbuild" --define "_sourcedir $HOME" @@ -137,4 +141,4 @@ rpmbuild -ba $HOME/ocelotgui.spec --define "_topdir $HOME/ocelotgui_rpm/rp/rpmbu # The result of rpmbuild should be ocelotgui_$VERSION-1.x86_64.rpm or ocelotgui_$VERSION-1_i686.rpm if 32-bit # Final lines of output should show: rpmlint says 0 errors, 0 warnings. rpmlint ~/ocelotgui.spec -rpmlint ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.3.0-1.x86_64.rpm +rpmlint ~/ocelotgui_rpm//rp/rpmbuild/RPMS/x86_64/ocelotgui-2.4.0-1.x86_64.rpm diff --git a/rpmchangelog b/rpmchangelog index 4728b07..1ca59c2 100644 --- a/rpmchangelog +++ b/rpmchangelog @@ -1,3 +1,5 @@ +* Tue Jun 04 2024 Peter Gulutzan - 2.4.0-1 +- Plugins * Mon Mar 18 2024 Peter Gulutzan - 2.3.0-1 - Make SHOW as good as SELECT * Thu Feb 15 2024 Peter Gulutzan - 2.2.0-1