-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 24 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.cpp | 26 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.h | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettingsbase.ui | 4 |
5 files changed, 36 insertions, 24 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index d1be8d0..11fc91b 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -104,49 +104,49 @@ void MainWindow::makeMenu() | |||
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( showSettings() ) ); | 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 QPEToolBar( this ); | 145 | sectionBar = new QPEToolBar( 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 ); |
@@ -203,63 +203,63 @@ void MainWindow::makeMenu() | |||
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 QPEToolBar(this); | 217 | destBar = new QPEToolBar(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 | spacer = new QLabel( " ", destBar ); | 227 | // spacer = new QLabel( " ", destBar ); |
228 | // spacer->setBackgroundMode( PaletteForeground ); | 228 | // spacer->setBackgroundMode( PaletteForeground ); |
229 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); | 229 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); |
230 | // CheckBoxLink->setBackgroundMode( PaletteForeground ); | 230 | // CheckBoxLink->setBackgroundMode( PaletteForeground ); |
231 | CheckBoxLink->setChecked( settings->createLinks() ); | 231 | CheckBoxLink->setChecked( settings->createLinks() ); |
232 | connect( CheckBoxLink, SIGNAL(toggled(bool)), | 232 | connect( CheckBoxLink, SIGNAL(toggled(bool)), |
233 | settings, SLOT(linkEnabled(bool)) ); | 233 | settings, SLOT(linkEnabled(bool)) ); |
234 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); | 234 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); |
235 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); | 235 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); |
236 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 236 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
237 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); | 237 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); |
238 | a->addTo( destBar ); | 238 | a->addTo( destBar ); |
239 | destBar->setStretchableWidget( CheckBoxLink ); | 239 | destBar->setStretchableWidget( CheckBoxLink ); |
240 | destAction->setToggleAction( true ); | 240 | destAction->setToggleAction( true ); |
241 | // destAction->addTo( viewMenu ); | 241 | destAction->addTo( viewMenu ); |
242 | 242 | ||
243 | // helpMenu | 243 | // helpMenu |
244 | helpMenu->insertSeparator(); | 244 | helpMenu->insertSeparator(); |
245 | a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); | 245 | a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); |
246 | a->addTo( helpMenu ); | 246 | a->addTo( helpMenu ); |
247 | helpMenu->insertSeparator(); | 247 | helpMenu->insertSeparator(); |
248 | a = new QAction( tr( "Install" ), | 248 | a = new QAction( tr( "Install" ), |
249 | Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 ); | 249 | Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 ); |
250 | a->addTo( helpMenu ); | 250 | a->addTo( helpMenu ); |
251 | a = new QAction( tr( "Remove" ), | 251 | a = new QAction( tr( "Remove" ), |
252 | Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 ); | 252 | Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 ); |
253 | a->addTo( helpMenu ); | 253 | a->addTo( helpMenu ); |
254 | helpMenu->insertSeparator(); | 254 | helpMenu->insertSeparator(); |
255 | a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 ); | 255 | a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 ); |
256 | a->addTo( helpMenu ); | 256 | a->addTo( helpMenu ); |
257 | helpMenu->insertSeparator(); | 257 | helpMenu->insertSeparator(); |
258 | a = new QAction( tr( "New version, installed" ), | 258 | a = new QAction( tr( "New version, installed" ), |
259 | Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 ); | 259 | Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 ); |
260 | a->addTo( helpMenu ); | 260 | a->addTo( helpMenu ); |
261 | a = new QAction( tr( "New version, not installed" ), | 261 | a = new QAction( tr( "New version, not installed" ), |
262 | Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 ); | 262 | Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 ); |
263 | a->addTo( helpMenu ); | 263 | a->addTo( helpMenu ); |
264 | a = new QAction( tr( "Old version, installed" ), | 264 | a = new QAction( tr( "Old version, installed" ), |
265 | Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 ); | 265 | Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 ); |
@@ -364,62 +364,68 @@ void MainWindow::subSectionChanged() | |||
364 | this, SLOT( sectionChanged() ) ); | 364 | this, SLOT( sectionChanged() ) ); |
365 | disconnect( subsection, SIGNAL(activated(int) ), | 365 | disconnect( subsection, SIGNAL(activated(int) ), |
366 | this, SLOT( subSectionChanged() ) ); | 366 | this, SLOT( subSectionChanged() ) ); |
367 | packageListServers.setSubSection( subsection->currentText() ); | 367 | packageListServers.setSubSection( subsection->currentText() ); |
368 | connect( section, SIGNAL( activated(int) ), | 368 | connect( section, SIGNAL( activated(int) ), |
369 | this, SLOT( sectionChanged() ) ); | 369 | this, SLOT( sectionChanged() ) ); |
370 | connect( subsection, SIGNAL(activated(int) ), | 370 | connect( subsection, SIGNAL(activated(int) ), |
371 | this, SLOT( subSectionChanged() ) ); | 371 | this, SLOT( subSectionChanged() ) ); |
372 | displayList(); | 372 | displayList(); |
373 | } | 373 | } |
374 | 374 | ||
375 | void MainWindow::setSections() | 375 | void MainWindow::setSections() |
376 | { | 376 | { |
377 | section->clear(); | 377 | section->clear(); |
378 | section->insertStringList( packageListServers.getSections() ); | 378 | section->insertStringList( packageListServers.getSections() ); |
379 | } | 379 | } |
380 | 380 | ||
381 | void MainWindow::setSubSections() | 381 | void MainWindow::setSubSections() |
382 | { | 382 | { |
383 | subsection->clear(); | 383 | subsection->clear(); |
384 | subsection->insertStringList( packageListServers.getSubSections() ); | 384 | subsection->insertStringList( packageListServers.getSubSections() ); |
385 | } | 385 | } |
386 | 386 | ||
387 | 387 | ||
388 | void MainWindow::showSettings() | 388 | void MainWindow::showSettings(int i) |
389 | { | 389 | { |
390 | if ( settings->showDialog( 0 ) ) | 390 | if ( settings->showDialog( i ) ) |
391 | { | ||
391 | updateList(); | 392 | updateList(); |
393 | } | ||
394 | setComboName(destination,settings->getDestinationName()); | ||
395 | CheckBoxLink->setChecked( settings->createLinks() ); | ||
396 | } | ||
397 | void MainWindow::showSettingsSetup() | ||
398 | { | ||
399 | showSettings(0); | ||
392 | } | 400 | } |
393 | void MainWindow::showSettingsSrv() | 401 | void MainWindow::showSettingsSrv() |
394 | { | 402 | { |
395 | if ( settings->showDialog( 1 ) ) | 403 | showSettings(1); |
396 | updateList(); | ||
397 | } | 404 | } |
398 | void MainWindow::showSettingsDst() | 405 | void MainWindow::showSettingsDst() |
399 | { | 406 | { |
400 | if ( settings->showDialog( 2 ) ) | 407 | showSettings(2); |
401 | updateList(); | ||
402 | } | 408 | } |
403 | 409 | ||
404 | void MainWindow::sectionShow(bool b) | 410 | void MainWindow::sectionShow(bool b) |
405 | { | 411 | { |
406 | if (b) sectionBar->show(); | 412 | if (b) sectionBar->show(); |
407 | else sectionBar->hide(); | 413 | else sectionBar->hide(); |
408 | sectionAction->setOn( b ); | 414 | sectionAction->setOn( b ); |
409 | } | 415 | } |
410 | 416 | ||
411 | void MainWindow::sectionClose() | 417 | void MainWindow::sectionClose() |
412 | { | 418 | { |
413 | sectionAction->setOn( false ); | 419 | sectionAction->setOn( false ); |
414 | } | 420 | } |
415 | 421 | ||
416 | void MainWindow::findShow(bool b) | 422 | void MainWindow::findShow(bool b) |
417 | { | 423 | { |
418 | if (b) findBar->show(); | 424 | if (b) findBar->show(); |
419 | else findBar->hide(); | 425 | else findBar->hide(); |
420 | findAction->setOn( b ); | 426 | findAction->setOn( b ); |
421 | } | 427 | } |
422 | 428 | ||
423 | void MainWindow::findClose() | 429 | void MainWindow::findClose() |
424 | { | 430 | { |
425 | findAction->setOn( false ); | 431 | findAction->setOn( false ); |
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 090ddd3..354c585 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -31,49 +31,50 @@ class QPEToolBar; | |||
31 | class QLineEdit; | 31 | class QLineEdit; |
32 | class PackageListItem; | 32 | class PackageListItem; |
33 | class QCopChannel; | 33 | class QCopChannel; |
34 | class QMessageBox; | 34 | class QMessageBox; |
35 | class QCheckBox; | 35 | class QCheckBox; |
36 | 36 | ||
37 | class MainWindow : public QMainWindow | 37 | class MainWindow : public QMainWindow |
38 | { | 38 | { |
39 | Q_OBJECT | 39 | Q_OBJECT |
40 | 40 | ||
41 | 41 | ||
42 | public: | 42 | public: |
43 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 43 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
44 | ~MainWindow(); | 44 | ~MainWindow(); |
45 | void makeChannel(); | 45 | void makeChannel(); |
46 | 46 | ||
47 | QCopChannel *channel; | 47 | QCopChannel *channel; |
48 | 48 | ||
49 | protected slots: | 49 | protected slots: |
50 | void runIpkg(); | 50 | void runIpkg(); |
51 | void updateList(); | 51 | void updateList(); |
52 | void displayList(); | 52 | void displayList(); |
53 | void subSectionChanged(); | 53 | void subSectionChanged(); |
54 | void sectionChanged(); | 54 | void sectionChanged(); |
55 | void showSettings(); | 55 | void showSettings(int); |
56 | void showSettingsSetup(); | ||
56 | void showSettingsSrv(); | 57 | void showSettingsSrv(); |
57 | void showSettingsDst(); | 58 | void showSettingsDst(); |
58 | 59 | ||
59 | public slots: | 60 | public slots: |
60 | void sectionClose(); | 61 | void sectionClose(); |
61 | void sectionShow(bool); | 62 | void sectionShow(bool); |
62 | void findClose(); | 63 | void findClose(); |
63 | void findShow(bool); | 64 | void findShow(bool); |
64 | void searchClose(); | 65 | void searchClose(); |
65 | void searchShow(bool); | 66 | void searchShow(bool); |
66 | void destClose(); | 67 | void destClose(); |
67 | void destShow(bool); | 68 | void destShow(bool); |
68 | void filterList(); | 69 | void filterList(); |
69 | void createLinks(); | 70 | void createLinks(); |
70 | void removeLinks(); | 71 | void removeLinks(); |
71 | void receive (const QCString &, const QByteArray &); | 72 | void receive (const QCString &, const QByteArray &); |
72 | void setDocument (const QString &); | 73 | void setDocument (const QString &); |
73 | void remotePackageQuery(); | 74 | void remotePackageQuery(); |
74 | 75 | ||
75 | private: | 76 | private: |
76 | void makeMenu(); | 77 | void makeMenu(); |
77 | void setSections(); | 78 | void setSections(); |
78 | void setSubSections(); | 79 | void setSubSections(); |
79 | bool updateIcon; | 80 | bool updateIcon; |
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index 59d5a3e..14c1944 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -38,48 +38,55 @@ PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* na | |||
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 | |||
63 | // get rid of setups | ||
64 | // Settings->hide(); | ||
65 | settingName->hide(); | ||
66 | newsetting->hide(); | ||
67 | renamesetting->hide(); | ||
68 | removesetting->hide(); | ||
62 | } | 69 | } |
63 | 70 | ||
64 | PackageManagerSettings::~PackageManagerSettings() | 71 | PackageManagerSettings::~PackageManagerSettings() |
65 | { | 72 | { |
66 | } | 73 | } |
67 | 74 | ||
68 | 75 | ||
69 | void PackageManagerSettings::newServer() | 76 | void PackageManagerSettings::newServer() |
70 | { | 77 | { |
71 | int i = servers->count(); | 78 | int i = servers->count(); |
72 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { | 79 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { |
73 | serverurlDic.insert(i,new QString("http://")); | 80 | serverurlDic.insert(i,new QString("http://")); |
74 | servers->insertItem(tr("New")); | 81 | servers->insertItem(tr("New")); |
75 | activeServers->insertItem(tr("New")); | 82 | activeServers->insertItem(tr("New")); |
76 | } else { | 83 | } else { |
77 | // allows one-level undo | 84 | // allows one-level undo |
78 | serverurlDic.insert(i,new QString(serverurl->text())); | 85 | serverurlDic.insert(i,new QString(serverurl->text())); |
79 | servers->insertItem(servername->text()); | 86 | servers->insertItem(servername->text()); |
80 | activeServers->insertItem(servername->text()); | 87 | activeServers->insertItem(servername->text()); |
81 | } | 88 | } |
82 | changed = true; | 89 | changed = true; |
83 | servers->setSelected(i,TRUE); | 90 | servers->setSelected(i,TRUE); |
84 | editServer(i); | 91 | editServer(i); |
85 | changed = true; | 92 | changed = true; |
@@ -511,60 +518,59 @@ QStringList PackageManagerSettings::getDestinationUrls() | |||
511 | return sl; | 518 | return sl; |
512 | } | 519 | } |
513 | 520 | ||
514 | /** returns the destination listed in ipkg.conf */ | 521 | /** returns the destination listed in ipkg.conf */ |
515 | QString PackageManagerSettings::getDestinationUrlByName(QString n) | 522 | QString PackageManagerSettings::getDestinationUrlByName(QString n) |
516 | { | 523 | { |
517 | QStringList sl; | 524 | QStringList sl; |
518 | for (int i=0; i<(int)destinations->count(); i++) | 525 | for (int i=0; i<(int)destinations->count(); i++) |
519 | { | 526 | { |
520 | if ( n == destinations->text(i)) return*destinationurlDic[i]; | 527 | if ( n == destinations->text(i)) return*destinationurlDic[i]; |
521 | } | 528 | } |
522 | return ""; | 529 | return ""; |
523 | } | 530 | } |
524 | 531 | ||
525 | /** returns the destination listed in ipkg.conf */ | 532 | /** returns the destination listed in ipkg.conf */ |
526 | QStringList PackageManagerSettings::getDestinationNames() | 533 | QStringList PackageManagerSettings::getDestinationNames() |
527 | { | 534 | { |
528 | QStringList sl; | 535 | QStringList sl; |
529 | for (int i=0; i<(int)destinations->count(); i++) | 536 | for (int i=0; i<(int)destinations->count(); i++) |
530 | { | 537 | { |
531 | sl += destinations->text(i); | 538 | sl += destinations->text(i); |
532 | } | 539 | } |
533 | return sl; | 540 | return sl; |
534 | } | 541 | } |
535 | 542 | ||
536 | 543 | ||
537 | void PackageManagerSettings::linkEnabled( bool b ) | 544 | void PackageManagerSettings::linkEnabled( bool b ) |
538 | { | 545 | { |
539 | pvDebug(2,"PackageManagerSettings::linkEnabled "+QString(b?"yes":"no")); | 546 | pvDebug(2,"PackageManagerSettings::linkEnabled "+QString(b?"yes":"no")); |
540 | activeLinkDestination->setEnabled( b ); | 547 | activeLinkDestination->setEnabled( b ); |
548 | CheckBoxLink->setChecked( b ); | ||
541 | } | 549 | } |
542 | 550 | ||
543 | void PackageManagerSettings::activeServerChanged() | 551 | void PackageManagerSettings::activeServerChanged() |
544 | { | 552 | { |
545 | changed = true; | 553 | changed = true; |
546 | } | 554 | } |
547 | 555 | ||
548 | QComboBox* PackageManagerSettings::getDestCombo() | ||
549 | { | ||
550 | return new QComboBox(activeDestination); | ||
551 | } | ||
552 | |||
553 | void PackageManagerSettings::createLinksToDest() | 556 | void PackageManagerSettings::createLinksToDest() |
554 | { | 557 | { |
555 | pvDebug(2,"creating links..."); | 558 | pvDebug(2,"creating links..."); |
556 | // emit doCreateLinks( destinationurl->text() ); | 559 | // emit doCreateLinks( destinationurl->text() ); |
557 | //ipkg->createLinks( destinationurl ); | 560 | //ipkg->createLinks( destinationurl ); |
558 | } | 561 | } |
559 | 562 | ||
560 | void PackageManagerSettings::removeLinksToDest() | 563 | void PackageManagerSettings::removeLinksToDest() |
561 | { | 564 | { |
562 | pvDebug(2,"removing links..."); | 565 | pvDebug(2,"removing links..."); |
563 | // emit doRemoveLinks( destinationurl->text() ); | 566 | // emit doRemoveLinks( destinationurl->text() ); |
564 | //ipkg->removeLinks( destinationurl ); | 567 | //ipkg->removeLinks( destinationurl ); |
565 | } | 568 | } |
566 | 569 | ||
567 | //void PackageManagerSettings::setIpkg( PmIpkg* i ) | 570 | void PackageManagerSettings::activeDestinationChange(int i) |
568 | //{ | 571 | { |
569 | //ipkg = i; | 572 | pvDebug(5,"activeDestinationChange "+QString::number(i)); |
570 | //} | 573 | if (i > activeDestination->count()) return; |
574 | activeDestination->setCurrentItem(i); | ||
575 | pvDebug(5,"dest name "+ activeDestination->currentText()); | ||
576 | } | ||
diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h index 8f9fe62..d66c4e8 100644 --- a/noncore/unsupported/oipkg/pksettings.h +++ b/noncore/unsupported/oipkg/pksettings.h | |||
@@ -3,73 +3,72 @@ | |||
3 | 3 | ||
4 | #include "pksettingsbase.h" | 4 | #include "pksettingsbase.h" |
5 | //#include "pmipkg.h" | 5 | //#include "pmipkg.h" |
6 | #include <qintdict.h> | 6 | #include <qintdict.h> |
7 | #include <qobject.h> | 7 | #include <qobject.h> |
8 | 8 | ||
9 | 9 | ||
10 | class PackageManagerSettings : public PackageManagerSettingsBase | 10 | class PackageManagerSettings : public PackageManagerSettingsBase |
11 | { | 11 | { |
12 | Q_OBJECT | 12 | Q_OBJECT |
13 | public: | 13 | public: |
14 | PackageManagerSettings( QWidget* , const char* , WFlags ); | 14 | PackageManagerSettings( QWidget* , const char* , WFlags ); |
15 | ~PackageManagerSettings(); | 15 | ~PackageManagerSettings(); |
16 | 16 | ||
17 | bool showDialog( int ) ; | 17 | bool showDialog( int ) ; |
18 | QString getDestinationUrl(); | 18 | QString getDestinationUrl(); |
19 | QString getDestinationName(); | 19 | QString getDestinationName(); |
20 | QString getLinkDestinationName(); | 20 | QString getLinkDestinationName(); |
21 | bool createLinks(); | 21 | bool createLinks(); |
22 | QStringList getServers(); | 22 | QStringList getServers(); |
23 | QStringList getActiveServers(); | 23 | QStringList getActiveServers(); |
24 | QStringList getDestinationUrls(); | 24 | QStringList getDestinationUrls(); |
25 | QStringList getDestinationNames(); | 25 | QStringList getDestinationNames(); |
26 | QString getDestinationUrlByName(QString); | 26 | QString getDestinationUrlByName(QString); |
27 | QComboBox* getDestCombo(); | ||
28 | // void setIpkg( PmIpkg* ); | ||
29 | 27 | ||
30 | public slots: | 28 | public slots: |
31 | void writeInstallationSettings(); | 29 | void writeInstallationSettings(); |
32 | void readInstallationSettings(); | 30 | void readInstallationSettings(); |
33 | void writeCurrentInstallationSetting(); | 31 | void writeCurrentInstallationSetting(); |
34 | void readInstallationSetting(int); | 32 | void readInstallationSetting(int); |
35 | void installationSettingSetName(const QString &); | 33 | void installationSettingSetName(const QString &); |
36 | void removeLinksToDest(); | 34 | void removeLinksToDest(); |
37 | void createLinksToDest(); | 35 | void createLinksToDest(); |
38 | void newServer(); | 36 | void newServer(); |
39 | void editServer(int); | 37 | void editServer(int); |
40 | void removeDestination(); | 38 | void removeDestination(); |
41 | void newDestination(); | 39 | void newDestination(); |
42 | void editDestination(int); | 40 | void editDestination(int); |
43 | void linkEnabled(bool); | 41 | void linkEnabled(bool); |
44 | void removeServer(); | 42 | void removeServer(); |
45 | void serverNameChanged(const QString&); | 43 | void serverNameChanged(const QString&); |
46 | void serverUrlChanged(const QString&); | 44 | void serverUrlChanged(const QString&); |
47 | void destNameChanged(const QString&); | 45 | void destNameChanged(const QString&); |
48 | void destUrlChanged(const QString&); | 46 | void destUrlChanged(const QString&); |
49 | void installationSettingChange(int); | 47 | void installationSettingChange(int); |
50 | void newInstallationSetting(); | 48 | void newInstallationSetting(); |
51 | void removeInstallationSetting(); | 49 | void removeInstallationSetting(); |
52 | void renameInstallationSetting(); | 50 | void renameInstallationSetting(); |
53 | void activeServerChanged(); | 51 | void activeServerChanged(); |
52 | void activeDestinationChange(int); | ||
54 | signals: | 53 | signals: |
55 | // void doCreateLinks( QString dest ); | 54 | // void doCreateLinks( QString dest ); |
56 | // void doRemoveLinks( QString dest ); | 55 | // void doRemoveLinks( QString dest ); |
57 | 56 | ||
58 | private: | 57 | private: |
59 | QIntDict<QString> serverurlDic; | 58 | QIntDict<QString> serverurlDic; |
60 | QIntDict<QString> destinationurlDic; | 59 | QIntDict<QString> destinationurlDic; |
61 | int ipkg_old; | 60 | int ipkg_old; |
62 | int editedserver; | 61 | int editedserver; |
63 | int editeddestination; | 62 | int editeddestination; |
64 | int currentSetting; | 63 | int currentSetting; |
65 | int installationSettingsCount; | 64 | int installationSettingsCount; |
66 | bool changed; | 65 | bool changed; |
67 | bool serverChanged; | 66 | bool serverChanged; |
68 | 67 | ||
69 | bool readIpkgConfig(const QString&); | 68 | bool readIpkgConfig(const QString&); |
70 | void writeIpkgConfig(const QString&); | 69 | void writeIpkgConfig(const QString&); |
71 | void writeSettings(); | 70 | void writeSettings(); |
72 | void readSettings(); | 71 | void readSettings(); |
73 | }; | 72 | }; |
74 | 73 | ||
75 | #endif | 74 | #endif |
diff --git a/noncore/unsupported/oipkg/pksettingsbase.ui b/noncore/unsupported/oipkg/pksettingsbase.ui index 5b83248..e95ed83 100644 --- a/noncore/unsupported/oipkg/pksettingsbase.ui +++ b/noncore/unsupported/oipkg/pksettingsbase.ui | |||
@@ -1,38 +1,38 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>PackageManagerSettingsBase</class> | 2 | <class>PackageManagerSettingsBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>Form4</cstring> | 7 | <cstring>Form4</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>337</width> | 14 | <width>333</width> |
15 | <height>454</height> | 15 | <height>454</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Package Servers</string> | 20 | <string>Package Servers</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <grid> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>3</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>3</number> | 35 | <number>3</number> |
36 | </property> | 36 | </property> |
37 | <widget row="0" column="0" > | 37 | <widget row="0" column="0" > |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
@@ -194,49 +194,49 @@ | |||
194 | </widget> | 194 | </widget> |
195 | <widget row="3" column="0" > | 195 | <widget row="3" column="0" > |
196 | <class>QLayoutWidget</class> | 196 | <class>QLayoutWidget</class> |
197 | <property stdset="1"> | 197 | <property stdset="1"> |
198 | <name>name</name> | 198 | <name>name</name> |
199 | <cstring>Layout13</cstring> | 199 | <cstring>Layout13</cstring> |
200 | </property> | 200 | </property> |
201 | <hbox> | 201 | <hbox> |
202 | <property stdset="1"> | 202 | <property stdset="1"> |
203 | <name>margin</name> | 203 | <name>margin</name> |
204 | <number>0</number> | 204 | <number>0</number> |
205 | </property> | 205 | </property> |
206 | <property stdset="1"> | 206 | <property stdset="1"> |
207 | <name>spacing</name> | 207 | <name>spacing</name> |
208 | <number>6</number> | 208 | <number>6</number> |
209 | </property> | 209 | </property> |
210 | <widget> | 210 | <widget> |
211 | <class>QLabel</class> | 211 | <class>QLabel</class> |
212 | <property stdset="1"> | 212 | <property stdset="1"> |
213 | <name>name</name> | 213 | <name>name</name> |
214 | <cstring>TextLabel1_2</cstring> | 214 | <cstring>TextLabel1_2</cstring> |
215 | </property> | 215 | </property> |
216 | <property stdset="1"> | 216 | <property stdset="1"> |
217 | <name>text</name> | 217 | <name>text</name> |
218 | <string>Used servers:</string> | 218 | <string>Used servers: (Highlighted feeds are active)</string> |
219 | </property> | 219 | </property> |
220 | </widget> | 220 | </widget> |
221 | <spacer> | 221 | <spacer> |
222 | <property> | 222 | <property> |
223 | <name>name</name> | 223 | <name>name</name> |
224 | <cstring>Spacer4</cstring> | 224 | <cstring>Spacer4</cstring> |
225 | </property> | 225 | </property> |
226 | <property stdset="1"> | 226 | <property stdset="1"> |
227 | <name>orientation</name> | 227 | <name>orientation</name> |
228 | <enum>Horizontal</enum> | 228 | <enum>Horizontal</enum> |
229 | </property> | 229 | </property> |
230 | <property stdset="1"> | 230 | <property stdset="1"> |
231 | <name>sizeType</name> | 231 | <name>sizeType</name> |
232 | <enum>Expanding</enum> | 232 | <enum>Expanding</enum> |
233 | </property> | 233 | </property> |
234 | <property> | 234 | <property> |
235 | <name>sizeHint</name> | 235 | <name>sizeHint</name> |
236 | <size> | 236 | <size> |
237 | <width>20</width> | 237 | <width>20</width> |
238 | <height>20</height> | 238 | <height>20</height> |
239 | </size> | 239 | </size> |
240 | </property> | 240 | </property> |
241 | </spacer> | 241 | </spacer> |
242 | </hbox> | 242 | </hbox> |