void JuffEd::initActions() { CommandStorageInt* st = Juff::Utils::commandStorage(); st->addAction(FILE_NEW, tr("&New"), this, SLOT(slotFileNew())); st->addAction(FILE_OPEN, tr("&Open"), this, SLOT(slotFileOpen())); st->addAction(FILE_SAVE, tr("&Save"), this, SLOT(slotFileSave())); st->addAction(FILE_SAVE_AS, tr("Save as"), this, SLOT(slotFileSaveAs())); st->addAction(FILE_SAVE_ALL, tr("Save all"), this, SLOT(slotFileSaveAll())); st->addAction(FILE_RELOAD, tr("&Reload"), this, SLOT(slotFileReload())); st->addAction(FILE_RENAME, tr("Rename"), this, SLOT(slotFileRename())); st->addAction(FILE_CLOSE, tr("Close"), this, SLOT(slotFileClose())); st->addAction(FILE_CLOSE_ALL, tr("Close All"), this, SLOT(slotFileCloseAll())); st->addAction(FILE_PRINT, tr("&Print"), this, SLOT(slotFilePrint())); st->addAction(FILE_EXIT, tr("Exit"), this, SLOT(slotFileExit())); st->addAction(SESSION_NEW, tr("New session"), this, SLOT(slotSessionNew())); st->addAction(SESSION_OPEN, tr("Open session"), this, SLOT(slotSessionOpen())); st->addAction(SESSION_SAVE, tr("Save session as..."), this, SLOT(slotSessionSaveAs())); st->addAction(EDIT_UNDO, tr("Undo"), this, SLOT(slotEditUndo())); st->addAction(EDIT_REDO, tr("Redo"), this, SLOT(slotEditRedo())); st->addAction(EDIT_CUT, tr("Cut"), this, SLOT(slotEditCut())); st->addAction(EDIT_COPY, tr("Copy"), this, SLOT(slotEditCopy())); st->addAction(EDIT_PASTE, tr("Paste"), this, SLOT(slotEditPaste())); st->addAction(SEARCH_FIND, tr("Find"), this, SLOT(slotFind())); st->addAction(SEARCH_FIND_NEXT, tr("Find next"), this, SLOT(slotFindNext())); st->addAction(SEARCH_FIND_PREV, tr("Find previous"), this, SLOT(slotFindPrev())); st->addAction(SEARCH_REPLACE, tr("Replace"), this, SLOT(slotReplace())); st->addAction(SEARCH_GOTO_LINE, tr("Go to line"), this, SLOT(slotGotoLine())); st->addAction(SEARCH_GOTO_FILE, tr("Go to file"), this, SLOT(slotGotoFile())); st->addAction(VIEW_ZOOM_IN, tr("Zoom In"), this, SLOT(slotZoomIn())); st->addAction(VIEW_ZOOM_OUT, tr("Zoom Out"), this, SLOT(slotZoomOut())); st->addAction(VIEW_ZOOM_100, tr("Zoom 100%"), this, SLOT(slotZoom100())); st->addAction(VIEW_FULLSCREEN, tr("Fullscreen"), this, SLOT(slotFullscreen())); st->addAction(TOOLS_SETTINGS, tr("Settings"), this, SLOT(slotSettings())); st->addAction(HELP_ABOUT, tr("About"), mw_, SLOT(slotAbout())); st->addAction(HELP_ABOUT_QT, tr("About Qt"), mw_, SLOT(slotAboutQt())); }
void MainWindow::createActions() { if(opt.arg_debug) printf("createActions\n"); if(opt.arg_disable == 0) { optionAct = new QAction(QIcon(":/images/option.png"), l_options, this); #ifndef USE_MAEMO optionAct->setShortcut(tr("Ctrl+O")); #endif optionAct->setStatusTip(l_status_options); connect(optionAct, SIGNAL(triggered()), this, SLOT(slotFileOpt())); } if(opt.arg_disable == 0) { windowAct = new QAction(QIcon(":/images/window.png"), l_new_window, this); windowAct->setShortcut(tr("Ctrl+N")); windowAct->setStatusTip(l_status_new_window); connect(windowAct, SIGNAL(triggered()), this, SLOT(slotWindow())); newtabAct = new QAction(QIcon(":/images/newtab.png"), l_new_tab, this); //newtabAct->setShortcut(tr("Ctrl+N")); newtabAct->setStatusTip(l_status_new_tab); connect(newtabAct, SIGNAL(triggered()), this, SLOT(slotNewTab())); } reconnectAct = new QAction(QIcon(":/images/view-refresh.png"), l_reconnect, this); reconnectAct->setShortcut(tr("Ctrl+R")); reconnectAct->setStatusTip(l_status_reconnect); connect(reconnectAct, SIGNAL(triggered()), this, SLOT(slotReconnect())); storebmpAct = new QAction(QIcon(":/images/storebmp.png"), l_save_as_bmp, this); storebmpAct->setShortcut(tr("Ctrl+B")); storebmpAct->setStatusTip(l_status_save_as_bmp); connect(storebmpAct, SIGNAL(triggered()), this, SLOT(slotStorebmp())); gohomeAct = new QAction(QIcon(":/images/gohome.png"), opt.initialhost, this); gohomeAct->setStatusTip(opt.initialhost); connect(gohomeAct, SIGNAL(triggered()), this, SLOT(slotGohome())); logbmpAct = new QAction(QIcon(":/images/logbmp.png"), l_log_as_bmp, this); logbmpAct->setStatusTip(l_status_log_as_bmp); connect(logbmpAct, SIGNAL(triggered()), this, SLOT(slotLogbmp())); logpvmAct = new QAction(QIcon(":/images/logpvm.png"), l_log_as_pvm, this); logpvmAct->setStatusTip(l_status_log_as_pvm); connect(logpvmAct, SIGNAL(triggered()), this, SLOT(slotLogpvm())); printAct = new QAction(QIcon(":/images/print.png"), l_print, this); printAct->setShortcut(tr("Ctrl+P")); printAct->setStatusTip(l_status_print); connect(printAct, SIGNAL(triggered()), this, SLOT(slotPrint())); newtabActToolBar = new QAction(QIcon(":/images/newtab.png"), l_new_tab, this); newtabActToolBar->setStatusTip(l_status_new_tab); connect(newtabActToolBar, SIGNAL(triggered()), this, SLOT(slotNewTab())); exitAct = new QAction(QIcon(":/images/exit.png"), l_exit, this); exitAct->setShortcut(tr("Ctrl+Q")); exitAct->setStatusTip(l_status_exit); connect(exitAct, SIGNAL(triggered()), this, SLOT(slotExit())); copyAct = new QAction(QIcon(":/images/copy.png"), l_copy, this); copyAct->setShortcut(tr("Ctrl+C")); copyAct->setStatusTip(l_status_copy); connect(copyAct, SIGNAL(triggered()), this, SLOT(slotCopy())); if(opt.arg_disable == 0) { editmenuAct = new QAction(l_editmenu, this); editmenuAct->setShortcut(tr("Ctrl+E")); editmenuAct->setStatusTip(l_status_editmenu); connect(editmenuAct, SIGNAL(triggered()), this, SLOT(slotEditmenu())); addAction(editmenuAct); toolbarAct = new QAction(QIcon(":/images/toolbar.png"), l_toolbar, this); toolbarAct->setShortcut(tr("Ctrl+T")); toolbarAct->setStatusTip(l_status_toolbar); connect(toolbarAct, SIGNAL(triggered()), this, SLOT(slotToolbar())); addAction(toolbarAct); statusbarAct = new QAction(QIcon(":/images/statusbar.png"), l_statusbar, this); statusbarAct->setShortcut(tr("Ctrl+S")); statusbarAct->setStatusTip(l_status_statusbar); connect(statusbarAct, SIGNAL(triggered()), this, SLOT(slotStatusbar())); addAction(statusbarAct); maximizedAct = new QAction(l_maximized, this); maximizedAct->setShortcut(tr("Ctrl+M")); maximizedAct->setStatusTip(l_status_toggle_maximized); connect(maximizedAct, SIGNAL(triggered()), this, SLOT(slotMaximized())); addAction(maximizedAct); fullscreenAct = new QAction(QIcon(":/images/fullscreen.png"), l_fullscreen, this); fullscreenAct->setShortcut(tr("Ctrl+F")); fullscreenAct->setStatusTip(l_status_toggle_full_screen); connect(fullscreenAct, SIGNAL(triggered()), this, SLOT(slotFullscreen())); addAction(fullscreenAct); } manualAct = new QAction(l_manual, this); manualAct->setShortcut(tr("Ctrl+H")); manualAct->setStatusTip(l_status_manual); connect(manualAct, SIGNAL(triggered()), this, SLOT(slotManual())); aboutAct = new QAction(l_about, this); aboutAct->setStatusTip(l_status_about); connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); aboutQtAct = new QAction("About &Qt", this); aboutQtAct->setStatusTip("About Qt library"); connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); logoAct = new QAction(QIcon(":/images/app.png"),"pvbrowser", this); logoAct->setStatusTip(tr("About pvbrowser")); connect(logoAct, SIGNAL(triggered()), this, SLOT(about())); }