--- FLFormDB.cpp 2008-12-06 03:28:15.000000000 +0100 +++ abanq-2.3-linux-src/src/flbase/FLFormDB.cpp 2009-03-02 16:47:19.000000000 +0100 @@ -99,7 +99,7 @@ } bool FLFormDB::close() { - if ( isClosing_ ) + if ( isClosing_ ) return true; isClosing_ = true; isClosing_ = QWidget::close(); @@ -197,6 +197,18 @@ pushButtonCancel->show(); mainWidget_ = w; + + // dpinelo: Tras establecer el widget, establecemos las medidas guardadas del formulario + QSettings settings; + settings.setPath( "InfoSiAL", "FacturaLUX", QSettings::User ); + QString keybase( "/facturalux/lite/formularios/" ); + int x = settings.readNumEntry( keybase + "FLFormDB" + name_ + "x", 0 ); + int y = settings.readNumEntry( keybase + "FLFormDB" + name_ + "y", 0 ); + int width = settings.readNumEntry( keybase + "FLFormDB" + name_ + "w", 0 ); + int h = settings.readNumEntry( keybase + "FLFormDB" + name_ + "h", 0 ); + if ( x > 0 && y > 0 && width > 0 && h > 0 ) + this->setGeometry(x, y, width, h); + } void FLFormDB::initScript() { @@ -222,6 +234,18 @@ } void FLFormDB::closeEvent( QCloseEvent * e ) { + +// dpinelo: Agregado para guardar y conocer los tamaņos de las ventanas + // dpinelo: Tras establecer el widget, establecemos las medidas guardadas del formulario + QSettings settings; + settings.setPath( "InfoSiAL", "FacturaLUX", QSettings::User ); + QString keybase( "/facturalux/lite/formularios/" ); + QRect geo = this->geometry(); + settings.writeEntry( keybase + "FLFormDB" + name_ + "x", geo.x() ); + settings.writeEntry( keybase + "FLFormDB" + name_ + "y", geo.y() ); + settings.writeEntry( keybase + "FLFormDB" + name_ + "w", geo.width() ); + settings.writeEntry( keybase + "FLFormDB" + name_ + "h", geo.height() ); + if ( focusWidget() ) { FLFieldDB * fdb = ::qt_cast( focusWidget()->parentWidget() ); if ( fdb && fdb->autoComFrame_ && fdb->autoComFrame_->isVisible() ) { @@ -279,7 +303,18 @@ FLAccessControlLists * acl = static_cast( qApp ) ->acl(); if ( acl ) acl->process( this ); - this->resize( size().expandedTo( mWidget->size() ) ); + + QSettings settings; + settings.setPath( "InfoSiAL", "FacturaLUX", QSettings::User ); + QString keybase( "/facturalux/lite/formularios/" ); + int width = settings.readNumEntry( keybase + "FLFormDB" + name_ + "w", 0 ); + int h = settings.readNumEntry( keybase + "FLFormDB" + name_ + "h", 0 ); + if ( x > 0 && y > 0 && width > 0 && h > 0 ) { + QSize tamanio (width, h); + this->resize( tamanio ); + } else { + this->resize( size().expandedTo( mWidget->size() ) ); + } if ( !initFocusWidget_ ) { itf.toFirst(); @@ -348,3 +383,4 @@ void FLFormDB::setMaximized() { setWindowState( windowState() | WindowMaximized ); } +