41 #ifndef NCPackageSelector_h 42 #define NCPackageSelector_h 46 #define YUILogComponent "ncurses-pkg" 49 #include "YNCursesUI.h" 50 #include "NCPkgStrings.h" 56 #include "YWidgetID.h" 58 #include <zypp/ResObject.h> 59 #include <zypp/ui/Selectable.h> 60 #include <zypp/Patch.h> 62 #include "NCPkgFilterSearch.h" 63 #include "NCPkgFilterInstSummary.h" 64 #include "NCPkgTable.h" 66 #include "NCPkgMenuFilter.h" 67 #include "NCPkgPackageDetails.h" 68 #include "NCPkgPopupDeps.h" 69 #include "NCPkgFilterMain.h" 70 #include "NCPkgSearchSettings.h" 72 #include "NCPkgSelMapper.h" 99 inline bool ic_compare (
char c1,
char c2 )
101 return ( toupper( c1 ) == toupper( c2 ) );
104 #define DOCTYPETAG "<!-- DT:Rich -->" // Special doctype for preformatted HTML 115 friend std::ostream & operator<<( std::ostream & STREAM,
const NCPackageSelector & OBJ );
123 typedef bool (
NCPackageSelector::* tHandlerFctPtr) (
const NCursesEvent& event );
126 typedef std::map<std::string, tHandlerFctPtr> tHandlerMap;
128 tHandlerMap eventHandlerMap;
150 bool onlineSearchEnabled;
152 std::map <std::string, std::string> sysconfig;
156 bool installRecommended;
158 std::string actionAtExit;
172 YMenuItem * updatelistItem;
175 YLabel * packageLabel;
176 YLabel * diskspaceLabel;
177 YLabel *patternLabel;
181 NCRichText * filter_desc;
182 NCInputField *searchField;
184 YReplacePoint * replacePoint;
185 YReplacePoint * replPoint;
186 YReplacePoint * replPoint2;
193 NCPushButton * okButton;
194 NCPushButton * cancelButton;
196 YMenuItem * visibleInfo;
201 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 );
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; }
327 bool isOnlineSearchEnabled() {
return onlineSearchEnabled; }
333 std::string ActionAtExit() {
return actionAtExit; }
334 void setActionAtExit( std::string action ) { actionAtExit = action; }
340 bool isCleanDepsOnRemove();
341 void setCleanDepsOnRemove(
bool on );
343 bool isAllowVendorChange();
344 void setAllowVendorChange(
bool on );
350 bool isInstallRecommended();
351 void setInstallRecommended(
bool on );
352 bool InstallRecommended() {
return installRecommended; }
354 bool isVerifySystem();
355 void setVerifySystem(
bool on );
356 bool VerifySystem() {
return verifySystem; }
361 void setAutoCheck(
bool check) { autoCheck = check; }
362 bool AutoCheck() {
return autoCheck; }
400 void clearInfoArea();
402 wrect deleteReplacePoint();
404 void replaceFilter ( FilterMode mode);
405 void replaceFilterDescr (
bool b );
450 NCPkgMenuFilter::PatchFilter filter );
496 return verified_pkgs;
505 verified_pkgs.insert( pkgname);
514 if ( !verified_pkgs.empty() )
516 yuiMilestone() <<
"Discarding auto-dependency changes" << std::endl;
517 verified_pkgs.clear();
524 #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 anyRetractedPkgInstalled()
Return 'true' if any package is installed in a retracted version.
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.