Check-in [8f2f14e4ea]

Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[bug fix] Fixed adding rtf and screenshot to the csv file, added utils class
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8f2f14e4ea28ff01f8db8e959122b043f23dd1b2
User & Date: avi 2014-09-20 19:11:54
Context
2014-09-21
17:01
[bug fix] Fixed controling autogenerated entries display from check box in html report check-in: 11f821b8de user: avi tags: trunk
2014-09-20
19:11
[bug fix] Fixed adding rtf and screenshot to the csv file, added utils class check-in: 8f2f14e4ea user: avi tags: trunk
2014-09-19
11:18
[Resources] res folder and icon were added check-in: 50e90ea0ca user: avi tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to RapidReporter2/RR2.pro.

18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
33
34
35
36
37

38
39
40
41
42
43
    applauncher.cpp \
    htmlstring.cpp \
    screenshot.cpp \
    session.cpp \
    keyenterreceiver.cpp \
    csv2html.cpp \
    dialogrtf.cpp \
    fullreportgenerator.cpp


HEADERS  += mainwindow.h \
    cliparser.h \
    applauncher.h \
    htmlstring.h \
    screenshot.h \
    Flags.h \
    session.h \
    keyenterreceiver.h \
    csv2html.h \
    dialogrtf.h \
    fullreportgenerator.h


FORMS    += mainwindow.ui \
    dialogrtf.ui

OTHER_FILES += \
    RevisionHistory.txt







|
>











|
>






18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
    applauncher.cpp \
    htmlstring.cpp \
    screenshot.cpp \
    session.cpp \
    keyenterreceiver.cpp \
    csv2html.cpp \
    dialogrtf.cpp \
    fullreportgenerator.cpp \
    utils.cpp

HEADERS  += mainwindow.h \
    cliparser.h \
    applauncher.h \
    htmlstring.h \
    screenshot.h \
    Flags.h \
    session.h \
    keyenterreceiver.h \
    csv2html.h \
    dialogrtf.h \
    fullreportgenerator.h \
    utils.h

FORMS    += mainwindow.ui \
    dialogrtf.ui

OTHER_FILES += \
    RevisionHistory.txt

Changes to RapidReporter2/csv2html.cpp.

160
161
162
163
164
165
166

167
    // to add succesfull to the logger
}

void Csv2Html::StartConvertSlot(QString csvFileName)
{
    setCSVfile(csvFileName);
    StartConvert();

}







>

160
161
162
163
164
165
166
167
168
    // to add succesfull to the logger
}

void Csv2Html::StartConvertSlot(QString csvFileName)
{
    setCSVfile(csvFileName);
    StartConvert();
    Utils::MessageToConsole("HTML report was succesfully created");
}

Changes to RapidReporter2/csv2html.h.

1
2
3
4
5
6
7

8
9
10
11
12
13
14
#ifndef CSV2HTML_H
#define CSV2HTML_H

#include <QObject>
#include <QDir>
#include <QFile>
#include <QTextStream>


class htmlstrings
{
public:
    QString html_title;

    //  the letter at the beginning of the var name is to hint about their order







>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef CSV2HTML_H
#define CSV2HTML_H

#include <QObject>
#include <QDir>
#include <QFile>
#include <QTextStream>
#include "utils.h"

class htmlstrings
{
public:
    QString html_title;

    //  the letter at the beginning of the var name is to hint about their order

Changes to RapidReporter2/session.cpp.

175
176
177
178
179
180
181























182
183
184
185
186
187
188
...
324
325
326
327
328
329
330


331
332
333
334
335
336
337
338
339
340
341
342
343
















344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371


372
373


374
375
376
377
378
379


380
381
382
383
384
385
386
...
387
388
389
390
391
392
393






394
395
396
397
398
399
400
}

void Session::StartSessionTimer(int sec)
{
    //sessionTimer.setInterval(1000);
    sessionTimer.start(1000 * sec);
}
























void Session::increaseTypeindexes()
{
    int count = userTypes.count();

    currentTypeIndex = (++currentTypeIndex == count) ? 0 : currentTypeIndex;
    nextTypeIndex = (++nextTypeIndex == count) ? 0 : nextTypeIndex;
................................................................................
{
    CloseSession();
}

// Add screenshot note to the csv file which contains the path to the taken screenshot
void Session::ScreenshotTakenSlot(QString screenshotPath)
{


    QString currentTime = "";
    currentTime.append(QDate::currentDate().toString(Qt::SystemLocaleShortDate));
    currentTime.append(" ").append(QTime::currentTime().toString());
    QString COMMA = ",";

    QString screenshotLine = "";
    screenshotLine.append(currentTime).append(COMMA).append(
            reporter).append(COMMA).append(
            "autogenerated").append(COMMA).append(
            "screenshot saved").append(COMMA).append(screenshotPath).append(COMMA);

    AddLineToCsvfile(screenshotLine);
}

















void Session::TakeScreenshotSlot()
{
    //QString target = SpecialTargetDirectory();
    QString target = PathAccordingOS();
    emit EmitTakeScreenshot(target);
}

void Session::TakeRtfSlot()
{
    //QString target = SpecialTargetDirectory();
    QString target = PathAccordingOS();
    emit EmitTakeRtf(target);
}


// Add general note to the csv file
void Session::NoteWasTakeSlot(QString noteType, QString noteContent)
{
    QString currentTime = QDate::currentDate().toString(Qt::SystemLocaleShortDate);
    currentTime.append(" ").append(QTime::currentTime().toString());
    QString COMMA = ",";

    QString screenshotLine = currentTime;
            screenshotLine.append(COMMA).append(
            reporter).append(COMMA).append(
            noteType).append(COMMA).append(
            noteContent).append(COMMA).append(COMMA);



    AddLineToCsvfile(screenshotLine);


}


// Add rtf note to the csv file which contains the path to the rtf
void Session::RtfWasTakeSlot(QString rtfPath)
{


    QString currentTime = "";
    currentTime.append(QDate::currentDate().toString(Qt::SystemLocaleShortDate));
    currentTime.append(" ").append(QTime::currentTime().toString());
    QString COMMA = ",";

    QString screenshotLine = "";
    screenshotLine.append(currentTime);
................................................................................
    screenshotLine.append(COMMA).append(
            reporter).append(COMMA).append(
            "autogenerated").append(COMMA).append(
            "extended note saved").append(COMMA).append(COMMA).append(rtfPath);

    AddLineToCsvfile(screenshotLine);
}







void Session::TimeOutSlot()
{
    if (!sessionTimeOver) {
        emit EmitsessionTimeOut(timeinterval);
    }








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>













>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










<












|
|
<
|
|
>
>

|
>
>






>
>







 







>
>
>
>
>
>







175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
...
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394

395
396
397
398
399
400
401
402
403
404
405
406
407
408

409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
...
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
}

void Session::StartSessionTimer(int sec)
{
    //sessionTimer.setInterval(1000);
    sessionTimer.start(1000 * sec);
}

void Session::InitScreenshot()
{
    isScreenshotTaken = false;
    screenshotSyncPath = "";
}

void Session::InitRtf()
{
    isRtfTaken = false;
    rtfSyncPath = "";
}

bool Session::getIsScreenshotTaken() const
{
    return isScreenshotTaken;
}

void Session::setIsScreenshotTaken(bool value)
{
    isScreenshotTaken = value;
}


void Session::increaseTypeindexes()
{
    int count = userTypes.count();

    currentTypeIndex = (++currentTypeIndex == count) ? 0 : currentTypeIndex;
    nextTypeIndex = (++nextTypeIndex == count) ? 0 : nextTypeIndex;
................................................................................
{
    CloseSession();
}

// Add screenshot note to the csv file which contains the path to the taken screenshot
void Session::ScreenshotTakenSlot(QString screenshotPath)
{
    UpdateScreenshotNotesync(screenshotPath);

    QString currentTime = "";
    currentTime.append(QDate::currentDate().toString(Qt::SystemLocaleShortDate));
    currentTime.append(" ").append(QTime::currentTime().toString());
    QString COMMA = ",";

    QString screenshotLine = "";
    screenshotLine.append(currentTime).append(COMMA).append(
            reporter).append(COMMA).append(
            "autogenerated").append(COMMA).append(
            "screenshot saved").append(COMMA).append(screenshotPath).append(COMMA);

    AddLineToCsvfile(screenshotLine);
}

///
/// \brief Session::UpdateScreenshotNotesync
///
/// This method is used to udpate the session if a screenshot was taken to embedd the last
/// screenshot inside the current note
///
/// \param screenshotPath
///
/// The Screenshot file path
///
void Session::UpdateScreenshotNotesync(QString screenshotPath)
{
    isScreenshotTaken = true;
    screenshotSyncPath = screenshotPath;
}

void Session::TakeScreenshotSlot()
{
    //QString target = SpecialTargetDirectory();
    QString target = PathAccordingOS();
    emit EmitTakeScreenshot(target);
}

void Session::TakeRtfSlot()
{

    QString target = PathAccordingOS();
    emit EmitTakeRtf(target);
}


// Add general note to the csv file
void Session::NoteWasTakeSlot(QString noteType, QString noteContent)
{
    QString currentTime = QDate::currentDate().toString(Qt::SystemLocaleShortDate);
    currentTime.append(" ").append(QTime::currentTime().toString());
    QString COMMA = ",";

    QString noteLine = currentTime;
            noteLine.append(COMMA).append(reporter).append(COMMA)

                    .append(noteType).append(COMMA)
                    .append(noteContent).append(COMMA)
                    .append(screenshotSyncPath).append(COMMA)
                    .append(rtfSyncPath);

    AddLineToCsvfile(noteLine);
    InitScreenshot();
    InitRtf();
}


// Add rtf note to the csv file which contains the path to the rtf
void Session::RtfWasTakeSlot(QString rtfPath)
{
    UpdateRtfNotesync(rtfPath);

    QString currentTime = "";
    currentTime.append(QDate::currentDate().toString(Qt::SystemLocaleShortDate));
    currentTime.append(" ").append(QTime::currentTime().toString());
    QString COMMA = ",";

    QString screenshotLine = "";
    screenshotLine.append(currentTime);
................................................................................
    screenshotLine.append(COMMA).append(
            reporter).append(COMMA).append(
            "autogenerated").append(COMMA).append(
            "extended note saved").append(COMMA).append(COMMA).append(rtfPath);

    AddLineToCsvfile(screenshotLine);
}

void Session::UpdateRtfNotesync(QString rtfPath)
{
    isRtfTaken = true;
    rtfSyncPath = rtfPath;
}

void Session::TimeOutSlot()
{
    if (!sessionTimeOver) {
        emit EmitsessionTimeOut(timeinterval);
    }

Changes to RapidReporter2/session.h.

44
45
46
47
48
49
50
51











52



53
54
55
56
57
58
59
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
..
83
84
85
86
87
88
89



90
91
92
93
94
95
96


    // timer utils
    void StartSessionTimer(int);
    int timeinterval;
    int timerInit;
    bool sessionTimeOver;












protected:




public:
    explicit Session(QObject *parent = 0);
    explicit Session(QString Reporter, QString Charter, QObject *parent = 0);
    void StartSession();
    void CloseSession();
    void SaveToSessionNotes(QString note);
................................................................................
    DialogRtf dialogRtf;
    QString TimeConversion(int msecs);

    QString getNextUserType();
    QString getPrevUserType();
    void increaseTypeindexes();
    void decreaseTypeindexes();
    //QString getSpecificUserType (QString userTypes[], int &index,int count);

    QString getCurrentNoteType();

    QTimer sessionTimer;

    QStringList getUserTypes() const;
    void setUserTypes(const QStringList &value);
................................................................................
    void setSessionTimeOver(bool value);

    QString PathAccordingOS();

    QString SpecialTargetDirectory();

    bool IsWinOS();



signals:
    void EmitsessionTimeOut(int);
    void EmitTakeScreenshot(QString);
    void EmitTakeRtf(QString);

public slots:
    void StartSessionSlot();








>
>
>
>
>
>
>
>
>
>
>

>
>
>







 







<







 







>
>
>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
..
77
78
79
80
81
82
83

84
85
86
87
88
89
90
..
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112


    // timer utils
    void StartSessionTimer(int);
    int timeinterval;
    int timerInit;
    bool sessionTimeOver;

    /// Screenshot utils
    bool isScreenshotTaken;
    QString screenshotSyncPath;
    void InitScreenshot();

    /// rtf utils
    bool isRtfTaken;
    QString rtfSyncPath;
    void InitRtf();


protected:

    void UpdateScreenshotNotesync(QString screenshotPath);
    void UpdateRtfNotesync(QString rtfPath);

public:
    explicit Session(QObject *parent = 0);
    explicit Session(QString Reporter, QString Charter, QObject *parent = 0);
    void StartSession();
    void CloseSession();
    void SaveToSessionNotes(QString note);
................................................................................
    DialogRtf dialogRtf;
    QString TimeConversion(int msecs);

    QString getNextUserType();
    QString getPrevUserType();
    void increaseTypeindexes();
    void decreaseTypeindexes();


    QString getCurrentNoteType();

    QTimer sessionTimer;

    QStringList getUserTypes() const;
    void setUserTypes(const QStringList &value);
................................................................................
    void setSessionTimeOver(bool value);

    QString PathAccordingOS();

    QString SpecialTargetDirectory();

    bool IsWinOS();
    bool getIsScreenshotTaken() const;
    void setIsScreenshotTaken(bool value);

signals:
    void EmitsessionTimeOut(int);
    void EmitTakeScreenshot(QString);
    void EmitTakeRtf(QString);

public slots:
    void StartSessionSlot();

Added RapidReporter2/utils.cpp.



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "utils.h"

Utils::Utils(QObject *parent) :
    QObject(parent)
{
}

void Utils::MessageToConsole(QString msg, bool toExit, int exitCode)
{
    std::cout << msg.toStdString();
    if(toExit)
        exit(exitCode);
}

Added RapidReporter2/utils.h.



































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef UTILS_H
#define UTILS_H

#include <QObject>
#include <QString>
#include <iostream>

using namespace std;

class Utils : public QObject
{
    Q_OBJECT
public:
    explicit Utils(QObject *parent = 0);

    ///
    /// \brief MessageToConsole
    ///
    /// Print message to console
    ///
    /// \param msg - message to print
    /// \param toExit - if to exit application
    /// \param exitCode
    ///
    static void MessageToConsole(QString msg, bool toExit = false, int exitCode = 1);

signals:

public slots:

};

#endif // UTILS_H