OSDN Git Service

- Added the ability to do special refreshes for debugging. - Added the ability to...
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / dialog / ConfigDebugPage.java
index 3719d26..e2bfc67 100644 (file)
  *\r
 */\r
 \r
+\r
+//**********************************************\r
+//**********************************************\r
+//* This dialog is the debugging information \r
+//* page used in the Edit/Preferences dialog\r
+//**********************************************\r
+//**********************************************\r
+\r
 package cx.fbn.nevernote.dialog;\r
 \r
 import com.trolltech.qt.gui.QCheckBox;\r
@@ -37,8 +45,10 @@ public class ConfigDebugPage extends QWidget {
        QComboBox serverCombo;\r
        QCheckBox disableUploads;\r
        QCheckBox carriageReturnFix;\r
+       QCheckBox htmlEntitiesFix;\r
        QCheckBox enableThumbnails;\r
        QSpinBox  databaseCache;\r
+       QCheckBox reloadSharedNotebooks;\r
        \r
        public ConfigDebugPage(QWidget parent) {\r
                super(parent);\r
@@ -106,10 +116,31 @@ public class ConfigDebugPage extends QWidget {
                crlfLayout.addWidget(carriageReturnFix);\r
                crlfGroup.setLayout(crlfLayout);\r
 \r
+               QGroupBox htmlGroup = new QGroupBox(tr("Android Note Fix"));\r
+               String entitiesMessage = new String(tr("Note: This is an experimental fix to correct Unicode" +\r
+                               " notes created on Android Evernote clients."));\r
+               htmlEntitiesFix = new QCheckBox(this);\r
+               QVBoxLayout htmlLayout = new QVBoxLayout();\r
+               htmlEntitiesFix.setText(tr("Enable Android Fix"));\r
+               htmlLayout.addWidget(htmlEntitiesFix);\r
+               htmlGroup.setLayout(htmlLayout);\r
+               \r
+               reloadSharedNotebooks = new QCheckBox(tr("Shared Notebooks"));\r
+               QGroupBox refresh = new QGroupBox(tr("Special Refresh (WARNING - This can cause unsynchronized data loss)."));\r
+               QVBoxLayout refreshLayout = new QVBoxLayout();\r
+               refreshLayout.addWidget(reloadSharedNotebooks);\r
+               refresh.setLayout(refreshLayout);\r
+               \r
+               \r
                QTextBrowser msg = new QTextBrowser(this);\r
+               QTextBrowser htmlMsg = new QTextBrowser(this);\r
                msg.setText(crlfMessage);\r
+               htmlMsg.setText(entitiesMessage);\r
                crlfLayout.addWidget(msg);\r
                mainLayout.addWidget(crlfGroup);\r
+               htmlLayout.addWidget(htmlMsg);\r
+               mainLayout.addWidget(htmlGroup);\r
+               mainLayout.addWidget(refresh);\r
 \r
                mainLayout.addStretch(1);\r
                setLayout(mainLayout);\r
@@ -129,6 +160,17 @@ public class ConfigDebugPage extends QWidget {
                int i = messageCombo.currentIndex();\r
                return messageCombo.itemData(i).toString();\r
        }\r
+\r
+\r
+       //******************************************\r
+       //* Experimental fixes\r
+       //******************************************\r
+       public void setHtmlEntitiesFix(boolean val) {\r
+               htmlEntitiesFix.setChecked(val);\r
+       }\r
+       public boolean getHtmlEntitiesFix() {\r
+               return htmlEntitiesFix.isChecked();\r
+       }\r
        public void setCarriageReturnFix(boolean val) {\r
                carriageReturnFix.setChecked(val);\r
        }\r
@@ -181,4 +223,12 @@ public class ConfigDebugPage extends QWidget {
                return new Integer(databaseCache.value()*1024).toString();\r
        }\r
 \r
+       \r
+       //***************************************\r
+       //* Special refreshes\r
+       //***************************************\r
+       public boolean reloadSharedNotebooksClicked() {\r
+               return reloadSharedNotebooks.isChecked();\r
+       }\r
+\r
 }\r