void RKConsole::commandsListDown () { RK_TRACE (APP); if (commands_history.constEnd () == commands_history_position) return; // already at bottommost item ++commands_history_position; if (commands_history.constEnd () == commands_history_position) setCurrentCommand (history_editing_line); else setCurrentCommand (*commands_history_position); }
void RKConsole::tryNextInBatch (bool add_new_line) { RK_TRACE (APP); if (add_new_line) { if (RKSettingsModuleConsole::maxConsoleLines ()) { uint c = (uint) doc->numLines(); setUpdatesEnabled (false); for (uint ui = c; ui > RKSettingsModuleConsole::maxConsoleLines (); --ui) { editInterface(doc)->removeText (0, 0,0, editInterface(doc)->textLine(0).length()); } setUpdatesEnabled (true); } editInterface(doc)->insertText (doc->numLines ()-1, 0, prefix); // somehow, it seems to be safer to do this after removing superfluous lines, than before cursorAtTheEnd (); } if (!commands_batch.isEmpty()) { // If we were not finished executing a batch of commands, we execute the next one. setCurrentCommand (currentCommand () + commands_batch.first ()); commands_batch.pop_front (); if (!commands_batch.isEmpty ()){ submitCommand (); return; } // We would put this here if we would want the last line to be executed. We generally don't want this, as there is an empty last item, if there is a newline at the end. //TODO: deal with this kind of situation better. //commands_batch.erase(commands_batch.begin()); } current_command = 0; interrupt_command_action->setEnabled (isBusy ()); }
void RKConsole::commandsListUp () { RK_TRACE (APP); if (commands_history.constBegin () == commands_history_position) return; // already at topmost item if (commands_history.constEnd () == commands_history_position) history_editing_line = currentCommand (); --commands_history_position; setCurrentCommand (*commands_history_position); }
ViewMonitor::ViewMonitor( QObject* parent ): QObject( parent ) { // 3 shades of red mColors.insert( 0, QColor( "#FFC0C0" ) ); mColors.insert( 1, QColor( "#FF0000" ) ); mColors.insert( 2, QColor( "#C00000" ) ); // 3 shades of yellow mColors.insert( 3, QColor( "#FFFFC0" ) ); mColors.insert( 4, QColor( "#FFFF00" ) ); mColors.insert( 5, QColor( "#C0C000" ) ); // 3 shades of green mColors.insert( 6, QColor( "#C0FFC0" ) ); mColors.insert( 7, QColor( "#00FF00" ) ); mColors.insert( 8, QColor( "#00C000" ) ); // 3 shades of cyan mColors.insert( 9, QColor( "#C0FFFF" ) ); mColors.insert( 10, QColor( "#00FFFF" ) ); mColors.insert( 11, QColor( "#00C0C0" ) ); // 3 shades of blue mColors.insert( 12, QColor( "#C0C0FF" ) ); mColors.insert( 13, QColor( "#0000FF" ) ); mColors.insert( 14, QColor( "#0000C0" ) ); // 3 shades of magenta mColors.insert( 15, QColor( "#FFC0FF" ) ); mColors.insert( 16, QColor( "#FF00FF" ) ); mColors.insert( 17, QColor( "#C000C0" ) ); mColors.insert( 18, QColor( "#FFFFFF" ) ); mColors.insert( 19, QColor( "#000000" ) ); Command first( "", "", mColors.at( 0 ), 0 ); setCurrentCommand( first ); }
bool IzCommandExecutor::gotoCommand() { setCurrentCommand(this); return true; }