Пример #1
0
void presentation::UI::setActiveTab(int targetTab)
{
    if(targetTab == UI::TabConfiguration)
        activeTab = tabWidgetSub->currentIndex() + tabMainCount;
    else
        activeTab = targetTab;
    updateNotification();
}
Пример #2
0
void presentation::UI::setModel(model::Model *model)
{
    this->model = model;

    thermalDiffusivitiesTab->setModel(model);
    heatSourcesTab->setModel(model);
    iBVsTab->setModel(model);
    simulationTab->setModel(model);
    visualizationTab->setModel(model);
    optimizationTab->setModel(model);

    // Initialen Tab laden/updaten
    updateNotification();
}
NotificationPreviewPresenter::NotificationPreviewPresenter(QObject *parent) :
    QObject(parent),
    window(0),
    currentNotification(0),
    notificationFeedbackPlayer(new NotificationFeedbackPlayer(this)),
    locks(new MeeGo::QmLocks(this)),
    displayState(new MeeGo::QmDisplayState(this))
{
    connect(NotificationManager::instance(), SIGNAL(notificationModified(uint)), this, SLOT(updateNotification(uint)));
    connect(NotificationManager::instance(), SIGNAL(notificationRemoved(uint)), this, SLOT(removeNotification(uint)));
    connect(this, SIGNAL(notificationPresented(uint)), notificationFeedbackPlayer, SLOT(addNotification(uint)));

    QTimer::singleShot(0, this, SLOT(createWindowIfNecessary()));
}
void Ut_NotificationListModel::testSignalConnections()
{
    NotificationListModel model;
    QCOMPARE(disconnect(NotificationManager::instance(), SIGNAL(notificationModified(uint)), &model, SLOT(updateNotification(uint))), true);
    QCOMPARE(disconnect(NotificationManager::instance(), SIGNAL(notificationRemoved(uint)), &model, SLOT(removeNotification(uint))), true);
    QCOMPARE(disconnect(&model, SIGNAL(clearRequested()), NotificationManager::instance(), SLOT(removeUserRemovableNotifications())), true);
}
Пример #5
0
 foreach(uint id, NotificationManager::instance()->notificationIds()) {
     updateNotification(id);
 }
Пример #6
0
NotificationListModel::NotificationListModel(QObject *parent) :
    QObjectListModel(parent)
{
    connect(NotificationManager::instance(), SIGNAL(notificationModified(uint)), this, SLOT(updateNotification(uint)));
    connect(NotificationManager::instance(), SIGNAL(notificationRemoved(uint)), this, SLOT(removeNotification(uint)));
    connect(this, SIGNAL(clearRequested()), NotificationManager::instance(), SLOT(removeUserRemovableNotifications()));

    QTimer::singleShot(0, this, SLOT(init()));
}
void Ut_NotificationPreviewPresenter::testSignalConnections()
{
    NotificationPreviewPresenter presenter;
    QCOMPARE(disconnect(NotificationManager::instance(), SIGNAL(notificationModified(uint)), &presenter, SLOT(updateNotification(uint))), true);
    QCOMPARE(disconnect(NotificationManager::instance(), SIGNAL(notificationRemoved(uint)), &presenter, SLOT(removeNotification(uint))), true);
}
NotificationClient::NotificationClient(QObject *parent)
    : QObject(parent)
{
    connect(this, SIGNAL(notificationChanged()), this, SLOT(updateNotification()));
}