kvirc / KVIrc

The KVIrc IRC Client
http://www.kvirc.net/
GNU General Public License v2.0
242 stars 75 forks source link

Export log #934

Open DarthGandalf opened 9 years ago

DarthGandalf commented 9 years ago

Reported by ctrlaltca on 01 Sep 2010 11:13:17 UTC Add the ability to export a log to plain text (stripping the control chars);
Plus: add other export formats (some ideas follows):


Migrated from: https://svn.kvirc.de/kvirc/ticket/934

DarthGandalf commented 9 years ago

Modified by HelLViS69 on 01 Sep 2010 13:30:45 Version: none → 4.1 Equilibrium

DarthGandalf commented 9 years ago

Comment by Tron on 09 Dec 2010 21:35:30 I would also like to suggest rtf as a possible export format but agree that txt would be most useful in the beginning.

DarthGandalf commented 9 years ago

Comment by HelLViS69 on 04 Apr 2011 19:40:39 workin' on it


Owner: pragmaware → HelLViS69 Status: new → assigned

DarthGandalf commented 9 years ago

Comment by HelLViS69 on 07 Apr 2011 20:10:26 first implementation added in r5762

DarthGandalf commented 9 years ago

Modified by HelLViS69 on 16 Apr 2011 19:33:36 Description:

--- 
+++ 
@@ -1,5 +1,5 @@
-Add the ability to export a log to plain text (stripping the control chars);[[BR]]
+Add the ability to export a log to ~~plain text (stripping the control chars)~~;[[BR]]
 Plus: add other export formats (some ideas follows):
- * single html files + index.html for an offline "archive";
+ * ~~single html files~~ + index.html for an offline "archive";
  * a parseable format like xml;
  * a database format like sqlite; 
DarthGandalf commented 9 years ago

Comment by Omega on 11 Nov 2014 19:02:21 Export a selected log (right-click the log in the Log File part of the Index tab) to HTML and plaintext fails here - 0B files are output in KVIrc's tmp directory

DarthGandalf commented 9 years ago

Modified by Omega on 11 Nov 2014 19:08:17

DarthGandalf commented 9 years ago

Modified by Omega on 11 Nov 2014 19:09:04

DarthGandalf commented 9 years ago

Comment by Omega on 14 Nov 2014 20:44:23 OK, the failure is due to a bullshit iId passed (src/modules/logview/LogViewWindow.cpp:LogViewWindow::exportLog) - the code wants an ordinal of 0+ to select refer to the QAction, but I'm getting negative numbers e.g. -172 currently. This is presumably a Qt4 bug - I have tried to look into Qt4, but its internal implementation is a bit mysterious - src/gui/widgets/qmenu.cpp:3291 - findIdForAction is as far as I can trace, which returns act->d_func()->id

The id might come from:

src/corelib/kernel/qobject_p.h:298:    inline int id() const { return methodoffset + methodrelative; }

perhaps? Needs someone with clue.

Anyway its clearly wrong, and this code is said to be deprecated Qt3 code, so I guess I'll rewrite this bit to use the recommended signal.

DarthGandalf commented 9 years ago

Comment by Omega on 18 Nov 2014 16:38:57 For reference src/modules/objects/KvsObject_comboBox.cpp:KvsObject_comboBox::slotActivated(int i) is called by the activated signal - confirmed that it works...

DarthGandalf commented 9 years ago

Comment by Omega on 22 Nov 2014 15:04:40 Log export failure fixed in r6399

DarthGandalf commented 9 years ago

Comment by Omega on 22 Nov 2014 15:08:25 hellvis69: If you still get this, can you say why LogViewWindow::createLog outputs to the KVIrc temp directory, rather than a user-specified directory? Is the functionality just incomplete?

If yes, I would like to prompt the user with a browser dialog to allow them to choose where, along with saving this location as a preference. Atm a user has no idea what is going on when logfiles are exported.

DarthGandalf commented 9 years ago

Comment by HelLViS69 on 22 Nov 2014 20:54:43 Hi Omega, honestly I don't remember this behaviour.. the log engine rewriting was another milestone but our efforts went to the porting to Qt4..

And I didn't remember I took this ticket eheheh Maybe because I implemented the "play last log" in channels and queries..

By the way, I agree with you in letting user choose where to export, like:

If you look around, there are other options like this to copy from

DarthGandalf commented 9 years ago

Comment by HelLViS69 on 22 Nov 2014 21:36:30 Btw, reading the file I think it was an uncompleted job.. Giving a look at void LogViewWindow::createLog(LogFile * pLog, int iId), there is only one case in switch block...

DarthGandalf commented 9 years ago

Comment by Omega on 23 Nov 2014 18:46:27 Thanks, I plan to get on with this next week - an XFCE4 task has preempted it so I can't start it on Monday.

DarthGandalf commented 9 years ago

Comment by Omega on 24 Nov 2014 21:17:40 I've implemented the dialog locally, but looking at code usage of the src/kvirc/ui/KviFileDialog.cpp functions, there isn't an example where its populated by previous data (either its blank or the user's home directory or the KVIrc temp directory is used etc). Would it be appropriate for me to just dump this information as a hidden KVIrc setting?

DarthGandalf commented 9 years ago

Comment by HelLViS69 on 24 Nov 2014 22:40:23 Give a look at Settings -> DCC -> File Transfer -> General tab.. You can just copy "save location" options ;)

DarthGandalf commented 9 years ago

Comment by Omega on 26 Nov 2014 20:01:37 Yeah, I will go ahead with the hidden setting idea then based on that. The contents of the logfiles appear to be junk currently (why??? the worst that can happen is a pointless UTF-8 BOM for me), I'll sort that out too.

DarthGandalf commented 9 years ago

Comment by HelLViS69 on 27 Nov 2014 23:20:26 It's not junk.. they're color codes, smiles and so on..

DarthGandalf commented 9 years ago

Comment by Omega on 28 Nov 2014 08:16:34 Currently no text editor can display the contents properly, from the start onwards.

DarthGandalf commented 9 years ago

Comment by Omega on 30 Nov 2014 13:54:11 Right, have implemented the directory specification and saving locally.

I know why the logs are being outputted as junk outside of my test files... the code has no idea if the logs are gzipped or not! Looking at other functions in the file, it looks like LogViewWindow::itemSelected would be a good example to copy from - I'm going to take out the custom file reading stuff from createLog and replace with this.

Do you agree?

DarthGandalf commented 9 years ago

Comment by HelLViS69 on 01 Dec 2014 00:06:48 createLog works well, removing all control codes and so on.. I think it's better to just check if the file is gzipped or not..

DarthGandalf commented 9 years ago

Comment by Omega on 01 Dec 2014 09:07:51 I'm not killing off your code, just the file opening and line splitting bit (thats what needs to know about the compression, so supposedly should use the Logfile iterator) - I'll make a patch before committing it.

DarthGandalf commented 9 years ago

Comment by Omega on 02 Dec 2014 21:16:34 Right, the state prior to changing the way the log is read has been pushed, and I have attached the upcomming commit as a diff here. It works, I have also fixed the regex for plaintext log processing, '// Remove link from a user speaking' - it now copes with (and maintains) the rank character.

Say its OK and I'll have finally finished this little project.

DarthGandalf commented 9 years ago

Comment by HelLViS69 on 03 Dec 2014 08:16:01 Commit :)

DarthGandalf commented 9 years ago

Comment by Omega on 03 Dec 2014 09:32:50 Logs are now properly exportable to plaintext and HTML in r6401.

un1versal commented 8 years ago

Exporting Logs to HTML is dead in current Development builds tested with head at 6804848cefe6b153001f511be2f69503f4a593ac

The log contains +- 100 lines all exported was

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
    <meta name="author" content="KVIrc 4.9.2 Aria" />
    <title>Console on </title>
</head>
<body>
<h2>Console on </h2>
<h3>Date: 2016.06.21</h3>
</p>
</body>
</html>