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(); }
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(); }
/** * setup menu, shortcuts, create GUI */ void KLinPopup::setupActions() { KStandardAction::quit(this, SLOT(exit()), actionCollection()); setStandardToolBarMenuEnabled(true); createStandardStatusBarAction(); menubarAction = KStandardAction::showMenubar(this, SLOT(optionsShowMenubar(bool)), actionCollection()); menubarAction->setChecked(!menuBar()->isHidden()); KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); autoReplyAction = new KToggleAction(KIcon("mail-reply-all"), i18n("&Autoreply"), this); autoReplyAction->setShortcut(Qt::CTRL+Qt::Key_A); actionCollection()->addAction("auto_reply", autoReplyAction); connect(autoReplyAction, SIGNAL(triggered(bool)), this, SLOT(statusAutoReply())); newPopupAction = new KAction(KIcon("mail-new"), i18n("&New"), this); newPopupAction->setShortcut(Qt::CTRL+Qt::Key_N); actionCollection()->addAction("new_popup", newPopupAction); connect(newPopupAction, SIGNAL(triggered(bool)), this, SLOT(newPopup())); replyPopupAction = new KAction(KIcon("mail-reply-sender"), i18n("&Reply"), this); replyPopupAction->setShortcut(Qt::CTRL+Qt::Key_R); actionCollection()->addAction("reply_popup", replyPopupAction); connect(replyPopupAction, SIGNAL(triggered(bool)), this, SLOT(replyPopup())); firstPopupAction = new KAction(KIcon("arrow-left-double"), i18n("&First"), this); firstPopupAction->setShortcut(Qt::CTRL+Qt::Key_B); actionCollection()->addAction("first_popup", firstPopupAction); connect(firstPopupAction, SIGNAL(triggered(bool)), this, SLOT(firstPopup())); prevPopupAction = new KAction(KIcon("arrow-left"), i18n("&Previous"), this); prevPopupAction->setShortcut(Qt::CTRL+Qt::Key_P); actionCollection()->addAction("previous_popup", prevPopupAction); connect(prevPopupAction, SIGNAL(triggered(bool)), this, SLOT(prevPopup())); nextPopupAction = new KAction(KIcon("arrow-right"), i18n("&Next"), this); nextPopupAction->setShortcut(Qt::CTRL+Qt::Key_F); actionCollection()->addAction("next_popup", nextPopupAction); connect(nextPopupAction, SIGNAL(triggered(bool)), this, SLOT(nextPopup())); lastPopupAction = new KAction(KIcon("arrow-right-double"), i18n("&Last"), this); lastPopupAction->setShortcut(Qt::CTRL+Qt::Key_L); actionCollection()->addAction("last_popup", lastPopupAction); connect(lastPopupAction, SIGNAL(triggered(bool)), this, SLOT(lastPopup())); unreadPopupAction = new KAction(KIcon("new_popup"), i18n("&Unread"), this); unreadPopupAction->setShortcut(Qt::CTRL+Qt::Key_U); actionCollection()->addAction("unread_popup", unreadPopupAction); connect(unreadPopupAction, SIGNAL(triggered(bool)), this, SLOT(unreadPopup())); deletePopupAction = new KAction(KIcon("mail-delete"), i18n("&Delete"), this); deletePopupAction->setShortcut(Qt::CTRL+Qt::Key_D); actionCollection()->addAction("delete_popup", deletePopupAction); connect(deletePopupAction, SIGNAL(triggered(bool)), this, SLOT(deletePopup())); setupGUI(); }
void Korrent::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()); 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 *custom = new KAction(i18n("Cus&tom Menuitem"), 0, this, SLOT(optionsPreferences()), actionCollection(), "custom_action"); }
squeeze::squeeze() : KXmlGuiWindow( ), m_view(new squeezeView(this)), m_printer(0) { setObjectName(QLatin1String("squeeze")); // accept dnd setAcceptDrops(false); // tell the KXmlGuiWindow that this is indeed the main widget setCentralWidget(m_view); // then, setup our actions setupActions(); //Add some widgets to status bar led = new KLed; led->off(); statusBar()->addWidget(led); //FIXME: Que cuando se escriba algo en la barra de status, quede el LED ahi tambien. // add a status bar statusBar()->show(); // Add typical actions and save size/toolbars/statusbar setupGUI(); disableUI(); // allow the view to change the statusbar and caption connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), this, SLOT(changeStatusbar(const QString&))); connect(m_view, SIGNAL(signalChangeCaption(const QString&)), this, SLOT(changeCaption(const QString&))); connect(m_view, SIGNAL(signalDisconnected()), this, SLOT(setDisconnected())); connect(m_view, SIGNAL(signalConnected()), this, SLOT(setConnected())); connect(m_view, SIGNAL(signalShowPrefs()), SLOT(optionsPreferences()) ); connect(m_view, SIGNAL(signalSalir() ), SLOT(salir() )); connect(m_view, SIGNAL(signalShowDbConfig()), this, SLOT(showDBConfigDialog())); connect(m_view, SIGNAL(signalAdminLoggedOn()), this, SLOT(enableUI())); connect(m_view, SIGNAL(signalAdminLoggedOff()), this, SLOT(disableUI())); connect(m_view, SIGNAL(signalSupervisorLoggedOn()), this, SLOT(enableUI())); timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(fixGeom())); timer->setInterval(5000); timer->start(); loadStyle(); }
/** * 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(); }
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(); }
ContainmentShell::ContainmentShell() : KParts::MainWindow( ), m_dialog(0) { setXMLFile("plasma-kpart-shellui.rc"); KAction *action = KStandardAction::quit(qApp, SLOT(quit()), actionCollection()); action = new KAction("&Configure", actionCollection()); connect(action, SIGNAL(triggered()), this, SLOT(optionsPreferences())); actionCollection()->addAction("options_configure", action); // this routine will find and load our Part. it finds the Part by // name which is a bad idea usually.. but it's alright in this // case since our Part is made for this Shell KService::Ptr service = KService::serviceByDesktopPath( "plasma-kpart.desktop" ); if (service) { Plasma::PluginLoader *loader = new TestShellPluginLoader(); m_part = service->createInstance<KParts::ReadOnlyPart>(0, QVariantList() << qVariantFromValue(loader)); if (m_part) { // tell the KParts::MainWindow that this is indeed the main widget setCentralWidget(m_part->widget()); // and integrate the part's GUI with the shell's createGUI(m_part); } else { // For whatever reason the part didn't load KMessageBox::error(this, "Could not instantiate our Part!"); qApp->quit(); } } else { // if we couldn't find our Part, we exit since the Shell by // itself can't do anything useful KMessageBox::error(this, "Could not find our Part!"); qApp->quit(); // we return here, cause qApp->quit() only means "exit the // next time we enter the event loop... return; } // apply the saved mainwindow settings, if any, and ask the mainwindow // to automatically save settings if changed: window size, toolbar // position, icon size, etc. setAutoSaveSettings(); }
void SayayinShell::setupActions() { KStandardAction::openNew(this, SLOT(fileNew()), actionCollection()); KStandardAction::open(this, SLOT(fileOpen()), actionCollection()); KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollection()); KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); KToggleAction* toggleMenu = KStandardAction::showMenubar(this, SLOT(toggleMenu()), actionCollection()); toggleMenu->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_M)); createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); //KStandardAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); //KStandardAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); }
void KVirtual::setupActions() { KStandardAction::openRecent( this, SLOT( fileNew() ), actionCollection() ); KStandardAction::openNew( this, SLOT( fileNew() ), actionCollection() ); KStandardAction::open( this, SLOT( fileOpen() ), actionCollection() ); KStandardAction::save( this, SLOT( fileSave() ), actionCollection() ); KStandardAction::saveAs( this, SLOT( fileSaveAs() ), actionCollection() ); KStandardAction::quit( qApp, SLOT( quit() ), actionCollection() ); KStandardAction::preferences( this, SLOT( optionsPreferences() ), actionCollection() ); // custom menu and menu item - the slot is in the class KVirtualView KAction *runvm = new KAction( KIcon( "run-build" ), i18n( "Start VM" ), this ); actionCollection()->addAction( QLatin1String( "start_vm" ), runvm ); connect( runvm, SIGNAL( triggered( bool ) ), this, SLOT( startVirtual() ) ); KAction *terminatevm = new KAction( KIcon( "dialog-close" ), i18n( "Terminate VM" ), this ); actionCollection()->addAction( QLatin1String( "terminate_vm" ), terminatevm ); connect( terminatevm, SIGNAL( triggered( bool ) ), this, SLOT( terminateVirtual() ) ); KAction *killvm = new KAction( KIcon( "application-exit" ), i18n( "Kill VM" ), this ); actionCollection()->addAction( QLatin1String( "kill_vm" ), killvm ); connect( killvm, SIGNAL( triggered( bool ) ), this, SLOT( killVirtual() ) ); // custom menu and menu item - the slot is in the class KVirtualView KAction *output = new KAction( KIcon( "view-process-system" ), i18n( "Show/Hide Output" ), this ); actionCollection()->addAction( QLatin1String( "toggle_output" ), output ); connect( output, SIGNAL( triggered( bool ) ), m_view, SLOT( toggleOutput() ) ); // custom menu and menu item - the slot is in the class KVirtualView KAction *vdisk = new KAction( KIcon( "document-export-table" ), i18n( "Create a new virtual disk image" ), this ); actionCollection()->addAction( QLatin1String( "new_vdisk" ), vdisk ); connect( vdisk, SIGNAL( triggered( bool ) ), m_create, SLOT( show() ) ); // test: print current config to stdout KAction *test = new KAction( KIcon( "edit-find" ), i18n( "Print config on stdout" ), this ); actionCollection()->addAction( QLatin1String( "test_config" ), test ); connect( test, SIGNAL( triggered( bool ) ), m_options, SLOT( printConfig() ) ); connect( this, SIGNAL( vmStateChanged( uint, bool ) ), m_view, SLOT( setState( uint, bool ) ) ); }
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(); }
void Kard::setupActions() { KStandardAction::quit(this, SLOT(slotQuit()), actionCollection()); KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); m_pFullScreen = KStandardAction::fullScreen( 0, 0, this, actionCollection()); actionCollection()->addAction("full_screen", m_pFullScreen ); connect( m_pFullScreen, SIGNAL( toggled( bool )), this, SLOT( slotUpdateFullScreen( bool ))); m_soundAction = new KToggleAction(i18n("Soun&ds"), actionCollection()); actionCollection()->addAction("sound", m_soundAction ); connect(m_soundAction , SIGNAL(triggered()), this, SLOT(slotToggleSound())); //adding choice of number of cards action m_numAction = new KSelectAction(i18n("View"), actionCollection()); actionCollection()->addAction("num", m_numAction ); connect(m_numAction , SIGNAL(triggered(int)), this, SLOT(setNumber(int))); QStringList nums; nums+=i18np("%1 Card", "%1 Cards", 4); nums+=i18np("%1 Card", "%1 Cards", 8); nums+=i18np("%1 Card", "%1 Cards", 12); nums+=i18np("%1 Card", "%1 Cards", 16); nums+=i18np("%1 Card", "%1 Cards", 20); nums+=i18np("%1 Card", "%1 Cards", 24); m_numAction->setItems(nums); m_numAction->setToolTip( i18n( "Choose the number of cards" ) ); m_numAction->setWhatsThis( i18n( "Choose the level of difficulty by setting the number of cards from 4 (very easy) to 24 (more difficult)" ) ); //adding theme action m_themeAction = new KSelectAction(i18n("Themes"), actionCollection()); actionCollection()->addAction("themes", m_themeAction ); connect(m_themeAction , SIGNAL(triggered(int)), this, SLOT(slotSetTheme(int ))); m_themeAction->setItems(KardThemeFactory::instance()->themeUiList()); m_themeAction->setToolTip( i18n( "Choose the theme for the cards" ) ); m_themeAction->setWhatsThis( i18n( "You can choose here the theme for the backs of the cards" ) ); KStandardAction::fullScreen(this, SLOT(toggleFullScreen()), this, actionCollection()); setupGUI(); }
void Opeke::setupActions() { KStandardAction::openNew ( this, SLOT ( fileNew() ), actionCollection() ); KStandardAction::quit ( qApp, SLOT ( quit() ), actionCollection() ); KStandardAction::save ( this, SLOT ( saveFile() ), actionCollection() ); KStandardAction::open ( this, SLOT ( openFile() ), actionCollection() ); KStandardAction::saveAs ( this, SLOT ( saveFileAs() ), actionCollection() ); KStandardAction::preferences ( this, SLOT ( optionsPreferences() ), actionCollection() ); undoAct = KStandardAction::undo (m_view, SLOT(undo()), actionCollection() ); redoAct = KStandardAction::redo (m_view, SLOT(redo()), actionCollection() ); removeAct = KStandardAction::cut (m_view, SLOT(delBrick()), actionCollection()); removeAct->setShortcut(QKeySequence(Qt::Key_Delete)); removeAct->setText( i18n ("Delete")); removeAct->setEnabled(false); // The action to start building Bricks in OGRE KAction *build = new KAction ( KIcon ( "build" ), i18n ( "Build" ), this ); build->setShortcut(QKeySequence(Qt::Key_B)); actionCollection()->addAction ( QLatin1String ( "build_action" ), build ); connect ( build, SIGNAL ( triggered ( bool ) ), m_view, SLOT ( setBuildMode() ) ); // Start select mode KAction *select = new KAction ( KIcon ( "select" ), i18n ( "S&elect" ), this ); select->setShortcut(QKeySequence(Qt::Key_E)); actionCollection()->addAction ( QLatin1String ( "select_action" ), select ); connect ( select, SIGNAL ( triggered ( bool ) ), m_view, SLOT ( setSelectMode() ) ); // Enable or disable grid KAction *grid = new KAction (KIcon ( "grid" ), i18n ("Toggle &Grid"), this); grid->setShortcut(QKeySequence(Qt::Key_G)); actionCollection()->addAction(QLatin1String("grid_action"), grid); connect (grid, SIGNAL (triggered (bool)), m_view, SLOT (flipGridEnabled() )); // Actions to choose what kind of Brick to build KAction *block = new KAction (KIcon ( "block" ), i18n ("Build B&lock"), this); block->setShortcut(QKeySequence(Qt::Key_L)); actionCollection()->addAction(QLatin1String("block_action"), block); connect (block, SIGNAL (triggered (bool)), m_view, SLOT (changeTypeBlock() )); connect (block, SIGNAL (triggered (bool)), m_view, SLOT (setBuildMode() )); KAction *roof = new KAction (KIcon ( "roof" ), i18n ("Build &Roof"), this); roof->setShortcut(QKeySequence(Qt::Key_R)); actionCollection()->addAction(QLatin1String("roof_action"), roof); connect (roof, SIGNAL (triggered (bool)), m_view, SLOT (changeTypeRoof())); connect (roof, SIGNAL (triggered (bool)), m_view, SLOT (setBuildMode() )); KAction *cylinder = new KAction (KIcon ( "cylinder" ), i18n ("Build &Cylinder"), this); cylinder->setShortcut(QKeySequence(Qt::Key_C)); actionCollection()->addAction(QLatin1String("cylinder_action"), cylinder); connect (cylinder, SIGNAL (triggered (bool)), m_view, SLOT (changeTypeCylinder() )); connect (cylinder, SIGNAL (triggered (bool)), m_view, SLOT (setBuildMode() )); KAction *invCyl = new KAction (KIcon ("invCyl"), i18n ("Build &Inverted Cylinder"), this); invCyl->setShortcut(QKeySequence(Qt::Key_I)); actionCollection()->addAction(QLatin1String("invCyl_action"), invCyl); connect (invCyl, SIGNAL (triggered (bool)), m_view, SLOT (changeTypeInvCyl() )); connect (invCyl, SIGNAL (triggered (bool)), m_view, SLOT (setBuildMode() )); KAction *sphere = new KAction (KIcon ("sphere"), i18n ("Build &Sphere"), this); sphere->setShortcut(QKeySequence(Qt::Key_S)); actionCollection()->addAction(QLatin1String("sphere_action"), sphere); connect (sphere, SIGNAL (triggered (bool)), m_view, SLOT (changeTypeSphere() )); connect (sphere, SIGNAL (triggered (bool)), m_view, SLOT (setBuildMode() )); KAction *cone = new KAction (KIcon ( "cone" ), i18n ("Build Co&ne"), this); cone->setShortcut(QKeySequence(Qt::Key_N)); actionCollection()->addAction(QLatin1String("cone_action"), cone); connect (cone, SIGNAL (triggered (bool)), m_view, SLOT (changeTypeCone() )); connect (cone, SIGNAL (triggered (bool)), m_view, SLOT (setBuildMode() )); KAction *corner = new KAction (KIcon ( "corner" ), i18n ("Build Roof C&orner"), this); corner->setShortcut(QKeySequence(Qt::Key_O)); actionCollection()->addAction(QLatin1String("corner_action"), corner); connect (corner, SIGNAL (triggered (bool)), m_view, SLOT (changeTypeCorner() )); connect (corner, SIGNAL (triggered (bool)), m_view, SLOT (setBuildMode() )); KAction *invrcor = new KAction (KIcon ( "invrcor" ), i18n ("Build In&verted Roof Corner"), this); invrcor->setShortcut(QKeySequence(Qt::Key_V)); actionCollection()->addAction(QLatin1String("invrcor_action"), invrcor); connect (invrcor, SIGNAL (triggered (bool)), m_view, SLOT (changeTypeInvCorner() )); connect (invrcor, SIGNAL (triggered (bool)), m_view, SLOT (setBuildMode() )); KAction *pyramid = new KAction (KIcon ( "pyramid" ), i18n ("Build &Pyramid"), this); pyramid->setShortcut(QKeySequence(Qt::Key_P)); actionCollection()->addAction(QLatin1String("pyramid_action"), pyramid); connect (pyramid, SIGNAL (triggered (bool)), m_view, SLOT (changeTypePyramid() )); connect (pyramid, SIGNAL (triggered (bool)), m_view, SLOT (setBuildMode() )); KAction *snapshot = new KAction (KIcon ("ksnapshot"), i18n ("&Take Screenshot"), this); snapshot->setShortcut(QKeySequence("Ctrl+T")); actionCollection()->addAction(QLatin1String("snapshot_action"), snapshot); connect (snapshot, SIGNAL(triggered(bool)), this, SLOT (saveScreen())); // Reload the field after loading a new file connect ( this, SIGNAL ( reload() ), m_view, SLOT ( update() ) ); connect ( this, SIGNAL ( clear() ), m_view, SLOT ( newScene() ) ); connect ( m_tool, SIGNAL ( colorViewed ( QColor ) ), m_view, SLOT ( viewColor ( QColor ) ) ); connect ( m_tool, SIGNAL ( colorChanged ( QColor ) ), m_view, SLOT ( setColor ( QColor ) ) ); connect ( m_tool, SIGNAL ( planeChanged ( int ) ), m_view, SLOT ( setPlaneZ ( int ) ) ); connect ( m_tool, SIGNAL ( sizeXChanged ( int ) ), m_view, SLOT ( setSizeX ( int ) ) ); connect ( m_tool, SIGNAL ( sizeYChanged ( int ) ), m_view, SLOT ( setSizeY ( int ) ) ); connect ( m_tool, SIGNAL ( sizeZChanged ( int ) ), m_view, SLOT ( setSizeZ ( int ) ) ); connect ( m_view, SIGNAL(planeChanged(int)), m_tool, SLOT(changePlaneZ(int))); connect ( m_view, SIGNAL(undoEmpty(bool)), this, SLOT(undoEnable(bool))); connect ( m_view, SIGNAL(redoEmpty(bool)), this, SLOT(redoEnable(bool))); connect ( m_view, SIGNAL(delEnable(bool)), this, SLOT(removeEnable(bool))); connect ( m_view, SIGNAL(modified()), this, SLOT(fileModified())); connect (m_tool, SIGNAL(rotX()), m_view, SLOT(rotateX())); connect (m_tool, SIGNAL(rotY()), m_view, SLOT(rotateY())); connect (m_tool, SIGNAL(rotZ()), m_view, SLOT(rotateZ())); }
void squeeze::setupActions() { KStandardAction::quit(qApp, SLOT(quit()), actionCollection()); KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); //My actions QAction* loginAction = actionCollection()->addAction( "login" ); loginAction->setText(i18n("Login")); loginAction->setIcon(KIcon("office-address-book")); loginAction->setShortcut(Qt::CTRL+Qt::Key_L); connect(loginAction, SIGNAL(triggered(bool)),m_view, SLOT(login())); QAction* usersBrowseAction = actionCollection()->addAction( "usersBrowse" ); usersBrowseAction->setText(i18n("Users")); usersBrowseAction->setIcon(KIcon("lemon-user")); usersBrowseAction->setShortcut(Qt::CTRL+Qt::Key_U); connect(usersBrowseAction, SIGNAL(triggered(bool)),m_view, SLOT(showUsersPage())); QAction* clientsBrowseAction = actionCollection()->addAction( "clientsBrowse" ); clientsBrowseAction->setText(i18n("Clients")); clientsBrowseAction->setIcon(KIcon("lemon-user"));//TODO:Create an icon for this... clientsBrowseAction->setShortcut(Qt::CTRL+Qt::Key_I); connect(clientsBrowseAction, SIGNAL(triggered(bool)),m_view, SLOT(showClientsPage())); QAction* prodBrowseAction = actionCollection()->addAction( "productsBrowse" ); prodBrowseAction->setText(i18n("Products")); prodBrowseAction->setIcon(KIcon("lemon-box")); prodBrowseAction->setShortcut(Qt::CTRL+Qt::Key_P); connect(prodBrowseAction, SIGNAL(triggered(bool)),m_view, SLOT(showProductsPage())); QAction* measuresBrowseAction = actionCollection()->addAction( "measuresBrowse" ); measuresBrowseAction->setText(i18n("Measures")); measuresBrowseAction->setIcon(KIcon("lemon-ruler")); measuresBrowseAction->setShortcut(Qt::CTRL+Qt::Key_M); connect(measuresBrowseAction, SIGNAL(triggered(bool)),m_view, SLOT(showMeasuresPage())); QAction* categoriesBrowseAction = actionCollection()->addAction( "categoriesBrowse" ); categoriesBrowseAction->setText(i18n("Categories")); categoriesBrowseAction->setIcon(KIcon("lemon-categories")); categoriesBrowseAction->setShortcut(Qt::CTRL+Qt::Key_C); connect(categoriesBrowseAction, SIGNAL(triggered(bool)),m_view, SLOT(showCategoriesPage())); QAction* offersBrowseAction = actionCollection()->addAction( "offersBrowse" ); offersBrowseAction->setText(i18n("Offers")); offersBrowseAction->setIcon(KIcon("lemon-offers")); offersBrowseAction->setShortcut(Qt::CTRL+Qt::Key_O); connect(offersBrowseAction, SIGNAL(triggered(bool)),m_view, SLOT(showOffersPage())); QAction* balancesBrowseAction = actionCollection()->addAction( "balancesBrowse" ); balancesBrowseAction->setText(i18n("Balances")); balancesBrowseAction->setIcon(KIcon("lemonbalance")); balancesBrowseAction->setShortcut(Qt::CTRL+Qt::Key_B); connect(balancesBrowseAction, SIGNAL(triggered(bool)),m_view, SLOT(showBalancesPage())); QAction* cashFlowBrowseAction = actionCollection()->addAction( "cashFlowBrowse" ); cashFlowBrowseAction->setText(i18n("Cash Flow")); cashFlowBrowseAction->setIcon(KIcon("lemon-cashout")); cashFlowBrowseAction->setShortcut(Qt::CTRL+Qt::Key_F); connect(cashFlowBrowseAction, SIGNAL(triggered(bool)),m_view, SLOT(showCashFlowPage())); QAction* transactionsBrowseAction = actionCollection()->addAction( "transactionsBrowse" ); transactionsBrowseAction->setText(i18n("Transactions")); transactionsBrowseAction->setIcon(KIcon("wallet-open")); transactionsBrowseAction->setShortcut(Qt::CTRL+Qt::Key_T); connect(transactionsBrowseAction, SIGNAL(triggered(bool)),m_view, SLOT(showTransactionsPage())); QAction* quickViewPlotsAction = actionCollection()->addAction( "quickViewPlots" ); quickViewPlotsAction->setText(i18n("Quick Plots")); quickViewPlotsAction->setIcon(KIcon("view-statistics")); quickViewPlotsAction->setShortcut(Qt::CTRL+Qt::Key_W); connect(quickViewPlotsAction, SIGNAL(triggered(bool)),m_view, SLOT(showWelcomeGraphs())); QAction* purchaseAction = actionCollection()->addAction( "doPurchase" ); //Alias Check IN purchaseAction->setText(i18n("Purchase")); purchaseAction->setIcon(KIcon("lemon-box")); purchaseAction->setShortcut(Qt::Key_F2); connect(purchaseAction, SIGNAL(triggered(bool)),m_view, SLOT(doPurchase())); QAction* checkOutAction = actionCollection()->addAction( "checkOut" ); checkOutAction->setText(i18n("Check Out")); checkOutAction->setIcon(KIcon("lemon-money"));//TODO:Create an icon for this... checkOutAction->setShortcut(Qt::Key_F3); connect(checkOutAction, SIGNAL(triggered(bool)),m_view, SLOT(doCheckOut())); QAction* stockCorrectionAction = actionCollection()->addAction( "stockCorrection" ); stockCorrectionAction->setText(i18n("Stock Correction")); stockCorrectionAction->setIcon(KIcon("lemon-box"));//TODO:Create an icon for this... stockCorrectionAction->setShortcut(Qt::Key_F4); connect(stockCorrectionAction, SIGNAL(triggered(bool)),m_view, SLOT(stockCorrection())); QAction* reportsAction = actionCollection()->addAction( "reports" ); reportsAction->setText(i18n("Reports")); reportsAction->setIcon(KIcon("lemon-reports")); reportsAction->setShortcut(Qt::Key_F5); connect(reportsAction, SIGNAL(triggered(bool)),m_view, SLOT(showReports())); QAction *action = actionCollection()->addAction( "printEndOfDay" ); action->setText(i18n("Print End of day report")); action->setIcon(KIcon("lemon-reports")); action->setShortcut(Qt::Key_F6); connect(action, SIGNAL(triggered(bool)),m_view, SLOT(printEndOfDay())); action = actionCollection()->addAction( "printEndOfDayGral" ); action->setText(i18n("Print General end of day report")); action->setIcon(KIcon("lemon-reports")); action->setShortcut(Qt::Key_F7); connect(action, SIGNAL(triggered(bool)),m_view, SLOT(printGralEndOfDay())); action = actionCollection()->addAction( "printEndOfMonth" ); action->setText(i18n("Print End of month report")); action->setIcon(KIcon("lemon-reports")); action->setShortcut(Qt::Key_F8); connect(action, SIGNAL(triggered(bool)),m_view, SLOT(printEndOfMonth())); action = actionCollection()->addAction( "printLowStock" ); action->setText(i18n("Print Low stock products")); action->setIcon(KIcon("lemon-reports")); action->setShortcut(Qt::Key_F9); connect(action, SIGNAL(triggered(bool)),m_view, SLOT(printLowStockProducts())); action = actionCollection()->addAction( "printSoldOut" ); action->setText(i18n("Print Sold out products")); action->setIcon(KIcon("lemon-reports")); action->setShortcut(Qt::Key_F10); connect(action, SIGNAL(triggered(bool)),m_view, SLOT(printSoldOutProducts())); action = actionCollection()->addAction( "showSpecialOrders" ); action->setText(i18n("Show Special Orders")); action->setIcon(KIcon("lemon-box")); //FIXME: Create an ICON action->setShortcut(Qt::Key_Insert); connect(action, SIGNAL(triggered(bool)),m_view, SLOT(showSpecialOrders())); action = actionCollection()->addAction( "randomMsgsBrowse" ); action->setText(i18n("Ticket Messages")); action->setIcon(KIcon("lemon-ticket")); action->setShortcut(Qt::CTRL+Qt::Key_M); connect(action, SIGNAL(triggered(bool)),m_view, SLOT(showRandomMsgs())); action = actionCollection()->addAction( "viewLog" ); action->setText(i18n("View Events Log")); action->setIcon(KIcon("view-pim-tasks-pending")); action->setShortcut(Qt::CTRL+Qt::Key_G); connect(action, SIGNAL(triggered(bool)),m_view, SLOT(showLogs())); action = actionCollection()->addAction( "providersBrowse" ); action->setText(i18n("Providers")); action->setIcon(KIcon("lemon-user")); action->setShortcut(Qt::CTRL+Qt::Key_R); connect(action, SIGNAL(triggered(bool)),m_view, SLOT(showProviders())); }
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() ) ); exportAction = new KAction( this );
void lemon::setupActions() { KStandardAction::quit(this, SLOT(salir()), actionCollection()); //KStandardAction::quit(qApp, SLOT(quit()), actionCollection()); KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); //Our actions QAction* loginAction = actionCollection()->addAction( "login" ); loginAction->setText(i18n("Login")); loginAction->setIcon(KIcon("preferences-web-browser-identification")); //identity office-address-book loginAction->setShortcut(Qt::CTRL+Qt::Key_L); connect(loginAction, SIGNAL(triggered(bool)),m_view, SLOT(login())); QAction *corteCajaAction = actionCollection()->addAction("balance"); corteCajaAction->setText(i18nc("Account balance", "Balance")); corteCajaAction->setIcon(KIcon("lemon-balance")); corteCajaAction->setShortcut(Qt::CTRL+Qt::Key_B); connect(corteCajaAction, SIGNAL(triggered(bool)), m_view, SLOT(corteDeCaja())); QAction* enterCodeAction = actionCollection()->addAction( "enterCode" ); enterCodeAction->setText(i18n("Enter Code")); enterCodeAction->setIcon(KIcon("lemon-tag")); enterCodeAction->setShortcut(Qt::Key_F2); connect(enterCodeAction, SIGNAL(triggered(bool)),m_view, SLOT(showEnterCodeWidget())); QAction* searchItemAction = actionCollection()->addAction( "searchItem" ); searchItemAction->setText(i18n("Search Item")); searchItemAction->setIcon(KIcon("edit-find")); searchItemAction->setShortcut(Qt::Key_F3); connect(searchItemAction, SIGNAL(triggered(bool)),m_view, SLOT(showSearchItemWidget())); QAction* delSelectedItemAction = actionCollection()->addAction( "deleteSelectedItem" ); delSelectedItemAction->setText(i18n("Delete Selected Item")); delSelectedItemAction->setIcon(KIcon("lemon-boxcancel")); delSelectedItemAction->setShortcut(QKeySequence::ZoomOut); //Qt::Key_Delete Qt::Key_Control+Qt::Key_Delete QKeySequence::Cut QKeySequence::ZoomOut connect(delSelectedItemAction, SIGNAL(triggered(bool)),m_view, SLOT(deleteSelectedItem())); // ERROR: I dont know why, in my computer, instead of CTRL-Delete, the key assigned is Shift-( // The same for other non-working shortcuts. // Some problem related to different keyboard layout : qDebug()<<"shortcut:"<<delSelectedItemAction->shortcuts(); QAction* finishTransactionAction = actionCollection()->addAction( "finishTransaction" ); finishTransactionAction->setText(i18n("Finish transaction")); finishTransactionAction->setIcon(KIcon("lemon-transaction-accept")); finishTransactionAction->setShortcut(Qt::Key_F12); connect(finishTransactionAction, SIGNAL(triggered(bool)),m_view, SLOT(finishCurrentTransaction())); QAction* cancelTransactionAction = actionCollection()->addAction( "cancelTransaction" ); cancelTransactionAction->setText(i18n("Cancel transaction")); cancelTransactionAction->setIcon(KIcon("lemon-transaction-cancel")); cancelTransactionAction->setShortcut(Qt::Key_F10); connect(cancelTransactionAction, SIGNAL(triggered(bool)),m_view, SLOT(preCancelCurrentTransaction())); QAction* cancelSellAction = actionCollection()->addAction("cancelTicket"); cancelSellAction->setText(i18n("Cancel a ticket")); cancelSellAction->setIcon(KIcon("lemon-ticket-cancel") ); cancelSellAction->setShortcut(Qt::Key_F11); connect(cancelSellAction, SIGNAL(triggered(bool)),m_view, SLOT(askForIdToCancel())); //NOTE: This action is for setting how much money is on the drawer... QAction* startOperationAction = actionCollection()->addAction( "startOperation" ); startOperationAction->setText(i18n("Start Operation")); startOperationAction->setIcon(KIcon("window-new")); startOperationAction->setShortcut(QKeySequence::New); // New Qt::Key_Control+Qt::Key_N connect(startOperationAction, SIGNAL(triggered(bool)),m_view, SLOT(_slotDoStartOperation())); QAction *payFocusAction = actionCollection()->addAction("payFocus"); payFocusAction->setText(i18n("Pay focus")); payFocusAction->setIcon(KIcon("lemon-payfocus")); payFocusAction->setShortcut(Qt::Key_F4); //Qt::Key_Alt + Qt::Key_End connect(payFocusAction, SIGNAL(triggered(bool)),m_view, SLOT(focusPayInput())); QAction *showProdGridAction = actionCollection()->addAction("showProductsGrid"); showProdGridAction->setCheckable(true); showProdGridAction->setText(i18n("Show/Hide Products Grid")); showProdGridAction->setIcon(KIcon("view-split-top-bottom")); showProdGridAction->setShortcut(QKeySequence::Print); connect(showProdGridAction, SIGNAL(toggled(bool)), m_view, SLOT(showProductsGrid(bool))); qDebug()<<"Show Grid shortcut:"<<showProdGridAction->shortcuts(); QAction *showPriceCheckerAction = actionCollection()->addAction("showPriceChecker"); showPriceCheckerAction->setText(i18n("Show Price Checker")); showPriceCheckerAction->setIcon(KIcon("lemon-price-checker")); showPriceCheckerAction->setShortcut(Qt::Key_F9); connect(showPriceCheckerAction, SIGNAL(triggered(bool)), m_view, SLOT(showPriceChecker())); QAction *reprintTicketAction = actionCollection()->addAction("reprintTicket"); reprintTicketAction->setText(i18n("Reprint ticket")); reprintTicketAction->setIcon(KIcon("lemon-print-ticket")); reprintTicketAction->setShortcut(Qt::Key_F5); connect(reprintTicketAction, SIGNAL(triggered(bool)), m_view, SLOT(showReprintTicket())); QAction *cashOutAction = actionCollection()->addAction("cashOut"); cashOutAction->setText(i18n("Cash Out")); cashOutAction->setIcon(KIcon("lemon-cashout")); cashOutAction->setShortcut(Qt::Key_F7); //F7 connect(cashOutAction, SIGNAL(triggered(bool)), m_view, SLOT(cashOut())); QAction *cashAvailableAction = actionCollection()->addAction("cashAvailable"); cashAvailableAction->setText(i18n("Cash in drawer")); cashAvailableAction->setIcon(KIcon("lemon-money")); cashAvailableAction->setShortcut(Qt::Key_F6); connect(cashAvailableAction, SIGNAL(triggered(bool)), m_view, SLOT(cashAvailable())); QAction *cashInAction = actionCollection()->addAction("cashIn"); cashInAction->setText(i18n("Cash In")); cashInAction->setIcon(KIcon("lemon-cashin")); cashInAction->setShortcut(Qt::Key_F8); //F8 connect(cashInAction, SIGNAL(triggered(bool)), m_view, SLOT(cashIn())); QAction *endOfDayAction = actionCollection()->addAction("endOfDay"); endOfDayAction->setText(i18n("End of day report")); endOfDayAction->setIcon(KIcon("go-jump-today")); endOfDayAction->setShortcut(QKeySequence::Close); connect(endOfDayAction, SIGNAL(triggered(bool)), m_view, SLOT(endOfDay())); qDebug()<<"End of day shortcut:"<<endOfDayAction->shortcuts(); setupGUI(); setGeometry(QApplication::desktop()->screenGeometry(this)); if (!Settings::splitterSizes().isEmpty()) m_view->setTheSplitterSizes(Settings::splitterSizes()); }
void lemon::setupActions() { KStandardAction::quit(this, SLOT(salir()), actionCollection()); //KStandardAction::quit(qApp, SLOT(quit()), actionCollection()); KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); //Our actions QAction* loginAction = actionCollection()->addAction( "login" ); loginAction->setText(i18n("Login")); loginAction->setIcon(KIcon("office-address-book")); //identity loginAction->setShortcut(Qt::CTRL+Qt::Key_L); connect(loginAction, SIGNAL(triggered(bool)),m_view, SLOT(login())); QAction *corteCajaAction = actionCollection()->addAction("balance"); corteCajaAction->setText(i18nc("Account balance", "Balance")); corteCajaAction->setIcon(KIcon("lemon-balance")); corteCajaAction->setShortcut(Qt::CTRL+Qt::Key_B); connect(corteCajaAction, SIGNAL(triggered(bool)), m_view, SLOT(doCorteDeCaja())); QAction* enterCodeAction = actionCollection()->addAction( "enterCode" ); enterCodeAction->setText(i18n("Enter Code")); enterCodeAction->setIcon(KIcon("lemon-tag")); enterCodeAction->setShortcut(Qt::Key_F2); connect(enterCodeAction, SIGNAL(triggered(bool)),m_view, SLOT(showEnterCodeWidget())); QAction* searchItemAction = actionCollection()->addAction( "searchItem" ); searchItemAction->setText(i18n("Search Item")); searchItemAction->setIcon(KIcon("edit-find")); searchItemAction->setShortcut(Qt::Key_F3); connect(searchItemAction, SIGNAL(triggered(bool)),m_view, SLOT(showSearchItemWidget())); QAction* delSelectedItemAction = actionCollection()->addAction( "deleteSelectedItem" ); delSelectedItemAction->setText(i18n("Delete Selected Item")); delSelectedItemAction->setIcon(KIcon("lemon-boxcancel")); delSelectedItemAction->setShortcut(QKeySequence::ZoomOut); //Qt::Key_Delete Qt::Key_Control+Qt::Key_Delete QKeySequence::Cut QKeySequence::ZoomOut connect(delSelectedItemAction, SIGNAL(triggered(bool)),m_view, SLOT(deleteSelectedItem())); // ERROR: I dont know why, in my computer, instead of CTRL-Delete, the key assigned is Shift-( // The same for other non-working shortcuts. // Some problem related to different keyboard layout : qDebug()<<"shortcut:"<<delSelectedItemAction->shortcuts(); QAction* finishTransactionAction = actionCollection()->addAction( "finishTransaction" ); finishTransactionAction->setText(i18n("Finish transaction")); finishTransactionAction->setIcon(KIcon("lemon-transaction-accept")); finishTransactionAction->setShortcut(Qt::Key_F12); connect(finishTransactionAction, SIGNAL(triggered(bool)),m_view, SLOT(finishCurrentTransaction())); QAction* cancelTransactionAction = actionCollection()->addAction( "cancelTransaction" ); cancelTransactionAction->setText(i18n("Cancel transaction")); cancelTransactionAction->setIcon(KIcon("lemon-transaction-cancel")); cancelTransactionAction->setShortcut(Qt::Key_F10); connect(cancelTransactionAction, SIGNAL(triggered(bool)),m_view, SLOT(preCancelCurrentTransaction())); QAction* cancelSellAction = actionCollection()->addAction("cancelTicket"); cancelSellAction->setText(i18n("Cancel a ticket")); cancelSellAction->setIcon(KIcon("lemon-ticket-cancel") ); cancelSellAction->setShortcut(Qt::Key_F11); connect(cancelSellAction, SIGNAL(triggered(bool)),m_view, SLOT(askForIdToCancel())); //NOTE: This action is for setting how much money is on the drawer... QAction* startOperationAction = actionCollection()->addAction( "startOperation" ); startOperationAction->setText(i18n("Start Operation")); startOperationAction->setIcon(KIcon("window-new")); startOperationAction->setShortcut(QKeySequence::New); // New Qt::Key_Control+Qt::Key_N connect(startOperationAction, SIGNAL(triggered(bool)),m_view, SLOT(_slotDoStartOperation())); QAction *payFocusAction = actionCollection()->addAction("payFocus"); payFocusAction->setText(i18n("Pay focus")); payFocusAction->setIcon(KIcon("lemon-payfocus")); payFocusAction->setShortcut(Qt::Key_F4); //Qt::Key_Alt + Qt::Key_End connect(payFocusAction, SIGNAL(triggered(bool)),m_view, SLOT(focusPayInput())); QAction *showProdGridAction = actionCollection()->addAction("showProductsGrid"); showProdGridAction->setCheckable(true); showProdGridAction->setText(i18n("Show/Hide Products Grid")); showProdGridAction->setIcon(KIcon("view-split-top-bottom")); showProdGridAction->setShortcut(QKeySequence::Print); connect(showProdGridAction, SIGNAL(toggled(bool)), m_view, SLOT(showProductsGrid(bool))); qDebug()<<"Show Grid shortcut:"<<showProdGridAction->shortcuts(); QAction *showPriceCheckerAction = actionCollection()->addAction("showPriceChecker"); showPriceCheckerAction->setText(i18n("Show Price Checker")); showPriceCheckerAction->setIcon(KIcon("lemon-price-checker")); showPriceCheckerAction->setShortcut(Qt::Key_F9); connect(showPriceCheckerAction, SIGNAL(triggered(bool)), m_view, SLOT(showPriceChecker())); QAction *reprintTicketAction = actionCollection()->addAction("reprintTicket"); reprintTicketAction->setText(i18n("Reprint ticket")); reprintTicketAction->setIcon(KIcon("lemon-print-ticket")); reprintTicketAction->setShortcut(Qt::Key_F5); connect(reprintTicketAction, SIGNAL(triggered(bool)), m_view, SLOT(showReprintTicket())); QAction *cashOutAction = actionCollection()->addAction("cashOut"); cashOutAction->setText(i18n("Cash Out")); cashOutAction->setIcon(KIcon("lemon-cashout")); cashOutAction->setShortcut(Qt::Key_F7); //F7 connect(cashOutAction, SIGNAL(triggered(bool)), m_view, SLOT(cashOut())); QAction *cashAvailableAction = actionCollection()->addAction("cashAvailable"); cashAvailableAction->setText(i18n("Cash in drawer")); cashAvailableAction->setIcon(KIcon("lemon-money")); cashAvailableAction->setShortcut(Qt::Key_F6); connect(cashAvailableAction, SIGNAL(triggered(bool)), m_view, SLOT(cashAvailable())); QAction *cashInAction = actionCollection()->addAction("cashIn"); cashInAction->setText(i18n("Cash In")); cashInAction->setIcon(KIcon("lemon-cashin")); cashInAction->setShortcut(Qt::Key_F8); //F8 connect(cashInAction, SIGNAL(triggered(bool)), m_view, SLOT(cashIn())); QAction *endOfDayAction = actionCollection()->addAction("endOfDay"); endOfDayAction->setText(i18n("End of day report")); endOfDayAction->setIcon(KIcon("go-jump-today")); endOfDayAction->setShortcut(QKeySequence::Close); connect(endOfDayAction, SIGNAL(triggered(bool)), m_view, SLOT(endOfDay())); qDebug()<<"End of day shortcut:"<<endOfDayAction->shortcuts(); QAction *soAction = actionCollection()->addAction("specialOrder"); soAction->setText(i18n("Add Special Order")); soAction->setIcon(KIcon("lemon-box")); soAction->setShortcut(Qt::Key_PageUp); connect(soAction, SIGNAL(triggered(bool)), m_view, SLOT(addSpecialOrder())); qDebug()<<"SpecialOrder shortcut:"<<soAction->shortcuts(); QAction *socAction = actionCollection()->addAction("specialOrderComplete"); socAction->setText(i18n("Complete Special Order")); socAction->setIcon(KIcon("lemon-box")); socAction->setShortcut(Qt::Key_PageDown); connect(socAction, SIGNAL(triggered(bool)), m_view, SLOT(specialOrderComplete())); qDebug()<<"SpecialOrder Complete shortcut:"<<socAction->shortcuts(); QAction *lockAction = actionCollection()->addAction("lockScreen"); lockAction->setText(i18n("Lock Screen")); lockAction->setIcon(KIcon("lemon-box")); //TODO:CREATE ICON! lockAction->setShortcut(Qt::CTRL+Qt::Key_Space); connect(lockAction, SIGNAL(triggered(bool)), m_view, SLOT(lockScreen())); qDebug()<<"LockScreen shortcut:"<<lockAction->shortcuts(); QAction *suspendSaleAction = actionCollection()->addAction("suspendSale"); suspendSaleAction->setText(i18n("Suspend Sale")); suspendSaleAction->setIcon(KIcon("lemon-suspend")); suspendSaleAction->setShortcut(Qt::CTRL+Qt::Key_Backspace); connect(suspendSaleAction, SIGNAL(triggered(bool)), m_view, SLOT( suspendSale() )); qDebug()<<"Suspend Sale shortcut:"<<suspendSaleAction->shortcuts(); QAction *soStatusAction = actionCollection()->addAction("soStatus"); soStatusAction->setText(i18n("Change Special Order Status")); soStatusAction->setIcon(KIcon("lemon-box")); //TODO:CREATE ICON! soStatusAction->setShortcut(Qt::CTRL+Qt::Key_PageUp); connect(soStatusAction, SIGNAL(triggered(bool)), m_view, SLOT( changeSOStatus() )); qDebug()<<"soStatus shortcut:"<<soStatusAction->shortcuts(); QAction *oDiscAction = actionCollection()->addAction("occasionalDiscount"); oDiscAction->setText(i18n("Change Special Order Status")); oDiscAction->setIcon(KIcon("lemon-money")); //TODO:CREATE ICON! oDiscAction->setShortcut(Qt::CTRL+Qt::Key_D); connect(oDiscAction, SIGNAL(triggered(bool)), m_view, SLOT( occasionalDiscount() )); qDebug()<<"occasionalDiscount shortcut:"<<oDiscAction->shortcuts(); QAction *resumeAction = actionCollection()->addAction("resumeSale"); resumeAction->setText(i18n("Resume Sale")); resumeAction->setIcon(KIcon("lemon-resume")); resumeAction->setShortcut(Qt::CTRL+Qt::Key_R); connect(resumeAction, SIGNAL(triggered(bool)), m_view, SLOT( resumeSale() )); qDebug()<<"resumeSale shortcut:"<<resumeAction->shortcuts(); QAction *makeReservationA = actionCollection()->addAction("makeReservation"); makeReservationA->setText(i18n("Reserve Items")); makeReservationA->setIcon(KIcon("lemon-box")); //TODO:CREATE ICON! makeReservationA->setShortcut(Qt::ALT + Qt::Key_R); // Qt::ALT is the left ALT key ( not the Alt Gr ) connect(makeReservationA, SIGNAL(triggered(bool)), m_view, SLOT( reserveItems() )); qDebug()<<"makeReservation shortcut:"<<makeReservationA->shortcuts(); QAction *resumeRAction = actionCollection()->addAction("resumeReservation"); resumeRAction->setText(i18n("Reservations")); resumeRAction->setIcon(KIcon("lemon-box")); //TODO:CREATE ICON! resumeRAction->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_R); connect(resumeRAction, SIGNAL(triggered(bool)), m_view, SLOT( resumeReservation() )); qDebug()<<"Reservations shortcut:"<<resumeRAction->shortcuts(); QAction *showCreditsAction = actionCollection()->addAction("showCredits"); showCreditsAction->setText(i18n("Show Credits")); showCreditsAction->setIcon(KIcon("lemon-credits")); showCreditsAction->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_C); connect(showCreditsAction, SIGNAL(triggered(bool)), m_view, SLOT( showCredits() )); qDebug()<<"ShowCredits shortcut:"<<showCreditsAction->shortcuts(); setupGUI(); //FIXME: SCREEN SIZE setWindowState( windowState() | Qt::WindowFullScreen ); // set //setGeometry(QApplication::desktop()->screenGeometry(this)); if (!Settings::splitterSizes().isEmpty()) m_view->setTheSplitterSizes(Settings::splitterSizes()); if (!Settings::gridSplitterSizes().isEmpty()) m_view->setTheGridSplitterSizes(Settings::gridSplitterSizes()); }
void kdvi::makeMenuBar() { if (menuBar) delete menuBar; menuBar = new KMenuBar( this ); CHECK_PTR( menuBar ); QPopupMenu *p = new QPopupMenu; CHECK_PTR( p ); m_fn = p->insertItem( i18n("&New"), this, SLOT(fileNew()) ); m_fo = p->insertItem( i18n("&Open ..."), this, SLOT(fileOpen()) ); recentmenu = new QPopupMenu; CHECK_PTR( recentmenu ); connect( recentmenu, SIGNAL(activated(int)), SLOT(openRecent(int)) ); m_fr = p->insertItem( i18n("Open &recent"), recentmenu ); m_fp = p->insertItem( i18n("&Print ..."), this, SLOT(filePrint())); m_fx = p->insertItem( i18n("E&xit"), this, SLOT(fileExit())); m_f = p; menuBar->insertItem( i18n("&File"), p, -2 ); p = new QPopupMenu; CHECK_PTR( p ); m_vi = p->insertItem( i18n("Zoom &in"), dviwin, SLOT(prevShrink()) ); m_vo = p->insertItem( i18n("Zoom &out"), dviwin, SLOT(nextShrink()) ); m_vf = p->insertItem( i18n("&Fit to page"), this, SLOT(viewFitPage()) ); m_vw = p->insertItem( i18n("Fit to page &width"), this, SLOT(viewFitPageWidth())); p->insertSeparator(); m_vr = p->insertItem( i18n("&Redraw page"), dviwin, SLOT(drawPage()) ); m_v = p; menuBar->insertItem( i18n("&View"), p, -2 ); p = new QPopupMenu; CHECK_PTR( p ); m_pp = p->insertItem( i18n("&Previous"), dviwin, SLOT(prevPage()) ); m_pn = p->insertItem( i18n("&Next"), dviwin, SLOT(nextPage()) ); m_pf = p->insertItem( i18n("&First"), dviwin, SLOT(firstPage()) ); m_pl = p->insertItem( i18n("&Last"), dviwin, SLOT(lastPage()) ); m_pg = p->insertItem( i18n("&Go to ..."), this, SLOT(pageGoto()) ); m_p = p; menuBar->insertItem( i18n("&Page"), p, -2 ); p = new QPopupMenu; CHECK_PTR( p ); p->setCheckable( TRUE ); m_op = p->insertItem( i18n("&Preferences ..."), this, SLOT(optionsPreferences())); m_ok = p->insertItem( i18n("&Keys ..."), this, SLOT(configKeys())); p->insertSeparator(); m_of = p->insertItem( i18n("Make PK-&fonts"), this, SLOT(toggleMakePK()) ); p->setItemChecked( m_of, makepk ); m_o0 = p->insertItem( i18n("Show PS"), this, SLOT(toggleShowPS())); p->setItemChecked( m_o0, showPS ); m_om = p->insertItem( i18n("Show &Menubar"), this, SLOT(toggleShowMenubar()) ); p->setItemChecked( m_om, !hideMenubar ); m_ob = p->insertItem( i18n("Show &Buttons"), this, SLOT(toggleShowButtons()) ); p->setItemChecked( m_ob, !hideButtons ); m_ot = p->insertItem( i18n("Show Page Lis&t"), this, SLOT(toggleVertToolbar()) ); p->setItemChecked( m_ol, vertToolbar ); m_os = p->insertItem( i18n("Show &Statusbar"), this, SLOT(toggleShowStatusbar()) ); p->setItemChecked( m_os, !hideStatusbar ); m_ol = p->insertItem( i18n("Show Scro&llbars"), this, SLOT(toggleShowScrollbars()) ); p->setItemChecked( m_ol, !hideScrollbars ); m_o = p; menuBar->insertItem( i18n("&Options"), p, -2 ); optionsmenu = p; menuBar->insertSeparator(); QPopupMenu *help = kapp->getHelpMenu(true, QString(i18n("DVI Viewer")) + " " + KDVI_VERSION + i18n("\n\nby Markku Hihnala") + " ([email protected])"); m_h = p; menuBar->insertItem( i18n("&Help"), help ); if ( hideMenubar ) menuBar->hide(); setMenu( menuBar ); }
kdvi::kdvi( char *fname, QWidget *, const char *name ) : KTopLevelWidget( name ) { msg = NULL; ssmenu = NULL; hbl = NULL; prefs = NULL; keys = new KAccel(this); readConfig(); setMinimumSize( 400, 60 ); setCaption( kapp->getCaption() ); tipgroup = new QToolTipGroup( this, "TipGroup" ); connect( tipgroup, SIGNAL(showTip(const char *)), SLOT(showTip(const char *)) ); connect( tipgroup, SIGNAL(removeTip()), SLOT(removeTip()) ); // Create KPanner for toolBar2 and dviwindow kpan = new KPanner( this, "panner", KPanner::O_VERTICAL|KPanner::U_ABSOLUTE, 100); setView( kpan, TRUE ); setFrameBorderWidth( 4 ); kpan->setAbsSeparator( pannerValue ); connect( kpan, SIGNAL(positionChanged()), SLOT(pannerChanged()) ); // Create a dvi window dviwin = new dviWindow( basedpi, mfmode, paper, makepk, kpan->child1(), "dviWindow" ); connect( dviwin, SIGNAL(currentPage(int)), SLOT(setPage(int)) ); connect( dviwin, SIGNAL(shrinkChanged(int)), SLOT(shrinkChanged(int)) ); connect( dviwin, SIGNAL(fileChanged()), SLOT(fileChanged()) ); connect( dviwin, SIGNAL(statusChange(const char *)), SLOT(showTip(const char *)) ); connect( dviwin, SIGNAL(setPoint(QPoint)), SLOT(showPoint(QPoint)) ); // Create a menubar menuBar = NULL; makeMenuBar(); // Create toolbars toolBar = NULL; makeButtons(); makeToolBar2( kpan->child0() ); // Create a statusbar statusBar = NULL; makeStatusBar( i18n("No document") ); // Lay out widgets QBoxLayout *l; l = new QBoxLayout( kpan->child0(), QBoxLayout::LeftToRight ); l->addWidget( toolBar2 ); l->activate(); l = new QBoxLayout( kpan->child1(), QBoxLayout::LeftToRight ); l->addWidget( dviwin ); l->activate(); // Create RMB menu rmbmenu = new QPopupMenu; rmbmenu->setMouseTracking( TRUE ); rmbmenu->connectItem( rmbmenu->insertItem(i18n("Toggle Menubar")), this, SLOT(toggleShowMenubar()) ); rmbmenu->connectItem( rmbmenu->insertItem(i18n("Mark page")), marklist, SLOT(markSelected()) ); rmbmenu->connectItem( rmbmenu->insertItem(i18n("Redraw")), dviwin, SLOT(drawPage()) ); rmbmenu->connectItem( rmbmenu->insertItem(i18n("Preferences ...")), this, SLOT(optionsPreferences()) ); // Bind keys bindKeys(); updateMenuAccel(); // Drag and drop KDNDDropZone * dropZone = new KDNDDropZone( this , DndURL); connect( dropZone, SIGNAL( dropAction( KDNDDropZone *) ), SLOT( dropEvent( KDNDDropZone *) ) ); // Read config options applyPreferences(); selectSmall(); dviwin->installEventFilter( this ); message( "" ); openFile(QString(fname)); }
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"); }
void CloudSync::setupActions() { contextMenu()->addAction(KStandardAction::quit(qApp, SLOT(quit()), actionCollection())); contextMenu()->addAction(KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection())); }