Logo Search packages:      
Sourcecode: basket version File versions  Download package

void Container::setupActions (  )  [private]

Basket :

Edit :

Go :

Items :

Insert :

Settings :

Definition at line 843 of file container.cpp.

References askNewBasket(), editItem(), goToPreviousBasket(), insertEmpty(), and toggleMenuBar().

Referenced by Container().

{
      // KActionCollection *ac = actionCollection();
      // KAction           *a;

      m_goBasketsMapper = new QSignalMapper(this);
      connect( m_goBasketsMapper, SIGNAL(mapped(int)), this, SLOT(setCurrentBasket(int)) );

      /** Basket : **************************************************************/

      actNewBasket    = new KAction( i18n("&New..."), "filenew", KStdAccel::shortcut(KStdAccel::New),
                                     this, SLOT(askNewBasket()), actionCollection(), "basket_new" );

      m_actPropBasket = new KAction( i18n("&Properties..."), "misc", "F2",
                                     this, SLOT(propBasket()), actionCollection(), "basket_properties" );
      m_actDelBasket  = new KAction( i18n("&Remove"), "tab_remove", 0,
                                     this, SLOT(delBasket()), actionCollection(), "basket_delete" );
      m_actLockBasket = new KToggleAction( i18n("&Lock"), "encrypted", "Ctrl+L",
                                           this, SLOT(lockBasket()), actionCollection(), "basket_lock" );

      m_actClearStack = new KAction( i18n("&Clear Stack"), "editclear", 0,
                                     this, SLOT(clearCurrentStack()), actionCollection(), "stack_clear" );
      m_actOpenMirror = new KAction( i18n("&Open the Mirrored Folder"), "fileopen", 0,
                                     this, SLOT(openCurrentMirror()), actionCollection(), "mirror_open" );
      /*m_actReloadMirror = KStdAction::redisplay(this, SLOT(reloadCurrentMirror()), actionCollection(), "mirror_reload" );
      m_actReloadMirror->setText(i18n("&Reload Folder Contents"));
      m_actReloadMirror->setShortcut( KStdAccel::shortcut(KStdAccel::Reload) ); // See Bug 85867*/

      new KAction( i18n("&Export to HTML..."), "fileexport", 0,
                   this, SLOT(exportToHTML()), actionCollection(), "basket_export_html" );
      new KAction( i18n("&KNotes"), "knotes", 0,
                   this, SLOT(importKNotes()), actionCollection(), "basket_import_knotes" );
      new KAction( i18n("K&Jots"), "kjots", 0,
                   this, SLOT(importKJots()), actionCollection(), "basket_import_kjots" );
      new KAction( i18n("&Sticky Notes"), "gnome", 0,
                   this, SLOT(importStickyNotes()), actionCollection(), "basket_import_sticky_notes" );

      m_actHideWindow = new KAction( i18n("&Hide Window"), "fileclose", KStdAccel::shortcut(KStdAccel::Close),
                                     this, SLOT(hideOnEscape()), actionCollection(), "window_hide" );
      m_actHideWindow->setEnabled(Settings::useSystray()); // Init here !
      actQuit         = KStdAction::quit( this, SLOT(askForQuit()), actionCollection() );

      /** Edit : ****************************************************************/

      //m_actUndo     = KStdAction::undo(  this, SLOT(undo()),                 actionCollection() );
      //m_actUndo->setEnabled(false); // Not yet implemented !
      //m_actRedo     = KStdAction::redo(  this, SLOT(redo()),                 actionCollection() );
      //m_actRedo->setEnabled(false); // Not yet implemented !

      m_actCutItem  = KStdAction::cut(   this, SLOT(cutItem()),              actionCollection() );
      m_actCopyItem = KStdAction::copy(  this, SLOT(copyItem()),             actionCollection() );
#if KDE_IS_VERSION( 3, 1, 90 ) // KDE 3.2.x
      m_actPaste    = KStdAction::pasteText( this, SLOT(pasteInCurrentBasket()), actionCollection() );
#else
      m_actPaste    = KStdAction::paste(     this, SLOT(pasteInCurrentBasket()), actionCollection() );
#endif
      m_actDelItem  = new KAction( i18n("D&elete"), "editdelete", "Delete",
                                  this, SLOT(delItem()), actionCollection(), "edit_delete" );

      m_actSelectAll = KStdAction::selectAll( this, SLOT( slotSelectAll() ), actionCollection() );
      m_actSelectAll      ->setStatusText( i18n( "Selects all items" ) );
      m_actUnselectAll = new KAction( i18n( "U&nselect All" ), CTRL+Key_U, this, SLOT( slotUnselectAll() ),
                                      actionCollection(), "edit_unselect_all" );
      m_actUnselectAll    ->setStatusText( i18n( "Unselects all selected items" ) );
      m_actInvertSelection = new KAction( i18n( "&Invert Selection" ), CTRL+Key_Asterisk,
                                          this, SLOT( slotInvertSelection() ),
                                          actionCollection(), "edit_invert_selection" );
      m_actInvertSelection->setStatusText( i18n( "Inverts the current selection of items" ) );
      m_actSelectCheckedItems = new KAction( i18n( "Select Chec&ked Items" ), 0,
                                             this, SLOT( slotSelectCheckedItems() ),
                                             actionCollection(), "edit_select_checked_items" );

      m_actShowSearch  = new KToggleAction( i18n("Show Search &Bar"), "find", KStdAccel::shortcut(KStdAccel::Find),
                                             /*this, SLOT(showHideSearchBar()),*/ actionCollection(), "edit_show_search" );
      connect( m_actShowSearch, SIGNAL(toggled(bool)), this, SLOT(showHideSearchBar(bool)) );
      m_actResetSearch = new KAction( i18n( "&Reset Search" ), "locationbar_erase", "Ctrl+R",
                                      this, SLOT( slotResetSearch() ),
                                      actionCollection(), "edit_reset_search" );

      /** Go : ******************************************************************/

      m_actPreviousBasket = KStdAction::back( this, SLOT(goToPreviousBasket()), actionCollection() );
      m_actPreviousBasket->setText(i18n("&Previous Basket"));
      m_actNextBasket     = KStdAction::forward( this, SLOT(goToNextBasket()), actionCollection() );
      m_actNextBasket->setText(i18n("&Next Basket"));

      m_actPrevChecked   = new KAction( i18n("Pre&vious Checked Item"),   "", "",
                                        this, SLOT(goToPreviousCheckedItem()),   actionCollection(), "go_prev_checked"   );
      m_actNextChecked   = new KAction( i18n("Ne&xt Checked Item"),       "", "Ctrl+E",
                                        this, SLOT(goToNextCheckedItem()),       actionCollection(), "go_next_checked"   );
      m_actPrevUnchecked = new KAction( i18n("Previ&ous Unchecked Item"), "", "",
                                        this, SLOT(goToPreviousUncheckedItem()), actionCollection(), "go_prev_unchecked" );
      m_actNextUnchecked = new KAction( i18n("Next &Unchecked Item"),     "", "Ctrl+Shift+E",
                                        this, SLOT(goToNextUncheckedItem()),     actionCollection(), "go_next_unchecked" );

      /** Items : ***************************************************************/

      m_actEditItem         = new KAction( i18n("Verb; not Menu", "&Edit..."), "edit",   "Return",
                                           this, SLOT(editItem()), actionCollection(), "item_edit" );
      m_actEditItemMetaData = new KAction( i18n("Edit &Meta-data..."),         "attach", "Shift+Return",
                                           this, SLOT(editItemMetaData()), actionCollection(), "item_edit_meta_data" );

      m_actOpenItem         = KStdAction::open( this, SLOT(openItem()), actionCollection(), "item_open" );
      m_actOpenItem->setText(i18n("&Open"));
      m_actOpenItem->setShortcut("F9");
      m_actOpenItemWith     = new KAction( i18n("Open &With..."), "fileopen", "Shift+F9",
                                       this, SLOT(openItemWith()), actionCollection(), "item_open_with" );
      m_actSaveItemAs       = KStdAction::saveAs( this, SLOT(saveItemAs()), actionCollection(), "item_save_as" );
//    m_actSaveItemAs->setText("Save &a Copy As...");
      m_actSaveItemAs->setShortcut(KStdAccel::save());

      // FIXME: I don't know if "checkedbox" is part of CrystalSVG icon pack or if it's a KOffice (or other app) icon
      //  "checkmark" could also be used. And if theire is none, "button_ok" is graphically near !
      m_actCheckItems = new KToggleAction( i18n("Chec&k"), "checkedbox", "Ctrl+K",
                                           this, SLOT(checkItem()), actionCollection(), "item_check" );

      m_actMoveOnTop    = new KAction( i18n("Move on &Top"),    "top",    "Ctrl+Shift+Home",
                                       this, SLOT(moveOnTop()),    actionCollection(), "item_move_top" );
      m_actMoveItemUp   = new KAction( i18n("Move &Up"),        "up",     "Ctrl+Shift+Up",
                                       this, SLOT(moveItemUp()),   actionCollection(), "item_move_up" );
      m_actMoveItemDown = new KAction( i18n("Move &Down"),      "down",   "Ctrl+Shift+Down",
                                       this, SLOT(moveItemDown()), actionCollection(), "item_move_down" );
      m_actMoveOnBottom = new KAction( i18n("Move on &Bottom"), "bottom", "Ctrl+Shift+End",
                                       this, SLOT(moveOnBottom()), actionCollection(), "item_move_bottom" );

      /** Insert : **************************************************************/

      QSignalMapper *insertEmptyMapper  = new QSignalMapper(this);
      QSignalMapper *insertWizardMapper = new QSignalMapper(this);
      connect( insertEmptyMapper,  SIGNAL(mapped(int)), this, SLOT(insertEmpty(int))  );
      connect( insertWizardMapper, SIGNAL(mapped(int)), this, SLOT(insertWizard(int)) );

      m_actInsertText   = new KAction( i18n("&Text"),      "text",     "Ctrl+T", actionCollection(), "insert_text"     );
      m_actInsertHtml   = new KAction( i18n("&Rich Text"), "html",     "Ctrl+H", actionCollection(), "insert_html"     );
      m_actInsertLink   = new KAction( i18n("&Link"),      "link",     "Ctrl+Y", actionCollection(), "insert_link"     );
      m_actInsertImage  = new KAction( i18n("&Image"),     "image",    "",       actionCollection(), "insert_image"    );
      m_actInsertColor  = new KAction( i18n("&Color"),     "colorset", "",       actionCollection(), "insert_color"    );
      m_actInsertLauncher=new KAction( i18n("L&auncher"),  "launch",   "",       actionCollection(), "insert_launcher" );

      m_actImportKMenu  = new KAction(i18n("Import &KMenu Launcher..."),"kmenu", "",actionCollection(),"insert_kmenu"      );
      m_actImportIcon   = new KAction( i18n("Im&port an Icon..."),  "icons",     "",actionCollection(),"insert_icon"       );
      m_actLoadFile     = new KAction( i18n("Load From a &File..."),"fileimport","",actionCollection(),"insert_from_file"  );
      //m_actMirrorFile   = new KAction( i18n("&Mirror a File..."),   "wizard",    "",actionCollection(),"insert_mirror_file");

      connect( m_actInsertText,     SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
      connect( m_actInsertHtml,     SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
      connect( m_actInsertImage,    SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
      connect( m_actInsertLink,     SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
      connect( m_actInsertColor,    SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
      connect( m_actInsertLauncher, SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
      insertEmptyMapper->setMapping(m_actInsertText,     Item::Text    );
      insertEmptyMapper->setMapping(m_actInsertHtml,     Item::Html    );
      insertEmptyMapper->setMapping(m_actInsertImage,    Item::Image   );
      insertEmptyMapper->setMapping(m_actInsertLink,     Item::Link    );
      insertEmptyMapper->setMapping(m_actInsertColor,    Item::Color   );
      insertEmptyMapper->setMapping(m_actInsertLauncher, Item::Launcher);

      connect( m_actImportKMenu, SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
      connect( m_actImportIcon,  SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
      connect( m_actLoadFile,    SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
      //connect( m_actMirrorFile,  SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
      insertWizardMapper->setMapping(m_actImportKMenu,  1 );
      insertWizardMapper->setMapping(m_actImportIcon,   2 );
      insertWizardMapper->setMapping(m_actLoadFile,     3 );
      //insertWizardMapper->setMapping(m_actMirrorFile,   4 );

      m_colorPicker = new DesktopColorPicker();
      m_actColorPicker = new KAction( i18n("C&olor From Screen"), "kcolorchooser", "",
                                       this, SLOT(slotColorFromScreen()), actionCollection(), "insert_screen_color" );
      connect( m_colorPicker, SIGNAL(pickedColor(const QColor&)), this, SLOT(colorPicked(const QColor&)) );
      connect( m_colorPicker, SIGNAL(canceledPick()),             this, SLOT(colorPickingCanceled())     );

      m_insertActions.append( m_actInsertText     );
      m_insertActions.append( m_actInsertHtml     );
      m_insertActions.append( m_actInsertLink     );
      m_insertActions.append( m_actInsertImage    );
      m_insertActions.append( m_actInsertColor    );
      m_insertActions.append( m_actImportKMenu    );
      m_insertActions.append( m_actInsertLauncher );
      m_insertActions.append( m_actImportIcon     );
      m_insertActions.append( m_actLoadFile       );
      //m_insertActions.append( m_actMirrorFile     );
      m_insertActions.append( m_actColorPicker    );

      /** Settings : ************************************************************/

      m_actShowMenubar   = KStdAction::showMenubar(   this, SLOT(toggleMenuBar()),   actionCollection());
      m_actShowToolbar   = KStdAction::showToolbar(   this, SLOT(toggleToolBar()),   actionCollection());
    m_actShowStatusbar = KStdAction::showStatusbar( this, SLOT(toggleStatusBar()), actionCollection());

      (void) KStdAction::keyBindings( this, SLOT(showShortcutsSettingsDialog()), actionCollection() );

      actConfigGlobalShortcuts = KStdAction::keyBindings(this, SLOT(showGlobalShortcutsSettingsDialog()),
                                                         actionCollection(), "options_configure_global_keybinding");
      actConfigGlobalShortcuts->setText(i18n("Configure &Global Shortcuts..."));

      (void) KStdAction::configureToolbars(this, SLOT(configureToolbars()), actionCollection() );

      //KAction *actCfgNotifs = KStdAction::configureNotifications(this, SLOT(configureNotifications()), actionCollection() );
      //actCfgNotifs->setEnabled(false); // Not yet implemented !

      actAppConfig = KStdAction::preferences( this, SLOT(showSettingsDialog()), actionCollection() );
}


Generated by  Doxygen 1.6.0   Back to index