/* PaletteEntryPanel::handleAction * Handles the action [id]. Returns true if the action was handled, * false otherwise *******************************************************************/ bool PaletteEntryPanel::handleAction(string id) { // Ignore if hidden if (!isActivePanel()) return false; // Only interested in "ppal_" events if (!id.StartsWith("ppal_")) return false; // Add to custom palettes if (id == "ppal_addcustom") { addCustomPalette(); return true; } // Test palette else if (id == "ppal_test") { testPalette(); return true; } // Export As else if (id == "ppal_exportas") { exportAs(); return true; } // Import From else if (id == "ppal_importfrom") { importFrom(); return true; } // Generate Palettes if (id == "ppal_generate") { generatePalettes(); return true; } // Generate Colormaps if (id == "ppal_colormap") { generateColormaps(); return true; } // Colourise else if (id == "ppal_colourise") { colourise(); return true; } // Tint else if (id == "ppal_tint") { tint(); return true; } // Tweak else if (id == "ppal_tweak") { tweak(); return true; } // Invert else if (id == "ppal_invert") { invert(); return true; } // Move Up else if (id == "ppal_moveup") { move(true); return true; } // Move Down else if (id == "ppal_movedown") { move(false); return true; } // Duplicate else if (id == "ppal_duplicate") { duplicate(); return true; } // Remove else if (id == "ppal_remove") { clearOne(); return true; } // Remove Others else if (id == "ppal_removeothers") { clearOthers(); return true; } // Some debug/reverse engineering stuff else if (id == "ppal_report") { analysePalettes(); return true; } return false; }
/// \brief Create the used actions. void OpenHantekMainWindow::createActions() { this->openAction = new QAction(QIcon(":actions/open.png"), tr("&Open..."), this); this->openAction->setShortcut(tr("Ctrl+O")); this->openAction->setStatusTip(tr("Open saved settings")); connect(this->openAction, SIGNAL(triggered()), this, SLOT(open())); this->saveAction = new QAction(QIcon(":actions/save.png"), tr("&Save"), this); this->saveAction->setShortcut(tr("Ctrl+S")); this->saveAction->setStatusTip(tr("Save the current settings")); connect(this->saveAction, SIGNAL(triggered()), this, SLOT(save())); this->saveAsAction = new QAction(QIcon(":actions/save-as.png"), tr("Save &as..."), this); this->saveAsAction->setStatusTip(tr("Save the current settings to another file")); connect(this->saveAsAction, SIGNAL(triggered()), this, SLOT(saveAs())); this->printAction = new QAction(QIcon(":actions/print.png"), tr("&Print..."), this); this->printAction->setShortcut(tr("Ctrl+P")); this->printAction->setStatusTip(tr("Print the oscilloscope screen")); connect(this->printAction, SIGNAL(triggered()), this->dsoWidget, SLOT(print())); this->exportAsAction = new QAction(QIcon(":actions/export-as.png"), tr("&Export as..."), this); this->exportAsAction->setShortcut(tr("Ctrl+E")); this->exportAsAction->setStatusTip(tr("Export the oscilloscope data to a file")); connect(this->exportAsAction, SIGNAL(triggered()), this->dsoWidget, SLOT(exportAs())); this->exitAction = new QAction(tr("E&xit"), this); this->exitAction->setShortcut(tr("Ctrl+Q")); this->exitAction->setStatusTip(tr("Exit the application")); connect(this->exitAction, SIGNAL(triggered()), this, SLOT(close())); this->configAction = new QAction(tr("&Settings"), this); this->configAction->setShortcut(tr("Ctrl+S")); this->configAction->setStatusTip(tr("Configure the oscilloscope")); connect(this->configAction, SIGNAL(triggered()), this, SLOT(config())); this->startStopAction = new QAction(this); this->startStopAction->setShortcut(tr("Space")); this->stopped(); this->digitalPhosphorAction = new QAction(QIcon(":actions/digitalphosphor.png"), tr("Digital &phosphor"), this); this->digitalPhosphorAction->setCheckable(true); this->digitalPhosphorAction->setChecked(this->settings->view.digitalPhosphor); this->digitalPhosphor(this->settings->view.digitalPhosphor); connect(this->digitalPhosphorAction, SIGNAL(toggled(bool)), this, SLOT(digitalPhosphor(bool))); this->zoomAction = new QAction(QIcon(":actions/zoom.png"), tr("&Zoom"), this); this->zoomAction->setCheckable(true); this->zoomAction->setChecked(this->settings->view.zoom); this->zoom(this->settings->view.zoom); connect(this->zoomAction, SIGNAL(toggled(bool)), this, SLOT(zoom(bool))); connect(this->zoomAction, SIGNAL(toggled(bool)), this->dsoWidget, SLOT(updateZoom(bool))); this->aboutAction = new QAction(tr("&About"), this); this->aboutAction->setStatusTip(tr("Show information about this program")); connect(this->aboutAction, SIGNAL(triggered()), this, SLOT(about())); this->aboutQtAction = new QAction(tr("About &Qt"), this); this->aboutQtAction->setStatusTip(tr("Show the Qt library's About box")); connect(this->aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); #ifdef DEBUG this->commandAction = new QAction(tr("Send command"), this); this->commandAction->setShortcut(tr("Shift+C")); #endif }
void SaxsviewImage::exportAs() { QString fileName = QFileDialog::getSaveFileName(this, "Export As", config().recentDirectory(), "All files (*.*)"); exportAs(fileName); }
void Gui::exportAsBmp() { QString suffix(".bmp"); exportAs(suffix); }
void Gui::exportAsJpg() { QString suffix(".jpg"); exportAs(suffix); }
void Gui::exportAsPng() { QString suffix(".png"); exportAs(suffix); }