import com.trolltech.qt.gui.QPalette.ColorRole;
import com.trolltech.qt.gui.QPushButton;
import com.trolltech.qt.gui.QShortcut;
+import com.trolltech.qt.gui.QSizePolicy;
import com.trolltech.qt.gui.QSplitter;
import com.trolltech.qt.gui.QTextEdit;
import com.trolltech.qt.gui.QTextEdit.LineWrapMode;
import com.trolltech.qt.webkit.QWebView;
import cx.fbn.nevernote.Global;
+import cx.fbn.nevernote.clipboard.ClipBoardObserver;
import cx.fbn.nevernote.dialog.EnCryptDialog;
import cx.fbn.nevernote.dialog.EnDecryptDialog;
import cx.fbn.nevernote.dialog.GeoDialog;
import cx.fbn.nevernote.dialog.TagAssign;
import cx.fbn.nevernote.evernote.EnCrypt;
import cx.fbn.nevernote.filters.FilterEditorTags;
-import cx.fbn.nevernote.neighbornote.ClipBoardObserver;
import cx.fbn.nevernote.signals.NoteResourceSignal;
import cx.fbn.nevernote.signals.NoteSignal;
import cx.fbn.nevernote.sql.DatabaseConnection;
private final QTimer setSourceTimer;
String latexGuid; // This is set if we are editing an existing LaTeX formula. Useful to track guid.
- // ICHANGED
private final ClipBoardObserver cbObserver;
public static class SuggestionListener implements SpellCheckListener {
}
- // ICHANGED 引数にcbObserverを追加
+ // 引数にcbObserverを追加
public BrowserWindow(DatabaseConnection c, ClipBoardObserver cbObserver) {
logger = new ApplicationLogger("browser.log");
logger.log(logger.HIGH, "Setting up browser");
authorLabel = new QLabel();
conn = c;
- // ICHANGED
this.cbObserver = cbObserver;
focusLost = new Signal0();
fontSize = new QComboBox();
fontList.setMaximumWidth(130);
fontSize.setMaximumWidth(45);
+ fontSize.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed);
fontList.setToolTip("Font");
fontSize.setToolTip("Font Size");
+ fontList.setStyleSheet("QComboBox {padding: 3px;} ");
+ fontSize.setStyleSheet("QComboBox {padding: 3px;} ");
fontList.activated.connect(this, "fontChanged(String)");
fontSize.activated.connect(this, "fontSizeChanged(String)");
fontListAction = buttonLayout.addWidget(fontList);
// QIcon icon = new QIcon(iconPath + name + ".gif");
QIcon icon = new QIcon(iconPath + name + ".png");
button.setIcon(icon);
- // ICHANGED
button.setIconSize(new QSize(16, 16));
button.setToolTip(toolTip);
button.clicked.connect(this, name + "Clicked()");
+ button.setStyleSheet("QPushButton {padding: 3px;} ");
return button;
}
// New Editor Button
// QIcon icon = new QIcon(iconPath + name + ".gif");
QIcon icon = new QIcon(iconPath + name + ".png");
button.setIcon(icon);
- // ICHANGED
button.setIconSize(new QSize(16, 16));
button.setToolTip(toolTip);
button.clicked.connect(this, name + "Clicked()");
+ button.setStyleSheet("QToolButton {padding: 3px;} ");
+ button.setMaximumHeight(22);
return button;
}
// New Separator
private QLabel newSeparator() {
- return new QLabel(" ");
+ return new QLabel("");
}
// Set the title in the window
}
// Listener for when cut is clicked
- @SuppressWarnings("unused")
- private void cutClicked() {
- // ICHANGED
+ public void cutClicked() {
cbObserver.setCopySourceGuid(currentNote.getGuid(), browser.page().selectedText());
browser.page().triggerAction(WebAction.Cut);
}
// Listener when COPY is clicked
- @SuppressWarnings("unused")
- private void copyClicked() {
- // ICHANGED
+ public void copyClicked() {
cbObserver.setCopySourceGuid(currentNote.getGuid(), browser.page().selectedText());
browser.page().triggerAction(WebAction.Copy);
return;
}
- // ICHANGED コピー&ペーストの操作履歴をデータベースに登録
+ // コピー&ペーストの操作履歴をデータベースに登録
String srcGuid = cbObserver.getSourceGuid();
String dstGuid = currentNote.getGuid();
if(srcGuid != null && dstGuid != null){
if (!mime.hasText())
return;
- // ICHANGED コピー&ペーストの操作履歴をデータベースに登録
+ // コピー&ペーストの操作履歴をデータベースに登録
String srcGuid = cbObserver.getSourceGuid();
String dstGuid = currentNote.getGuid();
if(srcGuid != null && dstGuid != null){
if (text.trim().equalsIgnoreCase(""))
return;
- // ICHANGED
NoteQuickLinkDialog dialog = new NoteQuickLinkDialog(logger, conn, text, cbObserver);
if (dialog.getResults().size() == 0) {
if (tagEdit.text().equalsIgnoreCase(saveTagList))
return;
+ if (saveTagList == null) {
+ return;
+ }
+
// We know something has changed...
String oldTagArray[] = saveTagList.split(Global.tagDelimeter);
String newTagArray[];