summaryrefslogtreecommitdiff
authortille <tille>2002-07-30 14:37:26 (UTC)
committer tille <tille>2002-07-30 14:37:26 (UTC)
commit988409a5a21b3a4238ce41316e48777c885f147a (patch) (unidiff)
tree0c62baa663e715f81e936664e0775dddb96ea519
parent0adb56cb2cd83e9933baa9776c77c4c637f93d04 (diff)
downloadopie-988409a5a21b3a4238ce41316e48777c885f147a.zip
opie-988409a5a21b3a4238ce41316e48777c885f147a.tar.gz
opie-988409a5a21b3a4238ce41316e48777c885f147a.tar.bz2
Added -force-overwrite ipkg option
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/installdialog.cpp17
-rw-r--r--noncore/unsupported/oipkg/installdialog.h1
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp2
3 files changed, 16 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/installdialog.cpp b/noncore/unsupported/oipkg/installdialog.cpp
index c676e84..fd93ad3 100644
--- a/noncore/unsupported/oipkg/installdialog.cpp
+++ b/noncore/unsupported/oipkg/installdialog.cpp
@@ -34,52 +34,60 @@ InstallDialog::InstallDialog( PackageManagerSettings* s, QWidget* parent, const
34 34
35 ListViewPackages = new PackageListView( this,"listViewPackages",settings ); 35 ListViewPackages = new PackageListView( this,"listViewPackages",settings );
36 36
37 InstallDialogLayout->addWidget( ListViewPackages, 0, 0 ); 37 InstallDialogLayout->addWidget( ListViewPackages, 0, 0 );
38 38
39 GroupBoxOptions = new QGroupBox( this, "GroupBoxOptions" ); 39 GroupBoxOptions = new QGroupBox( this, "GroupBoxOptions" );
40 GroupBoxOptions->setTitle( tr( "Ipkg options" ) ); 40 GroupBoxOptions->setTitle( tr( "Ipkg options" ) );
41 GroupBoxOptions->setColumnLayout(0, Qt::Vertical ); 41 GroupBoxOptions->setColumnLayout(0, Qt::Vertical );
42 GroupBoxOptions->layout()->setSpacing( 0 ); 42 GroupBoxOptions->layout()->setSpacing( 0 );
43 GroupBoxOptions->layout()->setMargin( 0 ); 43 GroupBoxOptions->layout()->setMargin( 0 );
44 GroupBoxOptionsLayout = new QGridLayout( GroupBoxOptions->layout() ); 44 GroupBoxOptionsLayout = new QGridLayout( GroupBoxOptions->layout() );
45 GroupBoxOptionsLayout->setAlignment( Qt::AlignTop ); 45 GroupBoxOptionsLayout->setAlignment( Qt::AlignTop );
46 GroupBoxOptionsLayout->setSpacing( 2 ); 46 GroupBoxOptionsLayout->setSpacing( 0 );
47 GroupBoxOptionsLayout->setMargin( 2 ); 47 GroupBoxOptionsLayout->setMargin( 0 );
48 48
49 _force_depends = new QCheckBox( GroupBoxOptions, "_force_depends" ); 49 _force_depends = new QCheckBox( GroupBoxOptions, "_force_depends" );
50 QFont _force_depends_font( _force_depends->font() ); 50 QFont _force_depends_font( _force_depends->font() );
51 _force_depends_font.setPointSize( 8 ); 51 _force_depends_font.setPointSize( 8 );
52 _force_depends->setFont( _force_depends_font ); 52 _force_depends->setFont( _force_depends_font );
53 _force_depends->setText( tr( "-force-depends" ) ); 53 _force_depends->setText( tr( "-force-depends" ) );
54 //_force_depends->setChecked( true ); 54 //_force_depends->setChecked( true );
55 55
56 GroupBoxOptionsLayout->addWidget( _force_depends, 0, 0 ); 56 GroupBoxOptionsLayout->addWidget( _force_depends, 0, 0 );
57 57
58 _force_reinstall = new QCheckBox( GroupBoxOptions, "_force_reinstall" ); 58 _force_reinstall = new QCheckBox( GroupBoxOptions, "_force_reinstall" );
59 QFont _force_reinstall_font( _force_reinstall->font() ); 59 QFont _force_reinstall_font( _force_reinstall->font() );
60 _force_reinstall_font.setPointSize( 8 ); 60 _force_reinstall_font.setPointSize( 8 );
61 _force_reinstall->setFont( _force_reinstall_font ); 61 _force_reinstall->setFont( _force_reinstall_font );
62 _force_reinstall->setText( tr( "-force-reinstall" ) ); 62 _force_reinstall->setText( tr( "-force-reinstall" ) );
63 63
64 GroupBoxOptionsLayout->addWidget( _force_reinstall, 1, 0 ); 64 GroupBoxOptionsLayout->addWidget( _force_reinstall, 1, 0 );
65 65
66 _force_remove = new QCheckBox( GroupBoxOptions, "_force_remove" ); 66 _force_remove = new QCheckBox( GroupBoxOptions, "_force_remove" );
67 QFont _force_remove_font( _force_remove->font() ); 67 QFont _force_remove_font( _force_remove->font() );
68 _force_remove_font.setPointSize( 8 ); 68 _force_remove_font.setPointSize( 8 );
69 _force_remove->setFont( _force_remove_font ); 69 _force_remove->setFont( _force_remove_font );
70 _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); 70 _force_remove->setText( tr( "-force-removal-of-essential-packages" ) );
71 71
72 GroupBoxOptionsLayout->addWidget( _force_remove, 2, 0 ); 72 GroupBoxOptionsLayout->addWidget( _force_remove, 2, 0 );
73 73
74 _force_overwrite = new QCheckBox( GroupBoxOptions, "_force_overwrite" );
75 QFont _force_overwrite_font( _force_overwrite->font() );
76 _force_overwrite_font.setPointSize( 8 );
77 _force_overwrite->setFont( _force_overwrite_font );
78 _force_overwrite->setText( tr( "-force-overwrite" ) );
79
80 GroupBoxOptionsLayout->addWidget(_force_overwrite, 3, 0 );
81
74 InstallDialogLayout->addWidget( GroupBoxOptions, 1, 0 ); 82 InstallDialogLayout->addWidget( GroupBoxOptions, 1, 0 );
75 toRemoveItem = new QCheckListItem( ListViewPackages, tr("To remove") ); 83 toRemoveItem = new QCheckListItem( ListViewPackages, tr("To remove") );
76 toInstallItem = new QCheckListItem( ListViewPackages, tr("To install") ); 84 toInstallItem = new QCheckListItem( ListViewPackages, tr("To install") );
77 85
78} 86}
79 87
80/* 88/*
81 * Destroys the object and frees any allocated resources 89 * Destroys the object and frees any allocated resources
82 */ 90 */
83InstallDialog::~InstallDialog() 91InstallDialog::~InstallDialog()
84{ 92{
85 // no need to delete child widgets, Qt does it all for us 93 // no need to delete child widgets, Qt does it all for us
@@ -89,20 +97,21 @@ InstallDialog::~InstallDialog()
89 * Main event handler. Reimplemented to handle application 97 * Main event handler. Reimplemented to handle application
90 * font changes 98 * font changes
91 */ 99 */
92bool InstallDialog::event( QEvent* ev ) 100bool InstallDialog::event( QEvent* ev )
93{ 101{
94 bool ret = QDialog::event( ev ); 102 bool ret = QDialog::event( ev );
95 if ( ev->type() == QEvent::ApplicationFontChange ) { 103 if ( ev->type() == QEvent::ApplicationFontChange ) {
96 QFont _force_depends_font( _force_depends->font() ); 104 QFont _force_depends_font( _force_depends->font() );
97 _force_depends_font.setPointSize( 8 ); 105 _force_depends_font.setPointSize( 8 );
98 _force_depends->setFont( _force_depends_font ); 106 _force_depends->setFont( _force_depends_font );
99 QFont _force_reinstall_font( _force_reinstall->font() ); 107 QFont _force_reinstall_font( _force_reinstall->font() );
100 _force_reinstall_font.setPointSize( 8 ); 108 _force_reinstall_font.setPointSize( 8 );
101 _force_reinstall->setFont( _force_reinstall_font ); 109 _force_reinstall->setFont( _force_reinstall_font );
102 QFont _force_remove_font( _force_remove->font() ); 110 QFont _force_remove_font( _force_remove->font() );
111 QFont _force_overwrite_font( _force_overwrite->font() );
103 _force_remove_font.setPointSize( 8 ); 112 _force_remove_font.setPointSize( 8 );
104 _force_remove->setFont( _force_remove_font ); 113 _force_remove->setFont( _force_remove_font );
105 } 114 }
106 return ret; 115 return ret;
107} 116}
108 117
diff --git a/noncore/unsupported/oipkg/installdialog.h b/noncore/unsupported/oipkg/installdialog.h
index 828c8df..d3510ff 100644
--- a/noncore/unsupported/oipkg/installdialog.h
+++ b/noncore/unsupported/oipkg/installdialog.h
@@ -26,24 +26,25 @@ class QListViewItem;
26 26
27class InstallDialog : public QDialog 27class InstallDialog : public QDialog
28{ 28{
29 Q_OBJECT 29 Q_OBJECT
30 30
31public: InstallDialog( PackageManagerSettings* s, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 31public: InstallDialog( PackageManagerSettings* s, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
32 ~InstallDialog(); 32 ~InstallDialog();
33 33
34 PackageListView* ListViewPackages; 34 PackageListView* ListViewPackages;
35 QGroupBox* GroupBoxOptions; 35 QGroupBox* GroupBoxOptions;
36 QCheckBox* _force_depends; 36 QCheckBox* _force_depends;
37 QCheckBox* _force_reinstall; 37 QCheckBox* _force_reinstall;
38 QCheckBox* _force_overwrite;
38 QCheckBox* _force_remove; 39 QCheckBox* _force_remove;
39 QCheckListItem *toRemoveItem; 40 QCheckListItem *toRemoveItem;
40 QCheckListItem *toInstallItem; 41 QCheckListItem *toInstallItem;
41 42
42protected: 43protected:
43 QGridLayout* InstallDialogLayout; 44 QGridLayout* InstallDialogLayout;
44 QGridLayout* GroupBoxOptionsLayout; 45 QGridLayout* GroupBoxOptionsLayout;
45 bool event( QEvent* ); 46 bool event( QEvent* );
46private: 47private:
47 PackageManagerSettings* settings; 48 PackageManagerSettings* settings;
48}; 49};
49 50
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 84de67b..2ed313c 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -66,24 +66,26 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
66 cmd += " -dest "+ dest; 66 cmd += " -dest "+ dest;
67 67
68 cmd += " -force-defaults "; 68 cmd += " -force-defaults ";
69 69
70 if ( installDialog && installDialog->_force_depends ) 70 if ( installDialog && installDialog->_force_depends )
71 { 71 {
72 if (installDialog->_force_depends->isChecked()) 72 if (installDialog->_force_depends->isChecked())
73 cmd += " -force-depends "; 73 cmd += " -force-depends ";
74 if (installDialog->_force_reinstall->isChecked()) 74 if (installDialog->_force_reinstall->isChecked())
75 cmd += " -force-reinstall "; 75 cmd += " -force-reinstall ";
76 if (installDialog->_force_remove->isChecked()) 76 if (installDialog->_force_remove->isChecked())
77 cmd += " -force-removal-of-essential-packages "; 77 cmd += " -force-removal-of-essential-packages ";
78 if (installDialog->_force_overwrite->isChecked())
79 cmd += " -force-overwrite ";
78 } 80 }
79 } //!args.contains("update") 81 } //!args.contains("update")
80 82
81 out( "Starting to "+ args+"\n"); 83 out( "Starting to "+ args+"\n");
82 qApp->processEvents(); 84 qApp->processEvents();
83 cmd += args; 85 cmd += args;
84 out( "running:\n"+cmd+"\n" ); 86 out( "running:\n"+cmd+"\n" );
85 pvDebug(2,"running:"+cmd); 87 pvDebug(2,"running:"+cmd);
86 qApp->processEvents(); 88 qApp->processEvents();
87 FILE *fp; 89 FILE *fp;
88 char line[130]; 90 char line[130];
89 QString lineStr, lineStrOld; 91 QString lineStr, lineStrOld;