summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp8
-rw-r--r--noncore/unsupported/oipkg/packagelistitem.cpp8
-rw-r--r--noncore/unsupported/oipkg/packagelistview.cpp8
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp2
4 files changed, 13 insertions, 13 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index a09bc30..7f1c0b8 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -83,214 +83,214 @@ void MainWindow::makeMenu()
83{ 83{
84 84
85 QToolBar *toolBar = new QToolBar( this ); 85 QToolBar *toolBar = new QToolBar( this );
86 QMenuBar *menuBar = new QMenuBar( toolBar ); 86 QMenuBar *menuBar = new QMenuBar( toolBar );
87 QPopupMenu *srvMenu = new QPopupMenu( menuBar ); 87 QPopupMenu *srvMenu = new QPopupMenu( menuBar );
88 QPopupMenu *viewMenu = new QPopupMenu( menuBar ); 88 QPopupMenu *viewMenu = new QPopupMenu( menuBar );
89 QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); 89 QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
90 QPopupMenu *helpMenu = new QPopupMenu( menuBar ); 90 QPopupMenu *helpMenu = new QPopupMenu( menuBar );
91 91
92 setToolBarsMovable( false ); 92 setToolBarsMovable( false );
93 toolBar->setHorizontalStretchable( true ); 93 toolBar->setHorizontalStretchable( true );
94 menuBar->insertItem( tr( "Package" ), srvMenu ); 94 menuBar->insertItem( tr( "Package" ), srvMenu );
95 menuBar->insertItem( tr( "View" ), viewMenu ); 95 menuBar->insertItem( tr( "View" ), viewMenu );
96 menuBar->insertItem( tr( "Settings" ), cfgMenu ); 96 menuBar->insertItem( tr( "Settings" ), cfgMenu );
97 menuBar->insertItem( tr( "Help" ), helpMenu ); 97 menuBar->insertItem( tr( "Help" ), helpMenu );
98 98
99// QLabel *spacer; 99// QLabel *spacer;
100// spacer = new QLabel( "", toolBar ); 100// spacer = new QLabel( "", toolBar );
101// spacer->setBackgroundColor( toolBar->backgroundColor() ); 101// spacer->setBackgroundColor( toolBar->backgroundColor() );
102// toolBar->setStretchableWidget( spacer ); 102// toolBar->setStretchableWidget( spacer );
103 103
104 104
105 runAction = new QAction( tr( "Apply" ), 105 runAction = new QAction( tr( "Apply" ),
106 Resource::loadPixmap( "oipkg/install" ), 106 Resource::loadPixmap( "oipkg/install" ),
107 QString::null, 0, this, 0 ); 107 QString::null, 0, this, 0 );
108 connect( runAction, SIGNAL( activated() ), 108 connect( runAction, SIGNAL( activated() ),
109 this, SLOT( runIpkg() ) ); 109 this, SLOT( runIpkg() ) );
110 runAction->addTo( toolBar ); 110 runAction->addTo( toolBar );
111 runAction->addTo( srvMenu ); 111 runAction->addTo( srvMenu );
112 112
113 srvMenu->insertSeparator(); 113 srvMenu->insertSeparator();
114 114
115 updateAction = new QAction( tr( "Update" ), 115 updateAction = new QAction( tr( "Update" ),
116 Resource::loadIconSet( "oipkg/update" ), 116 Resource::loadIconSet( "oipkg/update" ),
117 QString::null, 0, this, 0 ); 117 QString::null, 0, this, 0 );
118 connect( updateAction, SIGNAL( activated() ), 118 connect( updateAction, SIGNAL( activated() ),
119 this , SLOT( updateList() ) ); 119 this , SLOT( updateList() ) );
120 updateAction->addTo( toolBar ); 120 updateAction->addTo( toolBar );
121 updateAction->addTo( srvMenu ); 121 updateAction->addTo( srvMenu );
122 122
123 QAction *cfgact; 123 QAction *cfgact;
124 124
125 cfgact = new QAction( tr( "Setups" ), 125 cfgact = new QAction( tr( "Setups" ),
126 QString::null, 0, this, 0 ); 126 QString::null, 0, this, 0 );
127 connect( cfgact, SIGNAL( activated() ), 127 connect( cfgact, SIGNAL( activated() ),
128 SLOT( showSettingsSetup() ) ); 128 SLOT( showSettingsSetup() ) );
129 cfgact->addTo( cfgMenu ); 129 cfgact->addTo( cfgMenu );
130 130
131 cfgact = new QAction( tr( "Servers" ), 131 cfgact = new QAction( tr( "Servers" ),
132 QString::null, 0, this, 0 ); 132 QString::null, 0, this, 0 );
133 connect( cfgact, SIGNAL( activated() ), 133 connect( cfgact, SIGNAL( activated() ),
134 SLOT( showSettingsSrv() ) ); 134 SLOT( showSettingsSrv() ) );
135 cfgact->addTo( cfgMenu ); 135 cfgact->addTo( cfgMenu );
136 cfgact = new QAction( tr( "Destinations" ), 136 cfgact = new QAction( tr( "Destinations" ),
137 QString::null, 0, this, 0 ); 137 QString::null, 0, this, 0 );
138 connect( cfgact, SIGNAL( activated() ), 138 connect( cfgact, SIGNAL( activated() ),
139 SLOT( showSettingsDst() ) ); 139 SLOT( showSettingsDst() ) );
140 cfgact->addTo( cfgMenu ); 140 cfgact->addTo( cfgMenu );
141 141
142 QAction *a; 142 QAction *a;
143 143
144 // SECTIONS 144 // SECTIONS
145 sectionBar = new QToolBar( this ); 145 sectionBar = new QToolBar( this );
146 addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); 146 addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE );
147 sectionBar->setHorizontalStretchable( true ); 147 sectionBar->setHorizontalStretchable( true );
148 QLabel *label = new QLabel( sectionBar, "section" ); 148 QLabel *label = new QLabel( sectionBar, "section" );
149// label->setBackgroundMode( NoBackground ); 149// label->setBackgroundMode( NoBackground );
150 label->font().setPointSize( 8 ); 150 label->font().setPointSize( 8 );
151 label->setText( tr( "Section:" ) ); 151 label->setText( tr( "Section:" ) );
152 sectionBar->setStretchableWidget( label ); 152 sectionBar->setStretchableWidget( label );
153 section = new QComboBox( false, sectionBar ); 153 section = new QComboBox( false, sectionBar );
154 section->font().setPointSize( 8 ); 154 section->font().setPointSize( 8 );
155 label = new QLabel( " / ", sectionBar ); 155 label = new QLabel( " / ", sectionBar );
156 label->font().setPointSize( 8 ); 156 label->font().setPointSize( 8 );
157// label->setBackgroundMode( PaletteForeground ); 157// label->setBackgroundMode( PaletteForeground );
158 subsection = new QComboBox( false, sectionBar ); 158 subsection = new QComboBox( false, sectionBar );
159 subsection->font().setPointSize( 8 ); 159 subsection->font().setPointSize( 8 );
160 a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 160 a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
161 connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); 161 connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) );
162 a->addTo( sectionBar ); 162 a->addTo( sectionBar );
163 setSections(); 163 setSections();
164 setSubSections(); 164 setSubSections();
165 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); 165 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 );
166 connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); 166 connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) );
167 sectionAction->setToggleAction( true ); 167 sectionAction->setToggleAction( true );
168 sectionAction->addTo( viewMenu ); 168 sectionAction->addTo( viewMenu );
169 // sectionBar->setStretchableWidget( section ); 169 // sectionBar->setStretchableWidget( section );
170 170
171 //FIND 171 //FIND
172 findBar = new QToolBar(this); 172 findBar = new QToolBar(this);
173 addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); 173 addToolBar( findBar, "Filter", QMainWindow::Top, TRUE );
174 label = new QLabel( tr("Filter: "), findBar ); 174 label = new QLabel( tr("Filter: "), findBar );
175// label->setBackgroundMode( PaletteForeground ); 175// label->setBackgroundMode( PaletteForeground );
176 findBar->setHorizontalStretchable( TRUE ); 176 findBar->setHorizontalStretchable( TRUE );
177 findEdit = new QLineEdit( findBar, "findEdit" ); 177 findEdit = new QLineEdit( findBar, "findEdit" );
178 findBar->setStretchableWidget( findEdit ); 178 findBar->setStretchableWidget( findEdit );
179 connect( findEdit, SIGNAL( textChanged( const QString & ) ), 179 connect( findEdit, SIGNAL( textChanged(const QString&) ),
180 this, SLOT( displayList() ) ); 180 this, SLOT( displayList() ) );
181 a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); 181 a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
182 connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); 182 connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) );
183 a->addTo( findBar ); 183 a->addTo( findBar );
184 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 184 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
185 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); 185 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
186 a->addTo( findBar ); 186 a->addTo( findBar );
187 findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); 187 findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 );
188 connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); 188 connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) );
189 findAction->setToggleAction( true ); 189 findAction->setToggleAction( true );
190 findAction->addTo( viewMenu ); 190 findAction->addTo( viewMenu );
191 191
192 //SEARCH 192 //SEARCH
193 searchBar = new QToolBar(this); 193 searchBar = new QToolBar(this);
194 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); 194 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
195 label = new QLabel( tr("Search: "), searchBar ); 195 label = new QLabel( tr("Search: "), searchBar );
196// label->setBackgroundMode( PaletteForeground ); 196// label->setBackgroundMode( PaletteForeground );
197 searchBar->setHorizontalStretchable( TRUE ); 197 searchBar->setHorizontalStretchable( TRUE );
198 searchEdit = new QLineEdit( searchBar, "seachEdit" ); 198 searchEdit = new QLineEdit( searchBar, "seachEdit" );
199 searchBar->setStretchableWidget( searchEdit ); 199 searchBar->setStretchableWidget( searchEdit );
200// connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 200// connect( searchEdit, SIGNAL( textChanged(const QString&) ),
201// this, SLOT( displayList() ) ); 201// this, SLOT( displayList() ) );
202 a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); 202 a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
203 connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); 203 connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) );
204 a->addTo( searchBar ); 204 a->addTo( searchBar );
205 searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); 205 searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
206 connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); 206 connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) );
207 searchCommit->addTo( searchBar ); 207 searchCommit->addTo( searchBar );
208 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 208 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
209 connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); 209 connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) );
210 a->addTo( searchBar ); 210 a->addTo( searchBar );
211 searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); 211 searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 );
212 connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); 212 connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) );
213 searchAction->setToggleAction( true ); 213 searchAction->setToggleAction( true );
214 searchAction->addTo( viewMenu ); 214 searchAction->addTo( viewMenu );
215 215
216 //DEST 216 //DEST
217 destBar = new QToolBar(this); 217 destBar = new QToolBar(this);
218 addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); 218 addToolBar( destBar, "Destination", QMainWindow::Top, TRUE );
219 label = new QLabel( tr("Destination: "), destBar ); 219 label = new QLabel( tr("Destination: "), destBar );
220// label->setBackgroundMode( PaletteForeground ); 220// label->setBackgroundMode( PaletteForeground );
221 destBar->setHorizontalStretchable( TRUE ); 221 destBar->setHorizontalStretchable( TRUE );
222 destination = new QComboBox( false, destBar ); 222 destination = new QComboBox( false, destBar );
223 destination->insertStringList( settings->getDestinationNames() ); 223 destination->insertStringList( settings->getDestinationNames() );
224 setComboName(destination,settings->getDestinationName()); 224 setComboName(destination,settings->getDestinationName());
225 connect( destination, SIGNAL(activated(int)), 225 connect( destination, SIGNAL(activated(int)),
226 settings, SLOT(activeDestinationChange(int)) ); 226 settings, SLOT(activeDestinationChange(int)) );
227// space->setBackgroundMode( PaletteForeground ); 227// space->setBackgroundMode( PaletteForeground );
228 CheckBoxLink = new QCheckBox( tr("Link"), destBar); 228 CheckBoxLink = new QCheckBox( tr("Link"), destBar);
229// CheckBoxLink->setBackgroundMode( PaletteForeground ); 229// CheckBoxLink->setBackgroundMode( PaletteForeground );
230 CheckBoxLink->setChecked( settings->createLinks() ); 230 CheckBoxLink->setChecked( settings->createLinks() );
231 connect( CheckBoxLink, SIGNAL(toggled(bool)), 231 connect( CheckBoxLink, SIGNAL(toggled(bool)),
232 settings, SLOT(linkEnabled(bool)) ); 232 settings, SLOT(linkEnabled(bool)) );
233 destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); 233 destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 );
234 connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); 234 connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) );
235 a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 235 a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
236 connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); 236 connect( a, SIGNAL( activated() ), SLOT( destClose() ) );
237 a->addTo( destBar ); 237 a->addTo( destBar );
238 destBar->setStretchableWidget( CheckBoxLink ); 238 destBar->setStretchableWidget( CheckBoxLink );
239 destAction->setToggleAction( true ); 239 destAction->setToggleAction( true );
240 destAction->addTo( viewMenu ); 240 destAction->addTo( viewMenu );
241 241
242// helpMenu 242// helpMenu
243 helpMenu->insertSeparator(); 243 helpMenu->insertSeparator();
244 a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); 244 a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 );
245 a->addTo( helpMenu ); 245 a->addTo( helpMenu );
246 helpMenu->insertSeparator(); 246 helpMenu->insertSeparator();
247 a = new QAction( tr( "Install" ), 247 a = new QAction( tr( "Install" ),
248 Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 ); 248 Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 );
249 a->addTo( helpMenu ); 249 a->addTo( helpMenu );
250 a = new QAction( tr( "Remove" ), 250 a = new QAction( tr( "Remove" ),
251 Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 ); 251 Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 );
252 a->addTo( helpMenu ); 252 a->addTo( helpMenu );
253 helpMenu->insertSeparator(); 253 helpMenu->insertSeparator();
254 a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 ); 254 a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 );
255 a->addTo( helpMenu ); 255 a->addTo( helpMenu );
256 helpMenu->insertSeparator(); 256 helpMenu->insertSeparator();
257 a = new QAction( tr( "New version, installed" ), 257 a = new QAction( tr( "New version, installed" ),
258 Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 ); 258 Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 );
259 a->addTo( helpMenu ); 259 a->addTo( helpMenu );
260 a = new QAction( tr( "New version, not installed" ), 260 a = new QAction( tr( "New version, not installed" ),
261 Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 ); 261 Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 );
262 a->addTo( helpMenu ); 262 a->addTo( helpMenu );
263 a = new QAction( tr( "Old version, installed" ), 263 a = new QAction( tr( "Old version, installed" ),
264 Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 ); 264 Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 );
265 a->addTo( helpMenu ); 265 a->addTo( helpMenu );
266 a = new QAction( tr( "Old version, not installed" ), 266 a = new QAction( tr( "Old version, not installed" ),
267 Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 ); 267 Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 );
268 a->addTo( helpMenu ); 268 a->addTo( helpMenu );
269 a = new QAction( tr( "Old version, new version installed" ), 269 a = new QAction( tr( "Old version, new version installed" ),
270 Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 ); 270 Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 );
271 a->addTo( helpMenu ); 271 a->addTo( helpMenu );
272 a = new QAction( tr( "New version, old version installed" ), 272 a = new QAction( tr( "New version, old version installed" ),
273 Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 ); 273 Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 );
274 a->addTo( helpMenu ); 274 a->addTo( helpMenu );
275 //a = new QAction( tr( "" ), 275 //a = new QAction( tr( "" ),
276 // Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 ); 276 // Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 );
277 // a->addTo( helpMenu ); 277 // a->addTo( helpMenu );
278 278
279 // configure the menus 279 // configure the menus
280 Config cfg( "oipkg", Config::User ); 280 Config cfg( "oipkg", Config::User );
281 cfg.setGroup( "gui" ); 281 cfg.setGroup( "gui" );
282 282
283 findShow( cfg.readBoolEntry( "findBar", true ) ); 283 findShow( cfg.readBoolEntry( "findBar", true ) );
284 searchShow( cfg.readBoolEntry( "searchBar", true ) ); 284 searchShow( cfg.readBoolEntry( "searchBar", true ) );
285 sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); 285 sectionShow( cfg.readBoolEntry( "sectionBar", true ) );
286 destShow( cfg.readBoolEntry( "destBar", false ) ); 286 destShow( cfg.readBoolEntry( "destBar", false ) );
287 setComboName(section,cfg.readEntry("default_section")); 287 setComboName(section,cfg.readEntry("default_section"));
288 sectionChanged(); 288 sectionChanged();
289} 289}
290 290
291MainWindow::~MainWindow() 291MainWindow::~MainWindow()
292{ 292{
293 Config cfg( "oipkg", Config::User ); 293 Config cfg( "oipkg", Config::User );
294 cfg.setGroup( "gui" ); 294 cfg.setGroup( "gui" );
295 cfg.writeEntry( "findBar", !findBar->isHidden() ); 295 cfg.writeEntry( "findBar", !findBar->isHidden() );
296 cfg.writeEntry( "searchBar", !searchBar->isHidden() ); 296 cfg.writeEntry( "searchBar", !searchBar->isHidden() );
@@ -375,141 +375,141 @@ void MainWindow::setSections()
375{ 375{
376 section->clear(); 376 section->clear();
377 section->insertStringList( packageListServers.getSections() ); 377 section->insertStringList( packageListServers.getSections() );
378} 378}
379 379
380void MainWindow::setSubSections() 380void MainWindow::setSubSections()
381{ 381{
382 subsection->clear(); 382 subsection->clear();
383 subsection->insertStringList( packageListServers.getSubSections() ); 383 subsection->insertStringList( packageListServers.getSubSections() );
384} 384}
385 385
386 386
387void MainWindow::showSettings(int i) 387void MainWindow::showSettings(int i)
388{ 388{
389 if ( settings->showDialog( i ) ) 389 if ( settings->showDialog( i ) )
390 { 390 {
391 updateList(); 391 updateList();
392 } 392 }
393 setComboName(destination,settings->getDestinationName()); 393 setComboName(destination,settings->getDestinationName());
394 CheckBoxLink->setChecked( settings->createLinks() ); 394 CheckBoxLink->setChecked( settings->createLinks() );
395} 395}
396void MainWindow::showSettingsSetup() 396void MainWindow::showSettingsSetup()
397{ 397{
398 showSettings(0); 398 showSettings(0);
399} 399}
400void MainWindow::showSettingsSrv() 400void MainWindow::showSettingsSrv()
401{ 401{
402 showSettings(1); 402 showSettings(1);
403} 403}
404void MainWindow::showSettingsDst() 404void MainWindow::showSettingsDst()
405{ 405{
406 showSettings(2); 406 showSettings(2);
407} 407}
408 408
409void MainWindow::sectionShow(bool b) 409void MainWindow::sectionShow(bool b)
410{ 410{
411 if (b) sectionBar->show(); 411 if (b) sectionBar->show();
412 else sectionBar->hide(); 412 else sectionBar->hide();
413 sectionAction->setOn( b ); 413 sectionAction->setOn( b );
414} 414}
415 415
416void MainWindow::sectionClose() 416void MainWindow::sectionClose()
417{ 417{
418 sectionAction->setOn( false ); 418 sectionAction->setOn( false );
419} 419}
420 420
421void MainWindow::findShow(bool b) 421void MainWindow::findShow(bool b)
422{ 422{
423 if (b) findBar->show(); 423 if (b) findBar->show();
424 else findBar->hide(); 424 else findBar->hide();
425 findAction->setOn( b ); 425 findAction->setOn( b );
426} 426}
427 427
428void MainWindow::findClose() 428void MainWindow::findClose()
429{ 429{
430 findAction->setOn( false ); 430 findAction->setOn( false );
431} 431}
432 432
433void MainWindow::searchShow(bool b) 433void MainWindow::searchShow(bool b)
434{ 434{
435 if (b) searchBar->show(); 435 if (b) searchBar->show();
436 else searchBar->hide(); 436 else searchBar->hide();
437 searchAction->setOn( b ); 437 searchAction->setOn( b );
438} 438}
439 439
440void MainWindow::searchClose() 440void MainWindow::searchClose()
441{ 441{
442 searchAction->setOn( false ); 442 searchAction->setOn( false );
443} 443}
444 444
445 445
446void MainWindow::destShow(bool b) 446void MainWindow::destShow(bool b)
447{ 447{
448 if (b) destBar->show(); 448 if (b) destBar->show();
449 else destBar->hide(); 449 else destBar->hide();
450 destAction->setOn( b ); 450 destAction->setOn( b );
451} 451}
452 452
453void MainWindow::destClose() 453void MainWindow::destClose()
454{ 454{
455 destAction->setOn( false ); 455 destAction->setOn( false );
456} 456}
457 457
458void MainWindow::setDocument(const QString &fileName) 458void MainWindow::setDocument(const QString &fileName)
459{ 459{
460 if ( !QFile::exists( fileName ) ) return; 460 if ( !QFile::exists( fileName ) ) return;
461 ipkg->installFile( fileName ); 461 ipkg->installFile( fileName );
462 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 462 QCopEnvelope e("QPE/System", "linkChanged(QString)");
463 QString lf = QString::null; 463 QString lf = QString::null;
464 e << lf; 464 e << lf;
465} 465}
466 466
467 467
468void MainWindow::makeChannel() 468void MainWindow::makeChannel()
469 { 469 {
470 channel = new QCopChannel( "QPE/Application/oipkg", this ); 470 channel = new QCopChannel( "QPE/Application/oipkg", this );
471 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 471 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
472 this, SLOT(receive(const QCString&, const QByteArray&)) ); 472 this, SLOT(receive(const QCString&,const QByteArray&)) );
473} 473}
474 474
475 475
476 476
477void MainWindow::receive(const QCString &msg, const QByteArray &arg) 477void MainWindow::receive(const QCString &msg, const QByteArray &arg)
478{ 478{
479 pvDebug(3, "QCop "+msg+" "+QCString(arg)); 479 pvDebug(3, "QCop "+msg+" "+QCString(arg));
480 if ( msg == "installFile(QString)" ) 480 if ( msg == "installFile(QString)" )
481 { 481 {
482 ipkg->installFile( QString(arg) ); 482 ipkg->installFile( QString(arg) );
483 }else if( msg == "removeFile(QString)" ) 483 }else if( msg == "removeFile(QString)" )
484 { 484 {
485 ipkg->removeFile( QString(arg) ); 485 ipkg->removeFile( QString(arg) );
486 }else if( msg == "createLinks(QString)" ) 486 }else if( msg == "createLinks(QString)" )
487 { 487 {
488 ipkg->createLinks( QString(arg) ); 488 ipkg->createLinks( QString(arg) );
489 }else if( msg == "removeLinks(QString)" ) 489 }else if( msg == "removeLinks(QString)" )
490 { 490 {
491 ipkg->removeLinks( QString(arg) ); 491 ipkg->removeLinks( QString(arg) );
492 }else{ 492 }else{
493 pvDebug(2,"Huh what do ya want") 493 pvDebug(2,"Huh what do ya want")
494 } 494 }
495} 495}
496 496
497 497
498void MainWindow::createLinks() 498void MainWindow::createLinks()
499{ 499{
500 pvDebug(2,"creating links..."); 500 pvDebug(2,"creating links...");
501 ipkg->createLinks( settings->destinationurl->text() ); 501 ipkg->createLinks( settings->destinationurl->text() );
502} 502}
503 503
504void MainWindow::removeLinks() 504void MainWindow::removeLinks()
505{ 505{
506 pvDebug(2,"removing links..."); 506 pvDebug(2,"removing links...");
507 ipkg->removeLinks( settings->destinationurl->text() ); 507 ipkg->removeLinks( settings->destinationurl->text() );
508} 508}
509 509
510void MainWindow::remotePackageQuery() 510void MainWindow::remotePackageQuery()
511{ 511{
512 packageListSearch.query( searchEdit->text() ); 512 packageListSearch.query( searchEdit->text() );
513 packageListSearch.update(); 513 packageListSearch.update();
514 displayList(); 514 displayList();
515} 515}
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp
index 1610a37..1b4812d 100644
--- a/noncore/unsupported/oipkg/packagelistitem.cpp
+++ b/noncore/unsupported/oipkg/packagelistitem.cpp
@@ -118,123 +118,123 @@ void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg,
118 118
119void PackageListItem::paintFocus( QPainter *p, const QColorGroup & cg, 119void PackageListItem::paintFocus( QPainter *p, const QColorGroup & cg,
120 const QRect & r ) 120 const QRect & r )
121{ 121{
122 // Skip QCheckListItem 122 // Skip QCheckListItem
123 // (makes you wonder what we're getting from QCheckListItem) 123 // (makes you wonder what we're getting from QCheckListItem)
124 QListViewItem::paintFocus(p,cg,r); 124 QListViewItem::paintFocus(p,cg,r);
125} 125}
126 126
127QPixmap PackageListItem::statePixmap() const 127QPixmap PackageListItem::statePixmap() const
128{ 128{
129 bool installed = package->installed(); 129 bool installed = package->installed();
130 bool old = package->isOld(); 130 bool old = package->isOld();
131 bool verinstalled = package->otherInstalled(); 131 bool verinstalled = package->otherInstalled();
132 if ( !package->toProcess() ) { 132 if ( !package->toProcess() ) {
133 if ( !installed ) 133 if ( !installed )
134 if (old) 134 if (old)
135 { 135 {
136 if (verinstalled) return *pm_uninstalled_old_installed_new; 136 if (verinstalled) return *pm_uninstalled_old_installed_new;
137 else return *pm_uninstalled_old; 137 else return *pm_uninstalled_old;
138 } 138 }
139 else 139 else
140 { 140 {
141 if (verinstalled) return *pm_uninstalled_installed_old; 141 if (verinstalled) return *pm_uninstalled_installed_old;
142 else return *pm_uninstalled; 142 else return *pm_uninstalled;
143 } 143 }
144 else 144 else
145 if (old) return *pm_installed_old; 145 if (old) return *pm_installed_old;
146 else return *pm_installed; 146 else return *pm_installed;
147 } else { //toProcess() == true 147 } else { //toProcess() == true
148 if ( !installed ) 148 if ( !installed )
149 return *pm_install; 149 return *pm_install;
150 else 150 else
151 return *pm_uninstall; 151 return *pm_uninstall;
152 } 152 }
153} 153}
154 154
155QString PackageListItem::key( int column, bool ascending ) const 155QString PackageListItem::key( int column, bool ascending ) const
156{ 156{
157 if ( column == 2 ) { 157 if ( column == 2 ) {
158 QString t = text(2); 158 QString t = text(2);
159 double bytes=t.toDouble(); 159 double bytes=t.toDouble();
160 if ( t.contains('M') ) bytes*=1024*1024; 160 if ( t.contains('M') ) bytes*=1024*1024;
161 else if ( t.contains('K') || t.contains('k') ) bytes*=1024; 161 else if ( t.contains('K') || t.contains('k') ) bytes*=1024;
162 if ( !ascending ) bytes=999999999-bytes; 162 if ( !ascending ) bytes=999999999-bytes;
163 return QString().sprintf("%09d",(int)bytes); 163 return QString().sprintf("%09d",(int)bytes);
164 } else { 164 } else {
165 return QListViewItem::key(column,ascending); 165 return QListViewItem::key(column,ascending);
166 } 166 }
167} 167}
168 168
169void PackageListItem::setOn( bool b ) 169void PackageListItem::setOn( bool b )
170{ 170{
171 QCheckListItem::setOn( b ); 171 QCheckListItem::setOn( b );
172 package->toggleProcess(); 172 package->toggleProcess();
173 package->setLink( settings->createLinks() ); 173 package->setLink( settings->createLinks() );
174 displayDetails(); 174 displayDetails();
175} 175}
176 176
177void PackageListItem::displayDetails() 177void PackageListItem::displayDetails()
178{ 178{
179 QString sod; 179 QString sod;
180 sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits()); 180 sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits());
181 //sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest()); 181 //sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest());
182 sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); 182 sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest());
183 sod = sod.isEmpty()?QString(""):QString(" ("+sod+")"); 183 sod = sod.isEmpty()?QString(""):QString(" ("+sod+")");
184 setText(0, package->name()+sod ); 184 setText(0, package->name()+sod );
185 nameItem->setText( 0, QObject::tr("Name: ")+package->name()); 185 nameItem->setText( 0, QObject::tr("Name: ")+package->name());
186 linkItem->setText( 0, QObject::tr("Link: ")+(package->link()?QObject::tr("Yes"):QObject::tr("No"))); 186 linkItem->setText( 0, QObject::tr("Link: ")+(package->link()?QObject::tr("Yes"):QObject::tr("No")));
187 destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); 187 destItem->setText( 0, QObject::tr("Destination: ")+package->dest() );
188 statusItem->setText( 0, QObject::tr("Status: ")+package->status() ); 188 statusItem->setText( 0, QObject::tr("Status: ")+package->status() );
189 repaint(); 189 repaint();
190} 190}
191 191
192QPopupMenu* PackageListItem::getPopupMenu() 192QPopupMenu* PackageListItem::getPopupMenu()
193{ 193{
194 popupMenu->clear(); 194 popupMenu->clear();
195 destsMenu->clear(); 195 destsMenu->clear();
196 196
197 QAction *popupAction; 197 QAction *popupAction;
198 qDebug("PackageListItem::showPopup "); 198 qDebug("PackageListItem::showPopup ");
199 199
200 if (!package->installed()){ 200 if (!package->installed()){
201 popupMenu->insertItem( QObject::tr("Install to"), destsMenu ); 201 popupMenu->insertItem( QObject::tr("Install to"), destsMenu );
202 QStringList dests = settings->getDestinationNames(); 202 QStringList dests = settings->getDestinationNames();
203 QString ad = settings->getDestinationName(); 203 QString ad = settings->getDestinationName();
204 for (uint i = 0; i < dests.count(); i++ ) 204 for (uint i = 0; i < dests.count(); i++ )
205 { 205 {
206 popupAction = new QAction( dests[i], QString::null, 0, popupMenu, 0 ); 206 popupAction = new QAction( dests[i], QString::null, 0, popupMenu, 0 );
207 popupAction->addTo( destsMenu ); 207 popupAction->addTo( destsMenu );
208 if ( dests[i] == ad && getPackage()->toInstall() ) 208 if ( dests[i] == ad && getPackage()->toInstall() )
209 { 209 {
210 popupAction->setToggleAction( true ); 210 popupAction->setToggleAction( true );
211 popupAction->setOn(true); 211 popupAction->setOn(true);
212 } 212 }
213 } 213 }
214 connect( destsMenu, SIGNAL( activated( int ) ), 214 connect( destsMenu, SIGNAL( activated(int) ),
215 this, SLOT( menuAction( int ) ) ); 215 this, SLOT( menuAction(int) ) );
216 popupMenu->popup( QCursor::pos() ); 216 popupMenu->popup( QCursor::pos() );
217 }else{ 217 }else{
218 popupMenu->insertItem( QObject::tr("Remove")); 218 popupMenu->insertItem( QObject::tr("Remove"));
219 connect( popupMenu, SIGNAL( activated( int ) ), 219 connect( popupMenu, SIGNAL( activated(int) ),
220 this, SLOT( menuAction( int ) ) ); 220 this, SLOT( menuAction(int) ) );
221 popupMenu->popup( QCursor::pos() ); 221 popupMenu->popup( QCursor::pos() );
222 } 222 }
223 return popupMenu; 223 return popupMenu;
224} 224}
225 225
226void PackageListItem::menuAction( int i ) 226void PackageListItem::menuAction( int i )
227{ 227{
228 if (!package->installed()){ 228 if (!package->installed()){
229 package->setDest( destsMenu->text(i) ); 229 package->setDest( destsMenu->text(i) );
230 package->setLink( settings->createLinks() ); 230 package->setLink( settings->createLinks() );
231 } 231 }
232 package->setOn(); 232 package->setOn();
233 displayDetails(); 233 displayDetails();
234} 234}
235 235
236//void PackageListItem::toggleProcess() 236//void PackageListItem::toggleProcess()
237//{ 237//{
238// package->toggleProcess() ; 238// package->toggleProcess() ;
239// displayDetails(); 239// displayDetails();
240//} 240//}
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp
index 3c7435d..98ebf88 100644
--- a/noncore/unsupported/oipkg/packagelistview.cpp
+++ b/noncore/unsupported/oipkg/packagelistview.cpp
@@ -1,118 +1,118 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 9// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
10#include "packagelistview.h" 10#include "packagelistview.h"
11 11
12#include <qpopupmenu.h> 12#include <qpopupmenu.h>
13#include <qaction.h> 13#include <qaction.h>
14 14
15#include "listviewitemoipkg.h" 15#include "listviewitemoipkg.h"
16#include "packagelistitem.h" 16#include "packagelistitem.h"
17#include "pksettings.h" 17#include "pksettings.h"
18 18
19PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s) 19PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s)
20 : QListView(p,n) 20 : QListView(p,n)
21{ 21{
22 settings = s; 22 settings = s;
23 popupTimer = new QTimer( this ); 23 popupTimer = new QTimer( this );
24 setSelectionMode(QListView::NoSelection); 24 setSelectionMode(QListView::NoSelection);
25 addColumn( tr("Package") ); 25 addColumn( tr("Package") );
26 setRootIsDecorated( true ); 26 setRootIsDecorated( true );
27 27
28 connect( popupTimer, SIGNAL(timeout()), 28 connect( popupTimer, SIGNAL(timeout()),
29 this, SLOT(showPopup()) ); 29 this, SLOT(showPopup()) );
30 connect( this, SIGNAL( pressed( QListViewItem* ) ), 30 connect( this, SIGNAL( pressed(QListViewItem*) ),
31 this, SLOT( setCurrent( QListViewItem* ) ) ); 31 this, SLOT( setCurrent(QListViewItem*) ) );
32 connect( this, SIGNAL( clicked( QListViewItem* ) ), 32 connect( this, SIGNAL( clicked(QListViewItem*) ),
33 this, SLOT( stopTimer( QListViewItem* ) ) ); 33 this, SLOT( stopTimer(QListViewItem*) ) );
34 34
35} 35}
36 36
37//PackageListView::~PackageListView() 37//PackageListView::~PackageListView()
38//{ 38//{
39//} 39//}
40 40
41void PackageListView::setCurrent( QListViewItem* p ) 41void PackageListView::setCurrent( QListViewItem* p )
42{ 42{
43 qDebug("PackageListView::setCurrent "); 43 qDebug("PackageListView::setCurrent ");
44 activeItem = (ListViewItemOipkg*)p; 44 activeItem = (ListViewItemOipkg*)p;
45 45
46 if ( activeItem != 0 ) popupTimer->start( 750, true ); 46 if ( activeItem != 0 ) popupTimer->start( 750, true );
47 47
48// if ( activeItem->getType() != ListViewItemOipkg::Package ){ 48// if ( activeItem->getType() != ListViewItemOipkg::Package ){
49// qDebug("PackageListView::setCurrent !p "); 49// qDebug("PackageListView::setCurrent !p ");
50// activePackage = 0; 50// activePackage = 0;
51 // activePackageListItem = 0; 51 // activePackageListItem = 0;
52// qDebug("PackageListView::setCurrent returning "); 52// qDebug("PackageListView::setCurrent returning ");
53// return; 53// return;
54// }; 54// };
55// activePackageListItem = (PackageListItem*)p; 55// activePackageListItem = (PackageListItem*)p;
56// activePackage = activePackageListItem->getPackage(); 56// activePackage = activePackageListItem->getPackage();
57// if (activePackage == 0 ) 57// if (activePackage == 0 )
58// { 58// {
59// qDebug("PackageListView::setCurrent if (!activePackage)"); 59// qDebug("PackageListView::setCurrent if (!activePackage)");
60// return; 60// return;
61// } 61// }
62 62
63 63
64 qDebug("PackageListView::setCurrent popupTimer->start"); 64 qDebug("PackageListView::setCurrent popupTimer->start");
65} 65}
66 66
67 67
68void PackageListView::showPopup() 68void PackageListView::showPopup()
69{ 69{
70 qDebug("PackageListView::showPopup"); 70 qDebug("PackageListView::showPopup");
71 QPopupMenu *popup = activeItem->getPopupMenu(); 71 QPopupMenu *popup = activeItem->getPopupMenu();
72 if (popup == 0) return; 72 if (popup == 0) return;
73 popup->popup( QCursor::pos() ); 73 popup->popup( QCursor::pos() );
74 qDebug("PackageListView::showPopup"); 74 qDebug("PackageListView::showPopup");
75} 75}
76 76
77void PackageListView::stopTimer( QListViewItem* ) 77void PackageListView::stopTimer( QListViewItem* )
78{ 78{
79 popupTimer->stop(); 79 popupTimer->stop();
80} 80}
81 81
82 82
83void PackageListView::display() 83void PackageListView::display()
84{ 84{
85 QDictIterator<PackageList> list( PackageLists ); 85 QDictIterator<PackageList> list( PackageLists );
86 PackageList *packlist; 86 PackageList *packlist;
87 OipkgPackage *pack; 87 OipkgPackage *pack;
88 PackageListItem *item; 88 PackageListItem *item;
89 ListViewItemOipkg *rootItem; 89 ListViewItemOipkg *rootItem;
90 QListViewItem* it; 90 QListViewItem* it;
91 QListViewItem* itdel; 91 QListViewItem* itdel;
92 while ( list.current() ) { 92 while ( list.current() ) {
93 packlist = list.current(); 93 packlist = list.current();
94 rootItem = rootItems.find( list.currentKey() ); 94 rootItem = rootItems.find( list.currentKey() );
95 //rootItem->clear(); 95 //rootItem->clear();
96 it=rootItem->firstChild(); 96 it=rootItem->firstChild();
97 while ( it ) 97 while ( it )
98 { 98 {
99 itdel = it; 99 itdel = it;
100 it = it->nextSibling(); 100 it = it->nextSibling();
101 delete itdel; 101 delete itdel;
102 } 102 }
103 pack = packlist->first(); 103 pack = packlist->first();
104 while( pack ) 104 while( pack )
105 { 105 {
106 item = new PackageListItem( rootItem, pack, settings ); 106 item = new PackageListItem( rootItem, pack, settings );
107 pack = packlist->next(); 107 pack = packlist->next();
108 } 108 }
109 ++list; 109 ++list;
110 } 110 }
111} 111}
112 112
113void PackageListView::addList( QString n, PackageList* pl) 113void PackageListView::addList( QString n, PackageList* pl)
114{ 114{
115 PackageLists.insert(n, pl); 115 PackageLists.insert(n, pl);
116 ListViewItemOipkg *item = new ListViewItemOipkg(this,n,ListViewItemOipkg::Feed); 116 ListViewItemOipkg *item = new ListViewItemOipkg(this,n,ListViewItemOipkg::Feed);
117 rootItems.insert(n, item); 117 rootItems.insert(n, item);
118} 118}
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp
index 063b018..aac011e 100644
--- a/noncore/unsupported/oipkg/pksettings.cpp
+++ b/noncore/unsupported/oipkg/pksettings.cpp
@@ -1,145 +1,145 @@
1#include "pksettings.h" 1#include "pksettings.h"
2 2
3#include <qpe/process.h> 3#include <qpe/process.h>
4#include <qpe/resource.h> 4#include <qpe/resource.h>
5#include <qpe/stringutil.h> 5#include <qpe/stringutil.h>
6#include <qpe/qpeapplication.h> 6#include <qpe/qpeapplication.h>
7#include <qpe/qcopenvelope_qws.h> 7#include <qpe/qcopenvelope_qws.h>
8#include <qpe/applnk.h> 8#include <qpe/applnk.h>
9#include <qpe/config.h> 9#include <qpe/config.h>
10 10
11#include <qprogressbar.h> 11#include <qprogressbar.h>
12#include <qcombobox.h> 12#include <qcombobox.h>
13#include <qdict.h> 13#include <qdict.h>
14#include <qfile.h> 14#include <qfile.h>
15#include <qlineedit.h> 15#include <qlineedit.h>
16#include <qpushbutton.h> 16#include <qpushbutton.h>
17#include <qlistview.h> 17#include <qlistview.h>
18#include <qlistbox.h> 18#include <qlistbox.h>
19#include <qcheckbox.h> 19#include <qcheckbox.h>
20#include <qmessagebox.h> 20#include <qmessagebox.h>
21#include <qpainter.h> 21#include <qpainter.h>
22#include <qpixmap.h> 22#include <qpixmap.h>
23#include <qregexp.h> 23#include <qregexp.h>
24#include <qstring.h> 24#include <qstring.h>
25#include <qobject.h> 25#include <qobject.h>
26#include <qtextstream.h> 26#include <qtextstream.h>
27#include <qtextview.h> 27#include <qtextview.h>
28#include <qtoolbutton.h> 28#include <qtoolbutton.h>
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30 30
31#include <stdlib.h> 31#include <stdlib.h>
32#include <unistd.h> 32#include <unistd.h>
33#include "debug.h" 33#include "debug.h"
34//#include "utils.h" 34//#include "utils.h"
35 35
36PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) 36PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl )
37 : PackageManagerSettingsBase( parent, name, fl ) 37 : PackageManagerSettingsBase( parent, name, fl )
38{ 38{
39 connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) ); 39 connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) );
40 connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) ); 40 connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) );
41 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 41 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
42 connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) ); 42 connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) );
43 connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) ); 43 connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) );
44 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 44 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
45 // connect( CheckBoxLink, SIGNAL(toggled(bool)), 45 // connect( CheckBoxLink, SIGNAL(toggled(bool)),
46 // activeLinkDestination, SLOT(setEnabled(bool)) ); 46 // activeLinkDestination, SLOT(setEnabled(bool)) );
47 47
48// connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) ); 48// connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) );
49// connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) ); 49// connect( settingName, SIGNAL(textChanged(const QString&)), this, SLOT(installationSettingSetName(const QString&)) );
50// connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); 50// connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) );
51// connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); 51// connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) );
52 // connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); 52 // connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) );
53 servername->setEnabled(FALSE); 53 servername->setEnabled(FALSE);
54 serverurl->setEnabled(FALSE); 54 serverurl->setEnabled(FALSE);
55 serverurlDic.setAutoDelete(TRUE); 55 serverurlDic.setAutoDelete(TRUE);
56 destinationname->setEnabled(FALSE); 56 destinationname->setEnabled(FALSE);
57 destinationurl->setEnabled(FALSE); 57 destinationurl->setEnabled(FALSE);
58 destinationurlDic.setAutoDelete(TRUE); 58 destinationurlDic.setAutoDelete(TRUE);
59 readSettings(); 59 readSettings();
60 activeLinkDestination->hide(); 60 activeLinkDestination->hide();
61 serverChanged = false; 61 serverChanged = false;
62 62
63 // get rid of setups 63 // get rid of setups
64// Settings->hide(); 64// Settings->hide();
65// settingName->hide(); 65// settingName->hide();
66// newsetting->hide(); 66// newsetting->hide();
67// renamesetting->hide(); 67// renamesetting->hide();
68// removesetting->hide(); 68// removesetting->hide();
69} 69}
70 70
71PackageManagerSettings::~PackageManagerSettings() 71PackageManagerSettings::~PackageManagerSettings()
72{ 72{
73} 73}
74 74
75 75
76void PackageManagerSettings::newServer() 76void PackageManagerSettings::newServer()
77{ 77{
78 int i = servers->count(); 78 int i = servers->count();
79 if ( servername->isEnabled() || serverurl->text().isEmpty() ) { 79 if ( servername->isEnabled() || serverurl->text().isEmpty() ) {
80 serverurlDic.insert(i,new QString("http://")); 80 serverurlDic.insert(i,new QString("http://"));
81 servers->insertItem(tr("New")); 81 servers->insertItem(tr("New"));
82 activeServers->insertItem(tr("New")); 82 activeServers->insertItem(tr("New"));
83 } else { 83 } else {
84 // allows one-level undo 84 // allows one-level undo
85 serverurlDic.insert(i,new QString(serverurl->text())); 85 serverurlDic.insert(i,new QString(serverurl->text()));
86 servers->insertItem(servername->text()); 86 servers->insertItem(servername->text());
87 activeServers->insertItem(servername->text()); 87 activeServers->insertItem(servername->text());
88 } 88 }
89 changed = true; 89 changed = true;
90 servers->setSelected(i,TRUE); 90 servers->setSelected(i,TRUE);
91 editServer(i); 91 editServer(i);
92 changed = true; 92 changed = true;
93} 93}
94 94
95void PackageManagerSettings::newDestination() 95void PackageManagerSettings::newDestination()
96{ 96{
97 int i = destinations->count(); 97 int i = destinations->count();
98 if ( destinationname->isEnabled() || destinationurl->text().isEmpty() ) { 98 if ( destinationname->isEnabled() || destinationurl->text().isEmpty() ) {
99 destinationurlDic.insert(i,new QString("/")); 99 destinationurlDic.insert(i,new QString("/"));
100 destinations->insertItem(tr("New")); 100 destinations->insertItem(tr("New"));
101 activeDestination->insertItem(tr("New")); 101 activeDestination->insertItem(tr("New"));
102 activeLinkDestination->insertItem(tr("New")); 102 activeLinkDestination->insertItem(tr("New"));
103 } else { 103 } else {
104 // allows one-level undo 104 // allows one-level undo
105 destinationurlDic.insert(i,new QString(destinationurl->text())); 105 destinationurlDic.insert(i,new QString(destinationurl->text()));
106 destinations->insertItem(destinationname->text()); 106 destinations->insertItem(destinationname->text());
107 activeDestination->insertItem(destinationname->text()); 107 activeDestination->insertItem(destinationname->text());
108 activeLinkDestination->insertItem(destinationname->text()); 108 activeLinkDestination->insertItem(destinationname->text());
109 } 109 }
110 destinations->setSelected(i,TRUE); 110 destinations->setSelected(i,TRUE);
111 editDestination(i); 111 editDestination(i);
112 changed = true; 112 changed = true;
113} 113}
114 114
115 115
116void PackageManagerSettings::editServer(int i) 116void PackageManagerSettings::editServer(int i)
117{ 117{
118 if ( servername->isEnabled() ) { 118 if ( servername->isEnabled() ) {
119 disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); 119 disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) );
120 disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); 120 disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) );
121 } else { 121 } else {
122 servername->setEnabled(TRUE); 122 servername->setEnabled(TRUE);
123 serverurl->setEnabled(TRUE); 123 serverurl->setEnabled(TRUE);
124 } 124 }
125 125
126 servername->setText( servers->text(i) ); 126 servername->setText( servers->text(i) );
127 serverurl->setText( *serverurlDic[i] ); 127 serverurl->setText( *serverurlDic[i] );
128 128
129 editedserver = i; 129 editedserver = i;
130 serverChanged = true; 130 serverChanged = true;
131 connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); 131 connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) );
132 connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); 132 connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) );
133 changed = true; 133 changed = true;
134} 134}
135 135
136 136
137void PackageManagerSettings::editDestination(int i) 137void PackageManagerSettings::editDestination(int i)
138{ 138{
139 if ( destinationname->isEnabled() ) { 139 if ( destinationname->isEnabled() ) {
140 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); 140 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) );
141 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); 141 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) );
142 } else { 142 } else {
143 destinationname->setEnabled(TRUE); 143 destinationname->setEnabled(TRUE);
144 destinationurl->setEnabled(TRUE); 144 destinationurl->setEnabled(TRUE);
145 //since it does not work anyway 145 //since it does not work anyway