titleLabel = new QLineEdit();
evernoteLinkClicked = new Signal2<String,String>();
titleLabel.setMaxLength(Constants.EDAM_NOTE_TITLE_LEN_MAX);
urlText = new QLineEdit();
authorText = new QLineEdit();
geoBox = new QComboBox();
urlLabel = new QPushButton();
urlLabel.clicked.connect(this, "sourceUrlClicked()");
authorLabel = new QLabel();
conn = c;
focusLost = new Signal0();
tagEdit = new TagLineEdit(allTags);
tagLabel = new QLabel(tr("Tags:"));
tagEdit.focusLost.connect(this, "modifyTagsTyping()");
createdCalendarWidget = new QCalendarWidget();
createdDate = new QDateEdit();
createdDate.setDisplayFormat(Global.getDateFormat());
createdDate.setCalendarPopup(true);
createdDate.setCalendarWidget(createdCalendarWidget);
createdTime = new QTimeEdit();
createdDate.dateChanged.connect(this, "createdChanged()");
createdTime.timeChanged.connect(this, "createdChanged()");
alteredCalendarWidget = new QCalendarWidget();
alteredDate = new QDateEdit();
alteredDate.setDisplayFormat(Global.getDateFormat());
alteredDate.setCalendarPopup(true);
alteredDate.setCalendarWidget(alteredCalendarWidget);
alteredTime = new QTimeEdit();
alteredLabel = new QLabel(tr("Altered:"));
alteredDate.dateChanged.connect(this, "alteredChanged()");
alteredTime.timeChanged.connect(this, "alteredChanged()");
subjectCalendarWidget = new QCalendarWidget();
subjectDate = new QDateEdit();
subjectDate.setDisplayFormat(Global.getDateFormat());
subjectDate.setCalendarPopup(true);
subjectDate.setCalendarWidget(subjectCalendarWidget);
subjectTime = new QTimeEdit();
subjectLabel = new QLabel(tr("Subject Date:"));
subjectDate.dateChanged.connect(this, "subjectDateTimeChanged()");
subjectTime.timeChanged.connect(this, "subjectDateTimeChanged()");
authorText.textChanged.connect(this, "authorChanged()");
urlText.textChanged.connect(this, "sourceUrlChanged()");
notebookBox = new QComboBox();
notebookLabel = new QLabel(tr("Notebook"));
createdLabel = new QLabel(tr("Created:"));
// selectedText = new String();
urlLabel.setVisible(false);
urlText.setVisible(false);
authorLabel.setVisible(false);
geoBox.setVisible(false);
geoBox.addItem(new QIcon(iconPath+"globe.png"), "");
geoBox.addItem(new String(tr("Set")));
geoBox.addItem(new String(tr("Clear")));
geoBox.addItem(new String(tr("View On Map")));
geoBox.activated.connect(this, "geoBoxChanged()");
authorText.setVisible(false);
createdDate.setVisible(false);
alteredLabel.setVisible(false);
//notebookBox.setVisible(false);
notebookLabel.setVisible(false);
createdLabel.setVisible(false);
createdTime.setVisible(false);
alteredDate.setVisible(false);
alteredTime.setVisible(false);
subjectLabel.setVisible(false);
subjectDate.setVisible(false);
subjectTime.setVisible(false);
extendedOn = false;
buttonsVisible = true;
setAcceptDrops(true);
browser = new ContentView(this);
browser.page().setLinkDelegationPolicy(
QWebPage.LinkDelegationPolicy.DelegateAllLinks);
browser.linkClicked.connect(this, "linkClicked(QUrl)");
currentHyperlink = "";
//Setup the source editor
sourceEdit = new QTextEdit(this);
sourceEdit.setVisible(false);
sourceEdit.setTabChangesFocus(true);
sourceEdit.setLineWrapMode(LineWrapMode.NoWrap);
QFont font = new QFont();
font.setFamily("Courier");
font.setFixedPitch(true);
font.setPointSize(10);
sourceEdit.setFont(font);
syntaxHighlighter = new Highlighter(sourceEdit.document());
sourceEdit.textChanged.connect(this, "sourceEdited()");
QVBoxLayout v = new QVBoxLayout();
QFormLayout notebookLayout = new QFormLayout();
QGridLayout dateLayout = new QGridLayout();
titleLabel.setReadOnly(false);
titleLabel.editingFinished.connect(this, "titleEdited()");
browser.page().contentsChanged.connect(this, "contentChanged()");
browser.page().selectionChanged.connect(this, "selectionChanged()");
browser.page().mainFrame().javaScriptWindowObjectCleared.connect(this,
"exposeToJavascript()");
notebookBox.activated.connect(this, "notebookChanged()");
resourceSignal = new NoteResourceSignal();
QHBoxLayout tagLayout = new QHBoxLayout();
v.addWidget(titleLabel, 0);
notebookLayout.addRow(notebookLabel, notebookBox);
tagLayout.addLayout(notebookLayout, 0);
tagLayout.stretch(4);
tagLayout.addWidget(tagLabel, 0);
tagLayout.addWidget(tagEdit, 1);
v.addLayout(tagLayout);
QHBoxLayout urlLayout = new QHBoxLayout();
urlLayout.addWidget(urlLabel, 0);
urlLayout.addWidget(urlText, 0);
v.addLayout(urlLayout);
QHBoxLayout authorLayout = new QHBoxLayout();
authorLayout.addWidget(authorLabel, 0);
authorLayout.addWidget(authorText, 0);
authorLayout.addWidget(geoBox);
v.addLayout(authorLayout);
dateLayout.addWidget(createdLabel, 0, 0);
dateLayout.addWidget(createdDate, 0, 1);
dateLayout.addWidget(createdTime, 0, 2);
dateLayout.setColumnStretch(9, 100);
dateLayout.addWidget(alteredLabel, 0, 3);
dateLayout.addWidget(alteredDate, 0, 4);
dateLayout.addWidget(alteredTime, 0, 5);
dateLayout.addWidget(subjectLabel, 0, 6);
dateLayout.addWidget(subjectDate, 0, 7);
dateLayout.addWidget(subjectTime, 0, 8);
v.addLayout(dateLayout, 0);
undoButton = newEditorButton("undo", tr("Undo Change"));
redoButton = newEditorButton("redo", tr("Redo Change"));
cutButton = newEditorButton("cut", tr("Cut"));
copyButton = newEditorButton("copy", tr("Copy"));
pasteButton = newEditorButton("paste", tr("Paste"));
boldButton = newEditorButton("bold", tr("Bold"));
underlineButton = newEditorButton("underline", tr("Underline"));
italicButton = newEditorButton("italic", tr("Italic"));
rightAlignButton = newEditorButton("justifyRight", tr("Right Align"));
leftAlignButton = newEditorButton("justifyLeft", tr("Left Align"));
centerAlignButton = newEditorButton("justifyCenter", tr("Center Align"));
strikethroughButton = newEditorButton("strikethrough", tr("Strikethrough"));
hlineButton = newEditorButton("hline", tr("Insert Horizontal Line"));
indentButton = newEditorButton("indent", tr("Shift Right"));
outdentButton = newEditorButton("outdent", tr("Shift Left"));
bulletListButton = newEditorButton("bulletList", tr("Bullet List"));
numberListButton = newEditorButton("numberList", tr("Number List"));
spellCheckButton = newEditorButton("spellCheck", tr("Spell Check"));
todoButton = newEditorButton("todo", tr("To-do"));
buttonLayout = new EditorButtonBar();
v.addWidget(buttonLayout);
undoAction = buttonLayout.addWidget(undoButton);
buttonLayout.toggleUndoVisible.triggered.connect(this, "toggleUndoVisible(Boolean)");
redoAction = buttonLayout.addWidget(redoButton);
buttonLayout.toggleRedoVisible.triggered.connect(this, "toggleRedoVisible(Boolean)");
buttonLayout.addWidget(newSeparator());
cutAction = buttonLayout.addWidget(cutButton);
buttonLayout.toggleCutVisible.triggered.connect(this, "toggleCutVisible(Boolean)");
copyAction = buttonLayout.addWidget(copyButton);
buttonLayout.toggleCopyVisible.triggered.connect(this, "toggleCopyVisible(Boolean)");
pasteAction = buttonLayout.addWidget(pasteButton);
buttonLayout.togglePasteVisible.triggered.connect(this, "togglePasteVisible(Boolean)");
buttonLayout.addWidget(newSeparator());
boldAction = buttonLayout.addWidget(boldButton);
buttonLayout.toggleBoldVisible.triggered.connect(this, "toggleBoldVisible(Boolean)");
italicAction = buttonLayout.addWidget(italicButton);
buttonLayout.toggleItalicVisible.triggered.connect(this, "toggleItalicVisible(Boolean)");
underlineAction = buttonLayout.addWidget(underlineButton);
buttonLayout.toggleUnderlineVisible.triggered.connect(this, "toggleUnderlineVisible(Boolean)");
strikethroughAction = buttonLayout.addWidget(strikethroughButton);
buttonLayout.toggleStrikethroughVisible.triggered.connect(this, "toggleStrikethroughVisible(Boolean)");
buttonLayout.addWidget(newSeparator());
leftAlignAction = buttonLayout.addWidget(leftAlignButton);
buttonLayout.toggleLeftAlignVisible.triggered.connect(this, "toggleLeftAlignVisible(Boolean)");
centerAlignAction = buttonLayout.addWidget(centerAlignButton);
buttonLayout.toggleCenterAlignVisible.triggered.connect(this, "toggleCenterAlignVisible(Boolean)");
rightAlignAction = buttonLayout.addWidget(rightAlignButton);
buttonLayout.toggleRightAlignVisible.triggered.connect(this, "toggleRightAlignVisible(Boolean)");
buttonLayout.addWidget(newSeparator());
hlineAction = buttonLayout.addWidget(hlineButton);
buttonLayout.toggleHLineVisible.triggered.connect(this, "toggleHLineVisible(Boolean)");
indentAction = buttonLayout.addWidget(indentButton);
buttonLayout.toggleIndentVisible.triggered.connect(this, "toggleIndentVisible(Boolean)");
outdentAction = buttonLayout.addWidget(outdentButton);
buttonLayout.toggleOutdentVisible.triggered.connect(this, "toggleOutdentVisible(Boolean)");
bulletListAction = buttonLayout.addWidget(bulletListButton);
buttonLayout.toggleBulletListVisible.triggered.connect(this, "toggleBulletListVisible(Boolean)");
numberListAction = buttonLayout.addWidget(numberListButton);
buttonLayout.toggleNumberListVisible.triggered.connect(this, "toggleNumberListVisible(Boolean)");
// Setup the font & font size combo boxes
buttonLayout.addWidget(newSeparator());
fontList = new QComboBox();
fontSize = new QComboBox();
fontList.setToolTip("Font");
fontSize.setToolTip("Font Size");
fontList.activated.connect(this, "fontChanged(String)");
fontSize.activated.connect(this, "fontSizeChanged(String)");
fontListAction = buttonLayout.addWidget(fontList);