diff -Nru fotoxx-20.09/data/userguide fotoxx-20.10/data/userguide --- fotoxx-20.09/data/userguide 2020-02-25 10:35:49.000000000 +0000 +++ fotoxx-20.10/data/userguide 2020-03-04 07:44:16.000000000 +0000 @@ -248,6 +248,7 @@ |MONITOR GAMMA| - tool to adjust monitor gamma |CHANGE LANGUAGE| - change the language of the menus and dialogs |MISSING TRANSLATIONS| - list missing translations for the current language + |PHONE HOME| - enable or disable anonymous usage statistics |SHOW RESOURCES| - show CPU time and current memory usage |APPIMAGE FILES| - list the files included in the Appimage container |ZAPPCRASH TEST| - test crash report with source code line numbers @@ -338,12 +339,6 @@ introductory sections of this user guide. Help for individual functions can be referenced as needed during use, by using the F1 key. - \_Phone Home - Fotoxx will occasionally send a message to its web host for usage statistics. Nothing - is kept that could be associated with a person or location. If you still object, this - feature can be turned off in Tools > Phone Home. - Fotoxx privacy policy: \_https://gitlab.com/fotoxx/fotoxx/wikis/privacy - \_Translations Translations of the user interface are available for French, German, Spanish, Catalan, Italian, and Portuguese. If you can help with translations, review the topic @@ -5232,6 +5227,19 @@ the Fotoxx home folder. Here it can be easily accessed for adding or revising translations. +PHONE HOME + +image: phone-home.jpg + This dialog is shown if you are a new user installing Fotoxx for the first time, i.e. + your Fotoxx home folder (default /home//.fotoxx) does not exist. + + If you permit, Fotoxx sends an occasional message to its web host (kornelix.net) with + usage statistics. This is max. one per day. The data sent is entirely anonymous and + contains nothing that can be linked to a user or computer or location. If you decline, + a single message is sent to add one to an aggregate count of declining users. If you + elect "do nothing", nothing is done and no message is sent. You can change your mind + about this at any time. Use the menu Tools > Phone Home for this. + More details: \_https://gitlab.com/fotoxx/fotoxx/wikis/privacy + SHOW RESOURCES The following data is output to the log file (or terminal window): • process time: CPU time used, since the last time shown @@ -5611,6 +5619,7 @@ |PREFERENCES| - TIFF and PNG file compression settings. |PREFERENCES| - choose program for playing videos: totem, vlc ... |TECHNICAL NOTES|- how symbolic links are handled in Fotoxx. + |PHONE HOME| - enable or disable anonymous usage statistics. TECHNICAL NOTES @@ -6146,6 +6155,7 @@ |PATTERN| - add a background pattern to an image |PERMISSIONS| - view and set permissions for an image file |PERSPECTIVE| - straighten an object photographed from an obtuse angle + |PHONE HOME| - enable or disable anonymous usage statistics |PLACES/DATES| - list image locations and date groups, click for gallery |PLUGINS| - use another image edit application as a Fotoxx edit function |POPUP REPORTS| - keyboard navigation for text-based popup reports @@ -6287,6 +6297,7 @@ topic: |MONITOR GAMMA| topic: |CHANGE LANGUAGE| topic: |MISSING TRANSLATIONS| +topic: |PHONE HOME| topic: |SHOW RESOURCES| topic: |APPIMAGE FILES| file: /home2/mico/programs/fotoxx-20.0-test/f.effects.cc diff -Nru fotoxx-20.09/debian/changelog fotoxx-20.10/debian/changelog --- fotoxx-20.09/debian/changelog 2020-03-02 19:15:11.000000000 +0000 +++ fotoxx-20.10/debian/changelog 2020-03-10 05:01:10.000000000 +0000 @@ -1,3 +1,9 @@ +fotoxx (20.10-1dhor~focal) focal; urgency=medium + + * Phone Home: user choice dialog is presented at first install. + + -- Dariusz Duma Tue, 10 Mar 2020 06:01:10 +0100 + fotoxx (20.09-1dhor~focal) focal; urgency=medium * Phone Home: send last message if user turns off statistics update. diff -Nru fotoxx-20.09/debian-control fotoxx-20.10/debian-control --- fotoxx-20.09/debian-control 2020-02-25 10:35:49.000000000 +0000 +++ fotoxx-20.10/debian-control 2020-03-04 07:44:16.000000000 +0000 @@ -1,5 +1,5 @@ Package: Fotoxx -Version: 20.09 +Version: 20.10 Architecture: amd64 Section: graphics Installed-Size: 15244 diff -Nru fotoxx-20.09/doc/changelog fotoxx-20.10/doc/changelog --- fotoxx-20.09/doc/changelog 2020-02-25 10:35:49.000000000 +0000 +++ fotoxx-20.10/doc/changelog 2020-03-04 07:44:16.000000000 +0000 @@ -1,8 +1,10 @@ Fotoxx Change Log ================= +Version 20.10 Mar 04 2020 + • Phone Home: user choice dialog is presented at first install. + Version 20.09 Feb 25 2020 - • Phone Home: send last message if user turns off statistics update. • minor correction in user guide. Version 20.08 Feb 19 2020 @@ -13,8 +15,8 @@ Version 20.06 Feb 10 2020 • minor change in image zoom from mouse wheel - • Trim/Rotate: better logic to decide if mouse drag trims or levels image. - • Raw Therapee: search for the .tif output file in all top image folders. + • Trim/Rotate: better logic: mouse drag adjusts trim rectangle or levels image. + • Raw Therapee interface: output can be any file type, saved anywhere. • changed contact address to mkornelix@gmail.com Version 20.05 Jan 29 2020 diff -Nru fotoxx-20.09/fotoxx.cc fotoxx-20.10/fotoxx.cc --- fotoxx-20.09/fotoxx.cc 2020-02-25 10:35:49.000000000 +0000 +++ fotoxx-20.10/fotoxx.cc 2020-03-04 07:44:16.000000000 +0000 @@ -766,7 +766,7 @@ /********************************************************************************/ -// Fotoxx first startup - initial user decision about indexing +// Fotoxx first startup - initial user decisions about indexing and phone home void first_startup() // 20.0 { @@ -867,6 +867,9 @@ zdialog_free(zd); quitxx(); } + + phone_home_permit(Mwin); // permit or decline statistics 20.10 + return; } diff -Nru fotoxx-20.09/fotoxx.h fotoxx-20.10/fotoxx.h --- fotoxx-20.09/fotoxx.h 2020-02-25 10:35:49.000000000 +0000 +++ fotoxx-20.10/fotoxx.h 2020-03-04 07:44:16.000000000 +0000 @@ -30,7 +30,7 @@ // Fotoxx definitions -#define Frelease "fotoxx-20.09" // release Feb 19 2020 +#define Frelease "fotoxx-20.10" // release Feb 19 2020 #define Flicense "Free software - GNU General Public License v.3" #define Fhomepage "https://kornelix.net" // kornelix home page #define Fgitlab "https://gitlab.com/fotoxx" // GitLab home 20.0 @@ -1305,7 +1305,7 @@ void m_monitor_gamma(GtkWidget *, cchar *); // adjust monitor gamma void m_change_lang(GtkWidget *, cchar *); // change language void m_untranslated(GtkWidget *, cchar *); // report missing translations -void m_phone_home_allow(GtkWidget *, cchar *); // allow anonymous usage statistics 20.0 +void m_phone_home_permit(GtkWidget *, cchar *); // allow anonymous usage statistics 20.0 void m_resources(GtkWidget *, cchar *); // report CPU and memory usage void m_appimage_files(GtkWidget *, cchar *); // list files in appimage container 20.0 void m_zappcrash_test(GtkWidget *, cchar *); // zappcrash test function diff -Nru fotoxx-20.09/f.tools.cc fotoxx-20.10/f.tools.cc --- fotoxx-20.09/f.tools.cc 2020-02-25 10:35:49.000000000 +0000 +++ fotoxx-20.10/f.tools.cc 2020-03-04 07:44:16.000000000 +0000 @@ -48,7 +48,7 @@ m_monitor_gamma monitor gamma check and adjust m_change_lang choose GUI language m_untranslated report missing translations - m_phone_home_allow allow/block anonymous usage statistics + m_phone_home_permit permit/decline anonymous usage statistics m_resources print memory allocated and CPU time used m_appimage_files show files included in appimage container m_zappcrash zappcrash test @@ -6313,9 +6313,10 @@ // user can allow or block anonymous usage statistics sent to web host -void m_phone_home_allow(GtkWidget *, cchar *) // 20.0 +void m_phone_home_permit(GtkWidget *, cchar *) // 20.0 { - phone_home_allow(Mwin); + F1_help_topic = "phone home"; + phone_home_permit(Mwin); return; } diff -Nru fotoxx-20.09/f.widgets.cc fotoxx-20.10/f.widgets.cc --- fotoxx-20.09/f.widgets.cc 2020-02-25 10:35:49.000000000 +0000 +++ fotoxx-20.10/f.widgets.cc 2020-03-04 07:44:16.000000000 +0000 @@ -387,7 +387,7 @@ cchar * monitor_gamma_tip = E2X("Chart to adjust monitor gamma"); cchar * change_lang_tip = E2X("Change the GUI language"); cchar * untranslated_tip = E2X("Report missing translations"); - cchar * phone_home_allow_tip = E2X("Anonymous usage statistics"); + cchar * phone_home_permit_tip = E2X("Permit or decline anonymous usage statistics"); cchar * resources_tip = E2X("Memory and CPU (to terminal/logfile)"); cchar * appimage_files_tip = E2X("List files included in appimage container"); cchar * zappcrash_test_tip = E2X("test crash report with source line numbers"); @@ -626,8 +626,7 @@ MENU(mTools, E2X("Monitor Gamma"), 0, monitor_gamma_tip, m_monitor_gamma, 0 ); MENU(mTools, E2X("Change Language"), 0, change_lang_tip, m_change_lang, 0 ); MENU(mTools, E2X("Missing Translations"), 0, untranslated_tip, m_untranslated, 0 ); - MENU(mTools, E2X("Phone Home"), 0, phone_home_allow_tip, m_phone_home_allow, 0 ); // 20.0 - + MENU(mTools, E2X("Phone Home"), 0, phone_home_permit_tip, m_phone_home_permit, 0 ); // 20.0 MENU(mTools, E2X("Show Resources"), 0, resources_tip, m_resources, 0 ); MENU(mTools, E2X("Appimage Files"), 0, appimage_files_tip, m_appimage_files, 0 ); // 20.0 MENU(mTools, E2X("Zappcrash Test"), 0, zappcrash_test_tip, m_zappcrash_test, 0 ); Binary files /tmp/tmpRqHNh9/lvlTkBGurl/fotoxx-20.09/images/phone-home.jpg and /tmp/tmpRqHNh9/_a_fbX0H1Z/fotoxx-20.10/images/phone-home.jpg differ diff -Nru fotoxx-20.09/zfuncs.cc fotoxx-20.10/zfuncs.cc --- fotoxx-20.09/zfuncs.cc 2020-02-25 10:35:49.000000000 +0000 +++ fotoxx-20.10/zfuncs.cc 2020-03-04 07:44:16.000000000 +0000 @@ -140,9 +140,10 @@ showz_html show a local or remote HTML file showz_docfile show a document file topic and associated image validate_docfile validate docfile internal links - appruns_update update application appruns file + phone_home_permit dialog to permit/decline phone_home messages phone_home send anonymous statistics if allowed - phone_home_allow dialog to allow/block phone_home messages + phone_home_stop stop sending statistics, send stop message + appruns_update update application appruns file E2X(), etc. translate GUI and message text strings for non-English locales GTK Utility Functions @@ -5770,64 +5771,99 @@ /********************************************************************************/ -/*** +// phone home permit dialog +// Display basic information for user decision to permit phone home or not. +// Application: provide "phone home" menu or button which calls this function. +// If user permits, phone_home() will be called max. once per day. - Called at each application startup. - Update appruns file if >1 day since last update. - Also do phone_home() if user allows this. +void phone_home_permit(GtkWidget *parent) // 20.10 +{ + FILE *fid; + char apprunsfile[200], uuid[12]; + int nn, runs, ppermit; + int permit, decline, donothing; + uint64 random; + int zstat; + cchar *infomess = E2X("If you permit, a message is occasionally sent \n" + "to a web host for usage statistics. No data is \n" + "retained that can be associated with a person \n" + "or computer or location. \n\n" + "If you decline, a message is sent to increment \n" + "an aggregate count of declining users. \n\n" + "If you choose 'do nothing' or if you cancel the \n" + "dialog, nothing is done, ever."); - appruns file: Uxxxxxxxx Rxxx Px - | | |___ phone home permission: 0/1 = no/yes - | |________ appruns file update counter - |__________________ unique ID, random 8-digit hex number +/*** + __________________________________________________ + | Phone Home Permit [x] | + | | + | If you permit, a message is occasionally sent | + | to a web host for usage statistics. No data is | + | retained that can be associated with a person | + | or computer or location. | + | | + | If you decline, a message is sent to increment | + | an aggregate count of declining users. | + | | + | If you choose 'do nothing' or if you cancel the | + | dialog, nothing is done, ever. | + | | + | (o) Permit usage statistics | + | (o) Decline usage statistics | + | (o) Do nothing | + | [ OK ] | + |__________________________________________________| ***/ + zdialog *zd = zdialog_new(E2X("Phone Home"),parent,"OK",0); // query user + zdialog_add_widget(zd,"hbox","hbinfo","dialog",0,"space=10"); + zdialog_add_widget(zd,"label","labinfo","hbinfo",infomess,"space=5"); + zdialog_add_widget(zd,"hbox","hb1","dialog"); + zdialog_add_widget(zd,"label","space","hb1",0,"space=10"); + zdialog_add_widget(zd,"vbox","vb1","hb1"); + zdialog_add_widget(zd,"radio","permit","vb1",E2X("Permit usage statistics")); + zdialog_add_widget(zd,"radio","decline","vb1",E2X("Decline usage statistics")); + zdialog_add_widget(zd,"radio","donothing","vb1",E2X("Do nothing at this time")); + + zdialog_stuff(zd,"permit",1); // initial state, 1 0 0 + zdialog_stuff(zd,"decline",0); + zdialog_stuff(zd,"donothing",0); -void appruns_update() -{ - FILE *fid; - char apprunsfile[200], uuid[12]; - int nn, runs, err, permit; - STATB statb; - time_t mtime, today, fage = 999; - uint64 random; + if (parent) zdialog_run(zd,0,"parent"); + else zdialog_run(zd,0,"mouse"); + zstat = zdialog_wait(zd); - snprintf(apprunsfile,200,"%s/appruns",get_zhomedir()); // /home//.appname/appruns + zdialog_fetch(zd,"permit",permit); // get choice + zdialog_fetch(zd,"decline",decline); + zdialog_fetch(zd,"donothing",donothing); + zdialog_free(zd); - err = stat(apprunsfile,&statb); // look for appruns file - if (! err) { - mtime = statb.st_mtime; // file mod date/time - today = time(0); - fage = (today - mtime) / 3600; // file age in hours - } + if (zstat != 1) return; // user cancel = do nothing + if (donothing) return; // do nothing elected + snprintf(apprunsfile,200,"%s/appruns",get_zhomedir()); + fid = fopen(apprunsfile,"r"); // open appruns file if (fid) { - nn = fscanf(fid,"U%8s R%d P%d",uuid,&runs,&permit); // read "Uxxxxxxxx Rxxx Px" + nn = fscanf(fid,"U%8s R%d P%d",uuid,&runs,&ppermit); // read "Uxxxxxxxx Rxxx Px" fclose(fid); if (nn != 3) fid = 0; // failed } - if (fid && fage < 24) return; // < 1 day since last update - if (! fid) { // appruns not found or invalid - random = 0x100000000 * drandz(); // uuid: random 8-digit hex number + random = 0x100000000 * drandz(); // userID = random 8-digit hex number snprintf(uuid,12,"%08llx",random); // (range 4.2 billion) runs = 0; // run count - permit = 1; // permit phone home + ppermit = 1; // trigger phone_home_stop message } - - runs += 1; // increment run count - + fid = fopen(apprunsfile,"w"); // update appruns file if (! fid) return; fprintf(fid,"U%8s R%d P%d",uuid,runs,permit); fclose(fid); - if (! permit) return; // phone home blocked - if (runs == 1) return; // not if first run - phone_home(); // do phone home + if (! permit && ppermit) phone_home_stop(); // count declining users, one time return; } @@ -5838,7 +5874,7 @@ // No data tracable to a person, computer, or location is sent. // The IP address can be traced by a state actor (like any internet access). -void phone_home() +void phone_home() // 20.10 { FILE *fid; char apprunsfile[200], uuid[12]; @@ -5863,26 +5899,17 @@ } -// Send a log message to web host to notify usage statistics is stopped. // 20.09 +// Send a log message to web host to count users not permitting phone home. +// The only information sent is the appname-version. -void phone_home_stop() +void phone_home_stop() // 20.10 { - FILE *fid; - char apprunsfile[200], uuid[12]; - int nn, runs, permit; char buff1[140], buff2[100]; cchar *wget1 = "wget -b -q -O /dev/null %s 1>/dev/null"; // stuff wget2 - cchar *wget2 = "https://kornelix.net/phone_home_stop/%s/%s/"; // stuff appname, uuid + cchar *wget2 = "https://kornelix.net/phone_home_stop/%s/unknown/"; // stuff appname-version - snprintf(apprunsfile,200,"%s/appruns",get_zhomedir()); - fid = fopen(apprunsfile,"r"); // open appruns file - if (! fid) return; - nn = fscanf(fid,"U%8s R%d P%d",uuid,&runs,&permit); // read "Uxxxxxxxx Rxxx Px" - fclose(fid); - if (nn != 3) return; // failed - - snprintf(buff2,100,wget2,zappvers,uuid); // build message to web host + snprintf(buff2,100,wget2,zappvers); // build stop message to web host snprintf(buff1,140,wget1,buff2); shell_quiet(buff1); // send @@ -5892,32 +5919,37 @@ /********************************************************************************/ -// phone home dialog -// Display basic information for user decision to allow or block phone home. -// Application: provide "phone home" menu or button which calls this function. -// If user allows, phone_home() will be called each Ith run. +/*** -void phone_home_allow(GtkWidget *parent) + Called at each application startup. + Update appruns file if >1 day since last update. + Also do phone_home() if user allows this. + + appruns file: Uxxxxxxxx Rxxx Px + | | |___ phone home permission: 0/1 = no/yes + | |________ appruns file update counter + |__________________ unique ID, random 8-digit hex number + +***/ + +void appruns_update() // 20.10 { FILE *fid; char apprunsfile[200], uuid[12]; - int nn, runs, permit; + int nn, runs, err, permit; + STATB statb; + time_t mtime, today, fage = 999; uint64 random; - int zstat; - cchar *infomess = E2X("If you permit, a message is occasionally \n" - "sent to the web host for usage statistics. \n" - "No data is retained that can be associated \n" - "with a person or computer or location."); - zdialog *zd = zdialog_new(E2X("Phone Home"),parent,"OK","NO",0); // query user - zdialog_add_widget(zd,"hbox","hbinfo","dialog",0,"space=10"); - zdialog_add_widget(zd,"label","labinfo","hbinfo",infomess,"space=5"); - if (parent) zdialog_run(zd,0,"parent"); - else zdialog_run(zd,0,"mouse"); - zstat = zdialog_wait(zd); // 1/2 = OK/NO from user - zdialog_destroy(zd); + snprintf(apprunsfile,200,"%s/appruns",get_zhomedir()); // /home//.appname/appruns - snprintf(apprunsfile,200,"%s/appruns",get_zhomedir()); + err = stat(apprunsfile,&statb); // look for appruns file + if (! err) { + mtime = statb.st_mtime; // file mod date/time + today = time(0); + fage = (today - mtime) / 3600; // file age in hours + } + fid = fopen(apprunsfile,"r"); // open appruns file if (fid) { nn = fscanf(fid,"U%8s R%d P%d",uuid,&runs,&permit); // read "Uxxxxxxxx Rxxx Px" @@ -5925,23 +5957,26 @@ if (nn != 3) fid = 0; // failed } + if (fid && fage < 24) return; // < 1 day since last update + if (! fid) { // appruns not found or invalid - random = 0x100000000 * drandz(); // random 8-digit hex number + random = 0x100000000 * drandz(); // uuid: random 8-digit hex number snprintf(uuid,12,"%08llx",random); // (range 4.2 billion) runs = 0; // run count - permit = 1; // permit phone home + permit = 0; // default, no permit } - - if (zstat == 2) permit = 0; - else permit = 1; + + runs += 1; // increment run count fid = fopen(apprunsfile,"w"); // update appruns file if (! fid) return; fprintf(fid,"U%8s R%d P%d",uuid,runs,permit); fclose(fid); - if (permit) phone_home(); // phone home if allowed - else phone_home_stop(); // 21.0 + if (! permit) return; // phone home blocked + if (runs < 3) return; // omit users who never got started + phone_home(); // do phone home + return; } diff -Nru fotoxx-20.09/zfuncs.h fotoxx-20.10/zfuncs.h --- fotoxx-20.09/zfuncs.h 2020-02-25 10:35:49.000000000 +0000 +++ fotoxx-20.10/zfuncs.h 2020-03-04 07:44:16.000000000 +0000 @@ -17,7 +17,7 @@ *********************************************************************************/ -// zfuncs.h version v.7.4 (for Fotoxx 20.0) +// zfuncs.h version for Fotoxx 20.0 #include #include @@ -311,9 +311,10 @@ void showz_html(cchar *url); // show html via preferred browser void showz_docfile(GtkWidget *, cchar *docfile, cchar *topic); // show docfile topic and assoc. image -void appruns_update(); // update run counter in appruns file +void phone_home_permit(GtkWidget *parent); // user dialog to allow/block phone_home() void phone_home(); // send usage statistics -void phone_home_allow(GtkWidget *parent); // user dialog to allow/block phone_home() +void phone_home_stop(); // stop sending usage statistics +void appruns_update(); // update run counter in appruns file // translation functions =======================================================