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

List:       kde-usability
Subject:    KFileDialog toolbar
From:       "Aaron J. Seigo" <aseigo () olympusproject ! org>
Date:       2002-06-29 3:12:01
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi...

something that has bugged me about KFileDialog for a while is the toolbar.

in specific there is the "gear menu" that has some view options, and then 
there are some view options on the toolbar. this means that the user has to 
learn two differenet UI pathways to change view settings. 

the toolbar icons are also only meaningful if you know what they do (e.g. 
experimentation. there are tooltips, but it could be better.

also in the view submenu of the gear menu there is a radio group consisting of 
"Single view" and "Seperate Directories" .. in reality this is just a 
toggling on and off of the seperate directories sidebar .. it would make 
sense in its current form if other view options could be defined at run time 
(thereby inflating the number of radio group options to be >2) .. however, it 
seems this is not possible currently?

there is also a keyboard shortcut for the shortcuts sidebar but not for the 
preview area, which is inconsistent as from the user's perspective these 
things are the same type of "thing", that is: an side add-on to the main 
view.

so i finally sat down tonight and did something about it. the rather 
unexciting but IMO more consistent results can be seen at:

	http://urbanlizard.com/~aseigo/kfiledlg.png

or tried out first hand by applying the attached patch to kdelibs/kio/kfile

the two things i'm uncertain about:

 o does anything outside of kdiroperator and kfiledialog use the "single" 
action? (i can search lxr if nobody knows)
 o are view add-ons supported through some mechanism right now?
 
note that the only change to any header was the removal of a private slot from 
kdiroperator.

comments?

- -- 
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

"Everything should be made as simple as possible, but not simpler" 
    - Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9HSWC1rcusafx20MRAi39AKCeaF+jiXZX2WQ/mTNc8wSVc/9rDgCdFVEU
tS7Hb3ArA8KErahBT5mq+r0=
=u0x/
-----END PGP SIGNATURE-----

["kfiledialog_toolbar_reorder.diff" (text/x-diff)]

Index: kdiroperator.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kfile/kdiroperator.cpp,v
retrieving revision 1.149
diff -u -3 -d -p -r1.149 kdiroperator.cpp
--- kdiroperator.cpp	2002/05/31 13:34:00	1.149
+++ kdiroperator.cpp	2002/06/29 05:22:48
@@ -243,24 +243,24 @@ void KDirOperator::slotToggleHidden( boo
         m_fileView->listingCompleted();
 }
 
-void KDirOperator::slotSingleView()
-{
-    KFile::FileView view = static_cast<KFile::FileView>(
-        m_viewKind & ~(KFile::PreviewContents |
-                     KFile::PreviewInfo |
-                     KFile::SeparateDirs ));
-
-    setView( view );
-}
-
 void KDirOperator::slotSeparateDirs()
 {
-    KFile::FileView view = static_cast<KFile::FileView>(
-        (m_viewKind & ~(KFile::PreviewContents |
-                      KFile::PreviewInfo)
-         | KFile::SeparateDirs ));
-
-    setView( view );
+    if (separateDirsAction->isChecked())
+    {
+        KFile::FileView view = static_cast<KFile::FileView>(
+            (m_viewKind & ~(KFile::PreviewContents |
+                           KFile::PreviewInfo ) |
+                           KFile::SeparateDirs ));
+        setView( view );
+    }
+    else
+    {
+        KFile::FileView view = static_cast<KFile::FileView>(
+            m_viewKind & ~(KFile::PreviewContents |
+                            KFile::PreviewInfo
+             | KFile::SeparateDirs ));
+        setView( view );
+    }
 }
 
 void KDirOperator::slotDefaultPreview()
@@ -809,7 +809,7 @@ void KDirOperator::setView( KFile::FileV
             return;
         }
         else if ( !separateDirs )
-            (static_cast<KRadioAction*>( myActionCollection->action("single") ))->setChecked(true);
+            separateDirsAction->setChecked(true);
 
     }
 
@@ -1141,15 +1141,11 @@ void KDirOperator::setupActions()
 
     showHiddenAction = new KToggleAction( i18n("Show Hidden Files"), 0,
                                           myActionCollection, "show hidden" );
-    KRadioAction *singleAction = new KRadioAction( i18n("Single View"), 0,
-                                                   this,
-                                                   SLOT( slotSingleView() ),
-                                                   myActionCollection, "single" );
-    separateDirsAction = new KRadioAction( i18n("Separate Directories"), 0,
+    separateDirsAction = new KToggleAction( i18n("Separate Directories"), 0,
                                             this,
                                             SLOT(slotSeparateDirs()),
                                             myActionCollection, "separate dirs" );
-    KToggleAction *previewAction = new KToggleAction(i18n("Preview"),
+    KToggleAction *previewAction = new KToggleAction(i18n("Show Preview"),
                                                      "thumbnail", 0,
                                                      myActionCollection,
                                                      "preview" );
@@ -1157,10 +1153,6 @@ void KDirOperator::setupActions()
              SLOT( togglePreview( bool )));
 
 
-    QString combiView = QString::fromLatin1("combiview");
-    singleAction->setExclusiveGroup( combiView );
-    separateDirsAction->setExclusiveGroup( combiView );
-
     QString viewGroup = QString::fromLatin1("view");
     shortAction->setExclusiveGroup( viewGroup );
     detailedAction->setExclusiveGroup( viewGroup );
@@ -1190,9 +1182,11 @@ void KDirOperator::setupMenu()
 //     viewActionMenu->insert( shortAction );
 //     viewActionMenu->insert( detailedAction );
 //     viewActionMenu->insert( actionSeparator );
-    viewActionMenu->insert( showHiddenAction );
+    viewActionMenu->insert( myActionCollection->action( "short view" ) );
+    viewActionMenu->insert( myActionCollection->action( "detailed view" ) );
     viewActionMenu->insert( actionSeparator );
-    viewActionMenu->insert( myActionCollection->action( "single" ));
+    viewActionMenu->insert( showHiddenAction );
+//    viewActionMenu->insert( myActionCollection->action( "single" ));
     viewActionMenu->insert( separateDirsAction );
     // Warning: adjust slotViewActionAdded() and slotViewActionRemoved()
     // when you add/remove actions here!
Index: kdiroperator.h
===================================================================
RCS file: /home/kde/kdelibs/kio/kfile/kdiroperator.h,v
retrieving revision 1.75
diff -u -3 -d -p -r1.75 kdiroperator.h
--- kdiroperator.h	2002/05/14 19:09:28	1.75
+++ kdiroperator.h	2002/06/29 05:22:48
@@ -772,7 +772,6 @@ private slots:
     void slotSimpleView();
     void slotToggleHidden( bool );
 
-    void slotSingleView();
     void slotSeparateDirs();
     void slotDefaultPreview();
     void togglePreview( bool );
Index: kfiledialog.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kfile/kfiledialog.cpp,v
retrieving revision 1.304
diff -u -3 -d -p -r1.304 kfiledialog.cpp
--- kfiledialog.cpp	2002/05/11 00:05:54	1.304
+++ kfiledialog.cpp	2002/06/29 05:22:49
@@ -332,16 +332,14 @@ KFileDialog::KFileDialog(const QString& 
     menu->insert( coll->action( "separator" ));
     menu->insert( coll->action( "view menu" ));
     menu->insert( showSidebarAction );
+    coll->action( "preview" )->setShortcut(Key_F10);
+    menu->insert( coll->action( "preview" ));
     menu->insert( coll->action( "separator" ));
     menu->insert( coll->action( "properties" ));
     menu->setDelayed( false );
     connect( menu->popupMenu(), SIGNAL( aboutToShow() ),
              ops, SLOT( updateSelectionDependentActions() ));
     menu->plug( toolbar );
-
-    coll->action( "short view" )->plug( toolbar );
-    coll->action( "detailed view" )->plug( toolbar );
-    coll->action( "preview")->plug( toolbar );
 
     connect(toolbar, SIGNAL(clicked(int)),
             SLOT(toolbarCallback(int)));

_______________________________________________
kde-usability mailing list
kde-usability@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-usability

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

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