Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

NCPopupDeps.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                      __   __    ____ _____ ____                      |
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00005 |                       \ V / _` \___ \ | |   __) |                    |
00006 |                        | | (_| |___) || |  / __/                     |
00007 |                        |_|\__,_|____/ |_| |_____|                    |
00008 |                                                                      |
00009 |                               core system                            |
00010 |                                                        (C) SuSE GmbH |
00011 \----------------------------------------------------------------------/
00012 
00013    File:       NCPopupDeps.h
00014 
00015    Author:     Gabriele Strattner <gs@suse.de>
00016    Maintainer: Michael Andres <ma@suse.de>
00017 
00018 /-*/
00019 #ifndef NCPopupDeps_h
00020 #define NCPopupDeps_h
00021 
00022 #include <iosfwd>
00023 
00024 #include <vector>
00025 #include <string>
00026 
00027 #include "NCPopup.h"
00028 #include "NCLabel.h"
00029 #include "y2pm/PkgDep.h"
00030 
00031 #include <Y2PM.h>
00032 #include <y2pm/RpmDb.h>
00033 #include <y2pm/PMManager.h>
00034 
00035 class NCPkgTable;
00036 class NCPushButton;
00037 class NCMenuButton;
00038 class PackageSelector;
00039 
00041 //
00042 //      CLASS NAME : NCPopupDeps
00043 //
00044 //      DESCRIPTION :
00045 //
00046 class NCPopupDeps : public NCPopup {
00047 
00048     NCPopupDeps & operator=( const NCPopupDeps & );
00049     NCPopupDeps            ( const NCPopupDeps & );
00050 
00051 private:
00052 
00053     // the dependencies (index corresponds to line in package list)
00054     vector<std::pair<PkgDep::ErrorResult, std::string> > dependencies;
00055 
00056     map<std::string, bool> ignoreDependencies;
00057     
00058     NCPushButton * cancelButton;
00059     NCPushButton * solveButton;         
00060     NCPushButton * ignoreButton;
00061     NCPushButton * ignoreAllButton;
00062     
00063     NCPkgTable * deps;                  // the conflict/alternative packages
00064 
00065     NCLabel * head;                     // the headline
00066     
00067     NCLabel * errorLabel1;              // the error messages
00068     NCLabel * errorLabel2; 
00069 
00070     PackageSelector * packager;         // connection to the package selector
00071     
00072     // method to solve the dependencies
00073     virtual bool solveInstall( PkgDep::ResultList & goodList, PkgDep::ErrorResultList & badList ) = 0;
00074 
00075     // methods to create different text for package/selection popup
00076     virtual string getHeadline() = 0;
00077     virtual string getLabelRequire() = 0;
00078     virtual string getLabelRequBy1() = 0;
00079     virtual string getLabelRequBy2() = 0;
00080     virtual string getLabelConflict() = 0;
00081     virtual string getLabelContinueRequ() = 0;
00082     // set the tabel type
00083     virtual void setDepsTableType() = 0;
00084     
00085     void createLayout();
00086     
00087 
00088     bool addDepsLine( NCPkgTable * table, const PkgDep::ErrorResult & error, string kind );
00089 
00090     string getReferersList( const PkgDep::ErrorResult & error );
00091     
00092 protected:
00093 
00094     NCPkgTable * pkgs;                  // the list of packages with unresolved deps
00095     
00096     virtual bool postAgain();
00097 
00098     virtual NCursesEvent wHandleInput( wint_t ch );
00099     
00100 public:
00101 
00102     NCPopupDeps( const wpos at, PackageSelector * pkger );
00103     virtual ~NCPopupDeps();
00104 
00105     virtual long nicesize(YUIDimension dim);
00106 
00107     NCursesEvent showDependencyPopup( );
00108 
00109     bool showDependencies( );
00110     
00111     bool evaluateErrorResult( NCPkgTable * table,
00112                              const PkgDep::ErrorResultList & errorlist );
00113 
00114     bool concretelyDependency( int index );
00115     
00116 };
00117 
00119 
00120 
00121 #endif // NCPopupDeps_h

Generated on Wed Sep 14 10:52:54 2005 for yast2-ncurses by  doxygen 1.4.4