ToolBar::ToolBar( QWidget* parent ) : QToolBar( parent ) { // Disable context menu setContextMenuPolicy( Qt::PreventContextMenu ); // Items tbaAdd = addAction( QIcon( ":/tool/add" ), tr("Add") ); connect( tbaAdd, &QAction::triggered, this, &ToolBar::actionAdd ); tbaEdit = addAction( QIcon( ":/tool/edit" ), tr("Edit") ); connect( tbaEdit, &QAction::triggered, this, &ToolBar::actionEdit ); tbaRemove = addAction( QIcon( ":/tool/delete" ), tr("Remove") ); connect( tbaRemove, &QAction::triggered, this, &ToolBar::actionRemove ); addSeparator(); tbaFilmScanner = addAction( QIcon( ":/window/film-scanner" ), tr("Film scanner") ); connect( tbaFilmScanner, &QAction::triggered, this, &ToolBar::actionFilmScanner ); addSeparator(); tbaRandom = addAction( QIcon( ":/tool/random" ), tr("Random") ); connect( tbaRandom, &QAction::triggered, this, &ToolBar::actionRandom ); tbaSearch = addAction( QIcon( ":/tool/find" ), tr("Search") ); connect( tbaSearch, &QAction::triggered, this, &ToolBar::actionSearch ); addSeparator(); tbaExit = addAction( QIcon( ":/action/exit" ), tr("Exit") ); connect( tbaExit, &QAction::triggered, this, &ToolBar::actionExit ); }
WindowMenu::WindowMenu(QWidget *parent) : QMenu(QString::fromUtf8("&Window"), parent) { pMinimize_ = addAction(QString::fromUtf8("Minimize")); pMinimize_->setShortcut(QKeySequence(QString::fromAscii("Meta+M"))); connect(pMinimize_, SIGNAL(triggered()), this, SLOT(onMinimize())); pZoom_ = addAction(QString::fromUtf8("Zoom")); connect(pZoom_, SIGNAL(triggered()), this, SLOT(onZoom())); addSeparator(); pWindowPlaceholder_ = addAction(QString::fromAscii("__PLACEHOLDER__")); pWindowPlaceholder_->setVisible(false); addSeparator(); pBringAllToFront_ = addAction(QString::fromUtf8("Bring All to Front")); connect(pBringAllToFront_, SIGNAL(triggered()), this, SLOT(onBringAllToFront())); connect(this, SIGNAL(aboutToShow()), this, SLOT(onAboutToShow())); connect(this, SIGNAL(aboutToHide()), this, SLOT(onAboutToHide())); }
void Menu::populateToolBarsMenu() { clear(); const QVector<ToolBarDefinition> definitions = ToolBarsManager::getToolBarDefinitions(); for (int i = 0; i < definitions.count(); ++i) { QAction *toolBarAction = QMenu::addAction(definitions.at(i).title.isEmpty() ? tr("(Untitled)") : definitions.at(i).title); toolBarAction->setData(definitions.at(i).identifier); toolBarAction->setCheckable(true); toolBarAction->setChecked(definitions.at(i).visibility != AlwaysHiddenToolBar); connect(toolBarAction, SIGNAL(toggled(bool)), this, SLOT(setToolBarVisibility(bool))); } addAction(ActionsManager::ShowSidebarAction, true); addAction(ActionsManager::ShowErrorConsoleAction, true); addSeparator(); QMenu *menu = addMenu(tr("Add New")); menu->addAction(tr("Add Toolbar"), ToolBarsManager::getInstance(), SLOT(addToolBar())); menu->addAction(tr("Add Bookmarks Bar…"), ToolBarsManager::getInstance(), SLOT(addBookmarksBar())); addSeparator(); addAction(ActionsManager::LockToolBarsAction, true); addSeparator(); QMenu::addAction(tr("Reset to Defaults…"), ToolBarsManager::getInstance(), SLOT(resetToolBars())); }
void DebugMenu::common(QWidget* panel) { #if 0 add(new MemoryFrameAction(tr("MenuItemMemoryUsageMonitor"))); add(new JSeparator()); #endif addAction(new InstallDecoderFileAction(tr("Import Decoder File"), panel)); addAction(new InstallDecoderURLAction(tr("Import Decoder URL"), panel)); addAction(new DecoderIndexCreateAction(tr("Recreate Decoder Index"),panel)); addAction(new RecreateRosterAction(tr("Recreate Roster"),panel)); addAction(new UpdateDecoderDefinitionAction(tr("Update Decoder Definitions"),panel)); addSeparator(); addAction(new XmlFileValidateAction(tr("Validate XML File"), panel)); addAction(new NameCheckAction(tr("Check Decoder Names"), panel)); addAction(new ProgCheckAction(tr("Check Programmer Names"), panel)); addSeparator(); addAction(new LogixLoadAction(tr("Load Logix Disabled"), panel)); addAction(new LogAction(tr("Log Message"))); #if 0 add(new log.LogOutputWindowAction(tr("MenuItemLogOutputWindowAction"))); add(new jmri.util.swing.JmriNamedPaneAction(tr("MenuItemLogTreeAction"), new jmri.util.swing.sdi.JmriJFrameInterface(), "log.Log4JTreePane")); #endif addSeparator(); QMenu* vsdMenu = new QMenu(tr("Virtual Sound Decoder")); vsdMenu->addAction(new VSDecoderCreationAction(tr("VSDecoder Manager"), true)); // vsdMenu.add(new ManageLocationsAction(tr("Manage VSD Locations"), NULL)); vsdMenu->addAction(new VSDPreferencesAction(tr("VSDecoder Preferences"),this)); addMenu(vsdMenu); }
void KDatePickerPopup::buildMenu() { if ( isVisible() ) { return; } clear(); if ( mItems & DatePicker ) { addAction( new KDatePickerAction( mDatePicker, this ) ); if ( ( mItems & NoDate ) || ( mItems & Words ) ) { addSeparator(); } } if ( mItems & Words ) { addAction( i18nc( "@option today", "&Today" ), this, SLOT( slotToday() ) ); addAction( i18nc( "@option tomorrow", "To&morrow" ), this, SLOT( slotTomorrow() ) ); addAction( i18nc( "@option next week", "Next &Week" ), this, SLOT( slotNextWeek() ) ); addAction( i18nc( "@option next month", "Next M&onth" ), this, SLOT( slotNextMonth() ) ); if ( mItems & NoDate ) { addSeparator(); } } if ( mItems & NoDate ) { addAction( i18nc( "@option do not specify a date", "No Date" ), this, SLOT( slotNoDate() ) ); } }
void Menu::populateClosedWindowsMenu() { clear(); QMenu::addAction(Utils::getIcon(QLatin1String("edit-clear")), tr("Clear"), this, SLOT(clearClosedWindows()))->setData(0); addSeparator(); const QStringList windows = SessionsManager::getClosedWindows(); if (!windows.isEmpty()) { for (int i = 0; i < windows.count(); ++i) { QMenu::addAction(Utils::elideText(tr("Window - %1").arg(windows.at(i)), this), this, SLOT(restoreClosedWindow()))->setData(-(i + 1)); } addSeparator(); } MainWindow *mainWindow = MainWindow::findMainWindow(parent()); if (mainWindow) { const QList<ClosedWindow> tabs = mainWindow->getWindowsManager()->getClosedWindows(); for (int i = 0; i < tabs.count(); ++i) { QAction *action = QMenu::addAction(HistoryManager::getIcon(QUrl(tabs.at(i).window.getUrl())), Utils::elideText(tabs.at(i).window.getTitle(), this), this, SLOT(restoreClosedWindow())); action->setData(i + 1); action->setStatusTip(tabs.at(i).window.getUrl()); } } }
OptionsWidget_uparser::OptionsWidget_uparser(QWidget * parent) : KviOptionsWidget(parent,"uparser_options_widget") { createLayout(); KviBoolSelector * b; addBoolSelector(0,0,0,0,__tr2qs_ctx("Disable parser warnings","options"),KviOption_boolAvoidParserWarnings); addBoolSelector(0,1,0,1,__tr2qs_ctx("Disable broken event handlers","options"),KviOption_boolDisableBrokenEventHandlers); addBoolSelector(0,2,0,2,__tr2qs_ctx("Kill broken timers","options"),KviOption_boolKillBrokenTimers); addBoolSelector(0,3,0,3,__tr2qs_ctx("Send unknown commands as /RAW","options"),KviOption_boolSendUnknownCommandsAsRaw); addSeparator(0,4,0,4); addBoolSelector(0,5,0,5,__tr2qs_ctx("Automatically unload unused modules","options"),KviOption_boolCleanupUnusedModules); addBoolSelector(0,6,0,6,__tr2qs_ctx("Ignore module versions (dangerous)","options"),KviOption_boolIgnoreModuleVersions); addSeparator(0,7,0,7); b = addBoolSelector(0,8,0,8,__tr2qs_ctx("Relay errors and warnings to debug window","options"),KviOption_boolScriptErrorsToDebugWindow); mergeTip(b, __tr2qs_ctx("<center>This option will show the script errors and warnings " \ "also in the special debug window. This makes tracking of scripts that might " \ "be running in several windows far easier. The messages in the debug window " \ "also contain a deeper call stack which will help you identifying the " \ "scripting problems.</center>","options") ); addBoolSelector(0,9,0,9,__tr2qs_ctx("Create minimized debug window","options"),KviOption_boolShowMinimizedDebugWindow); addRowSpacer(0,10,0,10); }
void KlipperPopup::buildFromScratch() { addTitle(KIcon("klipper"), i18n("Klipper - Clipboard Tool")); m_filterWidget = new KLineEditBlackKey(this); m_filterWidget->setFocusPolicy( Qt::NoFocus ); m_filterWidgetAction = new QWidgetAction(this); m_filterWidgetAction->setDefaultWidget(m_filterWidget); m_filterWidgetAction->setVisible(false); addAction(m_filterWidgetAction); addSeparator(); for (int i = 0; i < m_actions.count(); i++) { if (i + 1 == m_actions.count()) { addMenu(m_helpMenu->menu())->setIcon(KIcon("help-contents")); addSeparator(); } addAction(m_actions.at(i)); } if ( KGlobalSettings::insertTearOffHandle() ) { setTearOffEnabled(true); } }
ToolBar::ToolBar(QWidget *parent) : QToolBar(parent) { setIconSize(QSize(40,40)); addAction(*((dynamic_cast<MainWindow *>(parent))->getActionNew())); addSeparator(); addAction(*((dynamic_cast<MainWindow *>(parent))->getActionOpen())); addAction(*((dynamic_cast<MainWindow *>(parent))->getActionSave())); addAction(*((dynamic_cast<MainWindow *>(parent))->getActionSaveAs())); addSeparator(); addAction(*((dynamic_cast<MainWindow *>(parent))->getActionAddNodes())); addSeparator(); addAction(*((dynamic_cast<MainWindow *>(parent))->getActionRunExperiment())); addSeparator(); addAction(*((dynamic_cast<MainWindow *>(parent))->getActionShowGraphics())); addAction(*((dynamic_cast<MainWindow *>(parent))->getActionShowTraces())); }
void DkPaintToolBar::createLayout() { QList<QKeySequence> enterSc; enterSc.append(QKeySequence(Qt::Key_Enter)); enterSc.append(QKeySequence(Qt::Key_Return)); QAction* applyAction = new QAction(icons[apply_icon], tr("Apply (ENTER)"), this); applyAction->setShortcuts(enterSc); applyAction->setObjectName("applyAction"); QAction* cancelAction = new QAction(icons[cancel_icon], tr("Cancel (ESC)"), this); cancelAction->setShortcut(QKeySequence(Qt::Key_Escape)); cancelAction->setObjectName("cancelAction"); panAction = new QAction(icons[pan_icon], tr("Pan"), this); panAction->setShortcut(QKeySequence(Qt::Key_P)); panAction->setObjectName("panAction"); panAction->setCheckable(true); panAction->setChecked(false); // pen color penCol = QColor(0,0,0); penColButton = new QPushButton(this); penColButton->setObjectName("penColButton"); penColButton->setStyleSheet("QPushButton {background-color: " + nmc::DkUtils::colorToString(penCol) + "; border: 1px solid #888;}"); penColButton->setToolTip(tr("Background Color")); penColButton->setStatusTip(penColButton->toolTip()); // undo Button undoAction = new QAction(icons[undo_icon], tr("Undo (CTRL+Z)"), this); undoAction->setShortcut(QKeySequence::Undo); undoAction->setObjectName("undoAction"); colorDialog = new QColorDialog(this); colorDialog->setObjectName("colorDialog"); // pen width widthBox = new QSpinBox(this); widthBox->setObjectName("widthBox"); widthBox->setSuffix("px"); widthBox->setMinimum(1); widthBox->setMaximum(500); // huge sizes since images might have high resolutions // pen alpha alphaBox = new QSpinBox(this); alphaBox->setObjectName("alphaBox"); alphaBox->setSuffix("%"); alphaBox->setMinimum(0); alphaBox->setMaximum(100); addAction(applyAction); addAction(cancelAction); addSeparator(); addAction(panAction); addAction(undoAction); addSeparator(); addWidget(widthBox); addWidget(penColButton); addWidget(alphaBox); }
void GraphDraw::handleCustomContextMenuRequested(const QPoint &pos) { auto menu = new QMenu(this); menu->addAction(getActionMap()["cut"]); menu->addAction(getActionMap()["copy"]); menu->addAction(getActionMap()["paste"]); menu->addAction(getActionMap()["delete"]); menu->addSeparator(); menu->addAction(getActionMap()["selectAll"]); menu->addSeparator(); menu->addAction(getActionMap()["find"]); menu->addSeparator(); menu->addAction(getActionMap()["createGraphPage"]); menu->addAction(getActionMap()["renameGraphPage"]); menu->addAction(getActionMap()["deleteGraphPage"]); menu->addMenu(getMenuMap()["moveGraphObjects"]); menu->addMenu(getMenuMap()["setAffinityZone"]); menu->addSeparator(); menu->addAction(getActionMap()["createInputBreaker"]); menu->addAction(getActionMap()["createOutputBreaker"]); menu->addSeparator(); menu->addAction(getActionMap()["rotateLeft"]); menu->addAction(getActionMap()["rotateRight"]); _lastContextMenuPos = pos; menu->exec(this->mapToGlobal(pos)); delete menu; }
void TwitterPage::on_TwitList__customContextMenuRequested (const QPoint& pos) { const auto& idx = Ui_.TwitList_->indexAt (pos); if (!idx.isValid ()) return; const auto username = idx.data (Qt::UserRole).value<Tweet_ptr> ()->GetAuthor ()->GetUsername (); auto menu = new QMenu (Ui_.TwitList_); auto actionOpenTimeline = new QAction (tr ("Open @%1 timeline").arg (username), menu); actionOpenTimeline->setProperty ("ActionIcon", "document-open-folder"); connect (actionOpenTimeline, SIGNAL (triggered ()), this, SLOT (openUserTimeline ())); menu->addActions ({ ActionRetwit_, ActionReply_, menu->addSeparator (), ActionSPAM_, menu->addSeparator (), ActionDelete_, menu->addSeparator (), ActionCopyText_, actionOpenTimeline, menu->addSeparator (), ActionMakeFavorite_ }); if (TC_.TabClass_ == ParentPlugin_->FavoriteTC_.TabClass_) menu->addAction (ActionDeleteFavorite_); menu->addActions ({ ActionShowFavorites_, menu->addSeparator (), ActionOpenWeb_, ActionSearch_ }); menu->setAttribute (Qt::WA_DeleteOnClose); menu->exec (Ui_.TwitList_->viewport ()->mapToGlobal (pos)); }
void NBCategoryMenu::populateMenu() { showAct = new QAction( "Visible", this ); connect( showAct, SIGNAL( triggered() ), this, SLOT( showCategory() ) ); addAction( showAct ); foldAct = new QAction( "Folded", this ); connect( foldAct, SIGNAL( triggered() ), this, SLOT( foldCategory() ) ); addAction( foldAct ); hideAct = new QAction( "Hidden", this ); connect( hideAct, SIGNAL( triggered() ), this, SLOT( hideCategory() ) ); addAction( hideAct ); addSeparator(); selAct = new QAction( QIcon( ":/icons/select1.png" ), "Select All", this ); addAction( selAct ); connect( selAct, SIGNAL( triggered() ), this, SLOT( manageSelection() ) ); uselAct = new QAction( QIcon(), "Deselect All", this ); addAction( uselAct ); connect( uselAct, SIGNAL( triggered() ), this, SLOT( manageSelection() ) ); addSeparator(); propAct = new QAction( QIcon( ":/icons/props.png" ), "Properties", this ); connect( propAct, SIGNAL( triggered() ), this, SLOT( showProperties() ) ); addAction( propAct ); };
OptionsWidget_uparser::OptionsWidget_uparser(QWidget * parent) : KviOptionsWidget(parent, "uparser_options_widget") { createLayout(); KviBoolSelector * b; KviBoolSelector * b1; addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Disable parser warnings", "options"), KviOption_boolAvoidParserWarnings); addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Disable broken event handlers", "options"), KviOption_boolDisableBrokenEventHandlers); addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Kill broken timers", "options"), KviOption_boolKillBrokenTimers); addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Send unknown commands as /RAW", "options"), KviOption_boolSendUnknownCommandsAsRaw); addSeparator(0, 4, 0, 4); addBoolSelector(0, 5, 0, 5, __tr2qs_ctx("Automatically unload unused modules", "options"), KviOption_boolCleanupUnusedModules); addBoolSelector(0, 6, 0, 6, __tr2qs_ctx("Ignore module versions (dangerous)", "options"), KviOption_boolIgnoreModuleVersions); addSeparator(0, 7, 0, 7); b = addBoolSelector(0, 8, 0, 8, __tr2qs_ctx("Relay errors and warnings to debug window", "options"), KviOption_boolScriptErrorsToDebugWindow); mergeTip(b, __tr2qs_ctx("This option will show the script errors and warnings " "also in the special debug window. This makes tracking of scripts that might " "be running in several windows far easier. The messages in the debug window " "also contain a deeper call stack which will help you to identify the " "scripting problems.", "options")); b1 = addBoolSelector(0, 9, 0, 9, __tr2qs_ctx("Create debug window without focus", "options"), KviOption_boolShowMinimizedDebugWindow); mergeTip(b1, __tr2qs_ctx("This option prevents the debug window " "from opening and diverting application focus.<br>" "Enable this if you don't like the debug window " "popping up while you're typing something in a channel.", "options")); addRowSpacer(0, 10, 0, 10); }
CFormPatinetMng::CFormPatinetMng(QWidget *parent ) :QMenu(parent) { pMainForm = parent; //创建菜单项 QString item = "病人信息"; act_patnt_info = new QAction(item,this); item = "删除病人信息"; act_patnt_del = new QAction(item,this); item = "药物计算"; act_drug_sum = new QAction(item,this); item = "返回"; act_back = new QAction(item,this); //添加菜单项 // setObjectName(QString::fromUtf8("main")); addAction(act_patnt_info); addAction(act_patnt_del); addSeparator(); addAction(act_drug_sum); addSeparator(); addAction(act_back); setFixedWidth(200); //设置格式 this->setStyleSheet(tr("background-color: white;selection-background-color: blue;")); show(); connect(act_patnt_info,SIGNAL(triggered()),this,SLOT(do_patnt_info())); connect(act_patnt_del,SIGNAL(triggered()),this,SLOT(do_patnt_del())); connect(act_drug_sum,SIGNAL(triggered()),this,SLOT(do_drug_sum())); connect(act_back,SIGNAL(triggered()),this,SLOT(do_back())); }
StorageVolControlMenu::StorageVolControlMenu( QWidget *parent, QStringList params, bool state) : QMenu(parent), parameters(params), autoReloadState(state) { if ( !parameters.isEmpty() ) { delete_Action = new QAction("Delete", this); delete_Action->setIcon(QIcon::fromTheme("delete")); download_Action = new QAction("Download", this); download_Action->setIcon(QIcon::fromTheme("download")); resize_Action = new QAction("Resize", this); resize_Action->setIcon(QIcon::fromTheme("resize")); upload_Action = new QAction("Upload", this); upload_Action->setIcon(QIcon::fromTheme("upload")); wipe_Menu = new WipeMenu(this); wipe_Action = new QAction("Wipe", this); wipe_Action->setIcon(QIcon::fromTheme("wipe")); wipe_Action->setMenu(wipe_Menu); connect(wipe_Menu, SIGNAL(execMethod(const QStringList&)), this, SIGNAL(execMethod(const QStringList&))); getXMLDesc_Action = new QAction("get XML Description", this); getXMLDesc_Action->setIcon(QIcon::fromTheme("application-xml")); addAction(delete_Action); addAction(download_Action); addAction(resize_Action); addAction(upload_Action); addAction(wipe_Action); addSeparator(); addAction(getXMLDesc_Action); addSeparator(); };
void MainObjectMenuMetadataItemVisitor::visitExceptions(Exceptions& exceptions) { addCreateItem(); addSeparator(); addGenerateCodeMenu(exceptions); addSeparator(); addRefreshItem(); }
void MainObjectMenuMetadataItemVisitor::visitFunctions(Functions& functions) { addDeclareItem(); addSeparator(); addGenerateCodeMenu(functions); addSeparator(); addRefreshItem(); }
void MainObjectMenuMetadataItemVisitor::visitViews(Views& views) { addCreateItem(); addSeparator(); addGenerateCodeMenu(views); addSeparator(); addRefreshItem(); }
void MainObjectMenuMetadataItemVisitor::visitTriggers(Triggers& triggers) { addCreateItem(); addSeparator(); addGenerateCodeMenu(triggers); addSeparator(); addRefreshItem(); }
void MainObjectMenuMetadataItemVisitor::visitTables(Tables& tables) { addCreateItem(); addSeparator(); addGenerateCodeMenu(tables); addSeparator(); addRefreshItem(); }
void MainObjectMenuMetadataItemVisitor::visitProcedures(Procedures& procedures) { addCreateItem(); addSeparator(); addGenerateCodeMenu(procedures); addSeparator(); addRefreshItem(); }
void MainObjectMenuMetadataItemVisitor::visitDomains(Domains& domains) { addCreateItem(); addSeparator(); addGenerateCodeMenu(domains); addSeparator(); addRefreshItem(); }
void MainObjectMenuMetadataItemVisitor::visitRole(Role& role) { addDropItem(role); addSeparator(); addGenerateCodeMenu(role); addSeparator(); // TODO: addRefreshItem(); addPropertiesItem(); }
void MainObjectMenuMetadataItemVisitor::visitFunction(Function& function) { addDropItem(function); addSeparator(); addGenerateCodeMenu(function); addSeparator(); addRefreshItem(); addPropertiesItem(); }
PGL_USING_NAMESPACE TOOLS_USING_NAMESPACE /* ----------------------------------------------------------------------- */ ViewCameraMenu::ViewCameraMenu(ViewCameraGL * camera,QWidget * parent, const char * name): QMenu(parent) { if(name)setObjectName(name); QPixmap home(ViewerIcon::getPixmap(ViewerIcon::home)); QPixmap read(ViewerIcon::getPixmap(ViewerIcon::fileopen)); QPixmap save(ViewerIcon::getPixmap(ViewerIcon::filefloppy)); QPixmap persp(ViewerIcon::getPixmap(ViewerIcon::perspective)); QPixmap ortho(ViewerIcon::getPixmap(ViewerIcon::orthographic)); QPixmap linked(ViewerIcon::getPixmap(ViewerIcon::linked)); QPixmap eyef(ViewerIcon::getPixmap(ViewerIcon::eyef)); QAction * action = addAction(home,tr("Home"), camera,SLOT(home()), Qt::CTRL+Qt::Key_I); addAction(tr("&Front View (YZ)"),camera,SLOT(YZView())); addAction(tr("&Right View (XZ)"),camera,SLOT(XZView())); addAction(tr("&Top View (XY)"), camera,SLOT(XYView())); addSeparator(); QMenu * __coordMenu = new QMenu(this); idGEOMcoord = __coordMenu->addAction(tr("GEOM System"), camera,SLOT(setGEOMCoordSys())); idGLcoord = __coordMenu->addAction(tr("GL System"), camera,SLOT(setGLCoordSys())); __coordMenu->addSeparator(); __coordMenu->addAction(tr("&Change"), camera,SLOT(changeCoordSys())); idGEOMcoord->setCheckable(true); idGLcoord->setCheckable(true); setCoordSys(camera->getCoordSys()); __coordMenu->setTitle(tr("Coordinates System")); addMenu(__coordMenu); addSeparator(); QMenu * __projectionMenu = new QMenu(this); idPerspective = __projectionMenu->addAction(persp,tr("&Perspective"), camera,SLOT(setPerspectiveMode())); idOrtho = __projectionMenu->addAction(ortho,tr("Ort&hographic"), camera,SLOT(setOrthographicMode())); __projectionMenu->addSeparator(); __projectionMenu->addAction(tr("&Change"), camera,SLOT(changeCameraMode()),Qt::CTRL+Qt::Key_D); idPerspective->setCheckable(true); idOrtho->setCheckable(true); __projectionMenu->setTitle(tr("Projection")); addMenu(__projectionMenu); setProjectionMode(camera->getProjectionMode()); QObject::connect(camera,SIGNAL(projectionChanged(bool)),this,SLOT(setProjectionMode(bool))); QObject::connect(camera,SIGNAL(coordSysChanged(int)),this,SLOT(setCoordSys(int))); addSeparator(); addAction(save,tr("&Save"), camera,SLOT(save())); addAction(read,tr("&Read"), camera,SLOT(read())); addSeparator(); QAction * idLock = addAction(linked,tr("&Auto Fit to Window"), camera,SLOT(lockDim())); if(camera)idLock->setChecked(camera->isDimLock()); QObject::connect(camera,SIGNAL(lockDimChanged(bool)),idLock,SLOT(setChecked(bool))); addAction(eyef,tr("&Fit to Window"), camera,SLOT(reDim())); }
void MainObjectMenuMetadataItemVisitor::visitException(Exception& exception) { addDropItem(exception); addSeparator(); addGenerateCodeMenu(exception); addSeparator(); addRefreshItem(); addPropertiesItem(); }
KOEventPopupMenu::KOEventPopupMenu() : mCopyToCalendarMenu( 0 ), mMoveToCalendarMenu( 0 ) { mCalendar = 0; mCurrentIncidence = 0; mCurrentDate = QDate(); mHasAdditionalItems = false; addAction( KOGlobals::self()->smallIcon( "document-preview" ), i18n( "&Show" ), this, SLOT( popupShow() ) ); mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "document-edit" ), i18n( "&Edit..." ), this, SLOT( popupEdit() ) ) ); #ifndef KORG_NOPRINTER mEditOnlyItems.append( addSeparator() ); addAction( KOGlobals::self()->smallIcon( "document-print" ), i18n( "&Print..." ), this, SLOT( print() ) ); QAction *preview = addAction( KOGlobals::self()->smallIcon( "document-print-preview" ), i18n( "Print Previe&w..." ), this, SLOT( printPreview() ) ); preview->setEnabled( !KMimeTypeTrader::self()->query("application/pdf", "KParts/ReadOnlyPart").isEmpty() ); #endif //------------------------------------------------------------------------ mEditOnlyItems.append( addSeparator() ); mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "edit-cut" ), i18nc( "cut this event", "C&ut" ), this, SLOT(popupCut()) ) ); mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "edit-copy" ), i18nc( "copy this event", "&Copy" ), this, SLOT(popupCopy()) ) ); // paste is always possible mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "edit-paste" ), i18n( "&Paste" ), this, SLOT(popupPaste()) ) ); mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "edit-delete" ), i18nc( "delete this incidence", "&Delete" ), this, SLOT(popupDelete()) ) ); //------------------------------------------------------------------------ mEditOnlyItems.append( addSeparator() ); mTodoOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "task-complete" ), i18n( "Togg&le To-do Completed" ), this, SLOT(toggleTodoCompleted()) ) ); mToggleReminder = addAction( QIcon( KOGlobals::self()->smallIcon( "appointment-reminder" ) ), i18n( "&Toggle Reminder" ), this, SLOT(toggleAlarm())); mEditOnlyItems.append( mToggleReminder ); //------------------------------------------------------------------------ mRecurrenceItems.append( addSeparator() ); mDissociateOccurrences = addAction( i18n( "&Dissociate From Recurrence..." ), this, SLOT(dissociateOccurrences()) ); mRecurrenceItems.append( mDissociateOccurrences ); addSeparator(); addAction( KOGlobals::self()->smallIcon( "mail-forward" ), i18n( "Send as iCalendar..." ), this, SLOT(forward()) ); }
void MainObjectMenuMetadataItemVisitor::visitDomain(Domain& domain) { addAlterItem(domain); addDropItem(domain); addSeparator(); addGenerateCodeMenu(domain); addSeparator(); addRefreshItem(); addPropertiesItem(); }
void MainObjectMenuMetadataItemVisitor::visitGenerators(Generators& generators) { menuM->Append(Cmds::Menu_ShowAllGeneratorValues, _("Show &all values")); addSeparator(); addCreateItem(); addSeparator(); addGenerateCodeMenu(generators); addSeparator(); addRefreshItem(); }