Package com.trolltech.qt.gui

Examples of com.trolltech.qt.gui.QAction


   * @param toolBar The toolbar to add the action to.
   * @return The action object.
   */
  private QAction action(String name, String image, Object shortcut,
      String slot, QMenu menu, QToolBar toolBar) {
    QAction a = new QAction(name, this);

    if (image != null)
      a.setIcon(new QIcon(rsrcPath + File.separator + image + ".png"));
    if (menu != null)
      menu.addAction(a);
    if (toolBar != null)
      toolBar.addAction(a);
    if (slot != null)
      a.triggered.connect(this, slot);

    if (shortcut instanceof String)
      a.setShortcut((String) shortcut);
    else if (shortcut instanceof QKeySequence.StandardKey)
      a.setShortcuts((QKeySequence.StandardKey) shortcut);

    return a;
  }
View Full Code Here


      }
      else{
        reachabilityTile = getTile(event);
        QMenu menu = new QMenu();
        QAction action1 = new QAction("Draw Reachability (1 Hop)", this);
        QAction action2 = new QAction("Draw Reachability (2 Hops)", this);
        QAction action3 = new QAction("Draw Reachability (3 Hops)", this);
        QAction action4 = new QAction("Draw Reachability (4 Hops)", this);
        QAction action5 = new QAction("Draw Reachability (5 Hops)", this);
        QAction actionClear = new QAction("Clear Highlighted Tiles", this);
        action1.triggered.connect(this, "menuReachability1()");
        action2.triggered.connect(this, "menuReachability2()");
        action3.triggered.connect(this, "menuReachability3()");
        action4.triggered.connect(this, "menuReachability4()");
        action5.triggered.connect(this, "menuReachability5()");
View Full Code Here

    List<String> colorNames = QColor.colorNames();
    for(int i=0; i<colorNames.size(); i++) {
      QColor color = new QColor(colorNames.get(i));
      QPixmap pix = new QPixmap(new QSize(22, 22));
      pix.fill(color);
      QAction newAction = new QAction(new QIcon(pix), "", parent);
      newAction.setToolTip(colorNames.get(i));
      newAction.setText(colorNames.get(i));
      newAction.hovered.connect(this, "itemHovered()");
      menu.addAction(newAction);
    }
  }
View Full Code Here

    toggleTodo = addAction("todo", tr("To-Do"));
  }
 
 
  private QAction addAction(String config, String name) {
    QAction newAction = new QAction(this);
    newAction.setText(name);
    newAction.setCheckable(true);
    newAction.setChecked(Global.isEditorButtonVisible(config));
    contextMenu.addAction(newAction);
    return newAction;
  }
View Full Code Here

 
  public MainMenuBar(NeverNote p) {
    parent = p;
   
   
    fullReindexAction = new QAction(tr("Reindex Database"), this);
    fullReindexAction.setToolTip(tr("Reindex all notes"));
    fullReindexAction.triggered.connect(parent, "fullReindex()");
    setupShortcut(fullReindexAction, "Tools_Reindex_Database");
       
    printAction = new QAction(tr("Print"), this);
    printAction.setToolTip(tr("Print the current note"));
    printAction.triggered.connect(parent, "printNote()");
    setupShortcut(printAction, "File_Print");
   
    emailAction = new QAction(tr("Email"), this);
    emailAction.setToolTip(tr("Email the current note"));
    emailAction.triggered.connect(parent, "emailNote()");
    setupShortcut(emailAction, "File_Email");
   
    backupAction = new QAction(tr("Backup Database"), this);
    backupAction.setToolTip(tr("Backup the current database"));
    backupAction.triggered.connect(parent, "databaseBackup()");
    setupShortcut(backupAction, "File_Backup");

    restoreAction = new QAction(tr("Restore Database"), this);
    restoreAction.setToolTip(tr("Restore the database from a backup"));
    restoreAction.triggered.connect(parent, "databaseRestore()");
    setupShortcut(restoreAction, "File_Restore");
     
    emptyTrashAction = new QAction(tr("Empty Trash"), this);
    emptyTrashAction.setToolTip(tr("Empty the trash folder"));
    emptyTrashAction.triggered.connect(parent, "emptyTrash()");
    setupShortcut(emptyTrashAction, "File_Empty_Trash");
   
    noteRestoreAction = new QAction(tr("Restore"), this);
    noteRestoreAction.setToolTip(tr("Restore a deleted file from the trash"));
    noteRestoreAction.triggered.connect(parent, "restoreNote()");
    noteRestoreAction.setVisible(false);
    setupShortcut(noteRestoreAction, "File_Note_Restore");
       
    settingsAction = new QAction(tr("Preferences"), this);
    settingsAction.setToolTip(tr("Program settings"));
    settingsAction.triggered.connect(parent, "settings()");
    setupShortcut(settingsAction, "Edit_Preferences");
   
    exitAction = new QAction(tr("Exit"), this);
    exitAction.setToolTip(tr("Close the program"));
    exitAction.triggered.connect(parent, "closeNeverNote()");
    exitAction.setShortcut("Ctrl+Q");
    setupShortcut(exitAction, "File_Exit");
   
    noteAttributes = new QAction(tr("Extended Information"), this);
    noteAttributes.setToolTip(tr("Show/Hide extended note attributes"));
    noteAttributes.triggered.connect(parent, "toggleNoteInformation()");
    noteAttributes.setShortcut("F8");
    setupShortcut(noteAttributes, "View_Extended_Information");
   
    noteReindex = new QAction(tr("Reindex"), this);
    noteReindex.setToolTip(tr("Reindex this note"));
    noteReindex.triggered.connect(parent, "reindexNote()");
    setupShortcut(noteReindex, "File_Note_Reindex");
   
    noteDuplicateAction = new QAction(tr("Duplicate"), this);
    noteDuplicateAction.setToolTip(tr("Duplicate this note"));
    noteDuplicateAction.triggered.connect(parent, "duplicateNote()");
    setupShortcut(noteReindex, "File_Note_Duplicate");
   
    noteMergeAction = new QAction(tr("Merge Notes"), this);
    noteMergeAction.setToolTip(tr("Merge Multiple notes"));
    noteMergeAction.triggered.connect(parent, "mergeNotes()");
    setupShortcut(noteMergeAction, "File_Note_Merge");
   
    noteExportAction = new QAction(tr("Export Selected Notes"), this);
    noteExportAction.setToolTip(tr("Export selected notes"));
    noteExportAction.triggered.connect(parent, "exportNotes()");
    setupShortcut(noteExportAction, "File_Note_Export");
   
    noteCopyAsUrlAction = new QAction(tr("Copy as URL"), this);
    noteCopyAsUrlAction.setToolTip(tr("Copy as URL"));
    noteCopyAsUrlAction.triggered.connect(parent, "copyAsUrlClicked()");
    setupShortcut(noteCopyAsUrlAction, "Note_Copy_As_Url");
   
    noteImportAction = new QAction(tr("Import Notes"), this);
    noteImportAction.setToolTip(tr("Import notes"));
    noteImportAction.triggered.connect(parent, "importNotes()");
    setupShortcut(noteImportAction, "File_Note_Import");
   
    noteAdd = new QAction(tr("Add"), this);
    noteAdd.setToolTip(tr("Add a new note"));
    noteAdd.triggered.connect(parent, "addNote()");
    setupShortcut(noteAdd, "File_Note_Add");
   
    noteTags = new QAction(tr("Modify Tags"), this);
    noteTags.setToolTip(tr("Change the tags assigned to this note"));
    noteTags.triggered.connect(parent.browserWindow, "modifyTags()");
    setupShortcut(noteTags, "File_Note_Modify_Tags");
   
    noteDelete = new QAction(tr("Delete"), this);
    noteDelete.setToolTip(tr("Delete this note"));
    noteDelete.triggered.connect(parent, "deleteNote()");
    setupShortcut(noteDelete, "File_Note_Delete");
 
    editFind = new QAction(tr("Find In Note"), this);
    editFind.setToolTip(tr("Find a string in the current note"));
    editFind.triggered.connect(parent, "findText()");
    setupShortcut(editFind, "Edit_Find_In_Note");
    //editFind.setShortcut("Ctrl+F");
   
    editUndo = new QAction(tr("Undo"), this);
    editUndo.setToolTip(tr("Undo"));
    editUndo.triggered.connect(parent.browserWindow, "undoClicked()")
    setupShortcut(editUndo, "Edit_Undo");
    //editUndo.setShortcut("Ctrl+Z");
   
    editRedo = new QAction(tr("Redo"), this);
    editRedo.setToolTip(tr("Redo"));
    editRedo.triggered.connect(parent.browserWindow, "redoClicked()");
    setupShortcut(editRedo, "Edit_Redo");
    //editRedo.setShortcut("Ctrl+Y");
 
    editCut = new QAction(tr("Cut"), this);
    editCut.setToolTip(tr("Cut"));
    editCut.triggered.connect(parent.browserWindow, "cutClicked()");
    setupShortcut(editCut, "Edit_Cut");
    //editCut.setShortcut("Ctrl+X");
   
    editCopy = new QAction(tr("Copy"), this);
    editCopy.setToolTip(tr("Copy"));
    editCopy.triggered.connect(parent.browserWindow, "copyClicked()");
    setupShortcut(editCopy, "Edit_Copy");
    //editCopy.setShortcut("Ctrl+C");

   
    editPaste = new QAction(tr("Paste"), this);
    editPaste.setToolTip(tr("Paste"));
    editPaste.triggered.connect(parent.browserWindow, "pasteClicked()");
    setupShortcut(editPaste, "Edit_Paste");

    editPasteWithoutFormat = new QAction(tr("Paste Without Formatting"), this);
    editPasteWithoutFormat.setToolTip(tr("Paste Without Formatting"));
    editPasteWithoutFormat.triggered.connect(parent.browserWindow, "pasteWithoutFormattingClicked()");
    setupShortcut(editPasteWithoutFormat, "Edit_Paste_Without_Formatting");
   
    hideNoteList = new QAction(tr("Show Note List"), this);
    hideNoteList.setToolTip(tr("Show/Hide Note List"));
    hideNoteList.triggered.connect(parent, "toggleNoteListWindow()");
    hideNoteList.setCheckable(true);
    hideNoteList.setChecked(true);
    setupShortcut(hideNoteList, "View_Show_Note_List");
   
    hideTags = new QAction(tr("Show Tags"), this);
    hideTags.setToolTip(tr("Show/Hide Tags"));
    hideTags.triggered.connect(parent, "toggleTagWindow()");
    hideTags.setCheckable(true);
    hideTags.setChecked(true);
    setupShortcut(hideTags, "View_Show_Tags");
     
    hideNotebooks = new QAction(tr("Show Notebooks"), this);
    hideNotebooks.setToolTip(tr("Show/Hide Notebooks"));
    hideNotebooks.triggered.connect(parent, "toggleNotebookWindow()");
    hideNotebooks.setCheckable(true);
    hideNotebooks.setChecked(true);
    setupShortcut(hideNotebooks, "View_Show_Notebooks");
   
    hideZoom = new QAction(tr("Show Zoom"), this);
    hideZoom.setToolTip(tr("Show/Hide Zoom"));
    hideZoom.triggered.connect(parent, "toggleZoomWindow()");
    hideZoom.setCheckable(true);
    hideZoom.setChecked(true);
    setupShortcut(hideZoom, "View_Show_Zoom");
   
    hideQuota = new QAction(tr("Show Quota Bar"), this);
    hideQuota.setToolTip(tr("Show/Hide Quota"));
    hideQuota.triggered.connect(parent, "toggleQuotaWindow()");
    hideQuota.setCheckable(true);
    hideQuota.setChecked(true);
    setupShortcut(hideQuota, "View_Show_Quota");
   
    hideSearch = new QAction(tr("Show Search Box"), this);
    hideSearch.setToolTip(tr("Show/Hide Search Box"));
    hideSearch.triggered.connect(parent, "toggleSearchWindow()");
    hideSearch.setCheckable(true);
    hideSearch.setChecked(true);
    setupShortcut(hideSearch, "View_Show_Search");

    wideListView = new QAction(tr("Wide List View"), this);
    wideListView.setToolTip(tr("Wide List View"));
    wideListView.setCheckable(true);
    wideListView.changed.connect(parent, "wideListView()");
    setupShortcut(wideListView, "View_Wide_List");
   
    narrowListView = new QAction(tr("Narrow List View"), this);
    narrowListView.setToolTip(tr("Narrow List View"));
    narrowListView.setCheckable(true);
    narrowListView.changed.connect(parent, "narrowListView()");
    setupShortcut(narrowListView, "View_Narrow_List");
   
    thumbnailView = new QAction(tr("Preview"), this);
    thumbnailView.setToolTip(tr("Preview Notes"));
    thumbnailView.triggered.connect(parent, "thumbnailView()");
    setupShortcut(thumbnailView, "View_Thumbnail");
   
    hideSavedSearches = new QAction(tr("Show Saved Searches"), this);
    hideSavedSearches.setToolTip(tr("Show/Hide Saved Searches"));
    hideSavedSearches.triggered.connect(parent, "toggleSavedSearchWindow()");
    hideSavedSearches.setCheckable(true);
    hideSavedSearches.setChecked(true);
    setupShortcut(hideSavedSearches, "View_Show_SavedSearches");
   
    hideAttributes = new QAction(tr("Show Attribute Searches"), this);
    hideAttributes.setToolTip(tr("Show/Hide Attribute Searches"));
    hideAttributes.triggered.connect(parent, "toggleAttributesWindow()");
    hideAttributes.setCheckable(true);
    hideAttributes.setChecked(true);
    setupShortcut(hideAttributes, "View_Show_Attribute_Searches");

    hideTrash = new QAction(tr("Show Trash"), this);
    hideTrash.setToolTip(tr("Show/Hide Trash Tree"));
    hideTrash.triggered.connect(parent, "toggleTrashWindow()");
    hideTrash.setCheckable(true);
    hideTrash.setChecked(true);
    setupShortcut(hideTrash, "View_Show_Trash");
   

    showEditorBar = new QAction(tr("Show Editor Button Bar"), this);
    showEditorBar.setToolTip(tr("Show/Hide Editor Button Bar"));
    showEditorBar.triggered.connect(parent, "toggleEditorButtonBar()");
    showEditorBar.setCheckable(true);
    showEditorBar.setChecked(true);
    setupShortcut(showEditorBar, "View_Show_Editor_Button_Bar");
   

    hideLeftSide = new QAction(tr("Hide Left Side Panels"), this);
    hideLeftSide.setToolTip(tr("Hide The Entire Left Side"));
    hideLeftSide.triggered.connect(parent, "toggleLeftSide()");
    hideLeftSide.setCheckable(true);
    hideLeftSide.setChecked(false);
    setupShortcut(hideLeftSide, "View_Show_Left_Side");
    //hideLeftSide.setShortcut("F11");
   
    viewSource = new QAction(tr("View Source"), this);
    viewSource.setToolTip(tr("View the source HTML for a note"));
    viewSource.triggered.connect(parent, "viewSource()");
    viewSource.setCheckable(true);
    viewSource.setChecked(false);
    setupShortcut(viewSource, "View_Source");
    //hideLeftSide.setShortcut("F11");

    alignLeftAction = new QAction(tr("Left"), this);
    alignLeftAction.setToolTip(tr("Left Align"));
    alignLeftAction.triggered.connect(parent.browserWindow, "justifyLeftClicked()");
    setupShortcut(alignLeftAction, "Format_Alignment_Left");
    //alignLeftAction.setShortcut("Ctrl+L");
   
    alignRightAction = new QAction(tr("Right"), this);
    alignRightAction.setToolTip(tr("Right Align"));
    alignRightAction.triggered.connect(parent.browserWindow, "justifyRightClicked()");
    setupShortcut(alignRightAction, "Format_Alignment_Right");
    //alignRightAction.setShortcut("Ctrl+R");
   
    alignCenterAction = new QAction(tr("Center"), this);
    alignCenterAction.setToolTip(tr("Center Align"));
    alignCenterAction.triggered.connect(parent.browserWindow, "justifyCenterClicked()");
    setupShortcut(alignCenterAction, "Format_Alignment_Center");
    //alignCenterAction.setShortcut("Ctrl+C");
   
    formatBold = new QAction(tr("Bold"), this);
    formatBold.setToolTip(tr("Bold"));
    formatBold.triggered.connect(parent.browserWindow, "boldClicked()");
    setupShortcut(formatBold, "Format_Bold");
    //formatBold.setShortcut("Ctrl+B");
   
    formatItalic = new QAction(tr("Italic"), this);
    formatItalic.setToolTip(tr("Italic"));
    formatItalic.triggered.connect(parent.browserWindow, "italicClicked()");
    setupShortcut(formatItalic, "Format_Italic");
    //formatItalic.setShortcut("Ctrl+I");
   
    formatUnderline = new QAction(tr("Underline"), this);
    formatUnderline.setToolTip(tr("Underline"));
    formatUnderline.triggered.connect(parent.browserWindow, "underlineClicked()");
    setupShortcut(formatUnderline, "Format_Underline");
//    formatUnderline.setShortcut("Ctrl+U");

   
    formatSuperscript = new QAction(tr("Superscript"), this);
    formatSuperscript.setToolTip(tr("Superscript"));
    formatSuperscript.triggered.connect(parent.browserWindow, "superscriptClicked()");
    setupShortcut(formatSuperscript, "Format_Superscript");


    formatSubscript = new QAction(tr("Subscript"), this);
    formatSubscript.setToolTip(tr("Subscript"));
    formatSubscript.triggered.connect(parent.browserWindow, "subscriptClicked()");
    setupShortcut(formatSubscript, "Format_Subscript");

   
    formatStrikethrough = new QAction(tr("Strikethrough"), this);
    formatStrikethrough.setToolTip(tr("Strikethrough"));
    formatStrikethrough.triggered.connect(parent.browserWindow, "strikethroughClicked()");
    setupShortcut(formatStrikethrough, "Format_Strikethrough");

    horizontalLineAction = new QAction(tr("Horizontal Line"), this);
    horizontalLineAction.setToolTip(tr("Horizontal Line"));
    horizontalLineAction.triggered.connect(parent.browserWindow, "hlineClicked()");
    setupShortcut(horizontalLineAction, "Format_Horizontal_Line");
   
    formatBulletList = new QAction(tr("Bulleted List"), this);
//    formatBulletList.setText(tr("Numbered List"));
    formatBulletList.triggered.connect(parent.browserWindow, "bulletListClicked()");
    setupShortcut(formatBulletList, "Format_List_Bullet");
//    formatBulletList.setShortcut("Ctrl+Shift+B");
   
    formatNumberList = new QAction(tr("Numbered List"), this);
    formatNumberList.setText(tr("Numbered list"));
    formatNumberList.triggered.connect(parent.browserWindow, "numberListClicked()");
    setupShortcut(formatNumberList, "Format_List_Numbered");
//    formatNumberList.setShortcut("Ctrl+Shift+O");

    indentAction = new QAction(tr(">> Increase"), this);
    indentAction.setText(tr(">> Increase"));
    indentAction.triggered.connect(parent.browserWindow, "indentClicked()");
    setupShortcut(indentAction, "Format_Indent_Increase");
    //indentAction.setShortcut("Ctrl+M");

    outdentAction = new QAction(tr("<< Decrease"), this);
    outdentAction.setText(tr("<< Decrease"));
    outdentAction.triggered.connect(parent.browserWindow, "outdentClicked()");
    setupShortcut(outdentAction, "Format_Indent_Decrease");
    //outdentAction.setShortcut("Ctrl+Shift+M");
   
    notebookAddAction = new QAction(tr("Add"), this);
    notebookAddAction.triggered.connect(parent, "addNotebook()");
    setupShortcut(notebookAddAction, "File_Notebook_Add");
   
    notebookEditAction = new QAction(tr("Edit"), this);
    notebookEditAction.setEnabled(false);
    notebookEditAction.triggered.connect(parent, "editNotebook()");
    setupShortcut(notebookEditAction, "File_Notebook_Edit");
   
    notebookDeleteAction = new QAction(tr("Delete"), this);
    notebookDeleteAction.setEnabled(false);
    notebookDeleteAction.triggered.connect(parent, "deleteNotebook()");
    setupShortcut(notebookDeleteAction, "File_Notebook_Delete");
   
    notebookPublishAction = new QAction(tr("Share With The World"), this);
    notebookPublishAction.setEnabled(false);
    notebookPublishAction.setVisible(false);
    notebookPublishAction.triggered.connect(parent, "publishNotebook()");
    setupShortcut(notebookPublishAction, "File_Notebook_Publish");

    notebookShareAction = new QAction(tr("Share With Individuals"), this);
    notebookShareAction.setEnabled(false);
    notebookShareAction.setVisible(false);
    notebookShareAction.triggered.connect(parent, "shareNotebook()");
    setupShortcut(notebookShareAction, "File_Notebook_Share");
   
   
    notebookCloseAction = new QAction(tr("Open/Close Notebooks"), this);
    notebookCloseAction.setEnabled(true);
    notebookCloseAction.triggered.connect(parent, "closeNotebooks()");
    setupShortcut(notebookCloseAction, "File_Notebook_Close");

    notebookIconAction = new QAction(tr("Change Icon"), this);
    notebookIconAction.setEnabled(false);
    notebookIconAction.triggered.connect(parent, "setNotebookIcon()");
    setupShortcut(notebookIconAction, "File_Notebook_Icon");
   
    notebookStackAction = new QAction(tr("Set Stack"), this);
    notebookStackAction.setEnabled(false);
    notebookStackAction.triggered.connect(parent, "stackNotebook()");
    setupShortcut(notebookStackAction, "File_Notebook_Stack");
   
    tagAddAction = new QAction(tr("Add"),this);
    tagAddAction.triggered.connect(parent, "addTag()");
    setupShortcut(tagAddAction, "File_Tag_Add");
   
    tagEditAction = new QAction(tr("Edit"), this);
    tagEditAction.triggered.connect(parent, "editTag()");
    tagEditAction.setEnabled(false);
    setupShortcut(tagEditAction, "File_Tag_Edit");
   
    tagDeleteAction = new QAction(tr("Delete"), this);
    tagDeleteAction.triggered.connect(parent, "deleteTag()");
    tagDeleteAction.setEnabled(false);   
    setupShortcut(tagDeleteAction, "File_Tag_Delete");
       
    tagIconAction = new QAction(tr("Change Icon"), this);
    tagIconAction.triggered.connect(parent, "setTagIcon()");
    tagIconAction.setEnabled(false);   
    setupShortcut(tagIconAction, "File_Tag_Icon");
   
    tagMergeAction = new QAction(tr("Merge Tags"), this);
    tagMergeAction.triggered.connect(parent, "mergeTags()");
    tagMergeAction.setEnabled(false);   
    setupShortcut(tagMergeAction, "File_Tag_Merge");
       
    savedSearchAddAction = new QAction(tr("Add"),this);
    savedSearchAddAction.triggered.connect(parent, "addSavedSearch()");
    setupShortcut(savedSearchAddAction, "File_SavedSearch_Add");
   
    savedSearchEditAction = new QAction(tr("Edit"), this);
    savedSearchEditAction.triggered.connect(parent, "editSavedSearch()");
    savedSearchEditAction.setEnabled(false);
    setupShortcut(savedSearchEditAction, "File_SavedSearch_Edit");
   
    savedSearchDeleteAction = new QAction(tr("Delete"), this);
    savedSearchDeleteAction.triggered.connect(parent, "deleteSavedSearch()");
    savedSearchDeleteAction.setEnabled(false);   
    setupShortcut(savedSearchDeleteAction, "File_SavedSearch_Delete");

    savedSearchIconAction = new QAction(tr("Change Icon"), this);
    savedSearchIconAction.triggered.connect(parent, "setSavedSearchIcon()");
    savedSearchIconAction.setEnabled(false);   
    setupShortcut(savedSearchIconAction, "File_SavedSearch_Icon");   
       
    connectAction = new QAction(tr("Connect"), this);
    connectAction.setToolTip("Connect to Evernote");
    connectAction.triggered.connect(parent, "remoteConnect()");
    setupShortcut(connectAction, "Tools_Connect");
   
    synchronizeAction = new QAction(tr("Synchronize with Evernote"), this);
    synchronizeAction.setToolTip("Delete all local data & get a fresh copy");
    synchronizeAction.triggered.connect(parent, "evernoteSync()");
    synchronizeAction.setEnabled(false);
    setupShortcut(synchronizeAction, "Tools_Synchronize");
    //synchronizeAction.setShortcut("F9");
   
    noteOnlineHistoryAction = new QAction(tr("Note History"), this);
    noteOnlineHistoryAction.triggered.connect(parent, "viewNoteHistory()");
    noteOnlineHistoryAction.setEnabled(false);
    setupShortcut(noteOnlineHistoryAction, "File_Note_History");
   
    selectiveSyncAction = new QAction(tr("Selective Synchronize"), this);
    selectiveSyncAction.setToolTip("Selectively ignore some notes");
    selectiveSyncAction.triggered.connect(parent, "setupSelectiveSync()");
    selectiveSyncAction.setEnabled(false);
    setupShortcut(synchronizeAction, "File_Selective_Sync");
   
   
   
    accountAction = new QAction(tr("Account Information"), this);
    accountAction.setToolTip(tr("Account Information"));
    accountAction.triggered.connect(parent, "accountInformation()");
    setupShortcut(accountAction, "Tools_Account_Information");
   
//    compactAction = new QAction(tr("Compact Database"), this);
//    compactAction.setToolTip(tr("Free unused database space"));
//    compactAction.triggered.connect(parent, "compactDatabase()");
//    setupShortcut(compactAction, "Tools_Compact_Database");

    databaseStatusAction = new QAction(tr("Database Status"), this);
    databaseStatusAction.setToolTip(tr("Show current database information"));
    databaseStatusAction.triggered.connect(parent, "databaseStatus()");
    setupShortcut(databaseStatusAction, "Tools_Database_Status");
   
   
    disableIndexing = new QAction(tr("Disable Note Indexing"), this);
    disableIndexing.setToolTip(tr("Manually Stop Note Indexing"));
    disableIndexing.triggered.connect(parent, "toggleNoteIndexing()");
    disableIndexing.setCheckable(true);
    disableIndexing.setChecked(false);
    setupShortcut(disableIndexing, "Tools_Disable_Note_Indexing");
   
   
    folderImportAction = new QAction(tr("Automatic Folder Importing"), this);
    folderImportAction.setToolTip(tr("Import Files Automatically"));
    folderImportAction.triggered.connect(parent, "folderImport()");
    setupShortcut(folderImportAction, "Tools_Folder_Import");
   
    spellCheckAction = new QAction(tr("Spell Check"), this);
    spellCheckAction.setToolTip(tr("Check for spelling errors"));
    spellCheckAction.triggered.connect(parent.browserWindow, "spellCheckClicked()");
    setupShortcut(spellCheckAction, "Tools_Spell_Check");

    encryptDatabaseAction = new QAction(tr("Encrypt Database"), this);
    encryptDatabaseAction.setToolTip(tr("Encrypt the database upon shutdown"));
    encryptDatabaseAction.triggered.connect(parent, "doDatabaseEncrypt()");
    setupShortcut(encryptDatabaseAction, "Tools_Database_Encrypt");
    if (Global.cipherPassword != null && Global.cipherPassword != "") {
      encryptDatabaseAction.setText("Decrypt Database");
      encryptDatabaseAction.setToolTip("Decrypt the database upon shutdown");
    }
   
    loggerAction = new QAction(tr("Logs"), this);
    loggerAction.setToolTip(tr("Show the detailed application log"));
    loggerAction.triggered.connect(parent, "logger()");
    setupShortcut(loggerAction, "About_Log");
       
    releaseAction = new QAction(tr("Release Notes"), this);
    releaseAction.setToolTip(tr("Release notes"));
    releaseAction.triggered.connect(parent, "releaseNotes()")
    setupShortcut(releaseAction, "About_Release_Notes");
   
    checkForUpdates = new QAction(tr("Check For Updates"), this);
    checkForUpdates.setToolTip(tr("Check for newer versions"));
    checkForUpdates.triggered.connect(parent, "checkForUpdates()");
    setupShortcut(checkForUpdates, "Help_Check_For_Updates");
   
    aboutAction = new QAction(tr("About"), this);
    aboutAction.setToolTip(tr("About NixNote"));
    aboutAction.triggered.connect(parent, "about()");
    setupShortcut(aboutAction, "About_About");
   
    setupMenuBar();
View Full Code Here

    setupToolBar();
    find = new FindDialog();
    find.getOkButton().clicked.connect(this, "doFindText()");
   
    // Setup the tray icon menu bar
    trayShowAction = new QAction(tr("Show/Hide"), this);
    trayExitAction = new QAction(tr("Exit"), this);
    trayAddNoteAction = new QAction(tr("Add Note"), this);
   
    trayExitAction.triggered.connect(this, "closeNeverNote()");
    trayAddNoteAction.triggered.connect(this, "addNote()");
    trayShowAction.triggered.connect(this, "trayToggleVisible()");
   
View Full Code Here

    @Override
  public QMenu createPopupMenu() {
      QMenu contextMenu = super.createPopupMenu();
     
      contextMenu.addSeparator();
      QAction prevAction = addContextAction("prevArrow", tr("Previous Arrow"));
      contextMenu.addAction(prevAction);
      prevAction.triggered.connect(this, "togglePrevArrowButton(Boolean)");

      QAction nextAction = addContextAction("nextArrow", tr("Next Arrow"));
      contextMenu.addAction(nextAction);
      nextAction.triggered.connect(this, "toggleNextArrowButton(Boolean)");

      QAction upAction = addContextAction("upArrow", tr("Up Arrow"));
      contextMenu.addAction(upAction);
      upAction.triggered.connect(this, "toggleUpArrowButton(Boolean)");

      QAction downAction = addContextAction("downArrow", tr("Down Arrow"));
      contextMenu.addAction(downAction);
      downAction.triggered.connect(this, "toggleDownArrowButton(Boolean)");

      QAction synchronizeAction = addContextAction("synchronize", tr("Synchronize"));
      contextMenu.addAction(synchronizeAction);
      synchronizeAction.triggered.connect(this, "toggleSynchronizeButton(Boolean)");

      QAction printAction = addContextAction("print", tr("Print"));
      contextMenu.addAction(printAction);
      printAction.triggered.connect(this, "togglePrintButton(Boolean)");

      QAction tagAction = addContextAction("tag", tr("Tag"));
      contextMenu.addAction(tagAction);
      tagAction.triggered.connect(this, "toggleTagButton(Boolean)");
     
      QAction attributeAction = addContextAction("attribute", tr("Attribute"));
      contextMenu.addAction(attributeAction);
      attributeAction.triggered.connect(this, "toggleAttributeButton(Boolean)");
     
      QAction emailAction = addContextAction("email", tr("Email"));
      contextMenu.addAction(emailAction);
      emailAction.triggered.connect(this, "toggleEmailButton(Boolean)");

      QAction deleteAction = addContextAction("delete", tr("Delete"));
      contextMenu.addAction(deleteAction);
      deleteAction.triggered.connect(this, "toggleDeleteButton(Boolean)");

      QAction newAction = addContextAction("new", tr("Add"));
      contextMenu.addAction(newAction);
      newAction.triggered.connect(this, "toggleNewButton(Boolean)");

      QAction allNotesAction = addContextAction("allNotes", tr("All Notes"));
      contextMenu.addAction(allNotesAction);
      allNotesAction.triggered.connect(this, "toggleAllNotesButton(Boolean)");
     
      QAction searchClearAction = addContextAction("searchClear", tr("Search Clear"));
      contextMenu.addAction(searchClearAction);
      searchClearAction.triggered.connect(this, "toggleSearchClearButton(Boolean)");
     
      return contextMenu;
     
View Full Code Here

     
      return contextMenu;
     
    }
    private QAction addContextAction(String config, String name) {
      QAction newAction = new QAction(this);
    newAction.setText(name);
    newAction.setCheckable(true);
    newAction.setChecked(Global.isToolbarButtonVisible(config));
    return newAction;
    }
View Full Code Here

    setSortIndicatorShown(true);
    setClickable(true);
   
    contextMenu = new QMenu();

    titleAction = new QAction(this);
    titleAction.setText(tr("Title"));
    titleAction.setCheckable(true);
    contextMenu.addAction(titleAction);
   
    createdDateAction = new QAction(this);
    createdDateAction.setText(tr("Date Created"));
    createdDateAction.setCheckable(true);
    contextMenu.addAction(createdDateAction);
   
    changedDateAction = new QAction(this);
    changedDateAction.setText(tr("Date Changed"));
    changedDateAction.setCheckable(true);
    contextMenu.addAction(changedDateAction);
   
    subjectDateAction = new QAction(this);
    subjectDateAction.setText(tr("Subject Date"));
    subjectDateAction.setCheckable(true);
    contextMenu.addAction(subjectDateAction);
   
    tagsAction = new QAction(this);
    tagsAction.setText(tr("Tags"));
    tagsAction.setCheckable(true);
    contextMenu.addAction(tagsAction);
   
    notebookAction = new QAction(this);
    notebookAction.setText(tr("Notebook"));
    notebookAction.setCheckable(true);
    contextMenu.addAction(notebookAction);
   
    synchronizedAction = new QAction(this);
    synchronizedAction.setText(tr("Sync"));
    synchronizedAction.setCheckable(true);
    contextMenu.addAction(synchronizedAction);
   
    authorAction = new QAction(this);
    authorAction.setText(tr("Author"));
    authorAction.setCheckable(true);
    contextMenu.addAction(authorAction);
   
    urlAction = new QAction(this);
    urlAction.setText(tr("Source URL"));
    urlAction.setCheckable(true);
    contextMenu.addAction(urlAction);
   
    thumbnailAction = new QAction(this);
    thumbnailAction.setText(tr("Thumbnail"));
    thumbnailAction.setCheckable(true);
    contextMenu.addAction(thumbnailAction);
   
    pinnedAction = new QAction(this);
    pinnedAction.setText(tr("Pinned"));
    pinnedAction.setCheckable(true);
    contextMenu.addAction(pinnedAction);
   
   
    guidAction = new QAction(this);
    guidAction.setText(tr("Guid"));
    guidAction.setCheckable(true);
    setMouseTracking(true);
    sectionEntered.connect(this, "sectionClicked(Integer)");
   
View Full Code Here

 
  public ExternalBrowserMenuBar(ExternalBrowse p) {
    parent = p;
   
   
    printAction = new QAction(tr("Print"), this);
    printAction.setToolTip(tr("Print the current note"));
    printAction.triggered.connect(parent, "printNote()");
    setupShortcut(printAction, "File_Print");
   
    emailAction = new QAction(tr("Email"), this);
    emailAction.setToolTip(tr("Email the current note"));
    emailAction.triggered.connect(parent, "emailNote()");
    setupShortcut(emailAction, "File_Email");
   
    editFind = new QAction(tr("Find In Note"), this);
    editFind.setToolTip(tr("Find a string in the current note"));
    editFind.triggered.connect(parent, "findText()");
    setupShortcut(editFind, "Edit_Find_In_Note");
    //editFind.setShortcut("Ctrl+F");
   
    editUndo = new QAction(tr("Undo"), this);
    editUndo.setToolTip(tr("Undo"));
    editUndo.triggered.connect(parent.getBrowserWindow(), "undoClicked()")
    setupShortcut(editUndo, "Edit_Undo");
    //editUndo.setShortcut("Ctrl+Z");
   
    editRedo = new QAction(tr("Redo"), this);
    editRedo.setToolTip(tr("Redo"));
    editRedo.triggered.connect(parent.getBrowserWindow(), "redoClicked()");
    setupShortcut(editRedo, "Edit_Redo");
    //editRedo.setShortcut("Ctrl+Y");
 
    editCut = new QAction(tr("Cut"), this);
    editCut.setToolTip(tr("Cut"));
    editCut.triggered.connect(parent.getBrowserWindow(), "cutClicked()");
    setupShortcut(editCut, "Edit_Cut");
    //editCut.setShortcut("Ctrl+X");
   
    editCopy = new QAction(tr("Copy"), this);
    editCopy.setToolTip(tr("Copy"));
    editCopy.triggered.connect(parent.getBrowserWindow(), "copyClicked()");
    setupShortcut(editCopy, "Edit_Copy");
    //editCopy.setShortcut("Ctrl+C");
   
    editPaste = new QAction(tr("Paste"), this);
    editPaste.setToolTip(tr("Paste"));
    editPaste.triggered.connect(parent.getBrowserWindow(), "pasteClicked()");
    setupShortcut(editPaste, "Edit_Paste");

    editPasteWithoutFormat = new QAction(tr("Paste Without Formatting"), this);
    editPasteWithoutFormat.setToolTip(tr("Paste Without Formatting"));
    editPasteWithoutFormat.triggered.connect(parent.getBrowserWindow(), "pasteWithoutFormattingClicked()");
    setupShortcut(editPasteWithoutFormat, "Edit_Paste_Without_Formatting");
   

    alignLeftAction = new QAction(tr("Left"), this);
    alignLeftAction.setToolTip(tr("Left Align"));
    alignLeftAction.triggered.connect(parent.getBrowserWindow(), "justifyLeftClicked()");
    setupShortcut(alignLeftAction, "Format_Alignment_Left");
    //alignLeftAction.setShortcut("Ctrl+L");
   
    alignRightAction = new QAction(tr("Right"), this);
    alignRightAction.setToolTip(tr("Right Align"));
    alignRightAction.triggered.connect(parent.getBrowserWindow(), "justifyRightClicked()");
    setupShortcut(alignRightAction, "Format_Alignment_Right");
    //alignRightAction.setShortcut("Ctrl+R");
   
    alignCenterAction = new QAction(tr("Center"), this);
    alignCenterAction.setToolTip(tr("Center Align"));
    alignCenterAction.triggered.connect(parent.getBrowserWindow(), "justifyCenterClicked()");
    setupShortcut(alignCenterAction, "Format_Alignment_Center");
    //alignCenterAction.setShortcut("Ctrl+C");
   
    formatBold = new QAction(tr("Bold"), this);
    formatBold.setToolTip(tr("Bold"));
    formatBold.triggered.connect(parent.getBrowserWindow(), "boldClicked()");
    setupShortcut(formatBold, "Format_Bold");
    //formatBold.setShortcut("Ctrl+B");
   
    formatItalic = new QAction(tr("Italic"), this);
    formatItalic.setToolTip(tr("Italic"));
    formatItalic.triggered.connect(parent.getBrowserWindow(), "italicClicked()");
    setupShortcut(formatItalic, "Format_Italic");
    //formatItalic.setShortcut("Ctrl+I");
   
    formatUnderline = new QAction(tr("Underline"), this);
    formatUnderline.setToolTip(tr("Underline"));
    formatUnderline.triggered.connect(parent.getBrowserWindow(), "underlineClicked()");
    setupShortcut(formatUnderline, "Format_Underline");
//    formatUnderline.setShortcut("Ctrl+U");

   
    formatSuperscript = new QAction(tr("Superscript"), this);
    formatSuperscript.setToolTip(tr("Superscript"));
    formatSuperscript.triggered.connect(parent.getBrowserWindow(), "superscriptClicked()");
    setupShortcut(formatSuperscript, "Format_Superscript");


    formatSubscript = new QAction(tr("Subscript"), this);
    formatSubscript.setToolTip(tr("Subscript"));
    formatSubscript.triggered.connect(parent.getBrowserWindow(), "subscriptClicked()");
    setupShortcut(formatSubscript, "Format_Subscript");

   
    formatStrikethrough = new QAction(tr("Strikethrough"), this);
    formatStrikethrough.setToolTip(tr("Strikethrough"));
    formatStrikethrough.triggered.connect(parent.getBrowserWindow(), "strikethroughClicked()");
    setupShortcut(formatStrikethrough, "Format_Strikethrough");

    horizontalLineAction = new QAction(tr("Horizontal Line"), this);
    horizontalLineAction.setToolTip(tr("Horizontal Line"));
    horizontalLineAction.triggered.connect(parent.getBrowserWindow(), "hlineClicked()");
    setupShortcut(horizontalLineAction, "Format_Horizontal_Line");
   
    formatBulletList = new QAction(tr("Bulleted List"), this);
//    formatBulletList.setText(tr("Numbered List"));
    formatBulletList.triggered.connect(parent.getBrowserWindow(), "bulletListClicked()");
    setupShortcut(formatBulletList, "Format_List_Bullet");
//    formatBulletList.setShortcut("Ctrl+Shift+B");
   
    formatNumberList = new QAction(tr("Numbered List"), this);
    formatNumberList.setText(tr("Numbered list"));
    formatNumberList.triggered.connect(parent.getBrowserWindow(), "numberListClicked()");
    setupShortcut(formatNumberList, "Format_List_Numbered");
//    formatNumberList.setShortcut("Ctrl+Shift+O");

    indentAction = new QAction(tr(">> Increase"), this);
    indentAction.setText(tr(">> Increase"));
    indentAction.triggered.connect(parent.getBrowserWindow(), "indentClicked()");
    setupShortcut(indentAction, "Format_Indent_Increase");
    //indentAction.setShortcut("Ctrl+M");

    outdentAction = new QAction(tr("<< Decrease"), this);
    outdentAction.setText(tr("<< Decrease"));
    outdentAction.triggered.connect(parent.getBrowserWindow(), "outdentClicked()");
    setupShortcut(outdentAction, "Format_Indent_Decrease");
    //outdentAction.setShortcut("Ctrl+Shift+M");
   
   
    spellCheckAction = new QAction(tr("Spell Check"), this);
    spellCheckAction.setToolTip(tr("Check for spelling errors"));
    spellCheckAction.triggered.connect(parent.getBrowserWindow(), "spellCheckClicked()");
    setupShortcut(spellCheckAction, "Tools_Spell_Check");
   
    setupMenuBar();
View Full Code Here

TOP

Related Classes of com.trolltech.qt.gui.QAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.