[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdemultimedia/juk
From:       Scott Wheeler <wheeler () kde ! org>
Date:       2005-03-17 22:07:18
Message-ID: 20050317220718.D034F16F45 () office ! kde ! org
[Download RAW message or body]

CVS commit by wheeler: 

Don't show the image selection dialog when no matching images were found.

BUG:101088


  M +30 -19    googlefetcher.cpp   1.15
  M +4 -9      googlefetcher.h   1.12
  M +0 -1      googlefetcherdialog.cpp   1.18
  M +0 -1      googlefetcherdialog.h   1.12


--- kdemultimedia/juk/googlefetcher.cpp  #1.14:1.15
@@ -140,5 +140,4 @@ QPixmap GoogleFetcher::pixmap()
 {
     bool chosen = false;
-    const int selectedIndex = 0;
     m_loadedSize = All;
 
@@ -148,6 +147,9 @@ QPixmap GoogleFetcher::pixmap()
 
     while(!chosen) {
-        GoogleFetcherDialog dialog("google", m_imageList, selectedIndex, m_file, 0);
 
+        if(m_imageList.isEmpty())
+            chosen = !requestNewSearchTerms(true);
+        else {
+            GoogleFetcherDialog dialog("google", m_imageList, m_file, 0);
         connect(&dialog, SIGNAL(sizeChanged(GoogleFetcher::ImageSize)),
                 this, SLOT(slotLoadImageURLs(GoogleFetcher::ImageSize)));
@@ -157,13 +159,7 @@ QPixmap GoogleFetcher::pixmap()
         pixmap = dialog.result();
         chosen = dialog.takeIt();
-        if(dialog.newSearch()) {
-            bool ok;
-            m_searchString = KInputDialog::getText(i18n("Cover Downloader"),
-                                                   i18n("Enter new search terms:"),
-                                                   m_searchString, &ok);
-            if(ok && !m_searchString.isEmpty())
-                displayWaitMessage();
-            else
-                m_searchString = m_loadedQuery;
+
+            if(dialog.newSearch())
+                requestNewSearchTerms();
         }
     }
@@ -179,4 +175,19 @@ void GoogleFetcher::displayWaitMessage()
 }
 
-#include "googlefetcher.moc"
+bool GoogleFetcher::requestNewSearchTerms(bool noResults)
+{
+    bool ok;
+    m_searchString = KInputDialog::getText(i18n("Cover Downloader"),
+                                           noResults ?
+                                             i18n("No matching images found, please \
enter new search terms:") : +                                             i18n("Enter \
new search terms:"), +                                           m_searchString, \
&ok); +    if(ok && !m_searchString.isEmpty())
+        displayWaitMessage();
+    else
+        m_searchString = m_loadedQuery;
 
+    return ok;
+}
+
+#include "googlefetcher.moc"

--- kdemultimedia/juk/googlefetcher.h  #1.11:1.12
@@ -53,19 +53,14 @@ public:
     QPixmap pixmap();
 
+signals:
+    void signalNewSearch(GoogleImageList &images);
+
 private:
-    void cancel();
-    void editSearch();
-    void saveCover();
-    void previous();
-    void next();
     void displayWaitMessage();
-    void buildBox();
+    bool requestNewSearchTerms(bool noResults = false);
 
 private slots:
     void slotLoadImageURLs(GoogleFetcher::ImageSize size = All);
 
-signals:
-    void signalNewSearch(GoogleImageList &images);
-
 private:
     FileHandle m_file;

--- kdemultimedia/juk/googlefetcherdialog.cpp  #1.17:1.18
@@ -31,5 +31,4 @@
 GoogleFetcherDialog::GoogleFetcherDialog(const QString &name,
                                          const GoogleImageList &imageList,
-                                         uint /* selectedIndex */,
                                          const FileHandle &file,
                                          QWidget *parent) :

--- kdemultimedia/juk/googlefetcherdialog.h  #1.11:1.12
@@ -31,5 +31,4 @@ public:
     GoogleFetcherDialog(const QString &name,
                         const GoogleImageList &urlList,
-                        uint selectedIndex,
                         const FileHandle &file,
                         QWidget *parent = 0);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic