[yast-commit] r41991 - in /branches/tmp/sh/mod-ui/ncurses/src/pkg: NCPackageSelector.cc NCPkgPopupDiskspace.cc
Author: gs Date: Tue Nov 13 09:39:31 2007 New Revision: 41991 URL: http://svn.opensuse.org/viewcvs/yast?rev=41991&view=rev Log: activate/fix diskspace popup Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc?rev=41991&r1=41990&r2=41991&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc Tue Nov 13 09:39:31 2007 @@ -266,10 +266,10 @@ #if 0 // the dependency popup depsPopup = new NCPkgPopupDeps( wpos( 3, 8 ), this ); - +#endif + // the disk space popup diskspacePopup = new NCPkgPopupDiskspace( wpos( (NCurses::lines() - 15)/2, NCurses::cols()/6 ), testMode ); -#endif } YStringTreeItem * NCPackageSelector::getDefaultRpmGroup() Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc?rev=41991&r1=41990&r2=41991&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc Tue Nov 13 09:39:31 2007 @@ -99,14 +99,11 @@ // void NCPkgPopupDiskspace::createLayout( ) { - - YWidgetOpt opt; - // the vertical split is the (only) child of the dialog NCLayoutBox * split = new NCLayoutBox( this, YD_VERT ); // addChild() is obsolete (handled by new libyui) - + head = new NCLabel( split, "", true, false ); // isHeading = true YTableHeader * tableHeader = new YTableHeader(); @@ -117,12 +114,12 @@ tableHeader->addColumn( "% ", YAlignBegin ); // add the partition table - //partitions = new NCTable( split, opt, header, false ); partitions = new NCTable( split, tableHeader ); + // add the ok button - opt.key_Fxx.setValue( 10 ); okButton = new NCPushButton( split, NCPkgNames::OKLabel() ); YStringWidgetID * okID = new YStringWidgetID( "ok" ); + okButton->setFunctionKey( 10 ); okButton->setId( okID ); } @@ -137,11 +134,9 @@ // void NCPkgPopupDiskspace::fillPartitionTable() { - //partitions->itemsCleared(); // clear table - partitions->deleteAllItems(); - - vector<string> pkgLine; - pkgLine.reserve(5); + partitions->deleteAllItems(); // clear table + + YTableItem * newItem; int i = 0; zypp::ZYpp::Ptr z = zypp::getZYpp(); @@ -164,21 +159,19 @@ if (it->readonly) continue; - pkgLine.clear(); - pkgLine.push_back (it->dir); - zypp::ByteCount pkg_used (it->pkg_size * 1024); - pkgLine.push_back (pkg_used.asString (8)); zypp::ByteCount pkg_available ((it->total_size - it->pkg_size) * 1024); - pkgLine.push_back (pkg_available.asString (8)); zypp::ByteCount total (it->total_size * 1024); - pkgLine.push_back (total.asString (8)); - pkgLine.push_back( usedPercent( it->pkg_size, it->total_size ) ); - // FIXME - //partitions->itemAdded( pkgLine, i ); + newItem = new YTableItem( it->dir, + pkg_used.asString (8), + pkg_available.asString (8), + total.asString (8), + usedPercent( it->pkg_size, it->total_size ) ); + + partitions->addItem( newItem ); i++; } @@ -413,20 +406,6 @@ popdownDialog(); } - -#if 0 -long NCPkgPopupDiskspace::nicesize(YUIDimension dim) -{ - long vdim; - if ( NCurses::lines() > 15 ) - vdim = 15; - else - vdim = NCurses::lines()-4; - - return ( dim == YD_HORIZ ? NCurses::cols()*2/3 : vdim ); -} -#endif - /////////////////////////////////////////////////////////////////// // // -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
gs@svn.opensuse.org