示例#1
0
bool TaskListPlugin::loadFile(QString *errorString, const QString &context, const QString &fileName)
{
    clearTasks();

    bool result = parseTaskFile(errorString, context, fileName);
    if (result) {
        SessionManager::setValue(QLatin1String(SESSION_BASE_KEY), context);
        SessionManager::setValue(QLatin1String(SESSION_FILE_KEY), fileName);
    } else {
        stopMonitoring();
    }

    return result;
}
示例#2
0
/// Add a new task into the queue
/// if the timer stops when adding, start it
void TasksHandler::addTask(BaseTask *t, bool append)
{
    if (append)
    {
        tasks_.append(t);
    }
    else
    {
        clearTasks(t->type());
        tasks_.prepend(t);
        abortCurTask();
    }

    // start the timer if it is not running
    if (!task_timer_.isActive())
    {
        startTimer();
    }
}
示例#3
0
void awakeMode_begin()
{
    halBeginNoInterrupts();

    //P1OUT &= ~BIT6;
    memset(&g_awakeState, 0, sizeof(g_awakeState));
    g_awakeState.buttonState = halReadButtons();
    g_awakeState.state = AWAKE_STATE_IDLE;

    radioWake();
    halSetTimerInterval(1, 10);
    halSetRadioIRQCallback(&awakeMode_onRadioIRQ);
    halSetButtonChangeCallback(&awakeMode_onButtonChange);
    clearTasks();
    addTask(&awakeMode_timerTick, 10);
    addTask(&awakeMode_inactivityTask, 1000);

    // We probably came from sleep mode -- send a packet!
    sendPacket();

    halEndNoInterrupts();
}
//Called from fileLoader
void Engine::loadDocumentAsync(const File & file){

  clearTasks();
  taskName = "Loading File";
  
  ProgressTask * clearTask = addTask("clearing");
  ProgressTask * parseTask = addTask("parsing");
  ProgressTask * loadTask = addTask("loading");

  clearTask->start();
  clear();
  clearTask->end();

  //  {
  //    MessageManagerLock ml;
  //  }
  ScopedPointer<InputStream> is( file.createInputStream());

  loadingStartTime =  Time::currentTimeMillis();
  setFile(file);
  file.getParentDirectory().setAsCurrentWorkingDirectory();

  {
    parseTask->start();
    jsonData = JSON::parse(*is);
    parseTask->end();

    loadTask->start();
    loadJSONData(jsonData,loadTask);
	loadTask->end();


  }// deletes data before launching audio, (data not needed after loaded)

  jsonData = var();
}
示例#5
0
TasksHandler::~TasksHandler()
{
    clearTasks();
}
示例#6
0
TaskWindow::TaskWindow(TaskHub *taskhub) : d(new TaskWindowPrivate)
{
    d->m_defaultHandler = 0;

    d->m_model = new Internal::TaskModel(this);
    d->m_filter = new Internal::TaskFilterModel(d->m_model);
    d->m_listview = new Internal::TaskView;

    d->m_listview->setModel(d->m_filter);
    d->m_listview->setFrameStyle(QFrame::NoFrame);
    d->m_listview->setWindowTitle(tr("Issues"));
    d->m_listview->setSelectionMode(QAbstractItemView::SingleSelection);
    Internal::TaskDelegate *tld = new Internal::TaskDelegate(this);
    d->m_listview->setItemDelegate(tld);
    d->m_listview->setWindowIcon(QIcon(QLatin1String(Constants::ICON_WINDOW)));
    d->m_listview->setContextMenuPolicy(Qt::ActionsContextMenu);
    d->m_listview->setAttribute(Qt::WA_MacShowFocusRect, false);

    d->m_taskWindowContext = new Internal::TaskWindowContext(d->m_listview);
    d->m_taskHub = taskhub;

    Core::ICore::addContextObject(d->m_taskWindowContext);

    connect(d->m_listview->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
            tld, SLOT(currentChanged(QModelIndex,QModelIndex)));

    connect(d->m_listview, SIGNAL(activated(QModelIndex)),
            this, SLOT(triggerDefaultHandler(QModelIndex)));

    d->m_contextMenu = new QMenu(d->m_listview);
    connect(d->m_contextMenu, SIGNAL(triggered(QAction*)),
            this, SLOT(contextMenuEntryTriggered(QAction*)));

    d->m_listview->setContextMenuPolicy(Qt::CustomContextMenu);

    connect(d->m_listview, SIGNAL(customContextMenuRequested(QPoint)),
            this, SLOT(showContextMenu(QPoint)));

    d->m_filterWarningsButton = createFilterButton(d->m_model->taskTypeIcon(Task::Warning),
                                                   tr("Show Warnings"),
                                                   this, SLOT(setShowWarnings(bool)));

    d->m_categoriesButton = new QToolButton;
    d->m_categoriesButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER)));
    d->m_categoriesButton->setToolTip(tr("Filter by categories"));
    d->m_categoriesButton->setProperty("noArrow", true);
    d->m_categoriesButton->setAutoRaise(true);
    d->m_categoriesButton->setPopupMode(QToolButton::InstantPopup);

    d->m_categoriesMenu = new QMenu(d->m_categoriesButton);
    connect(d->m_categoriesMenu, SIGNAL(aboutToShow()), this, SLOT(updateCategoriesMenu()));
    connect(d->m_categoriesMenu, SIGNAL(triggered(QAction*)), this, SLOT(filterCategoryTriggered(QAction*)));

    d->m_categoriesButton->setMenu(d->m_categoriesMenu);

    connect(d->m_taskHub, SIGNAL(categoryAdded(Core::Id,QString,bool)),
            this, SLOT(addCategory(Core::Id,QString,bool)));
    connect(d->m_taskHub, SIGNAL(taskAdded(ProjectExplorer::Task)),
            this, SLOT(addTask(ProjectExplorer::Task)));
    connect(d->m_taskHub, SIGNAL(taskRemoved(ProjectExplorer::Task)),
            this, SLOT(removeTask(ProjectExplorer::Task)));
    connect(d->m_taskHub, SIGNAL(taskLineNumberUpdated(uint,int)),
            this, SLOT(updatedTaskLineNumber(uint,int)));
    connect(d->m_taskHub, SIGNAL(taskFileNameUpdated(uint,QString)),
            this, SLOT(updatedTaskFileName(uint,QString)));
    connect(d->m_taskHub, SIGNAL(tasksCleared(Core::Id)),
            this, SLOT(clearTasks(Core::Id)));
    connect(d->m_taskHub, SIGNAL(categoryVisibilityChanged(Core::Id,bool)),
            this, SLOT(setCategoryVisibility(Core::Id,bool)));
    connect(d->m_taskHub, SIGNAL(popupRequested(bool)),
            this, SLOT(popup(bool)));
    connect(d->m_taskHub, SIGNAL(showTask(uint)),
            this, SLOT(showTask(uint)));
}
示例#7
0
TaskStack::~TaskStack()
{
    clearTasks();
    delete m_commonTasks;
}
示例#8
0
ImageTasksHandler::~ImageTasksHandler()
{
    clearTasks();
}