Esempio n. 1
0
SnifferDialog::SnifferDialog(QWidget * parent):
QDialog(parent), ui(new Ui::SnifferDialog)
{
    ui->setupUi(this);

    openedSniffersModel = new OpenedSniffersModel;
    ui->snifferTable->setModel(openedSniffersModel);

    connect(ui->addButton, SIGNAL(clicked()), this, SLOT(onAddSniffer()));
    connect(ui->removeButton, SIGNAL(clicked()), this, SLOT(onRemoveSniffer()));
    connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(onBrowseSniffer()));
    connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(onCloseDialog()));

    QFileInfoList captureInterfaces;
    QDir searchPath;
    QStringList extensions;

    extensions << QString("*.so") << QString("*.dylib");

    searchPath = QDir("/usr/lib/foren6/interfaces");
    if(!searchPath.exists())
        searchPath = QDir(QApplication::applicationDirPath() + "/capture");
    if(!searchPath.exists())
        searchPath = QDir(QApplication::applicationDirPath());

    captureInterfaces.append(searchPath.entryInfoList(extensions, QDir::Files, QDir::Name));

    QFileInfo captureInterface;

    foreach(captureInterface, captureInterfaces) {
        qDebug("Loading %s", captureInterface.absoluteFilePath().toLatin1().constData());
        loadInterface(captureInterface.absoluteFilePath().toLatin1().constData());
    }
int UserModifyPassDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: UserSignalModifyPass((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: UserModifyPassAttempt(); break;
        case 2: ServerModifyPassAnswer((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: onPassInputEdit(); break;
        case 4: onCloseDialog(); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
int UserAddNewsDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: Done(); break;
        case 1: Updated((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2])),(*reinterpret_cast< QString(*)>(_a[3])),(*reinterpret_cast< QString(*)>(_a[4])),(*reinterpret_cast< int(*)>(_a[5]))); break;
        case 2: UserAddNewsAttempt(); break;
        case 3: ServerAddNewsAnswer((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 4: onNewsInputEdit(); break;
        case 5: onCloseDialog(); break;
        default: ;
        }
        _id -= 6;
    }
    return _id;
}
Esempio n. 4
0
BOOL CALLBACK CalcOptions::wndProc(UINT msg,WPARAM wParam,LPARAM lParam)
{
	switch (msg)
	{
		case WM_INITDIALOG:
			return onInitDialog();

		case WM_DRAWITEM:
			return onDrawItem((LPDRAWITEMSTRUCT)lParam);

		case WM_COMMAND:

			switch(wParam)
			{
				case IDC_EXPR_FONT:
				case IDC_RESULT_FONT:
				case IDC_ERROR_FONT:
					onFont(wParam);
					break;

				case ID_SET_DEFAULTS:
					onSetDefaults();
					break;

				case ID_HELP_HELPTOPICS:
					onHelp();
					break;

				case IDOK:
				case IDCANCEL:					
					return onCloseDialog(wParam);
			}
			return TRUE;
	}
	return FALSE;
}