Pārlūkot izejas kodu

Merge branch 'development' into issue83

Neal Wilson 6 gadus atpakaļ
vecāks
revīzija
1121b2a75d
8 mainītis faili ar 1493 papildinājumiem un 1311 dzēšanām
  1. 19
    19
      src/daterangeselector.cpp
  2. 4
    4
      src/daterangeselector.h
  3. 2
    2
      src/draglabel.cpp
  4. 2
    2
      src/draglabel.h
  5. 101
    13
      src/moc_typica.cpp
  6. 6
    6
      src/scale.cpp
  7. 2
    2
      src/scale.h
  8. 1357
    1263
      src/typica.cpp

+ 19
- 19
src/daterangeselector.cpp Parādīt failu

1
-/*696:*/
1
+/*702:*/
2
 #line 70 "./daterangeselector.w"
2
 #line 70 "./daterangeselector.w"
3
 
3
 
4
 #include <QCalendarWidget> 
4
 #include <QCalendarWidget> 
11
 
11
 
12
 #include "daterangeselector.h"
12
 #include "daterangeselector.h"
13
 
13
 
14
-/*698:*/
14
+/*704:*/
15
 #line 115 "./daterangeselector.w"
15
 #line 115 "./daterangeselector.w"
16
 
16
 
17
 CustomDateRangePopup::CustomDateRangePopup(QWidget*parent):
17
 CustomDateRangePopup::CustomDateRangePopup(QWidget*parent):
55
 setLayout(outerLayout);
55
 setLayout(outerLayout);
56
 }
56
 }
57
 
57
 
58
-/*:698*//*699:*/
58
+/*:704*//*705:*/
59
 #line 163 "./daterangeselector.w"
59
 #line 163 "./daterangeselector.w"
60
 
60
 
61
 void CustomDateRangePopup::hideEvent(QHideEvent*)
61
 void CustomDateRangePopup::hideEvent(QHideEvent*)
63
 emit hidingPopup();
63
 emit hidingPopup();
64
 }
64
 }
65
 
65
 
66
-/*:699*//*700:*/
66
+/*:705*//*706:*/
67
 #line 172 "./daterangeselector.w"
67
 #line 172 "./daterangeselector.w"
68
 
68
 
69
 void CustomDateRangePopup::applyRange()
69
 void CustomDateRangePopup::applyRange()
78
 hide();
78
 hide();
79
 }
79
 }
80
 
80
 
81
-/*:700*//*701:*/
81
+/*:706*//*707:*/
82
 #line 189 "./daterangeselector.w"
82
 #line 189 "./daterangeselector.w"
83
 
83
 
84
 void CustomDateRangePopup::validateRange()
84
 void CustomDateRangePopup::validateRange()
93
 }
93
 }
94
 }
94
 }
95
 
95
 
96
-/*:701*/
96
+/*:707*/
97
 #line 81 "./daterangeselector.w"
97
 #line 81 "./daterangeselector.w"
98
 
98
 
99
-/*702:*/
99
+/*708:*/
100
 #line 207 "./daterangeselector.w"
100
 #line 207 "./daterangeselector.w"
101
 
101
 
102
 DateRangeSelector::DateRangeSelector(QWidget*parent):
102
 DateRangeSelector::DateRangeSelector(QWidget*parent):
108
 QDate currentDate= QDate::currentDate();
108
 QDate currentDate= QDate::currentDate();
109
 
109
 
110
 QHBoxLayout*layout= new QHBoxLayout;
110
 QHBoxLayout*layout= new QHBoxLayout;
111
-/*703:*/
111
+/*709:*/
112
 #line 236 "./daterangeselector.w"
112
 #line 236 "./daterangeselector.w"
113
 
113
 
114
 quickSelector->addItem("Yesterday",QVariant(QStringList()<<
114
 quickSelector->addItem("Yesterday",QVariant(QStringList()<<
188
 quickSelector->addItem("Lifetime");
188
 quickSelector->addItem("Lifetime");
189
 quickSelector->addItem("Custom");
189
 quickSelector->addItem("Custom");
190
 
190
 
191
-/*:703*/
191
+/*:709*/
192
 #line 217 "./daterangeselector.w"
192
 #line 217 "./daterangeselector.w"
193
 
193
 
194
 QToolButton*customButton= new QToolButton;
194
 QToolButton*customButton= new QToolButton;
201
 connect(customButton,SIGNAL(clicked()),this,SLOT(toggleCustom()));
201
 connect(customButton,SIGNAL(clicked()),this,SLOT(toggleCustom()));
202
 }
202
 }
203
 
203
 
204
-/*:702*//*704:*/
204
+/*:708*//*710:*/
205
 #line 319 "./daterangeselector.w"
205
 #line 319 "./daterangeselector.w"
206
 
206
 
207
 void DateRangeSelector::updateRange(int index)
207
 void DateRangeSelector::updateRange(int index)
217
 }
217
 }
218
 }
218
 }
219
 
219
 
220
-/*:704*//*705:*/
220
+/*:710*//*711:*/
221
 #line 336 "./daterangeselector.w"
221
 #line 336 "./daterangeselector.w"
222
 
222
 
223
 void DateRangeSelector::popupHidden()
223
 void DateRangeSelector::popupHidden()
227
 quickSelector->setCurrentIndex(lastIndex);
227
 quickSelector->setCurrentIndex(lastIndex);
228
 }
228
 }
229
 
229
 
230
-/*:705*//*706:*/
230
+/*:711*//*712:*/
231
 #line 347 "./daterangeselector.w"
231
 #line 347 "./daterangeselector.w"
232
 
232
 
233
 void DateRangeSelector::setCustomRange(QVariant range)
233
 void DateRangeSelector::setCustomRange(QVariant range)
238
 quickSelector->setCurrentIndex(lastIndex);
238
 quickSelector->setCurrentIndex(lastIndex);
239
 }
239
 }
240
 
240
 
241
-/*:706*//*707:*/
241
+/*:712*//*713:*/
242
 #line 362 "./daterangeselector.w"
242
 #line 362 "./daterangeselector.w"
243
 
243
 
244
 void DateRangeSelector::toggleCustom()
244
 void DateRangeSelector::toggleCustom()
279
 }
279
 }
280
 }
280
 }
281
 
281
 
282
-/*:707*//*708:*/
282
+/*:713*//*714:*/
283
 #line 404 "./daterangeselector.w"
283
 #line 404 "./daterangeselector.w"
284
 
284
 
285
 QVariant DateRangeSelector::currentRange()
285
 QVariant DateRangeSelector::currentRange()
287
 return quickSelector->itemData(lastIndex);
287
 return quickSelector->itemData(lastIndex);
288
 }
288
 }
289
 
289
 
290
-/*:708*//*709:*/
290
+/*:714*//*715:*/
291
 #line 412 "./daterangeselector.w"
291
 #line 412 "./daterangeselector.w"
292
 
292
 
293
 void DateRangeSelector::setCurrentIndex(int index)
293
 void DateRangeSelector::setCurrentIndex(int index)
300
 return quickSelector->currentIndex();
300
 return quickSelector->currentIndex();
301
 }
301
 }
302
 
302
 
303
-/*:709*//*710:*/
303
+/*:715*//*716:*/
304
 #line 432 "./daterangeselector.w"
304
 #line 432 "./daterangeselector.w"
305
 
305
 
306
 void DateRangeSelector::setLifetimeRange(QString startDate,QString endDate)
306
 void DateRangeSelector::setLifetimeRange(QString startDate,QString endDate)
309
 QVariant(QStringList()<<startDate<<endDate));
309
 QVariant(QStringList()<<startDate<<endDate));
310
 }
310
 }
311
 
311
 
312
-/*:710*//*711:*/
312
+/*:716*//*717:*/
313
 #line 442 "./daterangeselector.w"
313
 #line 442 "./daterangeselector.w"
314
 
314
 
315
 void DateRangeSelector::removeIndex(int index)
315
 void DateRangeSelector::removeIndex(int index)
317
 quickSelector->removeItem(index);
317
 quickSelector->removeItem(index);
318
 }
318
 }
319
 
319
 
320
-/*:711*/
320
+/*:717*/
321
 #line 82 "./daterangeselector.w"
321
 #line 82 "./daterangeselector.w"
322
 
322
 
323
 
323
 
325
 #include "moc_daterangeselector.cpp"
325
 #include "moc_daterangeselector.cpp"
326
 #endif
326
 #endif
327
 
327
 
328
-/*:696*/
328
+/*:702*/

+ 4
- 4
src/daterangeselector.h Parādīt failu

1
-/*695:*/
1
+/*701:*/
2
 #line 30 "./daterangeselector.w"
2
 #line 30 "./daterangeselector.w"
3
 
3
 
4
 
4
 
9
 #ifndef TypicaDateRangeSelectorHeader
9
 #ifndef TypicaDateRangeSelectorHeader
10
 #define TypicaDateRangeSelectorHeader
10
 #define TypicaDateRangeSelectorHeader
11
 
11
 
12
-/*697:*/
12
+/*703:*/
13
 #line 91 "./daterangeselector.w"
13
 #line 91 "./daterangeselector.w"
14
 
14
 
15
 class CustomDateRangePopup:public QWidget
15
 class CustomDateRangePopup:public QWidget
31
 QPushButton*applyButton;
31
 QPushButton*applyButton;
32
 };
32
 };
33
 
33
 
34
-/*:697*/
34
+/*:703*/
35
 #line 39 "./daterangeselector.w"
35
 #line 39 "./daterangeselector.w"
36
 
36
 
37
 
37
 
62
 
62
 
63
 #endif
63
 #endif
64
 
64
 
65
-/*:695*/
65
+/*:701*/

+ 2
- 2
src/draglabel.cpp Parādīt failu

1
-/*1091:*/
1
+/*1097:*/
2
 #line 33 "./scales.w"
2
 #line 33 "./scales.w"
3
 
3
 
4
 #include "draglabel.h"
4
 #include "draglabel.h"
26
 }
26
 }
27
 }
27
 }
28
 
28
 
29
-/*:1091*/
29
+/*:1097*/

+ 2
- 2
src/draglabel.h Parādīt failu

1
-/*1090:*/
1
+/*1096:*/
2
 #line 13 "./scales.w"
2
 #line 13 "./scales.w"
3
 
3
 
4
 #ifndef TypicaDragLabelInclude
4
 #ifndef TypicaDragLabelInclude
17
 
17
 
18
 #endif
18
 #endif
19
 
19
 
20
-/*:1090*/
20
+/*:1096*/

+ 101
- 13
src/moc_typica.cpp Parādīt failu

2496
        6,       // revision
2496
        6,       // revision
2497
        0,       // classname
2497
        0,       // classname
2498
        0,    0, // classinfo
2498
        0,    0, // classinfo
2499
-       8,   14, // methods
2499
+       9,   14, // methods
2500
        0,    0, // properties
2500
        0,    0, // properties
2501
        0,    0, // enums/sets
2501
        0,    0, // enums/sets
2502
        0,    0, // constructors
2502
        0,    0, // constructors
2509
  // slots: signature, parameters, type, tag, flags
2509
  // slots: signature, parameters, type, tag, flags
2510
       46,   39,   12,   12, 0x0a,
2510
       46,   39,   12,   12, 0x0a,
2511
       73,   13,   12,   12, 0x0a,
2511
       73,   13,   12,   12, 0x0a,
2512
-     103,   12,   12,   12, 0x0a,
2512
+     116,  103,   12,   12, 0x0a,
2513
+     132,   12,   12,   12, 0x0a,
2513
 
2514
 
2514
  // methods: signature, parameters, type, tag, flags
2515
  // methods: signature, parameters, type, tag, flags
2515
-     134,   12,  129,   12, 0x02,
2516
-     162,   12,  154,   12, 0x02,
2517
-     196,  182,  129,   12, 0x02,
2518
-     219,   12,  129,   12, 0x02,
2516
+     163,   12,  158,   12, 0x02,
2517
+     191,   12,  183,   12, 0x02,
2518
+     225,  211,  158,   12, 0x02,
2519
+     248,   12,  158,   12, 0x02,
2519
 
2520
 
2520
        0        // eod
2521
        0        // eod
2521
 };
2522
 };
2524
     "Application\0\0user\0userChanged(QString)\0"
2525
     "Application\0\0user\0userChanged(QString)\0"
2525
     "status\0setDatabaseConnected(bool)\0"
2526
     "status\0setDatabaseConnected(bool)\0"
2526
     "setCurrentTypicaUser(QString)\0"
2527
     "setCurrentTypicaUser(QString)\0"
2528
+    "notification\0notify(QString)\0"
2527
     "saveDeviceConfiguration()\0bool\0"
2529
     "saveDeviceConfiguration()\0bool\0"
2528
     "databaseConnected()\0QString\0"
2530
     "databaseConnected()\0QString\0"
2529
     "currentTypicaUser()\0user,password\0"
2531
     "currentTypicaUser()\0user,password\0"
2539
         case 0: _t->userChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
2541
         case 0: _t->userChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
2540
         case 1: _t->setDatabaseConnected((*reinterpret_cast< bool(*)>(_a[1]))); break;
2542
         case 1: _t->setDatabaseConnected((*reinterpret_cast< bool(*)>(_a[1]))); break;
2541
         case 2: _t->setCurrentTypicaUser((*reinterpret_cast< const QString(*)>(_a[1]))); break;
2543
         case 2: _t->setCurrentTypicaUser((*reinterpret_cast< const QString(*)>(_a[1]))); break;
2542
-        case 3: _t->saveDeviceConfiguration(); break;
2543
-        case 4: { bool _r = _t->databaseConnected();
2544
+        case 3: _t->notify((*reinterpret_cast< const QString(*)>(_a[1]))); break;
2545
+        case 4: _t->saveDeviceConfiguration(); break;
2546
+        case 5: { bool _r = _t->databaseConnected();
2544
             if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
2547
             if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
2545
-        case 5: { QString _r = _t->currentTypicaUser();
2548
+        case 6: { QString _r = _t->currentTypicaUser();
2546
             if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
2549
             if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
2547
-        case 6: { bool _r = _t->login((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])));
2550
+        case 7: { bool _r = _t->login((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])));
2548
             if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
2551
             if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
2549
-        case 7: { bool _r = _t->autoLogin();
2552
+        case 8: { bool _r = _t->autoLogin();
2550
             if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
2553
             if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
2551
         default: ;
2554
         default: ;
2552
         }
2555
         }
2585
     if (_id < 0)
2588
     if (_id < 0)
2586
         return _id;
2589
         return _id;
2587
     if (_c == QMetaObject::InvokeMetaMethod) {
2590
     if (_c == QMetaObject::InvokeMetaMethod) {
2588
-        if (_id < 8)
2591
+        if (_id < 9)
2589
             qt_static_metacall(this, _c, _id, _a);
2592
             qt_static_metacall(this, _c, _id, _a);
2590
-        _id -= 8;
2593
+        _id -= 9;
2591
     }
2594
     }
2592
     return _id;
2595
     return _id;
2593
 }
2596
 }
2598
     void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
2601
     void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
2599
     QMetaObject::activate(this, &staticMetaObject, 0, _a);
2602
     QMetaObject::activate(this, &staticMetaObject, 0, _a);
2600
 }
2603
 }
2604
+static const uint qt_meta_data_DatabaseNotification[] = {
2605
+
2606
+ // content:
2607
+       6,       // revision
2608
+       0,       // classname
2609
+       0,    0, // classinfo
2610
+       2,   14, // methods
2611
+       0,    0, // properties
2612
+       0,    0, // enums/sets
2613
+       0,    0, // constructors
2614
+       0,       // flags
2615
+       1,       // signalCount
2616
+
2617
+ // signals: signature, parameters, type, tag, flags
2618
+      35,   22,   21,   21, 0x05,
2619
+
2620
+ // slots: signature, parameters, type, tag, flags
2621
+      51,   22,   21,   21, 0x0a,
2622
+
2623
+       0        // eod
2624
+};
2625
+
2626
+static const char qt_meta_stringdata_DatabaseNotification[] = {
2627
+    "DatabaseNotification\0\0notification\0"
2628
+    "notify(QString)\0forwardNotification(QString)\0"
2629
+};
2630
+
2631
+void DatabaseNotification::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
2632
+{
2633
+    if (_c == QMetaObject::InvokeMetaMethod) {
2634
+        Q_ASSERT(staticMetaObject.cast(_o));
2635
+        DatabaseNotification *_t = static_cast<DatabaseNotification *>(_o);
2636
+        switch (_id) {
2637
+        case 0: _t->notify((*reinterpret_cast< const QString(*)>(_a[1]))); break;
2638
+        case 1: _t->forwardNotification((*reinterpret_cast< const QString(*)>(_a[1]))); break;
2639
+        default: ;
2640
+        }
2641
+    }
2642
+}
2643
+
2644
+const QMetaObjectExtraData DatabaseNotification::staticMetaObjectExtraData = {
2645
+    0,  qt_static_metacall 
2646
+};
2647
+
2648
+const QMetaObject DatabaseNotification::staticMetaObject = {
2649
+    { &QObject::staticMetaObject, qt_meta_stringdata_DatabaseNotification,
2650
+      qt_meta_data_DatabaseNotification, &staticMetaObjectExtraData }
2651
+};
2652
+
2653
+#ifdef Q_NO_DATA_RELOCATION
2654
+const QMetaObject &DatabaseNotification::getStaticMetaObject() { return staticMetaObject; }
2655
+#endif //Q_NO_DATA_RELOCATION
2656
+
2657
+const QMetaObject *DatabaseNotification::metaObject() const
2658
+{
2659
+    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
2660
+}
2661
+
2662
+void *DatabaseNotification::qt_metacast(const char *_clname)
2663
+{
2664
+    if (!_clname) return 0;
2665
+    if (!strcmp(_clname, qt_meta_stringdata_DatabaseNotification))
2666
+        return static_cast<void*>(const_cast< DatabaseNotification*>(this));
2667
+    return QObject::qt_metacast(_clname);
2668
+}
2669
+
2670
+int DatabaseNotification::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
2671
+{
2672
+    _id = QObject::qt_metacall(_c, _id, _a);
2673
+    if (_id < 0)
2674
+        return _id;
2675
+    if (_c == QMetaObject::InvokeMetaMethod) {
2676
+        if (_id < 2)
2677
+            qt_static_metacall(this, _c, _id, _a);
2678
+        _id -= 2;
2679
+    }
2680
+    return _id;
2681
+}
2682
+
2683
+// SIGNAL 0
2684
+void DatabaseNotification::notify(const QString & _t1)
2685
+{
2686
+    void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
2687
+    QMetaObject::activate(this, &staticMetaObject, 0, _a);
2688
+}
2601
 static const uint qt_meta_data_SaltModel[] = {
2689
 static const uint qt_meta_data_SaltModel[] = {
2602
 
2690
 
2603
  // content:
2691
  // content:

+ 6
- 6
src/scale.cpp Parādīt failu

1
-/*1097:*/
1
+/*1103:*/
2
 #line 135 "./scales.w"
2
 #line 135 "./scales.w"
3
 
3
 
4
 #include "scale.h"
4
 #include "scale.h"
10
 connect(this,SIGNAL(readyRead()),this,SLOT(dataAvailable()));
10
 connect(this,SIGNAL(readyRead()),this,SLOT(dataAvailable()));
11
 }
11
 }
12
 
12
 
13
-/*:1097*//*1098:*/
13
+/*:1103*//*1104:*/
14
 #line 153 "./scales.w"
14
 #line 153 "./scales.w"
15
 
15
 
16
 void SerialScale::dataAvailable()
16
 void SerialScale::dataAvailable()
24
 }
24
 }
25
 else
25
 else
26
 {
26
 {
27
-/*1099:*/
27
+/*1105:*/
28
 #line 193 "./scales.w"
28
 #line 193 "./scales.w"
29
 
29
 
30
 QStringList responseParts= QString(responseBuffer.simplified()).split(' ');
30
 QStringList responseParts= QString(responseBuffer.simplified()).split(' ');
53
 }
53
 }
54
 emit newMeasurement(weight,unit);
54
 emit newMeasurement(weight,unit);
55
 
55
 
56
-/*:1099*/
56
+/*:1105*/
57
 #line 165 "./scales.w"
57
 #line 165 "./scales.w"
58
 
58
 
59
 responseBuffer.clear();
59
 responseBuffer.clear();
61
 }
61
 }
62
 }
62
 }
63
 
63
 
64
-/*:1098*//*1100:*/
64
+/*:1104*//*1106:*/
65
 #line 224 "./scales.w"
65
 #line 224 "./scales.w"
66
 
66
 
67
 void SerialScale::tare()
67
 void SerialScale::tare()
96
 }
96
 }
97
 }
97
 }
98
 
98
 
99
-/*:1100*/
99
+/*:1106*/

+ 2
- 2
src/scale.h Parādīt failu

1
-/*1096:*/
1
+/*1102:*/
2
 #line 103 "./scales.w"
2
 #line 103 "./scales.w"
3
 
3
 
4
 #ifndef TypicaScaleInclude
4
 #ifndef TypicaScaleInclude
29
 
29
 
30
 #endif
30
 #endif
31
 
31
 
32
-/*:1096*/
32
+/*:1102*/

+ 1357
- 1263
src/typica.cpp
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


Notiek ielāde…
Atcelt
Saglabāt