summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 6930d60..a09bc30 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -1,44 +1,44 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9// 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 13
14#include "mainwindow.h" 14#include "mainwindow.h"
15 15
16#include <qmenubar.h> 16#include <qmenubar.h>
17#include <qpe/qpemessagebox.h> 17#include <qpe/qpemessagebox.h>
18#include <qpe/resource.h> 18#include <qpe/resource.h>
19#include <qpe/config.h> 19#include <qpe/config.h>
20#include <qpe/qpetoolbar.h> 20#include <qtoolbar.h>
21#include <qpe/qcopenvelope_qws.h> 21#include <qpe/qcopenvelope_qws.h>
22#include <qaction.h> 22#include <qaction.h>
23#include <qmessagebox.h> 23#include <qmessagebox.h>
24#include <qpopupmenu.h> 24#include <qpopupmenu.h>
25#include <qtoolbutton.h> 25#include <qtoolbutton.h>
26#include <qstring.h> 26#include <qstring.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qfile.h> 28#include <qfile.h>
29#include <qlistview.h> 29#include <qlistview.h>
30#include <qtextview.h> 30#include <qtextview.h>
31#include <qcheckbox.h> 31#include <qcheckbox.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qtabwidget.h> 33#include <qtabwidget.h>
34#include <qcombobox.h> 34#include <qcombobox.h>
35#include <qmessagebox.h> 35#include <qmessagebox.h>
36#include <qpushbutton.h> 36#include <qpushbutton.h>
37#include <qlayout.h> 37#include <qlayout.h>
38 38
39#include "pksettingsbase.h" 39#include "pksettingsbase.h"
40#include "utils.h" 40#include "utils.h"
41#include "packagelistitem.h" 41#include "packagelistitem.h"
42 42
43 43
44MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : 44MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
@@ -61,49 +61,49 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
61 pvDebug(9,"packageListServers.update"); 61 pvDebug(9,"packageListServers.update");
62 packageListServers.update(); 62 packageListServers.update();
63 pvDebug(9,"packageListDocLnk.update"); 63 pvDebug(9,"packageListDocLnk.update");
64 packageListDocLnk.update(); 64 packageListDocLnk.update();
65 pvDebug(9,"makeMenu"); 65 pvDebug(9,"makeMenu");
66 makeMenu(); 66 makeMenu();
67 makeChannel(); 67 makeChannel();
68 68
69 69
70 connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); 70 connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) );
71 connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); 71 connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) );
72 72
73 connect( settings->removeLinksButton, SIGNAL( clicked()), 73 connect( settings->removeLinksButton, SIGNAL( clicked()),
74 SLOT(removeLinks()) ); 74 SLOT(removeLinks()) );
75 connect( settings->createLinksButton, SIGNAL( clicked()), 75 connect( settings->createLinksButton, SIGNAL( clicked()),
76 SLOT(createLinks()) ); 76 SLOT(createLinks()) );
77 77
78 pvDebug(9,"displayList"); 78 pvDebug(9,"displayList");
79 displayList(); 79 displayList();
80} 80}
81 81
82void MainWindow::makeMenu() 82void MainWindow::makeMenu()
83{ 83{
84 84
85 QPEToolBar *toolBar = new QPEToolBar( this ); 85 QToolBar *toolBar = new QToolBar( this );
86 QMenuBar *menuBar = new QMenuBar( toolBar ); 86 QMenuBar *menuBar = new QMenuBar( toolBar );
87 QPopupMenu *srvMenu = new QPopupMenu( menuBar ); 87 QPopupMenu *srvMenu = new QPopupMenu( menuBar );
88 QPopupMenu *viewMenu = new QPopupMenu( menuBar ); 88 QPopupMenu *viewMenu = new QPopupMenu( menuBar );
89 QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); 89 QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
90 QPopupMenu *helpMenu = new QPopupMenu( menuBar ); 90 QPopupMenu *helpMenu = new QPopupMenu( menuBar );
91 91
92 setToolBarsMovable( false ); 92 setToolBarsMovable( false );
93 toolBar->setHorizontalStretchable( true ); 93 toolBar->setHorizontalStretchable( true );
94 menuBar->insertItem( tr( "Package" ), srvMenu ); 94 menuBar->insertItem( tr( "Package" ), srvMenu );
95 menuBar->insertItem( tr( "View" ), viewMenu ); 95 menuBar->insertItem( tr( "View" ), viewMenu );
96 menuBar->insertItem( tr( "Settings" ), cfgMenu ); 96 menuBar->insertItem( tr( "Settings" ), cfgMenu );
97 menuBar->insertItem( tr( "Help" ), helpMenu ); 97 menuBar->insertItem( tr( "Help" ), helpMenu );
98 98
99// QLabel *spacer; 99// QLabel *spacer;
100// spacer = new QLabel( "", toolBar ); 100// spacer = new QLabel( "", toolBar );
101// spacer->setBackgroundColor( toolBar->backgroundColor() ); 101// spacer->setBackgroundColor( toolBar->backgroundColor() );
102// toolBar->setStretchableWidget( spacer ); 102// toolBar->setStretchableWidget( spacer );
103 103
104 104
105 runAction = new QAction( tr( "Apply" ), 105 runAction = new QAction( tr( "Apply" ),
106 Resource::loadPixmap( "oipkg/install" ), 106 Resource::loadPixmap( "oipkg/install" ),
107 QString::null, 0, this, 0 ); 107 QString::null, 0, this, 0 );
108 connect( runAction, SIGNAL( activated() ), 108 connect( runAction, SIGNAL( activated() ),
109 this, SLOT( runIpkg() ) ); 109 this, SLOT( runIpkg() ) );
@@ -121,121 +121,121 @@ void MainWindow::makeMenu()
121 updateAction->addTo( srvMenu ); 121 updateAction->addTo( srvMenu );
122 122
123 QAction *cfgact; 123 QAction *cfgact;
124 124
125 cfgact = new QAction( tr( "Setups" ), 125 cfgact = new QAction( tr( "Setups" ),
126 QString::null, 0, this, 0 ); 126 QString::null, 0, this, 0 );
127 connect( cfgact, SIGNAL( activated() ), 127 connect( cfgact, SIGNAL( activated() ),
128 SLOT( showSettingsSetup() ) ); 128 SLOT( showSettingsSetup() ) );
129 cfgact->addTo( cfgMenu ); 129 cfgact->addTo( cfgMenu );
130 130
131 cfgact = new QAction( tr( "Servers" ), 131 cfgact = new QAction( tr( "Servers" ),
132 QString::null, 0, this, 0 ); 132 QString::null, 0, this, 0 );
133 connect( cfgact, SIGNAL( activated() ), 133 connect( cfgact, SIGNAL( activated() ),
134 SLOT( showSettingsSrv() ) ); 134 SLOT( showSettingsSrv() ) );
135 cfgact->addTo( cfgMenu ); 135 cfgact->addTo( cfgMenu );
136 cfgact = new QAction( tr( "Destinations" ), 136 cfgact = new QAction( tr( "Destinations" ),
137 QString::null, 0, this, 0 ); 137 QString::null, 0, this, 0 );
138 connect( cfgact, SIGNAL( activated() ), 138 connect( cfgact, SIGNAL( activated() ),
139 SLOT( showSettingsDst() ) ); 139 SLOT( showSettingsDst() ) );
140 cfgact->addTo( cfgMenu ); 140 cfgact->addTo( cfgMenu );
141 141
142 QAction *a; 142 QAction *a;
143 143
144 // SECTIONS 144 // SECTIONS
145 sectionBar = new QPEToolBar( this ); 145 sectionBar = new QToolBar( this );
146 addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); 146 addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE );
147 sectionBar->setHorizontalStretchable( true ); 147 sectionBar->setHorizontalStretchable( true );
148 QLabel *label = new QLabel( sectionBar, "section" ); 148 QLabel *label = new QLabel( sectionBar, "section" );
149// label->setBackgroundMode( NoBackground ); 149// label->setBackgroundMode( NoBackground );
150 label->font().setPointSize( 8 ); 150 label->font().setPointSize( 8 );
151 label->setText( tr( "Section:" ) ); 151 label->setText( tr( "Section:" ) );
152 sectionBar->setStretchableWidget( label ); 152 sectionBar->setStretchableWidget( label );
153 section = new QComboBox( false, sectionBar ); 153 section = new QComboBox( false, sectionBar );
154 section->font().setPointSize( 8 ); 154 section->font().setPointSize( 8 );
155 label = new QLabel( " / ", sectionBar ); 155 label = new QLabel( " / ", sectionBar );
156 label->font().setPointSize( 8 ); 156 label->font().setPointSize( 8 );
157// label->setBackgroundMode( PaletteForeground ); 157// label->setBackgroundMode( PaletteForeground );
158 subsection = new QComboBox( false, sectionBar ); 158 subsection = new QComboBox( false, sectionBar );
159 subsection->font().setPointSize( 8 ); 159 subsection->font().setPointSize( 8 );
160 a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 160 a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
161 connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); 161 connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) );
162 a->addTo( sectionBar ); 162 a->addTo( sectionBar );
163 setSections(); 163 setSections();
164 setSubSections(); 164 setSubSections();
165 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); 165 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 );
166 connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); 166 connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) );
167 sectionAction->setToggleAction( true ); 167 sectionAction->setToggleAction( true );
168 sectionAction->addTo( viewMenu ); 168 sectionAction->addTo( viewMenu );
169 // sectionBar->setStretchableWidget( section ); 169 // sectionBar->setStretchableWidget( section );
170 170
171 //FIND 171 //FIND
172 findBar = new QPEToolBar(this); 172 findBar = new QToolBar(this);
173 addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); 173 addToolBar( findBar, "Filter", QMainWindow::Top, TRUE );
174 label = new QLabel( tr("Filter: "), findBar ); 174 label = new QLabel( tr("Filter: "), findBar );
175// label->setBackgroundMode( PaletteForeground ); 175// label->setBackgroundMode( PaletteForeground );
176 findBar->setHorizontalStretchable( TRUE ); 176 findBar->setHorizontalStretchable( TRUE );
177 findEdit = new QLineEdit( findBar, "findEdit" ); 177 findEdit = new QLineEdit( findBar, "findEdit" );
178 findBar->setStretchableWidget( findEdit ); 178 findBar->setStretchableWidget( findEdit );
179 connect( findEdit, SIGNAL( textChanged( const QString & ) ), 179 connect( findEdit, SIGNAL( textChanged( const QString & ) ),
180 this, SLOT( displayList() ) ); 180 this, SLOT( displayList() ) );
181 a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); 181 a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
182 connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); 182 connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) );
183 a->addTo( findBar ); 183 a->addTo( findBar );
184 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 184 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
185 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); 185 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
186 a->addTo( findBar ); 186 a->addTo( findBar );
187 findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); 187 findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 );
188 connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); 188 connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) );
189 findAction->setToggleAction( true ); 189 findAction->setToggleAction( true );
190 findAction->addTo( viewMenu ); 190 findAction->addTo( viewMenu );
191 191
192 //SEARCH 192 //SEARCH
193 searchBar = new QPEToolBar(this); 193 searchBar = new QToolBar(this);
194 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); 194 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
195 label = new QLabel( tr("Search: "), searchBar ); 195 label = new QLabel( tr("Search: "), searchBar );
196// label->setBackgroundMode( PaletteForeground ); 196// label->setBackgroundMode( PaletteForeground );
197 searchBar->setHorizontalStretchable( TRUE ); 197 searchBar->setHorizontalStretchable( TRUE );
198 searchEdit = new QLineEdit( searchBar, "seachEdit" ); 198 searchEdit = new QLineEdit( searchBar, "seachEdit" );
199 searchBar->setStretchableWidget( searchEdit ); 199 searchBar->setStretchableWidget( searchEdit );
200// connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 200// connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
201// this, SLOT( displayList() ) ); 201// this, SLOT( displayList() ) );
202 a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); 202 a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
203 connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); 203 connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) );
204 a->addTo( searchBar ); 204 a->addTo( searchBar );
205 searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); 205 searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
206 connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); 206 connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) );
207 searchCommit->addTo( searchBar ); 207 searchCommit->addTo( searchBar );
208 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 208 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
209 connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); 209 connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) );
210 a->addTo( searchBar ); 210 a->addTo( searchBar );
211 searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); 211 searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 );
212 connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); 212 connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) );
213 searchAction->setToggleAction( true ); 213 searchAction->setToggleAction( true );
214 searchAction->addTo( viewMenu ); 214 searchAction->addTo( viewMenu );
215 215
216 //DEST 216 //DEST
217 destBar = new QPEToolBar(this); 217 destBar = new QToolBar(this);
218 addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); 218 addToolBar( destBar, "Destination", QMainWindow::Top, TRUE );
219 label = new QLabel( tr("Destination: "), destBar ); 219 label = new QLabel( tr("Destination: "), destBar );
220// label->setBackgroundMode( PaletteForeground ); 220// label->setBackgroundMode( PaletteForeground );
221 destBar->setHorizontalStretchable( TRUE ); 221 destBar->setHorizontalStretchable( TRUE );
222 destination = new QComboBox( false, destBar ); 222 destination = new QComboBox( false, destBar );
223 destination->insertStringList( settings->getDestinationNames() ); 223 destination->insertStringList( settings->getDestinationNames() );
224 setComboName(destination,settings->getDestinationName()); 224 setComboName(destination,settings->getDestinationName());
225 connect( destination, SIGNAL(activated(int)), 225 connect( destination, SIGNAL(activated(int)),
226 settings, SLOT(activeDestinationChange(int)) ); 226 settings, SLOT(activeDestinationChange(int)) );
227// space->setBackgroundMode( PaletteForeground ); 227// space->setBackgroundMode( PaletteForeground );
228 CheckBoxLink = new QCheckBox( tr("Link"), destBar); 228 CheckBoxLink = new QCheckBox( tr("Link"), destBar);
229// CheckBoxLink->setBackgroundMode( PaletteForeground ); 229// CheckBoxLink->setBackgroundMode( PaletteForeground );
230 CheckBoxLink->setChecked( settings->createLinks() ); 230 CheckBoxLink->setChecked( settings->createLinks() );
231 connect( CheckBoxLink, SIGNAL(toggled(bool)), 231 connect( CheckBoxLink, SIGNAL(toggled(bool)),
232 settings, SLOT(linkEnabled(bool)) ); 232 settings, SLOT(linkEnabled(bool)) );
233 destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); 233 destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 );
234 connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); 234 connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) );
235 a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 235 a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
236 connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); 236 connect( a, SIGNAL( activated() ), SLOT( destClose() ) );
237 a->addTo( destBar ); 237 a->addTo( destBar );
238 destBar->setStretchableWidget( CheckBoxLink ); 238 destBar->setStretchableWidget( CheckBoxLink );
239 destAction->setToggleAction( true ); 239 destAction->setToggleAction( true );
240 destAction->addTo( viewMenu ); 240 destAction->addTo( viewMenu );
241 241