Пример #1
0
void Kandy::setupActions()
{
    KStdAction::open(this, SLOT(fileOpen()), actionCollection());
    KStdAction::save(this, SLOT(fileSave()), actionCollection());
    KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
    //  KStdAction::print(this, SLOT(filePrint()), actionCollection());
    KStdAction::quit(this, SLOT(close()), actionCollection());

    createStandardStatusBarAction();
    setStandardToolBarMenuEnabled(true);

    KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
    KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
    KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());

    new KAction(i18n("Mobile GUI"), 0, this, SLOT(showMobileGui()),
                actionCollection(), "show_mobilegui");

    mConnectAction = new KAction(i18n("Connect"), 0, this, SLOT(modemConnect()),
                                 actionCollection(), "modem_connect");
    mDisconnectAction = new KAction(i18n("Disconnect"), 0, this,
                                    SLOT(modemDisconnect()), actionCollection(),
                                    "modem_disconnect");

    createGUI();
}
Пример #2
0
void KompareShell::setupActions()
{
	QAction *a;
	a = actionCollection()->addAction(KStandardAction::Open, this, SLOT(slotFileOpen()));
	a->setText( i18n( "&Open Diff..." ) );
	a = actionCollection()->addAction("file_compare_files", this, SLOT(slotFileCompareFiles()));
	a->setIcon(QIcon::fromTheme("document-open"));
	a->setText(i18n("&Compare Files..."));
	actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_C));
	a = actionCollection()->addAction("file_blend_url", this, SLOT(slotFileBlendURLAndDiff()));
	a->setText(i18n("&Blend URL with Diff..."));
	actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::Key_B));
	actionCollection()->addAction(KStandardAction::Quit, this, SLOT( slotFileClose() ));

	createStandardStatusBarAction();
	setStandardToolBarMenuEnabled(true);
	m_showTextView = new KToggleAction(i18n("Show T&ext View"), this);
// needs a KGuiItem, also the doc says explicitly not to do this
//	m_showTextView->setCheckedState(i18n("Hide T&ext View"));
	actionCollection()->addAction("options_show_text_view", m_showTextView);
	connect(m_showTextView, SIGNAL(triggered(bool)), SLOT(slotShowTextView()));

	KStandardAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
	KStandardAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
}
Пример #3
0
void kerp::setupActions()
{
    KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
    KStdAction::open(this, SLOT(fileOpen()), actionCollection());
    KStdAction::save(this, SLOT(fileSave()), actionCollection());
    KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
    KStdAction::print(this, SLOT(filePrint()), actionCollection());
    KStdAction::quit(kapp, SLOT(quit()), actionCollection());

    m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
    m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());

    KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
    KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
    KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());

    // this doesn't do anything useful.  it's just here to illustrate
    // how to insert a custom menu and menu item
    KAction *city_action = new KAction(i18n("&City/province"), 0,
                                  this, SLOT(city_action()),
                                  actionCollection(), "city_action");
    KAction *invoice_action=new KAction(i18n("&Invoice"),0,
    					this,SLOT(invoice_action()),
					actionCollection(),"invoice_action");

    KAction * partner_action = new KAction(i18n("&Partner"),0,
    									this,SLOT( partner_action()),
    									actionCollection(),"partner_action");

    createGUI();
}
Пример #4
0
void KXsldbg::setupActions()
{
    KAction *act = KStdAction::quit(kapp, SLOT(quit()), actionCollection());
    connect(act, SIGNAL(activated()), this, SLOT(quit()));

    m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
    m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());

    KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
    KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
}
Пример #5
0
/**
 * setup menu, shortcuts, create GUI
 */
void KLinPopup::setupActions()
{
	KStdAction::quit(this, SLOT(slotQuit()), actionCollection());

	setStandardToolBarMenuEnabled(true);
	createStandardStatusBarAction();

	m_menubarAction = KStdAction::showMenubar(this, SLOT(optionsShowMenubar()), actionCollection());

	KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
	KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
	KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());

	newPopupAction = new KAction(i18n("&New"),
								 "mail_new", CTRL+Key_N,
								 this, SLOT(newPopup()),
								 actionCollection(), "new_popup");
	replyPopupAction = new KAction(i18n("&Reply"),
								   "mail_reply", CTRL+Key_R,
								   this, SLOT(replyPopup()),
								   actionCollection(), "reply_popup");
	firstPopupAction = new KAction(i18n("&First"),
								   "start", CTRL+Key_B,
								   this, SLOT(firstPopup()),
								   actionCollection(), "first_popup");
	prevPopupAction = new KAction(i18n("&Previous"),
								  "back", CTRL+Key_P,
								  this, SLOT(prevPopup()),
								  actionCollection(), "previous_popup");
	nextPopupAction = new KAction(i18n("&Next"),
								  "forward", CTRL+Key_F,
								  this, SLOT(nextPopup()),
								  actionCollection(), "next_popup");
	lastPopupAction = new KAction(i18n("&Last"),
								  "finish", CTRL+Key_L,
								  this, SLOT(lastPopup()),
								  actionCollection(), "last_popup");
	unreadPopupAction = new KAction(i18n("&Unread"),
									"new_popup", CTRL+Key_U,
									this, SLOT(unreadPopup()),
									actionCollection(), "unread_popup");
	deletePopupAction = new KAction(i18n("&Delete"),
									"mail_delete", CTRL+Key_D,
									this, SLOT(deletePopup()),
									actionCollection(), "delete_popup");
	createGUI();
}
Пример #6
0
void KISDNnet::setupActions()
{
    KStdAction::quit(kapp, SLOT(quit()), actionCollection());

    m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
    m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());

    KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
    KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
    KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());

    // this doesn't do anything useful.  it's just here to illustrate
    // how to insert a custom menu and menu item
    m_hardware	= new KAction(i18n("&ISDN Hardware"), "hwinfo", 0, this, SLOT(editHardware()), actionCollection(), "hardware");
	m_newISP	= new KAction(i18n("&New Provider"), "kppp", 0, this, SLOT(newISP()), actionCollection(), "newISP");
    createGUI();
}
Пример #7
0
void k2send::setupActions()
{



    KAction *action;
    KShortcut cut;
    setXMLFile( "k2sendui.rc" );
    KStdAction::openNew(this, SLOT(fileNew()), actionCollection(),"file_new");

    KStdAction::open(this, SLOT(fileOpen()), actionCollection(),"file_open");

    action = new KAction(i18n("Import Playlist"), cut, this, SLOT(importPlaylist()), actionCollection(), "file_import");

    KStdAction::print(this, SLOT(filePrint()), actionCollection(),"file_print");
    KStdAction::quit(kapp, SLOT(quit()), actionCollection(),"file_quit");

    m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
    m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());

    KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
    KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
    KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection(),"preferences");

    action = new KAction(i18n("Remove"), "editdelete", cut, m_view, SLOT(slotRemoveBranch()), actionCollection(), "file_remove");

    action = new KAction(i18n("Play"), "player_play", cut, m_view, SLOT(slotPlay()), actionCollection(), "player_play");
    action = new KAction(i18n("Stop"), "player_stop", cut,m_view, SLOT(slotStop()), actionCollection(), "player_stop");
    action = new KAction(i18n("Next"), "player_fwd", cut,m_view, SLOT(slotSkip()), actionCollection(), "player_next");
    action = new KAction(i18n("Loudness"), 0, cut,m_view, SLOT(slotLoudness()), actionCollection(), "player_loudness");

    action = new KAction(i18n("Clear"), "reload", cut,m_view, SLOT(slotPlaylistClear()), actionCollection(), "playlist_clear");

    action = new KAction(i18n("Play"), "player_play", cut,m_view, SLOT(slotConsolePlay()), actionCollection(), "console_play");
    action = new KAction(i18n("Stop"), "player_stop", cut,m_view, SLOT(slotConsoleStop()), actionCollection(), "console_stop");
    action = new KAction(i18n("Clear"), "reload", cut,m_view, SLOT(slotConsoleClear()), actionCollection(), "console_clear");
    createGUI();



}
Пример #8
0
void Kooka::setupActions()
{

    KStdAction::print(this, SLOT(filePrint()), actionCollection());
    KStdAction::quit(this , SLOT(close()), actionCollection());

    KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), 
actionCollection());
    KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()),
				  actionCollection());
    KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());

    m_view->createDockMenu(actionCollection(), this, "settings_show_docks" );

    /* Image Viewer action Toolbar - OCR, Scaling etc. */
    (void) new KAction(i18n("&OCR Image..."), "ocr", CTRL+Key_O,
		       m_view, SLOT(doOCR()),
		       actionCollection(), "ocrImage" );

    (void) new KAction(i18n("O&CR on Selection..."), "ocr-select", CTRL+Key_C,
		       m_view, SLOT(doOCRonSelection()),
		       actionCollection(), "ocrImageSelect" );

    KAction *act;
    act =  new KAction(i18n("Scale to W&idth"), "scaletowidth", CTRL+Key_I,
		       m_view, SLOT( slIVScaleToWidth()),
		       actionCollection(), "scaleToWidth" );
    m_view->connectViewerAction( act );

    act = new KAction(i18n("Scale to &Height"), "scaletoheight", CTRL+Key_H,
		       m_view, SLOT( slIVScaleToHeight()),
		       actionCollection(), "scaleToHeight" );
    m_view->connectViewerAction( act );

    act = new KAction(i18n("Original &Size"), "scaleorig", CTRL+Key_S,
                      m_view, SLOT( slIVScaleOriginal()),
                      actionCollection(), "scaleOriginal" );
    m_view->connectViewerAction( act );

#ifdef QICONSET_HONOUR_ON_OFF
    /* The Toggleaction does not seem to handle the on/off icon from QIconSet */
    QIconSet lockSet;
    lockSet.setPixmap(BarIcon("lock")  , QIconSet::Automatic, QIconSet::Normal, QIconSet::On );
    lockSet.setPixmap(BarIcon("unlock"), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off);
    act = new KToggleAction ( i18n("Keep &Zoom Setting"), lockSet, CTRL+Key_Z,
                              actionCollection(), "keepZoom" );
#else
    act = new KToggleAction( i18n("Keep &Zoom Setting"), BarIcon("lockzoom"), CTRL+Key_Z,
                             actionCollection(), "keepZoom" );
#endif

    connect( act, SIGNAL( toggled( bool ) ), m_view->getImageViewer(),
             SLOT(setKeepZoom(bool)));

    m_view->connectViewerAction( act );

    /* thumbview and gallery actions */
    act = new KAction(i18n("Set Zoom..."), "viewmag", 0,
		       m_view, SLOT( slIVShowZoomDialog()),
		       actionCollection(), "showZoomDialog" );
    m_view->connectViewerAction( act );

    (void) new KAction(i18n("Create From Selectio&n"), "crop", CTRL+Key_N,
		       m_view, SLOT( slCreateNewImgFromSelection() ),
		       actionCollection(), "createFromSelection" );

    (void) new KAction(i18n("Mirror Image &Vertically"), "mirror-vert", CTRL+Key_V,
		       this, SLOT( slMirrorVertical() ),
		       actionCollection(), "mirrorVertical" );

    (void) new KAction(i18n("&Mirror Image Horizontally"), "mirror-horiz", CTRL+Key_M,
		       this, SLOT( slMirrorHorizontal() ),
		       actionCollection(), "mirrorHorizontal" );

    (void) new KAction(i18n("Mirror Image &Both Directions"), "mirror-both", CTRL+Key_B,
		       this, SLOT( slMirrorBoth() ),
		       actionCollection(), "mirrorBoth" );

    (void) new KAction(i18n("Open Image in &Graphic Application..."), "fileopen", CTRL+Key_G,
		       m_view, SLOT( slOpenCurrInGraphApp() ),
		       actionCollection(), "openInGraphApp" );

    act = new KAction(i18n("&Rotate Image Clockwise"), "rotate_cw", CTRL+Key_R,
		      this, SLOT( slRotateClockWise() ),
		       actionCollection(), "rotateClockwise" );
    m_view->connectViewerAction( act );

    act = new KAction(i18n("Rotate Image Counter-Clock&wise"), "rotate_ccw", CTRL+Key_W,
		       this, SLOT( slRotateCounterClockWise() ),
		       actionCollection(), "rotateCounterClockwise" );
    m_view->connectViewerAction( act );

    act = new KAction(i18n("Rotate Image 180 &Degrees"), "rotate", CTRL+Key_D,
		       this, SLOT( slRotate180() ),
		       actionCollection(), "upsitedown" );
    m_view->connectViewerAction( act );

    /* Gallery actions */
    act = new KAction(i18n("&Create Folder..."), "folder_new", 0,
		      m_view->gallery(), SLOT( slotCreateFolder() ),
		       actionCollection(), "foldernew" );
    m_view->connectGalleryAction( act );

    act = new KAction(i18n("&Save Image..."), "filesave", 0,
		      m_view->gallery(), SLOT( slotExportFile() ),
		       actionCollection(), "saveImage" );
    m_view->connectGalleryAction( act );

    act = new KAction(i18n("&Import Image..."), "inline_image", 0,
		      m_view->gallery(), SLOT( slotImportFile() ),
		       actionCollection(), "importImage" );
    m_view->connectGalleryAction( act );

    act = new KAction(i18n("&Delete Image"), "edittrash", 0,
		      m_view->gallery(), SLOT( slotDeleteItems() ),
		       actionCollection(), "deleteImage" );
    m_view->connectGalleryAction( act );

    act = new KAction(i18n("&Unload Image"), "fileclose", 0,
		      m_view->gallery(), SLOT( slotUnloadItems() ),
		       actionCollection(), "unloadImage" );
    m_view->connectGalleryAction( act );

#if 0
    /* not yet supported actions - coming post 3.1 */
    (void) new KAction(i18n("&Load Scan Parameters"), "bookmark_add", CTRL+Key_L,
                       m_view, SLOT(slLoadScanParams()),
                       actionCollection(), "loadscanparam" );

    (void) new KAction(i18n("Save &Scan Parameters"), "bookmark_add", CTRL+Key_S,
		       m_view, SLOT(slSaveScanParams()),
		       actionCollection(), "savescanparam" );
#endif

    (void) new KAction(i18n("Select Scan Device"), "scanner", 0,
		       m_view, SLOT( slSelectDevice()),
		       actionCollection(), "selectsource" );

    (void) new KAction( i18n("Enable All Warnings && Messages"), 0,
			this,  SLOT(slEnableWarnings()),
			actionCollection(), "enable_msgs");


    m_saveOCRTextAction = new KAction( i18n("Save OCR Res&ult Text"), "filesaveas", CTRL+Key_U,
                                       m_view, SLOT(slSaveOCRResult()),
                                       actionCollection(), "saveOCRResult");
}
        actionCollection()->addAction( "merge_ingredients_action", mergeIngredientsAction );
        connect( mergeIngredientsAction, SIGNAL(triggered(bool)), this, SLOT( mergeSimilarIngredients() ) );

    }

    KAction *action = KStandardAction::openNew( this, SLOT( fileNew() ), actionCollection() );
    action->setText( i18n( "&New Recipe" ) );

    saveAction = KStandardAction::save( this, SLOT( fileSave() ), actionCollection() );

    KStandardAction::quit( kapp, SLOT( quit() ), actionCollection() );

    m_statusbarAction = KStandardAction::showStatusbar( this, SLOT( optionsShowStatusbar() ), actionCollection() );

    KStandardAction::keyBindings( this, SLOT( optionsConfigureKeys() ), actionCollection() );
    KStandardAction::configureToolbars( this, SLOT( optionsConfigureToolbars() ), actionCollection() );
    KStandardAction::preferences( this, SLOT( optionsPreferences() ), actionCollection() );

    importAction = new KAction( this );
    importAction->setText( i18n( "Import from File..." ) );
    importAction->setIcon( KIcon( "document-import" ) );
    importAction->setShortcut( Qt::CTRL + Qt::Key_I );
    actionCollection()->addAction( "import_action" , importAction );
    connect( importAction, SIGNAL(triggered(bool)), this, SLOT( import() ) );

    importDBAction= new KAction( this );
    importDBAction->setText( i18n( "Import from Database..." ) );
    importDBAction->setIcon( KIcon( "document-import" ) );
    actionCollection()->addAction( "import_db_action" , importDBAction );
    connect( importDBAction, SIGNAL(triggered(bool)), this, SLOT( kreDBImport() ) );