-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 | |||
@@ -80,97 +80,97 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
80 | } | 80 | } |
81 | 81 | ||
82 | void MainWindow::makeMenu() | 82 | void MainWindow::makeMenu() |
83 | { | 83 | { |
84 | 84 | ||
85 | QPEToolBar *toolBar = new QPEToolBar( this ); | 85 | QPEToolBar *toolBar = new QPEToolBar( this ); |
86 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 86 | QPEMenuBar *menuBar = new QPEMenuBar( 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( 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 ); |
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 QPEToolBar(this); | 172 | findBar = new QPEToolBar(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 ); |
@@ -179,111 +179,111 @@ void MainWindow::makeMenu() | |||
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 QPEToolBar(this); | 193 | searchBar = new QPEToolBar(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 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 ); |
266 | a->addTo( helpMenu ); | 266 | a->addTo( helpMenu ); |
267 | a = new QAction( tr( "Old version, not installed" ), | 267 | a = new QAction( tr( "Old version, not installed" ), |
268 | Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 ); | 268 | Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 ); |
269 | a->addTo( helpMenu ); | 269 | a->addTo( helpMenu ); |
270 | a = new QAction( tr( "Old version, new version installed" ), | 270 | a = new QAction( tr( "Old version, new version installed" ), |
271 | Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 ); | 271 | Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 ); |
272 | a->addTo( helpMenu ); | 272 | a->addTo( helpMenu ); |
273 | a = new QAction( tr( "New version, old version installed" ), | 273 | a = new QAction( tr( "New version, old version installed" ), |
274 | Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 ); | 274 | Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 ); |
275 | a->addTo( helpMenu ); | 275 | a->addTo( helpMenu ); |
276 | //a = new QAction( tr( "" ), | 276 | //a = new QAction( tr( "" ), |
277 | // Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 ); | 277 | // Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 ); |
278 | // a->addTo( helpMenu ); | 278 | // a->addTo( helpMenu ); |
279 | 279 | ||
280 | // configure the menus | 280 | // configure the menus |
281 | Config cfg( "oipkg", Config::User ); | 281 | Config cfg( "oipkg", Config::User ); |
282 | cfg.setGroup( "gui" ); | 282 | cfg.setGroup( "gui" ); |
283 | 283 | ||
284 | findShow( cfg.readBoolEntry( "findBar", true ) ); | 284 | findShow( cfg.readBoolEntry( "findBar", true ) ); |
285 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); | 285 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); |
286 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); | 286 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); |
287 | destShow( cfg.readBoolEntry( "destBar", false ) ); | 287 | destShow( cfg.readBoolEntry( "destBar", false ) ); |
288 | setComboName(section,cfg.readEntry("default_section")); | 288 | setComboName(section,cfg.readEntry("default_section")); |
289 | sectionChanged(); | 289 | sectionChanged(); |
@@ -340,110 +340,116 @@ void MainWindow::displayList() | |||
340 | { | 340 | { |
341 | filterList(); | 341 | filterList(); |
342 | listViewPackages->display(); | 342 | listViewPackages->display(); |
343 | } | 343 | } |
344 | 344 | ||
345 | void MainWindow::sectionChanged() | 345 | void MainWindow::sectionChanged() |
346 | { | 346 | { |
347 | disconnect( section, SIGNAL( activated(int) ), | 347 | disconnect( section, SIGNAL( activated(int) ), |
348 | this, SLOT( sectionChanged() ) ); | 348 | this, SLOT( sectionChanged() ) ); |
349 | disconnect( subsection, SIGNAL(activated(int) ), | 349 | disconnect( subsection, SIGNAL(activated(int) ), |
350 | this, SLOT( subSectionChanged() ) ); | 350 | this, SLOT( subSectionChanged() ) ); |
351 | subsection->clear(); | 351 | subsection->clear(); |
352 | packageListServers.setSection( section->currentText() ); | 352 | packageListServers.setSection( section->currentText() ); |
353 | setSubSections(); | 353 | setSubSections(); |
354 | connect( section, SIGNAL( activated(int) ), | 354 | connect( section, SIGNAL( activated(int) ), |
355 | this, SLOT( sectionChanged() ) ); | 355 | this, SLOT( sectionChanged() ) ); |
356 | connect( subsection, SIGNAL(activated(int) ), | 356 | connect( subsection, SIGNAL(activated(int) ), |
357 | this, SLOT( subSectionChanged() ) ); | 357 | this, SLOT( subSectionChanged() ) ); |
358 | displayList(); | 358 | displayList(); |
359 | } | 359 | } |
360 | 360 | ||
361 | void MainWindow::subSectionChanged() | 361 | void MainWindow::subSectionChanged() |
362 | { | 362 | { |
363 | disconnect( section, SIGNAL( activated(int) ), | 363 | disconnect( section, SIGNAL( activated(int) ), |
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 ); |
426 | } | 432 | } |
427 | 433 | ||
428 | void MainWindow::searchShow(bool b) | 434 | void MainWindow::searchShow(bool b) |
429 | { | 435 | { |
430 | if (b) searchBar->show(); | 436 | if (b) searchBar->show(); |
431 | else searchBar->hide(); | 437 | else searchBar->hide(); |
432 | searchAction->setOn( b ); | 438 | searchAction->setOn( b ); |
433 | } | 439 | } |
434 | 440 | ||
435 | void MainWindow::searchClose() | 441 | void MainWindow::searchClose() |
436 | { | 442 | { |
437 | searchAction->setOn( false ); | 443 | searchAction->setOn( false ); |
438 | } | 444 | } |
439 | 445 | ||
440 | 446 | ||
441 | void MainWindow::destShow(bool b) | 447 | void MainWindow::destShow(bool b) |
442 | { | 448 | { |
443 | if (b) destBar->show(); | 449 | if (b) destBar->show(); |
444 | else destBar->hide(); | 450 | else destBar->hide(); |
445 | destAction->setOn( b ); | 451 | destAction->setOn( b ); |
446 | } | 452 | } |
447 | 453 | ||
448 | void MainWindow::destClose() | 454 | void MainWindow::destClose() |
449 | { | 455 | { |
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 | |||
@@ -7,97 +7,98 @@ | |||
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // Copyright (C) 2000 Trolltech AS. | 9 | // Copyright (C) 2000 Trolltech AS. |
10 | // adadpted form qpe/qipkg | 10 | // adadpted form qpe/qipkg |
11 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 11 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
12 | 12 | ||
13 | #ifndef MAINWINDOW_H | 13 | #ifndef MAINWINDOW_H |
14 | #define MAINWINDOW_H | 14 | #define MAINWINDOW_H |
15 | 15 | ||
16 | #include <qmainwindow.h> | 16 | #include <qmainwindow.h> |
17 | #include <qaction.h> | 17 | #include <qaction.h> |
18 | #include <qtimer.h> | 18 | #include <qtimer.h> |
19 | #include <qpopupmenu.h> | 19 | #include <qpopupmenu.h> |
20 | 20 | ||
21 | #include "packagelist.h" | 21 | #include "packagelist.h" |
22 | #include "packagelistremote.h" | 22 | #include "packagelistremote.h" |
23 | #include "packagelistlocal.h" | 23 | #include "packagelistlocal.h" |
24 | #include "packagelistdoclnk.h" | 24 | #include "packagelistdoclnk.h" |
25 | #include "pmipkg.h" | 25 | #include "pmipkg.h" |
26 | #include "pksettings.h" | 26 | #include "pksettings.h" |
27 | #include "packagelistview.h" | 27 | #include "packagelistview.h" |
28 | 28 | ||
29 | class QComboBox; | 29 | class QComboBox; |
30 | class QPEToolBar; | 30 | 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; |
80 | 81 | ||
81 | PmIpkg* ipkg; | 82 | PmIpkg* ipkg; |
82 | PackageManagerSettings *settings; | 83 | PackageManagerSettings *settings; |
83 | PackageListLocal packageListServers; | 84 | PackageListLocal packageListServers; |
84 | PackageListRemote packageListSearch; | 85 | PackageListRemote packageListSearch; |
85 | PackageListDocLnk packageListDocLnk; | 86 | PackageListDocLnk packageListDocLnk; |
86 | PackageListView *listViewPackages; | 87 | PackageListView *listViewPackages; |
87 | QAction *runAction; | 88 | QAction *runAction; |
88 | QAction *updateAction; | 89 | QAction *updateAction; |
89 | QAction *findAction; | 90 | QAction *findAction; |
90 | QPEToolBar *findBar; | 91 | QPEToolBar *findBar; |
91 | QLineEdit *findEdit; | 92 | QLineEdit *findEdit; |
92 | QAction *searchAction; | 93 | QAction *searchAction; |
93 | QAction *searchCommit; | 94 | QAction *searchCommit; |
94 | QPEToolBar *searchBar; | 95 | QPEToolBar *searchBar; |
95 | QLineEdit *searchEdit; | 96 | QLineEdit *searchEdit; |
96 | QAction *sectionAction; | 97 | QAction *sectionAction; |
97 | QPEToolBar *sectionBar; | 98 | QPEToolBar *sectionBar; |
98 | QComboBox *section; | 99 | QComboBox *section; |
99 | QComboBox *subsection; | 100 | QComboBox *subsection; |
100 | QAction *destAction; | 101 | QAction *destAction; |
101 | QPEToolBar *destBar; | 102 | QPEToolBar *destBar; |
102 | QComboBox *destination; | 103 | QComboBox *destination; |
103 | QCheckBox* CheckBoxLink; | 104 | QCheckBox* CheckBoxLink; |
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 | |||
@@ -14,96 +14,103 @@ | |||
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 | ||
36 | PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) | 36 | PackageManagerSettings::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 | |||
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; |
86 | } | 93 | } |
87 | 94 | ||
88 | void PackageManagerSettings::newDestination() | 95 | void PackageManagerSettings::newDestination() |
89 | { | 96 | { |
90 | int i = destinations->count(); | 97 | int i = destinations->count(); |
91 | if ( destinationname->isEnabled() || destinationurl->text().isEmpty() ) { | 98 | if ( destinationname->isEnabled() || destinationurl->text().isEmpty() ) { |
92 | destinationurlDic.insert(i,new QString("/")); | 99 | destinationurlDic.insert(i,new QString("/")); |
93 | destinations->insertItem(tr("New")); | 100 | destinations->insertItem(tr("New")); |
94 | activeDestination->insertItem(tr("New")); | 101 | activeDestination->insertItem(tr("New")); |
95 | activeLinkDestination->insertItem(tr("New")); | 102 | activeLinkDestination->insertItem(tr("New")); |
96 | } else { | 103 | } else { |
97 | // allows one-level undo | 104 | // allows one-level undo |
98 | destinationurlDic.insert(i,new QString(destinationurl->text())); | 105 | destinationurlDic.insert(i,new QString(destinationurl->text())); |
99 | destinations->insertItem(destinationname->text()); | 106 | destinations->insertItem(destinationname->text()); |
100 | activeDestination->insertItem(destinationname->text()); | 107 | activeDestination->insertItem(destinationname->text()); |
101 | activeLinkDestination->insertItem(destinationname->text()); | 108 | activeLinkDestination->insertItem(destinationname->text()); |
102 | } | 109 | } |
103 | destinations->setSelected(i,TRUE); | 110 | destinations->setSelected(i,TRUE); |
104 | editDestination(i); | 111 | editDestination(i); |
105 | changed = true; | 112 | changed = true; |
106 | } | 113 | } |
107 | 114 | ||
108 | 115 | ||
109 | void PackageManagerSettings::editServer(int i) | 116 | void PackageManagerSettings::editServer(int i) |
@@ -487,84 +494,83 @@ QStringList PackageManagerSettings::getActiveServers() | |||
487 | { | 494 | { |
488 | if ( activeServers->isSelected(i) ) | 495 | if ( activeServers->isSelected(i) ) |
489 | sl += activeServers->text(i); | 496 | sl += activeServers->text(i); |
490 | } | 497 | } |
491 | return sl; | 498 | return sl; |
492 | } | 499 | } |
493 | QStringList PackageManagerSettings::getServers() | 500 | QStringList PackageManagerSettings::getServers() |
494 | { | 501 | { |
495 | QStringList sl; | 502 | QStringList sl; |
496 | for (int i=0; i<(int)activeServers->count(); i++) | 503 | for (int i=0; i<(int)activeServers->count(); i++) |
497 | { | 504 | { |
498 | sl += activeServers->text(i); | 505 | sl += activeServers->text(i); |
499 | } | 506 | } |
500 | return sl; | 507 | return sl; |
501 | } | 508 | } |
502 | 509 | ||
503 | /** returns the destination listed in ipkg.conf */ | 510 | /** returns the destination listed in ipkg.conf */ |
504 | QStringList PackageManagerSettings::getDestinationUrls() | 511 | QStringList PackageManagerSettings::getDestinationUrls() |
505 | { | 512 | { |
506 | QStringList sl; | 513 | QStringList sl; |
507 | for (int i=0; i<(int)destinations->count(); i++) | 514 | for (int i=0; i<(int)destinations->count(); i++) |
508 | { | 515 | { |
509 | sl += *destinationurlDic[i]; | 516 | sl += *destinationurlDic[i]; |
510 | } | 517 | } |
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 | |||
@@ -1,75 +1,74 @@ | |||
1 | #ifndef PACKAGEMANAGERSETTINGS_H | 1 | #ifndef PACKAGEMANAGERSETTINGS_H |
2 | #define PACKAGEMANAGERSETTINGS_H | 2 | #define PACKAGEMANAGERSETTINGS_H |
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,62 +1,62 @@ | |||
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> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>TabWidget</cstring> | 41 | <cstring>TabWidget</cstring> |
42 | </property> | 42 | </property> |
43 | <property stdset="1"> | 43 | <property stdset="1"> |
44 | <name>enabled</name> | 44 | <name>enabled</name> |
45 | <bool>true</bool> | 45 | <bool>true</bool> |
46 | </property> | 46 | </property> |
47 | <property> | 47 | <property> |
48 | <name>layoutMargin</name> | 48 | <name>layoutMargin</name> |
49 | </property> | 49 | </property> |
50 | <property> | 50 | <property> |
51 | <name>layoutSpacing</name> | 51 | <name>layoutSpacing</name> |
52 | </property> | 52 | </property> |
53 | <widget> | 53 | <widget> |
54 | <class>QWidget</class> | 54 | <class>QWidget</class> |
55 | <property stdset="1"> | 55 | <property stdset="1"> |
56 | <name>name</name> | 56 | <name>name</name> |
57 | <cstring>tab</cstring> | 57 | <cstring>tab</cstring> |
58 | </property> | 58 | </property> |
59 | <attribute> | 59 | <attribute> |
60 | <name>title</name> | 60 | <name>title</name> |
61 | <string>Settings</string> | 61 | <string>Settings</string> |
62 | </attribute> | 62 | </attribute> |
@@ -170,97 +170,97 @@ | |||
170 | </property> | 170 | </property> |
171 | <widget> | 171 | <widget> |
172 | <class>QCheckBox</class> | 172 | <class>QCheckBox</class> |
173 | <property stdset="1"> | 173 | <property stdset="1"> |
174 | <name>name</name> | 174 | <name>name</name> |
175 | <cstring>CheckBoxLink</cstring> | 175 | <cstring>CheckBoxLink</cstring> |
176 | </property> | 176 | </property> |
177 | <property stdset="1"> | 177 | <property stdset="1"> |
178 | <name>text</name> | 178 | <name>text</name> |
179 | <string>Link to root destination</string> | 179 | <string>Link to root destination</string> |
180 | </property> | 180 | </property> |
181 | </widget> | 181 | </widget> |
182 | <widget> | 182 | <widget> |
183 | <class>QComboBox</class> | 183 | <class>QComboBox</class> |
184 | <property stdset="1"> | 184 | <property stdset="1"> |
185 | <name>name</name> | 185 | <name>name</name> |
186 | <cstring>activeLinkDestination</cstring> | 186 | <cstring>activeLinkDestination</cstring> |
187 | </property> | 187 | </property> |
188 | <property stdset="1"> | 188 | <property stdset="1"> |
189 | <name>enabled</name> | 189 | <name>enabled</name> |
190 | <bool>false</bool> | 190 | <bool>false</bool> |
191 | </property> | 191 | </property> |
192 | </widget> | 192 | </widget> |
193 | </hbox> | 193 | </hbox> |
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> |
243 | </widget> | 243 | </widget> |
244 | <widget row="4" column="0" > | 244 | <widget row="4" column="0" > |
245 | <class>QListBox</class> | 245 | <class>QListBox</class> |
246 | <property stdset="1"> | 246 | <property stdset="1"> |
247 | <name>name</name> | 247 | <name>name</name> |
248 | <cstring>activeServers</cstring> | 248 | <cstring>activeServers</cstring> |
249 | </property> | 249 | </property> |
250 | <property stdset="1"> | 250 | <property stdset="1"> |
251 | <name>enabled</name> | 251 | <name>enabled</name> |
252 | <bool>true</bool> | 252 | <bool>true</bool> |
253 | </property> | 253 | </property> |
254 | <property stdset="1"> | 254 | <property stdset="1"> |
255 | <name>selectionMode</name> | 255 | <name>selectionMode</name> |
256 | <enum>Multi</enum> | 256 | <enum>Multi</enum> |
257 | </property> | 257 | </property> |
258 | </widget> | 258 | </widget> |
259 | <widget row="1" column="0" > | 259 | <widget row="1" column="0" > |
260 | <class>QComboBox</class> | 260 | <class>QComboBox</class> |
261 | <property stdset="1"> | 261 | <property stdset="1"> |
262 | <name>name</name> | 262 | <name>name</name> |
263 | <cstring>settingName</cstring> | 263 | <cstring>settingName</cstring> |
264 | </property> | 264 | </property> |
265 | <property stdset="1"> | 265 | <property stdset="1"> |
266 | <name>enabled</name> | 266 | <name>enabled</name> |