EditorButtonBar::EditorButtonBar(QWidget *parent) :
    QToolBar(parent)
{
    contextMenu = new QMenu();
    undoVisible = contextMenu->addAction(tr("Undo"));
    redoVisible = contextMenu->addAction(tr("Redo"));
    cutVisible  = contextMenu->addAction(tr("Cut"));
    copyVisible = contextMenu->addAction(tr("Copy"));
    pasteVisible = contextMenu->addAction(tr("Paste"));
    removeFormatVisible = contextMenu->addAction(tr("Remove Formatting"));
    boldVisible = contextMenu->addAction(tr("Bold"));
    italicVisible = contextMenu->addAction(tr("Italics"));
    superscriptVisible = contextMenu->addAction(tr("Superscript"));
    subscriptVisible = contextMenu->addAction(tr("Subscript"));
    underlineVisible = contextMenu->addAction(tr("Underline"));
    strikethroughVisible = contextMenu->addAction(tr("Strikethrough"));
    leftJustifyVisible = contextMenu->addAction(tr("Align Left"));
    centerJustifyVisible = contextMenu->addAction(tr("Align Center"));
    rightJustifyVisible = contextMenu->addAction(tr("Align Right"));
    hlineVisible = contextMenu->addAction(tr("Horizontal Line"));
    insertDatetimeVisible = contextMenu->addAction(tr("Insert Date && Time"));
    shiftRightVisible = contextMenu->addAction(tr("Shift Right"));
    shiftLeftVisible = contextMenu->addAction(tr("Shift Left"));
    bulletListVisible = contextMenu->addAction(tr("Bullet List"));
    numberListVisible = contextMenu->addAction(tr("Number List"));
    fontVisible = contextMenu->addAction(tr("Font"));
    fontSizeVisible = contextMenu->addAction(tr("Font Size"));
    fontColorVisible = contextMenu->addAction(tr("Font Color"));
    highlightVisible = contextMenu->addAction(tr("Highlight"));
    todoVisible = contextMenu->addAction(tr("To-do"));
    spellCheckButtonVisible = contextMenu->addAction(tr("Spell Check"));
    insertTableButtonVisible = contextMenu->addAction(tr("Insert Table"));
    htmlEntitiesButtonVisible = contextMenu->addAction(tr("HTML Entities"));

    undoVisible->setCheckable(true);
    redoVisible->setCheckable(true);
    cutVisible->setCheckable(true);
    copyVisible->setCheckable(true);
    pasteVisible->setCheckable(true);
    removeFormatVisible->setCheckable(true);
    boldVisible->setCheckable(true);
    italicVisible->setCheckable(true);
    underlineVisible->setCheckable(true);
    strikethroughVisible->setCheckable(true);
    superscriptVisible->setCheckable(true);
    subscriptVisible->setCheckable(true);
    leftJustifyVisible->setCheckable(true);
    centerJustifyVisible->setCheckable(true);
    rightJustifyVisible->setCheckable(true);
    hlineVisible->setCheckable(true);
    shiftRightVisible->setCheckable(true);
    shiftLeftVisible->setCheckable(true);
    bulletListVisible->setCheckable(true);
    numberListVisible->setCheckable(true);
    todoVisible->setCheckable(true);
    fontColorVisible->setCheckable(true);
    highlightVisible->setCheckable(true);
    fontColorVisible->setCheckable(true);
    fontSizeVisible->setCheckable(true);
    fontVisible->setCheckable(true);
    spellCheckButtonVisible->setCheckable(true);
    spellCheckButtonVisible->setChecked(true);
    insertTableButtonVisible->setCheckable(true);
    htmlEntitiesButtonVisible->setCheckable(true);
    insertDatetimeVisible->setCheckable(true);

    connect(undoVisible, SIGNAL(triggered()), this, SLOT(toggleUndoButtonVisible()));
    connect(redoVisible, SIGNAL(triggered()), this, SLOT(toggleRedoButtonVisible()));
    connect(cutVisible, SIGNAL(triggered()), this, SLOT(toggleCutButtonVisible()));
    connect(copyVisible, SIGNAL(triggered()), this, SLOT(toggleCopyButtonVisible()));
    connect(pasteVisible, SIGNAL(triggered()), this, SLOT(togglePasteButtonVisible()));
    connect(removeFormatVisible, SIGNAL(triggered()), this, SLOT(toggleRemoveFormatVisible()));
    connect(boldVisible, SIGNAL(triggered()), this, SLOT(toggleBoldButtonVisible()));
    connect(italicVisible, SIGNAL(triggered()), this, SLOT(toggleItalicButtonVisible()));
    connect(underlineVisible, SIGNAL(triggered()), this, SLOT(toggleUnderlineButtonVisible()));
    connect(strikethroughVisible, SIGNAL(triggered()), this, SLOT(toggleStrikethroughButtonVisible()));
    connect(superscriptVisible, SIGNAL(triggered()), this, SLOT(toggleSuperscriptButtonVisible()));
    connect(subscriptVisible, SIGNAL(triggered()), this, SLOT(toggleSubscriptButtonVisible()));
    connect(insertDatetimeVisible, SIGNAL(triggered()), this, SLOT(toggleInsertDatetimeVisible()));
    connect(leftJustifyVisible, SIGNAL(triggered()), this, SLOT(toggleLeftJustifyButtonVisible()));
    connect(centerJustifyVisible, SIGNAL(triggered()), this, SLOT(toggleCenterJustifyButtonVisible()));
    connect(rightJustifyVisible, SIGNAL(triggered()), this, SLOT(toggleRightJustifyButtonVisible()));
    connect(hlineVisible, SIGNAL(triggered()), this, SLOT(toggleHlineButtonVisible()));
    connect(shiftRightVisible, SIGNAL(triggered()), this, SLOT(toggleShiftRightButtonVisible()));
    connect(shiftLeftVisible, SIGNAL(triggered()), this, SLOT(toggleShiftLeftButtonVisible()));
    connect(bulletListVisible, SIGNAL(triggered()), this, SLOT(toggleBulletListButtonVisible()));
    connect(numberListVisible, SIGNAL(triggered()), this, SLOT(toggleNumberListButtonVisible()));
    connect(fontVisible, SIGNAL(triggered()), this, SLOT(toggleFontButtonVisible()));
    connect(fontSizeVisible, SIGNAL(triggered()), this, SLOT(toggleFontSizeButtonVisible()));
    connect(todoVisible, SIGNAL(triggered()), this, SLOT(toggleTodoButtonVisible()));
    connect(highlightVisible, SIGNAL(triggered()), this, SLOT(toggleHighlightColorVisible()));
    connect(fontColorVisible, SIGNAL(triggered()), this, SLOT(toggleFontColorVisible()));
    connect(insertTableButtonVisible, SIGNAL(triggered()), this, SLOT(toggleInsertTableButtonVisible()));
    connect(spellCheckButtonVisible, SIGNAL(triggered()), this, SLOT(toggleSpellCheckButtonVisible()));
    connect(htmlEntitiesButtonVisible, SIGNAL(triggered()), this, SLOT(toggleHtmlEntitiesButtonVisible()));


  undoButtonAction = this->addAction(global.getIconResource(":undoIcon"), tr("Undo"));
  undoButtonShortcut = new QShortcut(this);
  setupShortcut(undoButtonShortcut, "Edit_Undo");

  redoButtonAction = this->addAction(global.getIconResource(":redoIcon"), tr("Redo"));
  redoButtonShortcut = new QShortcut(this);
  setupShortcut(redoButtonShortcut, "Edit_Redo");
  redoButtonShortcut->setContext(Qt::WidgetShortcut);

  cutButtonAction = this->addAction(global.getIconResource(":cutIcon"), tr("Cut"));
  cutButtonShortcut = new QShortcut(this);
  setupShortcut(cutButtonShortcut, "Edit_Cut");

  copyButtonAction = this->addAction(global.getIconResource(":copyIcon"), tr("Copy"));
  copyButtonShortcut = new QShortcut(this);
  setupShortcut(copyButtonShortcut, "Edit_Copy");

  pasteButtonAction = this->addAction(global.getIconResource(":pasteIcon"), tr("Paste"));
  //this->setupShortcut(pasteButtonAction, "Edit_Paste");  // This is captured in NWebView via a keyevent statement

  removeFormatButtonAction = this->addAction(global.getIconResource(":eraserIcon"), tr("Remove Formatting"));
  removeFormatButtonShortcut = new QShortcut(this);
  this->setupShortcut(removeFormatButtonShortcut, "Edit_Remove_Formatting");
  QLOG_DEBUG() << removeFormatButtonShortcut->key();

  boldButtonWidget = new QToolButton(this);
  boldButtonWidget->setIcon(global.getIconResource(":boldIcon"));
  boldButtonWidget->setText(tr("Bold"));
  boldButtonAction = this->addWidget(boldButtonWidget);
  boldButtonShortcut = new QShortcut(this);
  this->setupShortcut(boldButtonShortcut, "Format_Bold");

  italicButtonWidget = new QToolButton(this);
  italicButtonWidget->setIcon(global.getIconResource(":italicsIcon"));
  italicButtonWidget->setText(tr("Italics"));
  italicButtonWidget->setToolTip(tr("Italics"));
  italicButtonAction = this->addWidget(italicButtonWidget);
  italicButtonShortcut = new QShortcut(this);
  this->setupShortcut(italicButtonShortcut, "Format_Italic");

  underlineButtonWidget = new QToolButton(this);
  underlineButtonWidget->setIcon(global.getIconResource(":underlineIcon"));
  underlineButtonWidget->setText(tr("Underline"));
  underlineButtonWidget->setToolTip(tr("Underline"));
  underlineButtonAction = this->addWidget(underlineButtonWidget);
  underlineButtonShortcut = new QShortcut(this);
  this->setupShortcut(underlineButtonShortcut, "Format_Underline");

  strikethroughButtonAction = this->addAction(global.getIconResource(":strikethroughIcon"), tr("Strikethrough"));
  strikethroughButtonShortcut = new QShortcut(this);
  this->setupShortcut(strikethroughButtonShortcut, "Format_Strikethrough");

  superscriptButtonAction = this->addAction(global.getIconResource(":superscriptIcon"), tr("Superscript"));
  superscriptButtonShortcut = new QShortcut(this);
  this->setupShortcut(superscriptButtonShortcut, "Format_Superscript");

  subscriptButtonAction = this->addAction(global.getIconResource(":subscriptIcon"), tr("Subscript"));
  subscriptButtonShortcut = new QShortcut(this);
  this->setupShortcut(subscriptButtonShortcut, "Format_Subscript");

  centerJustifyButtonAction = this->addAction(global.getIconResource(":centerAlignIcon"), tr("Center"));
  centerJustifyButtonShortcut = new QShortcut(this);
  this->setupShortcut(centerJustifyButtonShortcut, "Format_Alignment_Center");

  rightJustifyButtonAction = this->addAction(global.getIconResource(":rightAlignIcon"), tr("Right Justify"));
  rightJustifyButtonShortcut = new QShortcut(this);
  this->setupShortcut(rightJustifyButtonShortcut, "Format_Alignment_Right");

  leftJustifyButtonAction = this->addAction(global.getIconResource(":leftAlignIcon"), tr("Left Justify"));
  leftJustifyButtonShortcut = new QShortcut(this);
  this->setupShortcut(leftJustifyButtonShortcut, "Format_Alignment_Left");

  hlineButtonAction = this->addAction(global.getIconResource(":hlineIcon"), tr("Horizontal Line"));
  hlineButtonShortcut = new QShortcut(this);
  this->setupShortcut(hlineButtonShortcut, "Format_Horizontal_Line");

  insertDatetimeButtonWidget = new QToolButton(this);
  insertDatetimeButtonWidget->setIcon(global.getIconResource(":dateTime"));
  insertDatetimeButtonWidget->setText(tr("Insert Date & Time"));
  insertDatetimeButtonWidget->setToolTip(tr("Insert Date & Time"));
  insertDatetimeButtonAction = this->addWidget(insertDatetimeButtonWidget);
  insertDatetimeButtonShortcut = new QShortcut(this);
  insertDatetimeButtonShortcut->setKey(insertDatetimeButtonWidget->shortcut());

  shiftRightButtonAction = this->addAction(global.getIconResource(":shiftRightIcon"), tr("Shift Right"));
  shiftRightButtonShortcut = new QShortcut(this);
  this->setupShortcut(shiftRightButtonShortcut, "Format_Indent_Increase");

  shiftLeftButtonAction = this->addAction(global.getIconResource(":shiftLeftIcon"), tr("Shift Left"));
  shiftLeftButtonShortcut = new QShortcut(this);
  this->setupShortcut(shiftLeftButtonShortcut, "Format_Indent_Decrease");

  bulletListButtonAction = this->addAction(global.getIconResource(":bulletListIcon"), tr("Bullet List"));
  bulletListButtonShortcut = new QShortcut(this);
  this->setupShortcut(bulletListButtonShortcut, "Format_List_Bullet");

  numberListButtonAction = this->addAction(global.getIconResource(":numberListIcon"), tr("Number List"));
  numberListButtonShortcut = new QShortcut(this);
  this->setupShortcut(numberListButtonShortcut, "Format_List_Numbered");

  fontNames = new FontNameComboBox(this);
  fontSizes = new FontSizeComboBox(this);

  loadFontNames();
  fontButtonAction = addWidget(fontNames);
  fontSizeButtonAction = addWidget(fontSizes);

  fontColorMenuWidget = new ColorMenu();
  fontColorButtonWidget = new QToolButton(this);
  fontColorButtonWidget->setAutoRaise(false);
  fontColorButtonWidget->setMenu(fontColorMenuWidget->getMenu());
  fontColorButtonWidget->setIcon(global.getIconResource(":fontColorIcon"));
  fontColorButtonWidget->setToolTip(tr("Font Color"));
  fontColorAction = this->addWidget(fontColorButtonWidget);

  highlightColorMenuWidget = new ColorMenu();
  highlightColorMenuWidget->setDefault(Qt::yellow);
  highlightColorButtonWidget = new QToolButton(this);
  highlightColorButtonWidget->setAutoRaise(false);
  highlightColorButtonWidget->setMenu(highlightColorMenuWidget->getMenu());
  highlightColorButtonWidget->setIcon(global.getIconResource(":fontHighlightIcon"));
  highlightColorButtonWidget->setToolTip(tr("Highlight"));
  highlightColorAction = this->addWidget(highlightColorButtonWidget);
  highlightColorShortcut = new QShortcut(this);
  this->setupShortcut(highlightColorShortcut, "Format_Highlight");

  todoButtonAction = this->addAction(global.getIconResource(":todoIcon"), tr("Todo"));
  todoButtonShortcut = new QShortcut(this);
  this->setupShortcut(todoButtonShortcut, "Edit_Insert_Todo");

  spellCheckButtonAction = this->addAction(global.getIconResource(":spellCheckIcon"), tr("Spell Check"));
  spellCheckButtonShortcut = new QShortcut(this);
  this->setupShortcut(spellCheckButtonShortcut, "Tools_Spell_Check");

  insertTableButtonAction = this->addAction(global.getIconResource(":gridIcon"), tr("Insert Table"));
  insertTableButtonShortcut = new QShortcut(this);
  this->setupShortcut(insertTableButtonShortcut, "Edit_Insert_Table");

  htmlEntitiesButtonAction = this->addAction(global.getIconResource(":htmlentitiesIcon"), tr("Insert HTML Entities"));
  htmlEntitiesButtonShortcut = new QShortcut(this);
  setupShortcut(htmlEntitiesButtonShortcut, "Edit_Insert_Html_Entities");
  htmlEntitiesButtonShortcut->setContext(Qt::WidgetShortcut);
}
Beispiel #2
0
EditorButtonBar::EditorButtonBar(QWidget *parent) :
    QToolBar(parent)
{
    contextMenu = new QMenu();
    undoVisible = contextMenu->addAction(tr("Undo"));
    redoVisible = contextMenu->addAction(tr("Redo"));
    cutVisible  = contextMenu->addAction(tr("Cut"));
    copyVisible = contextMenu->addAction(tr("Copy"));
    pasteVisible = contextMenu->addAction(tr("Paste"));
    removeFormatVisible = contextMenu->addAction(tr("Remove Formatting"));
    boldVisible = contextMenu->addAction(tr("Bold"));
    italicVisible = contextMenu->addAction(tr("Italics"));
    underlineVisible = contextMenu->addAction(tr("Underline"));
    strikethroughVisible = contextMenu->addAction(tr("Strikethrough"));
    leftJustifyVisible = contextMenu->addAction(tr("Align Left"));
    centerJustifyVisible = contextMenu->addAction(tr("Align Center"));
    rightJustifyVisible = contextMenu->addAction(tr("Align Right"));
    hlineVisible = contextMenu->addAction(tr("Horizontal Line"));
    shiftRightVisible = contextMenu->addAction(tr("Shift Right"));
    shiftLeftVisible = contextMenu->addAction(tr("Shift Left"));
    buttonListVisible = contextMenu->addAction(tr("Bullet List"));
    numberListVisible = contextMenu->addAction(tr("Number List"));
    fontVisible = contextMenu->addAction(tr("Font"));
    fontSizeVisible = contextMenu->addAction(tr("Font Size"));
    fontColorVisible = contextMenu->addAction(tr("Font Color"));
    highlightVisible = contextMenu->addAction(tr("Highlight"));
    todoVisible = contextMenu->addAction(tr("Todo"));
    spellCheckButtonVisible = contextMenu->addAction(tr("Spell Check"));
    insertTableButtonVisible = contextMenu->addAction(tr("Insert Table"));
    htmlEntitiesButtonVisible = contextMenu->addAction(tr("HTML Entities"));

    undoVisible->setCheckable(true);
    redoVisible->setCheckable(true);
    cutVisible->setCheckable(true);
    copyVisible->setCheckable(true);
    pasteVisible->setCheckable(true);
    removeFormatVisible->setCheckable(true);
    boldVisible->setCheckable(true);
    italicVisible->setCheckable(true);
    underlineVisible->setCheckable(true);
    strikethroughVisible->setCheckable(true);
    leftJustifyVisible->setCheckable(true);
    centerJustifyVisible->setCheckable(true);
    rightJustifyVisible->setCheckable(true);
    hlineVisible->setCheckable(true);
    shiftRightVisible->setCheckable(true);
    shiftLeftVisible->setCheckable(true);
    buttonListVisible->setCheckable(true);
    numberListVisible->setCheckable(true);
    todoVisible->setCheckable(true);
    fontColorVisible->setCheckable(true);
    highlightVisible->setCheckable(true);
    fontColorVisible->setCheckable(true);
    fontSizeVisible->setCheckable(true);
    fontVisible->setCheckable(true);
    spellCheckButtonVisible->setCheckable(true);
    spellCheckButtonVisible->setChecked(true);
    insertTableButtonVisible->setCheckable(true);
    htmlEntitiesButtonVisible->setCheckable(true);

    connect(undoVisible, SIGNAL(triggered()), this, SLOT(toggleUndoButtonVisible()));
    connect(redoVisible, SIGNAL(triggered()), this, SLOT(toggleRedoButtonVisible()));
    connect(cutVisible, SIGNAL(triggered()), this, SLOT(toggleCutButtonVisible()));
    connect(copyVisible, SIGNAL(triggered()), this, SLOT(toggleCopyButtonVisible()));
    connect(pasteVisible, SIGNAL(triggered()), this, SLOT(togglePasteButtonVisible()));
    connect(removeFormatVisible, SIGNAL(triggered()), this, SLOT(toggleRemoveFormatVisible()));
    connect(boldVisible, SIGNAL(triggered()), this, SLOT(toggleBoldButtonVisible()));
    connect(italicVisible, SIGNAL(triggered()), this, SLOT(toggleItalicButtonVisible()));
    connect(underlineVisible, SIGNAL(triggered()), this, SLOT(toggleUnderlineButtonVisible()));
    connect(strikethroughVisible, SIGNAL(triggered()), this, SLOT(toggleStrikethroughButtonVisible()));
    connect(leftJustifyVisible, SIGNAL(triggered()), this, SLOT(toggleLeftJustifyButtonVisible()));
    connect(centerJustifyVisible, SIGNAL(triggered()), this, SLOT(toggleCenterJustifyButtonVisible()));
    connect(rightJustifyVisible, SIGNAL(triggered()), this, SLOT(toggleRightJustifyButtonVisible()));
    connect(hlineVisible, SIGNAL(triggered()), this, SLOT(toggleHlineButtonVisible()));
    connect(shiftRightVisible, SIGNAL(triggered()), this, SLOT(toggleShiftRightButtonVisible()));
    connect(shiftLeftVisible, SIGNAL(triggered()), this, SLOT(toggleShiftLeftButtonVisible()));
    connect(buttonListVisible, SIGNAL(triggered()), this, SLOT(toggleButtonListButtonVisible()));
    connect(numberListVisible, SIGNAL(triggered()), this, SLOT(toggleNumberListButtonVisible()));
    connect(fontVisible, SIGNAL(triggered()), this, SLOT(toggleFontButtonVisible()));
    connect(fontSizeVisible, SIGNAL(triggered()), this, SLOT(toggleFontSizeButtonVisible()));
    connect(todoVisible, SIGNAL(triggered()), this, SLOT(toggleTodoButtonVisible()));
    connect(highlightVisible, SIGNAL(triggered()), this, SLOT(toggleHighlightColorVisible()));
    connect(fontColorVisible, SIGNAL(triggered()), this, SLOT(toggleFontColorVisible()));
    connect(insertTableButtonVisible, SIGNAL(triggered()), this, SLOT(toggleInsertTableButtonVisible()));
    connect(spellCheckButtonVisible, SIGNAL(triggered()), this, SLOT(toggleSpellCheckButtonVisible()));
    connect(htmlEntitiesButtonVisible, SIGNAL(triggered()), this, SLOT(toggleHtmlEntitiesButtonVisible()));


  undoButtonAction = this->addAction(QIcon(":undo.png"), tr("Undo"));
  this->setupShortcut(undoButtonAction, "Edit_Undo");
  redoButtonAction = this->addAction(QIcon(":redo.png"), tr("Redo"));
  this->setupShortcut(redoButtonAction, "Edit_Redo");

  cutButtonAction = this->addAction(QIcon(":cut.png"), tr("Cut"));
  this->setupShortcut(cutButtonAction, "Edit_Cut");
  copyButtonAction = this->addAction(QIcon(":copy.png"), tr("Copy"));
  this->setupShortcut(copyButtonAction, "Edit_Copy");
  pasteButtonAction = this->addAction(QIcon(":paste.png"), tr("Paste"));
  this->setupShortcut(pasteButtonAction, "Edit_Paste");
  removeFormatButtonAction = this->addAction(QIcon(":eraser.png"), tr("Remove Formatting"));
  this->setupShortcut(removeFormatButtonAction, "Edit_Remove_Formatting");

  boldButtonWidget = new QToolButton(this);
  boldButtonWidget->setIcon(QIcon(":bold.png"));
  boldButtonWidget->setText(tr("Bold"));
  this->setupShortcut(boldButtonWidget, "Format_Bold");
  boldButtonAction = this->addWidget(boldButtonWidget);


  italicButtonWidget = new QToolButton(this);
  italicButtonWidget->setIcon(QIcon(":italics.png"));
  italicButtonWidget->setText(tr("Italics"));
  italicButtonWidget->setToolTip(tr("Italics"));
  italicButtonAction = this->addWidget(italicButtonWidget);
  this->setupShortcut(italicButtonWidget, "Format_Italic");

  underlineButtonWidget = new QToolButton(this);
  underlineButtonWidget->setIcon(QIcon(":underline.png"));
  underlineButtonWidget->setText(tr("Underline"));
  underlineButtonWidget->setToolTip(tr("Underline"));
  underlineButtonAction = this->addWidget(underlineButtonWidget);
  this->setupShortcut(underlineButtonWidget, "Format_Underline");

  strikethroughButtonAction = this->addAction(QIcon(":strikethrough.png"), tr("Strikethrough"));
  this->setupShortcut(strikethroughButtonAction, "Format_Strikethrough");

  leftJustifyButtonAction = this->addAction(QIcon(":leftAlign.png"), tr("Left Justify"));
  this->setupShortcut(leftJustifyButtonAction, "Format_Alignment_Left");
  centerJustifyButtonAction = this->addAction(QIcon(":centerAlign.png"), tr("Center"));
  this->setupShortcut(centerJustifyButtonAction, "Format_Alignment_Center");
  rightJustifyButtonAction = this->addAction(QIcon(":rightAlign.png"), tr("Right Justify"));
  this->setupShortcut(rightJustifyButtonAction, "Format_Alignment_Right");

  hlineButtonAction = this->addAction(QIcon(":hline.png"), tr("Horizontal Line"));
  this->setupShortcut(hlineButtonAction, "Format_Horizontal_Line");

  shiftRightButtonAction = this->addAction(QIcon(":shiftRight.png"), tr("Shift Right"));
  this->setupShortcut(shiftRightButtonAction, "Format_Indent_Increase");
  shiftLeftButtonAction = this->addAction(QIcon(":shiftLeft.png"), tr("Shift Left"));
  this->setupShortcut(shiftLeftButtonAction, "Format_Indent_Decrease");

  bulletListButtonAction = this->addAction(QIcon(":bulletList.png"), tr("Bullet List"));
  this->setupShortcut(bulletListButtonAction, "Format_List_Bullet");
  numberListButtonAction = this->addAction(QIcon(":numberList.png"), tr("Number List"));
  this->setupShortcut(numberListButtonAction, "Format_List_Numbered");


  fontNames = new QComboBox(this);
  fontSizes = new QComboBox(this);

  loadFontNames();
  fontButtonAction = addWidget(fontNames);
  fontSizeButtonAction = addWidget(fontSizes);

  fontColorMenuWidget = new ColorMenu();
  fontColorButtonWidget = new QToolButton(this);
  fontColorButtonWidget->setAutoRaise(false);
  fontColorButtonWidget->setMenu(fontColorMenuWidget->getMenu());
  fontColorButtonWidget->setIcon(QIcon(":fontColor.png"));
  fontColorButtonWidget->setToolTip(tr("Font Color"));
  fontColorAction = this->addWidget(fontColorButtonWidget);

  highlightColorMenuWidget = new ColorMenu();
  highlightColorMenuWidget->setDefault(Qt::yellow);
  highlightColorButtonWidget = new QToolButton(this);
  highlightColorButtonWidget->setAutoRaise(false);
  highlightColorButtonWidget->setMenu(highlightColorMenuWidget->getMenu());
  highlightColorButtonWidget->setIcon(QIcon(":fontHighlight.png"));
  highlightColorButtonWidget->setToolTip(tr("Highlight"));
  highlightColorAction = this->addWidget(highlightColorButtonWidget);

  todoButtonAction = this->addAction(QIcon(":todo.png"), tr("Todo"));
  this->setupShortcut(todoButtonAction, "Edit_Insert_Todo");

  spellCheckButtonAction = this->addAction(QIcon(":spellCheck.png"), tr("Spell Check"));
  this->setupShortcut(spellCheckButtonAction, "Note_Spell_Check");

  insertTableButtonAction = this->addAction(QIcon(":grid.png"), tr("Insert Table"));
  this->setupShortcut(insertTableButtonAction, "Edit_Insert_Table");

  htmlEntitiesButtonAction = this->addAction(QIcon(":htmlentities.png"), tr("Insert HTML Entities"));
//  this->setupShortcut(insertTableButtonAction, "Edit_Insert_Table");
}