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
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
92
93
94
95
96
97
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
133
134
135
136
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
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
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
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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
|
/* main_status_bar.cpp
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <glib.h>
#include "file.h"
#include <epan/expert.h>
#include <epan/prefs.h>
#include <wsutil/filesystem.h>
#include <wsutil/utf8_entities.h>
#include "ui/main_statusbar.h"
#include <ui/qt/utils/qt_ui_utils.h>
#include <ui/qt/main_window.h>
#include "capture_file.h"
#include "main_status_bar.h"
#include "profile_dialog.h"
#include <ui/qt/utils/stock_icon.h>
#include <ui/qt/utils/color_utils.h>
#include <ui/qt/capture_file.h>
#include <ui/qt/widgets/clickable_label.h>
#include <QAction>
#include <QActionGroup>
#include <QHBoxLayout>
#include <QSplitter>
#include <QToolButton>
#include <QLatin1Char>
// To do:
// - Use the CaptureFile class.
// XXX - The GTK+ code assigns priorities to these and pushes/pops accordingly.
Q_DECLARE_METATYPE(ProfileDialog::ProfileAction)
// If we ever add support for multiple windows this will need to be replaced.
// See also: main_window.cpp
static MainStatusBar *cur_main_status_bar_ = NULL;
/*
* Push a formatted temporary message onto the statusbar.
*/
void
statusbar_push_temporary_msg(const gchar *msg_format, ...)
{
va_list ap;
QString push_msg;
if (!cur_main_status_bar_) return;
va_start(ap, msg_format);
push_msg = QString::vasprintf(msg_format, ap);
va_end(ap);
mainApp->pushStatus(WiresharkApplication::TemporaryStatus, push_msg);
}
/*
* Update the packets statusbar to the current values
*/
void
packets_bar_update(void)
{
if (!cur_main_status_bar_) return;
cur_main_status_bar_->updateCaptureStatistics(NULL);
}
static const int icon_size = 14; // px
MainStatusBar::MainStatusBar(QWidget *parent) :
QStatusBar(parent),
cap_file_(NULL),
#ifdef HAVE_LIBPCAP
ready_msg_(tr("Ready to load or capture")),
#else
ready_msg_(tr("Ready to load file")),
#endif
cs_fixed_(false),
cs_count_(0)
{
QSplitter *splitter = new QSplitter(this);
QWidget *info_progress = new QWidget(this);
QHBoxLayout *info_progress_hb = new QHBoxLayout(info_progress);
#if defined(Q_OS_WIN)
// Handles are the same color as widgets, at least on Windows 7.
splitter->setHandleWidth(3);
splitter->setStyleSheet(QString(
"QSplitter::handle {"
" border-left: 1px solid palette(mid);"
" border-right: 1px solid palette(mid);"
"}"
));
#endif
#ifdef Q_OS_MAC
profile_status_.setAttribute(Qt::WA_MacSmallSize, true);
#endif
QString button_ss =
"QToolButton {"
" border: none;"
" background: transparent;" // Disables platform style on Windows.
" padding: 0px;"
" margin: 0px;"
"}";
expert_button_ = new QToolButton(this);
expert_button_->setIconSize(QSize(icon_size, icon_size));
expert_button_->setStyleSheet(button_ss);
expert_button_->hide();
// We just want a clickable image. Using a QPushButton or QToolButton would require
// a lot of adjustment.
StockIcon comment_icon("x-capture-comment-update");
comment_button_ = new QToolButton(this);
comment_button_->setIcon(comment_icon);
comment_button_->setIconSize(QSize(icon_size, icon_size));
comment_button_->setStyleSheet(button_ss);
comment_button_->setToolTip(tr("Open the Capture File Properties dialog"));
comment_button_->setEnabled(false);
connect(expert_button_, SIGNAL(clicked(bool)), this, SIGNAL(showExpertInfo()));
connect(comment_button_, SIGNAL(clicked(bool)), this, SIGNAL(editCaptureComment()));
info_progress_hb->setContentsMargins(icon_size / 2, 0, 0, 0);
info_status_.setTemporaryContext(STATUS_CTX_TEMPORARY);
info_status_.setShrinkable(true);
info_progress_hb->addWidget(expert_button_);
info_progress_hb->addWidget(comment_button_);
info_progress_hb->addWidget(&info_status_);
info_progress_hb->addWidget(&progress_frame_);
info_progress_hb->addStretch(10);
splitter->addWidget(info_progress);
splitter->addWidget(&packet_status_);
splitter->addWidget(&profile_status_);
splitter->setStretchFactor(0, 3);
splitter->setStretchFactor(1, 3);
splitter->setStretchFactor(2, 1);
addWidget(splitter, 1);
cur_main_status_bar_ = this;
splitter->hide();
info_status_.pushText(ready_msg_, STATUS_CTX_MAIN);
packets_bar_update();
#ifdef QWINTASKBARPROGRESS_H
progress_frame_.enableTaskbarUpdates(true);
#endif
connect(mainApp, SIGNAL(appInitialized()), splitter, SLOT(show()));
connect(mainApp, SIGNAL(appInitialized()), this, SLOT(appInitialized()));
connect(&info_status_, SIGNAL(toggleTemporaryFlash(bool)),
this, SLOT(toggleBackground(bool)));
connect(mainApp, SIGNAL(profileNameChanged(const gchar *)),
this, SLOT(setProfileName()));
connect(&profile_status_, SIGNAL(clickedAt(QPoint,Qt::MouseButton)),
this, SLOT(showProfileMenu(QPoint,Qt::MouseButton)));
connect(&progress_frame_, SIGNAL(stopLoading()),
this, SIGNAL(stopLoading()));
}
void MainStatusBar::showExpert() {
expertUpdate();
}
void MainStatusBar::captureFileClosing() {
expert_button_->hide();
progress_frame_.captureFileClosing();
popGenericStatus(STATUS_CTX_FIELD);
}
void MainStatusBar::expertUpdate() {
// <img> won't load @2x versions in Qt versions earlier than 5.4.
// https://bugreports.qt.io/browse/QTBUG-36383
// We might have to switch to a QPushButton.
QString stock_name = "x-expert-";
QString tt_text = tr(" is the highest expert information level");
switch(expert_get_highest_severity()) {
case(PI_ERROR):
stock_name.append("error");
tt_text.prepend(tr("ERROR"));
break;
case(PI_WARN):
stock_name.append("warn");
tt_text.prepend(tr("WARNING"));
break;
case(PI_NOTE):
stock_name.append("note");
tt_text.prepend(tr("NOTE"));
break;
case(PI_CHAT):
stock_name.append("chat");
tt_text.prepend(tr("CHAT"));
break;
// case(PI_COMMENT):
// m_expertStatus.setText("<img src=\":/expert/expert_comment.png\"></img>");
// break;
default:
stock_name.append("none");
tt_text = tr("No expert information");
break;
}
StockIcon expert_icon(stock_name);
expert_button_->setIcon(expert_icon);
expert_button_->setToolTip(tt_text);
expert_button_->show();
}
// ui/gtk/main_statusbar.c
void MainStatusBar::setFileName(CaptureFile &cf)
{
if (cf.isValid()) {
popGenericStatus(STATUS_CTX_FILE);
QString msgtip = QString("%1 (%2)")
.arg(cf.capFile()->filename)
.arg(file_size_to_qstring(cf.capFile()->f_datalen));
pushGenericStatus(STATUS_CTX_FILE, cf.fileName(), msgtip);
}
}
void MainStatusBar::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange) {
info_status_.popText(STATUS_CTX_MAIN);
info_status_.pushText(ready_msg_, STATUS_CTX_MAIN);
setStatusbarForCaptureFile();
showCaptureStatistics();
setProfileName();
}
QStatusBar::changeEvent(event);
}
void MainStatusBar::setCaptureFile(capture_file *cf)
{
cap_file_ = cf;
comment_button_->setEnabled(cap_file_ != NULL);
}
void MainStatusBar::setStatusbarForCaptureFile()
{
if (cap_file_ && cap_file_->filename && (cap_file_->state != FILE_CLOSED)) {
popGenericStatus(STATUS_CTX_FILE);
QString msgtip = QString("%1 (%2)")
.arg(cap_file_->filename)
.arg(file_size_to_qstring(cap_file_->f_datalen));
pushGenericStatus(STATUS_CTX_FILE,
gchar_free_to_qstring(cf_get_display_name(cap_file_)), msgtip);
}
}
void MainStatusBar::selectedFieldChanged(FieldInformation * finfo)
{
QString item_info;
if (! finfo) {
pushGenericStatus(STATUS_CTX_FIELD, item_info);
return;
}
FieldInformation::HeaderInfo hInfo = finfo->headerInfo();
if (hInfo.isValid)
{
if (hInfo.description.length() > 0) {
item_info.append(hInfo.description);
} else {
item_info.append(hInfo.name);
}
}
if (!item_info.isEmpty()) {
int finfo_length;
if (hInfo.isValid)
item_info.append(" (" + hInfo.abbreviation + ")");
finfo_length = finfo->position().length + finfo->appendix().length;
if (finfo_length > 0) {
item_info.append(", " + tr("%Ln byte(s)", "", finfo_length));
}
}
pushGenericStatus(STATUS_CTX_FIELD, item_info);
}
void MainStatusBar::highlightedFieldChanged(FieldInformation * finfo)
{
QString hint;
if (finfo)
{
FieldInformation::Position pos = finfo->position();
QString field_str;
if (pos.length < 2) {
hint = QString(tr("Byte %1")).arg(pos.start);
} else {
hint = QString(tr("Bytes %1-%2")).arg(pos.start).arg(pos.start + pos.length - 1);
}
hint += QString(": %1 (%2)")
.arg(finfo->headerInfo().name)
.arg(finfo->headerInfo().abbreviation);
}
pushGenericStatus(STATUS_CTX_BYTE, hint);
}
void MainStatusBar::pushGenericStatus(StatusContext status, const QString &message, const QString &messagetip)
{
LabelStack * stack = &info_status_;
if (status == STATUS_CTX_MAIN)
stack = &packet_status_;
if (message.isEmpty() && status != STATUS_CTX_FILE && status != STATUS_CTX_TEMPORARY && status != STATUS_CTX_PROGRESS)
popGenericStatus(status);
else
stack->pushText(message, status);
stack->setToolTip(messagetip);
if (status == STATUS_CTX_FILTER || status == STATUS_CTX_FILE)
expertUpdate();
}
void MainStatusBar::popGenericStatus(StatusContext status)
{
LabelStack * stack = &info_status_;
if (status == STATUS_CTX_MAIN)
stack = &packet_status_;
stack->setToolTip(QString());
stack->popText(status);
}
void MainStatusBar::setProfileName()
{
profile_status_.setText(tr("Profile: %1").arg(get_profile_name()));
}
void MainStatusBar::appInitialized()
{
setProfileName();
connect(mainApp->mainWindow(), SIGNAL(framesSelected(QList<int>)), this, SLOT(selectedFrameChanged(QList<int>)));
}
void MainStatusBar::selectedFrameChanged(QList<int>)
{
showCaptureStatistics();
}
void MainStatusBar::showCaptureStatistics()
{
QString packets_str;
QList<int> rows;
MainWindow * mw = qobject_cast<MainWindow *>(mainApp->mainWindow());
if (mw)
rows = mw->selectedRows(true);
#ifdef HAVE_LIBPCAP
if (cap_file_) {
/* Do we have any packets? */
if (!cs_fixed_) {
cs_count_ = cap_file_->count;
}
if (cs_count_ > 0) {
if (prefs.gui_show_selected_packet && rows.count() == 1) {
packets_str.append(QString(tr("Selected Packet: %1 %2 "))
.arg(rows.at(0))
.arg(UTF8_MIDDLE_DOT));
}
packets_str.append(QString(tr("Packets: %1 %4 Displayed: %2 (%3%)"))
.arg(cs_count_)
.arg(cap_file_->displayed_count)
.arg((100.0*cap_file_->displayed_count)/cs_count_, 0, 'f', 1)
.arg(UTF8_MIDDLE_DOT));
if (rows.count() > 1) {
packets_str.append(QString(tr(" %1 Selected: %2 (%3%)"))
.arg(UTF8_MIDDLE_DOT)
.arg(rows.count())
.arg((100.0*rows.count())/cs_count_, 0, 'f', 1));
}
if (cap_file_->marked_count > 0) {
packets_str.append(QString(tr(" %1 Marked: %2 (%3%)"))
.arg(UTF8_MIDDLE_DOT)
.arg(cap_file_->marked_count)
.arg((100.0*cap_file_->marked_count)/cs_count_, 0, 'f', 1));
}
if (cap_file_->drops_known) {
packets_str.append(QString(tr(" %1 Dropped: %2 (%3%)"))
.arg(UTF8_MIDDLE_DOT)
.arg(cap_file_->drops)
.arg((100.0*cap_file_->drops)/cs_count_, 0, 'f', 1));
}
if (cap_file_->ignored_count > 0) {
packets_str.append(QString(tr(" %1 Ignored: %2 (%3%)"))
.arg(UTF8_MIDDLE_DOT)
.arg(cap_file_->ignored_count)
.arg((100.0*cap_file_->ignored_count)/cs_count_, 0, 'f', 1));
}
if (cap_file_->packet_comment_count > 0) {
packets_str.append(QString(tr(" %1 Comments: %2"))
.arg(UTF8_MIDDLE_DOT)
.arg(cap_file_->packet_comment_count));
}
if (prefs.gui_show_file_load_time && !cap_file_->is_tempfile) {
/* Loading an existing file */
gulong computed_elapsed = cf_get_computed_elapsed(cap_file_);
packets_str.append(QString(tr(" %1 Load time: %2:%3.%4"))
.arg(UTF8_MIDDLE_DOT)
.arg(computed_elapsed/60000, 2, 10, QLatin1Char('0'))
.arg(computed_elapsed%60000/1000, 2, 10, QLatin1Char('0'))
.arg(computed_elapsed%1000, 3, 10, QLatin1Char('0')));
}
}
} else if (cs_fixed_ && cs_count_ > 0) {
/* There shouldn't be any rows without a cap_file_ but this is benign */
if (prefs.gui_show_selected_packet && rows.count() == 1) {
packets_str.append(QString(tr("Selected Packet: %1 %2 "))
.arg(rows.at(0))
.arg(UTF8_MIDDLE_DOT));
}
packets_str.append(QString(tr("Packets: %1"))
.arg(cs_count_));
}
#endif // HAVE_LIBPCAP
if (packets_str.isEmpty()) {
packets_str = tr("No Packets");
}
popGenericStatus(STATUS_CTX_MAIN);
pushGenericStatus(STATUS_CTX_MAIN, packets_str);
}
void MainStatusBar::updateCaptureStatistics(capture_session *cap_session)
{
cs_fixed_ = false;
#ifndef HAVE_LIBPCAP
Q_UNUSED(cap_session)
#else
if ((!cap_session || cap_session->cf == cap_file_) && cap_file_ && cap_file_->count) {
cs_count_ = cap_file_->count;
} else {
cs_count_ = 0;
}
#endif // HAVE_LIBPCAP
showCaptureStatistics();
}
void MainStatusBar::updateCaptureFixedStatistics(capture_session *cap_session)
{
cs_fixed_ = true;
#ifndef HAVE_LIBPCAP
Q_UNUSED(cap_session)
#else
if (cap_session && cap_session->count) {
cs_count_ = cap_session->count;
} else {
cs_count_ = 0;
}
#endif // HAVE_LIBPCAP
showCaptureStatistics();
}
void MainStatusBar::showProfileMenu(const QPoint &global_pos, Qt::MouseButton button)
{
ProfileModel model;
QMenu * ctx_menu_;
QMenu * profile_menu;
if (button == Qt::LeftButton) {
ctx_menu_ = nullptr;
profile_menu = new QMenu(this);
profile_menu->setAttribute(Qt::WA_DeleteOnClose);
} else {
ctx_menu_ = new QMenu(this);
ctx_menu_->setAttribute(Qt::WA_DeleteOnClose);
profile_menu = new QMenu(ctx_menu_);
}
QActionGroup * global = new QActionGroup(profile_menu);
QActionGroup * user = new QActionGroup(profile_menu);
for (int cnt = 0; cnt < model.rowCount(); cnt++)
{
QModelIndex idx = model.index(cnt, ProfileModel::COL_NAME);
if (! idx.isValid())
continue;
QAction * pa = Q_NULLPTR;
QString name = idx.data().toString();
// An ampersand in the menu item's text sets Alt+F as a shortcut for this menu.
// Use "&&" to get a real ampersand in the menu bar.
name.replace('&', "&&");
if (idx.data(ProfileModel::DATA_IS_DEFAULT).toBool())
{
pa = profile_menu->addAction(name);
}
else if (idx.data(ProfileModel::DATA_IS_GLOBAL).toBool())
{
/* Check if this profile does not exist as user */
if (cnt == model.findByName(name))
pa = global->addAction(name);
}
else
pa = user->addAction(name);
if (! pa)
continue;
pa->setCheckable(true);
if (idx.data(ProfileModel::DATA_IS_SELECTED).toBool())
pa->setChecked(true);
pa->setFont(idx.data(Qt::FontRole).value<QFont>());
pa->setProperty("profile_name", idx.data());
pa->setProperty("profile_is_global", idx.data(ProfileModel::DATA_IS_GLOBAL));
connect(pa, &QAction::triggered, this, &MainStatusBar::switchToProfile);
}
profile_menu->addActions(user->actions());
profile_menu->addSeparator();
profile_menu->addActions(global->actions());
if (button == Qt::LeftButton) {
profile_menu->popup(global_pos);
} else {
bool enable_edit = false;
QModelIndex idx = model.activeProfile();
if (! idx.data(ProfileModel::DATA_IS_DEFAULT).toBool() && ! idx.data(ProfileModel::DATA_IS_GLOBAL).toBool())
enable_edit = true;
profile_menu->setTitle(tr("Switch to"));
QAction * action = ctx_menu_->addAction(tr("Manage Profiles…"), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::ShowProfiles);
ctx_menu_->addSeparator();
action = ctx_menu_->addAction(tr("New…"), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::NewProfile);
action = ctx_menu_->addAction(tr("Edit…"), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::EditCurrentProfile);
action->setEnabled(enable_edit);
action = ctx_menu_->addAction(tr("Delete"), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::DeleteCurrentProfile);
action->setEnabled(enable_edit);
ctx_menu_->addSeparator();
#ifdef HAVE_MINIZIP
QMenu * importMenu = new QMenu(tr("Import"), ctx_menu_);
action = importMenu->addAction(tr("From Zip File..."), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::ImportZipProfile);
action = importMenu->addAction(tr("From Directory..."), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::ImportDirProfile);
ctx_menu_->addMenu(importMenu);
if (model.userProfilesExist())
{
QMenu * exportMenu = new QMenu(tr("Export"), ctx_menu_);
if (enable_edit)
{
action = exportMenu->addAction(tr("Selected Personal Profile..."), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::ExportSingleProfile);
action->setEnabled(enable_edit);
}
action = exportMenu->addAction(tr("All Personal Profiles..."), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::ExportAllProfiles);
ctx_menu_->addMenu(exportMenu);
}
#else
action = ctx_menu_->addAction(tr("Import"), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::ImportDirProfile);
#endif
ctx_menu_->addSeparator();
ctx_menu_->addMenu(profile_menu);
ctx_menu_->popup(global_pos);
}
}
void MainStatusBar::toggleBackground(bool enabled)
{
if (enabled) {
setStyleSheet(QString(
"QStatusBar {"
" background-color: %2;"
"}"
)
.arg(ColorUtils::warningBackground().name()));
} else {
setStyleSheet(QString());
}
}
void MainStatusBar::switchToProfile()
{
QAction *pa = qobject_cast<QAction*>(sender());
if (pa && pa->property("profile_name").isValid()) {
QString profile = pa->property("profile_name").toString();
mainApp->setConfigurationProfile(profile.toUtf8().constData());
}
}
void MainStatusBar::manageProfile()
{
QAction *pa = qobject_cast<QAction*>(sender());
if (pa) {
ProfileDialog * cp_dialog = new ProfileDialog(this);
cp_dialog->setAttribute(Qt::WA_DeleteOnClose);
int profileAction = pa->property("dialog_action_").toInt();
cp_dialog->execAction(static_cast<ProfileDialog::ProfileAction>(profileAction));
}
}
void MainStatusBar::captureEventHandler(CaptureEvent ev)
{
switch(ev.captureContext())
{
#ifdef HAVE_LIBPCAP
case CaptureEvent::Update:
switch (ev.eventType())
{
case CaptureEvent::Continued:
updateCaptureStatistics(ev.capSession());
break;
case CaptureEvent::Finished:
updateCaptureStatistics(ev.capSession());
break;
default:
break;
}
break;
case CaptureEvent::Fixed:
switch (ev.eventType())
{
case CaptureEvent::Continued:
updateCaptureFixedStatistics(ev.capSession());
break;
default:
break;
}
break;
#endif
case CaptureEvent::Save:
switch (ev.eventType())
{
case CaptureEvent::Finished:
case CaptureEvent::Failed:
case CaptureEvent::Stopped:
popGenericStatus(STATUS_CTX_FILE);
break;
default:
break;
}
break;
default:
break;
}
}
|