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

List:       kde-devel
Subject:    KFM menus : request for comment
From:       David Faure <David.Faure () insa-lyon ! fr>
Date:       1999-01-06 11:20:47
[Download RAW message or body]

I received the following patch today, with the following ChangeLog.
As it's about menu items and menu organisation, I'd like to have opinions from
kde-look about it. I'm no expert on this matter...

Please tell me what you think of it...

BTW, this kind of patch is very long to test (because of all the changed
numbers), so I don't think it would be wise to apply it before 1.1

--- The ChangeLog

The changes here are NOT necessary but provide my own personal view of how
things should be organized. However, please consider first that what I believe is
a good design/presentation/organization might be a nightmare for you.

Jan 04 1999
* "Cache" menu :
     - Renamed "Show History" to "History" and relocated it to the "View" menu.
       I do not think a user can make the connection between Cache management
       and Browsing History.  Also think that the whole menu should an options under
       "Options-> Configure Browser" dialog !
     - Renamed "Show Cache" to "View". Redundancy (Could have renamed to "Show")
     - Renamed "Clear Cache" to "Clear". Redundant !
     - Renamed "Always look in cache" to "Always Checked First".
     - Renamed "Never look in cache" to "Never Checked"
     - Renamed "Always save cache" to "Enabled"
     - Renamed "Never save cache" to "Disabled"

* "View" menu :
     - Moved "Enable HTML View" to "Options" directory.  This choice is an option
       rather than a view type, although its end effect modifies what the user sees.
     - "Reload Tree" option is now disabled if the "View-> Directory Tree" option is
       not selected.  This option is only necessary to sync/update the Directory Tree
       and as such not needed unless user has activated it.

Jan 02 1998
* "View" menu :
     - Changed the wording of the first three menu items :
          "View Hidden Files"  --> is now "Hidden Files" [reason : View is just \
                redundant]
          "View Tree"            --> is now "Directory Tree" [reason : What tree ?]
          "View Thumbnails"   --> is now "Thumbnails" [reason : redundancy again]
     - Renamed "xxxx View" to "xxxx Mode" where xxxx is Icon|Text|Short|Long. Reason \
for  this modification is again redundancy. 
     - Renamed "HTML View" to "Enable HTML View" and moved it below "xxxx Mode" \
                choices
       as its own line separated item. The concept of HTML View is drastically \
                different than
       the other "xxxx View[Mode]" items.  Hence, I do not even think it belongs \
under the  "View" menu.

* "Options" menu :
     - Grouped the first four items under a "Show" menu.  This change is intended to \
save some  space and group similar functions under one roof.


-- Now the patch, for those who want more details...


diff -Naur kdebase/kfm/kfmgui.cpp kdebase_new/kfm/kfmgui.cpp
--- kdebase/kfm/kfmgui.cpp	Mon Jan  4 10:28:12 1999
+++ kdebase_new/kfm/kfmgui.cpp	Mon Jan  4 19:38:18 1999
@@ -286,22 +286,20 @@
     mview = new QPopupMenu;
     CHECK_PTR( mview );
     mview->setCheckable(true);
-    mview->insertItem( klocale->translate("Show Hi&dden Files"),
+    mview->insertItem( klocale->translate("Hi&dden Files"),
 		       this, SLOT(slotShowDot()) );
-    mview->insertItem( klocale->translate("Show Tr&ee"), 
+    mview->insertItem( klocale->translate("Directory Tr&ee"), 
 		       this, SLOT(slotShowTreeView()) );
-    mview->insertItem( klocale->translate("Sho&w Thumbnails"),
+    mview->insertItem( klocale->translate("Thumb&nails"),
 		       this, SLOT(slotShowSchnauzer()) );
-    mview->insertItem( klocale->translate("&HTML View"),
-		       this, SLOT(slotViewHTML()) );
     mview->insertSeparator();
-    mview->insertItem( klocale->translate("&Icon View"),
+    mview->insertItem( klocale->translate("&Icon Mode"),
 		       this, SLOT(slotIconView()) );
-    mview->insertItem( klocale->translate("&Text View"),
+    mview->insertItem( klocale->translate("&Text Mode"),
 		       this, SLOT(slotTextView()) );
-    mview->insertItem( klocale->translate("&Long View"),
+    mview->insertItem( klocale->translate("&Long List Mode"),
 		       this, SLOT(slotLongView()) );
-    mview->insertItem( klocale->translate("&Short View"),
+    mview->insertItem( klocale->translate("&Short List Mode"),
 		       this, SLOT(slotShortView()) );
     /* mview->insertSeparator();
     mview->insertItem( klocale->translate("Split &window"),
@@ -314,10 +312,13 @@
     mview->insertItem( klocale->translate("Rescan &Bindings"),
 		       this, SLOT(slotRescanBindings()) );
     mview->insertSeparator();
-    mview->insertItem( klocale->translate("&View Frame Source"),
+    mview->insertItem( klocale->translate( "&History" ),
+			this, SLOT( slotShowHistory() ) );    
+    mview->insertItem( klocale->translate("&Frame Source"),
 		       this, SLOT(slotViewFrameSource()) );
-    mview->insertItem( klocale->translate("View Docu&ment Source"),
+    mview->insertItem( klocale->translate("Docu&ment Source"),
 		       this, SLOT(slotViewDocumentSource()) );
+		       
 
     // charsets
     mcharset = new QPopupMenu();
@@ -333,13 +334,29 @@
 	     this, SLOT( slotSetCharset( int ) ) );
     mview->insertSeparator();
     mview->insertItem( klocale->translate("Document Encodin&g"), mcharset );
-
     
     mview->setItemChecked( mview->idAt( 0 ), showDot );
     mview->setItemChecked( mview->idAt( 1 ), bTreeView );
+    mview->setItemEnabled ( mview->idAt( 9 ), bTreeView ); // Enable "Reload Tree" \
Option ONLY when tree is visible !! (Dawit A.)  mview->setItemChecked( mview->idAt( 2 \
                ), visualSchnauzer );
-    mview->setItemChecked( mview->idAt( 3 ), bViewHTML );
-
+    
+    // Moved here by Dawit A. - For better organization - will not affect anything \
!! +    switch (viewMode) 
+    {
+      case ICON_VIEW:
+	mview->setItemChecked( mview->idAt( 4 ), true );
+	break;
+      case TEXT_VIEW:
+	mview->setItemChecked( mview->idAt( 5 ), true );
+	break;
+      case LONG_VIEW:
+	mview->setItemChecked( mview->idAt( 6 ), true );
+	break;
+      case SHORT_VIEW:
+	mview->setItemChecked( mview->idAt( 7 ), true );
+	break;
+    }
+    
     mgo = new QPopupMenu;
     CHECK_PTR( mgo );
     connect( mgo, SIGNAL(aboutToShow()), this, SLOT(slotUpdateHistoryMenu()) );
@@ -348,73 +365,69 @@
     mcache = new QPopupMenu;
     CHECK_PTR( mcache );
     mcache->setCheckable(true);
-    mcache->insertItem( klocale->translate( "Show History" ),
-			this, SLOT( slotShowHistory() ) );
-    mcache->insertItem( klocale->translate( "Show Cache" ),
+    mcache->insertItem( klocale->translate( "&View" ),
 			this, SLOT( slotShowCache() ) );
-    mcache->insertItem( klocale->translate( "Clear Cache" ),
+    mcache->insertItem( klocale->translate( "&Clear" ),
 			this, SLOT( slotClearCache() ) );
     mcache->insertSeparator();
-    mcache->insertItem( klocale->translate( "Always look in cache" ),
+    mcache->insertItem( klocale->translate( "&Always Checked First" ),
 			this, SLOT( slotCacheOn() ) );
-    mcache->insertItem( klocale->translate( "Never look in cache" ),
+    mcache->insertItem( klocale->translate( "&Never Checked" ),
 			this, SLOT( slotCacheOff() ) );
-    mcache->insertItem( klocale->translate( "Always save cache" ),
+    mcache->insertSeparator();			
+    mcache->insertItem( klocale->translate( "&Enabled" ),
 			this, SLOT( slotSaveCacheOn() ) );
-    mcache->insertItem( klocale->translate( "Never save cache" ),
+    mcache->insertItem( klocale->translate( "&Disabled" ),
 			this, SLOT( slotSaveCacheOff() ) );
     
-    mcache->setItemChecked( mcache->idAt( 4 ), HTMLCache::isEnabled() );
-    mcache->setItemChecked( mcache->idAt( 5 ), !HTMLCache::isEnabled() );
+    mcache->setItemChecked( mcache->idAt( 3 ), HTMLCache::isEnabled() );
+    mcache->setItemChecked( mcache->idAt( 4 ), !HTMLCache::isEnabled() );
     mcache->setItemChecked( mcache->idAt( 6 ), HTMLCache::isSaveEnabled() );
     mcache->setItemChecked( mcache->idAt( 7 ), !HTMLCache::isSaveEnabled() );
 
-    moptions = new QPopupMenu;
-    CHECK_PTR( moptions );
-    moptions->setCheckable(true);
-    moptions->insertItem( klocale->translate("Show &Menubar"),
+    moptions_show = new QPopupMenu;
+    CHECK_PTR( moptions_show );
+    moptions_show->setCheckable(true);
+    moptions_show->insertItem( klocale->translate("&Menubar"),
 			  this, SLOT(slotShowMenubar()) );
-    moptions->insertItem( klocale->translate("Show &Statusbar"),
+    moptions_show->insertItem( klocale->translate("&Statusbar"),
 			  this, SLOT(slotShowStatusbar()) );
-    moptions->insertItem( klocale->translate("Show &Toolbar"),
+    moptions_show->insertItem( klocale->translate("&Toolbar"),
 			  this, SLOT(slotShowToolbar()) );
-    moptions->insertItem( klocale->translate("Show &Location bar"),
-			  this, SLOT(slotShowLocationBar()) );
+    moptions_show->insertItem( klocale->translate("&Location bar"),
+			  this, SLOT(slotShowLocationBar()) ); 
+    
+    moptions = new QPopupMenu;
+    CHECK_PTR( moptions );
+    moptions->setCheckable(true);   
+    moptions->insertItem( klocale->translate("&Show"), moptions_show);
+    moptions->insertSeparator();    
+    moptions->insertItem( klocale->translate("Enable &HTML View"),
+		          this, SLOT(slotViewHTML()) );             
     moptions->insertSeparator();
     moptions->insertItem( klocale->translate("Sa&ve Settings"),
                           this, SLOT(slotSaveSettings()) );
     moptions->insertItem( klocale->translate("Save Settings for this &URL"),
                           view, SLOT(slotSaveLocalProperties()));
     if (pkfm->isURLPropesEnabled())
-      moptions->setItemEnabled(moptions->idAt( 6 ), true);
+    {
+      moptions->setItemEnabled(moptions->idAt( 5 ), true);
+    }
     else
-      moptions->setItemEnabled(moptions->idAt( 6 ), false);
+    {
+      moptions->setItemEnabled(moptions->idAt( 5 ), false);
+    }
     moptions->insertSeparator();
     moptions->insertItem( klocale->translate("&Configure File Manager..."),
                           this, SLOT(slotConfigureFileManager()));
     moptions->insertItem( klocale->translate("Configure &Browser..."),
                           this, SLOT(slotConfigureBrowser()));
     
-    moptions->setItemChecked( moptions->idAt( 0 ), showMenubar );
-    moptions->setItemChecked( moptions->idAt( 1 ), showStatusbar );
-    moptions->setItemChecked( moptions->idAt( 2 ), showToolbar );
-    moptions->setItemChecked( moptions->idAt( 3 ), showLocationBar );
-
-    switch (viewMode) 
-      {
-      case ICON_VIEW:
-	mview->setItemChecked( mview->idAt( 5 ), true );
-	break;
-      case TEXT_VIEW:
-	mview->setItemChecked( mview->idAt( 6 ), true );
-	break;
-      case LONG_VIEW:
-	mview->setItemChecked( mview->idAt( 7 ), true );
-	break;
-      case SHORT_VIEW:
-	mview->setItemChecked( mview->idAt( 8 ), true );
-	break;
-      }
+    moptions_show->setItemChecked( moptions_show->idAt( 0 ), showMenubar );
+    moptions_show->setItemChecked( moptions_show->idAt( 1 ), showStatusbar );
+    moptions_show->setItemChecked( moptions_show->idAt( 2 ), showToolbar );
+    moptions_show->setItemChecked( moptions_show->idAt( 3 ), showLocationBar );
+    moptions->setItemChecked( moptions->idAt( 2 ), bViewHTML );
 
     QPopupMenu *nav = new QPopupMenu;
     CHECK_PTR( nav );
@@ -629,11 +642,12 @@
 
   mview->setItemEnabled(mview->idAt( 0 ), has_upURL );
   mview->setItemEnabled(mview->idAt( 2 ), has_upURL );
+  mview->setItemEnabled(mview->idAt( 4 ), has_upURL );
   mview->setItemEnabled(mview->idAt( 5 ), has_upURL );
   mview->setItemEnabled(mview->idAt( 6 ), has_upURL );
   mview->setItemEnabled(mview->idAt( 7 ), has_upURL );
-  mview->setItemEnabled(mview->idAt( 8 ), has_upURL );
-  mview->setItemEnabled(mview->idAt( 11  ), !has_upURL );
+  
+  mview->setItemEnabled(mview->idAt( 10 ), !has_upURL );
   mview->setItemEnabled(mview->idAt( 14 ), !has_upURL );
   mview->setItemEnabled(mview->idAt( 15 ), !has_upURL );
   mview->setItemEnabled(mview->idAt( 17 ), !has_upURL );
@@ -673,16 +687,16 @@
 
 void KfmGui::slotCacheOn()
 {
-    mcache->setItemChecked( mcache->idAt( 4 ), true );
-    mcache->setItemChecked( mcache->idAt( 5 ), false );
+    mcache->setItemChecked( mcache->idAt( 3 ), true );
+    mcache->setItemChecked( mcache->idAt( 4 ), false );
 
     HTMLCache::enableCache( true );
 }
 
 void KfmGui::slotCacheOff()
 {
-    mcache->setItemChecked( mcache->idAt( 4 ), false );
-    mcache->setItemChecked( mcache->idAt( 5 ), true );
+    mcache->setItemChecked( mcache->idAt( 3 ), false );
+    mcache->setItemChecked( mcache->idAt( 4 ), true );
 
     HTMLCache::enableCache( false );
 }
@@ -877,8 +891,8 @@
 
 void KfmGui::slotViewHTML( )
 {
-    bViewHTML = !mview->isItemChecked( mview->idAt(3) );
-    mview->setItemChecked( mview->idAt( 3 ), bViewHTML);
+    bViewHTML = !moptions->isItemChecked( moptions->idAt( 2 ) );
+    moptions->setItemChecked( moptions->idAt( 2 ), bViewHTML);
     bViewHTMLLocal = bViewHTML; //force local mode too (sven)
     view->slotUpdateView();
 }
@@ -886,10 +900,10 @@
 void KfmGui::slotIconView()
 {
     viewMode = ICON_VIEW;
-    mview->setItemChecked( mview->idAt( 5 ), true );
+    mview->setItemChecked( mview->idAt( 4 ), true );
+    mview->setItemChecked( mview->idAt( 5 ), false );
     mview->setItemChecked( mview->idAt( 6 ), false );
     mview->setItemChecked( mview->idAt( 7 ), false );
-    mview->setItemChecked( mview->idAt( 8 ), false );
     viewModeLocal = viewMode; //force local mode too (sven)
     view->slotUpdateView( false );
 }
@@ -897,10 +911,10 @@
 void KfmGui::slotLongView()
 {
     viewMode = LONG_VIEW;
-    mview->setItemChecked( mview->idAt( 5 ), false );
-    mview->setItemChecked( mview->idAt( 6 ), false);
-    mview->setItemChecked( mview->idAt( 7 ), true );
-    mview->setItemChecked( mview->idAt( 8 ), false );
+    mview->setItemChecked( mview->idAt( 4 ), false );
+    mview->setItemChecked( mview->idAt( 5 ), false);
+    mview->setItemChecked( mview->idAt( 6 ), true );
+    mview->setItemChecked( mview->idAt( 7 ), false );
     viewModeLocal = viewMode; //force local mode too (sven)
     view->slotUpdateView( false );
 }
@@ -908,10 +922,10 @@
 void KfmGui::slotTextView()
 {
     viewMode = TEXT_VIEW;
-    mview->setItemChecked( mview->idAt( 5 ), false );
-    mview->setItemChecked( mview->idAt( 6 ), true );
+    mview->setItemChecked( mview->idAt( 4 ), false );
+    mview->setItemChecked( mview->idAt( 5 ), true );
+    mview->setItemChecked( mview->idAt( 6 ), false );
     mview->setItemChecked( mview->idAt( 7 ), false );
-    mview->setItemChecked( mview->idAt( 8 ), false );
     viewModeLocal = viewMode; //force local mode too (sven)
     view->slotUpdateView( false );
 }
@@ -919,10 +933,10 @@
 void KfmGui::slotShortView()
 {
     viewMode = SHORT_VIEW;
+    mview->setItemChecked( mview->idAt( 4 ), false );
     mview->setItemChecked( mview->idAt( 5 ), false );
     mview->setItemChecked( mview->idAt( 6 ), false );
-    mview->setItemChecked( mview->idAt( 7 ), false );
-    mview->setItemChecked( mview->idAt( 8 ), true );
+    mview->setItemChecked( mview->idAt( 7 ), true );
     viewModeLocal = viewMode; //force local mode too (sven)
     view->slotUpdateView( false );
 }
@@ -1196,7 +1210,7 @@
 void KfmGui::slotShowMenubar()
 {
     showMenubar = !showMenubar;
-    moptions->setItemChecked( moptions->idAt( 0 ), showMenubar );
+    moptions_show->setItemChecked( moptions_show->idAt( 0 ), showMenubar );
     if (showMenubar)
 	menu->show();
     else
@@ -1209,7 +1223,7 @@
 void KfmGui::slotShowToolbar()
 {
     showToolbar = !showToolbar;
-    moptions->setItemChecked( moptions->idAt( 2 ), showToolbar );
+    moptions_show->setItemChecked( moptions_show->idAt( 2 ), showToolbar );
     if ( !showToolbar )
 	toolbarButtons->enable( KToolBar::Hide );
     else
@@ -1220,7 +1234,7 @@
 void KfmGui::slotShowLocationBar()
 {
     showLocationBar = !showLocationBar;
-    moptions->setItemChecked( moptions->idAt( 3 ), showLocationBar );
+    moptions_show->setItemChecked( moptions_show->idAt( 3 ), showLocationBar );
     if ( !showLocationBar )
 	toolbarURL->enable( KToolBar::Hide );
     else
@@ -1231,7 +1245,7 @@
 void KfmGui::slotShowStatusbar()
 {
     showStatusbar = !showStatusbar;
-    moptions->setItemChecked( moptions->idAt( 1 ), showStatusbar );
+    moptions_show->setItemChecked( moptions_show->idAt( 1 ), showStatusbar );
     if ( !showStatusbar )
 	statusBar->enable( KStatusBar::Hide );
     else
@@ -1261,7 +1275,8 @@
 {
     bTreeView = !bTreeView;
     mview->setItemChecked( mview->idAt( 1 ), bTreeView );
-
+    mview->setItemEnabled( mview->idAt( 9 ), bTreeView ); // Enable/Disable "Reload \
Tree" option (Dawit A.) +    
     if ( bTreeView )
     {
         if ( !bTreeViewInitialized )
@@ -1546,7 +1561,7 @@
     pkfm->setTreeViewFollowMode( followmode );
 
     for ( w = windowList->first(); w != 0L; w = windowList->next() ) {
-        w->moptions->setItemEnabled(w->moptions->idAt( 6 ), urlprops);
+        w->moptions->setItemEnabled(w->moptions->idAt( 5 ), urlprops);
     }
 
     // -- Group Browser Settings/UserAgent -- (UserAgent tab)
@@ -1715,31 +1730,31 @@
     {
       hasLocal = true;
       
-        mview->setItemChecked( mview->idAt( 3 ), bViewHTMLLocal);
+        moptions->setItemChecked( moptions->idAt( 2 ), bViewHTMLLocal);
         mview->setItemChecked( mview->idAt( 2 ), visualSchnauzerLocal );
         mview->setItemChecked( mview->idAt( 0 ), showDotLocal );
         
+        mview->setItemChecked( mview->idAt( 4 ), false);
         mview->setItemChecked( mview->idAt( 5 ), false);
         mview->setItemChecked( mview->idAt( 6 ), false);
         mview->setItemChecked( mview->idAt( 7 ), false);
-        mview->setItemChecked( mview->idAt( 8 ), false);
 
         switch (viewModeLocal)
         {
           case ICON_VIEW:
-            mview->setItemChecked( mview->idAt( 5 ), true );
+            mview->setItemChecked( mview->idAt( 4 ), true );
             break;
+          
+          case TEXT_VIEW:
+            mview->setItemChecked( mview->idAt( 5 ), true );
+            break;            
 
           case LONG_VIEW:
-            mview->setItemChecked( mview->idAt( 7 ), true );
+            mview->setItemChecked( mview->idAt( 6 ), true );
             break;
 
           case SHORT_VIEW:
-            mview->setItemChecked( mview->idAt( 8 ), true );
-            break;
-
-          case TEXT_VIEW:
-            mview->setItemChecked( mview->idAt( 6 ), true );
+            mview->setItemChecked( mview->idAt( 7 ), true );
             break;
 	}
     }
@@ -1978,7 +1993,7 @@
   if (!hasLocal) // reset checkboxes to global state
   {
     if (bViewHTML != bViewHTMLLocal)
-      mview->setItemChecked( mview->idAt( 3 ), bViewHTML);
+      moptions->setItemChecked( moptions->idAt( 2 ), bViewHTML);
 
     if (visualSchnauzer != visualSchnauzerLocal)
       mview->setItemChecked( mview->idAt( 2 ), visualSchnauzer);
@@ -1988,27 +2003,27 @@
 
     if (viewMode != viewModeLocal)
     {
+      mview->setItemChecked( mview->idAt( 4 ), false);
       mview->setItemChecked( mview->idAt( 5 ), false);
       mview->setItemChecked( mview->idAt( 6 ), false);
       mview->setItemChecked( mview->idAt( 7 ), false);
-      mview->setItemChecked( mview->idAt( 8 ), false);
 
       switch (viewMode)
       {
 	case ICON_VIEW:
+	  mview->setItemChecked( mview->idAt( 4 ), true );
+	  break;
+	
+	case TEXT_VIEW:
 	  mview->setItemChecked( mview->idAt( 5 ), true );
 	  break;
 
 	case LONG_VIEW:
-	  mview->setItemChecked( mview->idAt( 7 ), true );
+	  mview->setItemChecked( mview->idAt( 6 ), true );
 	  break;
 
 	case SHORT_VIEW:
-	  mview->setItemChecked( mview->idAt( 8 ), true );
-	  break;
-
-	case TEXT_VIEW:
-	  mview->setItemChecked( mview->idAt( 6 ), true );
+	  mview->setItemChecked( mview->idAt( 7 ), true );
 	  break;
       }
     }
diff -Naur kdebase/kfm/kfmgui.h kdebase_new/kfm/kfmgui.h
--- kdebase/kfm/kfmgui.h	Mon Jan  4 10:28:12 1999
+++ kdebase_new/kfm/kfmgui.h	Mon Jan  4 14:19:21 1999
@@ -618,6 +618,7 @@
     QPopupMenu *mgo;
     QPopupMenu *mcache;
     QPopupMenu *moptions;
+    QPopupMenu *moptions_show;
     
     /**
      * The menu "New" in the "File" menu.


----- End forwarded message -----

-- 
 ____________________________________________________________________
> > 
> David FAURE                                                       |
> E-mail : David.Faure@insa-lyon.fr, faure@kde.org                  |
> http://www.insa-lyon.fr/People/AEDI/dfaure/index.html             |
> ____________________________________________________________________|


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

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