From 5c9a04ba9a20b67c514f25400dc58b50ff014723 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 8 Sep 2011 17:09:29 +0200 Subject: [PATCH] fixed the search bar bug. --- src/adaptors/UBSvgSubsetAdaptor.cpp | 1 + src/board/UBLibraryController.cpp | 5 ----- src/core/UBPreferencesController.cpp | 4 +--- src/gui/UBLibActionBar.cpp | 7 +++++++ src/gui/UBLibActionBar.h | 1 + src/gui/UBLibNavigatorWidget.cpp | 3 +++ src/gui/UBLibPathViewer.cpp | 10 +++++----- src/gui/UBLibraryWidget.cpp | 1 + src/gui/UBLibraryWidget.h | 1 + src/web/browser/WBTabWidget.cpp | 9 +++------ 10 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 9b9deaf7..782f8aac 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -1058,6 +1058,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene() continue; } + qDebug() << item; UBGraphicsCache* cache = qgraphicsitem_cast(item); if(cache && cache->isVisible()) { diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index bef5b864..28b8008a 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -443,11 +443,6 @@ QList UBLibraryController::getContent(UBLibElement *element) break; } -// qDebug() << "getContent()"; -// qDebug() << this; -// foreach(UBLibElement*eachElement, mElementsList) -// qDebug() << eachElement; - return mElementsList; } diff --git a/src/core/UBPreferencesController.cpp b/src/core/UBPreferencesController.cpp index 37a3bc37..9bee94a5 100644 --- a/src/core/UBPreferencesController.cpp +++ b/src/core/UBPreferencesController.cpp @@ -110,9 +110,7 @@ void UBPreferencesController::wire() for(int i = 0; i < settings->supportedKeyboardSizes->size(); i++) mPreferencesUI->keyboardPaletteKeyButtonSize->addItem(settings->supportedKeyboardSizes->at(i)); -// mPreferencesUI->keyboardPaletteKeyButtonSize->addItem("29x29"); -// mPreferencesUI->keyboardPaletteKeyButtonSize->addItem("30x30"); -// mPreferencesUI->keyboardPaletteKeyButtonSize->addItem("41x41"); + connect(mPreferencesUI->keyboardPaletteKeyButtonSize, SIGNAL(currentIndexChanged(const QString &)), settings->boardKeyboardPaletteKeyBtnSize, SLOT(setString(const QString &))); diff --git a/src/gui/UBLibActionBar.cpp b/src/gui/UBLibActionBar.cpp index 6b4093c0..046f81d2 100644 --- a/src/gui/UBLibActionBar.cpp +++ b/src/gui/UBLibActionBar.cpp @@ -501,6 +501,13 @@ void UBLibActionBar::onNavigbarUpdate(UBLibElement *crntElem) } } + +void UBLibActionBar::onItemChanged() +{ + mSearchBar->setText(""); + mpSearchBtn->setEnabled(false); +} + /** * \brief Construtor * @param parent as the parent widget diff --git a/src/gui/UBLibActionBar.h b/src/gui/UBLibActionBar.h index 204a0447..a7a1b4af 100644 --- a/src/gui/UBLibActionBar.h +++ b/src/gui/UBLibActionBar.h @@ -66,6 +66,7 @@ public slots: void onSelectionChanged(QList itemList, bool isInTrash); void onFavoritesEntered(bool bFav); void onNavigbarUpdate(UBLibElement* crntElem); + void onItemChanged(); protected: void enterEvent(QEvent *event); diff --git a/src/gui/UBLibNavigatorWidget.cpp b/src/gui/UBLibNavigatorWidget.cpp index 46908a29..149edd60 100644 --- a/src/gui/UBLibNavigatorWidget.cpp +++ b/src/gui/UBLibNavigatorWidget.cpp @@ -73,6 +73,9 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW connect(libWidget->actionBar(), SIGNAL(searchElement(QString)), mLibWidget, SLOT(onSearchElement(QString))); connect(libWidget->actionBar(), SIGNAL(newFolderToCreate()), mLibWidget, SLOT(onNewFolderToCreate())); + connect(mLibWidget, SIGNAL(itemClicked()),libWidget->actionBar(), SLOT(onItemChanged())); + connect(mPathViewer, SIGNAL(mouseClick(UBChainedLibElement*)),libWidget->actionBar(), SLOT(onItemChanged())); + mLibWidget->init(); } diff --git a/src/gui/UBLibPathViewer.cpp b/src/gui/UBLibPathViewer.cpp index 9da9c913..5342c740 100644 --- a/src/gui/UBLibPathViewer.cpp +++ b/src/gui/UBLibPathViewer.cpp @@ -58,16 +58,16 @@ UBLibPathViewer::UBLibPathViewer(QWidget *parent, const char *name):QGraphicsVie */ UBLibPathViewer::~UBLibPathViewer() { +// if(NULL != mpLayout) +// { +// delete mpLayout; +// mpLayout = NULL; +// } if(NULL != mpContainer) { delete mpContainer; mpContainer = NULL; } - //if(NULL != mpLayout) - //{ - // delete mpLayout; - // mpLayout = NULL; - //} if(NULL != mpElems) { delete mpElems; diff --git a/src/gui/UBLibraryWidget.cpp b/src/gui/UBLibraryWidget.cpp index d66f0b2c..65f26cfb 100644 --- a/src/gui/UBLibraryWidget.cpp +++ b/src/gui/UBLibraryWidget.cpp @@ -167,6 +167,7 @@ void UBLibraryWidget::onItemClicked(QGraphicsItem *item, int index) emit propertiesRequested(pElem); } } + emit itemClicked(); } } } diff --git a/src/gui/UBLibraryWidget.h b/src/gui/UBLibraryWidget.h index e6fd0fc7..f54bd916 100644 --- a/src/gui/UBLibraryWidget.h +++ b/src/gui/UBLibraryWidget.h @@ -60,6 +60,7 @@ signals: void itemsSelected(QList elemList, bool inTrash); void propertiesRequested(UBLibElement* pElem); void favoritesEntered(bool bFav); + void itemClicked(); protected: void dragEnterEvent(QDragEnterEvent *event); diff --git a/src/web/browser/WBTabWidget.cpp b/src/web/browser/WBTabWidget.cpp index ae4943e5..d49fac7e 100644 --- a/src/web/browser/WBTabWidget.cpp +++ b/src/web/browser/WBTabWidget.cpp @@ -237,16 +237,13 @@ WBTabWidget::WBTabWidget(QWidget *parent) setDocumentMode(false); mRecentlyClosedTabsMenu = new QMenu(this); - connect(mRecentlyClosedTabsMenu, SIGNAL(aboutToShow()), - this, SLOT(aboutToShowRecentTabsMenu())); - connect(mRecentlyClosedTabsMenu, SIGNAL(triggered(QAction *)), - this, SLOT(aboutToShowRecentTriggeredAction(QAction *))); + connect(mRecentlyClosedTabsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowRecentTabsMenu())); + connect(mRecentlyClosedTabsMenu, SIGNAL(triggered(QAction *)), this, SLOT(aboutToShowRecentTriggeredAction(QAction *))); mRecentlyClosedTabsAction = new QAction(tr("Recently Closed Tabs"), this); mRecentlyClosedTabsAction->setMenu(mRecentlyClosedTabsMenu); mRecentlyClosedTabsAction->setEnabled(false); - connect(this, SIGNAL(currentChanged(int)), - this, SLOT(currentChanged(int))); + connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); mLineEdits = new QStackedWidget(this); mLineEdits->setMinimumWidth(200);