void ToolSettings::setToolSlot(int i) { Q_ASSERT(i>=0 && i<QUICK_SLOTS); // Save old tool state, then switch to new slot (and tool) saveCurrentTool(); selectToolSlot(i); }
void ToolSettings::saveSettings() { QSettings cfg; cfg.beginGroup("tools"); cfg.setValue("slot", _currentQuickslot); saveCurrentTool(); for(int i=0;i<_toolprops.size();++i) { cfg.beginGroup(QString("slot-%1").arg(i)); _toolprops[i].save(cfg); cfg.endGroup(); } }
void ToolSettings::setPreviousToolSlot() { saveCurrentTool(); selectToolSlot(_previousToolSlot); }
/** * Set which tool setting widget is visible * @param tool tool identifier */ void ToolSettings::setTool(tools::Tool::Type tool) { // Save old tool settings, then switch to the new tool _previousTool = currentTool(); saveCurrentTool(); selectTool(tool); }