]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0021953: EDF GUI 2435 : The "desktop" section of the preference file may prevent... V6_6_0b1
authorvsr <vsr@opencascade.com>
Mon, 12 Nov 2012 09:18:47 +0000 (09:18 +0000)
committervsr <vsr@opencascade.com>
Mon, 12 Nov 2012 09:18:47 +0000 (09:18 +0000)
src/LightApp/LightApp_Application.cxx
src/Qtx/QtxMainWindow.cxx
src/Qtx/QtxMainWindow.h

index 040503db1717cb4ff204cc8e6707edf7a74b1dac..cf0163b5a2d40b291ef0894af0a7a4558d213a0b 100644 (file)
@@ -254,6 +254,7 @@ LightApp_Application::LightApp_Application()
 
   STD_TabDesktop* desk = new STD_TabDesktop();
   desk->setFullScreenAllowed(false);
+  desk->setMinimizeAllowed(false);
 
   setDesktop( desk );
 
index d8aa1e33f99d82cd82435a4666f04d8a7bd7b83c..574b8b0bb2a04be92bf34f053d11a90e71c8e7f8 100644 (file)
@@ -242,7 +242,8 @@ QtxMainWindow::QtxMainWindow( QWidget* parent, Qt::WindowFlags f )
   myOpaque( true ),
   myResizer( 0 ),
   myMouseMove( 0 ),
-  myFullScreenAllowed(true)
+  myFullScreenAllowed(true),
+  myMinimizeAllowed(true)
 {
   //rnv: Enables tooltips for inactive windows.
   //rnv: For details see http://bugtracker.opencascade.com/show_bug.cgi?id=20893
@@ -398,7 +399,7 @@ QString QtxMainWindow::storeGeometry() const
     state = QString( "max" );
     break;
   case Qt::WindowMinimized:
-    state = QString( "min" );
+    if ( isMinimizeAllowed() ) state = QString( "min" );
     break;
   case Qt::WindowFullScreen:
     state = isFullScreenAllowed() ? QString( "full" ) : QString( "max" );
@@ -482,12 +483,16 @@ void QtxMainWindow::retrieveGeometry( const QString& str )
   if ( stRx.indexIn( geom ) != -1 )
   {
     QString stStr = stRx.cap( 1 ).trimmed().toLower();
-    if ( stStr.startsWith( QString( "max" ) ) )
+    if ( stStr.startsWith( QString( "max" ) ) ) {
       state = Qt::WindowMaximized;
-    else if ( stStr.startsWith( QString( "min" ) ) )
-      state = Qt::WindowMinimized;
-    else if ( stStr.startsWith( QString( "full" ) ) )
-      state = Qt::WindowFullScreen;
+    }
+    else if ( stStr.startsWith( QString( "min" ) ) ) {
+      if ( isMinimizeAllowed() )
+       state = Qt::WindowMinimized;
+    }
+    else if ( stStr.startsWith( QString( "full" ) ) ) {
+      state = isFullScreenAllowed() ? Qt::WindowFullScreen : Qt::WindowMaximized;
+    }
   }
 
   resize( rect.size() );
@@ -629,7 +634,7 @@ bool QtxMainWindow::event( QEvent* e )
 /*!
   \brief FullScreenAllowed flag allowed dump in the main window geometry 
          Qt::WindowFullScreen parameter.
-  \return \c fullScreenAllowed flag.
+  \return \c FullScreenAllowed flag.
 */
 bool QtxMainWindow::isFullScreenAllowed() const {
   return myFullScreenAllowed;
@@ -639,8 +644,27 @@ bool QtxMainWindow::isFullScreenAllowed() const {
 /*!
   \brief Set FullScreenAllowed flag.
          The default value is true.
-  \param f value of the fullScreenAllowed flag.
+  \param f value of the FullScreenAllowed flag.
 */
 void QtxMainWindow::setFullScreenAllowed( const bool f ) {
     myFullScreenAllowed = f;
 }
+
+/*!
+  \brief MinimizeAllowed flag allowed dump in the main window geometry 
+         Qt::WindowMinimized parameter.
+  \return \c MinimizeAllowed flag.
+*/
+bool QtxMainWindow::isMinimizeAllowed() const {
+  return myMinimizeAllowed;
+}
+
+
+/*!
+  \brief Set MinimizeAllowed flag.
+         The default value is true.
+  \param f value of the MinimizeAllowed flag.
+*/
+void QtxMainWindow::setMinimizeAllowed( const bool f ) {
+    myMinimizeAllowed = f;
+}
index 5148f1d8e720ae18969c685e788828874b3cc42a..8de97eb0b6450194f9e5c06bf1a5487d46ed2910 100644 (file)
@@ -57,6 +57,9 @@ public:
   bool              isFullScreenAllowed() const;
   void              setFullScreenAllowed( const bool );
 
+  bool              isMinimizeAllowed() const;
+  void              setMinimizeAllowed( const bool );
+
 protected:
   virtual bool      event( QEvent* );
 
@@ -71,6 +74,7 @@ private:
   QToolBar*         myStatusBar;     //!< dockable status bar
 
   bool              myFullScreenAllowed;
+  bool              myMinimizeAllowed;
 
   bool              myOpaque;
   Resizer*          myResizer;