void PrefixTreeToolbar::createActions(){ treeState.reset(new QAction(this)); if (this->tree_state == D_TREE_COLLAPSE){ treeState->setIcon(CoreLib->loadIcon("data/expand.png")); treeState->setText(tr("Expand prefix tree")); treeState->setStatusTip(tr("Expand prefix tree")); emit(collapseTree()); } else { treeState->setIcon(CoreLib->loadIcon("data/collapse.png")); treeState->setText(tr("Collapse prefix tree")); treeState->setStatusTip(tr("Collapse prefix tree")); emit(expandTree()); } connect(treeState.get(), SIGNAL(triggered()), this, SLOT(treeState_Click())); prefixImport.reset(new QAction(CoreLib->loadIcon("data/import.png"), tr("Import prefixes"), this)); prefixImport->setStatusTip(tr("Import prefixes from ~/.local/share/wineprefixes/")); connect(prefixImport.get(), SIGNAL(triggered()), this, SLOT(prefixImport_Click())); prefixExport.reset(new QAction(CoreLib->loadIcon("data/export.png"), tr("Export prefixes"), this)); prefixExport->setStatusTip(tr("Export prefixes to ~/.local/share/wineprefixes/")); connect(prefixExport.get(), SIGNAL(triggered()), this, SLOT(prefixExport_Click())); return; }
void PrefixControlWidget::createActions(){ prefixAdd.reset(new QAction(CoreLib->loadIcon("data/wizard.png"), tr("Create new"), this)); prefixAdd->setStatusTip(tr("Create new prefix")); connect(prefixAdd.get(), SIGNAL(triggered()), this, SLOT(prefixAdd_Click())); prefixImport.reset(new QAction(CoreLib->loadIcon("data/down.png"), tr("Import prefix"), this)); prefixImport->setStatusTip(tr("Import prefix")); connect(prefixImport.get(), SIGNAL(triggered()), this, SLOT(prefixImport_Click())); prefixImport->setEnabled(FALSE); prefixExport.reset(new QAction(CoreLib->loadIcon("data/up.png"), tr("Export prefix"), this)); prefixExport->setStatusTip(tr("Export prefix")); connect(prefixExport.get(), SIGNAL(triggered()), this, SLOT(prefixExport_Click())); prefixExport->setEnabled(FALSE); prefixDelete.reset(new QAction(CoreLib->loadIcon("data/kill.png"), tr("Delete prefix"), this)); prefixDelete->setStatusTip(tr("Delete prefix")); connect(prefixDelete.get(), SIGNAL(triggered()), this, SLOT(prefixDelete_Click())); prefixDelete->setEnabled(FALSE); prefixSettings.reset(new QAction(CoreLib->loadIcon("data/configure.png"), tr("Edit prefix settings"), this)); prefixSettings->setStatusTip(tr("Edit prefix settings")); connect(prefixSettings.get(), SIGNAL(triggered()), this, SLOT(prefixSettings_Click())); prefixSettings->setEnabled(FALSE); prefixSetup.reset(new QAction(CoreLib->loadIcon("data/eject.png"), tr("Setup prefix fake drive"), this)); prefixSetup->setStatusTip(tr("Setup prefix fake drive and applications")); connect(prefixSetup.get(), SIGNAL(triggered()), this, SLOT(prefixSetup_Click())); prefixSetup->setEnabled(FALSE); menu.reset(new QMenu(this)); menu->addAction(prefixAdd.get()); menu->addSeparator(); menu->addAction(prefixImport.get()); menu->addAction(prefixExport.get()); menu->addSeparator(); menu->addAction(prefixDelete.get()); menu->addSeparator(); menu->addAction(prefixSettings.get()); menu->addSeparator(); menu->addAction(prefixSetup.get()); return; }