fixed minor bugs with gui, added secon dictionary file
[mdictionary] / trunk / src / base / gui / TranslationWidget.cpp
index fc0ee6f..42d4890 100644 (file)
@@ -30,7 +30,6 @@ TranslationWidget::TranslationWidget(Backbone *backbone, QWidget *parent):
 
     this->backbone = backbone;
 
-
     #ifdef Q_WS_MAEMO_5
         setAttribute(Qt::WA_Maemo5StackedWindow);
     #endif
@@ -38,13 +37,12 @@ TranslationWidget::TranslationWidget(Backbone *backbone, QWidget *parent):
 
     initializeUI();
 
-   /* connect(textEdit, SIGNAL(customContextMenuRequested(QPoint)),
-            this, SLOT(showContextMenu(QPoint)));*/
+    connect(backbone, SIGNAL(htmlReady()),
+            this, SLOT(show()));
 
     setWindowTitle(tr("Translation"));
 }
 
-
 void TranslationWidget::show() {
     QScrollArea::show();
 
@@ -60,15 +58,13 @@ void TranslationWidget::show() {
 
     textEdit->setPlainText(trans);
 
-    textEdit->update(this->rect());
+    textEdit->repaint(this->rect());
+
+    update(this->rect());
+
 }
 
 void TranslationWidget::initializeUI() {
-    /*contextMenu = new QMenu;
-
-    contextMenu->addAction(tr("Copy"), this, SLOT(copy()));
-    contextMenu->addAction(tr("Paste"), this, SLOT(paste()));
-    contextMenu->addAction(tr("Select all"), this, SLOT(selectAll()));*/
 
     textEdit = new QTextEdit;
     textEdit->setReadOnly(true);
@@ -82,7 +78,6 @@ void TranslationWidget::initializeUI() {
     this->setWidget(w);
     this->setWidgetResizable(true);
 
-
 }
 
 void TranslationWidget::showContextMenu(QPoint pos) {