Exemple #1
0
ImportsWidget::ImportsWidget(MainWindow *main, QAction *action) :
    CutterDockWidget(main, action),
    ui(new Ui::ImportsWidget),
    importsModel(new ImportsModel(&imports, this)),
    importsProxyModel(new ImportsProxyModel(importsModel, this))
{
    ui->setupUi(this);

    ui->importsTreeView->setModel(importsProxyModel);
    ui->importsTreeView->sortByColumn(ImportsModel::NameColumn, Qt::AscendingOrder);

    // Ctrl-F to show/hide the filter entry
    QShortcut *searchShortcut = new QShortcut(QKeySequence::Find, this);
    connect(searchShortcut, &QShortcut::activated, ui->quickFilterView, &QuickFilterView::showFilter);
    searchShortcut->setContext(Qt::WidgetWithChildrenShortcut);

    // Esc to clear the filter entry
    QShortcut *clearShortcut = new QShortcut(QKeySequence(Qt::Key_Escape), this);
    connect(clearShortcut, &QShortcut::activated, ui->quickFilterView, &QuickFilterView::clearFilter);
    clearShortcut->setContext(Qt::WidgetWithChildrenShortcut);

    connect(ui->quickFilterView, SIGNAL(filterTextChanged(const QString &)),
            importsProxyModel, SLOT(setFilterWildcard(const QString &)));
    connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->importsTreeView, SLOT(setFocus()));

    setScrollMode();

    connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshImports()));
}
Exemple #2
0
void Hacklace::initialize(void)
{
	sync_flags = 0;
	current_column = 0;
	scroll_timer = 0;
	delay_counter = 0;
	button = 0;
	btn_mask = BTN_MASK;
	
	// i/o initialization
	DDRB  = DDRB_INIT;
	PORTB = PORTB_INIT;
	DDRC  = DDRC_INIT;
	PORTC = PORTC_INIT;
#ifndef ENABLE_RUN_SLEEP_MONITOR
	DDRD  = DDRD_INIT;
#else
	DDRD  = DDRD_INIT | (1<<3);
#endif

	PORTD = PORTD_INIT;
	
	// timer1 initialization
	TCNT1 = 0;
	OCR1A = OCR1A_CYCLE_TIME;
	OCR1B = OCR1B_CYCLE_TIME;
	TCCR1A = 0;							// timer mode = normal
	TCCR1B = (T1_PRESC<<CS10);			// set prescaler
	TCCR1C = 0;
	TIFR1 = (1<<OCF1A)|(1<<OCF1B);		// clear compare-match interrupt flags
	TIMSK1 = (1<<OCIE1A)|(1<<OCIE1B);	// enable compare-match interrupts

	clearDisplay();
	setBrightness(0);
	setSpacing(1);
	setScrollSpeed(7, 10);
	setScrollMode(FORWARD, 1);
}
Exemple #3
0
CommentsWidget::CommentsWidget(MainWindow *main, QAction *action) :
    CutterDockWidget(main, action),
    ui(new Ui::CommentsWidget),
    main(main)
{
    ui->setupUi(this);

    commentsModel = new CommentsModel(&comments, &nestedComments, this);
    commentsProxyModel = new CommentsProxyModel(commentsModel, this);
    ui->commentsTreeView->setModel(commentsProxyModel);
    ui->commentsTreeView->sortByColumn(CommentsModel::CommentColumn, Qt::AscendingOrder);

    // Ctrl-F to show/hide the filter entry
    QShortcut *searchShortcut = new QShortcut(QKeySequence::Find, this);
    connect(searchShortcut, &QShortcut::activated, ui->quickFilterView, &QuickFilterView::showFilter);
    searchShortcut->setContext(Qt::WidgetWithChildrenShortcut);

    // Esc to clear the filter entry
    QShortcut *clearShortcut = new QShortcut(QKeySequence(Qt::Key_Escape), this);
    connect(clearShortcut, &QShortcut::activated, ui->quickFilterView, &QuickFilterView::clearFilter);
    clearShortcut->setContext(Qt::WidgetWithChildrenShortcut);

    connect(ui->quickFilterView, SIGNAL(filterTextChanged(const QString &)),
            commentsProxyModel, SLOT(setFilterWildcard(const QString &)));
    connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->commentsTreeView, SLOT(setFocus()));

    setScrollMode();

    ui->actionHorizontal->setChecked(true);
    this->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(const QPoint &)),
            this, SLOT(showTitleContextMenu(const QPoint &)));

    connect(Core(), SIGNAL(commentsChanged()), this, SLOT(refreshTree()));
    connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshTree()));
}
void Hacklace_AppEngine::nextApp()
{
	// Switch to the next app as defined by the app_list in EEPROM.
	
	byte app_id;

	if (app) { app->finish(); }				// finish old app
	clearDisplay();
	setSpacing(1);
	setScrollSpeed(7, 7);
	setScrollMode(FORWARD, 1);
	app_id = eeprom_read_byte(ee_ptr++);	// read new app_id
	app = getApp(app_id);					// get pointer to app object
	if (app) {
		ee_ptr = app->setup(ee_ptr);
	} else {
		printString_P(PSTR("bad ID"));
	}

	app_id = eeprom_read_byte(ee_ptr);		// peek next app_id
	if (app_id == END_OF_LIST) {			// end of list?
		ee_ptr = EE_START_ADDR;				// -> restart from beginning
	}
}