Example #1
0
void GerritDialog::refresh()
{
    const QString &query = m_ui->queryLineEdit->text().trimmed();
    updateCompletions(query);
    m_model->refresh(m_server, query);
    m_ui->treeView->sortByColumn(-1);
}
Example #2
0
 void AutoCompleteWorker::processOneItem(const std::shared_ptr<CompletionQuery> &item) {
     if (!item->getNeedsUpdate()) {
         generateCompletions(item);
     } else {
         updateCompletions(item);
     }
 }
Example #3
0
static void openConsole(char *str) {
	if ((mode==modeRewriteLast) && consoleLines) {
		mode=modeAppend;
		utilStrListRm(&consoleLines);
		cursorPos=0;
		consolePrint(str);
		mode=modeRewriteLast;
	} else {
		consoleClear();
		consolePrint(str);
	}
	cmdEnd=strlen(consoleLines->str);
	updateCompletions();
	setCursorPos(cmdEnd);
}
Example #4
0
void consoleKeyPress(char c) {
	if (!cursorPos)
		openConsole("");
	applyCompletion();

	int pos=cursorPos;
	setCursorPos(0);
	cmdLineRealloc(1);
	utilStrInsertChar(consoleLines->str+pos, c);
	cmdEnd++;

	updateCompletions();

	setCursorPos(pos+1);
	drawerInvokeRedisplay();
}
Example #5
0
void consoleBackspace() {
	if (cursorPos>cmdBegin) {
		if (cursorPos<=cmdEnd) {
			int pos=cursorPos;
			setCursorPos(0);
			utilStrRmChars(consoleLines->str + --pos, 1);
			cmdEnd--;
			updateCompletions();
			setCursorPos(pos);
		} else {
			setCursorPos(cmdEnd);
		}
	} else if (cursorPos+cursorLen==cmdEnd) {
		consoleClear();
	}
	drawerInvokeRedisplay();
}