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" 102 inline bool ic_compare (
char c1,
char c2 )
104 return ( toupper( c1 ) == toupper( c2 ) );
107 #define DOCTYPETAG "<!-- DT:Rich -->" // Special doctype for preformatted HTML 118 friend std::ostream & operator<<( std::ostream & STREAM,
const NCPackageSelector & OBJ );
126 typedef bool (
NCPackageSelector::* tHandlerFctPtr) (
const NCursesEvent& event );
129 typedef std::map<std::string, tHandlerFctPtr> tHandlerMap;
131 tHandlerMap eventHandlerMap;
156 std::map <std::string, std::string> sysconfig;
160 bool installRecommended;
162 std::string actionAtExit;
164 YRpmGroupsTree * _rpmGroupsTree;
178 YMenuItem * updatelistItem;
181 YLabel * packageLabel;
182 YLabel * diskspaceLabel;
183 YLabel *patternLabel;
187 NCRichText * filter_desc;
188 NCInputField *searchField;
190 YReplacePoint * replacePoint;
191 YReplacePoint * replPoint;
192 YReplacePoint * replPoint2;
199 NCPushButton * okButton;
200 NCPushButton * cancelButton;
202 YMenuItem * visibleInfo;
207 std::set<std::string> verified_pkgs;
235 void setFlags(
long modeFlags);
237 void readSysconfig();
238 void writeSysconfig();
246 void createPkgLayout( YWidget * parent, NCPkgTable::NCPkgTableType type );
259 YLabel *PackageLabel() {
return packageLabel; }
260 YLabel *PatternLabel() {
return patternLabel; }
265 NCPkgTable *VersionsList() {
return versionsList; }
266 void setVersionsList (
NCPkgTable *table ) { versionsList = table; }
268 NCPkgTable * PatchPkgs() {
return patchPkgs; }
269 NCPkgTable * PatchPkgsVersions() {
return patchPkgsVersions; }
271 YReplacePoint *ReplacePoint() {
return replacePoint; }
272 NCRichText *FilterDescription() {
return filter_desc; }
275 bool checkNow(
bool *ok );
276 bool systemVerification(
bool *ok );
277 bool doInstallRecommended(
bool *ok );
319 bool isYouMode() {
return youMode; }
321 bool isUpdateMode() {
return updateMode; }
323 bool isRepoMgrEnabled() {
return repoMgrEnabled; }
325 bool isTestMode() {
return testMode; }
331 std::string ActionAtExit() {
return actionAtExit; }
332 void setActionAtExit( std::string action ) { actionAtExit = action; }
338 bool isCleanDepsOnRemove();
339 void setCleanDepsOnRemove(
bool on );
341 bool isAllowVendorChange();
342 void setAllowVendorChange(
bool on );
348 bool isInstallRecommended();
349 void setInstallRecommended(
bool on );
350 bool InstallRecommended() {
return installRecommended; }
352 bool isVerifySystem();
353 void setVerifySystem(
bool on );
354 bool VerifySystem() {
return verifySystem; }
359 void setAutoCheck(
bool check) { autoCheck = check; }
360 bool AutoCheck() {
return autoCheck; }
398 void clearInfoArea();
400 wrect deleteReplacePoint();
402 void replaceFilter ( FilterMode mode);
403 void replaceFilterDescr (
bool b );
448 NCPkgMenuFilter::PatchFilter filter );
494 return verified_pkgs;
502 verified_pkgs.insert( pkgname);
510 if ( !verified_pkgs.empty() )
512 yuiMilestone() <<
"Discarding auto-dependency changes" << std::endl;
513 verified_pkgs.clear();
521 #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.