[Digikam-devel] [Bug 127614] [CameraUI] Focus steal when typing custom prefix in renaming options sidebar

Marcel Wiesweg marcel.wiesweg at gmx.de
Tue Sep 19 15:37:34 BST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=127614         




------- Additional Comments From marcel.wiesweg gmx de  2006-09-19 16:37 -------
SVN commit 586413 by mwiesweg:

Cam GUI:
- Remove "flicker" of settings tab
- make keyboard navigation possible again

Flicker was caused from two sides:
- handling of signalChanged from RenameCustomizer
  and signalSelectionChanged from IconView was entangled in one method,
  slotDownloadNamesChanged. Splitting that up, no signalNewSelection is
  emitted any more in response to a signalChanged
- Fast dis/enabling will create the impression of flicker and lose focus (127614)
  Only disable now when downloading.
  Previously, signalSelected -> getExif -> slotBusy (disable tab),
    when Exif is ready -> slotBusy (enable tab)

CC'ing 127614 because this explains the reason for the reported bug, and
because I removed the restoreFocus again, which broke keyboard
navigation, but does not seem to be needed any more.

CCBUG: 127614



 M  +27 -21    cameraiconview.cpp  
 M  +1 -0      cameraiconview.h  
 M  +9 -2      cameraui.cpp  


--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraiconview.cpp #586412:586413
 @ -106,14 +106,17  @
     // ----------------------------------------------------------------
 
     connect(this, SIGNAL(signalSelectionChanged()),
-            this, SLOT(slotDownloadNameChanged()));
-            
+            this, SLOT(slotSelectionChanged()));
+
+    connect(this, SIGNAL(signalNewSelection(bool)),
+            this, SLOT(slotUpdateDownloadNames(bool)));
+
     connect(this, SIGNAL(signalRightButtonClicked(IconItem*, const QPoint&)),
             this, SLOT(slotContextMenu(IconItem*, const QPoint&)));
 
     connect(this, SIGNAL(signalRightButtonClicked(const QPoint &)),
             this, SLOT(slotRightButtonClicked(const QPoint &)));
-            
+
     connect(this, SIGNAL(signalDoubleClicked(IconItem*)),
             this, SLOT(slotDoubleClicked(IconItem*)));
 
 @ -242,6 +245,21  @
 
 void CameraIconView::slotDownloadNameChanged()
 {
+    bool hasSelection = false;
+    for (IconItem* item = firstItem(); item; item = item->nextItem())
+    {
+        if (item->isSelected())
+        {
+            hasSelection = true;
+            break;
+        }
+    }
+
+    slotUpdateDownloadNames(hasSelection);
+}
+
+void CameraIconView::slotUpdateDownloadNames(bool hasSelection)
+{
     bool useDefault = true;
     int  startIndex = 0;
 
 @ -256,18 +274,6  @
 
     viewport()->setUpdatesEnabled(false);
 
-    bool hasSelection = false;
-    for (IconItem* item = firstItem(); item; item = item->nextItem())
-    {
-        if (item->isSelected())
-        {
-            hasSelection = true;
-            break;
-        }
-    }
-
-    emit signalNewSelection(hasSelection);
-
     if (hasSelection)
     {
         // Camera items selection.
 @ -330,12 +336,10  @
             startIndex++;
         }
     }
-    
+
     rearrangeItems();
     viewport()->setUpdatesEnabled(true);
     viewport()->update();
-
-    slotSelectionChanged();
 }
 
 QString CameraIconView::getTemplatedName(const GPItemInfo* itemInfo, int position)
 @ -384,9 +388,8  @
 {
     bool selected               = false;
     CameraIconViewItem* camItem = 0;
-    
-    for (IconItem* item = firstItem(); item;
-         item = item->nextItem())
+
+    for (IconItem* item = firstItem(); item; item = item->nextItem())
     {
         if (item->isSelected())
         {
 @ -396,7 +399,10  @
         }
     }
 
+    emit signalNewSelection(selected);
     emit signalSelected(camItem, selected);
+
+    viewport()->update();
 }
 
 void CameraIconView::slotContextMenu(IconItem * item, const QPoint&)
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraiconview.h #586412:586413
 @ -107,6 +107,7  @
     void slotContextMenu(IconItem* item, const QPoint& pos);
     void slotDoubleClicked(IconItem* item);
     void slotThemeChanged();
+    void slotUpdateDownloadNames(bool hasSelection);
 
 protected:
 
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #586412:586413
 @ -711,7 +711,8  @
 
         d->advBox->setEnabled(true);
         // B.K.O #127614: The Focus need to be restored in custom prefix widget.
-        d->renameCustomizer->restoreFocus();
+        //commenting this out again:  If we do not disable, no need to restore focus
+        //d->renameCustomizer->restoreFocus();
 
         enableButton(User3, true);
         enableButton(User2, true);
 @ -738,7 +739,9  @
 
         d->busy = true;
         d->cancelBtn->setEnabled(true);
-        d->advBox->setEnabled(false);
+        // Settings tab is disabled in slotDownload, selectively when downloading
+        // Fast dis/enabling would create the impression of flicker, e.g. when retrieving EXIF from camera
+        //d->advBox->setEnabled(false);
 
         enableButton(User3, false);
         enableButton(User2, false);
 @ -1183,6 +1186,10  @
     d->progress->setProgress(0);
     d->progress->setTotalSteps(total);
     d->progress->show();
+
+    // disable settings tab here instead of slotBusy:
+    // Only needs to be disabled while downloading
+    d->advBox->setEnabled(false);
 }
 
 void CameraUI::slotDownloaded(const QString& folder, const QString& file, int status)



More information about the Digikam-devel mailing list