Revision: 76944
          http://sourceforge.net/p/brlcad/code/76944
Author:   starseeker
Date:     2020-08-25 15:41:33 +0000 (Tue, 25 Aug 2020)
Log Message:
-----------
Runtime display manager type switching with dmtype never worked all that well, 
and currently doesn't work at all.  Move the type reporting function (dmtype 
with no args reported the currently running dm type) to a subcommand of the dm 
command where it should have been in the first place (dmtype -> dm type).  
Remove the runtime dm type setting - to change MGED display manager types, 
alter the mged_default(dm_type) property in .mgedrc

Modified Paths:
--------------
    brlcad/trunk/src/mged/attach.c
    brlcad/trunk/src/tclscripts/mged/CMakeLists.txt

Removed Paths:
-------------
    brlcad/trunk/src/tclscripts/mged/dmtype.tcl

Modified: brlcad/trunk/src/mged/attach.c
===================================================================
--- brlcad/trunk/src/mged/attach.c      2020-08-25 14:29:18 UTC (rev 76943)
+++ brlcad/trunk/src/mged/attach.c      2020-08-25 15:41:33 UTC (rev 76944)
@@ -597,6 +597,17 @@
        return TCL_OK;
     }
 
+    if (BU_STR_EQUAL(argv[1], "type")) {
+       if (argc != 2) {
+           bu_vls_printf(&vls, "help dm");
+           Tcl_Eval(interpreter, bu_vls_addr(&vls));
+           bu_vls_free(&vls);
+           return TCL_ERROR;
+       }
+       Tcl_AppendResult(interpreter, dm_get_type(DMP), (char *)NULL);
+       return TCL_OK;
+    }
+
     if (!cmd_hook) {
        const char *dm_name = dm_get_dm_name(DMP);
        if (dm_name) {

Modified: brlcad/trunk/src/tclscripts/mged/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/tclscripts/mged/CMakeLists.txt     2020-08-25 14:29:18 UTC 
(rev 76943)
+++ brlcad/trunk/src/tclscripts/mged/CMakeLists.txt     2020-08-25 15:41:33 UTC 
(rev 76944)
@@ -21,7 +21,6 @@
   cycle.tcl
   dbfindtree.tcl
   dbupgrade.tcl
-  dmtype.tcl
   e_id.tcl
   edit_menu.tcl
   edit_solid.tcl

Deleted: brlcad/trunk/src/tclscripts/mged/dmtype.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/mged/dmtype.tcl 2020-08-25 14:29:18 UTC (rev 
76943)
+++ brlcad/trunk/src/tclscripts/mged/dmtype.tcl 2020-08-25 15:41:33 UTC (rev 
76944)
@@ -1,88 +0,0 @@
-#
-#                        D M T Y P E . T C L
-# BRL-CAD
-#
-# Copyright (c) 2009-2020 United States Government as represented by
-# the U.S. Army Research Laboratory.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# version 2.1 as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this file; see the file named COPYING for more
-# information.
-#
-###
-#
-# Description -
-#       Without arguments, reports current display manager type.  With the
-#   "set" argument, if display manager type supplied is different from
-#   current type, destroy old display manager and start up new ones of the
-#   new type.
-#
-# Usage:
-#       dmtype
-#       dmtype set {X, ogl, rtgl, ...}
-#
-proc dmtype {args} {
-  global mged_gui
-  global mged_default
-  global mged_players
-  global mged_display
-  set id $mged_players
-
-  set argc [llength $args]
-  if {$argc == 0} {
-    return $mged_gui($id,dtype)
-  }
-  if {$argc == 1} {
-    return [help dmtype]
-  }
-  if {$argc > 2} {
-    return [help dmtype]
-  }
-  set arg [lindex $args 0]
-  if {$arg != "set"} {
-    return [help dmtype]
-  }
-  set dtype [lindex $args 1]
-
-  set oldaet [_mged_ae]
-
-  # New dm type is requested
-  catch { release $mged_gui($id,top).ur }
-  catch { release $mged_gui($id,top).ul }
-  catch { release $mged_gui($id,top).lr }
-  catch { release $mged_gui($id,top).ll }
-  destroy $mged_gui($id,top).ulF
-  destroy $mged_gui($id,top).urF
-  destroy $mged_gui($id,top).llF
-  destroy $mged_gui($id,top).lrF
-
-  openmv $id $mged_gui($id,top) $mged_gui($id,dmc) $mged_default(display) 
$dtype
-
-  grid $mged_gui($id,dmc).$mged_gui($id,dm_loc)\F -in $mged_gui($id,dmc) 
-sticky "nsew" -row 0 -column 0
-
-  set mged_gui($id,dtype) $dtype
-
-  mged_apply_local $id "rset cs mode 0"
-  rset cs mode 1
-
-  ae [lindex $oldaet 0] [lindex $oldaet 1] [lindex $oldaet 2]
-}
-
-
-# Local Variables:
-# mode: Tcl
-# tab-width: 8
-# c-basic-offset: 4
-# tcl-indent-level: 4
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=4 tabstop=8

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to