Check-in [fe44eddc97]

Not logged in

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

Overview
Comment:Fixed the screenshot path bug, HTML file is now generated successfully.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:fe44eddc9771b644cd62f2bfbc2833e34c8e3c43
User & Date: azadok 2014-03-20 20:25:01
Context
2014-07-10
22:03
Fixed bug: when calling RR2 from CLI it continue running after killing app. check-in: 52bbf539a1 user: avi tags: trunk
2014-03-20
20:25
Fixed the screenshot path bug, HTML file is now generated successfully. check-in: fe44eddc97 user: azadok tags: trunk
19:18
Add ui file for the rtf dialog that was missing check-in: e53b95548b user: azadok tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to RapidReporter2/screenshot.cpp.

23
24
25
26
27
28
29


30
31
32
33
34
35
36
37



38
39
40
41
42
43
44
45


46
47
48
49
50
51
52
// Take a screenshot and emit a SIGNAL with the screenshot file absolute path
void Screenshot::ShootScreenSlot(QString targetDirectory = "")
{    
    // If not given target directory - use the current path
    QString currentWorkingDirectory = (targetDirectory == "") ?
                QDir::currentPath(): targetDirectory;



    // Return full path for the file
    QString screenshotFileName = currentWorkingDirectory.append(QDir::separator()).append(ShootScreen());

    emit ScreenshotCaptured(screenshotFileName);
}

QString Screenshot::ShootScreen()
{    



    QString time = QTime::currentTime().toString();
    QString date = QDate::currentDate().toString(Qt::SystemLocaleShortDate);

    QString fileName = QString("RR2_").append(date).append("_").append(time).append(".png");

    // Remove chars which disturb the save proccess
    QRegExp regexp("[' ' | '\' | '/' | ':']");
    fileName.replace(regexp,"");



    // Take the screenshot and save it to the file
    screenshotPixmap = new QPixmap();
    QScreen *screen = QGuiApplication::primaryScreen();
    if (screen)
        *screenshotPixmap = screen->grabWindow(0);
    screenshotPixmap->save(fileName);







>
>

|

|


|
|
>
>
>




<
<
<

>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46



47
48
49
50
51
52
53
54
55
56
// Take a screenshot and emit a SIGNAL with the screenshot file absolute path
void Screenshot::ShootScreenSlot(QString targetDirectory = "")
{    
    // If not given target directory - use the current path
    QString currentWorkingDirectory = (targetDirectory == "") ?
                QDir::currentPath(): targetDirectory;

    const QString ret = ShootScreen(currentWorkingDirectory);

    // Return full path for the file
    //QString screenshotFileName = currentWorkingDirectory.append(QDir::separator()).append(ShootScreen());

    emit ScreenshotCaptured(ret);
}

QString Screenshot::ShootScreen(QString targetPath)
{
    // Remove chars which disturb the save proccess
    QRegExp regexp("[' ' | '\' | '/' | ':']");

    QString time = QTime::currentTime().toString();
    QString date = QDate::currentDate().toString(Qt::SystemLocaleShortDate);

    QString fileName = QString("RR2_").append(date).append("_").append(time).append(".png");



    fileName.replace(regexp,"");
    fileName = targetPath.append(QDir::separator()).append(fileName);


    // Take the screenshot and save it to the file
    screenshotPixmap = new QPixmap();
    QScreen *screen = QGuiApplication::primaryScreen();
    if (screen)
        *screenshotPixmap = screen->grabWindow(0);
    screenshotPixmap->save(fileName);

Changes to RapidReporter2/screenshot.h.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    Q_OBJECT

public:

    explicit Screenshot(QObject *parent = 0);
    Screenshot(QString screenshotTargetPath, QObject *parent = 0);

    QString ShootScreen();
    void setScreenshotPath(QString targetPath);

    signals:

        void ScreenshotCaptured(QString screenshotPath);

    public slots:







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    Q_OBJECT

public:

    explicit Screenshot(QObject *parent = 0);
    Screenshot(QString screenshotTargetPath, QObject *parent = 0);

    QString ShootScreen(QString targetPath);
    void setScreenshotPath(QString targetPath);

    signals:

        void ScreenshotCaptured(QString screenshotPath);

    public slots: