41 #define YUILogComponent "ncurses-pkg"
44 #include "YMenuButton.h"
47 #include "NCLayoutBox.h"
48 #include "NCSpacing.h"
49 #include "NCPkgStrings.h"
51 #include "NCPushButton.h"
52 #include "NCPkgTable.h"
53 #include "NCRichText.h"
58 #include "NCPkgPopupDescr.h"
59 #include "NCPackageSelector.h"
74 : NCPopup( at, false )
91 NCPkgPopupDescr::~NCPkgPopupDescr()
103 void NCPkgPopupDescr::createLayout( )
106 NCLayoutBox * split =
new NCLayoutBox(
this, YD_VERT );
108 new NCSpacing( split, YD_VERT,
false, 0.8 );
110 headline =
new NCLabel( split,
"",
true,
false );
111 new NCSpacing( split, YD_VERT,
false, 0.4 );
114 descrText =
new NCRichText( split,
"" );
116 new NCSpacing( split, YD_VERT,
true, 0.6 );
118 YTableHeader * tableHeader =
new YTableHeader();
121 pkgTable =
new NCPkgTable( split, tableHeader );
125 new NCSpacing( split, YD_VERT,
true, 0.6 );
128 new NCLabel( split, _(
" [+] Select [-] Delete [>] Update " ),
false,
false );
130 new NCSpacing( split, YD_VERT,
false, 0.6 );
134 okButton->setFunctionKey( 10 );
145 bool NCPkgPopupDescr::fillData( ZyppPkg pkgPtr, ZyppSel slbPtr )
156 headline->setLabel( pkgPtr->summary() );
158 descrText->setText( pkgPtr->description() );
171 NCursesEvent NCPkgPopupDescr::showInfoPopup( ZyppPkg pkgPtr, ZyppSel slbPtr )
173 postevent = NCursesEvent();
175 fillData( pkgPtr, slbPtr );
180 }
while ( postAgain() );
196 long NCPkgPopupDescr::nicesize(YUIDimension dim)
199 if ( NCurses::lines() > 17 )
202 vdim = NCurses::lines()-4;
204 return ( dim == YD_HORIZ ? NCurses::cols()*2/3 : vdim );
215 NCursesEvent NCPkgPopupDescr::wHandleInput( wint_t ch )
218 return NCursesEvent::cancel;
220 if ( ch == KEY_RETURN )
221 return NCursesEvent::button;
223 return NCDialog::wHandleInput( ch );
234 bool NCPkgPopupDescr::postAgain()
236 if ( ! postevent.widget )
239 if ( postevent == NCursesEvent::button || postevent == NCursesEvent::cancel )