void CaptureFile::captureFileEvent(int event, gpointer data) { switch(event) { case(cf_cb_file_opened): { g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: Opened"); cap_file_ = (capture_file *) data; QFileInfo cfi(QString::fromUtf8(cap_file_->filename)); file_title_ = cfi.baseName(); emit captureFileOpened(); break; } case(cf_cb_file_closing): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: Closing"); file_state_ = tr(" [closing]"); emit captureFileClosing(); break; case(cf_cb_file_closed): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: Closed"); file_state_ = tr(" [closed]"); emit captureFileClosed(); cap_file_ = NULL; file_title_ = no_capture_file_; file_state_ = QString(); break; case(cf_cb_file_read_started): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: Read started"); emit captureFileReadStarted(); break; case(cf_cb_file_read_finished): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: Read finished"); emit captureFileReadFinished(); break; case(cf_cb_file_reload_started): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: Reload started"); emit captureFileReadStarted(); break; case(cf_cb_file_reload_finished): g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: Reload finished"); emit captureFileReadFinished(); break; case(cf_cb_packet_selected): case(cf_cb_packet_unselected): case(cf_cb_field_unselected): // Signals and slots handled elsewhere. break; case(cf_cb_file_save_started): // data = string case(cf_cb_file_save_finished): case(cf_cb_file_save_failed): // Ignored break; default: g_log(NULL, G_LOG_LEVEL_DEBUG, "FIX: main_cf_callback %d %p", event, data); g_warning("CaptureFile::captureFileCallback: event %u unknown", event); break; } }
WiresharkDialog::WiresharkDialog(QWidget &, CaptureFile &capture_file) : QDialog(NULL, Qt::Window), cap_file_(capture_file), file_closed_(false), retap_depth_(0), dialog_closed_(false) { setWindowIcon(wsApp->normalIcon()); setWindowTitleFromSubtitle(); connect(&cap_file_, SIGNAL(captureFileRetapStarted()), this, SLOT(beginRetapPackets())); connect(&cap_file_, SIGNAL(captureFileRetapFinished()), this, SLOT(endsRetapPackets())); connect(&cap_file_, SIGNAL(captureFileClosing()), this, SLOT(captureFileClosing())); connect(&cap_file_, SIGNAL(captureFileClosed()), this, SLOT(captureFileClosing())); }