author | tille <tille> | 2002-05-26 12:17:56 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-26 12:17:56 (UTC) |
commit | 602e52f454a3d3a5cd973f3d7957d2d96f86464e (patch) (unidiff) | |
tree | eff9aabdbf44804c1dcc42639eaa00fa92dd200c | |
parent | 26eb036407dbade370032dcca6af49d682f0ebf3 (diff) | |
download | opie-602e52f454a3d3a5cd973f3d7957d2d96f86464e.zip opie-602e52f454a3d3a5cd973f3d7957d2d96f86464e.tar.gz opie-602e52f454a3d3a5cd973f3d7957d2d96f86464e.tar.bz2 |
do not close update windows when not successful
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 9c4c752..27c9f4c 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -46,206 +46,206 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | |||
46 | packageListSearch.setSettings( settings ); | 46 | packageListSearch.setSettings( settings ); |
47 | packageListDocLnk.setSettings( settings ); | 47 | packageListDocLnk.setSettings( settings ); |
48 | pvDebug(9,"packageListServers.update"); | 48 | pvDebug(9,"packageListServers.update"); |
49 | packageListServers.update(); | 49 | packageListServers.update(); |
50 | pvDebug(9,"packageListDocLnk.update"); | 50 | pvDebug(9,"packageListDocLnk.update"); |
51 | packageListDocLnk.update(); | 51 | packageListDocLnk.update(); |
52 | pvDebug(9,"makeMenu"); | 52 | pvDebug(9,"makeMenu"); |
53 | makeMenu(); | 53 | makeMenu(); |
54 | makeChannel(); | 54 | makeChannel(); |
55 | //opie is hardcoded default ;) | 55 | //opie is hardcoded default ;) |
56 | //pvDebug(9,"section->setCurrentItem"); | 56 | //pvDebug(9,"section->setCurrentItem"); |
57 | // for (int i=0;i<section->count();i++) | 57 | // for (int i=0;i<section->count();i++) |
58 | // if (section->text(i)=="opie") | 58 | // if (section->text(i)=="opie") |
59 | // section->setCurrentItem(i); | 59 | // section->setCurrentItem(i); |
60 | // sectionChanged(); | 60 | // sectionChanged(); |
61 | 61 | ||
62 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); | 62 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); |
63 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 63 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
64 | 64 | ||
65 | connect( settings->removeLinksButton, SIGNAL( clicked()), | 65 | connect( settings->removeLinksButton, SIGNAL( clicked()), |
66 | SLOT(removeLinks()) ); | 66 | SLOT(removeLinks()) ); |
67 | connect( settings->createLinksButton, SIGNAL( clicked()), | 67 | connect( settings->createLinksButton, SIGNAL( clicked()), |
68 | SLOT(createLinks()) ); | 68 | SLOT(createLinks()) ); |
69 | 69 | ||
70 | pvDebug(9,"displayList"); | 70 | pvDebug(9,"displayList"); |
71 | displayList(); | 71 | displayList(); |
72 | } | 72 | } |
73 | 73 | ||
74 | void MainWindow::makeMenu() | 74 | void MainWindow::makeMenu() |
75 | { | 75 | { |
76 | 76 | ||
77 | QPEToolBar *toolBar = new QPEToolBar( this ); | 77 | QPEToolBar *toolBar = new QPEToolBar( this ); |
78 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 78 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
79 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); | 79 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); |
80 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 80 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
81 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 81 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
82 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); | 82 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); |
83 | 83 | ||
84 | setToolBarsMovable( false ); | 84 | setToolBarsMovable( false ); |
85 | toolBar->setHorizontalStretchable( true ); | 85 | toolBar->setHorizontalStretchable( true ); |
86 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 86 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
87 | menuBar->insertItem( tr( "View" ), viewMenu ); | 87 | menuBar->insertItem( tr( "View" ), viewMenu ); |
88 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 88 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
89 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); | 89 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); |
90 | 90 | ||
91 | QLabel *spacer; | 91 | QLabel *spacer; |
92 | // spacer = new QLabel( "", toolBar ); | 92 | // spacer = new QLabel( "", toolBar ); |
93 | // spacer->setBackgroundColor( toolBar->backgroundColor() ); | 93 | // spacer->setBackgroundColor( toolBar->backgroundColor() ); |
94 | // toolBar->setStretchableWidget( spacer ); | 94 | // toolBar->setStretchableWidget( spacer ); |
95 | 95 | ||
96 | 96 | ||
97 | runAction = new QAction( tr( "Apply" ), | 97 | runAction = new QAction( tr( "Apply" ), |
98 | Resource::loadPixmap( "oipkg/install" ), | 98 | Resource::loadPixmap( "oipkg/install" ), |
99 | QString::null, 0, this, 0 ); | 99 | QString::null, 0, this, 0 ); |
100 | connect( runAction, SIGNAL( activated() ), | 100 | connect( runAction, SIGNAL( activated() ), |
101 | this, SLOT( runIpkg() ) ); | 101 | this, SLOT( runIpkg() ) ); |
102 | runAction->addTo( toolBar ); | 102 | runAction->addTo( toolBar ); |
103 | runAction->addTo( srvMenu ); | 103 | runAction->addTo( srvMenu ); |
104 | 104 | ||
105 | srvMenu->insertSeparator (); | 105 | srvMenu->insertSeparator (); |
106 | 106 | ||
107 | updateAction = new QAction( tr( "Update" ), | 107 | updateAction = new QAction( tr( "Update" ), |
108 | Resource::loadIconSet( "oipkg/update" ), | 108 | Resource::loadIconSet( "oipkg/update" ), |
109 | QString::null, 0, this, 0 ); | 109 | QString::null, 0, this, 0 ); |
110 | connect( updateAction, SIGNAL( activated() ), | 110 | connect( updateAction, SIGNAL( activated() ), |
111 | this , SLOT( updateList() ) ); | 111 | this , SLOT( updateList() ) ); |
112 | updateAction->addTo( toolBar ); | 112 | updateAction->addTo( toolBar ); |
113 | updateAction->addTo( srvMenu ); | 113 | updateAction->addTo( srvMenu ); |
114 | 114 | ||
115 | QAction *cfgact; | 115 | QAction *cfgact; |
116 | 116 | ||
117 | cfgact = new QAction( tr( "Setups" ), | 117 | cfgact = new QAction( tr( "Setups" ), |
118 | QString::null, 0, this, 0 ); | 118 | QString::null, 0, this, 0 ); |
119 | connect( cfgact, SIGNAL( activated() ), | 119 | connect( cfgact, SIGNAL( activated() ), |
120 | SLOT( showSettings() ) ); | 120 | SLOT( showSettings() ) ); |
121 | cfgact->addTo( cfgMenu ); | 121 | cfgact->addTo( cfgMenu ); |
122 | 122 | ||
123 | cfgact = new QAction( tr( "Servers" ), | 123 | cfgact = new QAction( tr( "Servers" ), |
124 | QString::null, 0, this, 0 ); | 124 | QString::null, 0, this, 0 ); |
125 | connect( cfgact, SIGNAL( activated() ), | 125 | connect( cfgact, SIGNAL( activated() ), |
126 | SLOT( showSettingsSrv() ) ); | 126 | SLOT( showSettingsSrv() ) ); |
127 | cfgact->addTo( cfgMenu ); | 127 | cfgact->addTo( cfgMenu ); |
128 | cfgact = new QAction( tr( "Destinations" ), | 128 | cfgact = new QAction( tr( "Destinations" ), |
129 | QString::null, 0, this, 0 ); | 129 | QString::null, 0, this, 0 ); |
130 | connect( cfgact, SIGNAL( activated() ), | 130 | connect( cfgact, SIGNAL( activated() ), |
131 | SLOT( showSettingsDst() ) ); | 131 | SLOT( showSettingsDst() ) ); |
132 | cfgact->addTo( cfgMenu ); | 132 | cfgact->addTo( cfgMenu ); |
133 | 133 | ||
134 | QAction *a; | 134 | QAction *a; |
135 | 135 | ||
136 | // SECTIONS | 136 | // SECTIONS |
137 | sectionBar = new QPEToolBar( this ); | 137 | sectionBar = new QPEToolBar( this ); |
138 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); | 138 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); |
139 | sectionBar->setHorizontalStretchable( true ); | 139 | sectionBar->setHorizontalStretchable( true ); |
140 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); | 140 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); |
141 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 141 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
142 | sectionBar->setStretchableWidget( label ); | ||
143 | section = new QComboBox( false, sectionBar ); | 142 | section = new QComboBox( false, sectionBar ); |
144 | label = new QLabel( " / ", sectionBar ); | 143 | label = new QLabel( " / ", sectionBar ); |
145 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 144 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
146 | subsection = new QComboBox( false, sectionBar ); | 145 | subsection = new QComboBox( false, sectionBar ); |
147 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 146 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
148 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); | 147 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); |
149 | a->addTo( sectionBar ); | 148 | a->addTo( sectionBar ); |
150 | setSections(); | 149 | setSections(); |
151 | setSubSections(); | 150 | setSubSections(); |
152 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); | 151 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); |
153 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); | 152 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); |
154 | sectionAction->setToggleAction( true ); | 153 | sectionAction->setToggleAction( true ); |
155 | sectionAction->addTo( viewMenu ); | 154 | sectionAction->addTo( viewMenu ); |
155 | sectionBar->setStretchableWidget( section ); | ||
156 | 156 | ||
157 | //FIND | 157 | //FIND |
158 | findBar = new QPEToolBar(this); | 158 | findBar = new QPEToolBar(this); |
159 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); | 159 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); |
160 | label = new QLabel( tr("Filter: "), findBar ); | 160 | label = new QLabel( tr("Filter: "), findBar ); |
161 | label->setBackgroundColor( findBar->backgroundColor() ); | 161 | label->setBackgroundColor( findBar->backgroundColor() ); |
162 | findBar->setHorizontalStretchable( TRUE ); | 162 | findBar->setHorizontalStretchable( TRUE ); |
163 | findEdit = new QLineEdit( findBar, "findEdit" ); | 163 | findEdit = new QLineEdit( findBar, "findEdit" ); |
164 | findBar->setStretchableWidget( findEdit ); | 164 | findBar->setStretchableWidget( findEdit ); |
165 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 165 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), |
166 | this, SLOT( displayList() ) ); | 166 | this, SLOT( displayList() ) ); |
167 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 167 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
168 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); | 168 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); |
169 | a->addTo( findBar ); | 169 | a->addTo( findBar ); |
170 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 170 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
171 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 171 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
172 | a->addTo( findBar ); | 172 | a->addTo( findBar ); |
173 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); | 173 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); |
174 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 174 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
175 | findAction->setToggleAction( true ); | 175 | findAction->setToggleAction( true ); |
176 | findAction->addTo( viewMenu ); | 176 | findAction->addTo( viewMenu ); |
177 | 177 | ||
178 | //SEARCH | 178 | //SEARCH |
179 | searchBar = new QPEToolBar(this); | 179 | searchBar = new QPEToolBar(this); |
180 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 180 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
181 | label = new QLabel( tr("ipkgfind: "), searchBar ); | 181 | label = new QLabel( tr("ipkgfind: "), searchBar ); |
182 | label->setBackgroundColor( searchBar->backgroundColor() ); | 182 | label->setBackgroundColor( searchBar->backgroundColor() ); |
183 | searchBar->setHorizontalStretchable( TRUE ); | 183 | searchBar->setHorizontalStretchable( TRUE ); |
184 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 184 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
185 | searchBar->setStretchableWidget( searchEdit ); | 185 | searchBar->setStretchableWidget( searchEdit ); |
186 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 186 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), |
187 | // this, SLOT( displayList() ) ); | 187 | // this, SLOT( displayList() ) ); |
188 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 188 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
189 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); | 189 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); |
190 | a->addTo( searchBar ); | 190 | a->addTo( searchBar ); |
191 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 191 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
192 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); | 192 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); |
193 | searchCommit->addTo( searchBar ); | 193 | searchCommit->addTo( searchBar ); |
194 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 194 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
195 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); | 195 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); |
196 | a->addTo( searchBar ); | 196 | a->addTo( searchBar ); |
197 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); | 197 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); |
198 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); | 198 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); |
199 | searchAction->setToggleAction( true ); | 199 | searchAction->setToggleAction( true ); |
200 | searchAction->addTo( viewMenu ); | 200 | searchAction->addTo( viewMenu ); |
201 | 201 | ||
202 | //DEST | 202 | //DEST |
203 | destBar = new QPEToolBar(this); | 203 | destBar = new QPEToolBar(this); |
204 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); | 204 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); |
205 | label = new QLabel( tr("Destination: "), destBar ); | 205 | label = new QLabel( tr("Destination: "), destBar ); |
206 | label->setBackgroundColor( destBar->backgroundColor() ); | 206 | label->setBackgroundColor( destBar->backgroundColor() ); |
207 | destBar->setHorizontalStretchable( TRUE ); | 207 | destBar->setHorizontalStretchable( TRUE ); |
208 | destination = new QComboBox( false, destBar ); | 208 | destination = new QComboBox( false, destBar ); |
209 | destination->insertStringList( settings->getDestinationNames() ); | 209 | destination->insertStringList( settings->getDestinationNames() ); |
210 | setComboName(destination,settings->getDestinationName()); | 210 | setComboName(destination,settings->getDestinationName()); |
211 | connect( destination, SIGNAL(activated(int)), | 211 | connect( destination, SIGNAL(activated(int)), |
212 | settings, SLOT(activeDestinationChange(int)) ); | 212 | settings, SLOT(activeDestinationChange(int)) ); |
213 | spacer = new QLabel( " ", destBar ); | 213 | spacer = new QLabel( " ", destBar ); |
214 | spacer->setBackgroundColor( destBar->backgroundColor() ); | 214 | spacer->setBackgroundColor( destBar->backgroundColor() ); |
215 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); | 215 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); |
216 | CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); | 216 | CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); |
217 | CheckBoxLink->setChecked( settings->createLinks() ); | 217 | CheckBoxLink->setChecked( settings->createLinks() ); |
218 | connect( CheckBoxLink, SIGNAL(toggled(bool)), | 218 | connect( CheckBoxLink, SIGNAL(toggled(bool)), |
219 | settings, SLOT(linkEnabled(bool)) ); | 219 | settings, SLOT(linkEnabled(bool)) ); |
220 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); | 220 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); |
221 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); | 221 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); |
222 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 222 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
223 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); | 223 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); |
224 | a->addTo( destBar ); | 224 | a->addTo( destBar ); |
225 | destBar->setStretchableWidget( CheckBoxLink ); | 225 | destBar->setStretchableWidget( CheckBoxLink ); |
226 | destAction->setToggleAction( true ); | 226 | destAction->setToggleAction( true ); |
227 | // destAction->addTo( viewMenu ); | 227 | // destAction->addTo( viewMenu ); |
228 | 228 | ||
229 | // configure the menus | 229 | // configure the menus |
230 | Config cfg( "oipkg", Config::User ); | 230 | Config cfg( "oipkg", Config::User ); |
231 | cfg.setGroup( "gui" ); | 231 | cfg.setGroup( "gui" ); |
232 | 232 | ||
233 | findShow( cfg.readBoolEntry( "findBar", true ) ); | 233 | findShow( cfg.readBoolEntry( "findBar", true ) ); |
234 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); | 234 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); |
235 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); | 235 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); |
236 | destShow( cfg.readBoolEntry( "destBar", false ) ); | 236 | destShow( cfg.readBoolEntry( "destBar", false ) ); |
237 | } | 237 | } |
238 | 238 | ||
239 | MainWindow::~MainWindow() | 239 | MainWindow::~MainWindow() |
240 | { | 240 | { |
241 | Config cfg( "oipkg", Config::User ); | 241 | Config cfg( "oipkg", Config::User ); |
242 | cfg.setGroup( "gui" ); | 242 | cfg.setGroup( "gui" ); |
243 | cfg.writeEntry( "findBar", !findBar->isHidden() ); | 243 | cfg.writeEntry( "findBar", !findBar->isHidden() ); |
244 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); | 244 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); |
245 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); | 245 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); |
246 | cfg.writeEntry( "destBar", !destBar->isHidden() ); | 246 | cfg.writeEntry( "destBar", !destBar->isHidden() ); |
247 | 247 | ||
248 | } | 248 | } |
249 | 249 | ||
250 | void MainWindow::runIpkg() | 250 | void MainWindow::runIpkg() |
251 | { | 251 | { |
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 8c5f0ea..bfb48b3 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -1,149 +1,149 @@ | |||
1 | #include "package.h" | 1 | #include "package.h" |
2 | 2 | ||
3 | #include <qpe/process.h> | 3 | #include <qpe/process.h> |
4 | #include <qpe/stringutil.h> | 4 | #include <qpe/stringutil.h> |
5 | #include <qfile.h> | 5 | #include <qfile.h> |
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | 9 | ||
10 | #include "debug.h" | 10 | #include "debug.h" |
11 | 11 | ||
12 | //Package::~Package() | 12 | //Package::~Package() |
13 | //{ | 13 | //{ |
14 | //} | 14 | //} |
15 | 15 | ||
16 | Package::Package( PackageManagerSettings *s ) | 16 | Package::Package( PackageManagerSettings *s ) |
17 | { | 17 | { |
18 | init(s); | 18 | init(s); |
19 | } | 19 | } |
20 | 20 | ||
21 | void Package::init( PackageManagerSettings *s ) | 21 | void Package::init( PackageManagerSettings *s ) |
22 | { | 22 | { |
23 | settings = s; | 23 | settings = s; |
24 | _size = ""; | 24 | _size = ""; |
25 | _section = ""; | 25 | _section = ""; |
26 | _subsection = ""; | 26 | _subsection = ""; |
27 | _shortDesc = ""; | 27 | _shortDesc = ""; |
28 | _desc = ""; | 28 | _desc = ""; |
29 | _name = ""; | 29 | _name = ""; |
30 | _toProcess = false; | 30 | _toProcess = false; |
31 | _useFileName = false; | 31 | _useFileName = false; |
32 | _old = false; | 32 | _old = false; |
33 | _status = ""; | 33 | _status = ""; |
34 | _dest = settings->getDestinationName(); | 34 | _dest = settings->getDestinationName(); |
35 | _link = settings->createLinks(); | 35 | _link = settings->createLinks(); |
36 | _versions=0; | 36 | _versions=0; |
37 | _version=""; | 37 | _version=""; |
38 | } | 38 | } |
39 | 39 | ||
40 | Package::Package( QStringList pack, PackageManagerSettings *s ) | 40 | Package::Package( QStringList pack, PackageManagerSettings *s ) |
41 | { | 41 | { |
42 | init(s); | 42 | init(s); |
43 | parsePackage( pack ); | 43 | parsePackage( pack ); |
44 | } | 44 | } |
45 | 45 | ||
46 | Package::Package( QString n, PackageManagerSettings *s ) | 46 | Package::Package( QString n, PackageManagerSettings *s ) |
47 | { | 47 | { |
48 | init(s); | 48 | init(s); |
49 | if ( !QFile::exists( n ) ) | 49 | if ( !QFile::exists( n ) ) |
50 | { | 50 | { |
51 | _name = QString( n ); | 51 | _name = QString( n ); |
52 | }else{ | 52 | }else{ |
53 | pvDebug(2,"remote file: "+n); | 53 | pvDebug(4,"remote file: "+n); |
54 | parseIpkgFile( n ); | 54 | parseIpkgFile( n ); |
55 | _useFileName = true; | 55 | _useFileName = true; |
56 | _fileName = QString( n ); | 56 | _fileName = QString( n ); |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | Package::Package( Package *pi ) | 60 | Package::Package( Package *pi ) |
61 | { | 61 | { |
62 | init(pi->settings); | 62 | init(pi->settings); |
63 | copyValues( pi ); | 63 | copyValues( pi ); |
64 | } | 64 | } |
65 | 65 | ||
66 | 66 | ||
67 | void Package::setValue( QString n, QString t ) | 67 | void Package::setValue( QString n, QString t ) |
68 | { | 68 | { |
69 | if ( n == "Package" ) | 69 | if ( n == "Package" ) |
70 | { | 70 | { |
71 | _name = QString( t ); | 71 | _name = QString( t ); |
72 | }else if ( n == "Installed-Size" ) | 72 | }else if ( n == "Installed-Size" ) |
73 | { | 73 | { |
74 | _size = t; | 74 | _size = t; |
75 | // }else if ( n == "Priority") | 75 | // }else if ( n == "Priority") |
76 | // { | 76 | // { |
77 | 77 | ||
78 | }else if ( n == "Section") | 78 | }else if ( n == "Section") |
79 | { | 79 | { |
80 | setSection( t ); | 80 | setSection( t ); |
81 | // }else if ( n == "Maintainer") | 81 | // }else if ( n == "Maintainer") |
82 | // { | 82 | // { |
83 | // | 83 | // |
84 | // }else if ( n == "Architecture") | 84 | // }else if ( n == "Architecture") |
85 | // { | 85 | // { |
86 | 86 | ||
87 | }else if ( n == "Version") | 87 | }else if ( n == "Version") |
88 | { | 88 | { |
89 | _version = t; | 89 | _version = t; |
90 | // }else if ( n == "Pre-Depends") | 90 | // }else if ( n == "Pre-Depends") |
91 | // { | 91 | // { |
92 | // | 92 | // |
93 | // }else if ( n == "Depends") | 93 | // }else if ( n == "Depends") |
94 | // { | 94 | // { |
95 | 95 | ||
96 | }else if ( n == "Filename") | 96 | }else if ( n == "Filename") |
97 | { | 97 | { |
98 | _fileName = t; | 98 | _fileName = t; |
99 | // }else if ( n == "Size") | 99 | // }else if ( n == "Size") |
100 | // { | 100 | // { |
101 | // | 101 | // |
102 | //}else if ( n == "MD5Sum") | 102 | //}else if ( n == "MD5Sum") |
103 | //{ | 103 | //{ |
104 | 104 | ||
105 | }else if ( n == "Description") | 105 | }else if ( n == "Description") |
106 | { | 106 | { |
107 | setDesc( t ); | 107 | setDesc( t ); |
108 | }else if ( n == "Status") | 108 | }else if ( n == "Status") |
109 | { | 109 | { |
110 | if ( installed() ) return; | 110 | if ( installed() ) return; |
111 | _status = t; | 111 | _status = t; |
112 | // }else if ( n == "Essential") | 112 | // }else if ( n == "Essential") |
113 | // { | 113 | // { |
114 | 114 | ||
115 | }else{ | 115 | }else{ |
116 | _values.insert(n,new QString(t)); | 116 | _values.insert(n,new QString(t)); |
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
120 | QString Package::name() | 120 | QString Package::name() |
121 | { | 121 | { |
122 | if (_displayName.isEmpty() ) return _name; | 122 | if (_displayName.isEmpty() ) return _name; |
123 | else return _displayName; | 123 | else return _displayName; |
124 | } | 124 | } |
125 | 125 | ||
126 | 126 | ||
127 | QString Package::installName() | 127 | QString Package::installName() |
128 | { | 128 | { |
129 | if (_useFileName) return _fileName; | 129 | if (_useFileName) return _fileName; |
130 | else return _name; | 130 | else return _name; |
131 | } | 131 | } |
132 | 132 | ||
133 | bool Package::installed() | 133 | bool Package::installed() |
134 | { | 134 | { |
135 | if (_status.contains("installed")) return true; | 135 | if (_status.contains("installed")) return true; |
136 | else | 136 | else |
137 | if (_versions) | 137 | if (_versions) |
138 | { | 138 | { |
139 | QDictIterator<Package> other( *_versions ); | 139 | QDictIterator<Package> other( *_versions ); |
140 | while ( other.current() ) | 140 | while ( other.current() ) |
141 | { | 141 | { |
142 | if (other.current()->status().contains("installed") | 142 | if (other.current()->status().contains("installed") |
143 | && other.current()->version() == version()) | 143 | && other.current()->version() == version()) |
144 | return true; | 144 | return true; |
145 | ++other; | 145 | ++other; |
146 | } | 146 | } |
147 | } | 147 | } |
148 | return false; | 148 | return false; |
149 | } | 149 | } |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 30777c2..0fa4c61 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -247,151 +247,152 @@ void PmIpkg::commit() | |||
247 | 247 | ||
248 | void PmIpkg::doIt() | 248 | void PmIpkg::doIt() |
249 | { | 249 | { |
250 | runwindow->progress->setProgress(0); | 250 | runwindow->progress->setProgress(0); |
251 | show(); | 251 | show(); |
252 | remove(); | 252 | remove(); |
253 | install(); | 253 | install(); |
254 | } | 254 | } |
255 | 255 | ||
256 | 256 | ||
257 | void PmIpkg::remove() | 257 | void PmIpkg::remove() |
258 | { | 258 | { |
259 | if ( to_remove.count() == 0 ) return; | 259 | if ( to_remove.count() == 0 ) return; |
260 | 260 | ||
261 | out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); | 261 | out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); |
262 | 262 | ||
263 | QStringList *fileList; | 263 | QStringList *fileList; |
264 | for (uint i=0; i < to_remove.count(); i++) | 264 | for (uint i=0; i < to_remove.count(); i++) |
265 | { | 265 | { |
266 | if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); | 266 | if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); |
267 | if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) | 267 | if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) |
268 | { | 268 | { |
269 | runwindow->progress->setProgress( 1 ); | 269 | runwindow->progress->setProgress( 1 ); |
270 | linkOpp = removeLink; | 270 | linkOpp = removeLink; |
271 | to_remove.at(i)->processed(); | 271 | to_remove.at(i)->processed(); |
272 | pvDebug(3,"link "+QString::number(i)); | 272 | pvDebug(3,"link "+QString::number(i)); |
273 | if ( to_remove.at(i)->link() ) | 273 | if ( to_remove.at(i)->link() ) |
274 | processFileList( fileList, to_remove.at(i)->dest() ); | 274 | processFileList( fileList, to_remove.at(i)->dest() ); |
275 | //pvDebug(3,"take "+QString::number(i)+" of "+QString::number(to_remove.count())); | 275 | //pvDebug(3,"take "+QString::number(i)+" of "+QString::number(to_remove.count())); |
276 | //if ( to_remove.at(i) ) to_remove.take( i ); | 276 | //if ( to_remove.at(i) ) to_remove.take( i ); |
277 | 277 | ||
278 | out("\n"); | 278 | out("\n"); |
279 | }else{ | 279 | }else{ |
280 | out(tr("Error while removing ")+to_remove.at(i)->name()+"\n"); | 280 | out(tr("Error while removing ")+to_remove.at(i)->name()+"\n"); |
281 | if ( to_remove.at(i)->link() ) | 281 | if ( to_remove.at(i)->link() ) |
282 | processFileList( fileList, to_remove.at(i)->dest() ); | 282 | processFileList( fileList, to_remove.at(i)->dest() ); |
283 | } | 283 | } |
284 | if ( to_remove.at(i)->link() ) | 284 | if ( to_remove.at(i)->link() ) |
285 | processFileList( fileList, to_remove.at(i)->dest() ); | 285 | processFileList( fileList, to_remove.at(i)->dest() ); |
286 | if ( to_remove.at(i)->link() )delete fileList; | 286 | if ( to_remove.at(i)->link() )delete fileList; |
287 | } | 287 | } |
288 | to_remove.clear(); | 288 | to_remove.clear(); |
289 | out("\n"); | 289 | out("\n"); |
290 | } | 290 | } |
291 | 291 | ||
292 | 292 | ||
293 | void PmIpkg::install() | 293 | void PmIpkg::install() |
294 | { | 294 | { |
295 | if ( to_install.count() == 0 ) return; | 295 | if ( to_install.count() == 0 ) return; |
296 | out(tr("Installing")+"\n"+tr("please wait")+"\n"); | 296 | out(tr("Installing")+"\n"+tr("please wait")+"\n"); |
297 | for (uint i=0; i < to_install.count(); i++) | 297 | for (uint i=0; i < to_install.count(); i++) |
298 | { | 298 | { |
299 | qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug | 299 | qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug |
300 | if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) | 300 | if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) |
301 | { | 301 | { |
302 | runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); | 302 | runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); |
303 | to_install.at(i)->processed(); | 303 | to_install.at(i)->processed(); |
304 | linkOpp = createLink; | 304 | linkOpp = createLink; |
305 | if ( to_install.at(i)->link() ) | 305 | if ( to_install.at(i)->link() ) |
306 | makeLinks( to_install.at(i) ); | 306 | makeLinks( to_install.at(i) ); |
307 | // to_install.take( i ); | 307 | // to_install.take( i ); |
308 | out("\n"); | 308 | out("\n"); |
309 | }else{ | 309 | }else{ |
310 | out(tr("Error while installing")+to_install.at(i)->name()+"\n"); | 310 | out(tr("Error while installing")+to_install.at(i)->name()+"\n"); |
311 | linkOpp = createLink; | 311 | linkOpp = createLink; |
312 | if ( to_install.at(i)->link() ) | 312 | if ( to_install.at(i)->link() ) |
313 | makeLinks( to_install.at(i) ); | 313 | makeLinks( to_install.at(i) ); |
314 | } | 314 | } |
315 | } | 315 | } |
316 | out("\n"); | 316 | out("\n"); |
317 | to_install.clear(); | 317 | to_install.clear(); |
318 | } | 318 | } |
319 | 319 | ||
320 | void PmIpkg::createLinks( const QString &dest ) | 320 | void PmIpkg::createLinks( const QString &dest ) |
321 | { | 321 | { |
322 | pvDebug(2,"PmIpkg::createLinks "+dest); | 322 | pvDebug(2,"PmIpkg::createLinks "+dest); |
323 | linkOpp=createLink; | 323 | linkOpp=createLink; |
324 | QString url = settings->getDestinationUrlByName( dest ); | 324 | QString url = settings->getDestinationUrlByName( dest ); |
325 | url = url==""?dest:url; | 325 | url = url==""?dest:url; |
326 | processLinkDir( "/opt", url ); | 326 | processLinkDir( "/opt", url ); |
327 | processLinkDir( "/usr", url ); | 327 | processLinkDir( "/usr", url ); |
328 | } | 328 | } |
329 | 329 | ||
330 | void PmIpkg::removeLinks( const QString &dest ) | 330 | void PmIpkg::removeLinks( const QString &dest ) |
331 | { | 331 | { |
332 | pvDebug(2,"PmIpkg::removeLinks "+dest); | 332 | pvDebug(2,"PmIpkg::removeLinks "+dest); |
333 | linkOpp=removeLink; | 333 | linkOpp=removeLink; |
334 | QString url = settings->getDestinationUrlByName( dest ); | 334 | QString url = settings->getDestinationUrlByName( dest ); |
335 | url = url==""?dest:url; | 335 | url = url==""?dest:url; |
336 | processLinkDir( "/opt", url ); | 336 | processLinkDir( "/opt", url ); |
337 | processLinkDir( "/usr", url ); | 337 | processLinkDir( "/usr", url ); |
338 | } | 338 | } |
339 | 339 | ||
340 | void PmIpkg::update() | 340 | void PmIpkg::update() |
341 | { | 341 | { |
342 | show(); | 342 | show(); |
343 | runIpkg( "update" ); | 343 | if ( runIpkg( "update" ) ) |
344 | runwindow->close(); | 344 | runwindow->close(); |
345 | else out("An error occurred!\nPlease check the log."); | ||
345 | } | 346 | } |
346 | 347 | ||
347 | void PmIpkg::out( QString o ) | 348 | void PmIpkg::out( QString o ) |
348 | { | 349 | { |
349 | runwindow->outPut->append(o); | 350 | runwindow->outPut->append(o); |
350 | runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE); | 351 | runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE); |
351 | } | 352 | } |
352 | 353 | ||
353 | 354 | ||
354 | 355 | ||
355 | 356 | ||
356 | void PmIpkg::show() | 357 | void PmIpkg::show() |
357 | { | 358 | { |
358 | if (!runwindow->isVisible()) | 359 | if (!runwindow->isVisible()) |
359 | { | 360 | { |
360 | runwindow->showMaximized(); | 361 | runwindow->showMaximized(); |
361 | runwindow->show(); | 362 | runwindow->show(); |
362 | } | 363 | } |
363 | runwindow->outPut->setText(""); | 364 | runwindow->outPut->setText(""); |
364 | } | 365 | } |
365 | 366 | ||
366 | void PmIpkg::installFile(const QString &fileName, const QString &dest) | 367 | void PmIpkg::installFile(const QString &fileName, const QString &dest) |
367 | { | 368 | { |
368 | 369 | ||
369 | to_install.clear(); | 370 | to_install.clear(); |
370 | to_remove.clear(); | 371 | to_remove.clear(); |
371 | pvDebug( 2,"PmIpkg::installFile "+ fileName); | 372 | pvDebug( 2,"PmIpkg::installFile "+ fileName); |
372 | Package *p = new Package(fileName,settings); | 373 | Package *p = new Package(fileName,settings); |
373 | if ( dest!="") p->setDest( dest ); | 374 | if ( dest!="") p->setDest( dest ); |
374 | to_install.append( p ); | 375 | to_install.append( p ); |
375 | commit(); | 376 | commit(); |
376 | delete p; | 377 | delete p; |
377 | } | 378 | } |
378 | 379 | ||
379 | void PmIpkg::removeFile(const QString &fileName, const QString &dest) | 380 | void PmIpkg::removeFile(const QString &fileName, const QString &dest) |
380 | { | 381 | { |
381 | 382 | ||
382 | to_install.clear(); | 383 | to_install.clear(); |
383 | to_remove.clear(); | 384 | to_remove.clear(); |
384 | pvDebug( 2,"PmIpkg::removeFile "+ fileName); | 385 | pvDebug( 2,"PmIpkg::removeFile "+ fileName); |
385 | Package *p = new Package(fileName,settings); | 386 | Package *p = new Package(fileName,settings); |
386 | if ( dest!="") p->setDest( dest ); | 387 | if ( dest!="") p->setDest( dest ); |
387 | to_remove.append( p ); | 388 | to_remove.append( p ); |
388 | commit(); | 389 | commit(); |
389 | delete p; | 390 | delete p; |
390 | } | 391 | } |
391 | 392 | ||
392 | 393 | ||
393 | void PmIpkg::clearLists() | 394 | void PmIpkg::clearLists() |
394 | { | 395 | { |
395 | to_remove.clear(); | 396 | to_remove.clear(); |
396 | to_install.clear(); | 397 | to_install.clear(); |
397 | } | 398 | } |