Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 997f449..54ee115 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -80,98 +80,98 @@ void MainWindow::makeMenu() | |||
80 | 80 | ||
81 | setToolBarsMovable( false ); | 81 | setToolBarsMovable( false ); |
82 | toolBar->setHorizontalStretchable( true ); | 82 | toolBar->setHorizontalStretchable( true ); |
83 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 83 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
84 | menuBar->insertItem( tr( "View" ), viewMenu ); | 84 | menuBar->insertItem( tr( "View" ), viewMenu ); |
85 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 85 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
86 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); | 86 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); |
87 | 87 | ||
88 | QLabel *spacer = new QLabel( "", toolBar ); | 88 | QLabel *spacer = new QLabel( "", toolBar ); |
89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); | 89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); |
90 | toolBar->setStretchableWidget( spacer ); | 90 | toolBar->setStretchableWidget( spacer ); |
91 | 91 | ||
92 | 92 | ||
93 | runAction = new QAction( tr( "Commit" ), | 93 | runAction = new QAction( tr( "Commit" ), |
94 | Resource::loadPixmap( "oipkg/install" ), | 94 | Resource::loadPixmap( "oipkg/install" ), |
95 | QString::null, 0, this, 0 ); | 95 | QString::null, 0, this, 0 ); |
96 | connect( runAction, SIGNAL( activated() ), | 96 | connect( runAction, SIGNAL( activated() ), |
97 | this, SLOT( runIpkg() ) ); | 97 | this, SLOT( runIpkg() ) ); |
98 | runAction->addTo( toolBar ); | 98 | runAction->addTo( toolBar ); |
99 | runAction->addTo( srvMenu ); | 99 | runAction->addTo( srvMenu ); |
100 | 100 | ||
101 | srvMenu->insertSeparator (); | 101 | srvMenu->insertSeparator (); |
102 | 102 | ||
103 | updateAction = new QAction( tr( "Update" ), | 103 | updateAction = new QAction( tr( "Update" ), |
104 | Resource::loadIconSet( "oipkg/repeat" ), | 104 | Resource::loadIconSet( "oipkg/update" ), |
105 | QString::null, 0, this, 0 ); | 105 | QString::null, 0, this, 0 ); |
106 | connect( updateAction, SIGNAL( activated() ), | 106 | connect( updateAction, SIGNAL( activated() ), |
107 | this , SLOT( updateList() ) ); | 107 | this , SLOT( updateList() ) ); |
108 | updateAction->addTo( toolBar ); | 108 | updateAction->addTo( toolBar ); |
109 | updateAction->addTo( srvMenu ); | 109 | updateAction->addTo( srvMenu ); |
110 | 110 | ||
111 | detailsAction = new QAction( tr( "Details" ), | 111 | detailsAction = new QAction( tr( "Details" ), |
112 | Resource::loadIconSet( "find" ), | 112 | Resource::loadIconSet( "find" ), |
113 | QString::null, 0, this, 0 ); | 113 | QString::null, 0, this, 0 ); |
114 | connect( detailsAction, SIGNAL( activated() ), | 114 | connect( detailsAction, SIGNAL( activated() ), |
115 | this , SLOT( showDetails() ) ); | 115 | this , SLOT( showDetails() ) ); |
116 | detailsAction->addTo( toolBar ); | 116 | detailsAction->addTo( toolBar ); |
117 | detailsAction->addTo( srvMenu ); | 117 | detailsAction->addTo( srvMenu ); |
118 | 118 | ||
119 | QAction *cfgact; | 119 | QAction *cfgact; |
120 | 120 | ||
121 | cfgact = new QAction( tr( "Setups" ), | 121 | cfgact = new QAction( tr( "Setups" ), |
122 | // Resource::loadIconSet( "" ), | 122 | // Resource::loadIconSet( "" ), |
123 | QString::null, 0, this, 0 ); | 123 | QString::null, 0, this, 0 ); |
124 | connect( cfgact, SIGNAL( activated() ), | 124 | connect( cfgact, SIGNAL( activated() ), |
125 | SLOT( showSettings() ) ); | 125 | SLOT( showSettings() ) ); |
126 | cfgact->addTo( cfgMenu ); | 126 | cfgact->addTo( cfgMenu ); |
127 | 127 | ||
128 | cfgact = new QAction( tr( "Servers" ), | 128 | cfgact = new QAction( tr( "Servers" ), |
129 | // Resource::loadIconSet( "" ), | 129 | // Resource::loadIconSet( "" ), |
130 | QString::null, 0, this, 0 ); | 130 | QString::null, 0, this, 0 ); |
131 | connect( cfgact, SIGNAL( activated() ), | 131 | connect( cfgact, SIGNAL( activated() ), |
132 | SLOT( showSettingsSrv() ) ); | 132 | SLOT( showSettingsSrv() ) ); |
133 | cfgact->addTo( cfgMenu ); | 133 | cfgact->addTo( cfgMenu ); |
134 | cfgact = new QAction( tr( "Destinations" ), | 134 | cfgact = new QAction( tr( "Destinations" ), |
135 | //Resource::loadIconSet( "" ), | 135 | //Resource::loadIconSet( "" ), |
136 | QString::null, 0, this, 0 ); | 136 | QString::null, 0, this, 0 ); |
137 | connect( cfgact, SIGNAL( activated() ), | 137 | connect( cfgact, SIGNAL( activated() ), |
138 | SLOT( showSettingsDst() ) ); | 138 | SLOT( showSettingsDst() ) ); |
139 | cfgact->addTo( cfgMenu ); | 139 | cfgact->addTo( cfgMenu ); |
140 | 140 | ||
141 | QAction *a; | 141 | QAction *a; |
142 | 142 | ||
143 | sectionBar = new QPEToolBar( this ); | 143 | sectionBar = new QPEToolBar( this ); |
144 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); | 144 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); |
145 | sectionBar->setHorizontalStretchable( true ); | 145 | sectionBar->setHorizontalStretchable( true ); |
146 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); | 146 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); |
147 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 147 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
148 | sectionBar->setStretchableWidget( label ); | ||
148 | section = new QComboBox( false, sectionBar ); | 149 | section = new QComboBox( false, sectionBar ); |
149 | // section->setBackgroundMode( PaletteBackground ); | 150 | // section->setBackgroundMode( PaletteBackground ); |
150 | label = new QLabel( " / ", sectionBar ); | 151 | label = new QLabel( " / ", sectionBar ); |
151 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 152 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
152 | subsection = new QComboBox( false, sectionBar ); | 153 | subsection = new QComboBox( false, sectionBar ); |
153 | sectionBar->setStretchableWidget( label ); | ||
154 | 154 | ||
155 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 155 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
156 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); | 156 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); |
157 | a->addTo( sectionBar ); | 157 | a->addTo( sectionBar ); |
158 | 158 | ||
159 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); | 159 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); |
160 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); | 160 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); |
161 | sectionAction->setToggleAction( true ); | 161 | sectionAction->setToggleAction( true ); |
162 | sectionAction->setOn( true ); | 162 | sectionAction->setOn( true ); |
163 | sectionAction->addTo( viewMenu ); | 163 | sectionAction->addTo( viewMenu ); |
164 | 164 | ||
165 | findBar = new QPEToolBar(this); | 165 | findBar = new QPEToolBar(this); |
166 | addToolBar( findBar, "Search", QMainWindow::Top, TRUE ); | 166 | addToolBar( findBar, "Search", QMainWindow::Top, TRUE ); |
167 | label = new QLabel( tr("Filter: "), findBar ); | 167 | label = new QLabel( tr("Filter: "), findBar ); |
168 | label->setBackgroundColor( findBar->backgroundColor() ); | 168 | label->setBackgroundColor( findBar->backgroundColor() ); |
169 | findBar->setHorizontalStretchable( TRUE ); | 169 | findBar->setHorizontalStretchable( TRUE ); |
170 | findEdit = new QLineEdit( findBar, "findEdit" ); | 170 | findEdit = new QLineEdit( findBar, "findEdit" ); |
171 | findBar->setStretchableWidget( findEdit ); | 171 | findBar->setStretchableWidget( findEdit ); |
172 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 172 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), |
173 | this, SLOT( displayList() ) ); | 173 | this, SLOT( displayList() ) ); |
174 | //a = new QAction( tr( "Filter" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); | 174 | //a = new QAction( tr( "Filter" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); |
175 | // connect( a, SIGNAL( activated() ), this, SLOT( filterList() ) ); | 175 | // connect( a, SIGNAL( activated() ), this, SLOT( filterList() ) ); |
176 | // a->addTo( findBar ); | 176 | // a->addTo( findBar ); |
177 | // a->addTo( edit ); | 177 | // a->addTo( edit ); |
@@ -254,59 +254,59 @@ void MainWindow::subSectionChanged() | |||
254 | packageList.setSubSection( subsection->currentText() ); | 254 | packageList.setSubSection( subsection->currentText() ); |
255 | connect( section, SIGNAL( activated(int) ), | 255 | connect( section, SIGNAL( activated(int) ), |
256 | this, SLOT( sectionChanged() ) ); | 256 | this, SLOT( sectionChanged() ) ); |
257 | connect( subsection, SIGNAL(activated(int) ), | 257 | connect( subsection, SIGNAL(activated(int) ), |
258 | this, SLOT( subSectionChanged() ) ); | 258 | this, SLOT( subSectionChanged() ) ); |
259 | displayList(); | 259 | displayList(); |
260 | } | 260 | } |
261 | 261 | ||
262 | void MainWindow::setSections() | 262 | void MainWindow::setSections() |
263 | { | 263 | { |
264 | section->clear(); | 264 | section->clear(); |
265 | section->insertStringList( packageList.getSections() ); | 265 | section->insertStringList( packageList.getSections() ); |
266 | } | 266 | } |
267 | 267 | ||
268 | void MainWindow::setSubSections() | 268 | void MainWindow::setSubSections() |
269 | { | 269 | { |
270 | subsection->clear(); | 270 | subsection->clear(); |
271 | subsection->insertStringList( packageList.getSubSections() ); | 271 | subsection->insertStringList( packageList.getSubSections() ); |
272 | } | 272 | } |
273 | 273 | ||
274 | 274 | ||
275 | void MainWindow::showSettings() | 275 | void MainWindow::showSettings() |
276 | { | 276 | { |
277 | if ( settings->showDialog( 0 ) ) | 277 | if ( settings->showDialog( 0 ) ) |
278 | getList(); | 278 | updateList(); |
279 | } | 279 | } |
280 | void MainWindow::showSettingsSrv() | 280 | void MainWindow::showSettingsSrv() |
281 | { | 281 | { |
282 | if ( settings->showDialog( 1 ) ) | 282 | if ( settings->showDialog( 1 ) ) |
283 | getList(); | 283 | updateList(); |
284 | } | 284 | } |
285 | void MainWindow::showSettingsDst() | 285 | void MainWindow::showSettingsDst() |
286 | { | 286 | { |
287 | if ( settings->showDialog( 2 ) ) | 287 | if ( settings->showDialog( 2 ) ) |
288 | getList(); | 288 | updateList(); |
289 | } | 289 | } |
290 | 290 | ||
291 | 291 | ||
292 | void MainWindow::showDetails() | 292 | void MainWindow::showDetails() |
293 | { | 293 | { |
294 | if ( activePackage ) return; | 294 | if ( activePackage ) return; |
295 | if ( details ) | 295 | if ( details ) |
296 | { | 296 | { |
297 | details = new PackageDetails( this ); | 297 | details = new PackageDetails( this ); |
298 | connect( details->install, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); | 298 | connect( details->install, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); |
299 | connect( details->remove, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); | 299 | connect( details->remove, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); |
300 | connect( details->ignore, SIGNAL(clicked()), details, SLOT(close())); | 300 | connect( details->ignore, SIGNAL(clicked()), details, SLOT(close())); |
301 | details->description->setTextFormat(RichText); | 301 | details->description->setTextFormat(RichText); |
302 | } | 302 | } |
303 | 303 | ||
304 | details->setCaption("Package: " + activePackage->name()); | 304 | details->setCaption("Package: " + activePackage->name()); |
305 | details->description->setText(activePackage->details() ); | 305 | details->description->setText(activePackage->details() ); |
306 | details->install->setEnabled(!activePackage->installed()); | 306 | details->install->setEnabled(!activePackage->installed()); |
307 | details->remove->setEnabled(activePackage->installed()); | 307 | details->remove->setEnabled(activePackage->installed()); |
308 | details->showMaximized(); | 308 | details->showMaximized(); |
309 | } | 309 | } |
310 | 310 | ||
311 | void MainWindow::toggleActivePackage() | 311 | void MainWindow::toggleActivePackage() |
312 | { | 312 | { |