Check-in [9b95a27cc5]

Not logged in

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

Overview
Comment:Added support for changing noty types using arrows. GUI support.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9b95a27cc5a74d28e5abce62c6354e3f0b1a1e30
User & Date: azadok 2013-12-22 20:41:13
Context
2013-12-25
18:21
Added GUI fixes: fixed size for main window Exit button Title bar was removed Move widget from window body functionality was added check-in: 38d7e9175e user: azadok tags: trunk
2013-12-22
20:41
Added support for changing noty types using arrows. GUI support. check-in: 9b95a27cc5 user: azadok tags: trunk
2013-12-17
21:17
Deleted redundant / duplicated classes. Show help functionality was added. check-in: 2c605a44d9 user: azadok tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to RapidReporter2/keyenterreceiver.cpp.

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
34
35
36


{
}


bool keyEnterReceiver::eventFilter(QObject *obj, QEvent *event)
{
    if(event->type() == QEvent::KeyPress)
    {
        QKeyEvent *key = static_cast<QKeyEvent *>(event);




        if((key->key() == Qt::Key_Enter) || (key->key() == Qt::Key_Return))
        {
            //Enter or return was pressed





            emit keyEnterReceived();









        }

        else
        {
            return QObject::eventFilter(obj, event);
        }
        return true;
    }
    else if (false) {
        //event->type() == QEvent::
    }

    else
    {
        return QObject::eventFilter(obj, event);
    }

    return false;
}









|
|

>
>
>
|
|
<
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
>
|
|
|
|
|
|
<
<
<
<
|
|
|
|

|
|
>
>
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
34
35
36
37
38
39
40
41
42




43
44
45
46
47
48
49
50
51
{
}


bool keyEnterReceiver::eventFilter(QObject *obj, QEvent *event)
{
    if(event->type() == QEvent::KeyPress)
       {
           QKeyEvent *key = static_cast<QKeyEvent *>(event);

           if((key->key() == Qt::Key_Enter)
                   || (key->key() == Qt::Key_Up)
                   || (key->key() == Qt::Key_Down)
                   || (key->key() == Qt::Key_Return))
           {


               switch (key->key())
                       {
                       case Qt::Key_Return:
                       case Qt::Key_Enter:
                           emit keyEnterReceived();
                           break;
                       case Qt::Key_Down:
                           emit keyDownReceived();
                           break;
                       case Qt::Key_Up:
                           emit keyUpReceived();
                           break;
                       default:
                           break;
                       }
           }
           else
           {
               return QObject::eventFilter(obj, event);
           }
           return true;
       }




       else
       {
           return QObject::eventFilter(obj, event);
       }

       return false;

}

Changes to RapidReporter2/keyenterreceiver.h.

11
12
13
14
15
16
17


18
19
20
21
22
23
24
25
26
{
    Q_OBJECT
public:
    explicit keyEnterReceiver(QObject *parent = 0);

signals:
    void keyEnterReceived();



public slots:

protected:
    bool eventFilter(QObject *obj, QEvent *event);

};

#endif // KEYENTERRECEIVER_H







>
>









11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
    Q_OBJECT
public:
    explicit keyEnterReceiver(QObject *parent = 0);

signals:
    void keyEnterReceived();
    void keyDownReceived();
    void keyUpReceived();

public slots:

protected:
    bool eventFilter(QObject *obj, QEvent *event);

};

#endif // KEYENTERRECEIVER_H

Changes to RapidReporter2/mainwindow.cpp.

7
8
9
10
11
12
13





14
15
16




17
18
19
20
21
22
23
..
41
42
43
44
45
46
47
48

49
50
51

52

53
54
55
56
57
58
59
..
65
66
67
68
69
70
71
72


73
74
75
76
77


78
79
80
81
82
83
84
85
86
87
...
137
138
139
140
141
142
143





















144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160





































161
162
163
164
165
166
167
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    sessionStarted=false;
    keyEnterReceiver *key = new keyEnterReceiver();
    ui->textEdit->installEventFilter(key);





    UpdateFieldLable("Reporter:");
    connect(&(*key),SIGNAL(keyEnterReceived()),
            this,SLOT(GetUserText()));




    connect(this,SIGNAL(EmitFieldContent(QString,QString)),
            this,SLOT(HandleCatchFieldContent(QString,QString)));
    setHelpString();
}

MainWindow::~MainWindow()
{
................................................................................
        emit EmitTakeScreenshot();
    }
}

// Grabs the content of the current field and update the GUI
void MainWindow::HandleCatchFieldContent(QString field, QString content)
{
    if ("Reporter" == field) {

        setReporterTmp(content);
        UpdateFieldLable("Charter");


    } else if ("Charter" == field) {


        // Update the session special user types if exist
        this->session=new Session(reporterTmp,content);
        if (userTypeTmp.count() > 0) {
            session->setUserTypes(userTypeTmp);
        }

................................................................................
        connect(this->session,SIGNAL(EmitsessionTimeOut(int)),
                this,SLOT(UpdateProgerssBar(int)));
        connect(this,SIGNAL(EmitResetTimer()),
                this->session,SLOT(ReserTimerSlot(int)));

        // Start the session with the proper setup
        session->StartSession();
        QString lableTitle = session->getCurrentNoteType();


        UpdateFieldLable(lableTitle);
        sessionStarted=true;


    } else {


        emit EmitNoteTake(field,content);
        QString lableTitle = session->getCurrentNoteType();
        UpdateFieldLable(lableTitle);
    }
}

void MainWindow::UpdateProgerssBar(int interval)
{
    int value = ui->progressBar->value()+interval;

................................................................................
}

void MainWindow::ChangeTargetDirectory(QString newTargetDirPath)
{
    ///todo
}























//Update the filed and content for the GUI lable and textedit controls
void MainWindow::UpdateFieldLable(QString field)
{
    QFont f( "Arial", 22, QFont::Bold);
    ui->label_field->setFont(f);
    ui->label_field->setText(field);
    ui->textEdit->setText("");
    ui->textEdit->setCurrentFont(f);
    ui->textEdit->setFont(f);
}

void MainWindow::NotifySessionTimeEnded()
{
    QMessageBox::about(this, tr("Session time ended"),
            tr("Please note that the session time is ended.\nYou may continue use RR2 or initilize a new session."));
}





































QString MainWindow::getHelpString() const
{
    return helpString;
}

void MainWindow::setHelpString()
{







>
>
>
>
>
|


>
>
>
>







 







|
>



>
|
>







 







|
>
>




|
>
>

|
|







 







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






|








|

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







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
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    sessionStarted=false;
    keyEnterReceiver *key = new keyEnterReceiver();
    ui->textEdit->installEventFilter(key);


    initLables();


    UpdateFieldLable("Reporter");
    connect(&(*key),SIGNAL(keyEnterReceived()),
            this,SLOT(GetUserText()));
    connect(&(*key),SIGNAL(keyUpReceived()),
            this,SLOT(increaceTypeLables()));
    connect(&(*key),SIGNAL(keyDownReceived()),
            this,SLOT(decreaceTypeLables()));
    connect(this,SIGNAL(EmitFieldContent(QString,QString)),
            this,SLOT(HandleCatchFieldContent(QString,QString)));
    setHelpString();
}

MainWindow::~MainWindow()
{
................................................................................
        emit EmitTakeScreenshot();
    }
}

// Grabs the content of the current field and update the GUI
void MainWindow::HandleCatchFieldContent(QString field, QString content)
{
    if ("Reporter" == field)
    {
        setReporterTmp(content);
        UpdateFieldLable("Charter");

    }
    else if ("Charter" == field)
    {

        // Update the session special user types if exist
        this->session=new Session(reporterTmp,content);
        if (userTypeTmp.count() > 0) {
            session->setUserTypes(userTypeTmp);
        }

................................................................................
        connect(this->session,SIGNAL(EmitsessionTimeOut(int)),
                this,SLOT(UpdateProgerssBar(int)));
        connect(this,SIGNAL(EmitResetTimer()),
                this->session,SLOT(ReserTimerSlot(int)));

        // Start the session with the proper setup
        session->StartSession();
        QString lableTitle = session->getCurrentNoteType();// need to remain the same
        setLableText(ui->Prev_label,session->getPrevUserType());
        setLableText(ui->Next_label,session->getNextUserType());
        UpdateFieldLable(lableTitle);
        sessionStarted=true;


    } else
    {
        clearContentText();
        emit EmitNoteTake(field,content);
//        QString lableTitle = session->getCurrentNoteType();
//        UpdateFieldLable(lableTitle);
    }
}

void MainWindow::UpdateProgerssBar(int interval)
{
    int value = ui->progressBar->value()+interval;

................................................................................
}

void MainWindow::ChangeTargetDirectory(QString newTargetDirPath)
{
    ///todo
}

void MainWindow::increaceTypeLables()
{
    if (sessionStarted) {
        session->increaseTypeindexes();
        UpdateFieldLable(session->getCurrentNoteType());
        setLableText(ui->Next_label,session->getNextUserType());
        setLableText(ui->Prev_label,session->getPrevUserType());
    }

}

void MainWindow::decreaceTypeLables()
{
    if (sessionStarted) {
        session->decreaseTypeindexes();
        UpdateFieldLable(session->getCurrentNoteType());
        setLableText(ui->Next_label,session->getNextUserType());
        setLableText(ui->Prev_label,session->getPrevUserType());
    }
}


//Update the filed and content for the GUI lable and textedit controls
void MainWindow::UpdateFieldLable(QString field)
{
    QFont f( "Arial", 22, QFont::Bold);
    ui->label_field->setFont(f);
    ui->label_field->setText(field + ":");
    ui->textEdit->setText("");
    ui->textEdit->setCurrentFont(f);
    ui->textEdit->setFont(f);
}

void MainWindow::NotifySessionTimeEnded()
{
    QMessageBox::about(this, tr("Session time ended"),
                       tr("Please note that the session time is ended.\nYou may continue use RR2 or initilize a new session."));
}

void MainWindow::setLableText(QString lableName, QString Text)
{
    if ("Prev_label" == lableName) {
        ui->Prev_label->setText(Text);
    } else if ("Next_label" == lableName) {
         ui->Next_label->setText(Text);
    }
}

void MainWindow::setLableText(QLabel * lableName, QString Text)
{
    lableName->setText(Text);
}

void MainWindow::initLables()
{
    QFont f( "Arial", 15, QFont::Bold);
    ui->Prev_label->setFont(f);
    setLableText("Prev_label","");
    ui->Next_label->setFont(f);
    setLableText("Next_label","");
}

void MainWindow::updateAllTypeLables(bool increase)
{
    if (increase) {

    } else {
    }
}

void MainWindow::clearContentText()
{
    ui->textEdit->setText("");
}

QString MainWindow::getHelpString() const
{
    return helpString;
}

void MainWindow::setHelpString()
{

Changes to RapidReporter2/mainwindow.h.

1
2
3
4
5

6
7
8
9
10
11
12
..
35
36
37
38
39
40
41


42
43
44
45
46
47
48
49
50
51
52
53
54





55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QKeyEvent>

#include "keyenterreceiver.h"
#include "session.h"

namespace Ui {
class MainWindow;
}

................................................................................
    void on_pushButton_clicked();
    void HandleCatchFieldContent(QString,QString);
    void UpdateProgerssBar(int);
    void SessionTimeEnded();
    void ShowHelp();
    void StartWithSpecialUserTypes(QStringList UserTypes);
    void ChangeTargetDirectory(QString newTargetDirPath);



signals:

    void EmitFieldContent(QString,QString);
    void EmitTakeScreenshot();
    void EmitNoteTake(QString,QString);
    void EmitResetTimer(int);


protected:
    void creatAndStartSession(QString,QString);
    void UpdateFieldLable(QString);
    void NotifySessionTimeEnded();





    //void keyPressEvent(QKeyEvent *);

private:
    Ui::MainWindow *ui;
    QString helpString;
    bool sessionStarted;
    Session * session;
    QString reporterTmp;
    QStringList userTypeTmp;
    void closeEvent(QCloseEvent *);
};

#endif // MAINWINDOW_H





>







 







>
>













>
>
>
>
>













1
2
3
4
5
6
7
8
9
10
11
12
13
..
36
37
38
39
40
41
42
43
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
74
75
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QKeyEvent>
#include <QLabel>
#include "keyenterreceiver.h"
#include "session.h"

namespace Ui {
class MainWindow;
}

................................................................................
    void on_pushButton_clicked();
    void HandleCatchFieldContent(QString,QString);
    void UpdateProgerssBar(int);
    void SessionTimeEnded();
    void ShowHelp();
    void StartWithSpecialUserTypes(QStringList UserTypes);
    void ChangeTargetDirectory(QString newTargetDirPath);
    void increaceTypeLables();
    void decreaceTypeLables();

signals:

    void EmitFieldContent(QString,QString);
    void EmitTakeScreenshot();
    void EmitNoteTake(QString,QString);
    void EmitResetTimer(int);


protected:
    void creatAndStartSession(QString,QString);
    void UpdateFieldLable(QString);
    void NotifySessionTimeEnded();
    void setLableText(QString lableName, QString Text);
    void setLableText(QLabel *lableName, QString Text);
    void initLables();
    void updateAllTypeLables(bool increase);
    void clearContentText();
    //void keyPressEvent(QKeyEvent *);

private:
    Ui::MainWindow *ui;
    QString helpString;
    bool sessionStarted;
    Session * session;
    QString reporterTmp;
    QStringList userTypeTmp;
    void closeEvent(QCloseEvent *);
};

#endif // MAINWINDOW_H

Changes to RapidReporter2/mainwindow.ui.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
...
100
101
102
103
104
105
106


























107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralWidget">
   <widget class="QPushButton" name="pushButton">
    <property name="geometry">
     <rect>
      <x>100</x>
      <y>10</y>
      <width>91</width>
      <height>23</height>
     </rect>
    </property>
    <property name="text">
     <string>Screenshot</string>
    </property>
   </widget>
   <widget class="QPushButton" name="pushButton_2">
    <property name="geometry">
     <rect>
      <x>100</x>
      <y>40</y>
      <width>91</width>
      <height>23</height>
     </rect>
    </property>
    <property name="text">
     <string>RTF</string>
................................................................................
    <property name="readOnly">
     <bool>false</bool>
    </property>
    <property name="html">
     <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
    </property>
   </widget>
   <widget class="QLabel" name="label_field">
    <property name="geometry">
     <rect>
      <x>200</x>
      <y>10</y>
      <width>211</width>
      <height>51</height>
     </rect>
    </property>
    <property name="text">
     <string/>
    </property>
    <property name="alignment">
................................................................................
    <property name="orientation">
     <enum>Qt::Vertical</enum>
    </property>
    <property name="textDirection">
     <enum>QProgressBar::BottomToTop</enum>
    </property>
   </widget>


























  </widget>
  <widget class="QMenuBar" name="menuBar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>847</width>
     <height>20</height>
    </rect>
   </property>
  </widget>
  <widget class="QToolBar" name="mainToolBar">
   <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
   </attribute>







|












|







 







|
|





|

|







 







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







|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
...
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralWidget">
   <widget class="QPushButton" name="pushButton">
    <property name="geometry">
     <rect>
      <x>70</x>
      <y>10</y>
      <width>91</width>
      <height>23</height>
     </rect>
    </property>
    <property name="text">
     <string>Screenshot</string>
    </property>
   </widget>
   <widget class="QPushButton" name="pushButton_2">
    <property name="geometry">
     <rect>
      <x>70</x>
      <y>40</y>
      <width>91</width>
      <height>23</height>
     </rect>
    </property>
    <property name="text">
     <string>RTF</string>
................................................................................
    <property name="readOnly">
     <bool>false</bool>
    </property>
    <property name="html">
     <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
    </property>
   </widget>
   <widget class="QLabel" name="label_field">
    <property name="geometry">
     <rect>
      <x>250</x>
      <y>10</y>
      <width>161</width>
      <height>51</height>
     </rect>
    </property>
    <property name="text">
     <string/>
    </property>
    <property name="alignment">
................................................................................
    <property name="orientation">
     <enum>Qt::Vertical</enum>
    </property>
    <property name="textDirection">
     <enum>QProgressBar::BottomToTop</enum>
    </property>
   </widget>
   <widget class="QLabel" name="Prev_label">
    <property name="geometry">
     <rect>
      <x>170</x>
      <y>40</y>
      <width>121</width>
      <height>20</height>
     </rect>
    </property>
    <property name="text">
     <string>TextLabel</string>
    </property>
   </widget>
   <widget class="QLabel" name="Next_label">
    <property name="geometry">
     <rect>
      <x>170</x>
      <y>10</y>
      <width>121</width>
      <height>16</height>
     </rect>
    </property>
    <property name="text">
     <string>TextLabel</string>
    </property>
   </widget>
  </widget>
  <widget class="QMenuBar" name="menuBar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>847</width>
     <height>21</height>
    </rect>
   </property>
  </widget>
  <widget class="QToolBar" name="mainToolBar">
   <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
   </attribute>

Changes to RapidReporter2/session.cpp.

14
15
16
17
18
19
20
21
22
23
24


25
26
27
28
29
30
31
..
96
97
98
99
100
101
102





















103
104
105
106
107
108
109
...
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
    reporter=Reporter;
    charter=Charter;

    timerInit = 1000 * 60 * 90;
    timeinterval = (100 / timerInit) + 1;
    sessionTimeOver = false;

    userTypes << "Setup:" <<  "Note:" <<  "Test:" <<
                 "Check:" << "Bug:" << "Question:" << "Next Time:";

    currentTypeIndex = 0;



    connect(&this->screenshot,SIGNAL(ScreenshotCaptured(QString)),
            this,SLOT(ScreenshotTakenSlot(QString)));
    connect(&this->sessionTimer,SIGNAL(timeout()),
            this,SLOT(TimeOutSlot()));
    sessionTimer.setInterval(timeinterval);
    sessionTimer.start(timerInit);
................................................................................
}

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





















bool Session::getSessionTimeOver() const
{
    return sessionTimeOver;
}



................................................................................
{
    timerInit = 1000 * 60 * timeToInit;
    sessionTimer.start(timerInit);
}

QString Session::getNextUserType()
{
    QString ret ="";


    return ret;
}

QString Session::getPrevUserType()
{
    QString ret ="";


    return ret;
}


QString Session::getCurrentNoteType()
{
    QString ret;
    ret = userTypes[currentTypeIndex];
    int count = userTypes.count();
    currentTypeIndex = (++currentTypeIndex == count) ? 0 : currentTypeIndex;

    QString d(currentTypeIndex);

    qDebug() << "Current index is: "  ;

    return ret;
}








|
|


>
>







 







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







 







|







|










<
<
<
<
<
<




14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
...
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317






318
319
320
321
    reporter=Reporter;
    charter=Charter;

    timerInit = 1000 * 60 * 90;
    timeinterval = (100 / timerInit) + 1;
    sessionTimeOver = false;

    userTypes << "Setup" <<  "Note" <<  "Test" <<
                 "Check" << "Bug" << "Question" << "Next Time";

    currentTypeIndex = 0;
    prevTypeIndex = userTypes.count() - 1;
    nextTypeIndex = currentTypeIndex + 1;

    connect(&this->screenshot,SIGNAL(ScreenshotCaptured(QString)),
            this,SLOT(ScreenshotTakenSlot(QString)));
    connect(&this->sessionTimer,SIGNAL(timeout()),
            this,SLOT(TimeOutSlot()));
    sessionTimer.setInterval(timeinterval);
    sessionTimer.start(timerInit);
................................................................................
}

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;
    prevTypeIndex = (++prevTypeIndex == count) ? 0 : prevTypeIndex;
}

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

    currentTypeIndex = (--currentTypeIndex < 0) ? count - 1 : currentTypeIndex;
    nextTypeIndex = (--nextTypeIndex < 0) ? count - 1 : nextTypeIndex;
    prevTypeIndex = (--prevTypeIndex < 0) ? count - 1 : prevTypeIndex;
}



bool Session::getSessionTimeOver() const
{
    return sessionTimeOver;
}



................................................................................
{
    timerInit = 1000 * 60 * timeToInit;
    sessionTimer.start(timerInit);
}

QString Session::getNextUserType()
{
    QString ret =userTypes[nextTypeIndex];


    return ret;
}

QString Session::getPrevUserType()
{
    QString ret =userTypes[prevTypeIndex];


    return ret;
}


QString Session::getCurrentNoteType()
{
    QString ret;
    ret = userTypes[currentTypeIndex];







    return ret;
}

Changes to RapidReporter2/session.h.

24
25
26
27
28
29
30


31
32
33
34
35
36
37
..
61
62
63
64
65
66
67


68
69
70
71
72
73
74
    QString charter;
    QString csvFileName;
    QFile * csvFile;

    // Handle note typs such as: Setup: Note: Test: Check: Bug: Question: Next Time:  etc..
    QStringList userTypes;
    int currentTypeIndex;




    // file hendling members
    QString workingDir;
    QString sessionFile;
    QString sessionFileFull;

................................................................................
    void UpdateNotes(int type, QString note, QString screenshot, QString RTFNote);
    void UpdateNotes(QString type, QString note, QString screenshot = "", QString RTFNote = "");
    Screenshot screenshot;
    QString TimeConversion(int msecs);

    QString getNextUserType();
    QString getPrevUserType();


    //QString getSpecificUserType (QString userTypes[], int &index,int count);

    QString getCurrentNoteType();

    QTimer sessionTimer;

    QStringList getUserTypes() const;







>
>







 







>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
    QString charter;
    QString csvFileName;
    QFile * csvFile;

    // Handle note typs such as: Setup: Note: Test: Check: Bug: Question: Next Time:  etc..
    QStringList userTypes;
    int currentTypeIndex;
    int prevTypeIndex;
    int nextTypeIndex;


    // file hendling members
    QString workingDir;
    QString sessionFile;
    QString sessionFileFull;

................................................................................
    void UpdateNotes(int type, QString note, QString screenshot, QString RTFNote);
    void UpdateNotes(QString type, QString note, QString screenshot = "", QString RTFNote = "");
    Screenshot screenshot;
    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;

Changes to RapidReporter2/ui_mainwindow.h.

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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72






73
74
75
76
77
78
79
80
81
82
83
..
88
89
90
91
92
93
94
95
96
97


98
99
100
101
102
103
104
105
106
107
108
public:
    QWidget *centralWidget;
    QPushButton *pushButton;
    QPushButton *pushButton_2;
    QTextEdit *textEdit;
    QLabel *label_field;
    QProgressBar *progressBar;


    QMenuBar *menuBar;
    QToolBar *mainToolBar;

    void setupUi(QMainWindow *MainWindow)
    {
        if (MainWindow->objectName().isEmpty())
            MainWindow->setObjectName(QStringLiteral("MainWindow"));
        MainWindow->resize(847, 144);
        centralWidget = new QWidget(MainWindow);
        centralWidget->setObjectName(QStringLiteral("centralWidget"));
        pushButton = new QPushButton(centralWidget);
        pushButton->setObjectName(QStringLiteral("pushButton"));
        pushButton->setGeometry(QRect(100, 10, 91, 23));
        pushButton_2 = new QPushButton(centralWidget);
        pushButton_2->setObjectName(QStringLiteral("pushButton_2"));
        pushButton_2->setGeometry(QRect(100, 40, 91, 23));
        textEdit = new QTextEdit(centralWidget);
        textEdit->setObjectName(QStringLiteral("textEdit"));
        textEdit->setGeometry(QRect(430, 10, 391, 51));
        textEdit->setReadOnly(false);
        label_field = new QLabel(centralWidget);
        label_field->setObjectName(QStringLiteral("label_field"));
        label_field->setGeometry(QRect(200, 10, 211, 51));
        label_field->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
        progressBar = new QProgressBar(centralWidget);
        progressBar->setObjectName(QStringLiteral("progressBar"));
        progressBar->setGeometry(QRect(20, 10, 21, 71));
        QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
        sizePolicy.setHorizontalStretch(0);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(progressBar->sizePolicy().hasHeightForWidth());
        progressBar->setSizePolicy(sizePolicy);
        progressBar->setValue(0);
        progressBar->setAlignment(Qt::AlignCenter);
        progressBar->setOrientation(Qt::Vertical);
        progressBar->setTextDirection(QProgressBar::BottomToTop);






        MainWindow->setCentralWidget(centralWidget);
        menuBar = new QMenuBar(MainWindow);
        menuBar->setObjectName(QStringLiteral("menuBar"));
        menuBar->setGeometry(QRect(0, 0, 847, 20));
        MainWindow->setMenuBar(menuBar);
        mainToolBar = new QToolBar(MainWindow);
        mainToolBar->setObjectName(QStringLiteral("mainToolBar"));
        MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);

        retranslateUi(MainWindow);

................................................................................
    {
        MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
        pushButton->setText(QApplication::translate("MainWindow", "Screenshot", 0));
        pushButton_2->setText(QApplication::translate("MainWindow", "RTF", 0));
        textEdit->setHtml(QApplication::translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;\"><br /></p></body></html>", 0));
        label_field->setText(QString());


    } // retranslateUi

};

namespace Ui {
    class MainWindow: public Ui_MainWindow {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_MAINWINDOW_H







>
>












|


|






|













>
>
>
>
>
>



|







 







|
|

>
>











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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
..
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
public:
    QWidget *centralWidget;
    QPushButton *pushButton;
    QPushButton *pushButton_2;
    QTextEdit *textEdit;
    QLabel *label_field;
    QProgressBar *progressBar;
    QLabel *Prev_label;
    QLabel *Next_label;
    QMenuBar *menuBar;
    QToolBar *mainToolBar;

    void setupUi(QMainWindow *MainWindow)
    {
        if (MainWindow->objectName().isEmpty())
            MainWindow->setObjectName(QStringLiteral("MainWindow"));
        MainWindow->resize(847, 144);
        centralWidget = new QWidget(MainWindow);
        centralWidget->setObjectName(QStringLiteral("centralWidget"));
        pushButton = new QPushButton(centralWidget);
        pushButton->setObjectName(QStringLiteral("pushButton"));
        pushButton->setGeometry(QRect(70, 10, 91, 23));
        pushButton_2 = new QPushButton(centralWidget);
        pushButton_2->setObjectName(QStringLiteral("pushButton_2"));
        pushButton_2->setGeometry(QRect(70, 40, 91, 23));
        textEdit = new QTextEdit(centralWidget);
        textEdit->setObjectName(QStringLiteral("textEdit"));
        textEdit->setGeometry(QRect(430, 10, 391, 51));
        textEdit->setReadOnly(false);
        label_field = new QLabel(centralWidget);
        label_field->setObjectName(QStringLiteral("label_field"));
        label_field->setGeometry(QRect(250, 10, 161, 51));
        label_field->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
        progressBar = new QProgressBar(centralWidget);
        progressBar->setObjectName(QStringLiteral("progressBar"));
        progressBar->setGeometry(QRect(20, 10, 21, 71));
        QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
        sizePolicy.setHorizontalStretch(0);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(progressBar->sizePolicy().hasHeightForWidth());
        progressBar->setSizePolicy(sizePolicy);
        progressBar->setValue(0);
        progressBar->setAlignment(Qt::AlignCenter);
        progressBar->setOrientation(Qt::Vertical);
        progressBar->setTextDirection(QProgressBar::BottomToTop);
        Prev_label = new QLabel(centralWidget);
        Prev_label->setObjectName(QStringLiteral("Prev_label"));
        Prev_label->setGeometry(QRect(170, 40, 121, 20));
        Next_label = new QLabel(centralWidget);
        Next_label->setObjectName(QStringLiteral("Next_label"));
        Next_label->setGeometry(QRect(170, 10, 121, 16));
        MainWindow->setCentralWidget(centralWidget);
        menuBar = new QMenuBar(MainWindow);
        menuBar->setObjectName(QStringLiteral("menuBar"));
        menuBar->setGeometry(QRect(0, 0, 847, 21));
        MainWindow->setMenuBar(menuBar);
        mainToolBar = new QToolBar(MainWindow);
        mainToolBar->setObjectName(QStringLiteral("mainToolBar"));
        MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);

        retranslateUi(MainWindow);

................................................................................
    {
        MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
        pushButton->setText(QApplication::translate("MainWindow", "Screenshot", 0));
        pushButton_2->setText(QApplication::translate("MainWindow", "RTF", 0));
        textEdit->setHtml(QApplication::translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;\"><br /></p></body></html>", 0));
        label_field->setText(QString());
        Prev_label->setText(QApplication::translate("MainWindow", "TextLabel", 0));
        Next_label->setText(QApplication::translate("MainWindow", "TextLabel", 0));
    } // retranslateUi

};

namespace Ui {
    class MainWindow: public Ui_MainWindow {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_MAINWINDOW_H