41 #ifndef NCPackageSelector_h 42 #define NCPackageSelector_h 46 #define YUILogComponent "ncurses-pkg" 49 #include "YNCursesUI.h" 50 #include "NCPkgStrings.h" 56 #include <YRpmGroupsTree.h> 57 #include "YWidgetID.h" 59 #include <zypp/ResObject.h> 60 #include <zypp/ui/Selectable.h> 61 #include <zypp/Patch.h> 63 #include "NCPkgFilterSearch.h" 64 #include "NCPkgFilterInstSummary.h" 65 #include "NCPkgTable.h" 67 #include "NCPkgMenuFilter.h" 68 #include "NCPkgPackageDetails.h" 69 #include "NCPkgPopupDeps.h" 70 #include "NCPkgFilterMain.h" 71 #include "NCPkgSearchSettings.h" 73 #include "NCPkgSelMapper.h" 100 inline bool ic_compare (
char c1,
char c2 )
102 return ( toupper( c1 ) == toupper( c2 ) );
105 #define DOCTYPETAG "<!-- DT:Rich -->" // Special doctype for preformatted HTML 116 friend std::ostream & operator<<( std::ostream & STREAM,
const NCPackageSelector & OBJ );
124 typedef bool (
NCPackageSelector::* tHandlerFctPtr) (
const NCursesEvent& event );
127 typedef std::map<std::string, tHandlerFctPtr> tHandlerMap;
129 tHandlerMap eventHandlerMap;
152 std::map <std::string, std::string> sysconfig;
156 bool installRecommended;
158 std::string actionAtExit;
160 YRpmGroupsTree * _rpmGroupsTree;
174 YMenuItem * updatelistItem;
177 YLabel * packageLabel;
178 YLabel * diskspaceLabel;
179 YLabel *patternLabel;
183 NCRichText * filter_desc;
184 NCInputField *searchField;
186 YReplacePoint * replacePoint;
187 YReplacePoint * replPoint;
188 YReplacePoint * replPoint2;
195 NCPushButton * okButton;
196 NCPushButton * cancelButton;
198 YMenuItem * visibleInfo;
203 std::set<std::string> verified_pkgs;
230 void setFlags(
long modeFlags);
232 void readSysconfig();
233 void writeSysconfig();
241 void createPkgLayout( YWidget * parent, NCPkgTable::NCPkgTableType type );
254 YLabel *PackageLabel() {
return packageLabel; }
255 YLabel *PatternLabel() {
return patternLabel; }
260 NCPkgTable *VersionsList() {
return versionsList; }
261 void setVersionsList (
NCPkgTable *table ) { versionsList = table; }
263 NCPkgTable * PatchPkgs() {
return patchPkgs; }
264 NCPkgTable * PatchPkgsVersions() {
return patchPkgsVersions; }
266 YReplacePoint *ReplacePoint() {
return replacePoint; }
267 NCRichText *FilterDescription() {
return filter_desc; }
270 bool checkNow(
bool *ok );
271 bool systemVerification(
bool *ok );
272 bool doInstallRecommended(
bool *ok );
314 bool isYouMode() {
return youMode; }
316 bool isUpdateMode() {
return updateMode; }
318 bool isRepoMgrEnabled() {
return repoMgrEnabled; }
320 bool isTestMode() {
return testMode; }
326 std::string ActionAtExit() {
return actionAtExit; }
327 void setActionAtExit( std::string action ) { actionAtExit = action; }
333 bool isCleanDepsOnRemove();
334 void setCleanDepsOnRemove(
bool on );
336 bool isAllowVendorChange();
337 void setAllowVendorChange(
bool on );
343 bool isInstallRecommended();
344 void setInstallRecommended(
bool on );
345 bool InstallRecommended() {
return installRecommended; }
347 bool isVerifySystem();
348 void setVerifySystem(
bool on );
349 bool VerifySystem() {
return verifySystem; }
354 void setAutoCheck(
bool check) { autoCheck = check; }
355 bool AutoCheck() {
return autoCheck; }
393 void clearInfoArea();
395 wrect deleteReplacePoint();
397 void replaceFilter ( FilterMode mode);
398 void replaceFilterDescr (
bool b );
443 NCPkgMenuFilter::PatchFilter filter );
489 return verified_pkgs;
497 verified_pkgs.insert( pkgname);
505 if ( !verified_pkgs.empty() )
507 yuiMilestone() <<
"Discarding auto-dependency changes" << std::endl;
508 verified_pkgs.clear();
516 #endif // NCPackageSelector_h
void showDiskSpace()
Calls the package mananager (updateDu()) and shows the required disk space.
void showSelectionDependencies()
Checks and shows the selectiondependencies.
bool checkPatch(ZyppPatch patch, ZyppSel selectable, NCPkgMenuFilter::PatchFilter filter)
Check if 'patch' matches the selected filter.
bool fillPatchList(NCPkgMenuFilter::PatchFilter filter)
Fills the package table with YOU patches matching the filter.
bool showPendingLicenseAgreements()
Check for license.
Mapping from ZyppPkg to the correspoinding ZyppSel.
void createPkgLayout(YWidget *parent, NCPkgTable::NCPkgTableType type)
Create layout for the PackageSelector.
void insertVerifiedPkg(std::string pkgname)
Insert package name into the list of already selected for automatic changes.
void showDownloadSize()
Shows the total download size.
bool handleEvent(const NCursesEvent &event)
Handle the given event.
void clearVerifiedPkgs()
Empty the std::set of packages selected for automatic changes.
void updatePackageList()
Updates the status in list of packages.
virtual ~NCPackageSelector()
Destructor.
std::set< std::string > getVerifiedPkgs()
Get list of packages already selected for automatic changes (usually via 'verify system' call) ...
void showPatchPackages()
Creates an NCPkgTable widget and shows all packages belonging to a patch.
bool fillPatchPackages(NCPkgTable *pkgTable, ZyppObj youPatch)
Fills the list of packages belonging to the youPatch.
bool CancelHandler(const NCursesEvent &event)
Handler function for "Cancel button pressed".
bool showLicensePopup(std::string pkgName, std::string license)
Shows 'End User License Agreement' popup with license text.
void saveState()
Check for changes.
bool fillPatchSearchList(const std::string &expr, bool checkName, bool checkSum)
Fills the package table with packages matching the search expression.
bool fillDefaultList()
Fills the default package table.
bool LinkHandler(std::string link)
Handles hyperlinks in package description.
void createYouLayout(YWidget *parent)
Create layout for the Online Update.
bool OkButtonHandler(const NCursesEvent &event)
Handler function for "OK button pressed".
void showPatchPkgVersions()
Creates an NCPkgTable widget and shows all versions of all packages belonging to a patch...
void showInformation()
Creates an NCRichText widget for package (patch) information.
bool showLicenseAgreement(ZyppSel &slbPtr, std::string licenseText)
Show popup with license.
bool showPackageDependencies(bool doit)
Checks and shows the dependencies.
void showVersionsList()
Creates an NCPkgTable widget and shows all verions a the selected package.
bool fillUpdateList()
Fills the package table with packages with update problems.