void ShortcutsWidget::loadShortcuts(const QSettings &settings) { MenuItems items = menuItems(); ::loadShortcuts(&items, settings); m_actions.clear(); m_shortcuts.clear(); QTableWidget *table = ui->tableWidget; while (table->rowCount() > 0) table->removeRow(0); for (const auto &item : items) { MenuAction action; action.iconName = item.iconName; action.iconId = item.iconId; action.text = item.text; action.settingsKey = item.settingsKey; addShortcutRow(action); action.shortcutButton->setDefaultShortcut(item.defaultShortcut); for (const auto &shortcut : item.shortcuts) action.shortcutButton->addShortcut(shortcut); } addCommands( loadAllCommands() ); addCommands( predefinedCommands() ); }
tcl::tcl() { tcl_int = Tcl_CreateInterp(); curid = 0; Tcl_Init(tcl_int); Tcl_SetVar(tcl_int, "argv0", "psotnic", TCL_GLOBAL_ONLY); addCommands(); }
void KisSavedCommandBase::runStroke(bool undo) { KisStrokeStrategyUndoCommandBased *strategy = new KisStrokeStrategyUndoCommandBased(text(), undo, 0); strategy->setUsedWhileUndoRedo(true); KisStrokeId id = m_strokesFacade->startStroke(strategy); addCommands(id, undo); m_strokesFacade->endStroke(id); }
void AddCommandDialog::accept() { const QModelIndexList indexes = ui->listViewCommands->selectionModel()->selectedIndexes(); if (!indexes.isEmpty()) { QList<Command> commands; foreach (const QModelIndex &index, indexes) commands.append( index.data(Qt::UserRole).value<Command>() ); emit addCommands(commands); }
void AddCommandDialog::accept() { const QModelIndexList indexes = ui->listViewCommands->selectionModel()->selectedIndexes(); if (!indexes.isEmpty()) { QVector<Command> commands; commands.reserve( indexes.size() ); for (const auto &index : indexes) commands.append( index.data(Qt::UserRole).value<Command>() ); emit addCommands(commands); } QDialog::accept(); }
int main() { auto cvarManager = cfg::CVarManager::createInstance(); auto cmdManager = cfg::CommandManager::createInstance(); // If a CVarManager is provided to the CommandManager, it will use // it to test that command names and CVar names never collide. And // also to perform CVar name expansion/substitution in command strings. cmdManager->setCVarManager(cvarManager); addCVars(cvarManager); addCommands(cmdManager); // All CVars and Commands are deleted when the mangers are destroyed. cfg::CommandManager::destroyInstance(cmdManager); cfg::CVarManager::destroyInstance(cvarManager); cfg::errorF("This is a test error message. Press any key to continue..."); std::cin.get(); }
void start() { addCommands(); colorMe(COLOR_SILVER); cout << "Do you have any simbolic names and selections you would like to load? (YES/NO)" << endl; string answer; cin >> answer; if (answer == "YES" || answer == "yes" || answer == "Yes") { cout << "Where have you saved your simbolics?" << endl; cin >> answer; path pathSimbolics = answer; if (!exists(pathSimbolics)) cout << "File couldn't be found." << endl; Simbolics::fetchSimbolics()->loadSimbolic(pathSimbolics); cout << "Where have you saved your selections?" << endl; cin >> answer; path pathSelections = answer; if (!exists(pathSelections)) cout << "File couldn't be found." << endl; Selections::loadSelections(pathSelections); }
void Calculator::commandsReceived(){ addCommands(QVector<pCommand>::fromStdVector(Connection::getInstance().giveCommandsFromClient())); }
void KisSavedMacroCommand::performCancel(KisStrokeId id, bool strokeUndo) { addCommands(id, !strokeUndo); }