00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "global.h"
00031 #include "instoptionsimpl.h"
00032 #include "ipkg.h"
00033
00034
00035 #ifdef QWS
00036 #include <qpe/config.h>
00037 #endif
00038 #include <qpe/qpeapplication.h>
00039
00040
00041 #include <qcheckbox.h>
00042 #include <qcombobox.h>
00043 #include <qgroupbox.h>
00044 #include <qlabel.h>
00045 #include <qlayout.h>
00046
00047 InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl )
00048 : QDialog( parent, name, modal, fl )
00049 {
00050 setCaption( tr( "Options" ) );
00051
00052 QVBoxLayout *layout = new QVBoxLayout( this );
00053 layout->setMargin( 2 );
00054 layout->setSpacing( 4 );
00055
00056 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Options" ), this );
00057 grpbox->layout()->setSpacing( 2 );
00058 grpbox->layout()->setMargin( 4 );
00059 layout->addWidget( grpbox );
00060
00061 QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );
00062
00063 forceDepends = new QCheckBox( tr( "Force Depends" ), grpbox );
00064 grplayout->addWidget( forceDepends );
00065
00066 forceReinstall = new QCheckBox( tr( "Force Reinstall" ), grpbox );
00067 grplayout->addWidget( forceReinstall );
00068
00069 forceRemove = new QCheckBox( tr( "Force Remove" ), grpbox );
00070 grplayout->addWidget( forceRemove );
00071
00072 forceOverwrite = new QCheckBox( tr( "Force Overwrite" ), grpbox );
00073 grplayout->addWidget( forceOverwrite );
00074
00075 QLabel *l = new QLabel( tr( "Information Level" ), grpbox );
00076 grplayout->addWidget( l );
00077
00078 verboseIpkg = new QComboBox( grpbox );
00079 verboseIpkg->insertItem( tr( "Errors only" ) );
00080 verboseIpkg->insertItem( tr( "Normal messages" ) );
00081 verboseIpkg->insertItem( tr( "Informative messages" ) );
00082 verboseIpkg->insertItem( tr( "Troubleshooting output" ) );
00083 verboseIpkg->setCurrentItem( verb );
00084 grplayout->addWidget( verboseIpkg );
00085
00086 grplayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
00087
00088 if ( flags & FORCE_DEPENDS )
00089 forceDepends->setChecked( true );
00090 if ( flags & FORCE_REINSTALL )
00091 forceReinstall->setChecked( true );
00092 if ( flags & FORCE_REMOVE )
00093 forceRemove->setChecked( true );
00094 if ( flags & FORCE_OVERWRITE )
00095 forceOverwrite->setChecked( true );
00096
00097
00098
00099
00100
00101 QPEApplication::showDialog( this );
00102
00103 }
00104
00105 InstallOptionsDlgImpl::~InstallOptionsDlgImpl()
00106 {}
00107
00108
00109 int InstallOptionsDlgImpl :: getFlags()
00110 {
00111 int flags = 0;
00112
00113 if ( forceDepends->isChecked() )
00114 flags |= FORCE_DEPENDS;
00115 if ( forceReinstall->isChecked() )
00116 flags |= FORCE_REINSTALL;
00117 if ( forceRemove->isChecked() )
00118 flags |= FORCE_REMOVE;
00119 if ( forceOverwrite->isChecked() )
00120 flags |= FORCE_OVERWRITE;
00121 if ( verboseWget->isChecked() )
00122 flags |= VERBOSE_WGET;
00123
00124 return flags;
00125 }
00126
00127 int InstallOptionsDlgImpl :: getInfoLevel()
00128 {
00129 return verboseIpkg->currentItem();
00130 }