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 "NCPkgFilterRPMGroups.h" 64 #include "NCPkgFilterSearch.h" 65 #include "NCPkgFilterInstSummary.h" 66 #include "NCPkgTable.h" 68 #include "NCPkgMenuFilter.h" 69 #include "NCPkgPackageDetails.h" 70 #include "NCPkgPopupDeps.h" 71 #include "NCPkgFilterMain.h" 72 #include "NCPkgSearchSettings.h" 74 #include "NCPkgSelMapper.h" 101 inline bool ic_compare (
char c1,
char c2 )
103 return ( toupper( c1 ) == toupper( c2 ) );
106 #define DOCTYPETAG "<!-- DT:Rich -->" // Special doctype for preformatted HTML 117 friend std::ostream & operator<<( std::ostream & STREAM,
const NCPackageSelector & OBJ );
125 typedef bool (
NCPackageSelector::* tHandlerFctPtr) (
const NCursesEvent& event );
128 typedef std::map<std::string, tHandlerFctPtr> tHandlerMap;
130 tHandlerMap eventHandlerMap;
154 std::map <std::string, std::string> sysconfig;
158 bool installRecommended;
160 std::string actionAtExit;
162 YRpmGroupsTree * _rpmGroupsTree;
176 YMenuItem * updatelistItem;
179 YLabel * packageLabel;
180 YLabel * diskspaceLabel;
181 YLabel *patternLabel;
185 NCRichText * filter_desc;
186 NCInputField *searchField;
188 YReplacePoint * replacePoint;
189 YReplacePoint * replPoint;
190 YReplacePoint * replPoint2;
197 NCPushButton * okButton;
198 NCPushButton * cancelButton;
200 YMenuItem * visibleInfo;
205 std::set<std::string> verified_pkgs;
232 void setFlags(
long modeFlags);
234 void readSysconfig();
235 void writeSysconfig();
243 void createPkgLayout( YWidget * parent, NCPkgTable::NCPkgTableType type );
256 YLabel *PackageLabel() {
return packageLabel; }
257 YLabel *PatternLabel() {
return patternLabel; }
262 NCPkgTable *VersionsList() {
return versionsList; }
263 void setVersionsList (
NCPkgTable *table ) { versionsList = table; }
265 NCPkgTable * PatchPkgs() {
return patchPkgs; }
266 NCPkgTable * PatchPkgsVersions() {
return patchPkgsVersions; }
268 YReplacePoint *ReplacePoint() {
return replacePoint; }
269 NCRichText *FilterDescription() {
return filter_desc; }
272 bool checkNow(
bool *ok );
273 bool systemVerification(
bool *ok );
274 bool doInstallRecommended(
bool *ok );
316 bool isYouMode() {
return youMode; }
318 bool isUpdateMode() {
return updateMode; }
320 bool isRepoMgrEnabled() {
return repoMgrEnabled; }
322 bool isTestMode() {
return testMode; }
328 std::string ActionAtExit() {
return actionAtExit; }
329 void setActionAtExit( std::string action ) { actionAtExit = action; }
335 bool isCleanDepsOnRemove();
336 void setCleanDepsOnRemove(
bool on );
338 bool isAllowVendorChange();
339 void setAllowVendorChange(
bool on );
345 bool isInstallRecommended();
346 void setInstallRecommended(
bool on );
347 bool InstallRecommended() {
return installRecommended; }
349 bool isVerifySystem();
350 void setVerifySystem(
bool on );
351 bool VerifySystem() {
return verifySystem; }
356 void setAutoCheck(
bool check) { autoCheck = check; }
357 bool AutoCheck() {
return autoCheck; }
395 void clearInfoArea();
397 wrect deleteReplacePoint();
399 void replaceFilter ( FilterMode mode);
400 void replaceFilterDescr (
bool b );
445 NCPkgMenuFilter::PatchFilter filter );
491 return verified_pkgs;
499 verified_pkgs.insert( pkgname);
507 if ( !verified_pkgs.empty() )
509 yuiMilestone() <<
"Discarding auto-dependency changes" << std::endl;
510 verified_pkgs.clear();
518 #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.