void KgpgApp::initActions() { KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(slotFileNew()), actionCollection()); KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(slotFileOpen()), actionCollection()); KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(slotFileSaveAs()), actionCollection()); KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotFileQuit()), actionCollection()); KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(slotEditCut()), actionCollection()); KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotEditCopy()), actionCollection()); KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(slotEditPaste()), actionCollection()); KStdAction::selectAll(TQT_TQOBJECT(this), TQT_SLOT(slotSelectAll()), actionCollection()); KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotOptions()), actionCollection(),"kgpg_config"); //KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); //KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureToolbars()), actionCollection()); fileSave = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotFileSave()), actionCollection()); (void) new TDEAction(i18n("&Encrypt File..."), "encrypted", 0,TQT_TQOBJECT(this), TQT_SLOT(slotFilePreEnc()), actionCollection(),"file_encrypt"); (void) new TDEAction(i18n("&Decrypt File..."), "decrypted", 0,TQT_TQOBJECT(this), TQT_SLOT(slotFilePreDec()), actionCollection(),"file_decrypt"); (void) new TDEAction(i18n("&Open Key Manager"), "kgpg", 0,TQT_TQOBJECT(this), TQT_SLOT(slotKeyManager()), actionCollection(),"key_manage"); editUndo = KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(slotundo()), actionCollection()); editRedo = KStdAction::redo(TQT_TQOBJECT(this), TQT_SLOT(slotredo()), actionCollection()); //(void) new TDEAction(i18n("&Manage Keys"), "kgpg_manage", CTRL+Key_K,TQT_TQOBJECT(this), TQT_SLOT(slotManageKey()), actionCollection(),"keys_manage"); (void) new TDEAction(i18n("&Generate Signature..."),0, TQT_TQOBJECT(this), TQT_SLOT(slotPreSignFile()), actionCollection(), "sign_generate"); (void) new TDEAction(i18n("&Verify Signature..."),0, TQT_TQOBJECT(this), TQT_SLOT(slotPreVerifyFile()), actionCollection(), "sign_verify"); (void) new TDEAction(i18n("&Check MD5 Sum..."), 0,TQT_TQOBJECT(this), TQT_SLOT(slotCheckMd5()), actionCollection(), "sign_check"); KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotFilePrint()), actionCollection()); // comment out for now, only confusing //encodingAction=new TDEToggleAction(i18n("&Unicode (utf-8) Encoding"), 0, 0,this, TQT_SLOT(slotSetCharset()),actionCollection(),"charsets"); }
void EditViewBase::setupBaseActions(bool haveClipboard) { // Actions all edit views will have // createAction("options_show_toolbar", SLOT(slotToggleToolBar())); createAction("options_show_statusbar", SLOT(slotToggleStatusBar())); createAction("options_configure", SLOT(slotConfigure())); // createAction("options_configure_keybindings", SLOT(slotEditKeys())); // createAction("options_configure_toolbars", SLOT(slotEditToolbars())); createAction("file_save", SIGNAL(saveFile())); createAction("file_close", SLOT(slotCloseWindow())); if (haveClipboard) { createAction("edit_cut", SLOT(slotEditCut())); createAction("edit_copy", SLOT(slotEditCopy())); createAction("edit_paste", SLOT(slotEditPaste())); } createAction("open_in_matrix", SLOT(slotOpenInMatrix())); createAction("open_in_percussion_matrix", SLOT(slotOpenInPercussionMatrix())); createAction("open_in_notation", SLOT(slotOpenInNotation())); createAction("open_in_event_list", SLOT(slotOpenInEventList())); createAction("open_in_pitch_tracker", SLOT(slotOpenInPitchTracker())); createAction("set_segment_start", SLOT(slotSetSegmentStartTime())); createAction("set_segment_duration", SLOT(slotSetSegmentDuration())); }
void KVerbosApp::initActions() { fileNewWindow = new KAction(i18n("New &Window"), "window_new.png", 0, this, SLOT(slotFileNewWindow()), actionCollection(),"file_new_window"); fileNew = KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection()); fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); fileOpenRecent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); fileOpenStandard = new KAction(i18n("Open &Standard Verb File"), "fileopen.png", 0, this, SLOT(slotFileOpenStandard()), actionCollection(),"file_open_standard"); fileSave = KStdAction::save(this, SLOT(slotFileSave()), actionCollection()); fileSaveAs = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); fileClose = KStdAction::close(this, SLOT(slotFileClose()), actionCollection()); filePrint = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection()); fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection()); editCut = KStdAction::cut(this, SLOT(slotEditCut()), actionCollection()); editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection()); editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection()); editErfassen = new KAction(i18n("E&nter New Verb..."), 0, 0, this, SLOT(slotEditErfassen()), actionCollection(),"edit_erfassen"); editBearbeiten = new KAction(i18n("&Edit Verb List..."), 0, 0, this, SLOT(slotEditBearbeiten()), actionCollection(), "edit_bearbeiten"); settingOptions = new KAction(i18n("&Configure KVerbos..."), 0, 0, this, SLOT(slotSettingsOptions()), actionCollection(), "settings_options"); userUsername = new KAction(i18n("&Username..."), 0, 0, this, SLOT(slotSettingsUsername()), actionCollection(), "user_username"); userResults = new KAction(i18n("&Results"), 0, 0, this, SLOT(slotUserResults()), actionCollection(), "user_results"); fileNewWindow->setToolTip(i18n("Opens a new application window")); fileOpenStandard->setToolTip(i18n("Opens the standard KVerbos verb file")); fileNew->setToolTip(i18n("Creates a new document")); fileOpen->setToolTip(i18n("Opens an existing document")); fileOpenRecent->setToolTip(i18n("Opens a recently used file")); fileSave->setToolTip(i18n("Saves the actual document")); fileSaveAs->setToolTip(i18n("Saves the actual document as...")); fileClose->setToolTip(i18n("Closes the actual document")); filePrint ->setToolTip(i18n("Prints out the actual document")); fileQuit->setToolTip(i18n("Quits the application")); editCut->setToolTip(i18n("Cuts the selected section and puts it to the clipboard")); editCopy->setToolTip(i18n("Copies the selected section to the clipboard")); editPaste->setToolTip(i18n("Pastes the clipboard contents to actual position")); editErfassen->setToolTip(i18n("Add new verbs.")); editBearbeiten->setToolTip(i18n("Edit the list of verbs.")); settingOptions->setToolTip(i18n("Change some options of the program")); userUsername->setToolTip(i18n("Enter your name as the username")); userResults->setToolTip(i18n("These are your latest results.")); // icons editBearbeiten->setIcon("edit.png"); editErfassen->setIcon("editclear.png"); settingOptions->setIcon("configure.png"); userUsername->setIcon("kverbosuser.png"); userResults->setIcon("kverbosuser.png"); setupGUI(); }
tristate KexiReportDesignView::afterSwitchFrom(Kexi::ViewMode mode) { kDebug() << tempData()->document; if (tempData()->document.isEmpty()) { _rd = new ReportDesigner(this, KexiMainWindowIface::global()->project()->dbConnection()); } else { if (_rd) { scr->takeWidget(); delete _rd; _rd = 0; } _rd = new ReportDesigner(this, KexiMainWindowIface::global()->project()->dbConnection(), tempData()->document); } scr->setWidget(_rd); //plugSharedAction ( "edit_copy", _rd, SLOT ( slotEditCopy() ) ); //plugSharedAction ( "edit_cut", _rd, SLOT ( slotEditCut() ) ); //plugSharedAction ( "edit_paste", _rd, SLOT ( slotEditPaste() ) ); //plugSharedAction ( "edit_delete", _rd, SLOT ( slotEditDelete() ) ); connect(_rd, SIGNAL(propertySetChanged()), this, SLOT(slotDesignerPropertySetChanged())); connect(_rd, SIGNAL(dirty()), this, SLOT(setDirty())); //Edit Actions connect(editCutAction, SIGNAL(activated()), _rd, SLOT(slotEditCut())); connect(editCopyAction, SIGNAL(activated()), _rd, SLOT(slotEditCopy())); connect(editPasteAction, SIGNAL(activated()), _rd, SLOT(slotEditPaste())); connect(editDeleteAction, SIGNAL(activated()), _rd, SLOT(slotEditDelete())); connect(sectionEdit, SIGNAL(activated()), _rd, SLOT(slotSectionEditor())); //Control Actions connect(res->itemLabel, SIGNAL(clicked()), this, SLOT(slotLabel())); connect(res->itemField, SIGNAL(clicked()), this, SLOT(slotField())); connect(res->itemText, SIGNAL(clicked()), this, SLOT(slotText())); connect(res->itemLine, SIGNAL(clicked()), this, SLOT(slotLine())); connect(res->itemBarcode, SIGNAL(clicked()), this, SLOT(slotBarcode())); connect(res->itemChart, SIGNAL(clicked()),this, SLOT(slotChart())); connect(res->itemImage, SIGNAL(clicked()), this, SLOT(slotImage())); connect(res->itemShape, SIGNAL(clicked()), this, SLOT(slotShape())); connect(res->itemCheck, SIGNAL(clicked()), this, SLOT(slotCheck())); //Raise/Lower connect(itemRaiseAction, SIGNAL(activated()), _rd, SLOT(slotRaiseSelected())); connect(itemLowerAction, SIGNAL(activated()), _rd, SLOT(slotLowerSelected())); return true; }
SegmentTool::SegmentTool(CompositionView* canvas, RosegardenDocument *doc) : BaseTool("SegmentTool", canvas), m_canvas(canvas), m_doc(doc) { //RG_DEBUG << "SegmentTool::SegmentTool()"; // Set up the actions for the right-click context menu. Note that // all of these end up simply delegating to RosegardenMainWindow. createAction("edit_default", SLOT(slotEdit())); createAction("edit_matrix", SLOT(slotEditInMatrix())); createAction("edit_percussion_matrix", SLOT(slotEditInPercussionMatrix())); createAction("edit_notation", SLOT(slotEditAsNotation())); createAction("edit_event_list", SLOT(slotEditInEventList())); createAction("edit_pitch_tracker", SLOT(slotEditInPitchTracker())); // Can we get some of the following connectionless mojo for some // of these others too? // The undo and redo actions are available globally through // CommandHistory. See ActionFileParser::findStandardAction() which // allows them to be found easily. Since disparate parts of the // system need the exact same QAction objects, it might be a good // idea to introduce a global QAction repository for all QAction // objects. RosegardenMainWindow might suffice. This would also // simplify the implementation of a shortcut manager. //createAction("edit_undo", ...); // handled by CommandHistory //createAction("edit_redo", ...); // handled by CommandHistory createAction("edit_cut", SLOT(slotEditCut())); createAction("edit_copy", SLOT(slotEditCopy())); createAction("edit_paste", SLOT(slotEditPaste())); createAction("delete", SLOT(slotDeleteSelectedSegments())); createAction("join_segments", SLOT(slotJoinSegments())); createAction("quantize_selection", SLOT(slotQuantizeSelection())); createAction("repeat_quantize", SLOT(slotRepeatQuantizeSelection())); createAction("relabel_segment", SLOT(slotRelabelSegments())); createAction("transpose", SLOT(slotTransposeSegments())); createAction("select", SLOT(slotPointerSelected())); createAction("move", SLOT(slotMoveSelected())); createAction("draw", SLOT(slotDrawSelected())); createAction("erase", SLOT(slotEraseSelected())); createAction("resize", SLOT(slotResizeSelected())); createAction("split", SLOT(slotSplitSelected())); }
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())); }
SegmentTool::SegmentTool(CompositionView* canvas, RosegardenDocument *doc) : BaseTool("SegmentTool", canvas), m_canvas(canvas), m_doc(doc), m_changeMade(false) { //RG_DEBUG << "SegmentTool::SegmentTool()"; // Set up the actions for the right-click context menu. Note that // all of these end up simply delegating to RosegardenMainWindow. createAction("edit_default", SLOT(slotEdit())); createAction("edit_matrix", SLOT(slotEditInMatrix())); createAction("edit_percussion_matrix", SLOT(slotEditInPercussionMatrix())); createAction("edit_notation", SLOT(slotEditAsNotation())); createAction("edit_event_list", SLOT(slotEditInEventList())); createAction("edit_pitch_tracker", SLOT(slotEditInPitchTracker())); // Can we get some of the following connectionless mojo for some // of these others too? //createAction("edit_undo", ...); // handled by a higher authority? //createAction("edit_redo", ...); // handled by a higher authority? createAction("edit_cut", SLOT(slotEditCut())); createAction("edit_copy", SLOT(slotEditCopy())); createAction("edit_paste", SLOT(slotEditPaste())); createAction("delete", SLOT(slotDeleteSelectedSegments())); createAction("join_segments", SLOT(slotJoinSegments())); createAction("quantize_selection", SLOT(slotQuantizeSelection())); createAction("repeat_quantize", SLOT(slotRepeatQuantizeSelection())); createAction("relabel_segment", SLOT(slotRelabelSegments())); createAction("transpose", SLOT(slotTransposeSegments())); createAction("select", SLOT(slotPointerSelected())); createAction("move", SLOT(slotMoveSelected())); createAction("draw", SLOT(slotDrawSelected())); createAction("erase", SLOT(slotEraseSelected())); createAction("resize", SLOT(slotResizeSelected())); createAction("split", SLOT(slotSplitSelected())); }
tristate KexiReportDesignView::afterSwitchFrom(Kexi::ViewMode mode) { Q_UNUSED(mode); if (tempData()->reportDefinition.isNull()) { m_reportDesigner = new KoReportDesigner(this); } else { if (m_reportDesigner) { m_scrollArea->takeWidget(); delete m_reportDesigner; m_reportDesigner = 0; } m_reportDesigner = new KoReportDesigner(this, tempData()->reportDefinition); m_sourceSelector->setConnectionData(tempData()->connectionDefinition); } connect(m_reportDesigner, SIGNAL(itemInserted(QString)), this, SIGNAL(itemInserted(QString))); m_scrollArea->setWidget(m_reportDesigner); connect(m_reportDesigner, SIGNAL(propertySetChanged()), this, SLOT(slotDesignerPropertySetChanged())); connect(m_reportDesigner, SIGNAL(dirty()), this, SLOT(setDirty())); //Edit Actions connect(m_editCutAction, SIGNAL(activated()), m_reportDesigner, SLOT(slotEditCut())); connect(m_editCopyAction, SIGNAL(activated()), m_reportDesigner, SLOT(slotEditCopy())); connect(m_editPasteAction, SIGNAL(activated()), m_reportDesigner, SLOT(slotEditPaste())); connect(m_editDeleteAction, SIGNAL(activated()), m_reportDesigner, SLOT(slotEditDelete())); connect(m_sectionEdit, SIGNAL(activated()), m_reportDesigner, SLOT(slotSectionEditor())); //Raise/Lower connect(m_itemRaiseAction, SIGNAL(activated()), m_reportDesigner, SLOT(slotRaiseSelected())); connect(m_itemLowerAction, SIGNAL(activated()), m_reportDesigner, SLOT(slotLowerSelected())); return true; }
void VirtualConsole::initMenuBar() { QString dir; _app->settings()->get(KEY_SYSTEM_DIR, dir); dir += QString("/") + PIXMAPPATH; setIcon(dir + QString("/virtualconsole.xpm")); m_layout = new QHBoxLayout(this); m_layout->setAutoAdd(false); m_menuBar = new QMenuBar(this); m_layout->setMenuBar(m_menuBar); // // Add menu // m_addMenu = new QPopupMenu(); m_addMenu->insertItem(QPixmap(dir + "/button.xpm"), "&Button", this, SLOT(slotAddButton()), 0, KVCMenuAddButton); m_addMenu->insertItem(QPixmap(dir + "/slider.xpm"), "&Slider", this, SLOT(slotAddSlider()), 0, KVCMenuAddSlider); m_addMenu->insertItem(QPixmap(dir + "/frame.xpm"), "&Frame", this, SLOT(slotAddFrame()), 0, KVCMenuAddFrame); m_addMenu->insertItem(QPixmap(dir + "/frame.xpm"), "&XY-Pad", this, SLOT(slotAddXYPad()), 0, KVCMenuAddXYPad); m_addMenu->setItemEnabled(KVCMenuAddXYPad, false); m_addMenu->insertItem(QPixmap(dir + "/rename.xpm"), "L&abel", this, SLOT(slotAddLabel()), 0, KVCMenuAddLabel); // // Tools menu // m_toolsMenu = new QPopupMenu(); m_toolsMenu->insertItem(QPixmap(dir + "/settings.xpm"), "&Settings...", this, SLOT(slotToolsSettings()), 0, KVCMenuToolsSettings); m_toolsMenu->insertItem(QPixmap(dir + "/slider.xpm"), "&Default Sliders", this, SLOT(slotToolsSliders()), 0, KVCMenuToolsSliders); m_toolsMenu->insertSeparator(); m_toolsMenu->insertItem(QPixmap(dir + "/panic.xpm"), "&Panic!", this, SLOT(slotToolsPanic()), 0, KVCMenuToolsPanic); // // Foreground menu // QPopupMenu* fgMenu = new QPopupMenu(); fgMenu->insertItem(QPixmap(dir + QString("/color.xpm")), "&Color...", this, SLOT(slotForegroundColor()), 0, KVCMenuForegroundColor); fgMenu->insertItem(QPixmap(dir + QString("/rename.xpm")), "&Font...", this, SLOT(slotForegroundFont()), 0, KVCMenuForegroundFont); fgMenu->insertItem(QPixmap(dir + QString("/fileclose.xpm")), "&Default", this, SLOT(slotForegroundNone()), 0, KVCMenuForegroundNone); // // Background Menu // QPopupMenu* bgMenu = new QPopupMenu(); bgMenu->insertItem(QPixmap(dir + QString("/color.xpm")), "&Color...", this, SLOT(slotBackgroundColor()), 0, KVCMenuBackgroundColor); bgMenu->insertItem(QPixmap(dir + QString("/image.xpm")), "&Image...", this, SLOT(slotBackgroundImage()), 0, KVCMenuBackgroundPixmap); bgMenu->insertItem(QPixmap(dir + QString("/fileclose.xpm")), "&Default", this, SLOT(slotBackgroundNone()), 0, KVCMenuBackgroundNone); bgMenu->insertSeparator(); bgMenu->insertItem(QPixmap(dir + QString("/frame.xpm")), "Toggle &Frame", this, SLOT(slotBackgroundFrame()), 0, KVCMenuBackgroundFrame); // // Stacking order menu // QPopupMenu* stackMenu = new QPopupMenu(); stackMenu->insertItem(QPixmap(dir + QString("/up.xpm")), "&Raise", this, SLOT(slotStackingRaise()), 0, KVCMenuStackingRaise); stackMenu->insertItem(QPixmap(dir + QString("/down.xpm")), "&Lower", this, SLOT(slotStackingLower()), 0, KVCMenuStackingLower); // // Edit menu // m_editMenu = new QPopupMenu(); m_editMenu->insertItem(QPixmap(dir + "/editcut.xpm"), "Cut", this, SLOT(slotEditCut()), 0, KVCMenuEditCut); m_editMenu->insertItem(QPixmap(dir + "/editcopy.xpm"), "Copy", this, SLOT(slotEditCopy()), 0, KVCMenuEditCopy); m_editMenu->insertItem(QPixmap(dir + "/editpaste.xpm"), "Paste", this, SLOT(slotEditPaste()), 0, KVCMenuEditPaste); m_editMenu->insertItem(QPixmap(dir + "/remove.xpm"), "Delete", this, SLOT(slotEditDelete()), 0, KVCMenuEditDelete); m_editMenu->insertSeparator(); m_editMenu->insertItem(QPixmap(dir + "/settings.xpm"), "&Properties...", this, SLOT(slotEditProperties()), 0, KVCMenuEditProperties); m_editMenu->insertItem(QPixmap(dir + QString("/rename.xpm")), "&Rename...", this, SLOT(slotEditRename()), 0, KVCMenuEditRename); m_editMenu->setItemEnabled(KVCMenuEditCut, false); m_editMenu->setItemEnabled(KVCMenuEditCopy, false); m_editMenu->setItemEnabled(KVCMenuEditPaste, false); m_editMenu->insertSeparator(); m_editMenu->insertItem("Foreground", fgMenu, KVCMenuForegroundMin); m_editMenu->insertItem("Background", bgMenu, KVCMenuBackgroundMin); m_editMenu->insertItem("Stacking Order", stackMenu, KVCMenuStackingMin); m_menuBar->insertItem("&Tools", m_toolsMenu); m_menuBar->insertItem("&Add", m_addMenu); m_menuBar->insertItem("&Edit", m_editMenu); }
void Portal::initActions() { fileQuit = actionCollection()->addAction( KStandardAction::Quit, this, SLOT(slotFileQuit() ) ); editCut = actionCollection()->addAction( KStandardAction::Cut, this, SLOT(slotEditCut() ) ); editCopy = actionCollection()->addAction( KStandardAction::Copy, this, SLOT(slotEditCopy() ) ); editPaste = actionCollection()->addAction( KStandardAction::Paste, this, SLOT(slotEditPaste() ) ); viewStatusBar = KStandardAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection()); actionCollection()->addAction( KStandardAction::Preferences, this, SLOT( preferences() ) ); actNewDocument = actionCollection()->addAction( "document_new", this, SLOT( slotNewDocument()) ); actNewDocument->setText( i18n("Create Document") ); actNewDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::New) ); actNewDocument->setIcon( KIcon("document-new")); actCopyDocument = actionCollection()->addAction( "document_copy", this, SLOT( slotCopyDocument()) ); actCopyDocument->setText( i18n("Copy Document")); actCopyDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::Copy) ); actCopyDocument->setIcon( KIcon( "document-edit")); actFollowDocument = actionCollection()->addAction( "document_follow", this, SLOT( slotFollowUpDocument() ) ); actFollowDocument->setText( i18n("Follow Document" )); actFollowDocument->setShortcut( KShortcut( Qt::CTRL + Qt::Key_F )); actFollowDocument->setIcon( KIcon( "document-edit")); actPrintDocument = actionCollection()->addAction( "document_print", this, SLOT( slotPrintDocument()) ); actPrintDocument->setText( i18n("Print Document")); actPrintDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::Print) ); actPrintDocument->setIcon( KIcon("document-print")); actOpenArchivedDocument = actionCollection()->addAction( "archived_open", this, SLOT( slotArchivedDocExecuted()) ); actOpenArchivedDocument->setText( i18n("Open Archived Document")); actOpenArchivedDocument->setShortcut( KShortcut(Qt::CTRL + Qt::Key_A) ); actViewDocument = actionCollection()->addAction( "document_view", this, SLOT( slotViewDocument())); actViewDocument->setText(i18n("Show Document")); actViewDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::Reload) ); actViewDocument->setIcon( KIcon("document-preview" )); actOpenDocument = actionCollection()->addAction( "document_open", this, SLOT( slotOpenDocument()) ); actOpenDocument->setText( i18n("Edit Document")); actOpenDocument->setShortcut( KStandardShortcut::shortcut(KStandardShortcut::Open) ); actOpenDocument->setIcon( KIcon("document-open" )); actMailDocument = actionCollection()->addAction( "document_mail", this, SLOT( slotMailDocument()) ); actMailDocument->setText(i18n("&Mail Document")); actMailDocument->setShortcut( KShortcut(Qt::CTRL + Qt::Key_M )); actMailDocument->setIcon( KIcon("mail-forward")); actEditTemplates = actionCollection()->addAction( "edit_tag_templates", this, SLOT( slotEditTagTemplates() ) ); actEditTemplates->setText("Edit Tag Templates"); actEditTemplates->setShortcut( KShortcut( Qt::CTRL + Qt::Key_E )); KAction *reconfDb = actionCollection()->addAction( "reconfigure_db", this, SLOT( slotReconfigureDatabase() ) ); reconfDb->setText("Redo Initial Setup..."); reconfDb->setShortcut( KShortcut( Qt::CTRL + Qt::Key_R )); fileQuit->setStatusTip(i18n("Quits the application")); editCut->setStatusTip(i18n("Cuts the selected section and puts it to the clipboard")); editCopy->setStatusTip(i18n("Copies the selected section to the clipboard")); editPaste->setStatusTip(i18n("Pastes the clipboard contents to current position")); viewStatusBar->setStatusTip(i18n("Enables/disables the statusbar")); actNewDocument->setStatusTip( i18n( "Creates a new Document" ) ); actPrintDocument->setStatusTip( i18n( "Print and archive this Document" ) ); actCopyDocument->setStatusTip( i18n( "Creates a new document which is a copy of the selected document" ) ); actFollowDocument->setStatusTip( i18n( "Create a followup document for the current document" ) ); actOpenDocument->setStatusTip( i18n( "Opens the document for editing" ) ); actViewDocument->setStatusTip( i18n( "Opens a read only view on the document." ) ); actMailDocument->setStatusTip( i18n( "Send document per mail" ) ); actEditTemplates->setStatusTip( i18n("Edit the available tag templates which can be assigned to document items.") ); reconfDb->setStatusTip( i18n( "Configure the Database Kraft is working on." ) ); actOpenArchivedDocument->setStatusTip( i18n( "Open a viewer on an archived document" ) ); setStandardToolBarMenuEnabled( true ); actOpenDocument->setEnabled( false ); actViewDocument->setEnabled( false ); actPrintDocument->setEnabled( false ); actCopyDocument->setEnabled( false ); actFollowDocument->setEnabled( false ); actMailDocument->setEnabled( false ); actOpenArchivedDocument->setEnabled( false ); // use the absolute path to your kraftui.rc file for testing purpose in createGUI(); QString prjPath = QString::fromUtf8(qgetenv("KRAFT_HOME")); if( !prjPath.isEmpty() ) { createGUI(QString("%1/src/kraftui.rc").arg(prjPath)); } else { createGUI( "kraftui.rc"); } }
tristate ReportDesignView::afterSwitchFrom ( ::ViewMode mode ) { kDebug(planDbg()) << tempData()->document; if ( tempData()->document.isEmpty() ) { _rd = new ReportDesigner ( this ); } else { if ( _rd ) { scr->takeWidget(); delete _rd; _rd = 0; } QDomDocument doc; doc.setContent ( tempData()->document ); QDomElement root = doc.documentElement(); QDomElement korep = root.firstChildElement( "koreport" ); QDomElement conn = root.firstChildElement( "connection" ); if ( !korep.isNull() ) { _rd = new ReportDesigner ( this, korep ); if (!conn.isNull()) { srcsel->setConnectionData(conn); } } else { kDebug(planDbg()) << "no koreport section"; //TODO remove...just create a blank document //Temp - allow load old style report definitions (no data) root.setTagName("koreport"); _rd = new ReportDesigner ( this, root ); } } scr->setWidget ( _rd ); //plugSharedAction ( "edit_copy", _rd, SLOT(slotEditCopy()) ); //plugSharedAction ( "edit_cut", _rd, SLOT(slotEditCut()) ); //plugSharedAction ( "edit_paste", _rd, SLOT(slotEditPaste()) ); //plugSharedAction ( "edit_delete", _rd, SLOT(slotEditDelete()) ); connect ( _rd, SIGNAL(propertySetChanged()), this, SLOT(slotDesignerPropertySetChanged()) ); connect ( _rd, SIGNAL(dirty()), this, SLOT(setDirty()) ); //Edit Actions connect ( editCutAction, SIGNAL(activated()), _rd, SLOT(slotEditCut()) ); connect ( editCopyAction, SIGNAL(activated()), _rd, SLOT(slotEditCopy()) ); connect ( editPasteAction, SIGNAL(activated()), _rd, SLOT(slotEditPaste()) ); connect ( editDeleteAction, SIGNAL(activated()), _rd, SLOT(slotEditDelete()) ); connect ( sectionEdit, SIGNAL(activated()), _rd, SLOT(slotSectionEditor()) ); //Control Actions connect ( res->itemLabel, SIGNAL(clicked()), this, SLOT(slotLabel()) ); connect ( res->itemField, SIGNAL(clicked()), this, SLOT(slotField()) ); connect ( res->itemText, SIGNAL(clicked()), this, SLOT(slotText()) ); connect ( res->itemLine, SIGNAL(clicked()), this, SLOT(slotLine()) ); connect ( res->itemBarcode, SIGNAL(clicked()), this, SLOT(slotBarcode()) ); connect ( res->itemChart, SIGNAL(clicked()),this, SLOT(slotChart()) ); connect ( res->itemImage, SIGNAL(clicked()), this, SLOT(slotImage()) ); connect ( res->itemShape, SIGNAL(clicked()), this, SLOT(slotShape()) ); connect ( res->itemCheck, SIGNAL(clicked()), this, SLOT(slotCheck()) ); //Raise/Lower connect ( itemRaiseAction, SIGNAL(activated()), _rd, SLOT(slotRaiseSelected()) ); connect ( itemLowerAction, SIGNAL(activated()), _rd, SLOT(slotLowerSelected()) ); return true; }