Browse Source

Small changes

Kandrashin Denis 13 years ago
parent
commit
a6e19c50ae
3 changed files with 21 additions and 3 deletions
  1. 3 2
      source/fb2edit.pro
  2. 10 1
      source/fb2main.cpp
  3. 8 0
      source/fb2read.cpp

+ 3 - 2
source/fb2edit.pro

@@ -41,10 +41,11 @@ OTHER_FILES += res/style.css \
 if (win32) {
 
     INCLUDEPATH += ../libxml2/include
-    LIBS += -L../libxml2/lib -llibxml2
-
     INCLUDEPATH += ../iconv/include
+
+    LIBS += -L../libxml2/lib -llibxml2
     LIBS += -L../iconv/lib -liconv
+    LIBS += -L../zlib/lib -lzlib
 
 } else {
 

+ 10 - 1
source/fb2main.cpp

@@ -440,6 +440,15 @@ void Fb2MainWindow::loadFinished(bool ok)
 
 void Fb2MainWindow::selectionChanged()
 {
+    actionCut->setEnabled(textEdit->CutEnabled());
+    actionCopy->setEnabled(textEdit->CopyEnabled());
+
+    actionTextBold->setChecked(textEdit->BoldChecked());
+    actionTextItalic->setChecked(textEdit->ItalicChecked());
+    actionTextStrike->setChecked(textEdit->StrikeChecked());
+    actionTextSub->setChecked(textEdit->SubChecked());
+    actionTextSup->setChecked(textEdit->SupChecked());
+
 //    QString script = "document.getSelection().baseNode.parentNode.tagName";
 //    qCritical() << textEdit->page()->mainFrame()->evaluateJavaScript(script).toString();
 }
@@ -619,7 +628,7 @@ void Fb2MainWindow::viewText()
     viewTree();
 
     connect(textEdit->page(), SIGNAL(contentsChanged()), SLOT(documentWasModified()));
-    connect(textEdit, SIGNAL(selectionChanged()), SLOT(selectionChanged()));
+    connect(textEdit->page(), SIGNAL(selectionChanged()), SLOT(selectionChanged()));
     connect(textEdit, SIGNAL(loadFinished(bool)), SLOT(loadFinished(bool)));
 
     connect(textEdit->pageAction(QWebPage::Undo), SIGNAL(changed()), SLOT(undoChanged()));

+ 8 - 0
source/fb2read.cpp

@@ -43,10 +43,18 @@ bool Fb2ReadThread::parse()
     }
     QXmlStreamWriter writer(&m_html);
     Fb2ReadHandler handler(*this, writer);
+#ifdef _WIN32
+    QXmlSimpleReader reader;
+    reader.setContentHandler(&handler);
+    reader.setErrorHandler(&handler);
+    QXmlInputSource source(&file);
+    return reader.parse(source);
+#else
     XML2::XmlReader reader;
     reader.setContentHandler(&handler);
     reader.setErrorHandler(&handler);
     return reader.parse(file);
+#endif
 }
 
 //---------------------------------------------------------------------------