diff -Nru boinctui-2.5.0/boinctui.1 boinctui-2.7.0/boinctui.1 --- boinctui-2.5.0/boinctui.1 1970-01-01 00:00:00.000000000 +0000 +++ boinctui-2.7.0/boinctui.1 2022-05-05 18:31:58.000000000 +0000 @@ -0,0 +1,46 @@ +.\" Hey, EMACS: -*- nroff -*- +.TH BOINCTUI 1 "21-JAN-2016" +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +boinctui \- Fullscreen text mode manager for BOINC client +.SH SYNOPSIS +.B boinctui +.SH DESCRIPTION +BOINC can be configured in many ways. And the monitoring of +scientific progress contributed to one's own machines is +rewarding. For remote machines or to avoid moving the hands +of your keyboard, this package provides, all for your UNIX +command line: +.br + * Fullscreen curses based text user interface +.br + * Switch between several BOINC clients hosts via hot key +.br + * View task list (run, queue, suspend e.t.c state) +.br + * View message list +.br + * Suspend/Resume/Abort tasks +.br + * Update/Suspend/Resume/Reset/No New Task/Allow New Task for projects +.br + * Toggle activity state GPU and CPU tasks +.br + * Run benchmarks +.br + * Manage BOINC client on remote hosts via boinc_gui protocol + +.SH SEE ALSO +.BR boinc-manager (1), +.br +https://github.com/suleman1971/boinctui diff -Nru boinctui-2.5.0/changelog boinctui-2.7.0/changelog --- boinctui-2.5.0/changelog 2017-06-26 09:18:43.000000000 +0000 +++ boinctui-2.7.0/changelog 2022-05-05 18:31:58.000000000 +0000 @@ -1,3 +1,33 @@ +boinctui (2.7.0) + + * command line parameters "--boinchost" and "--pwd" + + * fix build with autoconf 2.7.1 + +boinctui (2.6.0) + + * fix scrolling in statistics window and "raw task info" window + + * merged some features from boinctui-extended branch (maintained by Mark Pentler): + transparent background, "receive time" and "swap size" columns in task window, + host's label in task window, etc. + +boinctui (2.5.2) + + * task window scrolling fixed + + * fix build errors with gcc-11.2 + +boinctui (2.5.1) + + * implemented "Project/Add Project by URL" menu item + + * rpm spec file updated + + * fixed some build warnings + + * file gpl-3.0.txt included to source package + boinctui (2.5.0) * implemented Statistics window diff -Nru boinctui-2.5.0/config boinctui-2.7.0/config --- boinctui-2.5.0/config 2017-06-26 09:18:43.000000000 +0000 +++ boinctui-2.7.0/config 2022-05-05 18:31:58.000000000 +0000 @@ -1,5 +1,5 @@ TARGET = boinctui -VERSION = 2.5.0 +VERSION = 2.7.0 #DEFS += -DVERSION=$(VERSION) #DEFS += -DDEBUG DEFS += -DENABLEMOUSE diff -Nru boinctui-2.5.0/configure.in boinctui-2.7.0/configure.in --- boinctui-2.5.0/configure.in 2016-09-10 17:01:45.000000000 +0000 +++ boinctui-2.7.0/configure.in 2022-05-05 18:31:58.000000000 +0000 @@ -60,7 +60,7 @@ # Checks for header files. AC_LANG_PUSH([C++]) -AC_CHECK_HEADERS( \ +AC_CHECK_HEADERS(\ [ \ pthread.h \ string.h stdlib.h stdio.h sys/stat.h unistd.h stdarg.h sys/ioctl.h arpa/inet.h \ @@ -73,12 +73,12 @@ [gnutls], [AS_HELP_STRING([--without-gnutls],[use openssl instead gnutls-openssl])], [ - AC_CHECK_HEADERS( \ + AC_CHECK_HEADERS(\ [ openssl/md5.h ] , , [AC_MSG_ERROR([Couldn't find openssl/md5.h header])] ) ], [ #use gnutls-openssl (default case) - AC_CHECK_HEADERS( \ + AC_CHECK_HEADERS(\ [ gnutls/openssl.h ] , , [AC_MSG_ERROR([Couldn't find gnutls/openssl.h header])] ) ] ) @@ -88,18 +88,18 @@ [AS_HELP_STRING([--without-ncursesw],[use ncurses instead ncursesw])], [ #use old curses - AC_CHECK_HEADERS( \ + AC_CHECK_HEADERS(\ [ curses.h form.h panel.h menu.h] , , [AC_MSG_ERROR([Couldn't find some curses header])] ) ], [ #use ncursesw (default case) - AC_CHECK_HEADERS( \ + AC_CHECK_HEADERS(\ [ ncursesw/curses.h ncursesw/form.h ncursesw/panel.h ncursesw/menu.h] , [ AC_DEFINE(NCURSESW_HAVE_SUBDIR,1) ], #cursesw headers are in default include dir? - AC_CHECK_HEADERS( \ + AC_CHECK_HEADERS(\ [ curses.h form.h panel.h menu.h] , [], [ diff -Nru boinctui-2.5.0/debian/boinctui.1 boinctui-2.7.0/debian/boinctui.1 --- boinctui-2.5.0/debian/boinctui.1 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/debian/boinctui.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.TH BOINCTUI 1 "21-JAN-2016" -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -boinctui \- Fullscreen text mode manager for BOINC client -.SH SYNOPSIS -.B boinctui -.SH DESCRIPTION -BOINC can be configured in many ways. And the monitoring of -scientific progress contributed to one's own machines is -rewarding. For remote machines or to avoid moving the hands -of your keyboard, this package provides, all for your UNIX -command line: -.br - * Fullscreen curses based text user interface -.br - * Switch between several BOINC clients hosts via hot key -.br - * View task list (run, queue, suspend e.t.c state) -.br - * View message list -.br - * Suspend/Resume/Abort tasks -.br - * Update/Suspend/Resume/Reset/No New Task/Allow New Task for projects -.br - * Toggle activity state GPU and CPU tasks -.br - * Run benchmarks -.br - * Manage BOINC client on remote hosts via boinc_gui protocol - -.SH SEE ALSO -.BR boinc-manager (1), -.br -https://github.com/suleman1971/boinctui diff -Nru boinctui-2.5.0/debian/changelog boinctui-2.7.0/debian/changelog --- boinctui-2.5.0/debian/changelog 2017-06-22 09:57:19.000000000 +0000 +++ boinctui-2.7.0/debian/changelog 2022-05-05 18:31:58.000000000 +0000 @@ -1,3 +1,51 @@ +boinctui (2.7.0-0~202205051521~ubuntu18.04.1) bionic; urgency=low + + * Auto build. + + -- Gianfranco Costamagna Thu, 05 May 2022 18:31:58 +0000 + +boinctui (2.7.0-1) unstable; urgency=low + + * command line parameters "--boinchost" and "--pwd" + + * fix build with autoconf 2.7.1 + + -- Sergey Suslov Thu, 05 May 2022 17:00:00 +0300 + + +boinctui (2.6.0-1) unstable; urgency=low + + * fix scrolling in statistics window and "raw task info" window + + * merged some features from boinctui-extended branch (maintained by Mark Pentler): + transparent background, "receive time" and "swap size" columns in task window, + host's label in task window, etc. + + -- Sergey Suslov Sat, 19 Nov 2021 16:00:00 +0300 + + +boinctui (2.5.2-1) unstable; urgency=low + + * task window scrolling fixed (Closes: #997151) + + * fix build errors with gcc-11.2 + + -- Sergey Suslov Thu, 04 Nov 2021 08:44:55 +0300 + + +boinctui (2.5.1-1) unstable; urgency=low + + * implemented "Project/Add Project by URL" menu item + + * rpm spec file updated + + * fixed some build warnings + + * file gpl-3.0.txt included to source package + + -- Sergey Suslov Wed, 02 Sep 2020 17:31:00 +0300 + + boinctui (2.5.0-1) unstable; urgency=low * implemented Statistics window @@ -123,10 +171,10 @@ * scrollable widgets has scrollbars now - * optional ASCII line drawing mode (useful for wrong terminals + * optional ASCII line drawing mode (useful for wrong terminals like putty etc.) - * message "unauthorize" add to caption then authorization failed + * message "unauthorize" add to caption then authorization failed on boinc-client * bugfix: last item of long menu has incomplet submenu @@ -140,10 +188,10 @@ * implemented detail task raw info window - * network requests moved to separete threads (ui not freeze then + * network requests moved to separete threads (ui not freeze then network hang) - * confirmation dialogs for some operations (abort task, detach + * confirmation dialogs for some operations (abort task, detach project etc.) * "Projects" menu restructured @@ -167,7 +215,7 @@ * added watch file - * provided man page as debian/boinctui.1 + * provided man page as debian/boinctui.1 and removed respective lintian override * changelog: closing ITP with 'initial release' notion, @@ -175,7 +223,7 @@ [ Sergey Suslov ] - * bugfix: double free memory (potential crash after edit host + * bugfix: double free memory (potential crash after edit host list via Config form) * "Sort by deadline" was added into View menu diff -Nru boinctui-2.5.0/debian/compat boinctui-2.7.0/debian/compat --- boinctui-2.5.0/debian/compat 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru boinctui-2.5.0/debian/control boinctui-2.7.0/debian/control --- boinctui-2.5.0/debian/control 2016-09-07 09:18:08.000000000 +0000 +++ boinctui-2.7.0/debian/control 2022-05-05 18:31:58.000000000 +0000 @@ -2,12 +2,13 @@ Section: net Priority: optional Maintainer: Sergey Suslov -Build-Depends: autoconf, debhelper (>= 9), autotools-dev, +Build-Depends: autoconf, debhelper (>= 9), debhelper-compat (= 11), libncursesw5-dev, libgnutls-openssl-dev, libexpat1-dev -Standards-Version: 3.9.8 +Standards-Version: 4.5.0 Vcs-Git: https://github.com/suleman1971/boinctui.git Vcs-Browser: https://github.com/suleman1971/boinctui Homepage: https://github.com/suleman1971/boinctui +Rules-Requires-Root: no Package: boinctui Architecture: any @@ -15,8 +16,8 @@ Suggests: boinc-client Description: Fullscreen text mode manager for Boinc client boinctui is a fullscreen text mode control tool for BOINC client - It can manage local and remote clients (via boinc RPC), and allows - you to switch between clients with a hot key. + It can manage local and remote clients (via boinc RPC), and allows + you to switch between clients with a hot key. boinctui uses curses library and provides the following features: * Fullscreen curses based text user interface * Switch between several BOINC clients hosts via hot key @@ -26,4 +27,4 @@ * Update/Suspend/Resume/Reset/No New Task/Allow New Task for projects * Toggle activity state GPU and CPU tasks * Run benchmarks - * Manage BOINC client on remote hosts via boinc_gui protocol + * Manage BOINC client on remote hosts via boinc_gui protocol diff -Nru boinctui-2.5.0/debian/copyright boinctui-2.7.0/debian/copyright --- boinctui-2.5.0/debian/copyright 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/debian/copyright 2022-05-05 18:31:58.000000000 +0000 @@ -1,5 +1,6 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: boinctui +Upstream-Contact: suleman1971@gmail.com Source: https://github.com/suleman1971/boinctui.git Files: * diff -Nru boinctui-2.5.0/debian/git-build-recipe.manifest boinctui-2.7.0/debian/git-build-recipe.manifest --- boinctui-2.5.0/debian/git-build-recipe.manifest 1970-01-01 00:00:00.000000000 +0000 +++ boinctui-2.7.0/debian/git-build-recipe.manifest 2022-05-05 18:31:58.000000000 +0000 @@ -0,0 +1,2 @@ +# git-build-recipe format 0.4 deb-version {debupstream}-0~202205051521 +lp:boinctui git-commit:35d0ddc601df12b09632c5cd7bf31c8b8db6649f diff -Nru boinctui-2.5.0/debian/manpages boinctui-2.7.0/debian/manpages --- boinctui-2.5.0/debian/manpages 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/debian/manpages 2022-05-05 18:31:58.000000000 +0000 @@ -1 +1 @@ -debian/boinctui.1 +boinctui.1 diff -Nru boinctui-2.5.0/debian/rules boinctui-2.7.0/debian/rules --- boinctui-2.5.0/debian/rules 2016-07-29 10:26:36.000000000 +0000 +++ boinctui-2.7.0/debian/rules 2022-05-05 18:31:58.000000000 +0000 @@ -7,7 +7,7 @@ # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +export DH_VERBOSE=1 ### export DEB_BUILD_HARDENING=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all @@ -36,6 +36,8 @@ $(TARGET)-$(VERSION)/Makefile.in \ $(TARGET)-$(VERSION)/configure.in \ $(TARGET)-$(VERSION)/changelog \ + $(TARGET)-$(VERSION)/gpl-3.0.txt \ + $(TARGET)-$(VERSION)/boinctui.1 \ $(TARGET)-$(VERSION)/config ; cd $(TARGET)-$(VERSION) diff -Nru boinctui-2.5.0/debian/source/format boinctui-2.7.0/debian/source/format --- boinctui-2.5.0/debian/source/format 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/debian/source/format 2022-05-05 18:31:58.000000000 +0000 @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff -Nru boinctui-2.5.0/debian/upstream/metadata boinctui-2.7.0/debian/upstream/metadata --- boinctui-2.5.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ boinctui-2.7.0/debian/upstream/metadata 2022-05-05 18:31:58.000000000 +0000 @@ -0,0 +1,4 @@ +Bug-Database: https://github.com/suleman1971/boinctui/issues +Bug-Submit: https://github.com/suleman1971/boinctui/issues/new +Repository: https://github.com/suleman1971/boinctui.git +Repository-Browse: https://github.com/suleman1971/boinctui diff -Nru boinctui-2.5.0/debian/upstream/signing-key.asc boinctui-2.7.0/debian/upstream/signing-key.asc --- boinctui-2.5.0/debian/upstream/signing-key.asc 2016-06-02 13:32:50.000000000 +0000 +++ boinctui-2.7.0/debian/upstream/signing-key.asc 2022-05-05 18:31:58.000000000 +0000 @@ -1,5 +1,4 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 mQINBFDr7R4BEADYqNcFAMAKmbP/KPFLVRd0Z1vGHdB2eEvzdPUSXZZkTrP942lp HkYBjKvB64eqADBDODHL8GLpNTFl5lqnZ5hoitN6+PPXEjhJgYr7WXXF7L6fmZhx @@ -24,36 +23,29 @@ K5ramYOSDjzqD2kO+6LwJG0T96ADHGomRbsASuVNcVYgkQOOpV3X+jcezDeK93WC nIpWOP4YrMQdzb+kdj2iCVbT9QWvRwtPmWlSZJ4IwNJzHm1gODKL6h3J2czH/91d 7Whzf/mFEr1P1D9MXj+rj7SZaqh2ZwUmq9WoFDBOozqRS4i+DmrWUKSUY5ibuCzB -bQniKpIuY7ta9KdaTo3wLgWqk4d4OZtBQvxHQtjyupA7t4hGBBARAgAGBQJRK0MK -AAoJEL98eTrJEy3biycAn0vWff9gHlxYDoDnIgUTfmpOzERAAJ4gNKBKxESDlIQ8 -jHLkjDGPtBGd34kBHAQTAQgABgUCUSz+qgAKCRDKh+noKqwz8RNRB/41tir0KKr2 -DF0rv40UR3alkt2jT+z3SwsMJpSr15QRFgShY6nF9ND/8TlF9bdsORoRBoBuH/5Q -sknczec7m88uzlxWt4W5DJ3/u9xxgSePLd7SdsdcSDf+9/zf27MuPPWyMeolQnGv -0Vf9LkVAqoXEuYxma7v8gc3zFGo8yTSDwJGKwNs2amFgP/7eNg8Yu+NBY74VM3m8 -jVUosdQjUfO74l9JHWkP825SRFeM2HDv3MOPS38LjaX/gIJbjhbmaoFYmQ/+2RgI -DNVeGPVB+5dyVitB9SSZdQ4UkI9pLrqB+eBsm0cemmi42Y3oWoU2Tx2a7EaF6DJb -kUzip4mugRKnuQINBFDr7R4BEADCSE04VVy6BMrGZdBHBRbqa64+/UfmYylhYNIh -y5M7+4xN1mWPDv2N5c9BCKa6FtFeHQGMTsBb6fm8BKUL4/3EsL/6rSzd1ZQtbj4+ -NJimUEIzYoqVx/gkg7dM/abYLiT+SsRqz1MIGz38oFj/e5LkbS5lc/tk3z9pLS1A -Xb5YgOtHvcr91tXh3Vc9Ec4UxRFlwPNUtkdk3ZNFOA3bzQjtteEkbluOSQ1Iwhp2 -U8b5x1T49wTWU1K5al4t0KEuIfjkPCK8RF+L1uEvCZd3yK/mYsqLbkTnsGFwWC6E -lkC2knT4ht7i6S79LSdUiRp50EWlTINQIo0HwCVNgbWc99z7pZm4/5QWUo+GCJ4g -sSknt3p2QOZ9sHQbq7XWqf+1kvhUnEB2QrQzjwhxwSGoFi4grSArLizYNRSK5pkg -OjUXYEgd0UcEC+vLhg4FZCnUKMBR6UUevojb+YEzmAD66cgL/RsPzmK7I85/Fp4v -r36vjuoZzJgkx+Bqm3O6yK5XGqVSnIyGmf56snZ0ijyevK0kr3yVmuoBm96IBxuX -J3MZmGaNgy6B4G9i0RZlBmlGX39ijuTiW5vnGTUtidyUS7CuxwkqLLiAp13oLEsW -CVObjW48Bfk4W7JF/qCZSo04DeWdBXb9Hw3wFLrl/8ENgTwe6XfKepZ7wO37qO0I -VLWD8wARAQABiQIfBBgBAgAJBQJQ6+0eAhsMAAoJEICHjlmDK+wVuGEP/iXlUG0d -yuvdbdj2j46j4EdHVHk3DwbVTcxm9W8nMFjHTD4Jll6sZQGxYYSIonFsw/Ia3oRh -drEhPP2950TfagMo30lbJm3odSZ/Fojjwt992UZUj/99oa/JhBNRS8mihzjQuzln -uboPA9mmkd6Rfhyjsl/cO78no03t6DFXU4PFabX9SNadMMeUVJ0IikpP3WQDUdAh -ivUKe8JFsCyqA88GFSEtEPbV1mCGXLrXW+QpEYB3lVvu6Jy3aoT9V7HC5YXp+4xP -BNJd5vuSSkZBiQhLgAnjs2+Mna7RJHG64ARKQC7vKGh2o72y8n+frJ9zJvIo+v/k -bGgqjWG8dTRDtWno7t0eBZZAIpJ1VLHX29fFMsD2ojLB+rzQXvG6dMuSa3ctiyqZ -Y7cKB8h9j2elmU2v9QG9vJdiXdGeZ0ndgoRdX0J9unyQofniEWENTiVtSIy5IEmF -cYe/AkWDd/vC2Xuh8rUOmNHhZnx4IBVbiFKrQXv7JIxRXdfd3HHxSc6XP8UZ7SEL -UnXishqfL2NTCD2+4DR1XAFLYo8JcguOLsv7xK6d4lvDUTytaOcjKnIZQXfmsYc/ -zhONtQ228EZNuVGYJm7WwgBTVJJkn672sb1zXyQd8zjdHGe+9ganFzeL+Ct2VrD5 -7xTPQuirlS0AsZ89raPMOafihRsJuz5t9k0x -=9bqW +bQniKpIuY7ta9KdaTo3wLgWqk4d4OZtBQvxHQtjyupA7t7kCDQRQ6+0eARAAwkhN +OFVcugTKxmXQRwUW6muuPv1H5mMpYWDSIcuTO/uMTdZljw79jeXPQQimuhbRXh0B +jE7AW+n5vASlC+P9xLC/+q0s3dWULW4+PjSYplBCM2KKlcf4JIO3TP2m2C4k/krE +as9TCBs9/KBY/3uS5G0uZXP7ZN8/aS0tQF2+WIDrR73K/dbV4d1XPRHOFMURZcDz +VLZHZN2TRTgN280I7bXhJG5bjkkNSMIadlPG+cdU+PcE1lNSuWpeLdChLiH45Dwi +vERfi9bhLwmXd8iv5mLKi25E57BhcFguhJZAtpJ0+Ibe4uku/S0nVIkaedBFpUyD +UCKNB8AlTYG1nPfc+6WZuP+UFlKPhgieILEpJ7d6dkDmfbB0G6u11qn/tZL4VJxA +dkK0M48IccEhqBYuIK0gKy4s2DUUiuaZIDo1F2BIHdFHBAvry4YOBWQp1CjAUelF +Hr6I2/mBM5gA+unIC/0bD85iuyPOfxaeL69+r47qGcyYJMfgaptzusiuVxqlUpyM +hpn+erJ2dIo8nrytJK98lZrqAZveiAcblydzGZhmjYMugeBvYtEWZQZpRl9/Yo7k +4lub5xk1LYnclEuwrscJKiy4gKdd6CxLFglTm41uPAX5OFuyRf6gmUqNOA3lnQV2 +/R8N8BS65f/BDYE8Hul3ynqWe8Dt+6jtCFS1g/MAEQEAAYkCHwQYAQIACQUCUOvt +HgIbDAAKCRCAh45ZgyvsFbhhD/4l5VBtHcrr3W3Y9o+Oo+BHR1R5Nw8G1U3MZvVv +JzBYx0w+CZZerGUBsWGEiKJxbMPyGt6EYXaxITz9vedE32oDKN9JWyZt6HUmfxaI +48LffdlGVI//faGvyYQTUUvJooc40Ls5Z7m6DwPZppHekX4co7Jf3Du/J6NN7egx +V1ODxWm1/UjWnTDHlFSdCIpKT91kA1HQIYr1CnvCRbAsqgPPBhUhLRD21dZghly6 +11vkKRGAd5Vb7uict2qE/VexwuWF6fuMTwTSXeb7kkpGQYkIS4AJ47NvjJ2u0SRx +uuAESkAu7yhodqO9svJ/n6yfcybyKPr/5GxoKo1hvHU0Q7Vp6O7dHgWWQCKSdVSx +19vXxTLA9qIywfq80F7xunTLkmt3LYsqmWO3CgfIfY9npZlNr/UBvbyXYl3RnmdJ +3YKEXV9Cfbp8kKH54hFhDU4lbUiMuSBJhXGHvwJFg3f7wtl7ofK1DpjR4WZ8eCAV +W4hSq0F7+ySMUV3X3dxx8UnOlz/FGe0hC1J14rIany9jUwg9vuA0dVwBS2KPCXIL +ji7L+8SuneJbw1E8rWjnIypyGUF35rGHP84TjbUNtvBGTblRmCZu1sIAU1SSZJ+u +9rG9c18kHfM43RxnvvYGpxc3i/grdlaw+e8Uz0Loq5UtALGfPa2jzDmn4oUbCbs+ +bfZNMQ== +=CwDK -----END PGP PUBLIC KEY BLOCK----- diff -Nru boinctui-2.5.0/gpl-3.0.txt boinctui-2.7.0/gpl-3.0.txt --- boinctui-2.5.0/gpl-3.0.txt 1970-01-01 00:00:00.000000000 +0000 +++ boinctui-2.7.0/gpl-3.0.txt 2022-05-05 18:31:58.000000000 +0000 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff -Nru boinctui-2.5.0/Makefile.in boinctui-2.7.0/Makefile.in --- boinctui-2.5.0/Makefile.in 2017-06-26 09:18:43.000000000 +0000 +++ boinctui-2.7.0/Makefile.in 2022-05-05 18:31:58.000000000 +0000 @@ -44,7 +44,7 @@ clean: rm -f $(ODIR)/*.o $(PACKAGE_TARNAME) config.log -install: +install: installman $(INSTALL_PROGRAM) -d $(DESTDIR)$(BINDIR) $(INSTALL_PROGRAM) $(PACKAGE_TARNAME) $(DESTDIR)$(BINDIR) $(INSTALL_PROGRAM) -d $(DESTDIR)$(DOCDIR) @@ -53,6 +53,11 @@ createobj: @if ! [ -d "$(ODIR)" ] ; then echo "create $(ODIR)"; mkdir $(ODIR); fi +installman: + @echo "install man (boinctui.1) to " $(DESTDIR)@mandir@/man1 " directory" + mkdir -p $(DESTDIR)@mandir@/man1 + install -m 0644 boinctui.1 $(DESTDIR)@mandir@/man1 + #srctgz: clean # @if ! [ -d "../$(PACKAGE_TARNAME)-$(VERSION)" ] ; then echo "create symlink ../$(PACKAGE_TARNAME)-$(VERSION)->$(notdir $(CURDIR))"; ln -n -s $(notdir $(CURDIR)) ../$(PACKAGE_TARNAME)-$(VERSION); fi # cd ..; tar --exclude-vcs -vzcf $(PACKAGE_TARNAME)_$(VERSION).orig.tar.gz \ @@ -60,4 +65,7 @@ # $(PACKAGE_TARNAME)-$(VERSION)/redhat \ # $(PACKAGE_TARNAME)-$(VERSION)/Makefile.in \ # $(PACKAGE_TARNAME)-$(VERSION)/configure.in \ -# $(PACKAGE_TARNAME)-$(VERSION)/config +# $(PACKAGE_TARNAME)-$(VERSION)/config \ +# $(PACKAGE_TARNAME)-$(VERSION)/debian \ +# $(PACKAGE_TARNAME)-$(VERSION)/changelog \ +# $(PACKAGE_TARNAME)-$(VERSION)/gpl-3.0.txt diff -Nru boinctui-2.5.0/redhat/boinctui.spec boinctui-2.7.0/redhat/boinctui.spec --- boinctui-2.5.0/redhat/boinctui.spec 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/redhat/boinctui.spec 2022-05-05 18:31:58.000000000 +0000 @@ -1,35 +1,92 @@ -Name: boinctui -Version: 2.2.1 -Release: 0%{?dist} -Summary: curses based manager for Boinc client -Group: Applications/Communications -License: GPL-3.0+ -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -#Source0: boinctui-%{version}.tgz -Source0: boinctui-%{version}.tar.gz - -BuildRequires: autoconf ncurses-devel expat-devel openssl-devel -#Requires: libcurses libexpat +# Generate RPM using: +# $ cd ~ +# $ rpmdev-setuptree +# $ git clone https://github.com/suleman1971/boinctui +# $ patch -p0 < boinctui-makefile.patch +# $ cd boinctui +# $ autoconf +# $ ./configure --without-gnutls +# $ make srctgz +# $ cd .. +# $ mv boinctui_2.6.0.orig.tar.gz rpmbuild/SOURCES/ +# $ rm -rf boinctui* +# $ cd rpmbuild/SPECS +# $ rpmbuild -bb boinctui.spec +# $ ls ../RPMS/ + +Name: boinctui +Version: 2.6.0 +Release: 1%{?dist} +Summary: Fullscreen Text Mode Manager For BOINC Client +Group: Applications/Communications + +License: GPLv3+ +URL: https://github.com/suleman1971/boinctui +# Source0: http://download.sourceforge.net/project/boinctui/boinctui_%{version}.tar.gz +Source0: ../boinctui_%{version}.tar.gz + +BuildRequires: autoconf +BuildRequires: gcc +BuildRequires: ncurses-devel +BuildRequires: expat-devel +BuildRequires: openssl-devel +BuildRequires: gcc-c++ +Requires: ncurses +Requires: expat +Requires: openssl %description -boinctui is a fullscreen text based control tool for BOINC client. -based on curses library + boinctui is a fullscreen text mode control tool for BOINC client + It can manage local and remote clients (via boinc RPC), and allows + you to switch between clients with a hot key. + boinctui uses curses library and provides the following features: + * Fullscreen curses based text user interface + * Switch between several BOINC clients hosts via hot key + * View task list (run, queue, suspend e.t.c state) + * View message list + * Suspend/Resume/Abort tasks + * Update/Suspend/Resume/Reset/No New Task/Allow New Task for projects + * Toggle activity state GPU and CPU tasks + * Run benchmarks + * Manage BOINC client on remote hosts via boinc_gui protocol %prep -#echo ----- %{SOURCE0} -#cp %{SOURCE0} %{buildroot} -#%setup -q -n %{name} + %setup -q -n %{name}-%{version} %build -autoconf -./configure --without-gnutls -make clean -make +%__autoconf +%configure --without-gnutls +make %{?_smp_mflags} +%make_build + %install -make DESTDIR=%{buildroot} install +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +#install -m 0644 debian/%{name}.1 %{buildroot}%{_mandir}/man1/ +#gzip %{buildroot}%{_mandir}/man1/%{name}.1 +%make_install + + +%clean +rm -rf %{buildroot} + %files -%{_bindir}/%{name} +%attr(-, root, root) %{_bindir}/%{name} +%attr(-, root, root) %{_mandir}/man1/%{name}.1.gz +%attr(0644, root, root) %{_docdir}/%{name}/changelog + +#%doc changelog + + + +%license gpl-3.0.txt + + +%changelog +* Mon Aug 05 2019 Timothy Mullican 2.5.0-1 +- Generate new RPM SPEC file to conform with best practices +* Tue Feb 12 2013 Sergey Suslov 2.2.1-0 +- Initial version of the package diff -Nru boinctui-2.5.0/src/about.cpp boinctui-2.7.0/src/about.cpp --- boinctui-2.5.0/src/about.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/about.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -18,28 +18,27 @@ #include #include "about.h" #include "tuievent.h" - -//стрингификатор -#define XSTR(S) STR(S) -#define STR(S) #S +#include "commondef.h" AboutWin::AboutWin(int rows, int cols) : NGroup(NRect(rows, cols, getmaxy(stdscr)/2-rows/2,getmaxx(stdscr)/2-cols/2)) { modalflag = true; caption = strdup(" BOINCTUI "); - resize(10,getwidth()); - wattrset(win,getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD); + resize(12,getwidth()); + wattrset(win,getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD); if(asciilinedraw == 1) wborder(win, '|', '|', '-', '-', '+', '+', '+', '+'); else box(win,0,0); - mvwprintw(win,0,getwidth()/2-(strlen(caption)/2),caption); + mvwprintw(win,0,getwidth()/2-(strlen(caption)/2),"%s",caption); char buf[1024]; snprintf(buf,sizeof(buf),"%s ver %s","BOINC Client manager", XSTR(VERSION)); - mvwprintw(win,3,getwidth()/2-(strlen(buf)/2),buf); + mvwprintw(win,3,getwidth()/2-(strlen(buf)/2),"%s",buf); mvwprintw(win,5,getwidth()/2-(strlen("(c) Sergey Suslov")/2),"(c) Sergey Suslov"); mvwprintw(win,6,getwidth()/2-(strlen("suleman1971@gmail.com")/2),"suleman1971@gmail.com"); + mvwprintw(win,7,getwidth()/2-(strlen("Community PRs included by")/2),"Community PRs included by"); + mvwprintw(win,8,getwidth()/2-(strlen("Mark Pentler - GitHub: mpentler")/2),"Mark Pentler - GitHub: mpentler"); } diff -Nru boinctui-2.5.0/src/addmgrform.cpp boinctui-2.7.0/src/addmgrform.cpp --- boinctui-2.5.0/src/addmgrform.cpp 2017-06-26 09:18:43.000000000 +0000 +++ boinctui-2.7.0/src/addmgrform.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -56,7 +56,7 @@ //сообщение об ошибке errmsgfield = getfieldcount(); f = addfield(new_field(1, getwidth()-2, line++, 0, 0, 0)); - set_field_buffer(f, 0, "Errr"); + set_field_buffer(f, 0, "Error"); set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_RED) | A_BOLD); field_opts_off(f, O_ACTIVE); //статический текст field_opts_off(f, O_VISIBLE); //по умолчанию невидима @@ -94,7 +94,7 @@ //имя менеджера f = addfield(new_field(1, getwidth()-4, line, 2, 0, 0)); set_field_buffer(f, 0, "Description "); - set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); field_opts_off(f, O_ACTIVE); //статический текст namefield = getfieldcount(); f = addfield(new_field(1, 40, line++, 15, 0, 0)); @@ -118,7 +118,7 @@ line++; f = addfield(new_field(1, getwidth()-4, line, 2, 0, 0)); set_field_buffer(f, 0, "URL "); - set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); field_opts_off(f, O_ACTIVE); //статический текст urlfield = getfieldcount(); f = addfield(new_field(1, 40, line++, 15, 0, 0)); @@ -137,14 +137,14 @@ f = addfield(new_field(3, getwidth()-4, line++, 2, 0, 0)); set_field_buffer(f, 0, "If you have not yet registered with this account manager" \ " please do so before proceeding."); - set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); field_opts_off(f, O_ACTIVE); //статический текст line = line + 2; //user name line++; f = addfield(new_field(1, 10, line, 2 , 0, 0)); set_field_buffer(f, 0, "username"); - set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); field_opts_off(f, O_ACTIVE); //статический текст usernamefield = getfieldcount(); f = addfield(new_field(1, 40, line++, 15, 0, 0)); @@ -154,7 +154,7 @@ line++; f = addfield(new_field(1, 10, line, 2 , 0, 0)); set_field_buffer(f, 0, "password"); - set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); field_opts_off(f, O_ACTIVE); //статический текст passwfield = getfieldcount(); f = addfield(new_field(1, 40, line++, 15, 0, 0)); @@ -164,7 +164,7 @@ line++; f = addfield(new_field(1, getwidth()-25, line++, 20 , 0, 0)); set_field_buffer(f, 0, "Enter-Ok Esc-Cancel"); - set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); field_opts_off(f, O_ACTIVE); //статический текст //финализация списка полей addfield(NULL); @@ -175,7 +175,7 @@ { if ( ev->done ) return; - NMouseEvent* mevent = (NMouseEvent*)ev; + //NMouseEvent* mevent = (NMouseEvent*)ev; if ( ev->type == NEvent::evMOUSE) { NForm::eventhandle(ev); //предок diff -Nru boinctui-2.5.0/src/addprojectform.cpp boinctui-2.7.0/src/addprojectform.cpp --- boinctui-2.5.0/src/addprojectform.cpp 2016-09-12 18:09:40.000000000 +0000 +++ boinctui-2.7.0/src/addprojectform.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -46,12 +46,13 @@ } -AddProjectForm::AddProjectForm(int rows, int cols, Srv* srv, const char* projname, bool userexist) : NForm(rows,cols) +AddProjectForm::AddProjectForm(int rows, int cols, Srv* srv, const char* projname, bool userexist, bool byurl) : NForm(rows,cols) { this->srv = srv; settitle(projname); this->projname = projname; this->userexist = userexist; + this->byurl = byurl; Item* project = NULL; if (srv !=NULL) project = srv->findprojectbynamefromall(projname); @@ -63,7 +64,7 @@ } catch(const char* err) { - kLogPrintf("ERROR EXCAPTION %s\n",err); + kLogPrintf("ERROR EXCEPTION %s\n",err); } //пересчитываем высоту формы, чтобы влезли все поля и центрируем int r,c =0; @@ -79,124 +80,147 @@ { FIELD* f; delfields(); - if (project != NULL) - { //сообщение об ошибке errmsgfield = getfieldcount(); f = addfield(new_field(1, getwidth()-2, line++, 0, 0, 0)); if (!f) - ERROREX(); - if (E_OK != set_field_buffer(f, 0, "Errr")) - ERROREX(); + ERROREX(); + if (E_OK != set_field_buffer(f, 0, "Error")) + ERROREX(); if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_RED) | A_BOLD)) - ERROREX(); + ERROREX(); if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст - ERROREX(); + ERROREX(); if (E_OK != field_opts_off(f, O_VISIBLE)) //по умолчанию невидима - ERROREX(); - //url - Item* url = project->findItem("url"); - std::string s = "url : "; - if (url !=NULL) - projurl = url->getsvalue(); - s = s + projurl; - f = addfield(new_field(1, getwidth()-4, line++, 1, 0, 0)); - if (E_OK != set_field_buffer(f, 0, s.c_str())) - ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) - ERROREX(); - if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст - ERROREX(); - //area - Item* general_area = project->findItem("general_area"); - s = "General area : "; - if (general_area !=NULL) - s = s + general_area->getsvalue(); - f = addfield(new_field(1, getwidth()-4, line++, 1, 0, 0)); - if (!f) - ERROREX(); - if (E_OK != set_field_buffer(f, 0, s.c_str())) - ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) - ERROREX(); - if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст - ERROREX(); - //specific area - Item* specific_area = project->findItem("specific_area"); - s = "Specific area: "; - if (specific_area !=NULL) - s = s + specific_area->getsvalue(); - f = addfield(new_field(1, getwidth()-4, line++, 1, 0, 0)); - if (!f) - ERROREX(); - if (E_OK != set_field_buffer(f, 0, s.c_str())) - ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) - ERROREX(); - if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст - ERROREX(); - //home - s = "Home : "; - Item* home = project->findItem("home"); - if (home !=NULL) - s = s + home->getsvalue(); - f = addfield(new_field(1, getwidth()-4, line++, 1, 0, 0)); - if (!f) - ERROREX(); - if (E_OK != set_field_buffer(f, 0, s.c_str())) - ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) - ERROREX(); - if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст - ERROREX(); - //description - s = "Description : "; - line++; - Item* description = project->findItem("description"); - if (description !=NULL) - s = s + description->getsvalue(); - int h = s.size()/(getwidth() - 4) + 1; - if (h > 4) - h = 4; - f = addfield(new_field(h, getwidth()-4, line, 1, 0, 0)); - if (!f) - ERROREX(); - if (E_OK != set_field_buffer(f, 0, s.c_str())) - ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) - ERROREX(); - if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст - ERROREX(); - line += h+1; - //platforms - Item* platforms = project->findItem("platforms"); - s = "Platforms : "; - if (platforms !=NULL) + ERROREX(); + if (project != NULL) + { + //url + Item* url = project->findItem("url"); + std::string s = "url : "; + if (url !=NULL) + projurl = url->getsvalue(); + s = s + projurl; + f = addfield(new_field(1, getwidth()-4, line++, 1, 0, 0)); + if (E_OK != set_field_buffer(f, 0, s.c_str())) + ERROREX(); + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) + ERROREX(); + if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст + ERROREX(); + //area + Item* general_area = project->findItem("general_area"); + s = "General area : "; + if (general_area !=NULL) + s = s + general_area->getsvalue(); + f = addfield(new_field(1, getwidth()-4, line++, 1, 0, 0)); + if (!f) + ERROREX(); + if (E_OK != set_field_buffer(f, 0, s.c_str())) + ERROREX(); + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) + ERROREX(); + if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст + ERROREX(); + //specific area + Item* specific_area = project->findItem("specific_area"); + s = "Specific area: "; + if (specific_area !=NULL) + s = s + specific_area->getsvalue(); + f = addfield(new_field(1, getwidth()-4, line++, 1, 0, 0)); + if (!f) + ERROREX(); + if (E_OK != set_field_buffer(f, 0, s.c_str())) + ERROREX(); + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) + ERROREX(); + if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст + ERROREX(); + //home + s = "Home : "; + Item* home = project->findItem("home"); + if (home !=NULL) + s = s + home->getsvalue(); + f = addfield(new_field(1, getwidth()-4, line++, 1, 0, 0)); + if (!f) + ERROREX(); + if (E_OK != set_field_buffer(f, 0, s.c_str())) + ERROREX(); + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) + ERROREX(); + if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст + ERROREX(); + //description + s = "Description : "; + line++; + Item* description = project->findItem("description"); + if (description !=NULL) + s = s + description->getsvalue(); + int h = s.size()/(getwidth() - 4) + 1; + if (h > 4) + h = 4; + f = addfield(new_field(h, getwidth()-4, line, 1, 0, 0)); + if (!f) + ERROREX(); + if (E_OK != set_field_buffer(f, 0, s.c_str())) + ERROREX(); + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) + ERROREX(); + if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст + ERROREX(); + line += h+1; + //platforms + Item* platforms = project->findItem("platforms"); + s = "Platforms : "; + if (platforms !=NULL) + { + std::vector namelist = platforms->getItems("name"); //список названий платформ + std::vector::iterator it; + for (it = namelist.begin(); it!=namelist.end(); it++) + { + Item* name = (*it)->findItem("name"); + if (it != namelist.begin()) + s = s + ','; + s = s + name->getsvalue(); + } + } + h = s.size()/(getwidth() - 4) + 1; + if (h > 5) + h = 5; + f = addfield(new_field(h, getwidth()-4, ++line, 1, 0, 0)); + if (!f) + ERROREX(); + if (E_OK != set_field_buffer(f, 0, s.c_str())) + ERROREX(); + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) + ERROREX(); + if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст + ERROREX(); + line += h + 1; + } + + //project URL + if (byurl) { - std::vector namelist = platforms->getItems("name"); //список названий платформ - std::vector::iterator it; - for (it = namelist.begin(); it!=namelist.end(); it++) - { - Item* name = (*it)->findItem("name"); - if (it != namelist.begin()) - s = s + ','; - s = s + name->getsvalue(); - } + line++; + f = addfield(new_field(1, 10, line, 1 , 0, 0)); + if (!f) + ERROREX(); + if (E_OK != set_field_buffer(f, 0, "ProjectURL")) + ERROREX(); + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) + ERROREX(); + if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст + ERROREX(); + projurlfield = getfieldcount(); + f = addfield(new_field(1, 40, line++, 15, 0, 0)); + if (!f) + ERROREX(); + if (E_OK != field_opts_off(f, O_AUTOSKIP)) + ERROREX(); + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_CYAN) | A_BOLD)) + ERROREX(); } - h = s.size()/(getwidth() - 4) + 1; - if (h > 5) - h = 5; - f = addfield(new_field(h, getwidth()-4, ++line, 1, 0, 0)); - if (!f) - ERROREX(); - if (E_OK != set_field_buffer(f, 0, s.c_str())) - ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) - ERROREX(); - if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст - ERROREX(); - line += h + 1; - } //email line++; f = addfield(new_field(1, 10, line, 1 , 0, 0)); @@ -204,7 +228,7 @@ ERROREX(); if (E_OK != set_field_buffer(f, 0, "email")) ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) ERROREX(); if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст ERROREX(); @@ -223,7 +247,7 @@ ERROREX(); if (E_OK != set_field_buffer(f, 0, "password")) ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) ERROREX(); if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст ERROREX(); @@ -244,7 +268,7 @@ ERROREX(); if (E_OK != set_field_buffer(f, 0, "username")) ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) ERROREX(); if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст ERROREX(); @@ -263,7 +287,7 @@ ERROREX(); if (E_OK != set_field_buffer(f, 0, "teamname")) ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) ERROREX(); if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст ERROREX(); @@ -283,7 +307,7 @@ ERROREX(); if (E_OK != set_field_buffer(f, 0, "Enter-Ok Esc-Cancel")) ERROREX(); - if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD)) + if (E_OK != set_field_back(f, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD)) ERROREX(); if (E_OK != field_opts_off(f, O_ACTIVE)) //статический текст ERROREX(); @@ -296,7 +320,7 @@ { if ( ev->done ) return; - NMouseEvent* mevent = (NMouseEvent*)ev; + //NMouseEvent* mevent = (NMouseEvent*)ev; if ( ev->type == NEvent::evMOUSE) { NForm::eventhandle(ev); //предок @@ -311,8 +335,10 @@ { form_driver(frm, REQ_NEXT_FIELD); //костыль чтобы текущее поле не потеряло значение char* email = strlowcase(rtrim(field_buffer(fields[emailfield],0))); + if (byurl) + projurl = rtrim(field_buffer(fields[projurlfield],0)); char* passw = rtrim(field_buffer(fields[passwfield],0)); - kLogPrintf("AddProjectForm OK name=[%s] url=[%s] email=[%s]\n passw=[%s]\n", projname.c_str(), projurl.c_str(), email, passw); + kLogPrintf("AddProjectForm OK name=[%s] url=[%s] email=[%s] passw=[%s]\n", projname.c_str(), projurl.c_str(), email, passw); if (srv!=NULL) { std::string errmsg; diff -Nru boinctui-2.5.0/src/addprojectform.h boinctui-2.7.0/src/addprojectform.h --- boinctui-2.5.0/src/addprojectform.h 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/addprojectform.h 2022-05-05 18:31:58.000000000 +0000 @@ -28,10 +28,11 @@ class AddProjectForm : public NForm { public: - AddProjectForm(int lines, int rows, Srv* srv, const char* projname, bool userexist); + AddProjectForm(int lines, int rows, Srv* srv, const char* projname, bool userexist, bool byurl); void genfields(int& line, Item* project); //создаст массив полей virtual void eventhandle(NEvent* ev); //обработчик событий protected: + int projurlfield; int emailfield; int passwfield; int errmsgfield; @@ -41,6 +42,7 @@ std::string projname; //имя подключаемого проекта std::string projurl; //url подключаемого проекта bool userexist; //true если юзер уже создан + bool byurl; //сделать строку url редактируемой }; diff -Nru boinctui-2.5.0/src/cfg.cpp boinctui-2.7.0/src/cfg.cpp --- boinctui-2.5.0/src/cfg.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/cfg.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -22,6 +22,7 @@ #include "cfg.h" #include "resultparse.h" #include "kclog.h" +#include "commondef.h" Config* gCfg; @@ -45,6 +46,7 @@ //загружаем если файл уже есть или генерируем дефолтный load(); asciilinedraw = getivalue("line_draw_mode"); + transparentbg = getivalue("transparent_background"); } @@ -91,6 +93,62 @@ fclose (pfile); isdefault = false; } + //upgrade config version + Item* boinctui_cfg=getcfgptr(); + if(boinctui_cfg!=NULL) + { + std::string vercfg=""; + std::string verprog=XSTR(VERSION); + Item* v=boinctui_cfg->findItem("version"); + if(v!=NULL) + { + vercfg=v->getsvalue(); + } + else + { + Item* version=new Item("version"); + version->setsvalue(XSTR(VERSION)); + boinctui_cfg->addsubitem(version); + } + if(vercfg!=verprog) + kLogPrintf("prog ver='%s' config ver='%s' need upgrade\n",verprog.c_str(),vercfg.c_str()); + if((vercfg=="")&&(verprog=="2.6.0")) + { + //column_view_mask + Item* column_view_mask = boinctui_cfg->findItem("column_view_mask"); + if (column_view_mask == NULL) //создать + { + column_view_mask = new Item("column_view_mask"); + column_view_mask->setivalue(-1); + boinctui_cfg->addsubitem(column_view_mask); + } + unsigned int columnmask = column_view_mask->getivalue(); + unsigned int x1 = 0x001F & columnmask; //# state done% project est + unsigned int x2 = 0x0060 & columnmask; //dl application + unsigned int x3 = 0x0080 & columnmask; //task + columnmask = x1 | (0x1 << 5) | (x2 << 1) | (0x1 << 8) | (x3 << 2); + column_view_mask->setivalue(columnmask); + //tasks_sort_mode + Item* tasks_sort_mode = boinctui_cfg->findItem("tasks_sort_mode"); + if (tasks_sort_mode == NULL) //создать + { + tasks_sort_mode = new Item("tasks_sort_mode"); + tasks_sort_mode->setivalue(-1); + tasks_sort_mode->addsubitem(tasks_sort_mode); + } + unsigned int taskssortmode = tasks_sort_mode->getivalue(); + switch (taskssortmode) + { + case 5: + taskssortmode=6; + break; + case 7: + taskssortmode=9; + break; + } + tasks_sort_mode->setivalue(taskssortmode); + } + } } @@ -117,7 +175,7 @@ } -void Config::addhost(const char* shost, const char* sport, const char* spwd) +void Config::addhost(const char* shost, const char* sport, const char* spwd, const char* shostid) { if ( (strlen(shost) == 0)||(strlen(sport) == 0) ) return; //пустые не заносим @@ -142,6 +200,9 @@ pwd->appendvalue(spwd); srv->addsubitem(pwd); } + Item* hostid = new Item("hostid"); + hostid->appendvalue(shostid); + srv->addsubitem(hostid); boinctui_cfg->addsubitem(srv); } @@ -153,7 +214,7 @@ root = new Item(""); //корневой Item* cfg = new Item("boinctui_cfg"); root->addsubitem(cfg); - addhost("127.0.0.1","31416",""); + addhost("127.0.0.1","31416","","Local Server"); } diff -Nru boinctui-2.5.0/src/cfgform.cpp boinctui-2.7.0/src/cfgform.cpp --- boinctui-2.5.0/src/cfgform.cpp 2016-09-10 17:01:45.000000000 +0000 +++ boinctui-2.7.0/src/cfgform.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -48,53 +48,65 @@ int i = 0; //номер хоста int nl = 2; //номер экранной строки //статический заголовок полей хостов - FIELD* field = addfield(new_field(1, 44, nl, 5, 0, 0)); + FIELD* field = addfield(new_field(1, 53, nl, 5, 0, 0)); field_opts_off(field, O_ACTIVE); //статический текст - set_field_buffer(field, 0, "host port pwd"); - set_field_back(field, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + set_field_buffer(field, 0, "host port pwd label"); + set_field_back(field, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); nl = nl + 1; //поля для хостов for (i = 0; i < nhost; i++) //цикл по хостам { - //поле для хоста - field = addfield(new_field(1, 15, nl, 5, 0, 0)); - set_field_back(field, getcolorpair(COLOR_WHITE,COLOR_CYAN) | A_BOLD); - field_opts_off(field, O_AUTOSKIP); - field_opts_off(field, O_STATIC); - set_max_field(field,128); //max width 128 - //set_field_type(field[nf], TYPE_ALNUM, 0); - if (i < slist.size()) - { - Item* host = slist[i]->findItem("host"); - if (host != NULL) - set_field_buffer(field, 0, host->getsvalue()); - } - if (i == 0) - set_current_field(frm, field); //фокус на поле - //поле для порта - field = addfield(new_field(1, 5, nl, 17+5, 0, 0)); - set_field_back(field, getcolorpair(COLOR_WHITE,COLOR_CYAN) | A_BOLD); - set_field_type(field, TYPE_INTEGER, 0, 0, 65535); - field_opts_off(field, O_AUTOSKIP); - if (i < slist.size()) - { - Item* port = slist[i]->findItem("port"); - if (port != NULL) - set_field_buffer(field, 0, port->getsvalue()); - } - //поле для пароля - field = addfield(new_field(1, 20, nl, 29, 0, 0)); - set_field_back(field, getcolorpair(COLOR_WHITE,COLOR_CYAN) | A_BOLD); - field_opts_off(field, O_AUTOSKIP); - field_opts_off(field, O_STATIC); - set_max_field(field,128); //max width 128 - if (i < slist.size()) - { - Item* pwd = slist[i]->findItem("pwd"); - if (pwd != NULL) - set_field_buffer(field, 0, pwd->getsvalue()); - } - nl = nl + 2; + //поле для хоста + field = addfield(new_field(1, 15, nl, 5, 0, 0)); + set_field_back(field, getcolorpair(COLOR_WHITE,COLOR_CYAN) | A_BOLD); + field_opts_off(field, O_AUTOSKIP); + field_opts_off(field, O_STATIC); + set_max_field(field,128); //max width 128 + //set_field_type(field[nf], TYPE_ALNUM, 0); + if (i < (int)slist.size()) + { + Item* host = slist[i]->findItem("host"); + if (host != NULL) + set_field_buffer(field, 0, host->getsvalue()); + } + if (i == 0) + set_current_field(frm, field); //фокус на поле + //поле для порта + field = addfield(new_field(1, 5, nl, 17+5, 0, 0)); + set_field_back(field, getcolorpair(COLOR_WHITE,COLOR_CYAN) | A_BOLD); + set_field_type(field, TYPE_INTEGER, 0, 0, 65535); + field_opts_off(field, O_AUTOSKIP); + if (i < (int)slist.size()) + { + Item* port = slist[i]->findItem("port"); + if (port != NULL) + set_field_buffer(field, 0, port->getsvalue()); + } + //поле для пароля + field = addfield(new_field(1, 20, nl, 29, 0, 0)); + set_field_back(field, getcolorpair(COLOR_WHITE,COLOR_CYAN) | A_BOLD); + field_opts_off(field, O_AUTOSKIP); + field_opts_off(field, O_STATIC); + set_max_field(field,128); //max width 128 + if (i < (int)slist.size()) + { + Item* pwd = slist[i]->findItem("pwd"); + if (pwd != NULL) + set_field_buffer(field, 0, pwd->getsvalue()); + } + // hostid field + field = addfield(new_field(1, 20, nl, 51, 0, 0)); + set_field_back(field, getcolorpair(COLOR_WHITE,COLOR_CYAN) | A_BOLD); + field_opts_off(field, O_AUTOSKIP); + field_opts_off(field, O_STATIC); + set_max_field(field,128); + if (i < slist.size()) + { + Item* hostid = slist[i]->findItem("hostid"); + if (hostid != NULL) + set_field_buffer(field, 0, hostid->getsvalue()); + } + nl = nl + 2; } //клавиши упр-я nl++; @@ -104,7 +116,7 @@ set_field_buffer(field, 0, "Esc-Cancel Enter-Accept"); else set_field_buffer(field, 0, "Esc-Cancel Enter-Accept Ins-Add host"); - set_field_back(field, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + set_field_back(field, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); nl = nl + 2; //финализация списка полей addfield(NULL); @@ -118,7 +130,7 @@ { if ( ev->done ) return; - NMouseEvent* mevent = (NMouseEvent*)ev; + //NMouseEvent* mevent = (NMouseEvent*)ev; if ( ev->type == NEvent::evMOUSE) { //if (isinside(mevent->row, mevent->col)) @@ -182,11 +194,12 @@ //int n = field_count(frm); for (int i = 0; i < nhost; i++) //хосты из формы { - int nf = 1 + i*3; //номер поля для имени хоста + int nf = 1 + i*4; //номер поля для имени хоста char* shost = rtrim(field_buffer(fields[nf],0)); char* sport = rtrim(field_buffer(fields[nf+1],0)); char* spwd = rtrim(field_buffer(fields[nf+2],0)); - kLogPrintf("SERVER %d [%s:%s <%s>]\n", i, shost, sport, spwd); - gCfg->addhost(shost, sport, spwd); + char* shostid = rtrim(field_buffer(fields[nf+3],0)); + kLogPrintf("SERVER %d [%s:%s <%s> Label: %s]\n", i, shost, sport, spwd, shostid); + gCfg->addhost(shost, sport, spwd, shostid); } } diff -Nru boinctui-2.5.0/src/cfg.h boinctui-2.7.0/src/cfg.h --- boinctui-2.5.0/src/cfg.h 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/cfg.h 2022-05-05 18:31:58.000000000 +0000 @@ -35,9 +35,13 @@ int getivalue(const char* name) { return getivalue(getcfgptr(), name); }; //ищет name начиная с корня void setivalue(Item* node, const char* name, int value); //создаст в node подэл-т name со значением value void setivalue(const char* name, int value) { setivalue(getcfgptr(), name, value); }; //создаст в корне подэл-т name со значением value - void addhost(const char* host, const char* port, const char* pwd); + void addhost(const char* host, const char* port, const char* pwd, const char* hostid); bool isdefault; //true если конфиг не найден и создан дефолтный std::string errmsg; //строка ошибки возникшей при загрузке файла конфига + std::string cmdlinehost=""; + std::string cmdlineport="31416"; + std::string cmdlinepwd=""; + bool cmdlocalhost=false; protected: char* fullname; //полное имя файла Item* root; //корень дерева конфига diff -Nru boinctui-2.5.0/src/commondef.h boinctui-2.7.0/src/commondef.h --- boinctui-2.5.0/src/commondef.h 1970-01-01 00:00:00.000000000 +0000 +++ boinctui-2.7.0/src/commondef.h 2022-05-05 18:31:58.000000000 +0000 @@ -0,0 +1,8 @@ +#ifndef COMMONDEF_H +#define COMMONDEF_H + +//стрингификатор +#define XSTR(S) STR(S) +#define STR(S) #S + +#endif //COMMONDEF_H diff -Nru boinctui-2.5.0/src/helpwin.cpp boinctui-2.7.0/src/helpwin.cpp --- boinctui-2.5.0/src/helpwin.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/helpwin.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -24,21 +24,22 @@ { caption = strdup(" Hot keys list "); modalflag = true; - resize(17,60); - wattrset(win,getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD); + resize(18,60); + wattrset(win,getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD); if(asciilinedraw == 1) wborder(win, '|', '|', '-', '-', '+', '+', '+', '+'); else box(win,0,0); - mvwprintw(win,0,getwidth()/2-(strlen(caption)/2),caption); + mvwprintw(win,0,getwidth()/2-(strlen(caption)/2),"%s",caption); text1 = new NStaticText(NRect(getheight()-2,getwidth()-2,/*rect.begrow+*/1,/*rect.begcol+*/1)); - int attr1 = getcolorpair(COLOR_YELLOW, COLOR_BLACK) | A_BOLD; - int attr2 = getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD; + int attr1 = getcolorpair(COLOR_YELLOW, getbgcolor()) | A_BOLD; + int attr2 = getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD; text1->setstring(attr1, "\n Common Controls:\n"); - text1->appendstring(attr2," \"N\" - Toogle between BOINC hosts\n"); + text1->appendstring(attr2," \"N\" - View next BOINC host\n"); + text1->appendstring(attr2," \"P\" - View previous BOINC host\n"); text1->appendstring(attr2," \"C\" - Edit configuration\n"); text1->appendstring(attr2," \"Q\" - Quit boinctui\n"); - text1->appendstring(attr2," \"F9\" - Toogle main menu\n"); + text1->appendstring(attr2," \"F9\"/\"M\" - Toggle main menu\n"); text1->appendstring(attr2," \"PgUp\"/\"PgDn\" - Scroll Messages Window\n"); text1->appendstring(attr2,"\n"); text1->appendstring(attr1," Task Controls:\n"); diff -Nru boinctui-2.5.0/src/infopanel.cpp boinctui-2.7.0/src/infopanel.cpp --- boinctui-2.5.0/src/infopanel.cpp 2016-10-17 17:51:29.000000000 +0000 +++ boinctui-2.7.0/src/infopanel.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -63,7 +63,7 @@ NView::refresh(); return; } - wattrset(win,getcolorpair(COLOR_WHITE,COLOR_BLACK)); + wattrset(win,getcolorpair(COLOR_WHITE,getbgcolor())); wattron(win, A_REVERSE); mvwprintw(win,0,0," Tasks "); wattroff(win, A_REVERSE); @@ -91,14 +91,14 @@ bool compact = true; //компактный вывод статистики если user=host int line,col; getyx(win,line,col); - if ( (!compact)||(abs(usertotal - hosttotal) > 1) ) + if ( (!compact)||(std::abs(usertotal - hosttotal) > 1) ) { mvwprintw(win,line++,0,"user total%10.0f\n",usertotal); mvwprintw(win,line++,0,"host total%10.0f\n",hosttotal); } else mvwprintw(win,line++,0,"total %10.0f\n",usertotal); - if ( (!compact)||(abs(useravg - hostavg) > 1) ) + if ( (!compact)||(std::abs(useravg - hostavg) > 1) ) { mvwprintw(win,line++,0,"user avg %10.0f\n",useravg); mvwprintw(win,line++,0,"host avg %10.0f\n",hostavg); @@ -110,7 +110,7 @@ strftime(buf, sizeof(buf),"%-e %b",ltime); //"%-e %b %-k:%M" mvwprintw(win,line++,0,"%-s %s\n", buf, getdayname(laststattime).c_str()); //дата/время последней статистики //wattrset(win,0); - if ( (!compact)||(abs(lastdayuser - lastdayhost) > 1) ) + if ( (!compact)||(std::abs(lastdayuser - lastdayhost) > 1) ) { if ( asciilinedraw == 1) { @@ -136,17 +136,17 @@ } //по проектам mvwprintw(win, line++,0,"\n"); - for (int i = 0; i < projects.size(); i++) //цикл по названиям проектов + for (int i = 0; i < (int)projects.size(); i++) //цикл по названиям проектов { //расчитываем нужное кол-во строк int needlines = 2; if (!projects[i].sstatus.empty()) needlines++; - if ( (!compact)||(abs(projects[i].user - projects[i].host) > 1) ) + if ( (!compact)||(std::abs(projects[i].user - projects[i].host) > 1) ) needlines += 2; else needlines++; - if ( (!compact)||(abs(projects[i].userlastday - projects[i].hostlastday) > 1) ) + if ( (!compact)||(std::abs(projects[i].userlastday - projects[i].hostlastday) > 1) ) needlines += 2; else needlines++; @@ -154,15 +154,15 @@ if ( ( getheight()-line ) < needlines ) break; //не выводим если осталось мало строк //вывод на экран о проекте - wattrset(win,getcolorpair(COLOR_YELLOW,COLOR_BLACK)); + wattrset(win,getcolorpair(COLOR_YELLOW,getbgcolor())); mvwprintw(win,line++,0,"%s\n",projects[i].name.c_str()); if (!projects[i].sstatus.empty()) { - wattrset(win,getcolorpair(COLOR_RED,COLOR_BLACK)); + wattrset(win,getcolorpair(COLOR_RED,getbgcolor())); mvwprintw(win,line++,0,"%s\n",projects[i].sstatus.c_str()); } - wattrset(win,getcolorpair(COLOR_WHITE,COLOR_BLACK)); - if ( (!compact)||(abs(projects[i].user - projects[i].host) > 1) ) + wattrset(win,getcolorpair(COLOR_WHITE,getbgcolor())); + if ( (!compact)||(std::abs(projects[i].user - projects[i].host) > 1) ) { mvwprintw(win,line++,0,"user total%10.0f\n",projects[i].user); mvwprintw(win,line++,0,"host total%10.0f\n",projects[i].host); @@ -172,7 +172,7 @@ ltime = localtime(&projects[i].laststattime); strftime(buf, sizeof(buf),"%-e %b",ltime); //"%-e %b %-k:%M" mvwprintw(win,line++,0,"%-s %s\n",buf, getdayname(projects[i].laststattime).c_str()); - if ( (!compact)||(abs(projects[i].userlastday - projects[i].hostlastday) > 1) ) + if ( (!compact)||(std::abs(projects[i].userlastday - projects[i].hostlastday) > 1) ) { if (asciilinedraw == 1) { diff -Nru boinctui-2.5.0/src/mainprog.cpp boinctui-2.7.0/src/mainprog.cpp --- boinctui-2.5.0/src/mainprog.cpp 2017-06-26 09:18:43.000000000 +0000 +++ boinctui-2.7.0/src/mainprog.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -29,8 +29,7 @@ { uistate = 0; done = false; - gCfg = new Config(".boinctui.cfg"); - gsrvlist = new SrvList(); + gsrvlist = new SrvList(); evtimertime = 0; //запускаем таймер с нуля //основное окно wmain = new MainWin(NRect(getmaxy(stdscr)-2, getmaxx(stdscr), 1, 0)); //создаем основное окно @@ -132,7 +131,7 @@ wstatus->appendstring(attrBG, " Enter Info"); } wstatus->appendstring(attrWG, " |"); - wstatus->appendstring(attrYG, " F9"); + wstatus->appendstring(attrYG, " F9/M"); wstatus->appendstring(attrWG, " Menu |"); wstatus->appendstring(attrYG, " V"); wstatus->appendstring(attrWG, " Statistics |"); @@ -165,12 +164,24 @@ wmain->updatecaption(); } break; + case 'p': + case 'P': + menu->disable(); + if (gsrvlist->getcursrv()) + { + gsrvlist->prevserver(); + wmain->setserver(gsrvlist->getcursrv()); + menu->setserver(gsrvlist->getcursrv()); + evtimertime = 0; + wmain->updatecaption(); + } + break; case 'c': case 'C': if (getitembyid(typeid(CfgForm).name()) == NULL) { menu->disable(); - CfgForm* cfgform = new CfgForm(15,54/*,cfg*/); + CfgForm* cfgform = new CfgForm(15,76/*,cfg*/); insert(cfgform); cfgform->settitle("Configuration"); cfgform->refresh(); @@ -237,6 +248,8 @@ uistate = uistate & ~stUIMODALFORM; updatestatuslinecontent(); break; + case 'M': + case 'm': case KEY_F(9): if (!menu->isenable()) { @@ -319,10 +332,10 @@ if (!destroybyid(typeid(AddProjectForm).name())) { TuiEvent* ev1 = (TuiEvent*)ev; - Srv* srv = gsrvlist->getcursrv(); + //Srv* srv = gsrvlist->getcursrv(); if (ev1->srv != NULL) { - AddProjectForm* addform = new AddProjectForm(30,65,ev1->srv,ev1->sdata1.c_str(),ev1->bdata1); + AddProjectForm* addform = new AddProjectForm(30,65,ev1->srv,ev1->sdata1.c_str(),ev1->bdata1, ev1->bdata2); insert(addform); addform->move(getmaxy(stdscr)/2-addform->getheight()/2,getmaxx(stdscr)/2-addform->getwidth()/2); //центрируем uistate = uistate | stUIMODALFORM; @@ -338,7 +351,7 @@ if (!destroybyid(typeid(AddAccMgrForm).name())) { TuiEvent* ev1 = (TuiEvent*)ev; - Srv* srv = gsrvlist->getcursrv(); + //Srv* srv = gsrvlist->getcursrv(); if (ev1->srv != NULL) { AddAccMgrForm* addmgrform = new AddAccMgrForm(30,65,ev1->srv,ev1->sdata1.c_str()); @@ -446,6 +459,20 @@ refresh(); break; } + case evTRANSPARENTBGMODECHANGE: + { + gCfg->setivalue("transparent_background",(transparentbg==0)?1:0); + //transparentbg = (transparentbg==0)?1:0; + //refresh(); + menu->disable(); //выключаем меню + //создаем окно сообщения с подтверждением + NMessageBox* mbox = new NMessageBox("Need restart boinctui"); + NEvent* buttonNev = new NEvent(NEvent::evKB, 27); //событие для кнопки N + mbox->addbutton(new NMButton("Yes",buttonNev, 'Y','y','\n',27,0)); + insert(mbox); + uistate = uistate | stUIMODALFORM; + break; + } } //switch } } diff -Nru boinctui-2.5.0/src/mainwin.cpp boinctui-2.7.0/src/mainwin.cpp --- boinctui-2.5.0/src/mainwin.cpp 2016-10-17 17:11:23.000000000 +0000 +++ boinctui-2.7.0/src/mainwin.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -47,11 +47,13 @@ colname.push_back(" done%%"); colname.push_back(" project "); colname.push_back(" est"); - colname.push_back(" d/l"); + colname.push_back(" rcv"); + colname.push_back(" dl "); colname.push_back(" application "); + colname.push_back(" swap "); colname.push_back(" task"); tablheader = new NStaticText(NRect(1, rect.cols -2-(INFPANWIDTH)-1, 1, 1)); - tablheader->setstring(getcolorpair(COLOR_CYAN,COLOR_BLACK) | A_BOLD," # state done%% project est d/l task"); + tablheader->setstring(getcolorpair(COLOR_CYAN,getbgcolor()) | A_BOLD," # state done%% project est d/l task"); int wtaskheight = getheight() * wtaskheightpercent / 10000.0; if (wtaskheight < 5) wtaskheight = 5; @@ -139,13 +141,14 @@ if (wtask->iscolvisible(i)) s = s + colname[i]; } - tablheader->setstring(getcolorpair(COLOR_CYAN,COLOR_BLACK) | A_BOLD, s.c_str()); + tablheader->setbgcolor(getcolorpair(COLOR_WHITE,getbgcolor())); + tablheader->setstring(getcolorpair(COLOR_CYAN,getbgcolor()) | A_BOLD, s.c_str()); } void MainWin::refresh() { - wattrset(win, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + wattrset(win, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); if(asciilinedraw == 1) wborder(win, '|', '|', '-', '-', '+', '+', '+', '+'); else @@ -161,7 +164,8 @@ //wattrset(win,0); } //wborder(win, ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, ACS_URCORNER, ACS_LLCORNER, ACS_LRCORNER); - //wattroff(win, getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + //wattroff(win, getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); + setcoltitle(); NGroup::refresh(); } @@ -172,7 +176,10 @@ caption->clear(); if (srv) { - caption->append(getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD," Host %s:%s ",srv->gethost(),srv->getport()); + std::string shostid=""; + if(strlen(srv->hostid)>0) + shostid="("+std::string(srv->hostid)+")"; + caption->append(getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD," Host %s:%s%s ",srv->gethost(),srv->getport(),shostid.c_str()); if (srv->loginfail) caption->append(getcolorpair(COLOR_WHITE,COLOR_RED) | A_BOLD,"unauthorized!"); else diff -Nru boinctui-2.5.0/src/msgwin.cpp boinctui-2.7.0/src/msgwin.cpp --- boinctui-2.5.0/src/msgwin.cpp 2016-09-11 06:29:37.000000000 +0000 +++ boinctui-2.7.0/src/msgwin.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -71,10 +71,8 @@ sproject = project->getsvalue(); if ( (stimestamp != stimestampold)||(sproject != sprojectold)) //выводим имя и время проекта если они отличаются от предидущего { - //addstring(getcolorpair(COLOR_CYAN,COLOR_BLACK) /*| A_BOLD*/,"#%d %s ", number->getivalue(), tbuf); //номер и время сообщения - addstring(getcolorpair(COLOR_CYAN,COLOR_BLACK) ,"%s ", tbuf); //время сообщения - //strcpy(tbufold, tbuf); - content.back()->append(getcolorpair(COLOR_YELLOW,COLOR_BLACK),"%s",sproject.c_str()); //добавить имя проекта другим цветом + addstring(getcolorpair(COLOR_CYAN,getbgcolor()) ,"%s ", tbuf); //время сообщения + content.back()->append(getcolorpair(COLOR_YELLOW,getbgcolor()),"%s",sproject.c_str()); //добавить имя проекта другим цветом stimestampold = stimestamp; sprojectold = sproject; } @@ -86,7 +84,7 @@ s[slen-3] = '\0'; ss = ss + 9; } - addstring(getcolorpair(COLOR_WHITE,COLOR_BLACK), "%s", ss/*body->getsvalue()*/); //само сообщение + addstring(getcolorpair(COLOR_WHITE,getbgcolor()), "%s", ss/*body->getsvalue()*/); //само сообщение free(s); } } diff -Nru boinctui-2.5.0/src/net.cpp boinctui-2.7.0/src/net.cpp --- boinctui-2.5.0/src/net.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/net.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -92,7 +92,7 @@ if (hsock == -1) createconnect(/*shost,sport*/); //отправляем запрос - if (send(hsock, req, strlen(req), 0) != strlen(req)) + if (send(hsock, req, strlen(req), 0) != (int)strlen(req)) { kLogPrintf("send request %s:%s error\n",shost,sport); disconnect(); @@ -123,6 +123,8 @@ //копируем в суммарный буфер answbuflen = answbuflen+bytesRcvd; answbuf = (char*)realloc(answbuf,answbuflen); + if(answbuf==NULL) + return NULL; memcpy(&answbuf[totalBytesRcvd], bufpart, bytesRcvd); totalBytesRcvd += bytesRcvd; if (answbuf[totalBytesRcvd-1] == '\003') diff -Nru boinctui-2.5.0/src/nform.cpp boinctui-2.7.0/src/nform.cpp --- boinctui-2.5.0/src/nform.cpp 2016-10-19 07:57:46.000000000 +0000 +++ boinctui-2.7.0/src/nform.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -31,7 +31,7 @@ set_form_win(frm, win); subwin = derwin(win, rows-2, cols-2, 1,1); set_form_sub(frm, subwin); - wattrset(win,getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD); + wattrset(win,getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD); title = NULL; needrefresh = true; //перемещаем в центр экрана @@ -68,9 +68,13 @@ FIELD* NForm::addfield(FIELD* field) { - fields = (FIELD**)realloc(fields, (fieldcount+1)*sizeof(FIELD*)); //выделяем память под массив полей - fields[fieldcount] = field; - fieldcount++; + FIELD** tmp = (FIELD**)realloc(fields, (fieldcount+1)*sizeof(FIELD*)); //выделяем память под массив полей + if(tmp!=NULL) + { + fields=tmp; + fields[fieldcount] = field; + fieldcount++; + } if (field == NULL) set_form_fields(frm, fields); return field; diff -Nru boinctui-2.5.0/src/nhline.cpp boinctui-2.7.0/src/nhline.cpp --- boinctui-2.5.0/src/nhline.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/nhline.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -21,7 +21,7 @@ void NHLine::refresh() { wbkgd(win,bgcolor); - wattrset(win,getcolorpair(COLOR_WHITE,COLOR_BLACK)); + wattrset(win,getcolorpair(COLOR_WHITE,getbgcolor())); if ( asciilinedraw == 1) whline(win, '-', getwidth()-0); else diff -Nru boinctui-2.5.0/src/nmenu.cpp boinctui-2.7.0/src/nmenu.cpp --- boinctui-2.5.0/src/nmenu.cpp 2016-09-10 17:01:45.000000000 +0000 +++ boinctui-2.7.0/src/nmenu.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -26,9 +26,9 @@ ishoris = horis; posted = false; menu = new_menu(mitems); - setbackground(getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD); + setbackground(getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD); setforeground(getcolorpair(COLOR_BLACK,COLOR_WHITE)); - set_menu_grey(menu, getcolorpair(COLOR_RED,COLOR_BLACK)); //цвет разделителей + set_menu_grey(menu, getcolorpair(COLOR_RED,getbgcolor())); //цвет разделителей set_menu_win(menu, win); postmenu(); if (horis) @@ -93,7 +93,9 @@ { unpostmenu(); mitems = (ITEM**)realloc(mitems,(itemnames.size()+1)*sizeof(ITEM*)); - if (name == NULL) //финализация списка + if(mitems==NULL) + return; + if (name == NULL) //финализация списка { mitems[itemnames.size()] = NULL; set_menu_items(menu, mitems); @@ -205,8 +207,8 @@ { if (item_index(current_item(menu)) > 0) //элемент не первый { - ITEM* preditem = mitems[item_index(current_item(menu)) - 1]; //предыдущий - menu_driver(menu, REQ_SCR_UPAGE); + //ITEM* preditem = mitems[item_index(current_item(menu)) - 1]; //предыдущий + menu_driver(menu, REQ_SCR_UPAGE); } ev->done = true; } diff -Nru boinctui-2.5.0/src/nmessagebox.cpp boinctui-2.7.0/src/nmessagebox.cpp --- boinctui-2.5.0/src/nmessagebox.cpp 2016-10-17 17:15:39.000000000 +0000 +++ boinctui-2.7.0/src/nmessagebox.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -17,7 +17,6 @@ #include #include -#include #include "kclog.h" #include "nmessagebox.h" @@ -92,7 +91,7 @@ int bsize = strlen(text); //количество байт int result = 0; //подсчитанное кол-во символов int nbytes = 0; //просмотренное кол-во байтов - int nlines = 0; //количество экранных строк + //int nlines = 0; //количество экранных строк int col = getwidth() - 4; const char* p = text; do @@ -114,12 +113,12 @@ while ( (*p != 0)&&(nbytes < bsize) ); //дошли до конца //заполняем содержимое content = new NStaticText(NRect(contentheight, getwidth()-4, 2, 2)); - content->setbgcolor(getcolorpair(COLOR_WHITE, COLOR_BLACK)); + content->setbgcolor(getcolorpair(COLOR_WHITE, getbgcolor())); insert(content); - content->appendstring(getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD, text); + content->appendstring(getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD, text); modalflag = true; resize(contentheight + 6,getwidth()); - wattrset(win,getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD); + wattrset(win,getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD); if(asciilinedraw == 1) wborder(win, '|', '|', '-', '-', '+', '+', '+', '+'); else @@ -157,7 +156,7 @@ if ( ev->done ) return; //одиночный или двойной клик - NMouseEvent* mevent = (NMouseEvent*)ev; + //NMouseEvent* mevent = (NMouseEvent*)ev; if (/*(*/ ev->type == NEvent::evMOUSE /*) && (mevent->cmdcode & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))*/) { //блокируем все мышиные мнутри окна diff -Nru boinctui-2.5.0/src/nscrollbar.cpp boinctui-2.7.0/src/nscrollbar.cpp --- boinctui-2.5.0/src/nscrollbar.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/nscrollbar.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -16,7 +16,7 @@ // ============================================================================= -#include +#include #include "nscrollbar.h" #include "kclog.h" @@ -58,7 +58,7 @@ void NScrollBar::refresh() { wbkgd(win,bgcolor); - wattrset(win,getcolorpair(COLOR_WHITE,COLOR_BLACK)); + wattrset(win,getcolorpair(COLOR_WHITE,getbgcolor())); chtype topsymbol = asciilinedraw ? '+'| (chtop & A_BOLD) : chtop; chtype bottomsymbol = asciilinedraw ? '+' | (chbottom & A_BOLD) : chbottom; chtype bodysymbol = asciilinedraw ? 'X' : ACS_CKBOARD; diff -Nru boinctui-2.5.0/src/nscrollview.cpp boinctui-2.7.0/src/nscrollview.cpp --- boinctui-2.5.0/src/nscrollview.cpp 2017-06-26 09:18:43.000000000 +0000 +++ boinctui-2.7.0/src/nscrollview.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -50,7 +50,7 @@ //выводим строки начиная со startindex for (int line = 0; line < getheight(); line++) //цикл по экранным строкам { - if (startindex+line < content.size()) + if (startindex+line < (int)content.size()) { NColorString* cstring = content[startindex + line]; std::list::iterator it; @@ -99,14 +99,14 @@ void NScrollView::scrollto(int delta)//сдвинуть отображение на drlta строк вверх или вниз { - if (content.size()>getheight()) + if ((int)content.size()>getheight()) { //kLogPrintf("NScrollView::scrollto(%d) startindex=%d content.size()=%d getheight()=%d\n",delta, startindex, content.size(), getheight()); int oldstartindex = startindex; startindex = startindex + delta; if ( startindex < 0 ) startindex = 0; - if ( startindex > content.size()-getheight() ) + if ( startindex > (int)content.size()-getheight() ) startindex = content.size()-getheight()/* + 1*/; //+1 чтобы оставлять пустую строку if (oldstartindex != startindex) //позиция изменилась нужно перерисовываться needrefresh = true; @@ -131,7 +131,7 @@ void NScrollView::setstartindex(int n) //установить отображение со строки n { - if ((content.size()-n) < getheight()) //последняя строка видима на экране + if (((int)content.size()-n) < getheight()) //последняя строка видимая на экране { startindex = content.size()-getheight(); //поднять вверх if (startindex < 0) //но не выше нулевой diff -Nru boinctui-2.5.0/src/nselectlist.cpp boinctui-2.7.0/src/nselectlist.cpp --- boinctui-2.5.0/src/nselectlist.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/nselectlist.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -44,7 +44,7 @@ //выводим строки начиная со startindex for (int line = 0; line < getheight(); line++) //цикл по экранным строкам { - if (startindex+line < content.size()) //цикл по строкам + if (startindex+line < (int)content.size()) //цикл по строкам { NColorString* cstring = content[startindex + line]; std::list::iterator it; @@ -76,7 +76,7 @@ { wbkgdset(win,getcolorpair(COLOR_WHITE,selectorbgcolor)); wclrtoeol(win); //очищаем до конца строки - wbkgdset(win,getcolorpair(COLOR_WHITE, COLOR_BLACK)); + wbkgdset(win,getcolorpair(COLOR_WHITE, getbgcolor())); } } else //очищаем нижнюю незанятую часть окна (если есть) @@ -104,7 +104,7 @@ void* NSelectList::getselectedobj() { - if ((selectedindex >= 0)&&(selectedindex < objects.size())) + if ((selectedindex >= 0)&&(selectedindex < (int)objects.size())) { return objects[selectedindex]; } @@ -135,7 +135,7 @@ selectedindex++; needrefresh = true; //проверяем не нужно ли скролить - if ((startindex + getheight() < content.size())&&(startindex + getheight() - selectedindex < 4)) //видимых строк ниже серлектора осталось + if ((startindex + getheight() < (int)content.size())&&(startindex + getheight() - selectedindex < 4)) //видимых строк ниже серлектора осталось { scrollto(1); } diff -Nru boinctui-2.5.0/src/nstatictext.h boinctui-2.7.0/src/nstatictext.h --- boinctui-2.5.0/src/nstatictext.h 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/nstatictext.h 2022-05-05 18:31:58.000000000 +0000 @@ -26,7 +26,7 @@ class NStaticText : public NView { public: - NStaticText(NRect rect) : NView(rect) { content = new NColorString(0,""); align = 0; setbgcolor(getcolorpair(COLOR_WHITE,COLOR_BLACK));}; + NStaticText(NRect rect) : NView(rect) { content = new NColorString(0,""); align = 0; setbgcolor(getcolorpair(COLOR_WHITE,getbgcolor()));}; virtual ~NStaticText() { delete content; }; void appendstring(int attr, const char* fmt, ...); void setstring(int attr, const char* fmt, ...); diff -Nru boinctui-2.5.0/src/nview.cpp boinctui-2.7.0/src/nview.cpp --- boinctui-2.5.0/src/nview.cpp 2016-09-07 09:18:08.000000000 +0000 +++ boinctui-2.7.0/src/nview.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -22,6 +22,16 @@ int asciilinedraw = 0; //1-рисовать рамки символами +----+ +int transparentbg = 0; //1-прозрачный бэкграунд + + +int getbgcolor() //вернет цвет бакграунда (в зависимости от настройки transparentbg) +{ + if(transparentbg==1) + return -1; + else + return COLOR_BLACK; +} int getcolorpair(int fcolor, int bcolor) //получить пару для комбинации цветов @@ -73,7 +83,7 @@ #ifdef DEBUG refreshcount = 0; //счетчик обновлений #endif - wbkgdset(win,getcolorpair(COLOR_WHITE,COLOR_BLACK)); //бакграунд + wbkgdset(win,getcolorpair(COLOR_WHITE,getbgcolor())); //бакграунд werase(win); //заполняем цветом фона } diff -Nru boinctui-2.5.0/src/nview.h boinctui-2.7.0/src/nview.h --- boinctui-2.5.0/src/nview.h 2016-09-07 09:18:08.000000000 +0000 +++ boinctui-2.7.0/src/nview.h 2022-05-05 18:31:58.000000000 +0000 @@ -32,7 +32,9 @@ void initcolorpairs(); int getcolorpair(int fcolor, int bcolor); //получить пару для комбинации цветов +int getbgcolor(); //вернет цвет бакграунда (в зависимости от настройки transparentbg) extern int asciilinedraw; //1-рисовать рамки символами +----+ +extern int transparentbg; //1-прозрачный бэкграунд class NView //базовый визуальный класс diff -Nru boinctui-2.5.0/src/nvline.cpp boinctui-2.7.0/src/nvline.cpp --- boinctui-2.5.0/src/nvline.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/nvline.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -21,7 +21,7 @@ void NVLine::refresh() { wbkgd(win,bgcolor); - wattrset(win,getcolorpair(COLOR_WHITE,COLOR_BLACK)); + wattrset(win,getcolorpair(COLOR_WHITE,getbgcolor())); if (asciilinedraw == 1) wvline(win, '|', getheight()-0); else diff -Nru boinctui-2.5.0/src/resultparse.cpp boinctui-2.7.0/src/resultparse.cpp --- boinctui-2.5.0/src/resultparse.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/resultparse.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -35,7 +35,7 @@ { const char* teg1 = ""; const char* teg2 = ""; - int bytesdone = 0; //просмотрено байт + //int bytesdone = 0; //просмотрено байт char* pos = (char*)xml; while (pos < xml + len) { @@ -123,7 +123,7 @@ //kLogPrintf("\ncallbackData()-->[%s]<-- len=%d\n",tmp,len); //заносим значение в текущий эл-т bool empty = true; - for (int i = 0; i < strlen(tmp); i++) + for (uint i = 0; i < strlen(tmp); i++) { if (tmp[i] != ' ') { diff -Nru boinctui-2.5.0/src/srvdata.cpp boinctui-2.7.0/src/srvdata.cpp --- boinctui-2.5.0/src/srvdata.cpp 2016-10-17 17:18:21.000000000 +0000 +++ boinctui-2.7.0/src/srvdata.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef HAVE_OPENSSL #include #else @@ -141,20 +142,39 @@ Item* boinctui_cfg = gCfg->getcfgptr(); if (boinctui_cfg == NULL) return; + if(gCfg->cmdlinehost!="") + { + if((gCfg->cmdlinepwd=="")&&(gCfg->cmdlocalhost)) + { + std::ifstream ifs("/var/lib/boinc-client/gui_rpc_auth.cfg"); + std::string s((std::istreambuf_iterator(ifs)), + (std::istreambuf_iterator())); + for(auto c : s) + { + if(c>=0x20) + gCfg->cmdlinepwd.push_back(c); + } + } + servers.push_back(new Srv(gCfg->cmdlinehost.c_str(),gCfg->cmdlineport.c_str(),gCfg->cmdlinepwd.c_str(),"")); + } std::vector slist = boinctui_cfg->getItems("server"); std::vector::iterator it; for (it = slist.begin(); it != slist.end(); it++) { - Item* host = (*it)->findItem("host"); - Item* port = (*it)->findItem("port"); - Item* pwd = (*it)->findItem("pwd"); - if ((host != NULL)&&(port != NULL)) - { - if (pwd == NULL) - servers.push_back(new Srv(host->getsvalue(), port->getsvalue(), "")); - else - servers.push_back(new Srv(host->getsvalue(), port->getsvalue(), pwd->getsvalue())); - } + Item* host = (*it)->findItem("host"); + Item* port = (*it)->findItem("port"); + Item* pwd = (*it)->findItem("pwd"); + Item* hostid = (*it)->findItem("hostid"); + if ((host != NULL)&&(port != NULL)) + { + std::string spwd=""; + if(pwd!=NULL) + spwd=pwd->getsvalue(); + std::string shostid=""; + if(hostid!=NULL) + shostid=hostid->getsvalue(); + servers.push_back(new Srv(host->getsvalue(), port->getsvalue(), spwd.c_str(), shostid.c_str())); + } } if (!servers.empty()) { @@ -188,13 +208,26 @@ (*cursrv)->setactive(true); //активиркем тред } +void SrvList::prevserver() +{ + (*cursrv)->setactive(false); + if (cursrv == servers.begin()) + { + cursrv = servers.end(); + cursrv--; + } + else + cursrv--; + (*cursrv)->setactive(true); +} //============================================================================================= -Srv::Srv(const char* shost, const char* sport, const char* pwd) : TConnect(shost, sport) +Srv::Srv(const char* shost, const char* sport, const char* pwd, const char* hostid) : TConnect(shost, sport) { allprojectsdom = NULL; this->pwd = strdup(pwd); + this->hostid = strdup(hostid); lastmsgno = 0; active = false; loginfail = false; @@ -214,6 +247,7 @@ } if (allprojectsdom != NULL) delete allprojectsdom; if (pwd != NULL) delete pwd; + if (hostid != NULL) delete hostid; pthread_mutex_destroy(&mutex); kLogPrintf("-Srv::~Srv()\n"); } @@ -365,7 +399,7 @@ msgno = lastmsgno; //запрашиваем начиная с последнего отображенного else msgno = 0; //начинаем с первого - snprintf(req2,sizeof(req2),"\n%d\n",msgno); + snprintf(req2,sizeof(req2),"\n%d\n\n",msgno); Item* domtree = req(req2); if (domtree == NULL) return; @@ -518,7 +552,7 @@ for (int i=0;i\n" " %s\n" @@ -574,7 +608,7 @@ for (int i=0;i\n%s\n%s\n%s\n\n",url,email,shash); Item* res = req(sreq); if (res == NULL) @@ -585,28 +619,36 @@ snprintf(sreq,sizeof(sreq),""); std::string sauthenticator; bool done = false; + int maxcount = 30; do { - res = req(sreq); - if (res == NULL) - return false; - kLogPrintf("request=\n %s\n\n answer=\n%s\n",sreq, res->toxmlstring().c_str()); - Item* error_num = res->findItem("error_num"); - if ((error_num != NULL)&&(error_num->getivalue() != ERR_IN_PROGRESS)) - { - Item* error_msg = res->findItem("error_msg"); - if (error_msg != NULL) - errmsg = error_msg->getsvalue(); //возврат строки ошибки - return false; - } - Item* authenticator = res->findItem("authenticator"); - if (authenticator != NULL) - { - sauthenticator = authenticator->getsvalue(); - done = true; - } - free(res); - sleep(1); //ждем 1 сек + res = req(sreq); + if (res == NULL) + return false; + kLogPrintf("request=\n %s\n\n answer=\n%s\n",sreq, res->toxmlstring().c_str()); + Item* error_num = res->findItem("error_num"); + if (((error_num != NULL)||(strcmp(res->getname(),"error") == 0))&&(error_num->getivalue() != ERR_IN_PROGRESS)) + { + Item* error_msg = res->findItem("error_msg"); + if (error_msg != NULL) + errmsg += error_msg->getsvalue() + std::string(" "); + if (strcmp(res->getname(),"error") == 0) + errmsg += res->getsvalue(); + return false; + } + Item* authenticator = res->findItem("authenticator"); + if (authenticator != NULL) + { + sauthenticator = authenticator->getsvalue(); + done = true; + } + free(res); + sleep(1); //ждем 1 сек + if (--maxcount < 0) + { + errmsg = "error timeout"; + return false; + } } while((count--)&&(!done)); if (!done) @@ -615,8 +657,13 @@ snprintf(sreq,sizeof(sreq),"\n%s\n%s\n%s\n\n",url,sauthenticator.c_str(),prjname); res = req(sreq); if (res == NULL) - return false; + return false; kLogPrintf("request=\n %s\n\n answer=\n%s\n",sreq, res->toxmlstring().c_str()); + Item* error = res->findItem("error"); + if (error != NULL) + { + errmsg += error->getsvalue(); + } bool result = (res->findItem("success") != NULL); free(res); return result; diff -Nru boinctui-2.5.0/src/srvdata.h boinctui-2.7.0/src/srvdata.h --- boinctui-2.5.0/src/srvdata.h 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/srvdata.h 2022-05-05 18:31:58.000000000 +0000 @@ -59,7 +59,7 @@ class Srv : public TConnect //описание соединения с сервером { public: - Srv(const char* shost, const char* sport, const char* pwd); + Srv(const char* shost, const char* sport, const char* pwd, const char* hostid); virtual ~Srv(); void updateallprojects(); //обновить статистику static std::string findProjectName(Item* tree, const char* url); //найти в дереве tree имя проекта с заданным url @@ -96,6 +96,7 @@ void lock() { pthread_mutex_lock(&mutex); }; void unlock() { pthread_mutex_unlock(&mutex); }; bool loginfail; //true если получен unauthorize + char* hostid; protected: void updatestate(); //обновить состояние void updatemsgs(); //обновить список сообщений @@ -127,6 +128,7 @@ void refreshcfg(); //перечитать из конфига void clear(); //удалить все соединения void nextserver(); //переключиться на след сервер в списке + void prevserver(); protected: void addserver(Srv* c) { servers.push_back(c); }; std::list servers; //список соединений diff -Nru boinctui-2.5.0/src/statwin.cpp boinctui-2.7.0/src/statwin.cpp --- boinctui-2.5.0/src/statwin.cpp 2017-06-26 09:18:43.000000000 +0000 +++ boinctui-2.7.0/src/statwin.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -71,7 +71,7 @@ wborder(win, '|', '|', '-', '-', '+', '+', '+', '+'); else box(win,0,0); - mvwprintw(win,0,getwidth()/2-(caption.size()/2), this->caption.c_str()); + mvwprintw(win,0,getwidth()/2-(caption.size()/2), "%s",this->caption.c_str()); } @@ -84,7 +84,6 @@ //===данные статистики=== int startindexsave = content->getstartindex(); content->clearcontent(); - content->setstartindex(startindexsave); projects.clear(); std::map > allstat; @@ -139,7 +138,7 @@ //формируем содержимое окна на основе структуры projects std::vector::iterator itprj; std::list daylist; //для заголовков дней - NColorString* cs = new NColorString(getcolorpair(COLOR_CYAN, COLOR_BLACK) | A_BOLD, " %-*s %-*s", COLWIDTH-2, "", COLWIDTH-2, "Summary"); + NColorString* cs = new NColorString(getcolorpair(COLOR_CYAN, getbgcolor()) | A_BOLD, " %-*s %-*s", COLWIDTH-2, "", COLWIDTH-2, "Summary"); int n = hpos; for (itprj = projects.begin(); itprj != projects.end(); itprj++, n--) //проекты { @@ -148,7 +147,7 @@ std::string s = (*itprj).name.c_str(); if (s.size() > COLWIDTH) s.resize(COLWIDTH); - cs->append(getcolorpair(COLOR_RED, COLOR_BLACK) | A_BOLD, " %*s ", COLWIDTH, s.c_str()); //имена проектов + cs->append(getcolorpair(COLOR_RED, getbgcolor()) | A_BOLD, " %*s ", COLWIDTH, s.c_str()); //имена проектов std::list::iterator itdays; for(itdays = (*itprj).days.begin(); itdays!=(*itprj).days.end(); itdays++) { @@ -164,8 +163,8 @@ tm* daytm = localtime(&(*itday)); char buf[128] = "?"; strftime(buf, sizeof(buf),"%-2e %b",daytm); //"%-e %b %-k:%M" - NColorString* cs = new NColorString(getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD, "%-*s", COLWIDTH, buf); - cs->append(getcolorpair(COLOR_CYAN, COLOR_BLACK) | A_BOLD, " %*ld ", COLWIDTH, hostmode ? daysumhost[*itday] : daysumuser[*itday]); + NColorString* cs = new NColorString(getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD, "%-*s", COLWIDTH, buf); + cs->append(getcolorpair(COLOR_CYAN, getbgcolor()) | A_BOLD, " %*ld ", COLWIDTH, hostmode ? daysumhost[*itday] : daysumuser[*itday]); n = hpos; for (itprj = projects.begin(); itprj != projects.end(); itprj++, n--) //перебрать все проекты по этому дню { @@ -187,13 +186,14 @@ } } if (value != -1) - cs->append(getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD, " %*ld ",COLWIDTH, value); + cs->append(getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD, " %*ld ",COLWIDTH, value); else - cs->append(getcolorpair(COLOR_BLACK, COLOR_BLACK) | A_BOLD, " %*s ",COLWIDTH, "-"); + cs->append(getcolorpair(getbgcolor(), getbgcolor()) | A_BOLD, " %*s ",COLWIDTH, "-"); } content->addstring(cs); } } + content->setstartindex(startindexsave); srv->statisticsdom.releaseptr(tmpstatisticsdom); srv->statedom.releaseptr(tmpstatedom); } @@ -236,7 +236,7 @@ case KEY_NPAGE: if (!content->getautoscroll()) { - int oldpos = content->getstartindex(); + //int oldpos = content->getstartindex(); content->scrollto(getheight()/2); //вниз на пол окна } break; diff -Nru boinctui-2.5.0/src/taskinfowin.cpp boinctui-2.7.0/src/taskinfowin.cpp --- boinctui-2.5.0/src/taskinfowin.cpp 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/taskinfowin.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -40,7 +40,7 @@ case 9: result << "suspended"; break; case 5: result << "abort pending"; break; case 8: result << "quit pending"; break; - case 10: result << "copy panding"; break; + case 10: result << "copy pending"; break; }//switch } @@ -138,6 +138,23 @@ } } } + if( + !strcmp(item->getname(), "swap_size") || + !strcmp(item->getname(), "working_set_size") || + !strcmp(item->getname(), "working_set_size_smoothed") + ) + { + double d = item->getdvalue()/(1024*1024*1024); + if (d < 1) + { + d *= 1024; + result << std::setprecision(4) << d << "MB"; + } + else + { + result << std::setprecision(4) << d << "GB"; + } + } return result.str(); } @@ -160,9 +177,9 @@ std::string svalhr = raw2hr(*it2); if (svalhr.length()) sval = sval + " (" + svalhr + ")"; - if (strlen((*it2)->getname()) > maxlen1) + if ((int)strlen((*it2)->getname()) > maxlen1) maxlen1 = strlen((*it2)->getname()); - if (sval.length()/*strlen((*it2)->getsvalue())*/ > maxlen2) + if ((int)sval.length()/*strlen((*it2)->getsvalue())*/ > maxlen2) maxlen2 = sval.length() /*strlen((*it2)->getsvalue())*/; vout.push_back(std::pair((*it2)->getname(), sval/*(*it2)->getsvalue()*/)); } @@ -221,7 +238,7 @@ wborder(win, '|', '|', '-', '-', '+', '+', '+', '+'); else box(win,0,0); - mvwprintw(win,0,getwidth()/2-(strlen(caption)/2), this->caption.c_str()); + mvwprintw(win,0,getwidth()/2-(strlen(caption)/2), "%s",this->caption.c_str()); scrollbar = new NScrollBar(NRect(content->getheight()+2,1, content->getbegrow()-1, getwidth()-1), 0, 0, ACS_VLINE); content->setscrollbar(scrollbar); @@ -234,72 +251,72 @@ void TaskInfoWin::updatedata() { if (srv == NULL) - return; + return; //===данные по процессам=== if (srv->statedom.empty()) - return; + return; Item* tmpstatedom = srv->statedom.hookptr(); Item* client_state = tmpstatedom->findItem("client_state"); std::vector > ss; maxlen1 = 0; maxlen2 = 0; + int oldstartindex = content->getstartindex(); if (client_state != NULL) { - int oldstartindex = content->getstartindex(); - content->clearcontent(); + content->clearcontent(); std::vector results = client_state->getItems("result"); - std::vector::iterator it; - for (it = results.begin(); it!=results.end(); it++) //цикл списка задач - { - Item* project_url = (*it)->findItem("project_url"); - Item* name = (*it)->findItem("name"); - if ((project_url != NULL)&& - (name != NULL)&& - (strcmp(project_url->getsvalue(), projecturl.c_str()) == 0)&& - (strcmp(name->getsvalue(), taskname.c_str()) == 0)) - { - //имя проекта - std::string pname = srv->findProjectName(tmpstatedom, (*it)->findItem("project_url")->getsvalue()); - ss.push_back(std::pair("PROJECT NAME", pname)); - //имя приложения - char buf[256]; - snprintf(buf, sizeof(buf),"%s","unknown application"); - Item* wu_name = (*it)->findItem("wu_name"); - if (wu_name != NULL) + std::vector::iterator it; + for (it = results.begin(); it!=results.end(); it++) //цикл списка задач { - Item* app = srv->findappbywuname(wu_name->getsvalue()); - if (app != NULL) - { - Item* user_friendly_name = app->findItem("user_friendly_name"); - if (user_friendly_name != NULL) - snprintf(buf, sizeof(buf),"%s",user_friendly_name->getsvalue()); - } - } - ss.push_back(std::pair("APP NAME", buf)); - ss.push_back(std::pair("", "")); - //raw данные - Tree2Text(*it, ss, maxlen1, maxlen2); - break; - } - } //цикл списка задач - content->setstartindex(oldstartindex); - needrefresh = true; + Item* project_url = (*it)->findItem("project_url"); + Item* name = (*it)->findItem("name"); + if ((project_url != NULL)&& + (name != NULL)&& + (strcmp(project_url->getsvalue(), projecturl.c_str()) == 0)&& + (strcmp(name->getsvalue(), taskname.c_str()) == 0)) + { + //имя проекта + std::string pname = srv->findProjectName(tmpstatedom, (*it)->findItem("project_url")->getsvalue()); + ss.push_back(std::pair("PROJECT NAME", pname)); + //имя приложения + char buf[256]; + snprintf(buf, sizeof(buf),"%s","unknown application"); + Item* wu_name = (*it)->findItem("wu_name"); + if (wu_name != NULL) + { + Item* app = srv->findappbywuname(wu_name->getsvalue()); + if (app != NULL) + { + Item* user_friendly_name = app->findItem("user_friendly_name"); + if (user_friendly_name != NULL) + snprintf(buf, sizeof(buf),"%s",user_friendly_name->getsvalue()); + } + } + ss.push_back(std::pair("APP NAME", buf)); + ss.push_back(std::pair("", "")); + //raw данные + Tree2Text(*it, ss, maxlen1, maxlen2); + break; + } + } //цикл списка задач + needrefresh = true; } srv->statedom.releaseptr(tmpstatedom); //заполняем визуальные строки std::vector >::iterator it; for (it = ss.begin(); it!=ss.end(); it++) { - int varcolor = getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD; - int valcolor = getcolorpair(COLOR_WHITE, COLOR_BLACK) | A_BOLD; - if ((FindVar(ssbak, (*it).first) != (*it).second)&&(!ssbak.empty())) - valcolor = getcolorpair(COLOR_CYAN, COLOR_BLACK) | A_BOLD; - - NColorString* cs = new NColorString(varcolor, "%-*s ", maxlen1, (*it).first.c_str()); - cs->append(valcolor, "%s\n", (*it).second.c_str()); - content->addstring(cs); + int varcolor = getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD; + int valcolor = getcolorpair(COLOR_WHITE, getbgcolor()) | A_BOLD; + if ((FindVar(ssbak, (*it).first) != (*it).second)&&(!ssbak.empty())) + valcolor = getcolorpair(COLOR_CYAN, getbgcolor()) | A_BOLD; + + NColorString* cs = new NColorString(varcolor, "%-*s ", maxlen1, (*it).first.c_str()); + cs->append(valcolor, "%s\n", (*it).second.c_str()); + content->addstring(cs); } ssbak = ss; + content->setstartindex(oldstartindex); } diff -Nru boinctui-2.5.0/src/taskwin.cpp boinctui-2.7.0/src/taskwin.cpp --- boinctui-2.5.0/src/taskwin.cpp 2016-10-19 07:57:46.000000000 +0000 +++ boinctui-2.7.0/src/taskwin.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include "taskwin.h" #include "net.h" #include "resultparse.h" @@ -122,6 +124,18 @@ } +bool resultCmpLessByRcv( Item* res1, Item* res2 ) //для сортировки задач true если res1 < res2 +{ + Item* received_time1 = res1->findItem("received_time"); + Item* received_time2 = res2->findItem("received_time"); + if ( ( received_time1 != NULL) && (received_time2 != NULL) ) + return (received_time1->getdvalue() > received_time2->getdvalue()); + if ( ( received_time1 != NULL) && (received_time2 == NULL) ) + return true; + return false; +} + + bool resultCmpLessByDL( Item* res1, Item* res2 ) //для сортировки задач true если res1 < res2 { Item* report_deadline1 = res1->findItem("report_deadline"); @@ -136,6 +150,7 @@ return false; } + /* bool resultCmpLessByApp( Item* res1, Item* res2 ) //для сортировки задач true если res1 < res2 { @@ -143,6 +158,19 @@ } */ + +bool resultCmpLessBySwap( Item* res1, Item* res2 ) //для сортировки задач true если res1 < res2 +{ + Item* swap_size1 = res1->findItem("swap_size"); + Item* swap_size2 = res2->findItem("swap_size"); + if ( ( swap_size1 != NULL) && (swap_size2 != NULL) ) + return (swap_size1->getdvalue() > swap_size2->getdvalue()); + if ( ( swap_size1 != NULL) && (swap_size2 == NULL) ) + return true; + return false; +} + + bool resultCmpLessByTask( Item* res1, Item* res2 ) //для сортировки задач true если res1 < res2 { Item* name1 = res1->findItem("name"); @@ -217,6 +245,23 @@ } +std::string gethumanreadablesize(size_t size) +{ + std::stringstream s; + size_t sizemb=std::round(size/(1024.0*1024.0)); + if(sizemb==0) + s<<" - "; + else + { + if(sizemb<9999) + s<statedom.empty()) return; @@ -389,12 +435,18 @@ fcmpless = resultCmpLessByProject; //по project break; case 4: - fcmpless = resultCmpLessByEstimate; //по estimate + fcmpless = resultCmpLessByRcv; //по rcv break; case 5: + fcmpless = resultCmpLessByEstimate; //по estimate + break; + case 6: fcmpless = resultCmpLessByDL; //по deadline break; - case 7: + case 8: + fcmpless = resultCmpLessBySwap; //по swap + break; + case 9: fcmpless = resultCmpLessByTask; //по task break; }//switch @@ -408,23 +460,23 @@ if (name) { int column = 0; - int attr = getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_NORMAL; //ставим цвет по умолчанию + int attr = getcolorpair(COLOR_WHITE,getbgcolor()) | A_NORMAL; //ставим цвет по умолчанию NColorString* cs = new NColorString(attr, ""); std::string sstate = getresultstatestr(*it); //состояние задачи //цвет и атрибут в зависимости от состояния задачи if ((*it)->findItem("ready_to_report") != NULL) - attr = getcolorpair(COLOR_BLACK,COLOR_BLACK) | A_BOLD; + attr = getcolorpair(getbgcolor(),getbgcolor()) | A_BOLD; if ((*it)->findItem("active_task") != NULL) - attr = getcolorpair(COLOR_WHITE,COLOR_BLACK) | A_BOLD; //ставим цвет по умолчанию + A_BOLD; + attr = getcolorpair(COLOR_WHITE,getbgcolor()) | A_BOLD; //ставим цвет по умолчанию + A_BOLD; if ( sstate == "Run") - attr = getcolorpair(COLOR_YELLOW,COLOR_BLACK) | A_BOLD; + attr = getcolorpair(COLOR_YELLOW,getbgcolor()) | A_BOLD; if ( sstate == "Upld") - attr = getcolorpair(COLOR_BLUE,COLOR_BLACK) | A_BOLD; + attr = getcolorpair(COLOR_BLUE,getbgcolor()) | A_BOLD; if ( sstate == "Dwnld") - attr = getcolorpair(COLOR_GREEN,COLOR_BLACK) | A_BOLD; + attr = getcolorpair(COLOR_GREEN,getbgcolor()) | A_BOLD; int stateattr = attr; if (( sstate == "DoneEr" ) || ( sstate == "Abort" ) || ( sstate == "WMem" )) - stateattr = getcolorpair(COLOR_RED,COLOR_BLACK)/* | A_BOLD*/; + stateattr = getcolorpair(COLOR_RED,getbgcolor())/* | A_BOLD*/; //проверяем нужно-ли отображать эту задачу if ( !( @@ -435,7 +487,7 @@ continue; //пропускаем задачи не подходящие фильтру tasklistmode //колонка 0 номер задачи if(iscolvisible(column++)) - cs->append(attr, " %2d ", tasknumber++); + cs->append(attr, "%3d ", tasknumber++); //колонка 1 состояние char sdone[64]; if (!fraction_done) //для неактивных секция fraction_done отсутствует @@ -450,11 +502,11 @@ if (plan_class != NULL) { if ((strstr(plan_class->getsvalue(),"ati") != NULL )||(strstr(plan_class->getsvalue(),"opencl") != NULL)) - attrgpu = getcolorpair(COLOR_MAGENTA,COLOR_BLACK) | A_BOLD; + attrgpu = getcolorpair(COLOR_MAGENTA,getbgcolor()) | A_BOLD; if (strstr(plan_class->getsvalue(),"cuda") != NULL ) - attrgpu = getcolorpair(COLOR_GREEN,COLOR_BLACK) | A_BOLD; + attrgpu = getcolorpair(COLOR_GREEN,getbgcolor()) | A_BOLD; if (strstr(plan_class->getsvalue(),"intel") != NULL ) //NEED CHECK !!! - attrgpu = getcolorpair(COLOR_BLUE,COLOR_BLACK) | A_BOLD; + attrgpu = getcolorpair(COLOR_BLUE,getbgcolor()) | A_BOLD; } if (( sstate != "Run" )||( sstate != "Done")) // attrgpu = attrgpu & (~A_BOLD); //выключаем болд для незапущенных @@ -475,7 +527,7 @@ { double dtime = estimated_cpu_time_remaining->getdvalue(); if ( ( sstate == "Run" )&&( dtime < 600)&&( dtime >= 0 ) ) //осталось [0-600[ сек - attr2 = getcolorpair(COLOR_RED,COLOR_BLACK) | A_BOLD; + attr2 = getcolorpair(COLOR_RED,getbgcolor()) | A_BOLD; if ( dtime >= 0) cs->append(attr2," %4s", gethumanreadabletimestr(dtime).c_str()); //естимейт else @@ -484,7 +536,21 @@ else cs->append(attr2," %4s", "?"); } - //колонка 5 время дедлайн + //колонка 5 received time column + if(iscolvisible(column++)) + { + Item* received_time = (*it)->findItem("received_time"); + int attr2 = attr; + if (received_time != NULL) + { + double dtime = received_time->getdvalue(); + double beforedl = time(NULL) - dtime; //число секунд c момента получениия задачи + cs->append(attr2," %4s", gethumanreadabletimestr(beforedl).c_str()); + } + else + cs->append(attr," %4s", "?"); + } + //колонка 6 время дедлайн if(iscolvisible(column++)) { Item* report_deadline = (*it)->findItem("report_deadline"); @@ -494,13 +560,13 @@ double dtime = report_deadline->getdvalue(); double beforedl = dtime - time(NULL); //число секунд до дедлайна if ( ( sstate != "Done")&&( beforedl < 3600 * 24 * 2) ) //осталось меньше 2-х дней - attr2 = getcolorpair(COLOR_BLUE,COLOR_BLACK) | A_BOLD; + attr2 = getcolorpair(COLOR_BLUE,getbgcolor()) | A_BOLD; cs->append(attr2," %4s", (beforedl>0) ? gethumanreadabletimestr(beforedl).c_str() : "dead"); } else cs->append(attr2," %4s", "?"); } - //колонка 6 имя приложения + //колонка 7 имя приложения if(iscolvisible(column++)) { char buf[256]; @@ -520,7 +586,18 @@ mbstrtrunc(buf,30); cs->append(attr," %-30s", buf); } - //колонка 7 имя задачи + //колонка 8 swap size + if(iscolvisible(column++)) + { + Item* swap_size = (*it)->findItem("swap_size"); + if (swap_size != NULL) + { + cs->append(attr," %5s ", gethumanreadablesize(swap_size->getdvalue()).c_str()); + } + else + cs->append(attr," %5s ", " - "); + } + //колонка 9 имя задачи if(iscolvisible(column++)) cs->append(attr," %s", name->getsvalue()); //добавляем сформированную строку и поле данных с именем задачи (для селектора) @@ -531,6 +608,7 @@ } //цикл списка задач } srv->statedom.releaseptr(tmpstatedom); + setstartindex(oldindex); } @@ -539,7 +617,7 @@ NSelectList::eventhandle(ev); //предок if ( ev->done ) return; - bool selectorvisiblebak = (selectedindex >= 0)&&(selectedindex < content.size()); //состояние селектора до + bool selectorvisiblebak = (selectedindex >= 0)&&(selectedindex < (int)content.size()); //состояние селектора до //одиночный или двойной клик NMouseEvent* mevent = (NMouseEvent*)ev; if (( ev->type == NEvent::evMOUSE ) && (mevent->cmdcode & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))) @@ -567,7 +645,7 @@ break; case KEY_ENTER: case '\n': - if ((selectedindex >= 0)&&(selectedindex < content.size())) //селектор видимый + if ((selectedindex >= 0)&&(selectedindex < (int)content.size())) //селектор видимый putevent(new TuiEvent(evTASKINFO)); break; default: @@ -604,9 +682,9 @@ } } //если изменилась видимость селектора, то генерируем соотв евент - if (((selectedindex >= 0)&&(selectedindex < content.size()) )&&(!selectorvisiblebak)) + if (((selectedindex >= 0)&&(selectedindex < (int)content.size()) )&&(!selectorvisiblebak)) putevent(new TuiEvent(evTASKSELECTORON)); //селектор включился - if (((selectedindex == -1)||(selectedindex == content.size()))&&(selectorvisiblebak)) + if (((selectedindex == -1)||(selectedindex == (int)content.size()))&&(selectorvisiblebak)) putevent(new TuiEvent(evTASKSELECTOROFF)); //селектор выключился if (ev->done) //если обработали, то нужно перерисоваться diff -Nru boinctui-2.5.0/src/topmenu.cpp boinctui-2.7.0/src/topmenu.cpp --- boinctui-2.5.0/src/topmenu.cpp 2017-06-26 09:18:43.000000000 +0000 +++ boinctui-2.7.0/src/topmenu.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -30,6 +30,7 @@ #define M_HELP "Help" //Названия пунктов меню "File" #define M_NEXT_HOST "Next BOINC host" +#define M_PREV_HOST "Prev BOINC host" #define M_CONFIG_HOSTS "Configure host list" #define M_VIEW_STATS "View Statistics" #define M_RUN_BENCHMARKS "Run CPU benchmarks" @@ -40,8 +41,10 @@ #define M_VIEW_DONE "Percent done column" #define M_VIEW_PROJECT "Project name column" #define M_VIEW_ESTIMATE "Estimate time column" +#define M_VIEW_RCV "Receive time column" #define M_VIEW_DEADLINE "Deadline time column" #define M_VIEW_APPNAME "Application name column" +#define M_VIEW_SWAP "Swap size column" #define M_VIEW_TASKNAME "Task name column" #define M_ALL_TASKS "All tasks" #define M_HIDE_DONE "Hide done tasks" @@ -51,12 +54,16 @@ #define M_SORT_BY_DONE "Sort by done %" #define M_SORT_BY_PROJECT "Sort by project name" #define M_SORT_BY_ESTIMATE "Sort by estimate time" +#define M_SORT_BY_RCV "Sort by receive time" #define M_SORT_BY_DL "Sort by deadline" #define M_SORT_BY_APP "Sort by application" +#define M_SORT_BY_SWAP "Sort by swap size" #define M_SORT_BY_TASK "Sort by task name" #define M_ASCII_LINE_DRAW "ASCII line draw" +#define M_TRANSPARENT_BG "Transparent background" //Названия пунктов меню "Projects" #define M_ADD_PROJECT "Add project" +#define M_ADD_PROJECT_BY_URL "Add project by URL" #define M_CONNECT_MANAGER "Connect to account manager" #define M_SYNCHRONIZE_MANAGER "Synchronize with manager" #define M_DISCONNECT_MANAGER "Stop using account manager" @@ -230,6 +237,7 @@ FileSubMenu::FileSubMenu(NRect rect) : NMenu(rect) { additem(M_NEXT_HOST," N"); + additem(M_PREV_HOST," P"); additem(M_CONFIG_HOSTS," C"); additem(M_VIEW_STATS," V"); additem(M_RUN_BENCHMARKS,""); @@ -243,6 +251,8 @@ putevent(new NEvent(NEvent::evKB, KEY_F(9))); //закрыть осн меню if ( strcmp(item_name(current_item(menu)),M_NEXT_HOST) == 0 ) putevent(new NEvent(NEvent::evKB, 'N')); //создаем событие иммитирующее нажатие 'N' + if ( strcmp(item_name(current_item(menu)),M_PREV_HOST) == 0 ) + putevent(new NEvent(NEvent::evKB, 'P')); if ( strcmp(item_name(current_item(menu)),M_CONFIG_HOSTS) == 0 ) putevent(new NEvent(NEvent::evKB, 'C')); //создаем событие иммитирующее нажатие 'C' if ( strcmp(item_name(current_item(menu)),M_VIEW_STATS) == 0 ) @@ -266,8 +276,10 @@ additem(M_VIEW_DONE, iscolenable(/*cfg,*/colnum++) ? "[*]" : "[ ]"); additem(M_VIEW_PROJECT, iscolenable(/*cfg,*/colnum++) ? "[*]" : "[ ]"); additem(M_VIEW_ESTIMATE, iscolenable(/*cfg,*/colnum++) ? "[*]" : "[ ]"); + additem(M_VIEW_RCV, iscolenable(/*cfg,*/colnum++) ? "[*]" : "[ ]"); additem(M_VIEW_DEADLINE, iscolenable(/*cfg,*/colnum++) ? "[*]" : "[ ]"); additem(M_VIEW_APPNAME, iscolenable(/*cfg,*/colnum++) ? "[*]" : "[ ]"); + additem(M_VIEW_SWAP, iscolenable(/*cfg,*/colnum++) ? "[*]" : "[ ]"); additem(M_VIEW_TASKNAME, iscolenable(/*cfg,*/colnum++) ? "[*]" : "[ ]"); additem("",""); int taskslistmode = 0; @@ -298,12 +310,15 @@ additem(M_SORT_BY_STATE, (taskssortmode == 1) ? "(*)" : "( )"); additem(M_SORT_BY_DONE, (taskssortmode == 2) ? "(*)" : "( )"); additem(M_SORT_BY_PROJECT, (taskssortmode == 3) ? "(*)" : "( )"); - additem(M_SORT_BY_ESTIMATE, (taskssortmode == 4) ? "(*)" : "( )"); - additem(M_SORT_BY_DL, (taskssortmode == 5) ? "(*)" : "( )"); - //additem(M_SORT_BY_APP, (taskssortmode == 6) ? "(*)" : "( )"); //not implemented yet - additem(M_SORT_BY_TASK, (taskssortmode == 7) ? "(*)" : "( )"); + additem(M_SORT_BY_RCV, (taskssortmode == 4) ? "(*)" : "( )"); + additem(M_SORT_BY_ESTIMATE, (taskssortmode == 5) ? "(*)" : "( )"); + additem(M_SORT_BY_DL, (taskssortmode == 6) ? "(*)" : "( )"); + //additem(M_SORT_BY_APP, (taskssortmode == 7) ? "(*)" : "( )"); //not implemented yet + additem(M_SORT_BY_SWAP, (taskssortmode == 8) ? "(*)" : "( )"); + additem(M_SORT_BY_TASK, (taskssortmode == 9) ? "(*)" : "( )"); additem("",""); additem(M_ASCII_LINE_DRAW, (asciilinedraw == 1) ? "[*]" : "[ ]"); + additem(M_TRANSPARENT_BG, (transparentbg == 1) ? "[*]" : "[ ]"); additem(NULL,NULL); } @@ -372,27 +387,39 @@ return true; } + if ( strcmp(item_name(current_item(menu)), M_SORT_BY_RCV) == 0 ) + { + putevent(new TuiEvent(evSORTMODECH, 4)); + return true; + } + if ( strcmp(item_name(current_item(menu)), M_SORT_BY_ESTIMATE) == 0 ) { - putevent(new TuiEvent(evSORTMODECH, 4)); + putevent(new TuiEvent(evSORTMODECH, 5)); return true; } if ( strcmp(item_name(current_item(menu)), M_SORT_BY_DL) == 0 ) { - putevent(new TuiEvent(evSORTMODECH, 5)); + putevent(new TuiEvent(evSORTMODECH, 6)); return true; } if ( strcmp(item_name(current_item(menu)), M_SORT_BY_APP) == 0 ) { - putevent(new TuiEvent(evSORTMODECH, 6)); + putevent(new TuiEvent(evSORTMODECH, 7)); return true; } + if ( strcmp(item_name(current_item(menu)), M_SORT_BY_SWAP) == 0 ) + { + putevent(new TuiEvent(evSORTMODECH, 8)); + return true; + } + if ( strcmp(item_name(current_item(menu)), M_SORT_BY_TASK) == 0 ) { - putevent(new TuiEvent(evSORTMODECH, 7)); + putevent(new TuiEvent(evSORTMODECH, 9)); return true; } @@ -403,6 +430,12 @@ return true; } + if ( strcmp(item_name(current_item(menu)), M_TRANSPARENT_BG) == 0 ) + { + putevent(new TuiEvent(evTRANSPARENTBGMODECHANGE)); + return true; + } + putevent(new TuiEvent(evCOLVIEWCH,item_index(current_item(menu)), false)); return true; } @@ -452,6 +485,7 @@ } } additem(M_ADD_PROJECT,""); + additem(M_ADD_PROJECT_BY_URL,""); if (acctmgrname.empty()) additem(M_CONNECT_MANAGER,""); else @@ -468,7 +502,7 @@ if (client_state != NULL) { std::vector projects = client_state->getItems("project"); - for (int i = 0; i < projects.size(); i++) + for (uint i = 0; i < projects.size(); i++) { Item* project_name = projects[i]->findItem("project_name"); if (project_name != NULL) @@ -490,7 +524,7 @@ bool ProjectsSubMenu::action() { - bool result = false; + //bool result = false; if (items.size() > 1) //если уже открыто выходим (>1 из-за скроллбара) return false; //формируем код операции для подменю @@ -503,6 +537,18 @@ insert(new ProjectAllListSubMenu(NRect(5,25,beginrow, begincol), srv)); actiondone = true; } + if ( strcmp(item_name(current_item(menu)), M_ADD_PROJECT_BY_URL) == 0 ) //подключиться к проекту по url + { + if (srv != NULL) + { + const char* prjname = item_name(current_item(menu)); + //создаем подменю для выбора новый/существующий пользователь + int begincol = getwidth() - 2; //смещение на экране по горизонтали + int beginrow = 2 + item_index(current_item(menu)) - top_row(menu); //смещение на экране по вертикали + insert(new ProjectUserExistSubMenu(NRect(5,25,beginrow, begincol), srv, prjname, true)); + } + actiondone = true; + } if ( strcmp(item_name(current_item(menu)), M_CONNECT_MANAGER) == 0 ) //подключить менеджер { insert(new ProjectAccMgrSubMenu(NRect(5,25,beginrow, begincol), srv)); @@ -771,7 +817,7 @@ if (projects != NULL) { std::vector projlist = projects->getItems("project"); - for (int i = 0; i < projlist.size(); i++) + for (uint i = 0; i < projlist.size(); i++) { Item* name = projlist[i]->findItem("name"); Item* general_area = projlist[i]->findItem("general_area"); @@ -799,7 +845,7 @@ //создаем подменю для выбора новый/существующий пользователь int begincol = getwidth() - 2; //смещение на экране по горизонтали int beginrow = 2 + item_index(current_item(menu)) - top_row(menu); //смещение на экране по вертикали - insert(new ProjectUserExistSubMenu(NRect(5,25,beginrow, begincol), srv, prjname)); + insert(new ProjectUserExistSubMenu(NRect(5,25,beginrow, begincol), srv, prjname, false)); } return true; } @@ -853,7 +899,7 @@ if (projects != NULL) { std::vector mgrlist = projects->getItems("account_manager"); - for (int i = 0; i < mgrlist.size(); i++) + for (uint i = 0; i < mgrlist.size(); i++) { Item* name = mgrlist[i]->findItem("name"); if (name != NULL) @@ -924,10 +970,11 @@ //============================================================================================= -ProjectUserExistSubMenu::ProjectUserExistSubMenu(NRect rect, Srv* srv, const char* prjname) : NMenu(rect) +ProjectUserExistSubMenu::ProjectUserExistSubMenu(NRect rect, Srv* srv, const char* prjname, bool byurl) : NMenu(rect) { this->srv = srv; this->prjname = prjname; + this->byurl = byurl; additem(M_PROJECT_USER_EXIST,""); additem(M_PROJECT_NEW_USER,""); @@ -942,9 +989,9 @@ if (srv != NULL) { if ( strcmp(item_name(current_item(menu)),M_PROJECT_USER_EXIST) == 0 ) - putevent(new TuiEvent(evADDPROJECT, srv, prjname.c_str(), true)); + putevent(new TuiEvent(evADDPROJECT, srv, prjname.c_str(), true, this->byurl)); if ( strcmp(item_name(current_item(menu)),M_PROJECT_NEW_USER) == 0 ) - putevent(new TuiEvent(evADDPROJECT, srv, prjname.c_str(), false)); + putevent(new TuiEvent(evADDPROJECT, srv, prjname.c_str(), false, this->byurl)); } return true; } diff -Nru boinctui-2.5.0/src/topmenu.h boinctui-2.7.0/src/topmenu.h --- boinctui-2.5.0/src/topmenu.h 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/topmenu.h 2022-05-05 18:31:58.000000000 +0000 @@ -117,12 +117,13 @@ class ProjectUserExistSubMenu : public NMenu //выпадающие меню третего New/Exist user { public: - ProjectUserExistSubMenu(NRect rect, Srv* srv, const char* prjname); + ProjectUserExistSubMenu(NRect rect, Srv* srv, const char* prjname, bool byurl); virtual void eventhandle(NEvent* ev); //обработчик событий protected: virtual bool action(); //вызывается при нажатии Enter Srv* srv; //текущий отображаемый сервер std::string prjname; //имя выбранного проекта + bool byurl = false; //true если добавляем по url }; diff -Nru boinctui-2.5.0/src/tuievent.h boinctui-2.7.0/src/tuievent.h --- boinctui-2.5.0/src/tuievent.h 2016-07-15 10:27:32.000000000 +0000 +++ boinctui-2.7.0/src/tuievent.h 2022-05-05 18:31:58.000000000 +0000 @@ -39,6 +39,7 @@ evTASKSELECTORON, //генерируется когда селектор задач становится видимым evTASKSELECTOROFF, //генерируется когда селектор задач становится скрытым evASCIIMODECHANGE, //генерируется при переключении режима ASCII рамок + evTRANSPARENTBGMODECHANGE, //генерируется при переключении прозрачности бэкграунда evPOPUPMSG //генерируется когда нужно открыть попап сообщение }; @@ -47,11 +48,12 @@ { public: TuiEvent(TuiEventType type) : NEvent(evPROG, type) {}; - TuiEvent(TuiEventType type, Srv* srv, const char* prjname, bool userexist) : NEvent(evPROG, type) //событие для добавления проекта + TuiEvent(TuiEventType type, Srv* srv, const char* prjname, bool userexist, bool byurl) : NEvent(evPROG, type) //событие для добавления проекта { this->srv = srv; this->sdata1 = prjname; this->bdata1 = userexist; + this->bdata2 = byurl; }; TuiEvent(TuiEventType type, Srv* srv, const char* mgrname) : NEvent(evPROG, type) //событие для подключения к менеджеру { @@ -84,7 +86,8 @@ Srv* srv; std::string sdata1; //произвольная строка std::string sdata2; //произвольная строка - bool bdata1; //произаольная bool переменная + bool bdata1; //произвольная bool переменная + bool bdata2; //произвольная bool переменная int idata1; //произвольное целое }; diff -Nru boinctui-2.5.0/src/tui-main.cpp boinctui-2.7.0/src/tui-main.cpp --- boinctui-2.5.0/src/tui-main.cpp 2017-06-26 09:18:43.000000000 +0000 +++ boinctui-2.7.0/src/tui-main.cpp 2022-05-05 18:31:58.000000000 +0000 @@ -16,12 +16,15 @@ // ============================================================================= #include +#include +#include #if HAVE_LIBNCURSESW == 1 && NCURSESW_HAVE_SUBDIR == 1 #include #else #include #endif #include +#include #include "kclog.h" #include "mainprog.h" @@ -41,6 +44,7 @@ mousemask(ALL_MOUSE_EVENTS, NULL); // Report all mouse events #endif timeout(100); //ожидание для getch() 100 милисекунд + use_default_colors(); start_color(); } @@ -54,24 +58,135 @@ } +void printhelp() +{ + printf + ( + "\n\nusage: \n" + " boinctui [--help] [--boinchost=:] [--pwd=]\n\n" + " -b, --boinchost ip address and port of boinc server host\n" + " -p, --pwd boinc password\n" + " -h, --help print this help and exit\n" + "\nexamples: \n" + " boinctui --boinchost=192.168.1.123 --pwd=my_password -default port 31416 is used\n" + " boinctui --boinchost=192.168.1.123:31416 -connect with empty password\n" + " boinctui --boinchost=localhost -connect to localhost with defaul port and\n" + " password from /var/lib/boinc-client/gui_rpc_auth.cfg\n" + "\n" + ); +} + + +std::string hostname2ip(std::string& hostname) +{ + std::string result=""; + struct hostent *he; + struct in_addr **addr_list; + if ((he=gethostbyname(hostname.c_str()))==NULL) + { + printf("cat't resolve gethostbyname"); + return result; + } + addr_list = (struct in_addr **) he->h_addr_list; + for(int i=0; addr_list[i]!=NULL; i++) + { + char ip[100]; + strcpy(ip,inet_ntoa(*addr_list[i])); + if(i>0) + result+=","; + result+=ip; + } + return result; +} + + +bool parseargs(int argc, char ** argv) +{ + bool result=true; + int c; + while (1) + { + static struct option long_options[] = + { + {"help", no_argument, 0, 'h'}, + {"boinchost", required_argument, 0, 'b'}, + {"pwd", required_argument, 0, 'p'}, + {0, 0, 0, 0} + }; + int option_index = 0; + c = getopt_long (argc, argv, "hb:p:",long_options, &option_index); + if (c == -1) + break; + switch (c) + { + case 0: + if (long_options[option_index].flag != 0) + break; + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + case 'h': + printhelp(); + result=false; + break; + case 'b': + { + gCfg->cmdlinehost=optarg; + int pos=gCfg->cmdlinehost.find_last_of(":"); + if(pos!=std::string::npos) + { + gCfg->cmdlineport=gCfg->cmdlinehost.substr(pos+1); + gCfg->cmdlinehost.resize(pos); + } + char ip[100]; + std::string hostip=hostname2ip(gCfg->cmdlinehost); + gCfg->cmdlocalhost=(hostip.find("127.0.0.1")!=std::string::npos); + printf ("boinc server '%s' %s %s\n" + , gCfg->cmdlinehost.c_str() + ,(gCfg->cmdlinehost!=hostip)?hostip.c_str():"" + ,(gCfg->cmdlocalhost)?"(local host)":"" + ); + printf ("boinc server TCP port '%s'\n", gCfg->cmdlineport.c_str()); + break; + } + case 'p': + gCfg->cmdlinepwd=optarg; + break; + case '?': + result=false; + break; + default: + break; + } + } + return result; +} + + int main(int argc, char ** argv) { MainProg* mainprog; kLogOpen("boinctui.log"); - initcurses(); #ifdef DEBUG struct mallinfo minf1 = mallinfo(); #endif - mainprog = new MainProg(); - mainprog->refresh(); - mainprog->mainloop(); //запускаем осн. цикл событий - delete mainprog; + gCfg = new Config(".boinctui.cfg"); + if(parseargs(argc,argv)) + { + initcurses(); + mainprog = new MainProg(); + mainprog->refresh(); + mainprog->mainloop(); //запускаем осн. цикл событий + delete mainprog; + donecurses(); + } #ifdef DEBUG struct mallinfo minf2 = mallinfo(); kLogPrintf("mallinfo.uordblks= %d-%d = %d (bytes leak)\n",minf1.uordblks,minf2.uordblks, minf2.uordblks-minf1.uordblks); //malloc_stats(); #endif - donecurses(); kLogClose(); exit(EXIT_SUCCESS); }