示例#1
0
void ServerMenu::changeEvent(QEvent *event)
{
	if (event && event->type() == QEvent::LanguageChange)
		retranslateUI();

	QMenu::changeEvent(event);
}
void LiveViewWindow::changeEvent(QEvent *event)
{
	if (event && event->type() == QEvent::LanguageChange)
		retranslateUI();

	QWidget::changeEvent(event);
}
void SwitchEventsWidget::changeEvent(QEvent *event)
{
	if (event && event->type() == QEvent::LanguageChange)
		retranslateUI();

	QWidget::changeEvent(event);
}
示例#4
0
DecSourcePage::DecSourcePage(QWidget* parent)
    : DecWizardPage(parent)
{
    setupUI();
    retranslateUI();

    registerField("source", sourceLineEdit_);
    connect(sourceLineEdit_, SIGNAL(textChanged(QString)), this, SLOT(validate()));
    connect(fileBrowseButton_, SIGNAL(clicked()), this, SLOT(browseFile()));
}
示例#5
0
DecPasswordPage::DecPasswordPage(QWidget* parent)
    : DecWizardPage(parent)
{
    setupUI();
    retranslateUI();

    registerField("password", passwordLineEdit_);
    connect(passwordLineEdit_, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged()));
    connect(passwordCheckBox_, SIGNAL(stateChanged(int)), this, SLOT(showPassword(int)));
}
示例#6
0
DecDestinationPage::DecDestinationPage(QWidget* parent)
    : DecWizardPage(parent)
{
    setupUI();
    retranslateUI();

    registerField("destination", destinationLineEdit_);
    connect(destinationLineEdit_, SIGNAL(textChanged(QString)), this, SLOT(validate()));
    connect(destinationBrowseButton_, SIGNAL(clicked()), this, SLOT(browseDestination()));
}
SwitchEventsWidget::SwitchEventsWidget(QWidget *parent)
    : QWidget(parent)
{
    QHBoxLayout *layout = new QHBoxLayout(this);
    // layout->setMargin(0);

	m_previousButton = new QPushButton;
	m_nextButton = new QPushButton;

    layout->addWidget(m_previousButton);
    layout->addWidget(m_nextButton);

    updateButtonsState();

	retranslateUI();
}
EventViewWindow::EventViewWindow(QWidget *parent)
    : QWidget(parent, Qt::Window)
{
    resize(590, 380);

    QBoxLayout *layout = new QVBoxLayout(this);
    layout->setContentsMargins(0, 0, 0,
#ifndef Q_OS_MAC
                               style()->pixelMetric(QStyle::PM_LayoutBottomMargin)
#else
                               0
#endif
                               );

#if 1
    m_splitter = new QSplitter(Qt::Horizontal, this);
    layout->addWidget(m_splitter, 100);

    m_splitter->addWidget(createPlaybackArea());
    m_splitter->addWidget(createInfoArea());
    m_splitter->setStretchFactor(0, 1);
    m_splitter->setChildrenCollapsible(false);
#else
    createInfoArea();

    QWidget *topWidget = new QWidget();
    QHBoxLayout *topLayout = new QHBoxLayout(topWidget);
    topLayout->addStretch(1);

    m_switchEventsWidget = new SwitchEventsWidget();
    topLayout->addWidget(m_switchEventsWidget, 1);

    layout->addWidget(topWidget);

    layout->addWidget(topWidget, 1);
    layout->addWidget(createPlaybackArea(), 100);
#endif

    QSettings settings;
    restoreGeometry(settings.value(QLatin1String("ui/eventView/geometry")).toByteArray());
#if 0
    if (!m_splitter->restoreState(settings.value(QLatin1String("ui/eventView/splitState2")).toByteArray()))
        m_splitter->setSizes(QList<int>() << 1000 << 160);
#endif

	retranslateUI();
}
示例#9
0
DecWizard::DecWizard(QWidget* parent)
    : QWizard(parent)
{
    setupUI();
    retranslateUI();
}
示例#10
0
DecConclusionPage::DecConclusionPage(QWidget* parent)
    : DecWizardPage(parent)
{
    setupUI();
    retranslateUI();
}
示例#11
0
MainWindow::MainWindow(DVRServerRepository *serverRepository, QWidget *parent)
    : QMainWindow(parent), m_serverRepository(serverRepository), m_trayIcon(0)
{
    Q_ASSERT(m_serverRepository);

    bcApp->mainWindow = this;
    connect(bcApp->eventDownloadManager(), SIGNAL(eventVideoDownloadAdded(EventVideoDownload*)),
            this, SLOT(showDownloadsWindow()));

    setUnifiedTitleAndToolBarOnMac(true);
	resize(1100, 750);
    createMenu();
    updateTrayIcon();
    setObjectName("MainWindow");

    statusBar()->addPermanentWidget(new StatusBandwidthWidget(statusBar()));
    statusBar()->addWidget(new StatusBarServerAlert(m_serverRepository, statusBar()));

#ifdef Q_OS_MAC
    statusBar()->setSizeGripEnabled(false);
    if (style()->inherits("QMacStyle"))
        statusBar()->setFixedHeight(24);
#endif

    /* Experimental toolbar */
    m_mainToolbar = new QToolBar(tr("Main"));
    m_mainToolbar->setMovable(false);
    m_mainToolbar->setIconSize(QSize(16, 16));
    m_mainToolbar->addAction(QIcon(QLatin1String(":/icons/cassette.png")), tr("Events"), this, SLOT(showEventsWindow()));
	m_expandAllServersAction = m_mainToolbar->addAction(QIcon(QLatin1String(":/icons/expand-all.png")), tr("Expand All Servers"));
	m_collapseAllServersAction = m_mainToolbar->addAction(QIcon(QLatin1String(":/icons/collapse-all.png")), tr("Collapse All Servers"));
    addToolBar(Qt::TopToolBarArea, m_mainToolbar);

    /* Splitters */
    m_leftSplit = new MacSplitter(Qt::Horizontal);
    m_centerSplit = new MacSplitter(Qt::Vertical);

    /* Live view */
    m_liveView = new LiveViewWindow(serverRepository, this);

    /* Recent events */
    QWidget *eventsWidget = createRecentEvents();

    /* Layouts */
    m_leftSplit->addWidget(createSourcesList());
    m_leftSplit->addWidget(m_centerSplit);
    m_leftSplit->setStretchFactor(1, 1);
    m_leftSplit->setCollapsible(0, false);
    m_leftSplit->setCollapsible(1, false);

    m_centerSplit->addWidget(m_liveView);
    m_centerSplit->addWidget(eventsWidget);
    m_centerSplit->setStretchFactor(0, 1);
    m_centerSplit->setCollapsible(0, false);
    m_centerSplit->setCollapsible(1, false);

    /* Set center widget */
    QWidget *center = new QWidget;
    QBoxLayout *centerLayout = new QVBoxLayout(center);
    centerLayout->setMargin(0);
    centerLayout->setSpacing(0);
    centerLayout->addWidget(m_leftSplit, 1);
    setCentralWidget(center);

#ifdef Q_OS_WIN
    /* There is no top border on the statusbar on Windows, and we need one. */
    if (style()->inherits("QWindowsStyle"))
    {
        QFrame *line = new QFrame;
        line->setFrameStyle(QFrame::Plain | QFrame::HLine);
        QPalette p = line->palette();
        p.setColor(QPalette::WindowText, QColor(171, 175, 183));
        line->setPalette(p);
        line->setFixedHeight(1);
        centerLayout->addWidget(line);
    }
#endif

    QSettings settings;
    bcApp->liveView->setBandwidthMode(settings.value(QLatin1String("ui/liveview/bandwidthMode")).toInt());
    restoreGeometry(settings.value(QLatin1String("ui/main/geometry")).toByteArray());
    if (!m_centerSplit->restoreState(settings.value(QLatin1String("ui/main/centerSplit")).toByteArray()))
    {
        m_centerSplit->setSizes(QList<int>() << 1000 << 130);
    }
    if (!m_leftSplit->restoreState(settings.value(QLatin1String("ui/main/leftSplit")).toByteArray()))
    {
#ifdef Q_OS_MAC
        m_leftSplit->setSizes(QList<int>() << 210 << 1000);
#else
        m_leftSplit->setSizes(QList<int>() << 190 << 1000);
#endif
    }

    m_leftSplit->setHandleWidth(2);
    m_centerSplit->setHandleWidth(2);

    QString lastLayout = settings.value(QLatin1String("ui/cameraArea/lastLayout"), tr("Default")).toString();
    m_liveView->setLayout(lastLayout);

    connect(m_liveView, SIGNAL(layoutChanged(QString)), SLOT(liveViewLayoutChanged(QString)));
    connect(m_leftSplit, SIGNAL(splitterMoved(int,int)), SLOT(updateToolbarWidth()));
    updateToolbarWidth();

    connect(bcApp, SIGNAL(sslConfirmRequired(DVRServer*,QList<QSslError>,QSslConfiguration)),
            SLOT(sslConfirmRequired(DVRServer*,QList<QSslError>,QSslConfiguration)));
    connect(bcApp, SIGNAL(queryLivePaused()), SLOT(queryLivePaused()));
    connect(m_serverRepository, SIGNAL(serverAdded(DVRServer*)), SLOT(onServerAdded(DVRServer*)));

    foreach (DVRServer *s, m_serverRepository->servers())
        onServerAdded(s);

    connect(qApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));

    m_sourcesList->setFocus(Qt::OtherFocusReason);

    connect(m_expandAllServersAction, SIGNAL(triggered()), m_sourcesList, SLOT(expandAll()));
    connect(m_collapseAllServersAction, SIGNAL(triggered()), m_sourcesList, SLOT(collapseAll()));

    retranslateUI();

    if (settings.value(QLatin1String("ui/saveSession"), false).toBool())
        m_liveView->restoreSession();
}
示例#12
0
EventsWindow::EventsWindow(DVRServerRepository *serverRepository, QWidget *parent)
	: QWidget(parent, Qt::Window), m_serverRepository(serverRepository),
	  m_tagsLabel(0), m_tagInput(0)
{
    setAttribute(Qt::WA_DeleteOnClose);
    resize(QSize(900, 600));

    QBoxLayout *layout = new QHBoxLayout(this);
    QBoxLayout *filtersLayout = new QVBoxLayout;
    layout->addLayout(filtersLayout);

    m_eventsUpdater = new EventsUpdater(bcApp->serverRepository(), this);
    createResultsView();

    /* Filters */
    m_sourcesView = new DVRServersView(m_serverRepository);
    EventSourcesModel *sourcesModel = new EventSourcesModel(m_serverRepository, m_sourcesView);

    DVRServersProxyModel *proxyModel = new DVRServersProxyModel(sourcesModel);
    proxyModel->setDynamicSortFilter(true);
    proxyModel->setSourceModel(sourcesModel);
    proxyModel->sort(0);

    m_sourcesView->setModel(proxyModel);
    m_sourcesView->setMaximumWidth(180);
    //m_sourcesView->setMaximumHeight(150);
    filtersLayout->addWidget(m_sourcesView);

    connect(sourcesModel, SIGNAL(checkedSourcesChanged(QMap<DVRServer*,QSet<int>>)),
            this, SLOT(setFilterSources(QMap<DVRServer*,QSet<int>>)));

    createDateFilter(filtersLayout);
    createLoadButton(filtersLayout);

#if 1 /* This is not useful currently. */
	m_minimumLevelLabel = new QLabel;
	m_minimumLevelLabel->setStyleSheet(QLatin1String("font-weight:bold;"));
	filtersLayout->addWidget(m_minimumLevelLabel);
    filtersLayout->addWidget(createLevelFilter());
#endif

	m_typeLabel = new QLabel(tr("Type"));
	m_typeLabel->setStyleSheet(QLatin1String("font-weight:bold;"));
	filtersLayout->addWidget(m_typeLabel);
    filtersLayout->addWidget(createTypeFilter());

#if 0 /* Tags are not fully implemented yet */
	m_tagsLabel= new QLabel;
	m_tagsLabel->setStyleSheet(QLatin1String("font-weight:bold;"));
	filtersLayout->addWidget(m_tagsLabel);
    filtersLayout->addWidget(createTags());
    filtersLayout->addWidget(createTagsInput());
#endif

    /* Splitter between results and playback */
    m_videoSplitter = new QSplitter(Qt::Vertical);
    layout->addWidget(m_videoSplitter, 1);

    /* Results */
    m_resultTabs = new QTabWidget;
    m_videoSplitter->addWidget(m_resultTabs);
    m_videoSplitter->setCollapsible(0, false);

	m_timelineContainer = createTimeline();

    m_resultTabs->addTab(m_resultsView, tr("List"));
	m_resultTabs->addTab(m_timelineContainer, tr("Timeline"));

    /* Playback */
    m_eventViewer = new EventViewWindow;
    m_eventViewer->layout()->setMargin(0);
    m_eventViewer->hide();
    m_videoSplitter->addWidget(m_eventViewer);

    m_modelEventsCursor = new ModelEventsCursor();
    m_modelEventsCursor->setModel(m_resultsView->model());
    m_eventViewer->setEventsCursor(m_modelEventsCursor);
    connect(m_modelEventsCursor, SIGNAL(indexUpdated()), this, SLOT(cursorIndexUpdated()));

    /* Settings */
    QSettings settings;
    restoreGeometry(settings.value(QLatin1String("ui/events/geometry")).toByteArray());
    m_videoSplitter->restoreState(settings.value(QLatin1String("ui/events/videoSplitter")).toByteArray());

	retranslateUI();
}