From 2ad12b428a1104b2aed0fc1011c1085f12a049ab Mon Sep 17 00:00:00 2001 From: jakub Date: Mon, 28 Feb 2011 11:13:53 +0100 Subject: [PATCH] some change --- src/mdictionary/gui/SearchBarWidget.cpp | 17 ------------- src/mdictionary/qml/DictManagerWidget.qml | 1 - src/mdictionary/qml/StarDictDialog.qml | 1 - src/mdictionary/qml/WordListWidget.qml | 25 +++++++++++++------- src/mdictionary/qml/XdxfDialog.qml | 25 +++++++++++++++----- .../xdxf/XdxfDictDownloadProgressDialog.cpp | 5 ---- 6 files changed, 35 insertions(+), 39 deletions(-) diff --git a/src/mdictionary/gui/SearchBarWidget.cpp b/src/mdictionary/gui/SearchBarWidget.cpp index da482d0..7e9e16d 100644 --- a/src/mdictionary/gui/SearchBarWidget.cpp +++ b/src/mdictionary/gui/SearchBarWidget.cpp @@ -153,7 +153,6 @@ SearchBarWidget::~SearchBarWidget() { } void SearchBarWidget::checkFocus(){ - qDebug()<<"focus:"<index+1){ preferedCompliter = completerActualList.at(index+1); tempString=preferedCompliter; @@ -228,7 +226,6 @@ void SearchBarWidget::nextCompleter(){ QIcon SearchBarWidget::generateIcon(QIcon original, qreal rotation) { - qDebug()<<"test2"; QPixmap p = original.pixmap(64); if(rotation != 0) { @@ -273,7 +270,6 @@ void SearchBarWidget::setFocus() { } void SearchBarWidget::initializeUI() { - qDebug()<<"test4"; #ifdef Q_WS_MAEMO_5 setMaximumHeight(150); @@ -374,7 +370,6 @@ void SearchBarWidget::initializeUI() { } void SearchBarWidget::searchButtonClicked(QString text) { - qDebug()<<"test5"; if(busy) Q_EMIT stopSearching(); else @@ -382,7 +377,6 @@ void SearchBarWidget::searchButtonClicked(QString text) { } void SearchBarWidget::searchPushButtonClicked() { - qDebug()<<"test6"; #ifdef Q_WS_MAEMO_5 if(busy) { Q_EMIT stopSearching(); @@ -412,7 +406,6 @@ void SearchBarWidget::search(QString word) { } void SearchBarWidget::searchDelay(QString word) { - qDebug()<<"test8"; if(!busy && !word.isEmpty()) { #ifndef Q_WS_MAEMO_5 emit setLineEditText(word); @@ -428,7 +421,6 @@ void SearchBarWidget::searchDelay(QString word) { } void SearchBarWidget::delaySearchTimeout() { - qDebug()<<"test9"; delayTimer.stop(); if(!busy) { Q_EMIT searchForTranslations(delayString); @@ -436,11 +428,9 @@ void SearchBarWidget::delaySearchTimeout() { } void SearchBarWidget::setEnabled(bool enabled) { - qDebug()<<"test10"; #ifndef Q_WS_MAEMO_5 emit setLineEditEnables(enabled); if(!enabled) { - qDebug()<<"tu???"; emit setEnableHistoryNext(false); emit setEnableHistoryShow(false); emit setEnableHistoryPrev(false); @@ -453,11 +443,9 @@ void SearchBarWidget::setEnabled(bool enabled) { historyShowToolButton->setEnabled(false); } #endif -qDebug()<<"tu2???"; } void SearchBarWidget::setBusy() { - qDebug()<<"test11"; if(busy) return; #ifndef Q_WS_MAEMO_5 @@ -480,7 +468,6 @@ void SearchBarWidget::setBusy() { } void SearchBarWidget::updateBusyTimer(){ - qDebug()<<"test12"; if(progressMax==true){ emit progresSetValue2(0); progressMax=false; @@ -493,7 +480,6 @@ void SearchBarWidget::updateBusyTimer(){ } void SearchBarWidget::setIdle() { - qDebug()<<"test13"; if(!busy) return; #ifndef Q_WS_MAEMO_5 progressBar->hide(); @@ -512,7 +498,6 @@ void SearchBarWidget::setIdle() { void SearchBarWidget::clearSearchWordToolButtonClicked() { - qDebug()<<"test14"; #ifdef Q_WS_MAEMO_5 searchWordLineEdit->clear(); #endif @@ -521,7 +506,6 @@ void SearchBarWidget::clearSearchWordToolButtonClicked() { void SearchBarWidget::updateHistoryButtons(bool prev, bool next, bool list) { - qDebug()<<"test15"; if(!busy) { #ifndef Q_WS_MAEMO_5 emit setEnableHistoryNext(next); @@ -536,7 +520,6 @@ void SearchBarWidget::updateHistoryButtons(bool prev, bool next, bool list) { } void SearchBarWidget::showHistoryButtonClicked() { - qDebug()<<"test16"; #ifndef Q_WS_MAEMO_5 QPoint p=view->pos(); // = historyShowToolButton->pos(); p=mapToGlobal(p); diff --git a/src/mdictionary/qml/DictManagerWidget.qml b/src/mdictionary/qml/DictManagerWidget.qml index df43918..86adbed 100644 --- a/src/mdictionary/qml/DictManagerWidget.qml +++ b/src/mdictionary/qml/DictManagerWidget.qml @@ -111,7 +111,6 @@ Rectangle { model: dictModel } - //buttons Item { id: buttonsBox diff --git a/src/mdictionary/qml/StarDictDialog.qml b/src/mdictionary/qml/StarDictDialog.qml index 2291d11..b283f61 100644 --- a/src/mdictionary/qml/StarDictDialog.qml +++ b/src/mdictionary/qml/StarDictDialog.qml @@ -34,7 +34,6 @@ Rectangle{ SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } color : myPalette.window; - Text { id: textInfo text: "Tekst: " diff --git a/src/mdictionary/qml/WordListWidget.qml b/src/mdictionary/qml/WordListWidget.qml index 288cbaf..9383549 100644 --- a/src/mdictionary/qml/WordListWidget.qml +++ b/src/mdictionary/qml/WordListWidget.qml @@ -25,6 +25,9 @@ import Qt 4.7 Rectangle { + id: rectangle1 + color: myPalette.base + anchors.fill: parent function changeWordState(nr, state) { wordList.currentIndex = nr @@ -35,14 +38,10 @@ Rectangle { function setEnabled(Boolean) { wordList.enabled = Boolean } // slot signal wordSelected(string word); - + signal checkFocus(); SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } - id: rectangle1 - color: myPalette.base - anchors.fill: parent - ElementsListView{ id: wordList width: rectangle1.width @@ -53,6 +52,8 @@ Rectangle { delegate: Component{ id: wordListDelegate Item { + onActiveFocusChanged: rectangle1.checkFocus(); + width: rectangle1.width height: { if (wordText.height + 4 > check.height) @@ -60,10 +61,10 @@ Rectangle { else return check.height; } - MouseArea{ anchors.fill: parent - onClicked: { + onClicked: wordList.currentIndex = number + onDoubleClicked: { wordList.currentIndex = number rectangle1.wordSelected(word) } @@ -103,11 +104,17 @@ Rectangle { } } } - } - } model: wordModel } + + states: [ + State { + name: "noFocus"; + when: ((!wordList.focus) && (!rectangle1.focus)) + PropertyChanges { target: wordList.highlightItem; opacity:0} + } + ] } diff --git a/src/mdictionary/qml/XdxfDialog.qml b/src/mdictionary/qml/XdxfDialog.qml index e16180b..1b2a960 100644 --- a/src/mdictionary/qml/XdxfDialog.qml +++ b/src/mdictionary/qml/XdxfDialog.qml @@ -96,7 +96,7 @@ Rectangle{ Text { id: textInfo width: rectangle1.width - height: paintedHeight+5; + height: (paintedHeight+5)>150?150:paintedHeight+5; text: ": " wrapMode: Text.Wrap; anchors.top: textDescription.bottom @@ -105,13 +105,26 @@ Rectangle{ font.pixelSize: 12 } + + Rectangle { + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: saveButton.bottom + anchors.top: optimalizeCheckbox.top + + id: rectangle2 + color: myPalette.window + anchors.topMargin: -2 + } + Checkbox { id: optimalizeCheckbox width: 20 height: 20 + anchors.bottom: stripCheckbox.top + anchors.bottomMargin: 5 anchors.left: parent.left anchors.leftMargin: 5 - anchors.top: textInfo.bottom onChanged: rectangle1.optimalizeCheckboxChanged(selected); } @@ -119,8 +132,8 @@ Rectangle{ id: stripCheckbox width: 20 height: 20 - anchors.top: optimalizeCheckbox.bottom - anchors.topMargin: 5 + anchors.bottom: saveButton.top + anchors.bottomMargin: 15 anchors.horizontalCenter: optimalizeCheckbox.horizontalCenter onChanged: rectangle1.stripCheckboxChanged(selected); } @@ -151,9 +164,8 @@ Rectangle{ Button { id: saveButton height: 30 + anchors.bottom: parent.bottom textInButton: qsTr("Save") - anchors.top: stripCheckbox.bottom - anchors.topMargin: 10 anchors.right: parent.right anchors.left: parent.left onClicked: rectangle1.saveButtonClicked(); @@ -200,6 +212,7 @@ Rectangle{ onClicked: rectangle1.downloadButtonClicked(); } + states: [ State { name: "Stan1" diff --git a/src/plugins/xdxf/XdxfDictDownloadProgressDialog.cpp b/src/plugins/xdxf/XdxfDictDownloadProgressDialog.cpp index 5bf2ca7..e37032c 100644 --- a/src/plugins/xdxf/XdxfDictDownloadProgressDialog.cpp +++ b/src/plugins/xdxf/XdxfDictDownloadProgressDialog.cpp @@ -29,7 +29,6 @@ XdxfDictDownloadProgressDialog::XdxfDictDownloadProgressDialog(QWidget*parent): QDialog(parent) { -qDebug()<<"etap 01"; #ifndef Q_WS_MAEMO_5 view= new QDeclarativeView(); view->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/XdxfDictDownloader.qml")); @@ -85,7 +84,6 @@ qDebug()<<"etap 01"; void XdxfDictDownloadProgressDialog::show() { -qDebug()<<"etap 02"; #ifndef Q_WS_MAEMO_5 emit setMaximumValue(0); maximumValue=0; @@ -98,8 +96,6 @@ qDebug()<<"etap 02"; void XdxfDictDownloadProgressDialog::setText(QString text) { -qDebug()<<"etap 03"; - #ifndef Q_WS_MAEMO_5 emit setTextt(text); #else @@ -125,7 +121,6 @@ qDebug()<<"etap 04"; void XdxfDictDownloadProgressDialog::reject() { -qDebug()<<"etap 05"; #ifndef Q_WS_MAEMO_5 Q_EMIT cancelDownloading(); #else -- 1.7.9.5