KFileReplace::KFileReplace() : KParts::MainWindow(0L, "KFileReplace") { KLibFactory *factory = KLibLoader::self()->factory("libkfilereplacepart"); if (factory) { m_part = static_cast<KParts::ReadOnlyPart *>(factory->create(this, "kfilereplace_part", "KParts::ReadOnlyPart" )); if (m_part) { setCentralWidget(m_part->widget()); KStdAction::quit(this, SLOT(close()), actionCollection()); KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), actionCollection()); KStdAction::configureToolbars(this, SLOT(slotConfigureToolbars()), actionCollection()); setStandardToolBarMenuEnabled(true); createGUI(m_part); removeDuplicatedActions(); } } else { KMessageBox::error(this, i18n("Could not find the KFileReplace part.")); close(); return; } }
void KWatchGnuPGMainWindow::createActions() { (void)new KAction( i18n("C&lear History"), "history_clear", CTRL+Key_L, this, SLOT( slotClear() ), actionCollection(), "clear_log" ); (void)KStdAction::saveAs( this, SLOT(slotSaveAs()), actionCollection() ); (void)KStdAction::close( this, SLOT(close()), actionCollection() ); (void)KStdAction::quit( this, SLOT(slotQuit()), actionCollection() ); (void)KStdAction::preferences( this, SLOT(slotConfigure()), actionCollection() ); ( void )KStdAction::keyBindings(this, SLOT(configureShortcuts()), actionCollection()); ( void )KStdAction::configureToolbars(this, SLOT(slotConfigureToolbars()), actionCollection()); #if 0 (void)new KAction( i18n("Configure KWatchGnuPG..."), QString::fromLatin1("configure"), 0, this, SLOT( slotConfigure() ), actionCollection(), "configure" ); #endif }
// decoupled from resetActions in toplevel.cpp // as resetActions simply uses the action groups // specified in the ui.rc file void KEBApp::createActions() { m_actionsImpl = new ActionsImpl(this, GlobalBookmarkManager::self()->model()); connect(m_actionsImpl->testLinkHolder(), SIGNAL(setCancelEnabled(bool)), this, SLOT(setCancelTestsEnabled(bool))); connect(m_actionsImpl->favIconHolder(), SIGNAL(setCancelEnabled(bool)), this, SLOT(setCancelFavIconUpdatesEnabled(bool))); // save and quit should probably not be in the toplevel??? (void) KStandardAction::quit( this, SLOT( close() ), actionCollection()); KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection()); (void) KStandardAction::configureToolbars( this, SLOT( slotConfigureToolbars() ), actionCollection()); if (m_browser) { (void) KStandardAction::open( m_actionsImpl, SLOT( slotLoad() ), actionCollection()); (void) KStandardAction::saveAs( m_actionsImpl, SLOT( slotSaveAs() ), actionCollection()); } (void) KStandardAction::cut(m_actionsImpl, SLOT( slotCut() ), actionCollection()); (void) KStandardAction::copy(m_actionsImpl, SLOT( slotCopy() ), actionCollection()); (void) KStandardAction::paste(m_actionsImpl, SLOT( slotPaste() ), actionCollection()); // actions KAction* m_actionsImplDelete = actionCollection()->addAction("delete"); m_actionsImplDelete->setIcon(KIcon("edit-delete")); m_actionsImplDelete->setText(i18n("&Delete")); m_actionsImplDelete->setShortcut(Qt::Key_Delete); connect(m_actionsImplDelete, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotDelete() )); KAction* m_actionsImplRename = actionCollection()->addAction("rename"); m_actionsImplRename->setIcon(KIcon("edit-rename")); m_actionsImplRename->setText(i18n("Rename")); m_actionsImplRename->setShortcut(Qt::Key_F2); connect(m_actionsImplRename, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotRename() )); KAction* m_actionsImplChangeURL = actionCollection()->addAction("changeurl"); m_actionsImplChangeURL->setIcon(KIcon("edit-rename")); m_actionsImplChangeURL->setText(i18n("C&hange Location")); m_actionsImplChangeURL->setShortcut(Qt::Key_F3); connect(m_actionsImplChangeURL, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotChangeURL() )); KAction* m_actionsImplChangeComment = actionCollection()->addAction("changecomment"); m_actionsImplChangeComment->setIcon(KIcon("edit-rename")); m_actionsImplChangeComment->setText(i18n("C&hange Comment")); m_actionsImplChangeComment->setShortcut(Qt::Key_F4); connect(m_actionsImplChangeComment, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotChangeComment() )); KAction* m_actionsImplChangeIcon = actionCollection()->addAction("changeicon"); m_actionsImplChangeIcon->setIcon(KIcon("preferences-desktop-icons")); m_actionsImplChangeIcon->setText(i18n("Chan&ge Icon...")); connect(m_actionsImplChangeIcon, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotChangeIcon() )); KAction* m_actionsImplUpdateFavIcon = actionCollection()->addAction("updatefavicon"); m_actionsImplUpdateFavIcon->setText(i18n("Update Favicon")); connect(m_actionsImplUpdateFavIcon, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotUpdateFavIcon() )); KAction* m_actionsImplRecursiveSort = actionCollection()->addAction("recursivesort"); m_actionsImplRecursiveSort->setText(i18n("Recursive Sort")); connect(m_actionsImplRecursiveSort, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotRecursiveSort() )); KAction* m_actionsImplNewFolder = actionCollection()->addAction("newfolder"); m_actionsImplNewFolder->setIcon(KIcon("folder-new")); m_actionsImplNewFolder->setText(i18n("&New Folder...")); m_actionsImplNewFolder->setShortcut(Qt::CTRL+Qt::Key_N); connect(m_actionsImplNewFolder, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotNewFolder() )); KAction* m_actionsImplNewBookmark = actionCollection()->addAction("newbookmark"); m_actionsImplNewBookmark->setIcon(KIcon("bookmark-new")); m_actionsImplNewBookmark->setText(i18n("&New Bookmark")); connect(m_actionsImplNewBookmark, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotNewBookmark() )); KAction* m_actionsImplInsertSeparator = actionCollection()->addAction("insertseparator"); m_actionsImplInsertSeparator->setText(i18n("&Insert Separator")); m_actionsImplInsertSeparator->setShortcut(Qt::CTRL+Qt::Key_I); connect(m_actionsImplInsertSeparator, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotInsertSeparator() )); KAction* m_actionsImplSort = actionCollection()->addAction("sort"); m_actionsImplSort->setText(i18n("&Sort Alphabetically")); connect(m_actionsImplSort, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotSort() )); KAction* m_actionsImplSetAsToolbar = actionCollection()->addAction("setastoolbar"); m_actionsImplSetAsToolbar->setIcon(KIcon("bookmark-toolbar")); m_actionsImplSetAsToolbar->setText(i18n("Set as T&oolbar Folder")); connect(m_actionsImplSetAsToolbar, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotSetAsToolbar() )); KAction* m_actionsImplExpandAll = actionCollection()->addAction("expandall"); m_actionsImplExpandAll->setText(i18n("&Expand All Folders")); connect(m_actionsImplExpandAll, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExpandAll() )); KAction* m_actionsImplCollapseAll = actionCollection()->addAction("collapseall"); m_actionsImplCollapseAll->setText(i18n("Collapse &All Folders")); connect(m_actionsImplCollapseAll, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotCollapseAll() )); KAction* m_actionsImplOpenLink = actionCollection()->addAction("openlink"); m_actionsImplOpenLink->setIcon(KIcon("document-open")); m_actionsImplOpenLink->setText(i18n("&Open in Konqueror")); connect(m_actionsImplOpenLink, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotOpenLink() )); KAction* m_actionsImplTestSelection = actionCollection()->addAction("testlink"); m_actionsImplTestSelection->setIcon(KIcon("bookmarks")); m_actionsImplTestSelection->setText(i18n("Check &Status")); connect(m_actionsImplTestSelection, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotTestSelection() )); KAction* m_actionsImplTestAll = actionCollection()->addAction("testall"); m_actionsImplTestAll->setText(i18n("Check Status: &All")); connect(m_actionsImplTestAll, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotTestAll() )); KAction* m_actionsImplUpdateAllFavIcons = actionCollection()->addAction("updateallfavicons"); m_actionsImplUpdateAllFavIcons->setText(i18n("Update All &Favicons")); connect(m_actionsImplUpdateAllFavIcons, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotUpdateAllFavIcons() )); KAction* m_actionsImplCancelAllTests = actionCollection()->addAction("canceltests"); m_actionsImplCancelAllTests->setText(i18n("Cancel &Checks")); connect(m_actionsImplCancelAllTests, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotCancelAllTests() )); KAction* m_actionsImplCancelFavIconUpdates = actionCollection()->addAction("cancelfaviconupdates"); m_actionsImplCancelFavIconUpdates->setText(i18n("Cancel &Favicon Updates")); connect(m_actionsImplCancelFavIconUpdates, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotCancelFavIconUpdates() )); KAction* m_actionsImplImportNS = actionCollection()->addAction("importNS"); m_actionsImplImportNS->setObjectName( QLatin1String("NS" )); m_actionsImplImportNS->setIcon(KIcon("netscape")); m_actionsImplImportNS->setText(i18n("Import &Netscape Bookmarks...")); connect(m_actionsImplImportNS, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplImportOpera = actionCollection()->addAction("importOpera"); m_actionsImplImportOpera->setObjectName( QLatin1String("Opera" )); m_actionsImplImportOpera->setIcon(KIcon("opera")); m_actionsImplImportOpera->setText(i18n("Import &Opera Bookmarks...")); connect(m_actionsImplImportOpera, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); /* KAction* m_actionsImplImportCrashes = actionCollection()->addAction("importCrashes"); m_actionsImplImportCrashes->setObjectName( QLatin1String("Crashes" )); m_actionsImplImportCrashes->setText(i18n("Import All &Crash Sessions as Bookmarks...")); connect(m_actionsImplImportCrashes, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); */ KAction* m_actionsImplImportGaleon = actionCollection()->addAction("importGaleon"); m_actionsImplImportGaleon->setObjectName( QLatin1String("Galeon" )); m_actionsImplImportGaleon->setText(i18n("Import &Galeon Bookmarks...")); connect(m_actionsImplImportGaleon, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplImportKDE2 = actionCollection()->addAction("importKDE2"); m_actionsImplImportKDE2->setObjectName( QLatin1String("KDE2" )); m_actionsImplImportKDE2->setIcon(KIcon("kde")); m_actionsImplImportKDE2->setText(i18n("Import &KDE 2 or KDE 3 Bookmarks...")); connect(m_actionsImplImportKDE2, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplImportIE = actionCollection()->addAction("importIE"); m_actionsImplImportIE->setObjectName( QLatin1String("IE" )); m_actionsImplImportIE->setText(i18n("Import &Internet Explorer Bookmarks...")); connect(m_actionsImplImportIE, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplImportMoz = actionCollection()->addAction("importMoz"); m_actionsImplImportMoz->setObjectName( QLatin1String("Moz" )); m_actionsImplImportMoz->setIcon(KIcon("mozilla")); m_actionsImplImportMoz->setText(i18n("Import &Mozilla Bookmarks...")); connect(m_actionsImplImportMoz, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() )); KAction* m_actionsImplExportNS = actionCollection()->addAction("exportNS"); m_actionsImplExportNS->setIcon(KIcon("netscape")); m_actionsImplExportNS->setText(i18n("Export &Netscape Bookmarks")); connect(m_actionsImplExportNS, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportNS() )); KAction* m_actionsImplExportOpera = actionCollection()->addAction("exportOpera"); m_actionsImplExportOpera->setIcon(KIcon("opera")); m_actionsImplExportOpera->setText(i18n("Export &Opera Bookmarks...")); connect(m_actionsImplExportOpera, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportOpera() )); KAction* m_actionsImplExportHTML = actionCollection()->addAction("exportHTML"); m_actionsImplExportHTML->setIcon(KIcon("text-html")); m_actionsImplExportHTML->setText(i18n("Export &HTML Bookmarks...")); connect(m_actionsImplExportHTML, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportHTML() )); KAction* m_actionsImplExportIE = actionCollection()->addAction("exportIE"); m_actionsImplExportIE->setText(i18n("Export &Internet Explorer Bookmarks...")); connect(m_actionsImplExportIE, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportIE() )); KAction* m_actionsImplExportMoz = actionCollection()->addAction("exportMoz"); m_actionsImplExportMoz->setIcon(KIcon("mozilla")); m_actionsImplExportMoz->setText(i18n("Export &Mozilla Bookmarks...")); connect(m_actionsImplExportMoz, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportMoz() )); }
void Knmap::createMenu( ) { KStdAction::configureToolbars( this, SLOT( slotConfigureToolbars( )), actionCollection( )); KStdAction::keyBindings( this, SLOT( slotConfigureShortcuts( )), actionCollection( )); KStdAction::quit( kapp, SLOT( quit( )), actionCollection( )); m_fileSaveAction = KStdAction::save( m_mainWidget, SLOT( slotFileSave( )), actionCollection( )); m_fileSaveAsAction = KStdAction::saveAs( m_mainWidget, SLOT( slotFileSaveAs( )), actionCollection( )); m_settingsManAction = new KAction( i18n( "&Use local man page" ), "localman.png", 0, m_mainWidget, SLOT( slotSwitchManPages( )), actionCollection( ), "settings_local" ); m_useTargetHostAction = new KToggleAction( i18n( "Use target host name" ), NULL, 0, m_mainWidget, SLOT( slotUseTargetHost( )), actionCollection( ), "scan_use" ); m_wrapTextAction = new KToggleAction( i18n( "Wrap text" ), NULL, 0, m_mainWidget, SLOT( slotWrapText( )), actionCollection( ), "settings_wrap_text" ); new KAction( i18n( "Close scan" ), "scanclose", CTRL+Key_W, m_mainWidget, SLOT( slotScanClose( )), actionCollection( ), "scan_close" ); new KAction( i18n( "Copy profile..." ), "profilecopy", 0, m_mainWidget, SLOT( slotProfileCopy( )), actionCollection( ), "profile_copy" ); new KAction( i18n( "Delete profile..." ), "profiledelete", 0, m_mainWidget, SLOT( slotProfileDelete( )), actionCollection( ), "profile_delete" ); new KAction( i18n( "Display nmap man page" ), "manpage", 0, m_mainWidget, SLOT( slotShowManPage( )), actionCollection( ), "help_man_page" ); new KAction( i18n( "Duplicate scan" ), "scanduplicate", CTRL+Key_C, m_mainWidget, SLOT( slotScanDuplicate( )), actionCollection( ), "scan_duplicate" ); new KAction( i18n( "Load profile..." ), "profileload", 0, m_mainWidget, SLOT( slotProfileLoad( )), actionCollection( ), "profile_load" ); new KAction( i18n( "man page stylesheet..." ), "manstylesheet", 0, m_mainWidget, SLOT( slotSetStylesheet( )), actionCollection( ), "settings_stylesheet" ); new KAction( i18n( "New scan..." ), "scannew", CTRL+Key_N, m_mainWidget, SLOT( slotScanNew( )), actionCollection( ), "scan_new" ); new KAction( i18n( "Rename profile..." ), "profilerename", 0, m_mainWidget, SLOT( slotProfileRename( )), actionCollection( ), "profile_rename" ); new KAction( i18n( "Rename scan..." ), "scanrename", Key_F2, m_mainWidget, SLOT( slotScanRename( )), actionCollection( ), "scan_rename" ); new KAction( i18n( "Save profile..." ), "profilesave", 0, m_mainWidget, SLOT( slotProfileSave( )), actionCollection( ), "profile_save" ); new KAction( i18n( "Save profile as..." ), "profilesaveas", 0, m_mainWidget, SLOT( slotProfileSaveAs( )), actionCollection( ), "profile_save_as" ); new KAction( i18n( "Zoom custom" ), "zoomcustom", 0, m_mainWidget, SLOT( slotZoomCustom( )), actionCollection( ), "settings_zoom_custom" ); new KAction( i18n( "Zoom in" ), "zoomin", 0, m_mainWidget, SLOT( slotZoomIn( )), actionCollection( ), "settings_zoom_in" ); new KAction( i18n( "Zoom out" ), "zoomout", 0, m_mainWidget, SLOT( slotZoomOut( )), actionCollection( ), "settings_zoom_out" ); m_fileSaveAction->setEnabled( false ); m_fileSaveAsAction->setEnabled( false ); m_wrapTextAction->setChecked( m_mainWidget->wrapText( )); createStandardStatusBarAction( ); setStandardToolBarMenuEnabled( true ); #ifdef _DEBUG createGUI( QDir::homeDirPath( ) + "/.kde/share/apps/knmap/knmapui.rc" ); #else createGUI( ); #endif }
void PMShell::setupActions( ) { // m_helpMenu = new KHelpMenu( this, PMFactory::aboutData( ), true, // actionCollection( ) ); KStdAction::openNew( this, SLOT( slotFileNew( ) ), actionCollection( ) ); KStdAction::open( this, SLOT( slotFileOpen( ) ), actionCollection( ) ); m_pRecent = KStdAction::openRecent( this, SLOT( slotOpenRecent( const KURL& ) ), actionCollection( ) ); KStdAction::save( this, SLOT( slotFileSave( ) ), actionCollection( ) ); KStdAction::saveAs( this, SLOT( slotFileSaveAs( ) ), actionCollection( ) ); KStdAction::revert( this, SLOT( slotFileRevert( ) ), actionCollection( ) ); KStdAction::print( this, SLOT( slotFilePrint( ) ), actionCollection( ) ); KStdAction::close( this, SLOT( slotFileClose( ) ), actionCollection( ) ); KStdAction::quit( this, SLOT( close( ) ), actionCollection( ) ); m_pPathAction = new KToggleAction( i18n( "Show &Path" ), 0, this, SLOT( slotShowPath( ) ), actionCollection( ), "options_show_path" ); m_pPathAction->setCheckedState(i18n("Hide &Path")); m_pStatusbarAction = KStdAction::showStatusbar( this, SLOT( slotShowStatusbar( ) ), actionCollection( ) ); KStdAction::saveOptions( this, SLOT( saveOptions( ) ), actionCollection( ) ); KStdAction::keyBindings( this, SLOT( slotConfigureKeys( ) ), actionCollection( ) ); KStdAction::configureToolbars( this, SLOT( slotConfigureToolbars( ) ), actionCollection( ) ); KStdAction::preferences( this, SLOT( slotSettings( ) ), actionCollection( ) ); m_pNewTopViewAction = new KAction( i18n( "New Top View" ), 0, this, SLOT( slotNewTopView( ) ), actionCollection( ), "view_new_topview" ); m_pNewBottomViewAction = new KAction( i18n( "New Bottom View" ), 0, this, SLOT( slotNewBottomView( ) ), actionCollection( ), "view_new_bottomview" ); m_pNewLeftViewAction = new KAction( i18n( "New Left View" ), 0, this, SLOT( slotNewLeftView( ) ), actionCollection( ), "view_new_leftview" ); m_pNewRightViewAction = new KAction( i18n( "New Right View" ), 0, this, SLOT( slotNewRightView( ) ), actionCollection( ), "view_new_rightview" ); m_pNewFrontViewAction = new KAction( i18n( "New Front View" ), 0, this, SLOT( slotNewFrontView( ) ), actionCollection( ), "view_new_frontview" ); m_pNewBackViewAction = new KAction( i18n( "New Back View" ), 0, this, SLOT( slotNewBackView( ) ), actionCollection( ), "view_new_back_view" ); m_pNewCameraViewAction = new KAction( i18n( "New Camera View" ), 0, this, SLOT( slotNewCameraView( ) ), actionCollection( ), "view_new_cameraview" ); m_pNewTreeViewAction = new KAction( i18n( "New Object Tree" ), 0, this, SLOT( slotNewTreeView( ) ), actionCollection( ), "view_new_treeview" ); m_pNewDialogViewAction = new KAction( i18n( "New Properties View" ), 0, this, SLOT( slotNewDialogView( ) ), actionCollection( ), "view_new_dialogview" ); #ifdef KPM_WITH_OBJECT_LIBRARY m_pNewLibraryBrowserAction = new KAction( i18n( "New Library Browser" ), 0, this, SLOT( slotNewLibraryBrowserView( ) ), actionCollection( ), "view_new_librarybrowser" ); #endif // Creating the view layouts menu m_pViewLayoutsAction = new KActionMenu( i18n( "View Layouts" ), actionCollection( ), "view_layouts_menu" ); KPopupMenu* menu = m_pViewLayoutsAction->popupMenu( ); connect( menu, SIGNAL( aboutToShow( ) ), SLOT( slotViewsMenuAboutToShow( ) ) ); PMViewLayoutManager::theManager( )->fillPopupMenu( menu ); connect( menu, SIGNAL( activated( int ) ), SLOT( slotSelectedLayout( int ) ) ); m_pSaveViewLayoutAction = new KAction( i18n( "Save View Layout..." ), 0, this, SLOT( slotSaveViewLayout( ) ), actionCollection( ), "save_view_layout" ); }