author | tille <tille> | 2002-05-01 14:00:09 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-01 14:00:09 (UTC) |
commit | e729a9bdd9f37f4bd610d10122f002a0540c93ed (patch) (unidiff) | |
tree | a23696d8742a36b57256281dc7e2f7848407be61 | |
parent | 7e5615473c1d103db66f42ae60bf9ed57d52566c (diff) | |
download | opie-e729a9bdd9f37f4bd610d10122f002a0540c93ed.zip opie-e729a9bdd9f37f4bd610d10122f002a0540c93ed.tar.gz opie-e729a9bdd9f37f4bd610d10122f002a0540c93ed.tar.bz2 |
added ipkgfind remote query
24 files changed, 552 insertions, 234 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO index 790766c..fc2e8a4 100644 --- a/noncore/unsupported/oipkg/TODO +++ b/noncore/unsupported/oipkg/TODO | |||
@@ -1,9 +1,14 @@ | |||
1 | * Settings Class | 1 | * Settings Class |
2 | * tr() ;) | 2 | * tr() ;) |
3 | * Dialog to display ipkg output live | 3 | * Dialog to display ipkg output live |
4 | * parse "to install" and "to remove" from status | 4 | * parse "to install" and "to remove" from status |
5 | * install local file dialog | 5 | * install local file dialog |
6 | * qcop | 6 | * qcop |
7 | * error handling | 7 | * error handling |
8 | * manage links | 8 | * manage links |
9 | * dependency checking | 9 | * dependency checking |
10 | * create dest if it does not exist | ||
11 | * allow reinstalling | ||
12 | * handle different versions | ||
13 | * different types of filters and searches | ||
14 | i.e. name, desc, files etc \ No newline at end of file | ||
diff --git a/noncore/unsupported/oipkg/debug.h b/noncore/unsupported/oipkg/debug.h index 206dea5..d20a5eb 100644 --- a/noncore/unsupported/oipkg/debug.h +++ b/noncore/unsupported/oipkg/debug.h | |||
@@ -1,21 +1,21 @@ | |||
1 | #ifndef _DEBUG_H_ | 1 | #ifndef _DEBUG_H_ |
2 | #define _DEBUG_H_ | 2 | #define _DEBUG_H_ |
3 | 3 | ||
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | 5 | ||
6 | extern int debugLevel; | 6 | extern int debugLevel; |
7 | 7 | ||
8 | #define HACK | 8 | #define HACK |
9 | 9 | #define PACKAGELISTLOCAL | |
10 | #define NEWLAYOUT | 10 | #define NEWLAYOUT |
11 | 11 | ||
12 | #define pvDebug(I, S) \ | 12 | #define pvDebug(I, S) \ |
13 | if ( debugLevel < 3 ) \ | 13 | if ( debugLevel < 3 ) \ |
14 | { \ | 14 | { \ |
15 | if ( I <= debugLevel ) qDebug(S);\ | 15 | if ( I <= debugLevel ) qDebug(S);\ |
16 | }else{\ | 16 | }else{\ |
17 | if ( I <= debugLevel ) \ | 17 | if ( I <= debugLevel ) \ |
18 | qDebug("#%s:%i: %s \t\t(Level: %i)",__FILE__,__LINE__,QString(S).latin1(),I);\ | 18 | qDebug("#%s:%i: %s \t\t(Level: %i)",__FILE__,__LINE__,QString(S).latin1(),I);\ |
19 | } | 19 | } |
20 | 20 | ||
21 | #endif \ No newline at end of file | 21 | #endif \ No newline at end of file |
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index ca1e5e8..06828e0 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -1,422 +1,493 @@ | |||
1 | // adadpted form qpe/qipkg | 1 | // adadpted form qpe/qipkg |
2 | 2 | ||
3 | 3 | ||
4 | #include "mainwindow.h" | 4 | #include "mainwindow.h" |
5 | 5 | ||
6 | #include <qpe/qpemenubar.h> | 6 | #include <qpe/qpemenubar.h> |
7 | #include <qpe/qpemessagebox.h> | 7 | #include <qpe/qpemessagebox.h> |
8 | #include <qpe/resource.h> | 8 | #include <qpe/resource.h> |
9 | #include <qpe/config.h> | 9 | #include <qpe/config.h> |
10 | #include <qpe/qpetoolbar.h> | 10 | #include <qpe/qpetoolbar.h> |
11 | #include <qpe/qcopenvelope_qws.h> | 11 | #include <qpe/qcopenvelope_qws.h> |
12 | #include <qaction.h> | 12 | #include <qaction.h> |
13 | #include <qmessagebox.h> | 13 | #include <qmessagebox.h> |
14 | #include <qpopupmenu.h> | 14 | #include <qpopupmenu.h> |
15 | #include <qtoolbutton.h> | 15 | #include <qtoolbutton.h> |
16 | #include <qstring.h> | 16 | #include <qstring.h> |
17 | #include <qlabel.h> | 17 | #include <qlabel.h> |
18 | #include <qfile.h> | 18 | #include <qfile.h> |
19 | #include <qlistview.h> | 19 | #include <qlistview.h> |
20 | #include <qtextview.h> | 20 | #include <qtextview.h> |
21 | #include <qcheckbox.h> | 21 | #include <qcheckbox.h> |
22 | #include <qlineedit.h> | 22 | #include <qlineedit.h> |
23 | #include <qtabwidget.h> | 23 | #include <qtabwidget.h> |
24 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <qpushbutton.h> | ||
26 | #include <qlayout.h> | 27 | #include <qlayout.h> |
27 | 28 | ||
28 | #include "pksettingsbase.h" | 29 | #include "pksettingsbase.h" |
29 | #include "utils.h" | 30 | #include "utils.h" |
30 | #include "packagelistitem.h" | 31 | #include "packagelistitem.h" |
31 | 32 | ||
32 | 33 | ||
33 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | 34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : |
34 | QMainWindow( parent, name, f ) | 35 | QMainWindow( parent, name, f ) |
35 | { | 36 | { |
36 | setCaption( tr("Package Manager") ); | 37 | setCaption( tr("Package Manager") ); |
37 | settings = new PackageManagerSettings(this,0,TRUE); | 38 | settings = new PackageManagerSettings(this,0,TRUE); |
38 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); | 39 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); |
39 | setCentralWidget( listViewPackages ); | 40 | setCentralWidget( listViewPackages ); |
40 | 41 | ||
41 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); | 42 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); |
42 | //wait = new QMessageBox(this); | 43 | //wait = new QMessageBox(this); |
43 | // wait->setText(tr("Please wait")); | 44 | // wait->setText(tr("Please wait")); |
44 | ipkg = new PmIpkg( settings, this ); | 45 | ipkg = new PmIpkg( settings, this ); |
46 | // settings->setIpkg( ipkg ); | ||
45 | packageList.setSettings( settings ); | 47 | packageList.setSettings( settings ); |
48 | packageListSearch.setSettings( settings ); | ||
46 | packageList.update(); | 49 | packageList.update(); |
47 | makeMenu(); | 50 | makeMenu(); |
48 | makeChannel(); | 51 | makeChannel(); |
49 | //opie is hardcoded default ;) | 52 | //opie is hardcoded default ;) |
50 | for (int i=0;i<section->count();i++) | 53 | for (int i=0;i<section->count();i++) |
51 | if (section->text(i)=="opie") | 54 | if (section->text(i)=="opie") |
52 | section->setCurrentItem(i); | 55 | section->setCurrentItem(i); |
53 | sectionChanged(); | 56 | sectionChanged(); |
54 | 57 | ||
55 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); | 58 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); |
56 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 59 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
60 | |||
61 | connect( settings->removeLinksButton, SIGNAL( clicked()), | ||
62 | SLOT(removeLinks()) ); | ||
63 | connect( settings->createLinksButton, SIGNAL( clicked()), | ||
64 | SLOT(createLinks()) ); | ||
65 | |||
66 | //rootLocal = new QCheckListItem(listViewPackages,tr("local")); | ||
67 | //rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); | ||
57 | displayList(); | 68 | displayList(); |
58 | } | 69 | } |
59 | 70 | ||
60 | void MainWindow::makeMenu() | 71 | void MainWindow::makeMenu() |
61 | { | 72 | { |
62 | 73 | ||
63 | QPEToolBar *toolBar = new QPEToolBar( this ); | 74 | QPEToolBar *toolBar = new QPEToolBar( this ); |
64 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 75 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
65 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); | 76 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); |
66 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 77 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
67 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 78 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
68 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); | 79 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); |
69 | 80 | ||
70 | setToolBarsMovable( false ); | 81 | setToolBarsMovable( false ); |
71 | toolBar->setHorizontalStretchable( true ); | 82 | toolBar->setHorizontalStretchable( true ); |
72 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 83 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
73 | menuBar->insertItem( tr( "View" ), viewMenu ); | 84 | menuBar->insertItem( tr( "View" ), viewMenu ); |
74 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 85 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
75 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); | 86 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); |
76 | 87 | ||
77 | QLabel *spacer = new QLabel( "", toolBar ); | 88 | QLabel *spacer = new QLabel( "", toolBar ); |
78 | spacer->setBackgroundColor( toolBar->backgroundColor() ); | 89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); |
79 | toolBar->setStretchableWidget( spacer ); | 90 | toolBar->setStretchableWidget( spacer ); |
80 | 91 | ||
81 | 92 | ||
82 | runAction = new QAction( tr( "Apply" ), | 93 | runAction = new QAction( tr( "Apply" ), |
83 | Resource::loadPixmap( "oipkg/install" ), | 94 | Resource::loadPixmap( "oipkg/install" ), |
84 | QString::null, 0, this, 0 ); | 95 | QString::null, 0, this, 0 ); |
85 | connect( runAction, SIGNAL( activated() ), | 96 | connect( runAction, SIGNAL( activated() ), |
86 | this, SLOT( runIpkg() ) ); | 97 | this, SLOT( runIpkg() ) ); |
87 | runAction->addTo( toolBar ); | 98 | runAction->addTo( toolBar ); |
88 | runAction->addTo( srvMenu ); | 99 | runAction->addTo( srvMenu ); |
89 | 100 | ||
90 | srvMenu->insertSeparator (); | 101 | srvMenu->insertSeparator (); |
91 | 102 | ||
92 | updateAction = new QAction( tr( "Update" ), | 103 | updateAction = new QAction( tr( "Update" ), |
93 | Resource::loadIconSet( "oipkg/update" ), | 104 | Resource::loadIconSet( "oipkg/update" ), |
94 | QString::null, 0, this, 0 ); | 105 | QString::null, 0, this, 0 ); |
95 | connect( updateAction, SIGNAL( activated() ), | 106 | connect( updateAction, SIGNAL( activated() ), |
96 | this , SLOT( updateList() ) ); | 107 | this , SLOT( updateList() ) ); |
97 | updateAction->addTo( toolBar ); | 108 | updateAction->addTo( toolBar ); |
98 | updateAction->addTo( srvMenu ); | 109 | updateAction->addTo( srvMenu ); |
99 | 110 | ||
100 | // could we use for find | ||
101 | // detailsAction = new QAction( tr( "Find" ), | ||
102 | // Resource::loadIconSet( "find" ), | ||
103 | // QString::null, 0, this, 0 ); | ||
104 | // connect( detailsAction, SIGNAL( activated() ), | ||
105 | // this , SLOT( showFind() ) ); | ||
106 | // detailsAction->addTo( toolBar ); | ||
107 | |||
108 | QAction *cfgact; | 111 | QAction *cfgact; |
109 | 112 | ||
110 | cfgact = new QAction( tr( "Setups" ), | 113 | cfgact = new QAction( tr( "Setups" ), |
111 | QString::null, 0, this, 0 ); | 114 | QString::null, 0, this, 0 ); |
112 | connect( cfgact, SIGNAL( activated() ), | 115 | connect( cfgact, SIGNAL( activated() ), |
113 | SLOT( showSettings() ) ); | 116 | SLOT( showSettings() ) ); |
114 | cfgact->addTo( cfgMenu ); | 117 | cfgact->addTo( cfgMenu ); |
115 | 118 | ||
116 | cfgact = new QAction( tr( "Servers" ), | 119 | cfgact = new QAction( tr( "Servers" ), |
117 | QString::null, 0, this, 0 ); | 120 | QString::null, 0, this, 0 ); |
118 | connect( cfgact, SIGNAL( activated() ), | 121 | connect( cfgact, SIGNAL( activated() ), |
119 | SLOT( showSettingsSrv() ) ); | 122 | SLOT( showSettingsSrv() ) ); |
120 | cfgact->addTo( cfgMenu ); | 123 | cfgact->addTo( cfgMenu ); |
121 | cfgact = new QAction( tr( "Destinations" ), | 124 | cfgact = new QAction( tr( "Destinations" ), |
122 | QString::null, 0, this, 0 ); | 125 | QString::null, 0, this, 0 ); |
123 | connect( cfgact, SIGNAL( activated() ), | 126 | connect( cfgact, SIGNAL( activated() ), |
124 | SLOT( showSettingsDst() ) ); | 127 | SLOT( showSettingsDst() ) ); |
125 | cfgact->addTo( cfgMenu ); | 128 | cfgact->addTo( cfgMenu ); |
126 | 129 | ||
127 | QAction *a; | 130 | QAction *a; |
128 | 131 | ||
132 | // SECTIONS | ||
129 | sectionBar = new QPEToolBar( this ); | 133 | sectionBar = new QPEToolBar( this ); |
130 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); | 134 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); |
131 | sectionBar->setHorizontalStretchable( true ); | 135 | sectionBar->setHorizontalStretchable( true ); |
132 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); | 136 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); |
133 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 137 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
134 | sectionBar->setStretchableWidget( label ); | 138 | sectionBar->setStretchableWidget( label ); |
135 | section = new QComboBox( false, sectionBar ); | 139 | section = new QComboBox( false, sectionBar ); |
136 | label = new QLabel( " / ", sectionBar ); | 140 | label = new QLabel( " / ", sectionBar ); |
137 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 141 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
138 | subsection = new QComboBox( false, sectionBar ); | 142 | subsection = new QComboBox( false, sectionBar ); |
139 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 143 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
140 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); | 144 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); |
141 | a->addTo( sectionBar ); | 145 | a->addTo( sectionBar ); |
142 | |||
143 | setSections(); | 146 | setSections(); |
144 | setSubSections(); | 147 | setSubSections(); |
145 | |||
146 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); | 148 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); |
147 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); | 149 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); |
148 | sectionAction->setToggleAction( true ); | 150 | sectionAction->setToggleAction( true ); |
149 | sectionAction->addTo( viewMenu ); | 151 | sectionAction->addTo( viewMenu ); |
150 | 152 | ||
153 | //FIND | ||
151 | findBar = new QPEToolBar(this); | 154 | findBar = new QPEToolBar(this); |
152 | addToolBar( findBar, "Search", QMainWindow::Top, TRUE ); | 155 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); |
153 | label = new QLabel( tr("Filter: "), findBar ); | 156 | label = new QLabel( tr("Filter: "), findBar ); |
154 | label->setBackgroundColor( findBar->backgroundColor() ); | 157 | label->setBackgroundColor( findBar->backgroundColor() ); |
155 | findBar->setHorizontalStretchable( TRUE ); | 158 | findBar->setHorizontalStretchable( TRUE ); |
156 | findEdit = new QLineEdit( findBar, "findEdit" ); | 159 | findEdit = new QLineEdit( findBar, "findEdit" ); |
157 | findBar->setStretchableWidget( findEdit ); | 160 | findBar->setStretchableWidget( findEdit ); |
158 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 161 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), |
159 | this, SLOT( displayList() ) ); | 162 | this, SLOT( displayList() ) ); |
160 | |||
161 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 163 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
162 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); | 164 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); |
163 | a->addTo( findBar ); | 165 | a->addTo( findBar ); |
164 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 166 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
165 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 167 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
166 | a->addTo( findBar ); | 168 | a->addTo( findBar ); |
167 | findAction = new QAction( tr( "Find" ), QString::null, 0, this, 0 ); | 169 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); |
168 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 170 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
169 | findAction->setToggleAction( true ); | 171 | findAction->setToggleAction( true ); |
170 | findAction->addTo( viewMenu ); | 172 | findAction->addTo( viewMenu ); |
171 | 173 | ||
174 | //SEARCH | ||
175 | searchBar = new QPEToolBar(this); | ||
176 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | ||
177 | label = new QLabel( tr("ipkgfind: "), searchBar ); | ||
178 | label->setBackgroundColor( searchBar->backgroundColor() ); | ||
179 | searchBar->setHorizontalStretchable( TRUE ); | ||
180 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); | ||
181 | searchBar->setStretchableWidget( searchEdit ); | ||
182 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | ||
183 | // this, SLOT( displayList() ) ); | ||
184 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | ||
185 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); | ||
186 | a->addTo( searchBar ); | ||
187 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | ||
188 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); | ||
189 | searchCommit->addTo( searchBar ); | ||
190 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | ||
191 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); | ||
192 | a->addTo( searchBar ); | ||
193 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); | ||
194 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); | ||
195 | searchAction->setToggleAction( true ); | ||
196 | searchAction->addTo( viewMenu ); | ||
197 | |||
198 | //DEST | ||
172 | destBar = new QPEToolBar(this); | 199 | destBar = new QPEToolBar(this); |
173 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); | 200 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); |
174 | label = new QLabel( tr("Destination: "), destBar ); | 201 | label = new QLabel( tr("Destination: "), destBar ); |
175 | label->setBackgroundColor( destBar->backgroundColor() ); | 202 | label->setBackgroundColor( destBar->backgroundColor() ); |
176 | destBar->setHorizontalStretchable( TRUE ); | 203 | destBar->setHorizontalStretchable( TRUE ); |
177 | destination = new QComboBox( false, destBar ); | 204 | destination = new QComboBox( false, destBar ); |
178 | destination->insertStringList( settings->getDestinationNames() ); | 205 | destination->insertStringList( settings->getDestinationNames() ); |
179 | setComboName(destination,settings->getDestinationName()); | 206 | setComboName(destination,settings->getDestinationName()); |
180 | // connect( destination, SIGNAL(activated(int)), | 207 | connect( destination, SIGNAL(activated(int)), |
181 | // SLOT(activeDestinationChange(int)) ); | 208 | settings, SLOT(activeDestinationChange(int)) ); |
182 | spacer = new QLabel( " ", destBar ); | 209 | spacer = new QLabel( " ", destBar ); |
183 | spacer->setBackgroundColor( destBar->backgroundColor() ); | 210 | spacer->setBackgroundColor( destBar->backgroundColor() ); |
184 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); | 211 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); |
185 | CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); | 212 | CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); |
186 | CheckBoxLink->setChecked( settings->createLinks() ); | 213 | CheckBoxLink->setChecked( settings->createLinks() ); |
187 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), | 214 | connect( CheckBoxLink, SIGNAL(toggled(bool)), |
188 | // settings, SLOT(linkEnabled(bool)) ); | 215 | settings, SLOT(linkEnabled(bool)) ); |
189 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); | 216 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); |
190 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); | 217 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); |
191 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 218 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
192 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); | 219 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); |
193 | a->addTo( destBar ); | 220 | a->addTo( destBar ); |
194 | destBar->setStretchableWidget( CheckBoxLink ); | 221 | destBar->setStretchableWidget( CheckBoxLink ); |
195 | destAction->setToggleAction( true ); | 222 | destAction->setToggleAction( true ); |
196 | // destAction->addTo( viewMenu ); | 223 | // destAction->addTo( viewMenu ); |
197 | 224 | ||
198 | // configure the menus | 225 | // configure the menus |
199 | Config cfg( "oipkg", Config::User ); | 226 | Config cfg( "oipkg", Config::User ); |
200 | cfg.setGroup( "gui" ); | 227 | cfg.setGroup( "gui" ); |
201 | 228 | ||
202 | findShow( cfg.readBoolEntry( "findBar", true ) ); | 229 | findShow( cfg.readBoolEntry( "findBar", true ) ); |
230 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); | ||
203 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); | 231 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); |
204 | destShow( cfg.readBoolEntry( "destBar", false ) ); | 232 | destShow( cfg.readBoolEntry( "destBar", false ) ); |
205 | } | 233 | } |
206 | 234 | ||
207 | MainWindow::~MainWindow() | 235 | MainWindow::~MainWindow() |
208 | { | 236 | { |
209 | Config cfg( "oipkg", Config::User ); | 237 | Config cfg( "oipkg", Config::User ); |
210 | cfg.setGroup( "gui" ); | 238 | cfg.setGroup( "gui" ); |
211 | cfg.writeEntry( "findBar", !findBar->isHidden() ); | 239 | cfg.writeEntry( "findBar", !findBar->isHidden() ); |
240 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); | ||
212 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); | 241 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); |
213 | cfg.writeEntry( "destBar", !destBar->isHidden() ); | 242 | cfg.writeEntry( "destBar", !destBar->isHidden() ); |
214 | 243 | ||
215 | } | 244 | } |
216 | 245 | ||
217 | void MainWindow::runIpkg() | 246 | void MainWindow::runIpkg() |
218 | { | 247 | { |
219 | packageList.allPackages(); | 248 | packageList.allPackages(); |
249 | ipkg->loadList( packageListSearch ); | ||
220 | ipkg->commit( packageList ); | 250 | ipkg->commit( packageList ); |
221 | // ##### If we looked in the list of files, we could send out accurate | 251 | // ##### If we looked in the list of files, we could send out accurate |
222 | // ##### messages. But we don't bother yet, and just do an "all". | 252 | // ##### messages. But we don't bother yet, and just do an "all". |
223 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 253 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
224 | QString lf = QString::null; | 254 | QString lf = QString::null; |
225 | e << lf; | 255 | e << lf; |
226 | displayList(); | 256 | displayList(); |
227 | } | 257 | } |
228 | 258 | ||
229 | void MainWindow::updateList() | 259 | void MainWindow::updateList() |
230 | { | 260 | { |
231 | //wait->show(); | 261 | //wait->show(); |
232 | QTimer *t = new QTimer( this ); | 262 | QTimer *t = new QTimer( this ); |
233 | connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); | 263 | connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); |
234 | t->start( 0, false ); | 264 | t->start( 0, false ); |
235 | packageList.clear(); | 265 | packageList.clear(); |
236 | ipkg->update(); | 266 | ipkg->update(); |
237 | packageList.update(); | 267 | packageList.update(); |
238 | t->stop(); | 268 | t->stop(); |
239 | // wait->hide(); | 269 | // wait->hide(); |
240 | } | 270 | } |
241 | 271 | ||
242 | void MainWindow::filterList() | 272 | void MainWindow::filterList() |
243 | { | 273 | { |
244 | //wait->show(); | 274 | //wait->show(); |
245 | QString f = ""; | 275 | QString f = ""; |
246 | if ( findAction->isOn() ) f = findEdit->text(); | 276 | if ( findAction->isOn() ) f = findEdit->text(); |
247 | packageList.filterPackages( f ); | 277 | packageList.filterPackages( f ); |
248 | //wait->hide(); | 278 | //wait->hide(); |
249 | } | 279 | } |
250 | 280 | ||
251 | void MainWindow::displayList() | 281 | void MainWindow::displayList() |
252 | { | 282 | { |
253 | //wait->hide(); | 283 | //wait->hide(); |
254 | filterList(); | 284 | filterList(); |
255 | listViewPackages->clear(); | 285 | listViewPackages->clear(); |
256 | Package *pack = packageList.first(); | 286 | Package *pack = packageList.first(); |
287 | PackageListItem *item; | ||
288 | |||
289 | QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local")); | ||
290 | QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); | ||
257 | while( pack ) | 291 | while( pack ) |
258 | { | 292 | { |
259 | if ( pack && (pack->name() != "") ) | 293 | item = new PackageListItem( rootLocal, pack, settings ); |
260 | listViewPackages->insertItem( new PackageListItem( listViewPackages, pack, settings ) ); | ||
261 | pack = packageList.next(); | 294 | pack = packageList.next(); |
262 | } | 295 | } |
296 | pack = packageListSearch.first(); | ||
297 | while( pack ) | ||
298 | { | ||
299 | item = new PackageListItem( rootSearch, pack, settings ); | ||
300 | pack = packageListSearch.next(); | ||
301 | } | ||
263 | } | 302 | } |
264 | 303 | ||
265 | void MainWindow::sectionChanged() | 304 | void MainWindow::sectionChanged() |
266 | { | 305 | { |
267 | disconnect( section, SIGNAL( activated(int) ), | 306 | disconnect( section, SIGNAL( activated(int) ), |
268 | this, SLOT( sectionChanged() ) ); | 307 | this, SLOT( sectionChanged() ) ); |
269 | disconnect( subsection, SIGNAL(activated(int) ), | 308 | disconnect( subsection, SIGNAL(activated(int) ), |
270 | this, SLOT( subSectionChanged() ) ); | 309 | this, SLOT( subSectionChanged() ) ); |
271 | subsection->clear(); | 310 | subsection->clear(); |
272 | packageList.setSection( section->currentText() ); | 311 | packageList.setSection( section->currentText() ); |
273 | setSubSections(); | 312 | setSubSections(); |
274 | connect( section, SIGNAL( activated(int) ), | 313 | connect( section, SIGNAL( activated(int) ), |
275 | this, SLOT( sectionChanged() ) ); | 314 | this, SLOT( sectionChanged() ) ); |
276 | connect( subsection, SIGNAL(activated(int) ), | 315 | connect( subsection, SIGNAL(activated(int) ), |
277 | this, SLOT( subSectionChanged() ) ); | 316 | this, SLOT( subSectionChanged() ) ); |
278 | displayList(); | 317 | displayList(); |
279 | } | 318 | } |
280 | 319 | ||
281 | void MainWindow::subSectionChanged() | 320 | void MainWindow::subSectionChanged() |
282 | { | 321 | { |
283 | disconnect( section, SIGNAL( activated(int) ), | 322 | disconnect( section, SIGNAL( activated(int) ), |
284 | this, SLOT( sectionChanged() ) ); | 323 | this, SLOT( sectionChanged() ) ); |
285 | disconnect( subsection, SIGNAL(activated(int) ), | 324 | disconnect( subsection, SIGNAL(activated(int) ), |
286 | this, SLOT( subSectionChanged() ) ); | 325 | this, SLOT( subSectionChanged() ) ); |
287 | packageList.setSubSection( subsection->currentText() ); | 326 | packageList.setSubSection( subsection->currentText() ); |
288 | connect( section, SIGNAL( activated(int) ), | 327 | connect( section, SIGNAL( activated(int) ), |
289 | this, SLOT( sectionChanged() ) ); | 328 | this, SLOT( sectionChanged() ) ); |
290 | connect( subsection, SIGNAL(activated(int) ), | 329 | connect( subsection, SIGNAL(activated(int) ), |
291 | this, SLOT( subSectionChanged() ) ); | 330 | this, SLOT( subSectionChanged() ) ); |
292 | displayList(); | 331 | displayList(); |
293 | } | 332 | } |
294 | 333 | ||
295 | void MainWindow::setSections() | 334 | void MainWindow::setSections() |
296 | { | 335 | { |
297 | section->clear(); | 336 | section->clear(); |
298 | section->insertStringList( packageList.getSections() ); | 337 | section->insertStringList( packageList.getSections() ); |
299 | } | 338 | } |
300 | 339 | ||
301 | void MainWindow::setSubSections() | 340 | void MainWindow::setSubSections() |
302 | { | 341 | { |
303 | subsection->clear(); | 342 | subsection->clear(); |
304 | subsection->insertStringList( packageList.getSubSections() ); | 343 | subsection->insertStringList( packageList.getSubSections() ); |
305 | } | 344 | } |
306 | 345 | ||
307 | 346 | ||
308 | void MainWindow::showSettings() | 347 | void MainWindow::showSettings() |
309 | { | 348 | { |
310 | if ( settings->showDialog( 0 ) ) | 349 | if ( settings->showDialog( 0 ) ) |
311 | updateList(); | 350 | updateList(); |
312 | } | 351 | } |
313 | void MainWindow::showSettingsSrv() | 352 | void MainWindow::showSettingsSrv() |
314 | { | 353 | { |
315 | if ( settings->showDialog( 1 ) ) | 354 | if ( settings->showDialog( 1 ) ) |
316 | updateList(); | 355 | updateList(); |
317 | } | 356 | } |
318 | void MainWindow::showSettingsDst() | 357 | void MainWindow::showSettingsDst() |
319 | { | 358 | { |
320 | if ( settings->showDialog( 2 ) ) | 359 | if ( settings->showDialog( 2 ) ) |
321 | updateList(); | 360 | updateList(); |
322 | } | 361 | } |
323 | 362 | ||
324 | void MainWindow::sectionShow(bool b) | 363 | void MainWindow::sectionShow(bool b) |
325 | { | 364 | { |
326 | if (b) sectionBar->show(); | 365 | if (b) sectionBar->show(); |
327 | else sectionBar->hide(); | 366 | else sectionBar->hide(); |
328 | sectionAction->setOn( b ); | 367 | sectionAction->setOn( b ); |
329 | } | 368 | } |
330 | 369 | ||
331 | void MainWindow::sectionClose() | 370 | void MainWindow::sectionClose() |
332 | { | 371 | { |
333 | sectionAction->setOn( false ); | 372 | sectionAction->setOn( false ); |
334 | } | 373 | } |
335 | 374 | ||
336 | void MainWindow::findShow(bool b) | 375 | void MainWindow::findShow(bool b) |
337 | { | 376 | { |
338 | if (b) findBar->show(); | 377 | if (b) findBar->show(); |
339 | else findBar->hide(); | 378 | else findBar->hide(); |
340 | findAction->setOn( b ); | 379 | findAction->setOn( b ); |
341 | } | 380 | } |
342 | 381 | ||
343 | void MainWindow::findClose() | 382 | void MainWindow::findClose() |
344 | { | 383 | { |
345 | findAction->setOn( false ); | 384 | findAction->setOn( false ); |
346 | } | 385 | } |
347 | 386 | ||
387 | void MainWindow::searchShow(bool b) | ||
388 | { | ||
389 | if (b) searchBar->show(); | ||
390 | else searchBar->hide(); | ||
391 | searchAction->setOn( b ); | ||
392 | } | ||
393 | |||
394 | void MainWindow::searchClose() | ||
395 | { | ||
396 | searchAction->setOn( false ); | ||
397 | } | ||
398 | |||
399 | |||
348 | void MainWindow::destShow(bool b) | 400 | void MainWindow::destShow(bool b) |
349 | { | 401 | { |
350 | if (b) destBar->show(); | 402 | if (b) destBar->show(); |
351 | else destBar->hide(); | 403 | else destBar->hide(); |
352 | destAction->setOn( b ); | 404 | destAction->setOn( b ); |
353 | } | 405 | } |
354 | 406 | ||
355 | void MainWindow::destClose() | 407 | void MainWindow::destClose() |
356 | { | 408 | { |
357 | destAction->setOn( false ); | 409 | destAction->setOn( false ); |
358 | } | 410 | } |
359 | 411 | ||
360 | void MainWindow::rotateUpdateIcon() | 412 | void MainWindow::rotateUpdateIcon() |
361 | { | 413 | { |
362 | pvDebug(2, "MainWindow::rotateUpdateIcon"); | 414 | pvDebug(2, "MainWindow::rotateUpdateIcon"); |
363 | if ( updateIcon ) | 415 | if ( updateIcon ) |
364 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); | 416 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); |
365 | else | 417 | else |
366 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); | 418 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); |
367 | updateIcon = !updateIcon; | 419 | updateIcon = !updateIcon; |
368 | } | 420 | } |
369 | 421 | ||
370 | 422 | ||
371 | void MainWindow::setDocument(const QString &fileName) | 423 | void MainWindow::setDocument(const QString &fileName) |
372 | { | 424 | { |
373 | installFile(fileName); | 425 | installFile(fileName); |
374 | // ##### If we looked in the list of files, we could send out accurate | 426 | // ##### If we looked in the list of files, we could send out accurate |
375 | // ##### messages. But we don't bother yet, and just do an "all". | 427 | // ##### messages. But we don't bother yet, and just do an "all". |
376 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 428 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
377 | QString lf = QString::null; | 429 | QString lf = QString::null; |
378 | e << lf; | 430 | e << lf; |
379 | displayList(); | 431 | displayList(); |
380 | } | 432 | } |
381 | 433 | ||
382 | void MainWindow::installFile(const QString &fileName) | 434 | void MainWindow::installFile(const QString &fileName) |
383 | { | 435 | { |
384 | pvDebug(3, "MainWindow::installFile "+fileName); | 436 | pvDebug(3, "MainWindow::installFile "+fileName); |
385 | if ( !QFile::exists( fileName ) ) return; | 437 | if ( !QFile::exists( fileName ) ) return; |
386 | ipkg->installFile( fileName ); | 438 | ipkg->installFile( fileName ); |
387 | // ##### If we looked in the list of files, we could send out accurate | 439 | // ##### If we looked in the list of files, we could send out accurate |
388 | // ##### messages. But we don't bother yet, and just do an "all". | 440 | // ##### messages. But we don't bother yet, and just do an "all". |
389 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 441 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
390 | QString lf = QString::null; | 442 | QString lf = QString::null; |
391 | e << lf; | 443 | e << lf; |
392 | displayList(); | 444 | displayList(); |
393 | } | 445 | } |
394 | 446 | ||
395 | void MainWindow::makeChannel() | 447 | void MainWindow::makeChannel() |
396 | { | 448 | { |
397 | channel = new QCopChannel( "QPE/Application/oipkg", this ); | 449 | channel = new QCopChannel( "QPE/Application/oipkg", this ); |
398 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 450 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
399 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 451 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
400 | } | 452 | } |
401 | 453 | ||
402 | 454 | ||
403 | 455 | ||
404 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) | 456 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) |
405 | { | 457 | { |
406 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); | 458 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); |
407 | if ( msg == "installFile(QString)" ) | 459 | if ( msg == "installFile(QString)" ) |
408 | { | 460 | { |
409 | ipkg->installFile( QString(arg) ); | 461 | ipkg->installFile( QString(arg) ); |
410 | }else if( msg == "removeFile(QString)" ) | 462 | }else if( msg == "removeFile(QString)" ) |
411 | { | 463 | { |
412 | ipkg->removeFile( QString(arg) ); | 464 | ipkg->removeFile( QString(arg) ); |
413 | }else if( msg == "createLinks(QString)" ) | 465 | }else if( msg == "createLinks(QString)" ) |
414 | { | 466 | { |
415 | ipkg->createLinks( QString(arg) ); | 467 | ipkg->createLinks( QString(arg) ); |
416 | }else if( msg == "removeLinks(QString)" ) | 468 | }else if( msg == "removeLinks(QString)" ) |
417 | { | 469 | { |
418 | ipkg->removeLinks( QString(arg) ); | 470 | ipkg->removeLinks( QString(arg) ); |
419 | }else{ | 471 | }else{ |
420 | pvDebug(2,"Huh what do ya want") | 472 | pvDebug(2,"Huh what do ya want") |
421 | } | 473 | } |
422 | } | 474 | } |
475 | |||
476 | |||
477 | void MainWindow::createLinks() | ||
478 | { | ||
479 | pvDebug(2,"creating links..."); | ||
480 | ipkg->createLinks( settings->destinationurl->text() ); | ||
481 | } | ||
482 | |||
483 | void MainWindow::removeLinks() | ||
484 | { | ||
485 | pvDebug(2,"removing links..."); | ||
486 | ipkg->removeLinks( settings->destinationurl->text() ); | ||
487 | } | ||
488 | |||
489 | void MainWindow::remotePackageQuery() | ||
490 | { | ||
491 | packageListSearch.query( searchEdit->text() ); | ||
492 | displayList(); | ||
493 | } | ||
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 7615b09..4a73b78 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -1,84 +1,98 @@ | |||
1 | #ifndef MAINWINDOW_H | 1 | #ifndef MAINWINDOW_H |
2 | #define MAINWINDOW_H | 2 | #define MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qaction.h> | 5 | #include <qaction.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qpopupmenu.h> | 7 | #include <qpopupmenu.h> |
8 | 8 | ||
9 | #include "packagelist.h" | 9 | #include "packagelist.h" |
10 | #include "packagelistremote.h" | ||
11 | #include "packagelistlocal.h" | ||
10 | #include "pmipkg.h" | 12 | #include "pmipkg.h" |
11 | #include "pksettings.h" | 13 | #include "pksettings.h" |
12 | #include "packagelistview.h" | 14 | #include "packagelistview.h" |
13 | 15 | ||
14 | class QComboBox; | 16 | class QComboBox; |
15 | class QPEToolBar; | 17 | class QPEToolBar; |
16 | class QLineEdit; | 18 | class QLineEdit; |
17 | class PackageListItem; | 19 | class PackageListItem; |
18 | class QCopChannel; | 20 | class QCopChannel; |
19 | class QMessageBox; | 21 | class QMessageBox; |
20 | class QCheckBox; | 22 | class QCheckBox; |
21 | 23 | ||
22 | class MainWindow : public QMainWindow | 24 | class MainWindow : public QMainWindow |
23 | { | 25 | { |
24 | Q_OBJECT | 26 | Q_OBJECT |
25 | 27 | ||
26 | 28 | ||
27 | public: | 29 | public: |
28 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 30 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
29 | ~MainWindow(); | 31 | ~MainWindow(); |
30 | void makeChannel(); | 32 | void makeChannel(); |
31 | 33 | ||
32 | QCopChannel *channel; | 34 | QCopChannel *channel; |
33 | 35 | ||
34 | protected slots: | 36 | protected slots: |
35 | void runIpkg(); | 37 | void runIpkg(); |
36 | void updateList(); | 38 | void updateList(); |
37 | void displayList(); | 39 | void displayList(); |
38 | void subSectionChanged(); | 40 | void subSectionChanged(); |
39 | void sectionChanged(); | 41 | void sectionChanged(); |
40 | void showSettings(); | 42 | void showSettings(); |
41 | void showSettingsSrv(); | 43 | void showSettingsSrv(); |
42 | void showSettingsDst(); | 44 | void showSettingsDst(); |
43 | 45 | ||
44 | public slots: | 46 | public slots: |
45 | void sectionClose(); | 47 | void sectionClose(); |
46 | void sectionShow(bool); | 48 | void sectionShow(bool); |
47 | void findClose(); | 49 | void findClose(); |
48 | void findShow(bool); | 50 | void findShow(bool); |
51 | void searchClose(); | ||
52 | void searchShow(bool); | ||
49 | void destClose(); | 53 | void destClose(); |
50 | void destShow(bool); | 54 | void destShow(bool); |
51 | void filterList(); | 55 | void filterList(); |
56 | void createLinks(); | ||
57 | void removeLinks(); | ||
52 | void receive (const QCString &, const QByteArray &); | 58 | void receive (const QCString &, const QByteArray &); |
53 | void setDocument (const QString &); | 59 | void setDocument (const QString &); |
60 | void remotePackageQuery(); | ||
54 | 61 | ||
55 | private: | 62 | private: |
56 | void makeMenu(); | 63 | void makeMenu(); |
57 | void setSections(); | 64 | void setSections(); |
58 | void setSubSections(); | 65 | void setSubSections(); |
59 | void installFile(const QString &); | 66 | void installFile(const QString &); |
60 | bool updateIcon; | 67 | bool updateIcon; |
61 | 68 | ||
62 | PmIpkg* ipkg; | 69 | PmIpkg* ipkg; |
63 | PackageManagerSettings *settings; | 70 | PackageManagerSettings *settings; |
64 | PackageList packageList; | 71 | PackageListLocal packageList; |
72 | PackageListRemote packageListSearch; | ||
73 | PackageListView *listViewPackages; | ||
74 | // QCheckListItem* rootSearch; | ||
75 | // QCheckListItem* rootLocal; | ||
65 | QAction *runAction; | 76 | QAction *runAction; |
66 | QAction *updateAction; | 77 | QAction *updateAction; |
67 | QAction *findAction; | 78 | QAction *findAction; |
68 | QAction *sectionAction; | ||
69 | QAction *destAction; | ||
70 | PackageListView *listViewPackages; | ||
71 | QPEToolBar *findBar; | 79 | QPEToolBar *findBar; |
72 | QLineEdit *findEdit; | 80 | QLineEdit *findEdit; |
81 | QAction *searchAction; | ||
82 | QAction *searchCommit; | ||
83 | QPEToolBar *searchBar; | ||
84 | QLineEdit *searchEdit; | ||
85 | QAction *sectionAction; | ||
73 | QPEToolBar *sectionBar; | 86 | QPEToolBar *sectionBar; |
74 | QComboBox *section; | 87 | QComboBox *section; |
75 | QComboBox *subsection; | 88 | QComboBox *subsection; |
89 | QAction *destAction; | ||
76 | QPEToolBar *destBar; | 90 | QPEToolBar *destBar; |
77 | QComboBox *destination; | 91 | QComboBox *destination; |
78 | QCheckBox* CheckBoxLink; | 92 | QCheckBox* CheckBoxLink; |
79 | // QMessageBox *wait; | 93 | // QMessageBox *wait; |
80 | private slots: | 94 | private slots: |
81 | void rotateUpdateIcon(); | 95 | void rotateUpdateIcon(); |
82 | }; | 96 | }; |
83 | 97 | ||
84 | #endif | 98 | #endif |
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro index c5d3b3d..98f92c8 100644 --- a/noncore/unsupported/oipkg/oipkg.pro +++ b/noncore/unsupported/oipkg/oipkg.pro | |||
@@ -1,28 +1,32 @@ | |||
1 | DESTDIR = $(OPIEDIR)/bin | 1 | DESTDIR = $(OPIEDIR)/bin |
2 | TEMPLATE= app | 2 | TEMPLATE= app |
3 | #CONFIG = qt warn_on release | 3 | #CONFIG = qt warn_on release |
4 | CONFIG = qt warn_on debug | 4 | CONFIG = qt warn_on debug |
5 | HEADERS = mainwindow.h \ | 5 | HEADERS = mainwindow.h \ |
6 | pksettings.h \ | 6 | pksettings.h \ |
7 | pmipkg.h \ | 7 | pmipkg.h \ |
8 | utils.h \ | 8 | utils.h \ |
9 | packagelistitem.h \ | 9 | packagelistitem.h \ |
10 | packagelistremote.h \ | ||
10 | packagelist.h \ | 11 | packagelist.h \ |
12 | packagelistlocal.h \ | ||
11 | packagelistview.h \ | 13 | packagelistview.h \ |
12 | package.h | 14 | package.h |
13 | SOURCES = main.cpp \ | 15 | SOURCES = main.cpp \ |
14 | mainwindow.cpp \ | 16 | mainwindow.cpp \ |
15 | utils.cpp \ | 17 | utils.cpp \ |
16 | packagelistview.cpp \ | 18 | packagelistview.cpp \ |
19 | packagelistremote.cpp \ | ||
20 | packagelistlocal.cpp \ | ||
17 | pksettings.cpp \ | 21 | pksettings.cpp \ |
18 | pmipkg.cpp \ | 22 | pmipkg.cpp \ |
19 | packagelistitem.cpp \ | 23 | packagelistitem.cpp \ |
20 | packagelist.cpp \ | 24 | packagelist.cpp \ |
21 | package.cpp | 25 | package.cpp |
22 | INCLUDEPATH += $(OPIEDIR)/include | 26 | INCLUDEPATH += $(OPIEDIR)/include |
23 | DEPENDPATH+= $(OPIEDIR)/ioclude | 27 | DEPENDPATH+= $(OPIEDIR)/ioclude |
24 | LIBS += -lqpe | 28 | LIBS += -lqpe |
25 | INTERFACES= runwindow.ui \ | 29 | INTERFACES= runwindow.ui \ |
26 | pksettingsbase.ui | 30 | pksettingsbase.ui |
27 | TARGET = oipkg | 31 | TARGET = oipkg |
28 | 32 | ||
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 0499e19..6bb53a9 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -1,338 +1,352 @@ | |||
1 | #include "package.h" | 1 | #include "package.h" |
2 | 2 | ||
3 | #include <qpe/process.h> | 3 | #include <qpe/process.h> |
4 | #include <qpe/stringutil.h> | 4 | #include <qpe/stringutil.h> |
5 | #include <qfile.h> | 5 | #include <qfile.h> |
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | 9 | ||
10 | #include "debug.h" | 10 | #include "debug.h" |
11 | 11 | ||
12 | //Package::~Package() | 12 | //Package::~Package() |
13 | //{ | 13 | //{ |
14 | //} | 14 | //} |
15 | 15 | ||
16 | Package::Package( PackageManagerSettings *s ) | 16 | Package::Package( PackageManagerSettings *s ) |
17 | { | 17 | { |
18 | init(s); | 18 | init(s); |
19 | } | 19 | } |
20 | 20 | ||
21 | void Package::init( PackageManagerSettings *s ) | 21 | void Package::init( PackageManagerSettings *s ) |
22 | { | 22 | { |
23 | settings = s; | 23 | settings = s; |
24 | _size = ""; | 24 | _size = ""; |
25 | _section = ""; | 25 | _section = ""; |
26 | _subsection = ""; | 26 | _subsection = ""; |
27 | _shortDesc = ""; | 27 | _shortDesc = ""; |
28 | _desc = ""; | 28 | _desc = ""; |
29 | _name = ""; | 29 | _name = ""; |
30 | _toProcess = false; | 30 | _toProcess = false; |
31 | _useFileName = false; | ||
31 | _status = ""; | 32 | _status = ""; |
32 | _dest = settings->getDestinationName(); | 33 | _dest = settings->getDestinationName(); |
33 | _link = settings->createLinks(); | 34 | _link = settings->createLinks(); |
34 | } | 35 | } |
35 | 36 | ||
36 | Package::Package( QStringList pack, PackageManagerSettings *s ) | 37 | Package::Package( QStringList pack, PackageManagerSettings *s ) |
37 | { | 38 | { |
38 | init(s); | 39 | init(s); |
39 | parsePackage( pack ); | 40 | parsePackage( pack ); |
40 | } | 41 | } |
41 | 42 | ||
42 | Package::Package( QString n, PackageManagerSettings *s ) | 43 | Package::Package( QString n, PackageManagerSettings *s ) |
43 | { | 44 | { |
44 | init(s); | 45 | init(s); |
45 | if ( !QFile::exists( n ) ) | 46 | if ( !QFile::exists( n ) ) |
46 | { | 47 | { |
47 | _name = QString( n ); | 48 | _name = QString( n ); |
48 | }else{ | 49 | }else{ |
49 | parseIpkgFile( n ); | 50 | parseIpkgFile( n ); |
50 | _toProcess = true; | 51 | _toProcess = true; |
51 | _packageName = QString( n ); | 52 | _useFileName = true; |
53 | _fileName = QString( n ); | ||
52 | } | 54 | } |
53 | } | 55 | } |
54 | 56 | ||
55 | Package::Package( Package *pi ) | 57 | Package::Package( Package *pi ) |
56 | { | 58 | { |
57 | init(pi->settings); | 59 | init(pi->settings); |
58 | copyValues( pi ); | 60 | copyValues( pi ); |
59 | } | 61 | } |
60 | 62 | ||
61 | 63 | ||
62 | void Package::setValue( QString n, QString t ) | 64 | void Package::setValue( QString n, QString t ) |
63 | { | 65 | { |
64 | if ( n == "Package" ) | 66 | if ( n == "Package" ) |
65 | { | 67 | { |
66 | _name = QString( t ); | 68 | _name = QString( t ); |
67 | }else if ( n == "Installed-Size" ) | 69 | }else if ( n == "Installed-Size" ) |
68 | { | 70 | { |
69 | _size = t; | 71 | _size = t; |
70 | }else if ( n == "Priority") | 72 | }else if ( n == "Priority") |
71 | { | 73 | { |
72 | 74 | ||
73 | }else if ( n == "Section") | 75 | }else if ( n == "Section") |
74 | { | 76 | { |
75 | setSection( t ); | 77 | setSection( t ); |
76 | }else if ( n == "Maintainer") | 78 | }else if ( n == "Maintainer") |
77 | { | 79 | { |
78 | 80 | ||
79 | }else if ( n == "Architecture") | 81 | }else if ( n == "Architecture") |
80 | { | 82 | { |
81 | 83 | ||
82 | }else if ( n == "Version") | 84 | }else if ( n == "Version") |
83 | { | 85 | { |
84 | 86 | ||
85 | }else if ( n == "Pre-Depends") | 87 | }else if ( n == "Pre-Depends") |
86 | { | 88 | { |
87 | 89 | ||
88 | }else if ( n == "Depends") | 90 | }else if ( n == "Depends") |
89 | { | 91 | { |
90 | 92 | ||
91 | }else if ( n == "Filename") | 93 | }else if ( n == "Filename") |
92 | { | 94 | { |
93 | 95 | _fileName = t; | |
94 | }else if ( n == "Size") | 96 | }else if ( n == "Size") |
95 | { | 97 | { |
96 | 98 | ||
97 | }else if ( n == "MD5Sum") | 99 | }else if ( n == "MD5Sum") |
98 | { | 100 | { |
99 | 101 | ||
100 | } | 102 | } |
101 | if ( n == "Description") | 103 | if ( n == "Description") |
102 | { | 104 | { |
103 | setDesc( t ); | 105 | setDesc( t ); |
104 | } | 106 | } |
105 | if ( n == "Status") | 107 | if ( n == "Status") |
106 | { | 108 | { |
107 | if ( installed() ) return; | 109 | if ( installed() ) return; |
108 | _status = t; | 110 | _status = t; |
109 | } | 111 | } |
110 | if ( t == "Essential") | 112 | if ( t == "Essential") |
111 | { | 113 | { |
112 | 114 | ||
113 | } | 115 | } |
114 | }; | 116 | }; |
115 | 117 | ||
116 | QString Package::name() | 118 | QString Package::name() |
117 | { | 119 | { |
118 | return _name; | 120 | return _name; |
119 | } | 121 | } |
120 | 122 | ||
123 | |||
124 | QString Package::installName() | ||
125 | { | ||
126 | if (_useFileName) return _fileName; | ||
127 | else return _name; | ||
128 | } | ||
129 | |||
121 | bool Package::installed() | 130 | bool Package::installed() |
122 | { | 131 | { |
123 | return _status.contains("installed"); | 132 | return _status.contains("installed"); |
124 | } | 133 | } |
125 | 134 | ||
126 | void Package::setDesc( QString s ) | 135 | void Package::setDesc( QString s ) |
127 | { | 136 | { |
128 | _desc = s; | 137 | _desc = s; |
129 | _shortDesc = s.left( s.find("\n") ); | 138 | _shortDesc = s.left( s.find("\n") ); |
130 | } | 139 | } |
131 | 140 | ||
132 | QString Package::desc() | 141 | QString Package::desc() |
133 | { | 142 | { |
134 | return _desc; | 143 | return _desc; |
135 | } | 144 | } |
136 | 145 | ||
137 | QString Package::shortDesc() | 146 | QString Package::shortDesc() |
138 | { | 147 | { |
139 | return _shortDesc; | 148 | return _shortDesc; |
140 | } | 149 | } |
141 | 150 | ||
142 | QString Package::size() | 151 | QString Package::size() |
143 | { | 152 | { |
144 | return _size; | 153 | return _size; |
145 | } | 154 | } |
146 | 155 | ||
147 | QString Package::sizeUnits() | 156 | QString Package::sizeUnits() |
148 | { | 157 | { |
149 | int i = _size.toInt(); | 158 | int i = _size.toInt(); |
150 | int c = 0; | 159 | int c = 0; |
151 | QString ret; | 160 | QString ret; |
152 | QStringList unit; | 161 | QStringList unit; |
153 | unit << "B" << "KB" << "MB" << "GB" << "TB"; //prepair for the future ;) | 162 | unit << "B" << "KB" << "MB" << "GB" << "TB"; //prepair for the future ;) |
154 | while (i > 1) | 163 | while (i > 1) |
155 | { | 164 | { |
156 | ret=QString::number(i)+" "+unit[c]; | 165 | ret=QString::number(i)+" "+unit[c]; |
157 | c++; | 166 | c++; |
158 | i /= 1024; | 167 | i /= 1024; |
159 | } | 168 | } |
160 | return ret; | 169 | return ret; |
161 | } | 170 | } |
162 | 171 | ||
163 | bool Package::toProcess() | 172 | bool Package::toProcess() |
164 | { | 173 | { |
165 | return _toProcess; | 174 | return _toProcess; |
166 | } | 175 | } |
167 | 176 | ||
168 | bool Package::toRemove() | 177 | bool Package::toRemove() |
169 | { | 178 | { |
170 | if ( _toProcess && installed() ) return true; | 179 | if ( _toProcess && installed() ) return true; |
171 | else return false; | 180 | else return false; |
172 | } | 181 | } |
173 | 182 | ||
174 | bool Package::toInstall() | 183 | bool Package::toInstall() |
175 | { | 184 | { |
176 | if ( _toProcess && !installed() ) return true; | 185 | if ( _toProcess && !installed() ) return true; |
177 | else return false; | 186 | else return false; |
178 | } | 187 | } |
179 | 188 | ||
180 | void Package::toggleProcess() | 189 | void Package::toggleProcess() |
181 | { | 190 | { |
182 | _toProcess = ! _toProcess; | 191 | _toProcess = ! _toProcess; |
183 | } | 192 | } |
184 | 193 | ||
185 | 194 | ||
186 | 195 | ||
187 | void Package::copyValues( Package* pack ) | 196 | void Package::copyValues( Package* pack ) |
188 | { | 197 | { |
189 | if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size ); | 198 | if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size ); |
190 | if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section ); | 199 | if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section ); |
191 | if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection ); | 200 | if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection ); |
192 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); | 201 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); |
193 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); | 202 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); |
194 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); | 203 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); |
195 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); | 204 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); |
196 | } | 205 | } |
197 | 206 | ||
198 | QString Package::section() | 207 | QString Package::section() |
199 | { | 208 | { |
200 | return _section; | 209 | return _section; |
201 | } | 210 | } |
202 | 211 | ||
203 | void Package::setSection( QString s) | 212 | void Package::setSection( QString s) |
204 | { | 213 | { |
205 | int i = s.find("/"); | 214 | int i = s.find("/"); |
206 | if ( i > 0 ) | 215 | if ( i > 0 ) |
207 | { | 216 | { |
208 | _section = s.left(i); | 217 | _section = s.left(i); |
209 | _subsection = s.mid(i+1); | 218 | _subsection = s.mid(i+1); |
210 | }else{ | 219 | }else{ |
211 | _section = s; | 220 | _section = s; |
212 | _subsection = ""; | 221 | _subsection = ""; |
213 | } | 222 | } |
214 | } | 223 | } |
215 | 224 | ||
216 | QString Package::subSection() | 225 | QString Package::subSection() |
217 | { | 226 | { |
218 | return _subsection; | 227 | return _subsection; |
219 | } | 228 | } |
220 | 229 | ||
221 | void Package::parsePackage( QStringList pack ) | 230 | void Package::parsePackage( QStringList pack ) |
222 | { | 231 | { |
223 | if ( pack.isEmpty() ) return; | 232 | if ( pack.isEmpty() ) return; |
224 | int count = pack.count(); | 233 | int count = pack.count(); |
225 | for( int i = 0; i < count; i++ ) | 234 | for( int i = 0; i < count; i++ ) |
226 | { | 235 | { |
227 | QString line = pack[i]; | 236 | QString line = pack[i]; |
228 | int sep = line.find( QRegExp(":[\t ]+") ); | 237 | int sep = line.find( QRegExp(":[\t ]+") ); |
229 | if ( sep >= 0 ) | 238 | if ( sep >= 0 ) |
230 | { | 239 | { |
231 | QString tag = line.left(sep); | 240 | QString tag = line.left(sep); |
232 | QString value = line.mid(sep+2).simplifyWhiteSpace(); | 241 | QString value = line.mid(sep+2).simplifyWhiteSpace(); |
233 | setValue( tag, value ); | 242 | setValue( tag, value ); |
234 | }else{ | 243 | }else{ |
235 | } | 244 | } |
236 | } | 245 | } |
237 | return; | 246 | return; |
238 | } | 247 | } |
239 | 248 | ||
240 | QString Package::details() | 249 | QString Package::details() |
241 | { | 250 | { |
242 | QString status; | 251 | QString status; |
243 | Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); | 252 | Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); |
244 | QString description; | 253 | QString description; |
245 | if ( ipkg_status.exec("",status) ) | 254 | if ( ipkg_status.exec("",status) ) |
246 | { | 255 | { |
247 | QStringList lines = QStringList::split('\n',status,TRUE); | 256 | QStringList lines = QStringList::split('\n',status,TRUE); |
248 | for (QStringList::Iterator it = lines.begin(); it!=lines.end(); ++it) { | 257 | for (QStringList::Iterator it = lines.begin(); it!=lines.end(); ++it) { |
249 | QString line = *it; | 258 | QString line = *it; |
250 | if ( line == " ." ) | 259 | if ( line == " ." ) |
251 | { | 260 | { |
252 | description.append("<p>"); | 261 | description.append("<p>"); |
253 | } else | 262 | } else |
254 | if ( line[0] == ' ' || line[0] == '\t' ) | 263 | if ( line[0] == ' ' || line[0] == '\t' ) |
255 | { | 264 | { |
256 | // continuation | 265 | // continuation |
257 | description.append(" "); | 266 | description.append(" "); |
258 | description.append(Qtopia::escapeString(line)); | 267 | description.append(Qtopia::escapeString(line)); |
259 | } else { | 268 | } else { |
260 | int sep = line.find(QRegExp(":[\t ]+")); | 269 | int sep = line.find(QRegExp(":[\t ]+")); |
261 | if ( sep >= 0 ) | 270 | if ( sep >= 0 ) |
262 | { | 271 | { |
263 | QString tag = line.left(sep); | 272 | QString tag = line.left(sep); |
264 | description.append("<br>"); | 273 | description.append("<br>"); |
265 | description.append("<b>"); | 274 | description.append("<b>"); |
266 | description.append(Qtopia::escapeString(tag)); | 275 | description.append(Qtopia::escapeString(tag)); |
267 | description.append(":</b> "); | 276 | description.append(":</b> "); |
268 | description.append(Qtopia::escapeString(line.mid(sep+2))); | 277 | description.append(Qtopia::escapeString(line.mid(sep+2))); |
269 | } else { | 278 | } else { |
270 | description.append(" "); | 279 | description.append(" "); |
271 | description.append(Qtopia::escapeString(line)); | 280 | description.append(Qtopia::escapeString(line)); |
272 | } | 281 | } |
273 | } | 282 | } |
274 | } | 283 | } |
275 | } | 284 | } |
276 | return description; | 285 | return description; |
277 | } | 286 | } |
278 | 287 | ||
279 | void Package::processed() | 288 | void Package::processed() |
280 | { | 289 | { |
281 | _toProcess = false; | 290 | _toProcess = false; |
282 | //hack, but we're not writing status anyway... | 291 | //hack, but we're not writing status anyway... |
283 | if ( installed() ) _status = "install"; | 292 | if ( installed() ) _status = "install"; |
284 | else _status = "installed"; | 293 | else _status = "installed"; |
285 | } | 294 | } |
286 | 295 | ||
287 | QString Package::dest() | 296 | QString Package::dest() |
288 | { | 297 | { |
289 | if ( installed()||(!installed() && _toProcess) ) | 298 | if ( installed()||(!installed() && _toProcess) ) |
290 | return _dest!=""?_dest:settings->getDestinationName(); | 299 | return _dest!=""?_dest:settings->getDestinationName(); |
291 | else return ""; | 300 | else return ""; |
292 | } | 301 | } |
293 | 302 | ||
294 | void Package::setDest( QString d ) | 303 | void Package::setDest( QString d ) |
295 | { | 304 | { |
296 | _dest = d; | 305 | _dest = d; |
297 | } | 306 | } |
298 | 307 | ||
299 | void Package::setOn() | 308 | void Package::setOn() |
300 | { | 309 | { |
301 | _toProcess = true; | 310 | _toProcess = true; |
302 | } | 311 | } |
303 | 312 | ||
304 | bool Package::link() | 313 | bool Package::link() |
305 | { | 314 | { |
306 | if ( _dest == "root" || (!installed() && !_toProcess) ) return false; | 315 | if ( _dest == "root" || (!installed() && !_toProcess) ) return false; |
307 | return _link; | 316 | return _link; |
308 | } | 317 | } |
309 | 318 | ||
310 | void Package::setLink(bool b) | 319 | void Package::setLink(bool b) |
311 | { | 320 | { |
312 | _link = b; | 321 | _link = b; |
313 | } | 322 | } |
314 | 323 | ||
315 | void Package::parseIpkgFile( QString file) | 324 | void Package::parseIpkgFile( QString file) |
316 | { | 325 | { |
317 | system("tar xzf "+file+" -C /tmp"); | 326 | system("tar xzf "+file+" -C /tmp"); |
318 | system("tar xzf /tmp/control.tar.gz -C /tmp"); | 327 | system("tar xzf /tmp/control.tar.gz -C /tmp"); |
319 | QFile f("/tmp/control"); | 328 | QFile f("/tmp/control"); |
320 | if ( f.open(IO_ReadOnly) ) | 329 | if ( f.open(IO_ReadOnly) ) |
321 | { | 330 | { |
322 | QTextStream t( &f ); | 331 | QTextStream t( &f ); |
323 | QStringList pack; | 332 | QStringList pack; |
324 | while ( !t.eof() ) | 333 | while ( !t.eof() ) |
325 | { | 334 | { |
326 | pack << t.readLine(); | 335 | pack << t.readLine(); |
327 | } | 336 | } |
328 | f.close(); | 337 | f.close(); |
329 | parsePackage( pack ); | 338 | parsePackage( pack ); |
330 | } | 339 | } |
331 | 340 | ||
332 | } | 341 | } |
333 | 342 | ||
334 | QString Package::getPackageName() | 343 | //QString Package::getPackageName() |
344 | //{ | ||
345 | //if ( _packageName.isEmpty() ) return _name; | ||
346 | //else return _packageName; | ||
347 | //} | ||
348 | |||
349 | void Package::instalFromFile(bool iff) | ||
335 | { | 350 | { |
336 | if ( _packageName.isEmpty() ) return _name; | 351 | _useFileName = iff; |
337 | else return _packageName; | ||
338 | } | 352 | } |
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h index 49bb3bf..4618c3a 100644 --- a/noncore/unsupported/oipkg/package.h +++ b/noncore/unsupported/oipkg/package.h | |||
@@ -1,70 +1,74 @@ | |||
1 | #ifndef PK_ITEM_H | 1 | #ifndef PK_ITEM_H |
2 | #define PK_ITEM_H | 2 | #define PK_ITEM_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qpainter.h> | 6 | #include <qpainter.h> |
7 | #include <qpixmap.h> | 7 | #include <qpixmap.h> |
8 | #include <qdict.h> | 8 | #include <qdict.h> |
9 | #include <qobject.h> | 9 | #include <qobject.h> |
10 | 10 | ||
11 | #include "pksettings.h" | 11 | #include "pksettings.h" |
12 | 12 | ||
13 | class Package //: public QObject | 13 | class Package //: public QObject |
14 | { | 14 | { |
15 | // Q_OBJECT | 15 | // Q_OBJECT |
16 | public: | 16 | public: |
17 | Package(PackageManagerSettings *); | 17 | Package(PackageManagerSettings *); |
18 | // ~Package(); | 18 | // ~Package(); |
19 | Package( QStringList, PackageManagerSettings * ); | 19 | Package( QStringList, PackageManagerSettings * ); |
20 | Package( QString, PackageManagerSettings * ); | 20 | Package( QString, PackageManagerSettings * ); |
21 | Package( Package* ); | 21 | Package( Package* ); |
22 | 22 | ||
23 | void setValue( QString, QString ); | 23 | void setValue( QString, QString ); |
24 | void copyValues( Package* ); | 24 | void copyValues( Package* ); |
25 | 25 | ||
26 | QString name() ; | 26 | QString name() ; |
27 | QString installName() ; | ||
27 | bool installed(); | 28 | bool installed(); |
28 | 29 | ||
29 | void setDesc( QString ); | 30 | void setDesc( QString ); |
30 | QString shortDesc(); | 31 | QString shortDesc(); |
31 | QString desc(); | 32 | QString desc(); |
32 | QString size(); | 33 | QString size(); |
33 | QString sizeUnits(); | 34 | QString sizeUnits(); |
34 | void setSection( QString ); | 35 | void setSection( QString ); |
35 | QString section(); | 36 | QString section(); |
36 | QString subSection(); | 37 | QString subSection(); |
37 | QString details(); | 38 | QString details(); |
38 | bool toProcess(); | 39 | bool toProcess(); |
39 | bool toInstall(); | 40 | bool toInstall(); |
40 | bool toRemove(); | 41 | bool toRemove(); |
41 | void processed(); | 42 | void processed(); |
42 | QString dest(); | 43 | QString dest(); |
43 | void setDest( QString d ); | 44 | void setDest( QString d ); |
44 | void setOn(); | 45 | void setOn(); |
45 | bool link(); | 46 | bool link(); |
46 | void setLink(bool); | 47 | void setLink(bool); |
47 | void parseIpkgFile( QString );; | 48 | void parseIpkgFile( QString ); |
49 | void instalFromFile(bool iff=true); | ||
48 | public slots: | 50 | public slots: |
49 | QString getPackageName(); | 51 | // QString getPackageName(); |
50 | void toggleProcess(); | 52 | void toggleProcess(); |
51 | 53 | ||
52 | private: | 54 | private: |
53 | PackageManagerSettings *settings; | 55 | PackageManagerSettings *settings; |
54 | QString _packageName; | 56 | // QString _packageName; |
55 | QString _name; | 57 | QString _name; |
58 | QString _fileName; | ||
56 | bool _toProcess; | 59 | bool _toProcess; |
57 | bool _link; | 60 | bool _link; |
58 | QString _status; | 61 | QString _status; |
59 | QString _size; | 62 | QString _size; |
60 | QString _section; | 63 | QString _section; |
61 | QString _subsection; | 64 | QString _subsection; |
62 | QString _shortDesc; | 65 | QString _shortDesc; |
63 | QString _desc; | 66 | QString _desc; |
64 | QString _dest; | 67 | QString _dest; |
68 | bool _useFileName; | ||
65 | void parsePackage( QStringList ); | 69 | void parsePackage( QStringList ); |
66 | void init(PackageManagerSettings *); | 70 | void init(PackageManagerSettings *); |
67 | }; | 71 | }; |
68 | 72 | ||
69 | 73 | ||
70 | #endif | 74 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 035ec81..b892b30 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp | |||
@@ -1,241 +1,192 @@ | |||
1 | #include "packagelist.h" | 1 | #include "packagelist.h" |
2 | 2 | ||
3 | #include <assert.h> | 3 | #include <assert.h> |
4 | #include <qfile.h> | 4 | #include <qfile.h> |
5 | #include <qfileinfo.h> | 5 | #include <qfileinfo.h> |
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | #include <qpe/config.h> | ||
8 | 7 | ||
9 | #include "debug.h" | 8 | #include "debug.h" |
10 | 9 | ||
11 | PackageList::PackageList() | 10 | PackageList::PackageList() |
12 | : packageIter( packageList ) | 11 | : packageIter( packageList ) |
13 | { | 12 | { |
14 | empty=true; | 13 | empty=true; |
15 | { | ||
16 | Config cfg( "oipkg", Config::User ); | ||
17 | cfg.setGroup( "Common" ); | ||
18 | statusDir = cfg.readEntry( "statusDir", "" ); | ||
19 | listsDir = cfg.readEntry( "listsDir", "" ); | ||
20 | if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) | ||
21 | { | ||
22 | statusDir="/usr/lib/ipkg/"; | ||
23 | listsDir="/usr/lib/ipkg/lists/"; | ||
24 | cfg.writeEntry( "statusDir", statusDir ); | ||
25 | cfg.writeEntry( "listsDir", listsDir ); | ||
26 | } | ||
27 | } | ||
28 | sections << "All"; | 14 | sections << "All"; |
29 | subSections.insert("All", new QStringList() ); | 15 | subSections.insert("All", new QStringList() ); |
30 | QStringList *ss = subSections["All"]; | 16 | QStringList *ss = subSections["All"]; |
31 | *ss << "All"; | 17 | *ss << "All"; |
32 | aktSection = "All"; | 18 | aktSection = "All"; |
33 | aktSubSection = "All"; | 19 | aktSubSection = "All"; |
34 | } | 20 | } |
35 | 21 | ||
36 | PackageList::PackageList( PackageManagerSettings* s) | 22 | PackageList::PackageList( PackageManagerSettings* s) |
37 | : packageIter( packageList ) | 23 | : packageIter( packageList ) |
38 | { | 24 | { |
39 | settings = s; | 25 | settings = s; |
40 | PackageList(); | 26 | PackageList(); |
41 | } | 27 | } |
42 | 28 | ||
43 | PackageList::~PackageList() | 29 | PackageList::~PackageList() |
44 | { | 30 | { |
45 | } | 31 | } |
46 | 32 | ||
47 | /** Inserts a package into the list */ | 33 | /** Inserts a package into the list */ |
48 | void PackageList::insertPackage( Package* pack ) | 34 | void PackageList::insertPackage( Package* pack ) |
49 | { | 35 | { |
50 | Package* p = packageList.find( pack->name() ); | 36 | Package* p = packageList.find( pack->name() ); |
51 | if ( p ) | 37 | if ( p ) |
52 | { | 38 | { |
53 | p->copyValues( pack ); | 39 | p->copyValues( pack ); |
54 | delete pack; | 40 | delete pack; |
55 | pack = p; | 41 | pack = p; |
56 | }else{ | 42 | }else{ |
57 | packageList.insert( pack->name(), pack ); | 43 | packageList.insert( pack->name(), pack ); |
58 | origPackageList.insert( pack->name(), pack ); | 44 | origPackageList.insert( pack->name(), pack ); |
59 | empty=false; | 45 | empty=false; |
60 | }; | 46 | }; |
61 | updateSections( pack ); | 47 | updateSections( pack ); |
62 | } | 48 | } |
63 | 49 | ||
64 | void PackageList::filterPackages( QString f ) | 50 | void PackageList::filterPackages( QString f ) |
65 | { | 51 | { |
66 | packageList.clear(); | 52 | packageList.clear(); |
67 | QDictIterator<Package> filterIter( origPackageList ); | 53 | QDictIterator<Package> filterIter( origPackageList ); |
68 | filterIter.toFirst(); | 54 | filterIter.toFirst(); |
69 | Package *pack= filterIter.current() ; | 55 | Package *pack= filterIter.current() ; |
70 | while ( pack ) | 56 | while ( pack ) |
71 | { | 57 | { |
72 | if ( | 58 | if ( |
73 | ((aktSection=="All")||(pack->section()==aktSection)) && | 59 | ((aktSection=="All")||(pack->section()==aktSection)) && |
74 | ((aktSubSection=="All")||(pack->subSection()==aktSubSection)) && | 60 | ((aktSubSection=="All")||(pack->subSection()==aktSubSection)) && |
75 | pack->name().contains( f ) | 61 | pack->name().contains( f ) |
76 | ) | 62 | ) |
77 | { | 63 | { |
78 | packageList.insert( pack->name(), pack ); | 64 | packageList.insert( pack->name(), pack ); |
79 | } | 65 | } |
80 | ++filterIter; | 66 | ++filterIter; |
81 | pack = filterIter.current(); | 67 | pack = filterIter.current(); |
82 | } | 68 | } |
83 | } | 69 | } |
84 | 70 | ||
85 | Package* PackageList::find( QString n ) | 71 | Package* PackageList::find( QString n ) |
86 | { | 72 | { |
87 | return packageList.find( n ); | 73 | return packageList.find( n ); |
88 | } | 74 | } |
89 | 75 | ||
90 | Package* PackageList::first() | 76 | Package* PackageList::first() |
91 | { | 77 | { |
92 | packageIter.toFirst(); | 78 | packageIter.toFirst(); |
93 | return packageIter.current(); | 79 | return packageIter.current(); |
94 | } | 80 | } |
95 | 81 | ||
96 | Package* PackageList::next() | 82 | Package* PackageList::next() |
97 | { | 83 | { |
98 | ++packageIter; | 84 | ++packageIter; |
99 | return packageIter.current(); | 85 | return packageIter.current(); |
100 | } | 86 | } |
101 | 87 | ||
102 | QStringList PackageList::getSections() | 88 | QStringList PackageList::getSections() |
103 | { | 89 | { |
104 | sections.sort(); | 90 | sections.sort(); |
105 | return sections; | 91 | return sections; |
106 | } | 92 | } |
107 | 93 | ||
108 | QStringList PackageList::getSubSections() | 94 | QStringList PackageList::getSubSections() |
109 | { | 95 | { |
110 | QStringList ss; | 96 | QStringList ss; |
111 | if ( !subSections[aktSection] ) return ss; | 97 | if ( !subSections[aktSection] ) return ss; |
112 | ss = *subSections[aktSection]; | 98 | ss = *subSections[aktSection]; |
113 | ss.sort(); | 99 | ss.sort(); |
114 | return ss; | 100 | return ss; |
115 | } | 101 | } |
116 | 102 | ||
117 | void PackageList::setSection( QString sec ) | 103 | void PackageList::setSection( QString sec ) |
118 | { | 104 | { |
119 | aktSection = sec; | 105 | aktSection = sec; |
120 | } | 106 | } |
121 | 107 | ||
122 | void PackageList::setSubSection( QString ssec ) | 108 | void PackageList::setSubSection( QString ssec ) |
123 | { | 109 | { |
124 | aktSubSection = ssec; | 110 | aktSubSection = ssec; |
125 | } | 111 | } |
126 | 112 | ||
127 | void PackageList::updateSections( Package* pack ) | 113 | void PackageList::updateSections( Package* pack ) |
128 | { | 114 | { |
129 | QString s = pack->section(); | 115 | QString s = pack->section(); |
130 | if ( s.isEmpty() || s == "") return; | 116 | if ( s.isEmpty() || s == "") return; |
131 | if ( sections.contains(s) ) return; | 117 | if ( sections.contains(s) ) return; |
132 | sections += s; | 118 | sections += s; |
133 | QString ss = pack->subSection(); | 119 | QString ss = pack->subSection(); |
134 | if ( ss.isEmpty() || ss == "" ) return; | 120 | if ( ss.isEmpty() || ss == "" ) return; |
135 | if ( !subSections[s] ) { | 121 | if ( !subSections[s] ) { |
136 | subSections.insert( s, new QStringList() ); | 122 | subSections.insert( s, new QStringList() ); |
137 | QStringList *subsecs = subSections[s]; | 123 | QStringList *subsecs = subSections[s]; |
138 | *subsecs += "All"; | 124 | *subsecs += "All"; |
139 | } | 125 | } |
140 | QStringList *subsecs = subSections[s]; | 126 | QStringList *subsecs = subSections[s]; |
141 | *subsecs += ss; | 127 | *subsecs += ss; |
142 | if ( !subSections["All"] ) subSections.insert( "All", new QStringList() ); | 128 | if ( !subSections["All"] ) subSections.insert( "All", new QStringList() ); |
143 | subsecs = subSections["All"]; | 129 | subsecs = subSections["All"]; |
144 | *subsecs += ss; | 130 | *subsecs += ss; |
145 | } | 131 | } |
146 | 132 | ||
147 | 133 | ||
148 | |||
149 | /** No descriptions */ | ||
150 | void PackageList::parseStatus() | ||
151 | { | ||
152 | QStringList dests = settings->getDestinationUrls(); | ||
153 | QStringList destnames = settings->getDestinationNames(); | ||
154 | QStringList::Iterator name = destnames.begin(); | ||
155 | for ( QStringList::Iterator dir = dests.begin(); dir != dests.end(); ++dir ) | ||
156 | { | ||
157 | pvDebug( 2,"Status: "+*dir+statusDir+"/status"); | ||
158 | readFileEntries( *dir+statusDir+"/status", *name ); | ||
159 | ++name; | ||
160 | }; | ||
161 | } | ||
162 | |||
163 | void PackageList::parseList() | ||
164 | { | ||
165 | QStringList srvs = settings->getActiveServers(); | ||
166 | |||
167 | for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) | ||
168 | { | ||
169 | pvDebug( 2, "List: "+listsDir+"/"+*it); | ||
170 | readFileEntries( listsDir+"/"+*it, "" ); | ||
171 | } | ||
172 | } | ||
173 | |||
174 | void PackageList::readFileEntries( QString filename, QString dest ) | 134 | void PackageList::readFileEntries( QString filename, QString dest ) |
175 | { | 135 | { |
136 | pvDebug(5,"PackageList::readFileEntries "+filename+" dest "+dest); | ||
176 | QStringList packEntry; | 137 | QStringList packEntry; |
177 | QFile f( filename ); | 138 | QFile f( filename ); |
178 | if ( !f.open(IO_ReadOnly) ) return; | 139 | if ( !f.open(IO_ReadOnly) ) return; |
179 | QTextStream *statusStream = new QTextStream( &f ); | 140 | QTextStream *statusStream = new QTextStream( &f ); |
180 | while ( !statusStream ->eof() ) | 141 | while ( !statusStream ->eof() ) |
181 | { | 142 | { |
182 | QString line = statusStream->readLine(); | 143 | QString line = statusStream->readLine(); |
183 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) | 144 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) |
184 | { | 145 | { |
185 | //end of package | 146 | //end of package |
186 | if ( ! packEntry.isEmpty() ) | 147 | if ( ! packEntry.isEmpty() ) |
187 | { | 148 | { |
188 | Package *p = new Package( packEntry, settings ); | 149 | Package *p = new Package( packEntry, settings ); |
189 | p->setDest( dest ); | 150 | p->setDest( dest ); |
190 | if ( p ) | 151 | if ( p ) |
191 | { | 152 | { |
192 | insertPackage( p ); | 153 | insertPackage( p ); |
193 | packEntry.clear(); | 154 | packEntry.clear(); |
194 | } | 155 | } |
195 | } | 156 | } |
196 | }else{ | 157 | }else{ |
197 | packEntry << line; | 158 | packEntry << line; |
198 | }; | 159 | }; |
199 | } | 160 | } |
200 | return; | 161 | return; |
201 | } | 162 | } |
202 | 163 | ||
203 | |||
204 | void PackageList::update() | ||
205 | { | ||
206 | pvDebug( 2, "parseStatus"); | ||
207 | parseStatus(); | ||
208 | pvDebug( 2, "parseList"); | ||
209 | parseList(); | ||
210 | pvDebug( 2, "finished parsing"); | ||
211 | } | ||
212 | |||
213 | void PackageList::setSettings( PackageManagerSettings *s ) | 164 | void PackageList::setSettings( PackageManagerSettings *s ) |
214 | { | 165 | { |
215 | settings = s; | 166 | settings = s; |
216 | } | 167 | } |
217 | 168 | ||
218 | Package* PackageList::getByName( QString n ) | 169 | Package* PackageList::getByName( QString n ) |
219 | { | 170 | { |
220 | origPackageList[n]; | 171 | origPackageList[n]; |
221 | } | 172 | } |
222 | 173 | ||
223 | void PackageList::clear() | 174 | void PackageList::clear() |
224 | { | 175 | { |
225 | origPackageList.clear(); | 176 | origPackageList.clear(); |
226 | packageList.clear(); | 177 | packageList.clear(); |
227 | } | 178 | } |
228 | 179 | ||
229 | void PackageList::allPackages() | 180 | void PackageList::allPackages() |
230 | { | 181 | { |
231 | packageList.clear(); | 182 | packageList.clear(); |
232 | QDictIterator<Package> filterIter( origPackageList ); | 183 | QDictIterator<Package> filterIter( origPackageList ); |
233 | filterIter.toFirst(); | 184 | filterIter.toFirst(); |
234 | Package *pack= filterIter.current() ; | 185 | Package *pack= filterIter.current() ; |
235 | while ( pack ) | 186 | while ( pack ) |
236 | { | 187 | { |
237 | packageList.insert( pack->name(), pack ); | 188 | packageList.insert( pack->name(), pack ); |
238 | ++filterIter; | 189 | ++filterIter; |
239 | pack = filterIter.current(); | 190 | pack = filterIter.current(); |
240 | } | 191 | } |
241 | } | 192 | } |
diff --git a/noncore/unsupported/oipkg/packagelist.h b/noncore/unsupported/oipkg/packagelist.h index 7c326ca..acea3b9 100644 --- a/noncore/unsupported/oipkg/packagelist.h +++ b/noncore/unsupported/oipkg/packagelist.h | |||
@@ -1,70 +1,58 @@ | |||
1 | #ifndef PACKAGELIST_H | 1 | #ifndef PACKAGELIST_H |
2 | #define PACKAGELIST_H | 2 | #define PACKAGELIST_H |
3 | 3 | ||
4 | #include <qdict.h> | 4 | #include <qdict.h> |
5 | #include "package.h" | 5 | #include "package.h" |
6 | #include "pksettings.h" | 6 | #include "pksettings.h" |
7 | #include "debug.h" | 7 | #include "debug.h" |
8 | 8 | ||
9 | #define HACK | ||
10 | #ifdef HACK | ||
11 | static QString listsDir="/usr/lib/ipkg/"; | ||
12 | static QString statusDir="/usr/lib/ipkg/"; | ||
13 | #endif | ||
14 | |||
15 | class PackageList //:QObject | 9 | class PackageList //:QObject |
16 | { | 10 | { |
17 | // Q_OBJECT | 11 | // Q_OBJECT |
18 | public: | 12 | public: |
19 | //static QString all = QObject::tr("All"); | 13 | //static QString all = QObject::tr("All"); |
20 | 14 | ||
21 | PackageList(); | 15 | PackageList(); |
22 | PackageList( PackageManagerSettings* ); | 16 | PackageList( PackageManagerSettings* ); |
23 | ~PackageList(); | 17 | virtual ~PackageList(); |
24 | void insertPackage( Package* ); | 18 | void insertPackage( Package* ); |
25 | Package* find( QString ); | 19 | Package* find( QString ); |
26 | Package* next(); | 20 | Package* next(); |
27 | Package* first(); | 21 | Package* first(); |
28 | 22 | ||
29 | QStringList getSections(); | 23 | QStringList getSections(); |
30 | QStringList getSubSections(); | 24 | QStringList getSubSections(); |
31 | void setSettings( PackageManagerSettings* ); | 25 | void setSettings( PackageManagerSettings* ); |
32 | void filterPackages( QString ); | 26 | void filterPackages( QString ); |
33 | Package* getByName( QString ); | 27 | Package* getByName( QString ); |
34 | void clear(); | 28 | void clear(); |
35 | void allPackages(); | 29 | void allPackages(); |
36 | 30 | ||
37 | public slots: | 31 | public slots: |
38 | void setSection(QString); | 32 | void setSection(QString); |
39 | void setSubSection(QString); | 33 | void setSubSection(QString); |
40 | void update(); | 34 | // virtual void update(); |
41 | 35 | ||
42 | private: | 36 | protected: |
43 | int currentPackage; | 37 | int currentPackage; |
44 | int packageCount; | 38 | int packageCount; |
45 | 39 | ||
46 | PackageManagerSettings *settings; | 40 | PackageManagerSettings *settings; |
47 | QDict<Package> packageList; | 41 | QDict<Package> packageList; |
48 | QDict<Package> origPackageList; | 42 | QDict<Package> origPackageList; |
49 | QDictIterator<Package> packageIter; | 43 | QDictIterator<Package> packageIter; |
50 | 44 | ||
51 | bool empty; | 45 | bool empty; |
52 | #ifndef HACK | ||
53 | QString listsDir; | ||
54 | QString statusDir; | ||
55 | #endif | ||
56 | QString aktSection; | 46 | QString aktSection; |
57 | QString aktSubSection; | 47 | QString aktSubSection; |
58 | QStringList sections; | 48 | QStringList sections; |
59 | QDict<QStringList> subSections; | 49 | QDict<QStringList> subSections; |
60 | QDict<bool> sectionsDict; | 50 | QDict<bool> sectionsDict; |
61 | 51 | ||
62 | 52 | ||
63 | void updateSections( Package* ); | 53 | void updateSections( Package* ); |
64 | void parseStatus(); | 54 | void readFileEntries( QString file, QString dest="" ); |
65 | void parseList(); | ||
66 | void readFileEntries( QString file, QString dest ); | ||
67 | }; | 55 | }; |
68 | 56 | ||
69 | 57 | ||
70 | #endif | 58 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 0c7c928..b7af9a6 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -1,122 +1,133 @@ | |||
1 | #include "packagelistitem.h" | 1 | #include "packagelistitem.h" |
2 | 2 | ||
3 | #include <qpe/resource.h> | 3 | #include <qpe/resource.h> |
4 | #include <qobject.h> | 4 | #include <qobject.h> |
5 | 5 | ||
6 | #include "debug.h" | 6 | #include "debug.h" |
7 | 7 | ||
8 | static QPixmap *pm_uninstalled=0; | 8 | static QPixmap *pm_uninstalled=0; |
9 | static QPixmap *pm_installed=0; | 9 | static QPixmap *pm_installed=0; |
10 | static QPixmap *pm_uninstall=0; | 10 | static QPixmap *pm_uninstall=0; |
11 | static QPixmap *pm_install=0; | 11 | static QPixmap *pm_install=0; |
12 | 12 | ||
13 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) | 13 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) |
14 | :QCheckListItem(lv,pi->name(),CheckBox) | 14 | :QCheckListItem(lv,pi->name(),CheckBox) |
15 | { | 15 | { |
16 | init(pi,s); | ||
17 | } | ||
18 | |||
19 | PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManagerSettings *s) | ||
20 | :QCheckListItem(lvi,pi->name(),CheckBox) | ||
21 | { | ||
22 | init(pi,s); | ||
23 | } | ||
24 | |||
25 | void PackageListItem::init( Package *pi, PackageManagerSettings *s) | ||
26 | { | ||
16 | package = pi; | 27 | package = pi; |
17 | settings = s; | 28 | settings = s; |
18 | setExpandable( true ); | 29 | setExpandable( true ); |
19 | QCheckListItem *item; | 30 | QCheckListItem *item; |
20 | nameItem = new QCheckListItem( this, "" ); | 31 | nameItem = new QCheckListItem( this, "" ); |
21 | item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); | 32 | item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); |
22 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); | 33 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); |
23 | destItem = new QCheckListItem( this, "" ); | 34 | destItem = new QCheckListItem( this, "" ); |
24 | linkItem = new QCheckListItem( this, "" ); | 35 | linkItem = new QCheckListItem( this, "" ); |
25 | displayDetails(); | 36 | displayDetails(); |
26 | 37 | ||
27 | if (!pm_uninstalled) | 38 | if (!pm_uninstalled) |
28 | { | 39 | { |
29 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); | 40 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); |
30 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); | 41 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); |
31 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); | 42 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); |
32 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); | 43 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); |
33 | } | 44 | } |
34 | } | 45 | } |
35 | 46 | ||
36 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, | 47 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, |
37 | int column, int width, int alignment ) | 48 | int column, int width, int alignment ) |
38 | { | 49 | { |
39 | if ( !p ) | 50 | if ( !p ) |
40 | return; | 51 | return; |
41 | 52 | ||
42 | p->fillRect( 0, 0, width, height(), | 53 | p->fillRect( 0, 0, width, height(), |
43 | isSelected()? cg.highlight() : cg.base() ); | 54 | isSelected()? cg.highlight() : cg.base() ); |
44 | 55 | ||
45 | if ( column != 0 ) { | 56 | if ( column != 0 ) { |
46 | // The rest is text | 57 | // The rest is text |
47 | QListViewItem::paintCell( p, cg, column, width, alignment ); | 58 | QListViewItem::paintCell( p, cg, column, width, alignment ); |
48 | return; | 59 | return; |
49 | } | 60 | } |
50 | 61 | ||
51 | QListView *lv = listView(); | 62 | QListView *lv = listView(); |
52 | if ( !lv ) | 63 | if ( !lv ) |
53 | return; | 64 | return; |
54 | int marg = lv->itemMargin(); | 65 | int marg = lv->itemMargin(); |
55 | int r = marg; | 66 | int r = marg; |
56 | 67 | ||
57 | QPixmap pm = statePixmap(); | 68 | QPixmap pm = statePixmap(); |
58 | p->drawPixmap(marg,(height()-pm.height())/2,pm); | 69 | p->drawPixmap(marg,(height()-pm.height())/2,pm); |
59 | r += pm.width()+1; | 70 | r += pm.width()+1; |
60 | 71 | ||
61 | p->translate( r, 0 ); | 72 | p->translate( r, 0 ); |
62 | QListViewItem::paintCell( p, cg, column, width - r, alignment ); | 73 | QListViewItem::paintCell( p, cg, column, width - r, alignment ); |
63 | } | 74 | } |
64 | 75 | ||
65 | 76 | ||
66 | void PackageListItem::paintFocus( QPainter *p, const QColorGroup & cg, | 77 | void PackageListItem::paintFocus( QPainter *p, const QColorGroup & cg, |
67 | const QRect & r ) | 78 | const QRect & r ) |
68 | { | 79 | { |
69 | // Skip QCheckListItem | 80 | // Skip QCheckListItem |
70 | // (makes you wonder what we're getting from QCheckListItem) | 81 | // (makes you wonder what we're getting from QCheckListItem) |
71 | QListViewItem::paintFocus(p,cg,r); | 82 | QListViewItem::paintFocus(p,cg,r); |
72 | } | 83 | } |
73 | 84 | ||
74 | QPixmap PackageListItem::statePixmap() const | 85 | QPixmap PackageListItem::statePixmap() const |
75 | { | 86 | { |
76 | bool installed = package->installed(); | 87 | bool installed = package->installed(); |
77 | if ( !package->toProcess() ) { | 88 | if ( !package->toProcess() ) { |
78 | if ( !installed ) | 89 | if ( !installed ) |
79 | return *pm_uninstalled; | 90 | return *pm_uninstalled; |
80 | else | 91 | else |
81 | return *pm_installed; | 92 | return *pm_installed; |
82 | } else { | 93 | } else { |
83 | if ( !installed ) | 94 | if ( !installed ) |
84 | return *pm_install; | 95 | return *pm_install; |
85 | else | 96 | else |
86 | return *pm_uninstall; | 97 | return *pm_uninstall; |
87 | } | 98 | } |
88 | } | 99 | } |
89 | 100 | ||
90 | QString PackageListItem::key( int column, bool ascending ) const | 101 | QString PackageListItem::key( int column, bool ascending ) const |
91 | { | 102 | { |
92 | if ( column == 2 ) { | 103 | if ( column == 2 ) { |
93 | QString t = text(2); | 104 | QString t = text(2); |
94 | double bytes=t.toDouble(); | 105 | double bytes=t.toDouble(); |
95 | if ( t.contains('M') ) bytes*=1024*1024; | 106 | if ( t.contains('M') ) bytes*=1024*1024; |
96 | else if ( t.contains('K') || t.contains('k') ) bytes*=1024; | 107 | else if ( t.contains('K') || t.contains('k') ) bytes*=1024; |
97 | if ( !ascending ) bytes=999999999-bytes; | 108 | if ( !ascending ) bytes=999999999-bytes; |
98 | return QString().sprintf("%09d",(int)bytes); | 109 | return QString().sprintf("%09d",(int)bytes); |
99 | } else { | 110 | } else { |
100 | return QListViewItem::key(column,ascending); | 111 | return QListViewItem::key(column,ascending); |
101 | } | 112 | } |
102 | } | 113 | } |
103 | 114 | ||
104 | void PackageListItem::setOn( bool b ) | 115 | void PackageListItem::setOn( bool b ) |
105 | { | 116 | { |
106 | QCheckListItem::setOn( b ); | 117 | QCheckListItem::setOn( b ); |
107 | package->toggleProcess(); | 118 | package->toggleProcess(); |
108 | package->setLink( settings->createLinks() ); | 119 | package->setLink( settings->createLinks() ); |
109 | displayDetails(); | 120 | displayDetails(); |
110 | } | 121 | } |
111 | 122 | ||
112 | void PackageListItem::displayDetails() | 123 | void PackageListItem::displayDetails() |
113 | { | 124 | { |
114 | QString sod = " ("+package->sizeUnits(); | 125 | QString sod = " ("+package->sizeUnits(); |
115 | sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); | 126 | sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); |
116 | sod += ")"; | 127 | sod += ")"; |
117 | setText(0, package->name()+sod ); | 128 | setText(0, package->name()+sod ); |
118 | nameItem->setText( 0, QObject::tr("Name: ")+package->name()); | 129 | nameItem->setText( 0, QObject::tr("Name: ")+package->name()); |
119 | linkItem->setText( 0, QObject::tr("Link: ")+QString(package->link()?QObject::tr("Yes"):QObject::tr("No")) ); | 130 | linkItem->setText( 0, QObject::tr("Link: ")+QString(package->link()?QObject::tr("Yes"):QObject::tr("No")) ); |
120 | destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); | 131 | destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); |
121 | repaint(); | 132 | repaint(); |
122 | } | 133 | } |
diff --git a/noncore/unsupported/oipkg/packagelistitem.h b/noncore/unsupported/oipkg/packagelistitem.h index 54d9f9e..b128f0d 100644 --- a/noncore/unsupported/oipkg/packagelistitem.h +++ b/noncore/unsupported/oipkg/packagelistitem.h | |||
@@ -1,38 +1,40 @@ | |||
1 | #ifndef PK_LISTITEM_H | 1 | #ifndef PK_LISTITEM_H |
2 | #define PK_LISTITEM_H | 2 | #define PK_LISTITEM_H |
3 | 3 | ||
4 | #include "package.h" | 4 | #include "package.h" |
5 | 5 | ||
6 | #include <qstring.h> | 6 | #include <qstring.h> |
7 | #include <qlistview.h> | 7 | #include <qlistview.h> |
8 | #include <qpainter.h> | 8 | #include <qpainter.h> |
9 | #include <qpixmap.h> | 9 | #include <qpixmap.h> |
10 | #include <qdict.h> | 10 | #include <qdict.h> |
11 | 11 | ||
12 | #include "pksettings.h" | 12 | #include "pksettings.h" |
13 | 13 | ||
14 | class PackageListItem | 14 | class PackageListItem |
15 | : public QCheckListItem | 15 | : public QCheckListItem |
16 | { | 16 | { |
17 | public: | 17 | public: |
18 | PackageListItem(QListViewItem*, Package*, PackageManagerSettings*); | ||
18 | PackageListItem(QListView*, Package*, PackageManagerSettings*); | 19 | PackageListItem(QListView*, Package*, PackageManagerSettings*); |
19 | void paintCell( QPainter*, const QColorGroup&, int, int, int ); | 20 | void paintCell( QPainter*, const QColorGroup&, int, int, int ); |
20 | void paintFocus( QPainter*, const QColorGroup&, const QRect& ); | 21 | void paintFocus( QPainter*, const QColorGroup&, const QRect& ); |
21 | QPixmap statePixmap() const; | 22 | QPixmap statePixmap() const; |
22 | QString key( int, bool ) const; | 23 | QString key( int, bool ) const; |
23 | Package* getPackage() { return package; } ; | 24 | Package* getPackage() { return package; } ; |
24 | QString getName() { return package->name(); } ; | 25 | QString getName() { return package->name(); } ; |
25 | bool isInstalled(){ return package->installed(); }; | 26 | bool isInstalled(){ return package->installed(); }; |
26 | virtual void setOn ( bool ); | 27 | virtual void setOn ( bool ); |
27 | void displayDetails(); | 28 | void displayDetails(); |
28 | 29 | ||
29 | private: | 30 | private: |
31 | void init(Package*, PackageManagerSettings*); | ||
30 | QCheckListItem *nameItem; | 32 | QCheckListItem *nameItem; |
31 | QCheckListItem *destItem; | 33 | QCheckListItem *destItem; |
32 | QCheckListItem *linkItem; | 34 | QCheckListItem *linkItem; |
33 | PackageManagerSettings *settings; | 35 | PackageManagerSettings *settings; |
34 | Package *package; | 36 | Package *package; |
35 | }; | 37 | }; |
36 | 38 | ||
37 | 39 | ||
38 | #endif | 40 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistlocal.cpp b/noncore/unsupported/oipkg/packagelistlocal.cpp new file mode 100644 index 0000000..6d931c8 --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistlocal.cpp | |||
@@ -0,0 +1,66 @@ | |||
1 | #include <qpe/config.h> | ||
2 | #include <qfile.h> | ||
3 | #include <qfileinfo.h> | ||
4 | #include <qtextstream.h> | ||
5 | #include <qstringlist.h> | ||
6 | #include "packagelistlocal.h" | ||
7 | |||
8 | PackageListLocal::PackageListLocal() | ||
9 | : PackageList() | ||
10 | { | ||
11 | Config cfg( "oipkg", Config::User ); | ||
12 | cfg.setGroup( "Common" ); | ||
13 | statusDir = cfg.readEntry( "statusDir", "" ); | ||
14 | listsDir = cfg.readEntry( "listsDir", "" ); | ||
15 | if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) | ||
16 | { | ||
17 | statusDir="/usr/lib/ipkg/"; | ||
18 | listsDir="/usr/lib/ipkg/lists/"; | ||
19 | cfg.writeEntry( "statusDir", statusDir ); | ||
20 | cfg.writeEntry( "listsDir", listsDir ); | ||
21 | } | ||
22 | } | ||
23 | |||
24 | PackageListLocal::PackageListLocal(PackageManagerSettings* s) | ||
25 | : PackageList(s) | ||
26 | { | ||
27 | PackageListLocal(); | ||
28 | } | ||
29 | |||
30 | PackageListLocal::~PackageListLocal() | ||
31 | { | ||
32 | } | ||
33 | |||
34 | void PackageListLocal::parseStatus() | ||
35 | { | ||
36 | QStringList dests = settings->getDestinationUrls(); | ||
37 | QStringList destnames = settings->getDestinationNames(); | ||
38 | QStringList::Iterator name = destnames.begin(); | ||
39 | for ( QStringList::Iterator dir = dests.begin(); dir != dests.end(); ++dir ) | ||
40 | { | ||
41 | pvDebug( 2,"Status: "+*dir+statusDir+"/status"); | ||
42 | readFileEntries( *dir+statusDir+"/status", *name ); | ||
43 | ++name; | ||
44 | }; | ||
45 | } | ||
46 | |||
47 | void PackageListLocal::parseList() | ||
48 | { | ||
49 | QStringList srvs = settings->getActiveServers(); | ||
50 | |||
51 | for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) | ||
52 | { | ||
53 | pvDebug( 2, "List: "+listsDir+"/"+*it); | ||
54 | readFileEntries( listsDir+"/"+*it ); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | |||
59 | void PackageListLocal::update() | ||
60 | { | ||
61 | pvDebug( 2, "parseStatus"); | ||
62 | parseStatus(); | ||
63 | pvDebug( 2, "parseList"); | ||
64 | parseList(); | ||
65 | pvDebug( 2, "finished parsing"); | ||
66 | } | ||
diff --git a/noncore/unsupported/oipkg/packagelistlocal.h b/noncore/unsupported/oipkg/packagelistlocal.h new file mode 100644 index 0000000..887126b --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistlocal.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef PACKAGELISTLOCAL_H | ||
2 | #define PACKAGELISTLOCAL_H | ||
3 | |||
4 | #include "packagelist.h" | ||
5 | |||
6 | |||
7 | #define HACK | ||
8 | #ifdef HACK | ||
9 | static QString listsDir="/usr/lib/ipkg/"; | ||
10 | static QString statusDir="/usr/lib/ipkg/"; | ||
11 | #endif | ||
12 | |||
13 | class PackageListLocal : public PackageList { | ||
14 | public: | ||
15 | PackageListLocal(); | ||
16 | PackageListLocal( PackageManagerSettings* ); | ||
17 | virtual ~PackageListLocal(); | ||
18 | |||
19 | public slots: | ||
20 | void update(); | ||
21 | private: | ||
22 | #ifndef HACK | ||
23 | QString listsDir; | ||
24 | QString statusDir; | ||
25 | #endif | ||
26 | void parseStatus(); | ||
27 | void parseList(); | ||
28 | }; | ||
29 | |||
30 | #endif | ||
diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp new file mode 100644 index 0000000..721d4a6 --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistremote.cpp | |||
@@ -0,0 +1,47 @@ | |||
1 | |||
2 | #include "packagelistremote.h" | ||
3 | |||
4 | #include <qstring.h> | ||
5 | #include <stdlib.h> | ||
6 | #include <unistd.h> | ||
7 | |||
8 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) | ||
9 | : PackageList(s) | ||
10 | { | ||
11 | PackageListRemote(); | ||
12 | } | ||
13 | |||
14 | PackageListRemote::PackageListRemote() | ||
15 | : PackageList() | ||
16 | { | ||
17 | } | ||
18 | |||
19 | PackageListRemote::~PackageListRemote() | ||
20 | { | ||
21 | } | ||
22 | |||
23 | void PackageListRemote::query(QString s) | ||
24 | { | ||
25 | int r=0; | ||
26 | QString cmd = "wget"; | ||
27 | QString redirect = "/tmp/oipkg.query"; | ||
28 | |||
29 | // use file for output | ||
30 | cmd += " --output-document="+redirect; | ||
31 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= | ||
32 | QString server="http://ipkgfind.handhelds.org/"; | ||
33 | cmd += " \""+server+"/packages.phtml"; | ||
34 | cmd += "?format=pda&searchtype=package§ion="; | ||
35 | cmd += "&query="+s; | ||
36 | cmd += "\""; | ||
37 | |||
38 | pvDebug(2,"search :"+cmd); | ||
39 | r = system(cmd.latin1()); | ||
40 | readFileEntries( redirect ); | ||
41 | |||
42 | } | ||
43 | |||
44 | void PackageListRemote::update() | ||
45 | { | ||
46 | pvDebug(2,"PackageListRemote::update\ndoing nothing "); | ||
47 | } | ||
diff --git a/noncore/unsupported/oipkg/packagelistremote.h b/noncore/unsupported/oipkg/packagelistremote.h new file mode 100644 index 0000000..147da1e --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistremote.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef PACKAGELISTREMOTE_H | ||
2 | #define PACKAGELISTREMOTE_H | ||
3 | |||
4 | #include "packagelist.h" | ||
5 | #include "package.h" | ||
6 | #include "pksettings.h" | ||
7 | #include "debug.h" | ||
8 | |||
9 | class PackageListRemote : public PackageList { | ||
10 | public: | ||
11 | PackageListRemote(); | ||
12 | PackageListRemote( PackageManagerSettings* s); | ||
13 | virtual ~PackageListRemote(); | ||
14 | void query(QString); | ||
15 | public slots: | ||
16 | void update(); | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp index 2915ac6..610a0e1 100644 --- a/noncore/unsupported/oipkg/packagelistview.cpp +++ b/noncore/unsupported/oipkg/packagelistview.cpp | |||
@@ -1,107 +1,90 @@ | |||
1 | /*************************************************************************** | ||
2 | packagelistview.cpp - description | ||
3 | ------------------- | ||
4 | begin : Sat Apr 27 2002 | ||
5 | copyright : (C) 2002 by tille | ||
6 | email : tille@handhelds.org | ||
7 | ***************************************************************************/ | ||
8 | |||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | |||
18 | #include "packagelistview.h" | 1 | #include "packagelistview.h" |
19 | 2 | ||
20 | #include <qpopupmenu.h> | 3 | #include <qpopupmenu.h> |
21 | #include <qaction.h> | 4 | #include <qaction.h> |
22 | 5 | ||
23 | #include "packagelistitem.h" | 6 | #include "packagelistitem.h" |
24 | #include "pksettings.h" | 7 | #include "pksettings.h" |
25 | 8 | ||
26 | PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s) | 9 | PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s) |
27 | : QListView(p,n) | 10 | : QListView(p,n) |
28 | { | 11 | { |
29 | settings = s; | 12 | settings = s; |
30 | popupMenu = new QPopupMenu( this ); | 13 | popupMenu = new QPopupMenu( this ); |
31 | destsMenu = new QPopupMenu( popupMenu ); | 14 | destsMenu = new QPopupMenu( popupMenu ); |
32 | popupTimer = new QTimer( this ); | 15 | popupTimer = new QTimer( this ); |
33 | setSelectionMode(QListView::NoSelection); | 16 | setSelectionMode(QListView::NoSelection); |
34 | addColumn( tr("Package") ); | 17 | addColumn( tr("Package") ); |
35 | setRootIsDecorated( true ); | 18 | setRootIsDecorated( true ); |
36 | 19 | ||
37 | connect( popupTimer, SIGNAL(timeout()), | 20 | connect( popupTimer, SIGNAL(timeout()), |
38 | this, SLOT(showPopup()) ); | 21 | this, SLOT(showPopup()) ); |
39 | connect( this, SIGNAL( pressed( QListViewItem* ) ), | 22 | connect( this, SIGNAL( pressed( QListViewItem* ) ), |
40 | this, SLOT( setCurrent( QListViewItem* ) ) ); | 23 | this, SLOT( setCurrent( QListViewItem* ) ) ); |
41 | connect( this, SIGNAL( clicked( QListViewItem* ) ), | 24 | connect( this, SIGNAL( clicked( QListViewItem* ) ), |
42 | this, SLOT( stopTimer( QListViewItem* ) ) ); | 25 | this, SLOT( stopTimer( QListViewItem* ) ) ); |
43 | 26 | ||
44 | } | 27 | } |
45 | 28 | ||
46 | //PackageListView::~PackageListView() | 29 | //PackageListView::~PackageListView() |
47 | //{ | 30 | //{ |
48 | //} | 31 | //} |
49 | 32 | ||
50 | void PackageListView::setCurrent( QListViewItem* p ) | 33 | void PackageListView::setCurrent( QListViewItem* p ) |
51 | { | 34 | { |
52 | if ( !p ) return; | 35 | if ( !p ) return; |
53 | activePackageListItem = (PackageListItem*)p; | 36 | activePackageListItem = (PackageListItem*)p; |
54 | activePackage = activePackageListItem->getPackage(); | 37 | activePackage = activePackageListItem->getPackage(); |
55 | if (!activePackage) return; | 38 | if (!activePackage) return; |
56 | popupTimer->start( 750, true ); | 39 | popupTimer->start( 750, true ); |
57 | } | 40 | } |
58 | 41 | ||
59 | 42 | ||
60 | void PackageListView::showPopup() | 43 | void PackageListView::showPopup() |
61 | { | 44 | { |
62 | popupMenu->clear(); | 45 | popupMenu->clear(); |
63 | destsMenu->clear(); | 46 | destsMenu->clear(); |
64 | 47 | ||
65 | QAction *popupAction; | 48 | QAction *popupAction; |
66 | if ( !activePackage->installed() ) | 49 | if ( !activePackage->installed() ) |
67 | { | 50 | { |
68 | popupMenu->insertItem( QObject::tr("Install to"), destsMenu ); | 51 | popupMenu->insertItem( QObject::tr("Install to"), destsMenu ); |
69 | QStringList dests = settings->getDestinationNames(); | 52 | QStringList dests = settings->getDestinationNames(); |
70 | QString ad = settings->getDestinationName(); | 53 | QString ad = settings->getDestinationName(); |
71 | for (uint i = 0; i < dests.count(); i++ ) | 54 | for (uint i = 0; i < dests.count(); i++ ) |
72 | { | 55 | { |
73 | popupAction = new QAction( dests[i], QString::null, 0, this, 0 ); | 56 | popupAction = new QAction( dests[i], QString::null, 0, this, 0 ); |
74 | popupAction->addTo( destsMenu ); | 57 | popupAction->addTo( destsMenu ); |
75 | if ( dests[i] == ad && activePackage->toInstall() ) | 58 | if ( dests[i] == ad && activePackage->toInstall() ) |
76 | { | 59 | { |
77 | popupAction->setToggleAction( true ); | 60 | popupAction->setToggleAction( true ); |
78 | popupAction->setOn(true); | 61 | popupAction->setOn(true); |
79 | }; | 62 | }; |
80 | } | 63 | } |
81 | connect( destsMenu, SIGNAL( activated( int ) ), | 64 | connect( destsMenu, SIGNAL( activated( int ) ), |
82 | this, SLOT( changePackageDest( int ) ) ); | 65 | this, SLOT( changePackageDest( int ) ) ); |
83 | }else{ | 66 | }else{ |
84 | // popupActcat setOn( activePackage->toProcess() ); | 67 | // popupActcat setOn( activePackage->toProcess() ); |
85 | } | 68 | } |
86 | popupMenu->popup( QCursor::pos() ); | 69 | popupMenu->popup( QCursor::pos() ); |
87 | } | 70 | } |
88 | 71 | ||
89 | void PackageListView::stopTimer( QListViewItem* ) | 72 | void PackageListView::stopTimer( QListViewItem* ) |
90 | { | 73 | { |
91 | popupTimer->stop(); | 74 | popupTimer->stop(); |
92 | } | 75 | } |
93 | 76 | ||
94 | 77 | ||
95 | void PackageListView::changePackageDest( int i ) | 78 | void PackageListView::changePackageDest( int i ) |
96 | { | 79 | { |
97 | activePackage->setDest( destsMenu->text(i) ); | 80 | activePackage->setDest( destsMenu->text(i) ); |
98 | activePackage->setOn(); | 81 | activePackage->setOn(); |
99 | activePackage->setLink( settings->createLinks() ); | 82 | activePackage->setLink( settings->createLinks() ); |
100 | activePackageListItem->displayDetails(); | 83 | activePackageListItem->displayDetails(); |
101 | } | 84 | } |
102 | 85 | ||
103 | void PackageListView::toggleProcess() | 86 | void PackageListView::toggleProcess() |
104 | { | 87 | { |
105 | activePackage->toggleProcess() ; | 88 | activePackage->toggleProcess() ; |
106 | activePackageListItem->displayDetails(); | 89 | activePackageListItem->displayDetails(); |
107 | } | 90 | } |
diff --git a/noncore/unsupported/oipkg/packagelistview.h b/noncore/unsupported/oipkg/packagelistview.h index a3db0d0..d371a34 100644 --- a/noncore/unsupported/oipkg/packagelistview.h +++ b/noncore/unsupported/oipkg/packagelistview.h | |||
@@ -1,55 +1,54 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | packagelistview.h - description | 2 | packagelistview.h - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Sat Apr 27 2002 | 4 | begin : Sat Apr 27 2002 |
5 | copyright : (C) 2002 by tille | 5 | copyright : (C) 2002 by tille |
6 | email : tille@handhelds.org | 6 | email : tille@handhelds.org |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #ifndef PACKAGELISTVIEW_H | 18 | #ifndef PACKAGELISTVIEW_H |
19 | #define PACKAGELISTVIEW_H | 19 | #define PACKAGELISTVIEW_H |
20 | 20 | ||
21 | #include <qlistview.h> | 21 | #include <qlistview.h> |
22 | #include <qaction.h> | 22 | #include <qaction.h> |
23 | #include <qtimer.h> | 23 | #include <qtimer.h> |
24 | #include <qwidget.h> | 24 | #include <qwidget.h> |
25 | #include <qpopupmenu.h> | 25 | #include <qpopupmenu.h> |
26 | #include "debug.h" | 26 | #include "debug.h" |
27 | 27 | ||
28 | class PackageListItem; | 28 | class PackageListItem; |
29 | class Package; | 29 | class Package; |
30 | class PackageManagerSettings; | 30 | class PackageManagerSettings; |
31 | 31 | ||
32 | class PackageListView : public QListView | 32 | class PackageListView : public QListView |
33 | { | 33 | { |
34 | Q_OBJECT | 34 | Q_OBJECT |
35 | 35 | ||
36 | public: | 36 | public: |
37 | PackageListView(QWidget*, const char*, PackageManagerSettings*); | 37 | PackageListView(QWidget*, const char*, PackageManagerSettings*); |
38 | //~PackageListView(); | 38 | //~PackageListView(); |
39 | QTimer *popupTimer; | 39 | QTimer *popupTimer; |
40 | private: | 40 | private: |
41 | PackageManagerSettings *settings; | 41 | PackageManagerSettings *settings; |
42 | Package *activePackage; | 42 | Package *activePackage; |
43 | PackageListItem *activePackageListItem; | 43 | PackageListItem *activePackageListItem; |
44 | QPopupMenu *popupMenu; | 44 | QPopupMenu *popupMenu; |
45 | QPopupMenu *destsMenu; | 45 | QPopupMenu *destsMenu; |
46 | public slots: | 46 | public slots: |
47 | void showPopup(); | 47 | void showPopup(); |
48 | void changePackageDest( int ); | 48 | void changePackageDest( int ); |
49 | void setCurrent( QListViewItem* ); | 49 | void setCurrent( QListViewItem* ); |
50 | void stopTimer( QListViewItem* ); | 50 | void stopTimer( QListViewItem* ); |
51 | /** No descriptions */ | ||
52 | void toggleProcess(); | 51 | void toggleProcess(); |
53 | }; | 52 | }; |
54 | 53 | ||
55 | #endif | 54 | #endif |
diff --git a/noncore/unsupported/oipkg/pkfind.ui b/noncore/unsupported/oipkg/pkfind.ui deleted file mode 100644 index 7a24c00..0000000 --- a/noncore/unsupported/oipkg/pkfind.ui +++ b/dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>Search</class> | ||
3 | <widget> | ||
4 | <class>QDialog</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>Form5</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>196</width> | ||
15 | <height>55</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Search Packages</string> | ||
21 | </property> | ||
22 | <hbox> | ||
23 | <property stdset="1"> | ||
24 | <name>margin</name> | ||
25 | <number>11</number> | ||
26 | </property> | ||
27 | <property stdset="1"> | ||
28 | <name>spacing</name> | ||
29 | <number>6</number> | ||
30 | </property> | ||
31 | <widget> | ||
32 | <class>QLabel</class> | ||
33 | <property stdset="1"> | ||
34 | <name>name</name> | ||
35 | <cstring>TextLabel4</cstring> | ||
36 | </property> | ||
37 | <property stdset="1"> | ||
38 | <name>text</name> | ||
39 | <string>Find:</string> | ||
40 | </property> | ||
41 | </widget> | ||
42 | <widget> | ||
43 | <class>QLineEdit</class> | ||
44 | <property stdset="1"> | ||
45 | <name>name</name> | ||
46 | <cstring>pattern</cstring> | ||
47 | </property> | ||
48 | </widget> | ||
49 | </hbox> | ||
50 | </widget> | ||
51 | </UI> | ||
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index 6c8dc2a..7e2ef10 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -1,542 +1,564 @@ | |||
1 | #include "pksettings.h" | 1 | #include "pksettings.h" |
2 | 2 | ||
3 | #include <qpe/process.h> | 3 | #include <qpe/process.h> |
4 | #include <qpe/resource.h> | 4 | #include <qpe/resource.h> |
5 | #include <qpe/stringutil.h> | 5 | #include <qpe/stringutil.h> |
6 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | #include <qpe/qcopenvelope_qws.h> | 7 | #include <qpe/qcopenvelope_qws.h> |
8 | #include <qpe/applnk.h> | 8 | #include <qpe/applnk.h> |
9 | #include <qpe/config.h> | 9 | #include <qpe/config.h> |
10 | 10 | ||
11 | #include <qprogressbar.h> | 11 | #include <qprogressbar.h> |
12 | #include <qcombobox.h> | 12 | #include <qcombobox.h> |
13 | #include <qdict.h> | 13 | #include <qdict.h> |
14 | #include <qfile.h> | 14 | #include <qfile.h> |
15 | #include <qlineedit.h> | 15 | #include <qlineedit.h> |
16 | #include <qpushbutton.h> | 16 | #include <qpushbutton.h> |
17 | #include <qlistview.h> | 17 | #include <qlistview.h> |
18 | #include <qlistbox.h> | 18 | #include <qlistbox.h> |
19 | #include <qcheckbox.h> | 19 | #include <qcheckbox.h> |
20 | #include <qmessagebox.h> | 20 | #include <qmessagebox.h> |
21 | #include <qpainter.h> | 21 | #include <qpainter.h> |
22 | #include <qpixmap.h> | 22 | #include <qpixmap.h> |
23 | #include <qregexp.h> | 23 | #include <qregexp.h> |
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qobject.h> | 25 | #include <qobject.h> |
26 | #include <qtextstream.h> | 26 | #include <qtextstream.h> |
27 | #include <qtextview.h> | 27 | #include <qtextview.h> |
28 | #include <qtoolbutton.h> | 28 | #include <qtoolbutton.h> |
29 | #include <qtabwidget.h> | 29 | #include <qtabwidget.h> |
30 | 30 | ||
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | #include "debug.h" | 33 | #include "debug.h" |
34 | //#include "utils.h" | 34 | //#include "utils.h" |
35 | 35 | ||
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 | } | 61 | } |
62 | 62 | ||
63 | PackageManagerSettings::~PackageManagerSettings() | 63 | PackageManagerSettings::~PackageManagerSettings() |
64 | { | 64 | { |
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | void PackageManagerSettings::newServer() | 68 | void PackageManagerSettings::newServer() |
69 | { | 69 | { |
70 | int i = servers->count(); | 70 | int i = servers->count(); |
71 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { | 71 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { |
72 | serverurlDic.insert(i,new QString("http://")); | 72 | serverurlDic.insert(i,new QString("http://")); |
73 | servers->insertItem(tr("New")); | 73 | servers->insertItem(tr("New")); |
74 | activeServers->insertItem(tr("New")); | 74 | activeServers->insertItem(tr("New")); |
75 | } else { | 75 | } else { |
76 | // allows one-level undo | 76 | // allows one-level undo |
77 | serverurlDic.insert(i,new QString(serverurl->text())); | 77 | serverurlDic.insert(i,new QString(serverurl->text())); |
78 | servers->insertItem(servername->text()); | 78 | servers->insertItem(servername->text()); |
79 | activeServers->insertItem(servername->text()); | 79 | activeServers->insertItem(servername->text()); |
80 | } | 80 | } |
81 | changed = true; | 81 | changed = true; |
82 | servers->setSelected(i,TRUE); | 82 | servers->setSelected(i,TRUE); |
83 | editServer(i); | 83 | editServer(i); |
84 | changed = true; | 84 | changed = true; |
85 | } | 85 | } |
86 | 86 | ||
87 | void PackageManagerSettings::newDestination() | 87 | void PackageManagerSettings::newDestination() |
88 | { | 88 | { |
89 | int i = destinations->count(); | 89 | int i = destinations->count(); |
90 | if ( destinationname->isEnabled() || destinationurl->text().isEmpty() ) { | 90 | if ( destinationname->isEnabled() || destinationurl->text().isEmpty() ) { |
91 | destinationurlDic.insert(i,new QString("/")); | 91 | destinationurlDic.insert(i,new QString("/")); |
92 | destinations->insertItem(tr("New")); | 92 | destinations->insertItem(tr("New")); |
93 | activeDestination->insertItem(tr("New")); | 93 | activeDestination->insertItem(tr("New")); |
94 | activeLinkDestination->insertItem(tr("New")); | 94 | activeLinkDestination->insertItem(tr("New")); |
95 | } else { | 95 | } else { |
96 | // allows one-level undo | 96 | // allows one-level undo |
97 | destinationurlDic.insert(i,new QString(destinationurl->text())); | 97 | destinationurlDic.insert(i,new QString(destinationurl->text())); |
98 | destinations->insertItem(destinationname->text()); | 98 | destinations->insertItem(destinationname->text()); |
99 | activeDestination->insertItem(destinationname->text()); | 99 | activeDestination->insertItem(destinationname->text()); |
100 | activeLinkDestination->insertItem(destinationname->text()); | 100 | activeLinkDestination->insertItem(destinationname->text()); |
101 | } | 101 | } |
102 | destinations->setSelected(i,TRUE); | 102 | destinations->setSelected(i,TRUE); |
103 | editDestination(i); | 103 | editDestination(i); |
104 | changed = true; | 104 | changed = true; |
105 | } | 105 | } |
106 | 106 | ||
107 | 107 | ||
108 | void PackageManagerSettings::editServer(int i) | 108 | void PackageManagerSettings::editServer(int i) |
109 | { | 109 | { |
110 | if ( servername->isEnabled() ) { | 110 | if ( servername->isEnabled() ) { |
111 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); | 111 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); |
112 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); | 112 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); |
113 | } else { | 113 | } else { |
114 | servername->setEnabled(TRUE); | 114 | servername->setEnabled(TRUE); |
115 | serverurl->setEnabled(TRUE); | 115 | serverurl->setEnabled(TRUE); |
116 | } | 116 | } |
117 | 117 | ||
118 | servername->setText( servers->text(i) ); | 118 | servername->setText( servers->text(i) ); |
119 | serverurl->setText( *serverurlDic[i] ); | 119 | serverurl->setText( *serverurlDic[i] ); |
120 | 120 | ||
121 | editedserver = i; | 121 | editedserver = i; |
122 | 122 | ||
123 | connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); | 123 | connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); |
124 | connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); | 124 | connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); |
125 | changed = true; | 125 | changed = true; |
126 | } | 126 | } |
127 | 127 | ||
128 | 128 | ||
129 | void PackageManagerSettings::editDestination(int i) | 129 | void PackageManagerSettings::editDestination(int i) |
130 | { | 130 | { |
131 | if ( destinationname->isEnabled() ) { | 131 | if ( destinationname->isEnabled() ) { |
132 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); | 132 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); |
133 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); | 133 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); |
134 | } else { | 134 | } else { |
135 | destinationname->setEnabled(TRUE); | 135 | destinationname->setEnabled(TRUE); |
136 | destinationurl->setEnabled(TRUE); | 136 | destinationurl->setEnabled(TRUE); |
137 | createLinksButton->setEnabled(TRUE); | ||
138 | removeLinksButton->setEnabled(TRUE); | ||
137 | } | 139 | } |
138 | 140 | ||
139 | destinationname->setText( destinations->text(i) ); | 141 | destinationname->setText( destinations->text(i) ); |
140 | destinationurl->setText( *destinationurlDic[i] ); | 142 | destinationurl->setText( *destinationurlDic[i] ); |
141 | 143 | ||
142 | editeddestination = i; | 144 | editeddestination = i; |
143 | 145 | ||
144 | connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); | 146 | connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); |
145 | connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); | 147 | connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); |
146 | changed = true; | 148 | changed = true; |
147 | } | 149 | } |
148 | 150 | ||
149 | void PackageManagerSettings::removeServer() | 151 | void PackageManagerSettings::removeServer() |
150 | { | 152 | { |
151 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); | 153 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); |
152 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); | 154 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); |
153 | servername->setText(servers->text(editedserver)); | 155 | servername->setText(servers->text(editedserver)); |
154 | serverurl->setText(*serverurlDic[editedserver]); | 156 | serverurl->setText(*serverurlDic[editedserver]); |
155 | disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 157 | disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
156 | servers->removeItem(editedserver); | 158 | servers->removeItem(editedserver); |
157 | activeServers->removeItem(editedserver); | 159 | activeServers->removeItem(editedserver); |
158 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 160 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
159 | servername->setEnabled(FALSE); | 161 | servername->setEnabled(FALSE); |
160 | serverurl->setEnabled(FALSE); | 162 | serverurl->setEnabled(FALSE); |
161 | changed = true; | 163 | changed = true; |
162 | } | 164 | } |
163 | 165 | ||
164 | void PackageManagerSettings::removeDestination() | 166 | void PackageManagerSettings::removeDestination() |
165 | { | 167 | { |
166 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); | 168 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); |
167 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); | 169 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); |
168 | destinationname->setText(destinations->text(editedserver)); | 170 | destinationname->setText(destinations->text(editedserver)); |
169 | destinationurl->setText(*destinationurlDic[editedserver]); | 171 | destinationurl->setText(*destinationurlDic[editedserver]); |
170 | disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 172 | disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
171 | destinations->removeItem(editeddestination); | 173 | destinations->removeItem(editeddestination); |
172 | activeDestination->removeItem(editeddestination); | 174 | activeDestination->removeItem(editeddestination); |
173 | activeLinkDestination->removeItem(editeddestination); | 175 | activeLinkDestination->removeItem(editeddestination); |
174 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 176 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
175 | destinationname->setEnabled(FALSE); | 177 | destinationname->setEnabled(FALSE); |
176 | destinationurl->setEnabled(FALSE); | 178 | destinationurl->setEnabled(FALSE); |
177 | changed = true; | 179 | changed = true; |
178 | } | 180 | } |
179 | 181 | ||
180 | void PackageManagerSettings::serverNameChanged(const QString& t) | 182 | void PackageManagerSettings::serverNameChanged(const QString& t) |
181 | { | 183 | { |
182 | disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 184 | disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
183 | servers->changeItem( t, editedserver ); | 185 | servers->changeItem( t, editedserver ); |
184 | activeServers->changeItem( t, editedserver ); | 186 | activeServers->changeItem( t, editedserver ); |
185 | changed = true; | 187 | changed = true; |
186 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 188 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
187 | changed = true; | 189 | changed = true; |
188 | } | 190 | } |
189 | 191 | ||
190 | void PackageManagerSettings::destNameChanged(const QString& t) | 192 | void PackageManagerSettings::destNameChanged(const QString& t) |
191 | { | 193 | { |
192 | disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 194 | disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
193 | destinations->changeItem( t, editeddestination ); | 195 | destinations->changeItem( t, editeddestination ); |
194 | activeDestination->changeItem( t, editeddestination ); | 196 | activeDestination->changeItem( t, editeddestination ); |
195 | activeLinkDestination->changeItem( t, editeddestination ); | 197 | activeLinkDestination->changeItem( t, editeddestination ); |
196 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 198 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
197 | changed = true; | 199 | changed = true; |
198 | } | 200 | } |
199 | 201 | ||
200 | void PackageManagerSettings::serverUrlChanged(const QString& t) | 202 | void PackageManagerSettings::serverUrlChanged(const QString& t) |
201 | { | 203 | { |
202 | serverurlDic.replace(editedserver, new QString(t)); | 204 | serverurlDic.replace(editedserver, new QString(t)); |
203 | changed = true; | 205 | changed = true; |
204 | } | 206 | } |
205 | 207 | ||
206 | void PackageManagerSettings::destUrlChanged(const QString& t) | 208 | void PackageManagerSettings::destUrlChanged(const QString& t) |
207 | { | 209 | { |
208 | destinationurlDic.replace(editeddestination, new QString(t)); | 210 | destinationurlDic.replace(editeddestination, new QString(t)); |
209 | changed = true; | 211 | changed = true; |
210 | } | 212 | } |
211 | 213 | ||
212 | void PackageManagerSettings::writeIpkgConfig(const QString& conffile) | 214 | void PackageManagerSettings::writeIpkgConfig(const QString& conffile) |
213 | { | 215 | { |
214 | QFile conf(conffile); | 216 | QFile conf(conffile); |
215 | if ( ! conf.open(IO_WriteOnly) ) return; | 217 | if ( ! conf.open(IO_WriteOnly) ) return; |
216 | QTextStream s(&conf); | 218 | QTextStream s(&conf); |
217 | s << "# Written by qpie Package Manager\n"; | 219 | s << "# Written by qpie Package Manager\n"; |
218 | for (int i=0; i<(int)activeServers->count(); i++) | 220 | for (int i=0; i<(int)activeServers->count(); i++) |
219 | { | 221 | { |
220 | QString url = serverurlDic[i] ? *serverurlDic[i] : QString("???"); | 222 | QString url = serverurlDic[i] ? *serverurlDic[i] : QString("???"); |
221 | if ( !activeServers->isSelected(i) ) | 223 | if ( !activeServers->isSelected(i) ) |
222 | s << "#"; | 224 | s << "#"; |
223 | s << "src " << activeServers->text(i) << " " << url << "\n"; | 225 | s << "src " << activeServers->text(i) << " " << url << "\n"; |
224 | } | 226 | } |
225 | for (int i=0; i<(int)destinations->count(); i++) | 227 | for (int i=0; i<(int)destinations->count(); i++) |
226 | { | 228 | { |
227 | QString url = destinationurlDic[i] ? *destinationurlDic[i] : QString("???"); | 229 | QString url = destinationurlDic[i] ? *destinationurlDic[i] : QString("???"); |
228 | s << "dest " << destinations->text(i) << " " << url << "\n"; | 230 | s << "dest " << destinations->text(i) << " " << url << "\n"; |
229 | } | 231 | } |
230 | conf.close(); | 232 | conf.close(); |
231 | } | 233 | } |
232 | 234 | ||
233 | 235 | ||
234 | void PackageManagerSettings::readInstallationSettings() | 236 | void PackageManagerSettings::readInstallationSettings() |
235 | { | 237 | { |
236 | Config cfg( "oipkg", Config::User ); | 238 | Config cfg( "oipkg", Config::User ); |
237 | cfg.setGroup( "Settings" ); | 239 | cfg.setGroup( "Settings" ); |
238 | installationSettingsCount = cfg.readNumEntry( "count", -1 ); | 240 | installationSettingsCount = cfg.readNumEntry( "count", -1 ); |
239 | currentSetting = cfg.readNumEntry( "current", 0 );// o should be -1 | 241 | currentSetting = cfg.readNumEntry( "current", 0 );// o should be -1 |
240 | 242 | ||
241 | for (int i = 0; i < installationSettingsCount; i++) | 243 | for (int i = 0; i < installationSettingsCount; i++) |
242 | { | 244 | { |
243 | cfg.setGroup( "Setting_" + QString::number(i) ); | 245 | cfg.setGroup( "Setting_" + QString::number(i) ); |
244 | settingName->insertItem( cfg.readEntry( "name", "???" ), i ); | 246 | settingName->insertItem( cfg.readEntry( "name", "???" ), i ); |
245 | }; | 247 | }; |
246 | readInstallationSetting( currentSetting ); | 248 | readInstallationSetting( currentSetting ); |
247 | } | 249 | } |
248 | 250 | ||
249 | 251 | ||
250 | 252 | ||
251 | /** | 253 | /** |
252 | * remove from conf file | 254 | * remove from conf file |
253 | */ | 255 | */ |
254 | void PackageManagerSettings::removeInstallationSetting() | 256 | void PackageManagerSettings::removeInstallationSetting() |
255 | { | 257 | { |
256 | settingName->removeItem( settingName->currentItem() ); | 258 | settingName->removeItem( settingName->currentItem() ); |
257 | Config cfg( "oipkg", Config::User ); | 259 | Config cfg( "oipkg", Config::User ); |
258 | cfg.setGroup( "Setting_" + QString::number( installationSettingsCount ) ); | 260 | cfg.setGroup( "Setting_" + QString::number( installationSettingsCount ) ); |
259 | cfg.clearGroup(); | 261 | cfg.clearGroup(); |
260 | installationSettingsCount--; | 262 | installationSettingsCount--; |
261 | changed = true; | 263 | changed = true; |
262 | settingName->setEditable( false ); | 264 | settingName->setEditable( false ); |
263 | } | 265 | } |
264 | 266 | ||
265 | /** | 267 | /** |
266 | * write to confgile | 268 | * write to confgile |
267 | */ | 269 | */ |
268 | void PackageManagerSettings::newInstallationSetting() | 270 | void PackageManagerSettings::newInstallationSetting() |
269 | { | 271 | { |
270 | installationSettingsCount++; | 272 | installationSettingsCount++; |
271 | settingName->insertItem( "New", installationSettingsCount ); | 273 | settingName->insertItem( "New", installationSettingsCount ); |
272 | settingName->setCurrentItem( installationSettingsCount ); | 274 | settingName->setCurrentItem( installationSettingsCount ); |
273 | settingName->setEditable( true ); | 275 | settingName->setEditable( true ); |
274 | changed = true; | 276 | changed = true; |
275 | } | 277 | } |
276 | 278 | ||
277 | void PackageManagerSettings::installationSettingChange(int cs) | 279 | void PackageManagerSettings::installationSettingChange(int cs) |
278 | { | 280 | { |
279 | writeCurrentInstallationSetting(); | 281 | writeCurrentInstallationSetting(); |
280 | currentSetting = cs; | 282 | currentSetting = cs; |
281 | readInstallationSetting( cs ); | 283 | readInstallationSetting( cs ); |
282 | changed = true; | 284 | changed = true; |
283 | } | 285 | } |
284 | 286 | ||
285 | void PackageManagerSettings::writeInstallationSettings() | 287 | void PackageManagerSettings::writeInstallationSettings() |
286 | { | 288 | { |
287 | { | 289 | { |
288 | Config cfg( "oipkg", Config::User ); | 290 | Config cfg( "oipkg", Config::User ); |
289 | cfg.setGroup( "Settings" ); | 291 | cfg.setGroup( "Settings" ); |
290 | cfg.writeEntry( "count", installationSettingsCount ); | 292 | cfg.writeEntry( "count", installationSettingsCount ); |
291 | cfg.writeEntry( "current", currentSetting ); | 293 | cfg.writeEntry( "current", currentSetting ); |
292 | } | 294 | } |
293 | writeCurrentInstallationSetting(); | 295 | writeCurrentInstallationSetting(); |
294 | } | 296 | } |
295 | 297 | ||
296 | 298 | ||
297 | void PackageManagerSettings::readInstallationSetting(int setting) | 299 | void PackageManagerSettings::readInstallationSetting(int setting) |
298 | { | 300 | { |
299 | if ( setting < 0 ) return; | 301 | if ( setting < 0 ) return; |
300 | Config cfg( "oipkg", Config::User ); | 302 | Config cfg( "oipkg", Config::User ); |
301 | cfg.setGroup( "Setting_" + QString::number( setting ) ); | 303 | cfg.setGroup( "Setting_" + QString::number( setting ) ); |
302 | CheckBoxLink->setChecked( cfg.readBoolEntry( "link", true ) ); | 304 | CheckBoxLink->setChecked( cfg.readBoolEntry( "link", true ) ); |
303 | QString dest = cfg.readEntry( "dest" ); | 305 | QString dest = cfg.readEntry( "dest" ); |
304 | QString linkdest = cfg.readEntry( "linkdest" ); | 306 | QString linkdest = cfg.readEntry( "linkdest" ); |
305 | pvDebug(3, "dest="+dest); | 307 | pvDebug(3, "dest="+dest); |
306 | pvDebug(3, "linkdest="+linkdest); | 308 | pvDebug(3, "linkdest="+linkdest); |
307 | for ( int i = 0; i < activeDestination->count(); i++) | 309 | for ( int i = 0; i < activeDestination->count(); i++) |
308 | { | 310 | { |
309 | if ( activeDestination->text( i ) == dest ) | 311 | if ( activeDestination->text( i ) == dest ) |
310 | activeDestination->setCurrentItem( i ); | 312 | activeDestination->setCurrentItem( i ); |
311 | if ( activeLinkDestination->text( i ) == linkdest ) | 313 | if ( activeLinkDestination->text( i ) == linkdest ) |
312 | activeLinkDestination->setCurrentItem( i ); | 314 | activeLinkDestination->setCurrentItem( i ); |
313 | } | 315 | } |
314 | } | 316 | } |
315 | 317 | ||
316 | void PackageManagerSettings::writeCurrentInstallationSetting() | 318 | void PackageManagerSettings::writeCurrentInstallationSetting() |
317 | { | 319 | { |
318 | Config cfg( "oipkg", Config::User ); | 320 | Config cfg( "oipkg", Config::User ); |
319 | cfg.setGroup( "Setting_" + QString::number(currentSetting) ); | 321 | cfg.setGroup( "Setting_" + QString::number(currentSetting) ); |
320 | cfg.writeEntry( "link", CheckBoxLink->isChecked() ); | 322 | cfg.writeEntry( "link", CheckBoxLink->isChecked() ); |
321 | cfg.writeEntry( "dest", getDestinationName() ); | 323 | cfg.writeEntry( "dest", getDestinationName() ); |
322 | cfg.writeEntry( "linkdest" , getLinkDestinationName() ); | 324 | cfg.writeEntry( "linkdest" , getLinkDestinationName() ); |
323 | QStringList sers = getActiveServers(); | 325 | QStringList sers = getActiveServers(); |
324 | int srvc = 0; | 326 | int srvc = 0; |
325 | for ( QStringList::Iterator it = sers.begin(); it != sers.end(); ++it ) { | 327 | for ( QStringList::Iterator it = sers.begin(); it != sers.end(); ++it ) { |
326 | cfg.writeEntry( "server_" + QString::number(srvc++), *it ); | 328 | cfg.writeEntry( "server_" + QString::number(srvc++), *it ); |
327 | } | 329 | } |
328 | cfg.writeEntry( "server_count", srvc ); | 330 | cfg.writeEntry( "server_count", srvc ); |
329 | } | 331 | } |
330 | 332 | ||
331 | void PackageManagerSettings::renameInstallationSetting() | 333 | void PackageManagerSettings::renameInstallationSetting() |
332 | { | 334 | { |
333 | settingName->setEditable( true ); | 335 | settingName->setEditable( true ); |
334 | changed = true; | 336 | changed = true; |
335 | } | 337 | } |
336 | 338 | ||
337 | void PackageManagerSettings::installationSettingSetName(const QString &name) | 339 | void PackageManagerSettings::installationSettingSetName(const QString &name) |
338 | { | 340 | { |
339 | settingName->changeItem( name, settingName->currentItem() ); | 341 | settingName->changeItem( name, settingName->currentItem() ); |
340 | changed = true; | 342 | changed = true; |
341 | } | 343 | } |
342 | 344 | ||
343 | 345 | ||
344 | bool PackageManagerSettings::readIpkgConfig(const QString& conffile) | 346 | bool PackageManagerSettings::readIpkgConfig(const QString& conffile) |
345 | { | 347 | { |
346 | QFile conf(conffile); | 348 | QFile conf(conffile); |
347 | changed = false; | 349 | changed = false; |
348 | if ( conf.open(IO_ReadOnly) ) { | 350 | if ( conf.open(IO_ReadOnly) ) { |
349 | QTextStream s(&conf); | 351 | QTextStream s(&conf); |
350 | servers->clear(); | 352 | servers->clear(); |
351 | activeServers->clear(); | 353 | activeServers->clear(); |
352 | activeDestination->clear(); | 354 | activeDestination->clear(); |
353 | activeLinkDestination->clear(); | 355 | activeLinkDestination->clear(); |
354 | serverurlDic.clear(); | 356 | serverurlDic.clear(); |
355 | destinationurlDic.clear(); | 357 | destinationurlDic.clear(); |
356 | ipkg_old=0; | 358 | ipkg_old=0; |
357 | int currentserver=0; | 359 | int currentserver=0; |
358 | while ( !s.atEnd() ) { | 360 | while ( !s.atEnd() ) { |
359 | QString l = s.readLine(); | 361 | QString l = s.readLine(); |
360 | QStringList token = QStringList::split(' ', l); | 362 | QStringList token = QStringList::split(' ', l); |
361 | if ( token[0] == "src" || token[0] == "#src" ) { | 363 | if ( token[0] == "src" || token[0] == "#src" ) { |
362 | currentserver=servers->count(); | 364 | currentserver=servers->count(); |
363 | serverurlDic.insert(servers->count(),new QString(token[2])); | 365 | serverurlDic.insert(servers->count(),new QString(token[2])); |
364 | int a = token[0] == "src" ? 1 : 0; | 366 | int a = token[0] == "src" ? 1 : 0; |
365 | int i = servers->count(); | 367 | int i = servers->count(); |
366 | servers->insertItem(token[1]); | 368 | servers->insertItem(token[1]); |
367 | activeServers->insertItem( token[1] ); | 369 | activeServers->insertItem( token[1] ); |
368 | activeServers->setSelected(i,a); | 370 | activeServers->setSelected(i,a); |
369 | } else if ( token[0] == "dest" ) { | 371 | } else if ( token[0] == "dest" ) { |
370 | currentserver=destinations->count(); | 372 | currentserver=destinations->count(); |
371 | destinationurlDic.insert(destinations->count(),new QString(token[2])); | 373 | destinationurlDic.insert(destinations->count(),new QString(token[2])); |
372 | destinations->insertItem(token[1]); | 374 | destinations->insertItem(token[1]); |
373 | activeDestination->insertItem( token[1] ); | 375 | activeDestination->insertItem( token[1] ); |
374 | activeLinkDestination->insertItem( token[1] ); | 376 | activeLinkDestination->insertItem( token[1] ); |
375 | 377 | ||
376 | } else if ( token[0] == "option" ) { | 378 | } else if ( token[0] == "option" ) { |
377 | // ### somehow need to use the settings from netsetup | 379 | // ### somehow need to use the settings from netsetup |
378 | // if ( token[1] == "http_proxy" ) | 380 | // if ( token[1] == "http_proxy" ) |
379 | // http->setText(token[2]); | 381 | // http->setText(token[2]); |
380 | // else if ( token[1] == "ftp_proxy" ) | 382 | // else if ( token[1] == "ftp_proxy" ) |
381 | // ftp->setText(token[2]); | 383 | // ftp->setText(token[2]); |
382 | // else if ( token[1] == "proxy_username" ) | 384 | // else if ( token[1] == "proxy_username" ) |
383 | // username->setText(token[2]); | 385 | // username->setText(token[2]); |
384 | // else if ( token[1] == "proxy_password" ) | 386 | // else if ( token[1] == "proxy_password" ) |
385 | // password->setText(token[2]); | 387 | // password->setText(token[2]); |
386 | } else { | 388 | } else { |
387 | // Old style? | 389 | // Old style? |
388 | int eq = l.find('='); | 390 | int eq = l.find('='); |
389 | if ( eq >= 0 ) { | 391 | if ( eq >= 0 ) { |
390 | QString v = l.mid(eq+1).stripWhiteSpace(); | 392 | QString v = l.mid(eq+1).stripWhiteSpace(); |
391 | if ( v[0] == '"' || v[0] == '\'' ) { | 393 | if ( v[0] == '"' || v[0] == '\'' ) { |
392 | int cl=v.find(v[0],1); | 394 | int cl=v.find(v[0],1); |
393 | if ( cl >= 0 ) | 395 | if ( cl >= 0 ) |
394 | v = v.mid(1,cl-1); | 396 | v = v.mid(1,cl-1); |
395 | } | 397 | } |
396 | if ( l.left(12) == "IPKG_SOURCE=" ) { | 398 | if ( l.left(12) == "IPKG_SOURCE=" ) { |
397 | ipkg_old=1; | 399 | ipkg_old=1; |
398 | currentserver=servers->count(); | 400 | currentserver=servers->count(); |
399 | serverurlDic.insert(servers->count(),new QString(v)); | 401 | serverurlDic.insert(servers->count(),new QString(v)); |
400 | servers->insertItem(v); | 402 | servers->insertItem(v); |
401 | } else if ( l.left(13) == "#IPKG_SOURCE=" ) { | 403 | } else if ( l.left(13) == "#IPKG_SOURCE=" ) { |
402 | serverurlDic.insert(servers->count(),new QString(v)); | 404 | serverurlDic.insert(servers->count(),new QString(v)); |
403 | servers->insertItem(v); | 405 | servers->insertItem(v); |
404 | } else if ( l.left(10) == "IPKG_ROOT=" ) { | 406 | } else if ( l.left(10) == "IPKG_ROOT=" ) { |
405 | // ### no UI | 407 | // ### no UI |
406 | // } else if ( l.left(20) == "IPKG_PROXY_USERNAME=" ) { | 408 | // } else if ( l.left(20) == "IPKG_PROXY_USERNAME=" ) { |
407 | // username->setText(v); | 409 | // username->setText(v); |
408 | // } else if ( l.left(20) == "IPKG_PROXY_PASSWORD=" ) { | 410 | // } else if ( l.left(20) == "IPKG_PROXY_PASSWORD=" ) { |
409 | // password->setText(v); | 411 | // password->setText(v); |
410 | // } else if ( l.left(16) == "IPKG_PROXY_HTTP=" ) { | 412 | // } else if ( l.left(16) == "IPKG_PROXY_HTTP=" ) { |
411 | // http->setText(v); | 413 | // http->setText(v); |
412 | // } else if ( l.left(16) == "IPKG_PROXY_FTP=" ) { | 414 | // } else if ( l.left(16) == "IPKG_PROXY_FTP=" ) { |
413 | // ftp->setText(v); | 415 | // ftp->setText(v); |
414 | } | 416 | } |
415 | } | 417 | } |
416 | } | 418 | } |
417 | } | 419 | } |
418 | if ( ipkg_old ) { | 420 | if ( ipkg_old ) { |
419 | servers->setSelectionMode(QListBox::Single); | 421 | servers->setSelectionMode(QListBox::Single); |
420 | servers->setSelected(currentserver,TRUE); | 422 | servers->setSelected(currentserver,TRUE); |
421 | } | 423 | } |
422 | return TRUE; | 424 | return TRUE; |
423 | } else { | 425 | } else { |
424 | return FALSE; | 426 | return FALSE; |
425 | } | 427 | } |
426 | } | 428 | } |
427 | 429 | ||
428 | 430 | ||
429 | /** | 431 | /** |
430 | * read from config file(s) | 432 | * read from config file(s) |
431 | */ | 433 | */ |
432 | void PackageManagerSettings::readSettings() | 434 | void PackageManagerSettings::readSettings() |
433 | { | 435 | { |
434 | readIpkgConfig("/etc/ipkg.conf"); | 436 | readIpkgConfig("/etc/ipkg.conf"); |
435 | readInstallationSettings(); | 437 | readInstallationSettings(); |
436 | } | 438 | } |
437 | 439 | ||
438 | void PackageManagerSettings::writeSettings() | 440 | void PackageManagerSettings::writeSettings() |
439 | { | 441 | { |
440 | if ( changed ) writeIpkgConfig("/etc/ipkg.conf"); | 442 | if ( changed ) writeIpkgConfig("/etc/ipkg.conf"); |
441 | writeInstallationSettings(); | 443 | writeInstallationSettings(); |
442 | } | 444 | } |
443 | /** shows the setting dialog */ | 445 | /** shows the setting dialog */ |
444 | bool PackageManagerSettings::showDialog( int i ) | 446 | bool PackageManagerSettings::showDialog( int i ) |
445 | { | 447 | { |
446 | TabWidget->setCurrentPage( i ); | 448 | TabWidget->setCurrentPage( i ); |
447 | showMaximized(); | 449 | showMaximized(); |
448 | bool ret = exec(); | 450 | bool ret = exec(); |
449 | if ( ret ) writeSettings(); | 451 | if ( ret ) writeSettings(); |
450 | else readSettings(); | 452 | else readSettings(); |
451 | return (changed && ret); | 453 | return (changed && ret); |
452 | } | 454 | } |
453 | /** Returns the installation destination */ | 455 | /** Returns the installation destination */ |
454 | QString PackageManagerSettings::getDestinationName() | 456 | QString PackageManagerSettings::getDestinationName() |
455 | { | 457 | { |
456 | return activeDestination->currentText(); | 458 | return activeDestination->currentText(); |
457 | } | 459 | } |
458 | /** Returns the link destination */ | 460 | /** Returns the link destination */ |
459 | QString PackageManagerSettings::getLinkDestinationName() | 461 | QString PackageManagerSettings::getLinkDestinationName() |
460 | { | 462 | { |
461 | return activeLinkDestination->currentText(); | 463 | return activeLinkDestination->currentText(); |
462 | } | 464 | } |
463 | /** Returns the URL of the active destination */ | 465 | /** Returns the URL of the active destination */ |
464 | QString PackageManagerSettings::getDestinationUrl() | 466 | QString PackageManagerSettings::getDestinationUrl() |
465 | { | 467 | { |
466 | int dnr = activeDestination->currentItem(); | 468 | int dnr = activeDestination->currentItem(); |
467 | return *destinationurlDic.find(dnr); | 469 | return *destinationurlDic.find(dnr); |
468 | } | 470 | } |
469 | /** Should oipkg create links form install destination to link destination */ | 471 | /** Should oipkg create links form install destination to link destination */ |
470 | bool PackageManagerSettings::createLinks() | 472 | bool PackageManagerSettings::createLinks() |
471 | { | 473 | { |
472 | return CheckBoxLink->isChecked(); | 474 | return CheckBoxLink->isChecked(); |
473 | } | 475 | } |
474 | /** get the servers that are active */ | 476 | /** get the servers that are active */ |
475 | QStringList PackageManagerSettings::getActiveServers() | 477 | QStringList PackageManagerSettings::getActiveServers() |
476 | { | 478 | { |
477 | QStringList sl; | 479 | QStringList sl; |
478 | for (int i=0; i<(int)activeServers->count(); i++) | 480 | for (int i=0; i<(int)activeServers->count(); i++) |
479 | { | 481 | { |
480 | if ( activeServers->isSelected(i) ) | 482 | if ( activeServers->isSelected(i) ) |
481 | sl += activeServers->text(i); | 483 | sl += activeServers->text(i); |
482 | } | 484 | } |
483 | return sl; | 485 | return sl; |
484 | } | 486 | } |
485 | QStringList PackageManagerSettings::getServers() | 487 | QStringList PackageManagerSettings::getServers() |
486 | { | 488 | { |
487 | QStringList sl; | 489 | QStringList sl; |
488 | for (int i=0; i<(int)activeServers->count(); i++) | 490 | for (int i=0; i<(int)activeServers->count(); i++) |
489 | { | 491 | { |
490 | sl += activeServers->text(i); | 492 | sl += activeServers->text(i); |
491 | } | 493 | } |
492 | return sl; | 494 | return sl; |
493 | } | 495 | } |
494 | 496 | ||
495 | /** returns the destination listed in ipkg.conf */ | 497 | /** returns the destination listed in ipkg.conf */ |
496 | QStringList PackageManagerSettings::getDestinationUrls() | 498 | QStringList PackageManagerSettings::getDestinationUrls() |
497 | { | 499 | { |
498 | QStringList sl; | 500 | QStringList sl; |
499 | for (int i=0; i<(int)destinations->count(); i++) | 501 | for (int i=0; i<(int)destinations->count(); i++) |
500 | { | 502 | { |
501 | sl += *destinationurlDic[i]; | 503 | sl += *destinationurlDic[i]; |
502 | } | 504 | } |
503 | return sl; | 505 | return sl; |
504 | } | 506 | } |
505 | 507 | ||
506 | /** returns the destination listed in ipkg.conf */ | 508 | /** returns the destination listed in ipkg.conf */ |
507 | QString PackageManagerSettings::getDestinationUrlByName(QString n) | 509 | QString PackageManagerSettings::getDestinationUrlByName(QString n) |
508 | { | 510 | { |
509 | QStringList sl; | 511 | QStringList sl; |
510 | for (int i=0; i<(int)destinations->count(); i++) | 512 | for (int i=0; i<(int)destinations->count(); i++) |
511 | { | 513 | { |
512 | if ( n == destinations->text(i)) return*destinationurlDic[i]; | 514 | if ( n == destinations->text(i)) return*destinationurlDic[i]; |
513 | } | 515 | } |
514 | return ""; | 516 | return ""; |
515 | } | 517 | } |
516 | 518 | ||
517 | /** returns the destination listed in ipkg.conf */ | 519 | /** returns the destination listed in ipkg.conf */ |
518 | QStringList PackageManagerSettings::getDestinationNames() | 520 | QStringList PackageManagerSettings::getDestinationNames() |
519 | { | 521 | { |
520 | QStringList sl; | 522 | QStringList sl; |
521 | for (int i=0; i<(int)destinations->count(); i++) | 523 | for (int i=0; i<(int)destinations->count(); i++) |
522 | { | 524 | { |
523 | sl += destinations->text(i); | 525 | sl += destinations->text(i); |
524 | } | 526 | } |
525 | return sl; | 527 | return sl; |
526 | } | 528 | } |
527 | 529 | ||
528 | 530 | ||
529 | void PackageManagerSettings::linkEnabled( bool b ) | 531 | void PackageManagerSettings::linkEnabled( bool b ) |
530 | { | 532 | { |
533 | pvDebug(2,"PackageManagerSettings::linkEnabled "+QString(b?"yes":"no")); | ||
531 | activeLinkDestination->setEnabled( b ); | 534 | activeLinkDestination->setEnabled( b ); |
532 | } | 535 | } |
533 | 536 | ||
534 | void PackageManagerSettings::activeServerChanged() | 537 | void PackageManagerSettings::activeServerChanged() |
535 | { | 538 | { |
536 | changed = true; | 539 | changed = true; |
537 | } | 540 | } |
538 | 541 | ||
539 | QComboBox* PackageManagerSettings::getDestCombo() | 542 | QComboBox* PackageManagerSettings::getDestCombo() |
540 | { | 543 | { |
541 | return new QComboBox(activeDestination); | 544 | return new QComboBox(activeDestination); |
542 | } | 545 | } |
546 | |||
547 | void PackageManagerSettings::createLinksToDest() | ||
548 | { | ||
549 | pvDebug(2,"creating links..."); | ||
550 | // emit doCreateLinks( destinationurl->text() ); | ||
551 | //ipkg->createLinks( destinationurl ); | ||
552 | } | ||
553 | |||
554 | void PackageManagerSettings::removeLinksToDest() | ||
555 | { | ||
556 | pvDebug(2,"removing links..."); | ||
557 | // emit doRemoveLinks( destinationurl->text() ); | ||
558 | //ipkg->removeLinks( destinationurl ); | ||
559 | } | ||
560 | |||
561 | //void PackageManagerSettings::setIpkg( PmIpkg* i ) | ||
562 | //{ | ||
563 | //ipkg = i; | ||
564 | //} | ||
diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h index fbb3b99..1632d4a 100644 --- a/noncore/unsupported/oipkg/pksettings.h +++ b/noncore/unsupported/oipkg/pksettings.h | |||
@@ -1,68 +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 <qintdict.h> | 6 | #include <qintdict.h> |
7 | #include <qobject.h> | ||
6 | 8 | ||
7 | 9 | ||
8 | class PackageManagerSettings : private PackageManagerSettingsBase | 10 | class PackageManagerSettings : public PackageManagerSettingsBase |
9 | { | 11 | { |
10 | // Q_OBJECT | 12 | // Q_OBJECT |
11 | public: | 13 | public: |
12 | PackageManagerSettings( QWidget* , const char* , WFlags ); | 14 | PackageManagerSettings( QWidget* , const char* , WFlags ); |
13 | ~PackageManagerSettings(); | 15 | ~PackageManagerSettings(); |
14 | 16 | ||
15 | bool showDialog( int ) ; | 17 | bool showDialog( int ) ; |
16 | QString getDestinationUrl(); | 18 | QString getDestinationUrl(); |
17 | QString getDestinationName(); | 19 | QString getDestinationName(); |
18 | QString getLinkDestinationName(); | 20 | QString getLinkDestinationName(); |
19 | bool createLinks(); | 21 | bool createLinks(); |
20 | QStringList getServers(); | 22 | QStringList getServers(); |
21 | QStringList getActiveServers(); | 23 | QStringList getActiveServers(); |
22 | QStringList getDestinationUrls(); | 24 | QStringList getDestinationUrls(); |
23 | QStringList getDestinationNames(); | 25 | QStringList getDestinationNames(); |
24 | QString getDestinationUrlByName(QString); | 26 | QString getDestinationUrlByName(QString); |
25 | /** No descriptions */ | ||
26 | QComboBox* getDestCombo(); | 27 | QComboBox* getDestCombo(); |
27 | 28 | // void setIpkg( PmIpkg* ); | |
28 | private: | ||
29 | QIntDict<QString> serverurlDic; | ||
30 | QIntDict<QString> destinationurlDic; | ||
31 | int ipkg_old; | ||
32 | int editedserver; | ||
33 | int editeddestination; | ||
34 | int currentSetting; | ||
35 | int installationSettingsCount; | ||
36 | bool changed; | ||
37 | |||
38 | bool readIpkgConfig(const QString&); | ||
39 | void writeIpkgConfig(const QString&); | ||
40 | void writeSettings(); | ||
41 | void readSettings(); | ||
42 | 29 | ||
43 | public slots: | 30 | public slots: |
44 | void writeInstallationSettings(); | 31 | void writeInstallationSettings(); |
45 | void readInstallationSettings(); | 32 | void readInstallationSettings(); |
46 | void writeCurrentInstallationSetting(); | 33 | void writeCurrentInstallationSetting(); |
47 | void readInstallationSetting(int); | 34 | void readInstallationSetting(int); |
48 | void installationSettingSetName(const QString &); | 35 | void installationSettingSetName(const QString &); |
49 | 36 | void removeLinksToDest(); | |
37 | void createLinksToDest(); | ||
50 | void newServer(); | 38 | void newServer(); |
51 | void editServer(int); | 39 | void editServer(int); |
52 | void removeDestination(); | 40 | void removeDestination(); |
53 | void newDestination(); | 41 | void newDestination(); |
54 | void editDestination(int); | 42 | void editDestination(int); |
55 | void linkEnabled(bool); | 43 | void linkEnabled(bool); |
56 | void removeServer(); | 44 | void removeServer(); |
57 | void serverNameChanged(const QString&); | 45 | void serverNameChanged(const QString&); |
58 | void serverUrlChanged(const QString&); | 46 | void serverUrlChanged(const QString&); |
59 | void destNameChanged(const QString&); | 47 | void destNameChanged(const QString&); |
60 | void destUrlChanged(const QString&); | 48 | void destUrlChanged(const QString&); |
61 | void installationSettingChange(int); | 49 | void installationSettingChange(int); |
62 | void newInstallationSetting(); | 50 | void newInstallationSetting(); |
63 | void removeInstallationSetting(); | 51 | void removeInstallationSetting(); |
64 | void renameInstallationSetting(); | 52 | void renameInstallationSetting(); |
65 | void activeServerChanged(); | 53 | void activeServerChanged(); |
54 | signals: | ||
55 | // void doCreateLinks( QString dest ); | ||
56 | // void doRemoveLinks( QString dest ); | ||
57 | |||
58 | private: | ||
59 | QIntDict<QString> serverurlDic; | ||
60 | QIntDict<QString> destinationurlDic; | ||
61 | int ipkg_old; | ||
62 | int editedserver; | ||
63 | int editeddestination; | ||
64 | int currentSetting; | ||
65 | int installationSettingsCount; | ||
66 | bool changed; | ||
67 | |||
68 | bool readIpkgConfig(const QString&); | ||
69 | void writeIpkgConfig(const QString&); | ||
70 | void writeSettings(); | ||
71 | void readSettings(); | ||
66 | }; | 72 | }; |
67 | 73 | ||
68 | #endif | 74 | #endif |
diff --git a/noncore/unsupported/oipkg/pksettingsbase.ui b/noncore/unsupported/oipkg/pksettingsbase.ui index fd6d208..5b83248 100644 --- a/noncore/unsupported/oipkg/pksettingsbase.ui +++ b/noncore/unsupported/oipkg/pksettingsbase.ui | |||
@@ -1,270 +1,270 @@ | |||
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>345</width> | 14 | <width>337</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> |
63 | <grid> | 63 | <grid> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>margin</name> | 65 | <name>margin</name> |
66 | <number>3</number> | 66 | <number>3</number> |
67 | </property> | 67 | </property> |
68 | <property stdset="1"> | 68 | <property stdset="1"> |
69 | <name>spacing</name> | 69 | <name>spacing</name> |
70 | <number>3</number> | 70 | <number>3</number> |
71 | </property> | 71 | </property> |
72 | <widget row="0" column="0" > | 72 | <widget row="0" column="0" > |
73 | <class>QLayoutWidget</class> | 73 | <class>QLayoutWidget</class> |
74 | <property stdset="1"> | 74 | <property stdset="1"> |
75 | <name>name</name> | 75 | <name>name</name> |
76 | <cstring>Layout3_2</cstring> | 76 | <cstring>Layout3_2</cstring> |
77 | </property> | 77 | </property> |
78 | <hbox> | 78 | <hbox> |
79 | <property stdset="1"> | 79 | <property stdset="1"> |
80 | <name>margin</name> | 80 | <name>margin</name> |
81 | <number>0</number> | 81 | <number>0</number> |
82 | </property> | 82 | </property> |
83 | <property stdset="1"> | 83 | <property stdset="1"> |
84 | <name>spacing</name> | 84 | <name>spacing</name> |
85 | <number>6</number> | 85 | <number>6</number> |
86 | </property> | 86 | </property> |
87 | <widget> | 87 | <widget> |
88 | <class>QLabel</class> | 88 | <class>QLabel</class> |
89 | <property stdset="1"> | 89 | <property stdset="1"> |
90 | <name>name</name> | 90 | <name>name</name> |
91 | <cstring>Settings</cstring> | 91 | <cstring>Settings</cstring> |
92 | </property> | 92 | </property> |
93 | <property stdset="1"> | 93 | <property stdset="1"> |
94 | <name>text</name> | 94 | <name>text</name> |
95 | <string>Installation Setups</string> | 95 | <string>Installation Setups</string> |
96 | </property> | 96 | </property> |
97 | </widget> | 97 | </widget> |
98 | <spacer> | 98 | <spacer> |
99 | <property> | 99 | <property> |
100 | <name>name</name> | 100 | <name>name</name> |
101 | <cstring>Spacer2_2_2</cstring> | 101 | <cstring>Spacer2_2_2</cstring> |
102 | </property> | 102 | </property> |
103 | <property stdset="1"> | 103 | <property stdset="1"> |
104 | <name>orientation</name> | 104 | <name>orientation</name> |
105 | <enum>Horizontal</enum> | 105 | <enum>Horizontal</enum> |
106 | </property> | 106 | </property> |
107 | <property stdset="1"> | 107 | <property stdset="1"> |
108 | <name>sizeType</name> | 108 | <name>sizeType</name> |
109 | <enum>Expanding</enum> | 109 | <enum>Expanding</enum> |
110 | </property> | 110 | </property> |
111 | <property> | 111 | <property> |
112 | <name>sizeHint</name> | 112 | <name>sizeHint</name> |
113 | <size> | 113 | <size> |
114 | <width>20</width> | 114 | <width>20</width> |
115 | <height>20</height> | 115 | <height>20</height> |
116 | </size> | 116 | </size> |
117 | </property> | 117 | </property> |
118 | </spacer> | 118 | </spacer> |
119 | </hbox> | 119 | </hbox> |
120 | </widget> | 120 | </widget> |
121 | <widget row="5" column="0" > | 121 | <widget row="5" column="0" > |
122 | <class>QLayoutWidget</class> | 122 | <class>QLayoutWidget</class> |
123 | <property stdset="1"> | 123 | <property stdset="1"> |
124 | <name>name</name> | 124 | <name>name</name> |
125 | <cstring>Layout8</cstring> | 125 | <cstring>Layout8</cstring> |
126 | </property> | 126 | </property> |
127 | <hbox> | 127 | <hbox> |
128 | <property stdset="1"> | 128 | <property stdset="1"> |
129 | <name>margin</name> | 129 | <name>margin</name> |
130 | <number>0</number> | 130 | <number>0</number> |
131 | </property> | 131 | </property> |
132 | <property stdset="1"> | 132 | <property stdset="1"> |
133 | <name>spacing</name> | 133 | <name>spacing</name> |
134 | <number>6</number> | 134 | <number>6</number> |
135 | </property> | 135 | </property> |
136 | <widget> | 136 | <widget> |
137 | <class>QLabel</class> | 137 | <class>QLabel</class> |
138 | <property stdset="1"> | 138 | <property stdset="1"> |
139 | <name>name</name> | 139 | <name>name</name> |
140 | <cstring>TextLabel1</cstring> | 140 | <cstring>TextLabel1</cstring> |
141 | </property> | 141 | </property> |
142 | <property stdset="1"> | 142 | <property stdset="1"> |
143 | <name>text</name> | 143 | <name>text</name> |
144 | <string>Install destination:</string> | 144 | <string>Install destination:</string> |
145 | </property> | 145 | </property> |
146 | </widget> | 146 | </widget> |
147 | <widget> | 147 | <widget> |
148 | <class>QComboBox</class> | 148 | <class>QComboBox</class> |
149 | <property stdset="1"> | 149 | <property stdset="1"> |
150 | <name>name</name> | 150 | <name>name</name> |
151 | <cstring>activeDestination</cstring> | 151 | <cstring>activeDestination</cstring> |
152 | </property> | 152 | </property> |
153 | </widget> | 153 | </widget> |
154 | </hbox> | 154 | </hbox> |
155 | </widget> | 155 | </widget> |
156 | <widget row="6" column="0" > | 156 | <widget row="6" column="0" > |
157 | <class>QLayoutWidget</class> | 157 | <class>QLayoutWidget</class> |
158 | <property stdset="1"> | 158 | <property stdset="1"> |
159 | <name>name</name> | 159 | <name>name</name> |
160 | <cstring>Layout9</cstring> | 160 | <cstring>Layout9</cstring> |
161 | </property> | 161 | </property> |
162 | <hbox> | 162 | <hbox> |
163 | <property stdset="1"> | 163 | <property stdset="1"> |
164 | <name>margin</name> | 164 | <name>margin</name> |
165 | <number>0</number> | 165 | <number>0</number> |
166 | </property> | 166 | </property> |
167 | <property stdset="1"> | 167 | <property stdset="1"> |
168 | <name>spacing</name> | 168 | <name>spacing</name> |
169 | <number>6</number> | 169 | <number>6</number> |
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:</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> |
267 | <bool>true</bool> | 267 | <bool>true</bool> |
268 | </property> | 268 | </property> |
269 | <property stdset="1"> | 269 | <property stdset="1"> |
270 | <name>focusPolicy</name> | 270 | <name>focusPolicy</name> |
@@ -279,479 +279,608 @@ | |||
279 | <class>QLayoutWidget</class> | 279 | <class>QLayoutWidget</class> |
280 | <property stdset="1"> | 280 | <property stdset="1"> |
281 | <name>name</name> | 281 | <name>name</name> |
282 | <cstring>Layout11</cstring> | 282 | <cstring>Layout11</cstring> |
283 | </property> | 283 | </property> |
284 | <hbox> | 284 | <hbox> |
285 | <property stdset="1"> | 285 | <property stdset="1"> |
286 | <name>margin</name> | 286 | <name>margin</name> |
287 | <number>0</number> | 287 | <number>0</number> |
288 | </property> | 288 | </property> |
289 | <property stdset="1"> | 289 | <property stdset="1"> |
290 | <name>spacing</name> | 290 | <name>spacing</name> |
291 | <number>6</number> | 291 | <number>6</number> |
292 | </property> | 292 | </property> |
293 | <widget> | 293 | <widget> |
294 | <class>QPushButton</class> | 294 | <class>QPushButton</class> |
295 | <property stdset="1"> | 295 | <property stdset="1"> |
296 | <name>name</name> | 296 | <name>name</name> |
297 | <cstring>newsetting</cstring> | 297 | <cstring>newsetting</cstring> |
298 | </property> | 298 | </property> |
299 | <property stdset="1"> | 299 | <property stdset="1"> |
300 | <name>enabled</name> | 300 | <name>enabled</name> |
301 | <bool>false</bool> | 301 | <bool>false</bool> |
302 | </property> | 302 | </property> |
303 | <property stdset="1"> | 303 | <property stdset="1"> |
304 | <name>text</name> | 304 | <name>text</name> |
305 | <string>New</string> | 305 | <string>New</string> |
306 | </property> | 306 | </property> |
307 | <property stdset="1"> | 307 | <property stdset="1"> |
308 | <name>autoDefault</name> | 308 | <name>autoDefault</name> |
309 | <bool>false</bool> | 309 | <bool>false</bool> |
310 | </property> | 310 | </property> |
311 | </widget> | 311 | </widget> |
312 | <widget> | 312 | <widget> |
313 | <class>QPushButton</class> | 313 | <class>QPushButton</class> |
314 | <property stdset="1"> | 314 | <property stdset="1"> |
315 | <name>name</name> | 315 | <name>name</name> |
316 | <cstring>renamesetting</cstring> | 316 | <cstring>renamesetting</cstring> |
317 | </property> | 317 | </property> |
318 | <property stdset="1"> | 318 | <property stdset="1"> |
319 | <name>enabled</name> | 319 | <name>enabled</name> |
320 | <bool>false</bool> | 320 | <bool>false</bool> |
321 | </property> | 321 | </property> |
322 | <property stdset="1"> | 322 | <property stdset="1"> |
323 | <name>text</name> | 323 | <name>text</name> |
324 | <string>Rename</string> | 324 | <string>Rename</string> |
325 | </property> | 325 | </property> |
326 | </widget> | 326 | </widget> |
327 | <widget> | 327 | <widget> |
328 | <class>QPushButton</class> | 328 | <class>QPushButton</class> |
329 | <property stdset="1"> | 329 | <property stdset="1"> |
330 | <name>name</name> | 330 | <name>name</name> |
331 | <cstring>removesetting</cstring> | 331 | <cstring>removesetting</cstring> |
332 | </property> | 332 | </property> |
333 | <property stdset="1"> | 333 | <property stdset="1"> |
334 | <name>enabled</name> | 334 | <name>enabled</name> |
335 | <bool>false</bool> | 335 | <bool>false</bool> |
336 | </property> | 336 | </property> |
337 | <property stdset="1"> | 337 | <property stdset="1"> |
338 | <name>text</name> | 338 | <name>text</name> |
339 | <string>Remove</string> | 339 | <string>Remove</string> |
340 | </property> | 340 | </property> |
341 | <property stdset="1"> | 341 | <property stdset="1"> |
342 | <name>autoDefault</name> | 342 | <name>autoDefault</name> |
343 | <bool>false</bool> | 343 | <bool>false</bool> |
344 | </property> | 344 | </property> |
345 | </widget> | 345 | </widget> |
346 | </hbox> | 346 | </hbox> |
347 | </widget> | 347 | </widget> |
348 | </grid> | 348 | </grid> |
349 | </widget> | 349 | </widget> |
350 | <widget> | 350 | <widget> |
351 | <class>QWidget</class> | 351 | <class>QWidget</class> |
352 | <property stdset="1"> | 352 | <property stdset="1"> |
353 | <name>name</name> | 353 | <name>name</name> |
354 | <cstring>tab</cstring> | 354 | <cstring>tab</cstring> |
355 | </property> | 355 | </property> |
356 | <attribute> | 356 | <attribute> |
357 | <name>title</name> | 357 | <name>title</name> |
358 | <string>Servers</string> | 358 | <string>Servers</string> |
359 | </attribute> | 359 | </attribute> |
360 | <grid> | 360 | <grid> |
361 | <property stdset="1"> | 361 | <property stdset="1"> |
362 | <name>margin</name> | 362 | <name>margin</name> |
363 | <number>3</number> | 363 | <number>3</number> |
364 | </property> | 364 | </property> |
365 | <property stdset="1"> | 365 | <property stdset="1"> |
366 | <name>spacing</name> | 366 | <name>spacing</name> |
367 | <number>3</number> | 367 | <number>3</number> |
368 | </property> | 368 | </property> |
369 | <widget row="3" column="0" rowspan="1" colspan="2" > | 369 | <widget row="3" column="0" rowspan="1" colspan="2" > |
370 | <class>QLayoutWidget</class> | 370 | <class>QLayoutWidget</class> |
371 | <property stdset="1"> | 371 | <property stdset="1"> |
372 | <name>name</name> | 372 | <name>name</name> |
373 | <cstring>Layout4</cstring> | 373 | <cstring>Layout4</cstring> |
374 | </property> | 374 | </property> |
375 | <grid> | 375 | <grid> |
376 | <property stdset="1"> | 376 | <property stdset="1"> |
377 | <name>margin</name> | 377 | <name>margin</name> |
378 | <number>0</number> | 378 | <number>0</number> |
379 | </property> | 379 | </property> |
380 | <property stdset="1"> | 380 | <property stdset="1"> |
381 | <name>spacing</name> | 381 | <name>spacing</name> |
382 | <number>6</number> | 382 | <number>6</number> |
383 | </property> | 383 | </property> |
384 | <widget row="0" column="1" > | 384 | <widget row="0" column="1" > |
385 | <class>QLineEdit</class> | 385 | <class>QLineEdit</class> |
386 | <property stdset="1"> | 386 | <property stdset="1"> |
387 | <name>name</name> | 387 | <name>name</name> |
388 | <cstring>servername</cstring> | 388 | <cstring>servername</cstring> |
389 | </property> | 389 | </property> |
390 | </widget> | 390 | </widget> |
391 | <widget row="0" column="0" > | 391 | <widget row="0" column="0" > |
392 | <class>QLabel</class> | 392 | <class>QLabel</class> |
393 | <property stdset="1"> | 393 | <property stdset="1"> |
394 | <name>name</name> | 394 | <name>name</name> |
395 | <cstring>TextLabel1_3</cstring> | 395 | <cstring>TextLabel1_3</cstring> |
396 | </property> | 396 | </property> |
397 | <property stdset="1"> | 397 | <property stdset="1"> |
398 | <name>text</name> | 398 | <name>text</name> |
399 | <string>Name:</string> | 399 | <string>Name:</string> |
400 | </property> | 400 | </property> |
401 | </widget> | 401 | </widget> |
402 | <widget row="1" column="1" > | 402 | <widget row="1" column="1" > |
403 | <class>QLineEdit</class> | 403 | <class>QLineEdit</class> |
404 | <property stdset="1"> | 404 | <property stdset="1"> |
405 | <name>name</name> | 405 | <name>name</name> |
406 | <cstring>serverurl</cstring> | 406 | <cstring>serverurl</cstring> |
407 | </property> | 407 | </property> |
408 | </widget> | 408 | </widget> |
409 | <widget row="1" column="0" > | 409 | <widget row="1" column="0" > |
410 | <class>QLabel</class> | 410 | <class>QLabel</class> |
411 | <property stdset="1"> | 411 | <property stdset="1"> |
412 | <name>name</name> | 412 | <name>name</name> |
413 | <cstring>TextLabel2_3</cstring> | 413 | <cstring>TextLabel2_3</cstring> |
414 | </property> | 414 | </property> |
415 | <property stdset="1"> | 415 | <property stdset="1"> |
416 | <name>text</name> | 416 | <name>text</name> |
417 | <string>URL:</string> | 417 | <string>URL:</string> |
418 | </property> | 418 | </property> |
419 | </widget> | 419 | </widget> |
420 | </grid> | 420 | </grid> |
421 | </widget> | 421 | </widget> |
422 | <widget row="0" column="0" rowspan="1" colspan="2" > | 422 | <widget row="0" column="0" rowspan="1" colspan="2" > |
423 | <class>QLayoutWidget</class> | 423 | <class>QLayoutWidget</class> |
424 | <property stdset="1"> | 424 | <property stdset="1"> |
425 | <name>name</name> | 425 | <name>name</name> |
426 | <cstring>Layout2</cstring> | 426 | <cstring>Layout2</cstring> |
427 | </property> | 427 | </property> |
428 | <hbox> | 428 | <hbox> |
429 | <property stdset="1"> | 429 | <property stdset="1"> |
430 | <name>margin</name> | 430 | <name>margin</name> |
431 | <number>0</number> | 431 | <number>0</number> |
432 | </property> | 432 | </property> |
433 | <property stdset="1"> | 433 | <property stdset="1"> |
434 | <name>spacing</name> | 434 | <name>spacing</name> |
435 | <number>6</number> | 435 | <number>6</number> |
436 | </property> | 436 | </property> |
437 | <widget> | 437 | <widget> |
438 | <class>QLabel</class> | 438 | <class>QLabel</class> |
439 | <property stdset="1"> | 439 | <property stdset="1"> |
440 | <name>name</name> | 440 | <name>name</name> |
441 | <cstring>Servers</cstring> | 441 | <cstring>Servers</cstring> |
442 | </property> | 442 | </property> |
443 | <property stdset="1"> | 443 | <property stdset="1"> |
444 | <name>text</name> | 444 | <name>text</name> |
445 | <string>Servers</string> | 445 | <string>Servers</string> |
446 | </property> | 446 | </property> |
447 | </widget> | 447 | </widget> |
448 | <spacer> | 448 | <spacer> |
449 | <property> | 449 | <property> |
450 | <name>name</name> | 450 | <name>name</name> |
451 | <cstring>Spacer2</cstring> | 451 | <cstring>Spacer2</cstring> |
452 | </property> | 452 | </property> |
453 | <property stdset="1"> | 453 | <property stdset="1"> |
454 | <name>orientation</name> | 454 | <name>orientation</name> |
455 | <enum>Horizontal</enum> | 455 | <enum>Horizontal</enum> |
456 | </property> | 456 | </property> |
457 | <property stdset="1"> | 457 | <property stdset="1"> |
458 | <name>sizeType</name> | 458 | <name>sizeType</name> |
459 | <enum>Expanding</enum> | 459 | <enum>Expanding</enum> |
460 | </property> | 460 | </property> |
461 | <property> | 461 | <property> |
462 | <name>sizeHint</name> | 462 | <name>sizeHint</name> |
463 | <size> | 463 | <size> |
464 | <width>20</width> | 464 | <width>20</width> |
465 | <height>20</height> | 465 | <height>20</height> |
466 | </size> | 466 | </size> |
467 | </property> | 467 | </property> |
468 | </spacer> | 468 | </spacer> |
469 | </hbox> | 469 | </hbox> |
470 | </widget> | 470 | </widget> |
471 | <widget row="1" column="0" rowspan="1" colspan="2" > | 471 | <widget row="1" column="0" rowspan="1" colspan="2" > |
472 | <class>QListBox</class> | 472 | <class>QListBox</class> |
473 | <property stdset="1"> | 473 | <property stdset="1"> |
474 | <name>name</name> | 474 | <name>name</name> |
475 | <cstring>servers</cstring> | 475 | <cstring>servers</cstring> |
476 | </property> | 476 | </property> |
477 | <property stdset="1"> | 477 | <property stdset="1"> |
478 | <name>selectionMode</name> | 478 | <name>selectionMode</name> |
479 | <enum>Extended</enum> | 479 | <enum>Extended</enum> |
480 | </property> | 480 | </property> |
481 | </widget> | 481 | </widget> |
482 | <widget row="2" column="1" > | 482 | <widget row="2" column="1" > |
483 | <class>QPushButton</class> | 483 | <class>QPushButton</class> |
484 | <property stdset="1"> | 484 | <property stdset="1"> |
485 | <name>name</name> | 485 | <name>name</name> |
486 | <cstring>removeserver</cstring> | 486 | <cstring>removeserver</cstring> |
487 | </property> | 487 | </property> |
488 | <property stdset="1"> | 488 | <property stdset="1"> |
489 | <name>enabled</name> | 489 | <name>enabled</name> |
490 | <bool>true</bool> | 490 | <bool>true</bool> |
491 | </property> | 491 | </property> |
492 | <property stdset="1"> | 492 | <property stdset="1"> |
493 | <name>text</name> | 493 | <name>text</name> |
494 | <string>Remove</string> | 494 | <string>Remove</string> |
495 | </property> | 495 | </property> |
496 | <property stdset="1"> | 496 | <property stdset="1"> |
497 | <name>autoDefault</name> | 497 | <name>autoDefault</name> |
498 | <bool>false</bool> | 498 | <bool>false</bool> |
499 | </property> | 499 | </property> |
500 | </widget> | 500 | </widget> |
501 | <widget row="2" column="0" > | 501 | <widget row="2" column="0" > |
502 | <class>QPushButton</class> | 502 | <class>QPushButton</class> |
503 | <property stdset="1"> | 503 | <property stdset="1"> |
504 | <name>name</name> | 504 | <name>name</name> |
505 | <cstring>newserver</cstring> | 505 | <cstring>newserver</cstring> |
506 | </property> | 506 | </property> |
507 | <property stdset="1"> | 507 | <property stdset="1"> |
508 | <name>enabled</name> | 508 | <name>enabled</name> |
509 | <bool>true</bool> | 509 | <bool>true</bool> |
510 | </property> | 510 | </property> |
511 | <property stdset="1"> | 511 | <property stdset="1"> |
512 | <name>text</name> | 512 | <name>text</name> |
513 | <string>New</string> | 513 | <string>New</string> |
514 | </property> | 514 | </property> |
515 | <property stdset="1"> | 515 | <property stdset="1"> |
516 | <name>autoDefault</name> | 516 | <name>autoDefault</name> |
517 | <bool>false</bool> | 517 | <bool>false</bool> |
518 | </property> | 518 | </property> |
519 | </widget> | 519 | </widget> |
520 | </grid> | 520 | </grid> |
521 | </widget> | 521 | </widget> |
522 | <widget> | 522 | <widget> |
523 | <class>QWidget</class> | 523 | <class>QWidget</class> |
524 | <property stdset="1"> | 524 | <property stdset="1"> |
525 | <name>name</name> | 525 | <name>name</name> |
526 | <cstring>tab</cstring> | 526 | <cstring>tab</cstring> |
527 | </property> | 527 | </property> |
528 | <attribute> | 528 | <attribute> |
529 | <name>title</name> | 529 | <name>title</name> |
530 | <string>Destinations</string> | 530 | <string>Destinations</string> |
531 | </attribute> | 531 | </attribute> |
532 | <grid> | 532 | <grid> |
533 | <property stdset="1"> | 533 | <property stdset="1"> |
534 | <name>margin</name> | 534 | <name>margin</name> |
535 | <number>3</number> | 535 | <number>2</number> |
536 | </property> | 536 | </property> |
537 | <property stdset="1"> | 537 | <property stdset="1"> |
538 | <name>spacing</name> | 538 | <name>spacing</name> |
539 | <number>3</number> | 539 | <number>2</number> |
540 | </property> | 540 | </property> |
541 | <widget row="0" column="0" > | 541 | <widget row="0" column="0" > |
542 | <class>QLayoutWidget</class> | 542 | <class>QLayoutWidget</class> |
543 | <property stdset="1"> | 543 | <property stdset="1"> |
544 | <name>name</name> | 544 | <name>name</name> |
545 | <cstring>Layout3</cstring> | 545 | <cstring>Layout3</cstring> |
546 | </property> | 546 | </property> |
547 | <hbox> | 547 | <hbox> |
548 | <property stdset="1"> | 548 | <property stdset="1"> |
549 | <name>margin</name> | 549 | <name>margin</name> |
550 | <number>0</number> | 550 | <number>0</number> |
551 | </property> | 551 | </property> |
552 | <property stdset="1"> | 552 | <property stdset="1"> |
553 | <name>spacing</name> | 553 | <name>spacing</name> |
554 | <number>6</number> | 554 | <number>6</number> |
555 | </property> | 555 | </property> |
556 | <widget> | 556 | <widget> |
557 | <class>QLabel</class> | 557 | <class>QLabel</class> |
558 | <property stdset="1"> | 558 | <property stdset="1"> |
559 | <name>name</name> | 559 | <name>name</name> |
560 | <cstring>Destinations</cstring> | 560 | <cstring>Destinations</cstring> |
561 | </property> | 561 | </property> |
562 | <property stdset="1"> | 562 | <property stdset="1"> |
563 | <name>text</name> | 563 | <name>text</name> |
564 | <string>Destinations</string> | 564 | <string>Destinations</string> |
565 | </property> | 565 | </property> |
566 | </widget> | 566 | </widget> |
567 | <spacer> | 567 | <spacer> |
568 | <property> | 568 | <property> |
569 | <name>name</name> | 569 | <name>name</name> |
570 | <cstring>Spacer2_2</cstring> | 570 | <cstring>Spacer2_2</cstring> |
571 | </property> | 571 | </property> |
572 | <property stdset="1"> | 572 | <property stdset="1"> |
573 | <name>orientation</name> | 573 | <name>orientation</name> |
574 | <enum>Horizontal</enum> | 574 | <enum>Horizontal</enum> |
575 | </property> | 575 | </property> |
576 | <property stdset="1"> | 576 | <property stdset="1"> |
577 | <name>sizeType</name> | 577 | <name>sizeType</name> |
578 | <enum>Expanding</enum> | 578 | <enum>Expanding</enum> |
579 | </property> | 579 | </property> |
580 | <property> | 580 | <property> |
581 | <name>sizeHint</name> | 581 | <name>sizeHint</name> |
582 | <size> | 582 | <size> |
583 | <width>20</width> | 583 | <width>20</width> |
584 | <height>20</height> | 584 | <height>20</height> |
585 | </size> | 585 | </size> |
586 | </property> | 586 | </property> |
587 | </spacer> | 587 | </spacer> |
588 | </hbox> | 588 | </hbox> |
589 | </widget> | 589 | </widget> |
590 | <widget row="1" column="0" > | 590 | <widget row="1" column="0" > |
591 | <class>QListBox</class> | 591 | <class>QListBox</class> |
592 | <property stdset="1"> | 592 | <property stdset="1"> |
593 | <name>name</name> | 593 | <name>name</name> |
594 | <cstring>destinations</cstring> | 594 | <cstring>destinations</cstring> |
595 | </property> | 595 | </property> |
596 | <property stdset="1"> | 596 | <property stdset="1"> |
597 | <name>selectionMode</name> | 597 | <name>selectionMode</name> |
598 | <enum>Single</enum> | 598 | <enum>Single</enum> |
599 | </property> | 599 | </property> |
600 | </widget> | 600 | </widget> |
601 | <widget row="2" column="0" > | 601 | <widget row="2" column="0" > |
602 | <class>QLayoutWidget</class> | 602 | <class>QLayoutWidget</class> |
603 | <property stdset="1"> | 603 | <property stdset="1"> |
604 | <name>name</name> | 604 | <name>name</name> |
605 | <cstring>Layout5</cstring> | 605 | <cstring>Layout5</cstring> |
606 | </property> | 606 | </property> |
607 | <hbox> | 607 | <hbox> |
608 | <property stdset="1"> | 608 | <property stdset="1"> |
609 | <name>margin</name> | 609 | <name>margin</name> |
610 | <number>0</number> | 610 | <number>0</number> |
611 | </property> | 611 | </property> |
612 | <property stdset="1"> | 612 | <property stdset="1"> |
613 | <name>spacing</name> | 613 | <name>spacing</name> |
614 | <number>6</number> | 614 | <number>6</number> |
615 | </property> | 615 | </property> |
616 | <widget> | 616 | <widget> |
617 | <class>QPushButton</class> | 617 | <class>QPushButton</class> |
618 | <property stdset="1"> | 618 | <property stdset="1"> |
619 | <name>name</name> | 619 | <name>name</name> |
620 | <cstring>newdestination</cstring> | 620 | <cstring>newdestination</cstring> |
621 | </property> | 621 | </property> |
622 | <property stdset="1"> | 622 | <property stdset="1"> |
623 | <name>enabled</name> | 623 | <name>enabled</name> |
624 | <bool>true</bool> | 624 | <bool>true</bool> |
625 | </property> | 625 | </property> |
626 | <property stdset="1"> | 626 | <property stdset="1"> |
627 | <name>text</name> | 627 | <name>text</name> |
628 | <string>New</string> | 628 | <string>New</string> |
629 | </property> | 629 | </property> |
630 | <property stdset="1"> | 630 | <property stdset="1"> |
631 | <name>autoDefault</name> | 631 | <name>autoDefault</name> |
632 | <bool>false</bool> | 632 | <bool>false</bool> |
633 | </property> | 633 | </property> |
634 | </widget> | 634 | </widget> |
635 | <widget> | 635 | <widget> |
636 | <class>QPushButton</class> | 636 | <class>QPushButton</class> |
637 | <property stdset="1"> | 637 | <property stdset="1"> |
638 | <name>name</name> | 638 | <name>name</name> |
639 | <cstring>removedestination</cstring> | 639 | <cstring>removedestination</cstring> |
640 | </property> | 640 | </property> |
641 | <property stdset="1"> | 641 | <property stdset="1"> |
642 | <name>enabled</name> | 642 | <name>enabled</name> |
643 | <bool>true</bool> | 643 | <bool>true</bool> |
644 | </property> | 644 | </property> |
645 | <property stdset="1"> | 645 | <property stdset="1"> |
646 | <name>text</name> | 646 | <name>text</name> |
647 | <string>Remove</string> | 647 | <string>Remove</string> |
648 | </property> | 648 | </property> |
649 | <property stdset="1"> | 649 | <property stdset="1"> |
650 | <name>autoDefault</name> | 650 | <name>autoDefault</name> |
651 | <bool>false</bool> | 651 | <bool>false</bool> |
652 | </property> | 652 | </property> |
653 | </widget> | 653 | </widget> |
654 | </hbox> | 654 | </hbox> |
655 | </widget> | 655 | </widget> |
656 | <widget row="3" column="0" > | 656 | <widget row="3" column="0" > |
657 | <class>QLayoutWidget</class> | 657 | <class>QLayoutWidget</class> |
658 | <property stdset="1"> | 658 | <property stdset="1"> |
659 | <name>name</name> | 659 | <name>name</name> |
660 | <cstring>Layout11</cstring> | 660 | <cstring>Layout11</cstring> |
661 | </property> | 661 | </property> |
662 | <property> | 662 | <property> |
663 | <name>layoutMargin</name> | 663 | <name>layoutMargin</name> |
664 | </property> | 664 | </property> |
665 | <property> | 665 | <property> |
666 | <name>layoutSpacing</name> | 666 | <name>layoutSpacing</name> |
667 | </property> | 667 | </property> |
668 | <grid> | 668 | <grid> |
669 | <property stdset="1"> | 669 | <property stdset="1"> |
670 | <name>margin</name> | 670 | <name>margin</name> |
671 | <number>3</number> | 671 | <number>3</number> |
672 | </property> | 672 | </property> |
673 | <property stdset="1"> | 673 | <property stdset="1"> |
674 | <name>spacing</name> | 674 | <name>spacing</name> |
675 | <number>3</number> | 675 | <number>3</number> |
676 | </property> | 676 | </property> |
677 | <widget row="1" column="0" > | 677 | <widget row="1" column="0" > |
678 | <class>QLabel</class> | 678 | <class>QLabel</class> |
679 | <property stdset="1"> | 679 | <property stdset="1"> |
680 | <name>name</name> | 680 | <name>name</name> |
681 | <cstring>TextLabel1_3_2_2</cstring> | 681 | <cstring>TextLabel1_3_2_2</cstring> |
682 | </property> | 682 | </property> |
683 | <property stdset="1"> | 683 | <property stdset="1"> |
684 | <name>text</name> | 684 | <name>text</name> |
685 | <string>URL:</string> | 685 | <string>URL:</string> |
686 | </property> | 686 | </property> |
687 | </widget> | 687 | </widget> |
688 | <widget row="0" column="1" > | 688 | <widget row="0" column="1" > |
689 | <class>QLineEdit</class> | 689 | <class>QLineEdit</class> |
690 | <property stdset="1"> | 690 | <property stdset="1"> |
691 | <name>name</name> | 691 | <name>name</name> |
692 | <cstring>destinationname</cstring> | 692 | <cstring>destinationname</cstring> |
693 | </property> | 693 | </property> |
694 | </widget> | 694 | </widget> |
695 | <widget row="1" column="1" > | 695 | <widget row="1" column="1" > |
696 | <class>QLineEdit</class> | 696 | <class>QLineEdit</class> |
697 | <property stdset="1"> | 697 | <property stdset="1"> |
698 | <name>name</name> | 698 | <name>name</name> |
699 | <cstring>destinationurl</cstring> | 699 | <cstring>destinationurl</cstring> |
700 | </property> | 700 | </property> |
701 | </widget> | 701 | </widget> |
702 | <widget row="0" column="0" > | 702 | <widget row="0" column="0" > |
703 | <class>QLabel</class> | 703 | <class>QLabel</class> |
704 | <property stdset="1"> | 704 | <property stdset="1"> |
705 | <name>name</name> | 705 | <name>name</name> |
706 | <cstring>TextLabel1_3_2</cstring> | 706 | <cstring>TextLabel1_3_2</cstring> |
707 | </property> | 707 | </property> |
708 | <property stdset="1"> | 708 | <property stdset="1"> |
709 | <name>text</name> | 709 | <name>text</name> |
710 | <string>Name:</string> | 710 | <string>Name:</string> |
711 | </property> | 711 | </property> |
712 | </widget> | 712 | </widget> |
713 | </grid> | 713 | </grid> |
714 | </widget> | 714 | </widget> |
715 | <widget row="4" column="0" > | ||
716 | <class>QLayoutWidget</class> | ||
717 | <property stdset="1"> | ||
718 | <name>name</name> | ||
719 | <cstring>Layout11</cstring> | ||
720 | </property> | ||
721 | <hbox> | ||
722 | <property stdset="1"> | ||
723 | <name>margin</name> | ||
724 | <number>0</number> | ||
725 | </property> | ||
726 | <property stdset="1"> | ||
727 | <name>spacing</name> | ||
728 | <number>6</number> | ||
729 | </property> | ||
730 | <widget> | ||
731 | <class>QPushButton</class> | ||
732 | <property stdset="1"> | ||
733 | <name>name</name> | ||
734 | <cstring>createLinksButton</cstring> | ||
735 | </property> | ||
736 | <property stdset="1"> | ||
737 | <name>enabled</name> | ||
738 | <bool>false</bool> | ||
739 | </property> | ||
740 | <property stdset="1"> | ||
741 | <name>text</name> | ||
742 | <string>link to /</string> | ||
743 | </property> | ||
744 | </widget> | ||
745 | <widget> | ||
746 | <class>QPushButton</class> | ||
747 | <property stdset="1"> | ||
748 | <name>name</name> | ||
749 | <cstring>removeLinksButton</cstring> | ||
750 | </property> | ||
751 | <property stdset="1"> | ||
752 | <name>enabled</name> | ||
753 | <bool>false</bool> | ||
754 | </property> | ||
755 | <property stdset="1"> | ||
756 | <name>text</name> | ||
757 | <string>Remove links</string> | ||
758 | </property> | ||
759 | </widget> | ||
760 | </hbox> | ||
761 | </widget> | ||
762 | <widget row="5" column="0" > | ||
763 | <class>QGroupBox</class> | ||
764 | <property stdset="1"> | ||
765 | <name>name</name> | ||
766 | <cstring>GroupBox1</cstring> | ||
767 | </property> | ||
768 | <property stdset="1"> | ||
769 | <name>title</name> | ||
770 | <string></string> | ||
771 | </property> | ||
772 | <grid> | ||
773 | <property stdset="1"> | ||
774 | <name>margin</name> | ||
775 | <number>11</number> | ||
776 | </property> | ||
777 | <property stdset="1"> | ||
778 | <name>spacing</name> | ||
779 | <number>6</number> | ||
780 | </property> | ||
781 | <widget row="0" column="0" > | ||
782 | <class>QLayoutWidget</class> | ||
783 | <property stdset="1"> | ||
784 | <name>name</name> | ||
785 | <cstring>Layout12</cstring> | ||
786 | </property> | ||
787 | <hbox> | ||
788 | <property stdset="1"> | ||
789 | <name>margin</name> | ||
790 | <number>0</number> | ||
791 | </property> | ||
792 | <property stdset="1"> | ||
793 | <name>spacing</name> | ||
794 | <number>6</number> | ||
795 | </property> | ||
796 | <widget> | ||
797 | <class>QCheckBox</class> | ||
798 | <property stdset="1"> | ||
799 | <name>name</name> | ||
800 | <cstring>CheckBoxvolatile</cstring> | ||
801 | </property> | ||
802 | <property stdset="1"> | ||
803 | <name>enabled</name> | ||
804 | <bool>false</bool> | ||
805 | </property> | ||
806 | <property stdset="1"> | ||
807 | <name>text</name> | ||
808 | <string>volatile</string> | ||
809 | </property> | ||
810 | </widget> | ||
811 | <widget> | ||
812 | <class>QCheckBox</class> | ||
813 | <property stdset="1"> | ||
814 | <name>name</name> | ||
815 | <cstring>removeable</cstring> | ||
816 | </property> | ||
817 | <property stdset="1"> | ||
818 | <name>enabled</name> | ||
819 | <bool>false</bool> | ||
820 | </property> | ||
821 | <property stdset="1"> | ||
822 | <name>text</name> | ||
823 | <string>removeable</string> | ||
824 | </property> | ||
825 | </widget> | ||
826 | </hbox> | ||
827 | </widget> | ||
828 | </grid> | ||
829 | </widget> | ||
715 | </grid> | 830 | </grid> |
716 | </widget> | 831 | </widget> |
717 | </widget> | 832 | </widget> |
718 | </grid> | 833 | </grid> |
719 | </widget> | 834 | </widget> |
720 | <connections> | 835 | <connections> |
721 | <connection> | 836 | <connection> |
722 | <sender>activeServers</sender> | 837 | <sender>activeServers</sender> |
723 | <signal>pressed(QListBoxItem*)</signal> | 838 | <signal>pressed(QListBoxItem*)</signal> |
724 | <receiver>Form4</receiver> | 839 | <receiver>Form4</receiver> |
725 | <slot>activeServerChanged()</slot> | 840 | <slot>activeServerChanged()</slot> |
726 | </connection> | 841 | </connection> |
727 | <connection> | 842 | <connection> |
728 | <sender>activeServers</sender> | 843 | <sender>activeServers</sender> |
729 | <signal>selectionChanged(QListBoxItem*)</signal> | 844 | <signal>selectionChanged(QListBoxItem*)</signal> |
730 | <receiver>Form4</receiver> | 845 | <receiver>Form4</receiver> |
731 | <slot>activeServerChanged()</slot> | 846 | <slot>activeServerChanged()</slot> |
732 | </connection> | 847 | </connection> |
733 | <connection> | 848 | <connection> |
734 | <sender>activeServers</sender> | 849 | <sender>activeServers</sender> |
735 | <signal>pressed(QListBoxItem*)</signal> | 850 | <signal>pressed(QListBoxItem*)</signal> |
736 | <receiver>Form4</receiver> | 851 | <receiver>Form4</receiver> |
737 | <slot>activeServerChanged()</slot> | 852 | <slot>activeServerChanged()</slot> |
738 | </connection> | 853 | </connection> |
854 | <connection> | ||
855 | <sender>createLinksButton</sender> | ||
856 | <signal>clicked()</signal> | ||
857 | <receiver>Form4</receiver> | ||
858 | <slot>createLinksToDest()</slot> | ||
859 | </connection> | ||
860 | <connection> | ||
861 | <sender>removeLinksButton</sender> | ||
862 | <signal>clicked()</signal> | ||
863 | <receiver>Form4</receiver> | ||
864 | <slot>removeLinksToDest()</slot> | ||
865 | </connection> | ||
866 | <slot access="public">activeServerChanged()</slot> | ||
867 | <slot access="public">createLinksToDest()</slot> | ||
739 | <slot access="public">destNameChanged(const QString&)</slot> | 868 | <slot access="public">destNameChanged(const QString&)</slot> |
740 | <slot access="public">destUrlChanged(const QString&)</slot> | 869 | <slot access="public">destUrlChanged(const QString&)</slot> |
741 | <slot access="public">editDestination(int)</slot> | 870 | <slot access="public">editDestination(int)</slot> |
742 | <slot access="public">editServer(int)</slot> | 871 | <slot access="public">editServer(int)</slot> |
743 | <slot access="public">installationSettingChange(int)</slot> | 872 | <slot access="public">installationSettingChange(int)</slot> |
744 | <slot access="public">installationSettingSetName(const QString &)</slot> | 873 | <slot access="public">installationSettingSetName(const QString &)</slot> |
745 | <slot access="public">linkEnabled(bool)</slot> | 874 | <slot access="public">linkEnabled(bool)</slot> |
746 | <slot access="public">newDestination()</slot> | 875 | <slot access="public">newDestination()</slot> |
747 | <slot access="public">newInstallationSetting()</slot> | 876 | <slot access="public">newInstallationSetting()</slot> |
748 | <slot access="public">newServer()</slot> | 877 | <slot access="public">newServer()</slot> |
749 | <slot access="public">activeServerChanged()</slot> | ||
750 | <slot access="public">removeDestination()</slot> | 878 | <slot access="public">removeDestination()</slot> |
751 | <slot access="public">removeInstallationSetting()</slot> | 879 | <slot access="public">removeInstallationSetting()</slot> |
880 | <slot access="public">removeLinksToDest()</slot> | ||
752 | <slot access="public">removeServer()</slot> | 881 | <slot access="public">removeServer()</slot> |
753 | <slot access="public">renameInstallationSetting()</slot> | 882 | <slot access="public">renameInstallationSetting()</slot> |
754 | <slot access="public">serverNameChanged(const QString&)</slot> | 883 | <slot access="public">serverNameChanged(const QString&)</slot> |
755 | <slot access="public">serverUrlChanged(const QString&)</slot> | 884 | <slot access="public">serverUrlChanged(const QString&)</slot> |
756 | </connections> | 885 | </connections> |
757 | </UI> | 886 | </UI> |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 9f6429a..fe200f5 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -1,460 +1,458 @@ | |||
1 | #include "pmipkg.h" | 1 | #include "pmipkg.h" |
2 | #include "pksettings.h" | 2 | #include "pksettings.h" |
3 | #include "package.h" | 3 | #include "package.h" |
4 | #include "packagelistitem.h" | 4 | #include "packagelistitem.h" |
5 | 5 | ||
6 | #include <qpe/process.h> | 6 | #include <qpe/process.h> |
7 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
8 | #include <qpe/config.h> | 8 | #include <qpe/config.h> |
9 | #include <qpe/stringutil.h> | 9 | #include <qpe/stringutil.h> |
10 | #include <qdir.h> | 10 | #include <qdir.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qgroupbox.h> | 12 | #include <qgroupbox.h> |
13 | #include <qmultilineedit.h> | 13 | #include <qmultilineedit.h> |
14 | #include <qstring.h> | 14 | #include <qstring.h> |
15 | #include <qcheckbox.h> | 15 | #include <qcheckbox.h> |
16 | #include <qtextstream.h> | 16 | #include <qtextstream.h> |
17 | #include <qtextview.h> | 17 | #include <qtextview.h> |
18 | 18 | ||
19 | #include <qprogressbar.h> | 19 | #include <qprogressbar.h> |
20 | #include <qpushbutton.h> | 20 | #include <qpushbutton.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | 22 | ||
23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
24 | #include <unistd.h> | 24 | #include <unistd.h> |
25 | 25 | ||
26 | #include "mainwindow.h" | 26 | #include "mainwindow.h" |
27 | 27 | ||
28 | 28 | ||
29 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) | 29 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) |
30 | : QObject ( p ) | 30 | : QObject ( p ) |
31 | { | 31 | { |
32 | settings = s; | 32 | settings = s; |
33 | runwindowopen = false; | 33 | runwindowopen = false; |
34 | runwindow = new RunWindow( p, name, true, f ); | 34 | runwindow = new RunWindow( p, name, true, f ); |
35 | } | 35 | } |
36 | 36 | ||
37 | PmIpkg::~PmIpkg() | 37 | PmIpkg::~PmIpkg() |
38 | { | 38 | { |
39 | } | 39 | } |
40 | 40 | ||
41 | //#define PROC | 41 | //#define PROC |
42 | #define SYSTEM | 42 | #define SYSTEM |
43 | int PmIpkg::runIpkg(const QString& args, const QString& dest ) | 43 | int PmIpkg::runIpkg(const QString& args, const QString& dest ) |
44 | { | 44 | { |
45 | pvDebug(2,"PmIpkg::runIpkg "+args); | 45 | pvDebug(2,"PmIpkg::runIpkg "+args); |
46 | 46 | ||
47 | #ifdef PROC | 47 | #ifdef PROC |
48 | QStringList cmd = "/usr/bin/ipkg "; | 48 | QStringList cmd = "/usr/bin/ipkg "; |
49 | #endif | 49 | #endif |
50 | #ifdef SYSTEM | 50 | #ifdef SYSTEM |
51 | QString cmd = "/usr/bin/ipkg "; | 51 | QString cmd = "/usr/bin/ipkg "; |
52 | #endif | 52 | #endif |
53 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); | 53 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); |
54 | if ( dest == "" ) | 54 | if ( dest == "" ) |
55 | cmd += " -dest "+settings->getDestinationName(); | 55 | cmd += " -dest "+settings->getDestinationName(); |
56 | else | 56 | else |
57 | cmd += " -dest "+ dest; | 57 | cmd += " -dest "+ dest; |
58 | 58 | ||
59 | cmd += " -force-defaults "; | 59 | cmd += " -force-defaults "; |
60 | 60 | ||
61 | if (_force_depends) | 61 | if (_force_depends) |
62 | { | 62 | { |
63 | if (_force_depends->isChecked()) | 63 | if (_force_depends->isChecked()) |
64 | cmd += " -force-depends "; | 64 | cmd += " -force-depends "; |
65 | if (_force_reinstall->isChecked()) | 65 | if (_force_reinstall->isChecked()) |
66 | cmd += " -force-reinstall "; | 66 | cmd += " -force-reinstall "; |
67 | if (_force_remove->isChecked()) | 67 | if (_force_remove->isChecked()) |
68 | cmd += " -force-removal-of-essential-packages "; | 68 | cmd += " -force-removal-of-essential-packages "; |
69 | } | 69 | } |
70 | 70 | ||
71 | out( "<hr><br>Starting to "+ args+"<br>\n"); | 71 | out( "<hr><br>Starting to "+ args+"<br>\n"); |
72 | cmd += args; | 72 | cmd += args; |
73 | int r = 0; | 73 | int r = 0; |
74 | #ifdef PROC | 74 | #ifdef PROC |
75 | QString o = "start"; | 75 | QString o = "start"; |
76 | Process *ipkg = new Process( "ls");//cmd ); | 76 | Process *ipkg = new Process( "ls");//cmd ); |
77 | out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); | 77 | out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); |
78 | QString description; | 78 | QString description; |
79 | ipkg->exec("",o); | 79 | ipkg->exec("",o); |
80 | // out( o ); | 80 | // out( o ); |
81 | #endif | 81 | #endif |
82 | #ifdef SYSTEM | 82 | #ifdef SYSTEM |
83 | out( "running:<br>\n"+cmd+"<br>\n" ); | 83 | out( "running:<br>\n"+cmd+"<br>\n" ); |
84 | QString redirect = "/tmp/oipkg.pipe"; | 84 | QString redirect = "/tmp/oipkg.pipe"; |
85 | cmd += " 2>&1 | tee "+redirect+" 2>&1"; | 85 | cmd += " 2>&1 | tee "+redirect+" 2>&1"; |
86 | pvDebug(2, "running >"+cmd+"<"); | 86 | pvDebug(2, "running >"+cmd+"<"); |
87 | r = system(cmd.latin1()); | 87 | r = system(cmd.latin1()); |
88 | QFile f( redirect ); | 88 | QFile f( redirect ); |
89 | QString line; | 89 | QString line; |
90 | QString oldLine; | 90 | QString oldLine; |
91 | while ( ! f.open(IO_ReadOnly) ) {}; | 91 | while ( ! f.open(IO_ReadOnly) ) {}; |
92 | QTextStream t( &f ); | 92 | QTextStream t( &f ); |
93 | while ( !t.eof() ) | 93 | while ( !t.eof() ) |
94 | { | 94 | { |
95 | line = t.readLine(); | 95 | line = t.readLine(); |
96 | if ( line != oldLine ) | 96 | if ( line != oldLine ) |
97 | { | 97 | { |
98 | out( line +"<br>" ); | 98 | out( line +"<br>" ); |
99 | oldLine = line; | 99 | oldLine = line; |
100 | } | 100 | } |
101 | } | 101 | } |
102 | f.close(); | 102 | f.close(); |
103 | out( "Finished!<br>"); | 103 | out( "Finished!<br>"); |
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | return r; | 106 | return r; |
107 | } | 107 | } |
108 | 108 | ||
109 | void PmIpkg::makeLinks(Package *pack) | 109 | void PmIpkg::makeLinks(Package *pack) |
110 | { | 110 | { |
111 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); | 111 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); |
112 | linkPackage( pack->name(), pack->dest() ); | 112 | linkPackage( pack->name(), pack->dest() ); |
113 | } | 113 | } |
114 | 114 | ||
115 | QStringList* PmIpkg::getList( QString packFileName, QString d ) | 115 | QStringList* PmIpkg::getList( QString packFileName, QString d ) |
116 | { | 116 | { |
117 | QString dest = settings->getDestinationUrlByName( d ); | 117 | QString dest = settings->getDestinationUrlByName( d ); |
118 | dest = dest==""?d:dest; | 118 | dest = dest==""?d:dest; |
119 | if (dest == "/" ) return 0; | 119 | if (dest == "/" ) return 0; |
120 | { | 120 | { |
121 | Config cfg( "oipkg", Config::User ); | 121 | Config cfg( "oipkg", Config::User ); |
122 | cfg.setGroup( "Common" ); | 122 | cfg.setGroup( "Common" ); |
123 | QString statusDir = cfg.readEntry( "statusDir", "" ); | 123 | QString statusDir = cfg.readEntry( "statusDir", "" ); |
124 | } | 124 | } |
125 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; | 125 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; |
126 | QFile f( packFileName ); | 126 | QFile f( packFileName ); |
127 | if ( ! f.open(IO_ReadOnly) ) | 127 | if ( ! f.open(IO_ReadOnly) ) |
128 | { | 128 | { |
129 | pvDebug(1," Panik! Could not open"); | 129 | pvDebug(1," Panik! Could not open"); |
130 | out( "<b>Panik!</b> Could not open:<br>"+packFileName ); | 130 | out( "<b>Panik!</b> Could not open:<br>"+packFileName ); |
131 | return (QStringList*)0; | 131 | return (QStringList*)0; |
132 | } | 132 | } |
133 | QStringList *fileList = new QStringList(); | 133 | QStringList *fileList = new QStringList(); |
134 | QTextStream t( &f ); | 134 | QTextStream t( &f ); |
135 | while ( !t.eof() ) | 135 | while ( !t.eof() ) |
136 | { | 136 | { |
137 | *fileList += t.readLine(); | 137 | *fileList += t.readLine(); |
138 | } | 138 | } |
139 | return fileList; | 139 | return fileList; |
140 | } | 140 | } |
141 | 141 | ||
142 | void PmIpkg::linkPackage( QString packFileName, QString dest ) | 142 | void PmIpkg::linkPackage( QString packFileName, QString dest ) |
143 | { | 143 | { |
144 | QStringList *fileList = getList( packFileName, dest ); | 144 | QStringList *fileList = getList( packFileName, dest ); |
145 | processFileList( fileList, dest ); | 145 | processFileList( fileList, dest ); |
146 | delete fileList; | 146 | delete fileList; |
147 | } | 147 | } |
148 | 148 | ||
149 | void PmIpkg::processFileList( QStringList *fileList, QString d ) | 149 | void PmIpkg::processFileList( QStringList *fileList, QString d ) |
150 | { | 150 | { |
151 | if (!fileList) return; | 151 | if (!fileList) return; |
152 | for (uint i=0; i < fileList->count(); i++) | 152 | for (uint i=0; i < fileList->count(); i++) |
153 | { | 153 | { |
154 | QString dest = settings->getDestinationUrlByName( d ); | 154 | QString dest = settings->getDestinationUrlByName( d ); |
155 | dest = dest==""?d:dest; | 155 | dest = dest==""?d:dest; |
156 | processLinkDir( (*fileList)[i], dest ); | 156 | processLinkDir( (*fileList)[i], dest ); |
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | 160 | ||
161 | void PmIpkg::processLinkDir( QString file, QString dest ) | 161 | void PmIpkg::processLinkDir( QString file, QString dest ) |
162 | { | 162 | { |
163 | pvDebug( 7,"PmIpkg::processLinkDir "+file+" to "+ dest); | 163 | pvDebug( 7,"PmIpkg::processLinkDir "+file+" to "+ dest); |
164 | if (linkOpp==createLink) pvDebug( 2,"opp: createLink"); | 164 | if (linkOpp==createLink) pvDebug( 2,"opp: createLink"); |
165 | if (linkOpp==removeLink) pvDebug( 2,"opp:removeLink"); | 165 | if (linkOpp==removeLink) pvDebug( 2,"opp:removeLink"); |
166 | if ( dest == "???" || dest == "" ) return; | 166 | if ( dest == "???" || dest == "" ) return; |
167 | QString destFile = file; | 167 | QString destFile = file; |
168 | file = dest+"/"+file; | 168 | file = dest+"/"+file; |
169 | if (file == dest) return; | 169 | if (file == dest) return; |
170 | QFileInfo fileInfo( file ); | 170 | QFileInfo fileInfo( file ); |
171 | if ( fileInfo.isDir() ) | 171 | if ( fileInfo.isDir() ) |
172 | { | 172 | { |
173 | QDir destDir( destFile ); | 173 | QDir destDir( destFile ); |
174 | if (linkOpp==createLink) destDir.mkdir( destFile, true ); | 174 | if (linkOpp==createLink) destDir.mkdir( destFile, true ); |
175 | QDir d( file ); | 175 | QDir d( file ); |
176 | d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); | 176 | d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); |
177 | const QFileInfoList *list = d.entryInfoList(); | 177 | const QFileInfoList *list = d.entryInfoList(); |
178 | QFileInfoListIterator it( *list ); | 178 | QFileInfoListIterator it( *list ); |
179 | QFileInfo *fi; | 179 | QFileInfo *fi; |
180 | while ( (fi=it.current()) ) | 180 | while ( (fi=it.current()) ) |
181 | { | 181 | { |
182 | pvDebug(4, "process dir "+fi->absFilePath()); | 182 | pvDebug(4, "process dir "+fi->absFilePath()); |
183 | processLinkDir( fi->absFilePath(), dest ); | 183 | processLinkDir( fi->absFilePath(), dest ); |
184 | ++it; | 184 | ++it; |
185 | } | 185 | } |
186 | // if (linkOpp==removeLink) | 186 | // if (linkOpp==removeLink) |
187 | // { | 187 | // { |
188 | // pvDebug(2,"remove destDir "+ destFile ); | 188 | // pvDebug(2,"remove destDir "+ destFile ); |
189 | // destDir.remove( destFile, true ); | 189 | // destDir.remove( destFile, true ); |
190 | // } | 190 | // } |
191 | } else | 191 | } else |
192 | if ( fileInfo.isFile() ) | 192 | if ( fileInfo.isFile() ) |
193 | { | 193 | { |
194 | const char *instFile = strdup( (file).ascii() ); | 194 | const char *instFile = strdup( (file).ascii() ); |
195 | const char *linkFile = strdup( (destFile).ascii()); | 195 | const char *linkFile = strdup( (destFile).ascii()); |
196 | if( linkOpp==createLink ) | 196 | if( linkOpp==createLink ) |
197 | { | 197 | { |
198 | pvDebug(4, "linking: "+file+" -> "+destFile ); | 198 | pvDebug(4, "linking: "+file+" -> "+destFile ); |
199 | symlink( instFile, linkFile ); | 199 | symlink( instFile, linkFile ); |
200 | } | 200 | } |
201 | } else { | 201 | } else { |
202 | const char *linkFile = strdup( (destFile).ascii()); | 202 | const char *linkFile = strdup( (destFile).ascii()); |
203 | if( linkOpp==removeLink ) | 203 | if( linkOpp==removeLink ) |
204 | { | 204 | { |
205 | pvDebug(4,"removing "+destFile+" no "+file); | 205 | pvDebug(4,"removing "+destFile+" no "+file); |
206 | QFileInfo toRemoveLink( destFile ); | 206 | QFileInfo toRemoveLink( destFile ); |
207 | if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) | 207 | if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) |
208 | unlink( linkFile ); | 208 | unlink( linkFile ); |
209 | } | 209 | } |
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | void PmIpkg::commit( PackageList pl ) | 213 | void PmIpkg::loadList( PackageList pl ) |
214 | { | 214 | { |
215 | int sizecount = 0; | ||
216 | to_install.clear(); | ||
217 | to_remove.clear(); | ||
218 | QString rem="<b>"+tr("To remove:")+"</b><br>\n"; | ||
219 | QString inst="<b>"+tr("To install:")+"</b><br>\n"; | ||
220 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) | 215 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) |
221 | { | 216 | { |
222 | if ( pack && (pack->name() != "") && pack) | 217 | if ( pack && (pack->name() != "") && pack) |
223 | { | 218 | { |
224 | if ( pack->toInstall() ) | 219 | if ( pack->toInstall() ) |
225 | { | ||
226 | to_install.append( pack ); | 220 | to_install.append( pack ); |
227 | sizecount += pack->size().toInt(); | 221 | if ( pack->toRemove() ) |
228 | inst += pack->name()+"\t("+tr("on ")+pack->dest()+")<br>"; | ||
229 | } | ||
230 | if ( pack->toRemove() ) | ||
231 | { | ||
232 | to_remove.append( pack ); | 222 | to_remove.append( pack ); |
233 | sizecount += 1; | 223 | } |
234 | rem += pack->name()+"<br>"; | 224 | } |
235 | } | 225 | } |
236 | } | ||
237 | } | ||
238 | 226 | ||
227 | void PmIpkg::commit( PackageList pl ) | ||
228 | { | ||
229 | sizecount = 0; | ||
230 | QString rem="<b>"+tr("To remove:")+"</b><br>\n"; | ||
231 | QString inst="<b>"+tr("To install:")+"</b><br>\n"; | ||
232 | loadList(pl); | ||
233 | for (uint i=0; i < to_remove.count(); i++) | ||
234 | sizecount += 1; | ||
235 | for (uint i=0; i < to_install.count(); i++) | ||
236 | sizecount += to_install.at(i)->size().toInt(); | ||
239 | startDialog(); | 237 | startDialog(); |
240 | |||
241 | } | 238 | } |
242 | 239 | ||
243 | void PmIpkg::startDialog() | 240 | void PmIpkg::startDialog() |
244 | { | 241 | { |
245 | installDialog = new QDialog(0,0,true); | 242 | installDialog = new QDialog(0,0,true); |
246 | QGridLayout *RunWindowLayout = new QGridLayout( installDialog ); | 243 | QGridLayout *RunWindowLayout = new QGridLayout( installDialog ); |
247 | RunWindowLayout->setSpacing( 2 ); | 244 | RunWindowLayout->setSpacing( 2 ); |
248 | RunWindowLayout->setMargin( 2 ); | 245 | RunWindowLayout->setMargin( 2 ); |
249 | 246 | ||
250 | PackageListView *plv = new PackageListView(installDialog, "install",settings); | 247 | PackageListView *plv = new PackageListView(installDialog, "install",settings); |
251 | plv->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding, plv->sizePolicy().mayShrinkVertically()) ); | 248 | plv->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding, plv->sizePolicy().mayShrinkVertically()) ); |
252 | RunWindowLayout->addWidget( plv, 1, 0 ); | 249 | RunWindowLayout->addWidget( plv, 1, 0 ); |
253 | QCheckListItem *toRemoveItem; | 250 | QCheckListItem *toRemoveItem; |
254 | toRemoveItem= new QCheckListItem( plv, QObject::tr("To remove") ); | 251 | toRemoveItem= new QCheckListItem( plv, QObject::tr("To remove") ); |
255 | toRemoveItem->setOpen( true ); | 252 | toRemoveItem->setOpen( true ); |
256 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | 253 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) |
257 | { | 254 | { |
258 | toRemoveItem->insertItem( new PackageListItem(plv, it,settings) ); | 255 | toRemoveItem->insertItem( new PackageListItem(plv, it,settings) ); |
259 | } | 256 | } |
260 | QCheckListItem *toInstallItem; | 257 | QCheckListItem *toInstallItem; |
261 | toInstallItem = new QCheckListItem( plv, QObject::tr("To install") ); | 258 | toInstallItem = new QCheckListItem( plv, QObject::tr("To install") ); |
262 | toInstallItem->setOpen( true ); | 259 | toInstallItem->setOpen( true ); |
263 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) | 260 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) |
264 | { | 261 | { |
265 | toInstallItem->insertItem( new PackageListItem(plv, it,settings) ); | 262 | toInstallItem->insertItem( new PackageListItem(plv, it,settings) ); |
266 | } | 263 | } |
267 | 264 | ||
268 | QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" ); | 265 | QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" ); |
269 | GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().hasHeightForWidth() ) ); | 266 | GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().mayShrinkVertically() ) ); |
270 | GroupBox1->setTitle( tr( "Ipkg options" ) ); | 267 | GroupBox1->setTitle( tr( "Ipkg options" ) ); |
271 | GroupBox1->setColumnLayout(0, Qt::Vertical ); | 268 | GroupBox1->setColumnLayout(0, Qt::Vertical ); |
272 | GroupBox1->layout()->setSpacing( 0 ); | 269 | GroupBox1->layout()->setSpacing( 0 ); |
273 | GroupBox1->layout()->setMargin( 0 ); | 270 | GroupBox1->layout()->setMargin( 0 ); |
274 | QGridLayout *GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); | 271 | QGridLayout *GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); |
275 | GroupBox1Layout->setAlignment( Qt::AlignTop ); | 272 | GroupBox1Layout->setAlignment( Qt::AlignTop ); |
276 | GroupBox1Layout->setSpacing( 3 ); | 273 | GroupBox1Layout->setSpacing( 3 ); |
277 | GroupBox1Layout->setMargin( 3 ); | 274 | GroupBox1Layout->setMargin( 3 ); |
278 | |||
279 | _force_depends = new QCheckBox( GroupBox1, "_force_depends" ); | 275 | _force_depends = new QCheckBox( GroupBox1, "_force_depends" ); |
280 | _force_depends->setText( tr( "-force-depends" ) ); | 276 | _force_depends->setText( tr( "-force-depends" ) ); |
281 | _force_depends->setAutoResize( TRUE ); | 277 | _force_depends->setAutoResize( TRUE ); |
278 | _force_depends->setChecked(true); | ||
282 | GroupBox1Layout->addWidget( _force_depends, 0, 0 ); | 279 | GroupBox1Layout->addWidget( _force_depends, 0, 0 ); |
283 | _force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" ); | 280 | _force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" ); |
284 | _force_reinstall->setText( tr( "-force-reinstall" ) ); | 281 | _force_reinstall->setText( tr( "-force-reinstall" ) ); |
285 | _force_reinstall->setAutoResize( TRUE ); | 282 | _force_reinstall->setAutoResize( TRUE ); |
286 | GroupBox1Layout->addWidget( _force_reinstall, 1, 0 ); | 283 | GroupBox1Layout->addWidget( _force_reinstall, 1, 0 ); |
287 | _force_remove = new QCheckBox( GroupBox1, "_force_remove" ); | 284 | _force_remove = new QCheckBox( GroupBox1, "_force_remove" ); |
288 | _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); | 285 | _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); |
289 | _force_remove->setAutoResize( TRUE ); | 286 | _force_remove->setAutoResize( TRUE ); |
290 | GroupBox1Layout->addWidget( _force_remove, 1, 0 ); | 287 | GroupBox1Layout->addWidget( _force_remove, 1, 0 ); |
291 | RunWindowLayout->addWidget( GroupBox1 , 3, 0 ); | 288 | RunWindowLayout->addWidget( GroupBox1 , 3, 0 ); |
292 | 289 | ||
293 | // connect( doItButton, SIGNAL( clicked() ), | 290 | // connect( doItButton, SIGNAL( clicked() ), |
294 | // this, SLOT( doIt() ) ); | 291 | // this, SLOT( doIt() ) ); |
295 | // connect( installButton, SIGNAL( clicked() ), | 292 | // connect( installButton, SIGNAL( clicked() ), |
296 | // this, SLOT( install() ) ); | 293 | // this, SLOT( install() ) ); |
297 | // connect( removeButton, SIGNAL( clicked() ), | 294 | // connect( removeButton, SIGNAL( clicked() ), |
298 | // this, SLOT( remove() ) ); | 295 | // this, SLOT( remove() ) ); |
299 | // connect( cancelButton, SIGNAL( clicked() ), | 296 | // connect( cancelButton, SIGNAL( clicked() ), |
300 | // installDialog, SLOT( close() ) ); | 297 | // installDialog, SLOT( close() ) ); |
301 | installDialog->showMaximized(); | 298 | installDialog->showMaximized(); |
302 | if ( installDialog->exec() ) doIt(); | 299 | if ( installDialog->exec() ) doIt(); |
303 | installDialog->close(); | 300 | installDialog->close(); |
304 | out(tr("<b>All done.</b>")); | 301 | out(tr("<b>All done.</b>")); |
305 | } | 302 | } |
306 | 303 | ||
307 | void PmIpkg::doIt() | 304 | void PmIpkg::doIt() |
308 | { | 305 | { |
309 | show( true ); | 306 | show( true ); |
310 | remove(); | 307 | remove(); |
311 | install(); | 308 | install(); |
312 | } | 309 | } |
313 | 310 | ||
314 | 311 | ||
315 | void PmIpkg::remove() | 312 | void PmIpkg::remove() |
316 | { | 313 | { |
317 | if ( to_remove.count() == 0 ) return; | 314 | if ( to_remove.count() == 0 ) return; |
318 | 315 | ||
319 | out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>"); | 316 | out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>"); |
320 | 317 | ||
321 | QStringList *fileList; | 318 | QStringList *fileList; |
322 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | 319 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) |
323 | { | 320 | { |
324 | if ( it->link() )fileList = getList( it->name(), it->dest() ); | 321 | if ( it->link() )fileList = getList( it->name(), it->dest() ); |
325 | if ( runIpkg("remove " + it->name()) == 0) | 322 | if ( runIpkg("remove " + it->name()) == 0) |
326 | { | 323 | { |
327 | runwindow->progress->setProgress( 1 + runwindow->progress->progress() ); | 324 | runwindow->progress->setProgress( 1 + runwindow->progress->progress() ); |
328 | linkOpp = removeLink; | 325 | linkOpp = removeLink; |
329 | if ( it->link() ) | 326 | if ( it->link() ) |
330 | { | 327 | { |
331 | out( "<br>removing links<br>" ); | 328 | out( "<br>removing links<br>" ); |
332 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); | 329 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); |
333 | processFileList( fileList, it->dest() ); | 330 | processFileList( fileList, it->dest() ); |
334 | } | 331 | } |
335 | it->processed(); | 332 | it->processed(); |
333 | |||
336 | out("<br><hr>"); | 334 | out("<br><hr>"); |
337 | }else{ | 335 | }else{ |
338 | out("<b>"+tr("Error while removing")+"</b><hr>"+it->name()); | 336 | out("<b>"+tr("Error while removing")+"</b><hr>"+it->name()); |
339 | } | 337 | } |
340 | pvDebug(2,"delete File List"); | 338 | pvDebug(2,"delete File List"); |
341 | if ( it->link() )delete fileList; | 339 | if ( it->link() )delete fileList; |
342 | } | 340 | } |
343 | out("<br>"); | 341 | out("<br>"); |
344 | } | 342 | } |
345 | 343 | ||
346 | 344 | ||
347 | void PmIpkg::install() | 345 | void PmIpkg::install() |
348 | { | 346 | { |
349 | if ( to_install.count() == 0 ) return; | 347 | if ( to_install.count() == 0 ) return; |
350 | out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); | 348 | out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); |
351 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) | 349 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) |
352 | { | 350 | { |
353 | 351 | ||
354 | if ( runIpkg("install " + it->getPackageName(), it->dest() ) == 0 ) | 352 | if ( runIpkg("install " + it->installName(), it->dest() ) == 0 ) |
355 | { | 353 | { |
356 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); | 354 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); |
357 | linkOpp = createLink; | 355 | linkOpp = createLink; |
358 | if ( it->link() ) | 356 | if ( it->link() ) |
359 | { | 357 | { |
360 | out( "<br>creating links<br>" ); | 358 | out( "<br>creating links<br>" ); |
361 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); | 359 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); |
362 | makeLinks( it ); | 360 | makeLinks( it ); |
363 | } | 361 | } |
364 | it->processed(); | 362 | it->processed(); |
365 | out("<br><hr>"); | 363 | out("<br><hr>"); |
366 | }else{ | 364 | }else{ |
367 | out("<b>"+tr("Error while installing")+"</b><hr>"+it->name()); | 365 | out("<b>"+tr("Error while installing")+"</b><hr>"+it->name()); |
368 | } | 366 | } |
369 | } | 367 | } |
370 | out("<br>"); | 368 | out("<br>"); |
371 | } | 369 | } |
372 | 370 | ||
373 | void PmIpkg::createLinks( const QString &dest ) | 371 | void PmIpkg::createLinks( const QString &dest ) |
374 | { | 372 | { |
375 | pvDebug(2,"PmIpkg::createLinks "+dest); | 373 | pvDebug(2,"PmIpkg::createLinks "+dest); |
376 | linkOpp=createLink; | 374 | linkOpp=createLink; |
377 | QString url = settings->getDestinationUrlByName( dest ); | 375 | QString url = settings->getDestinationUrlByName( dest ); |
378 | url = url==""?dest:url; | 376 | url = url==""?dest:url; |
379 | processLinkDir( "/", url ); | 377 | processLinkDir( "/", url ); |
380 | } | 378 | } |
381 | 379 | ||
382 | void PmIpkg::removeLinks( const QString &dest ) | 380 | void PmIpkg::removeLinks( const QString &dest ) |
383 | { | 381 | { |
384 | pvDebug(2,"PmIpkg::removeLinks "+dest); | 382 | pvDebug(2,"PmIpkg::removeLinks "+dest); |
385 | linkOpp=removeLink; | 383 | linkOpp=removeLink; |
386 | QString url = settings->getDestinationUrlByName( dest ); | 384 | QString url = settings->getDestinationUrlByName( dest ); |
387 | url = url==""?dest:url; | 385 | url = url==""?dest:url; |
388 | processLinkDir( "/", url ); | 386 | processLinkDir( "/", url ); |
389 | } | 387 | } |
390 | 388 | ||
391 | void PmIpkg::update() | 389 | void PmIpkg::update() |
392 | { | 390 | { |
393 | show( false ); | 391 | show( false ); |
394 | runIpkg( "update" ); | 392 | runIpkg( "update" ); |
395 | runwindow->close(); | 393 | runwindow->close(); |
396 | } | 394 | } |
397 | 395 | ||
398 | void PmIpkg::out( QString o ) | 396 | void PmIpkg::out( QString o ) |
399 | { | 397 | { |
400 | runwindow->outPut->append(o); | 398 | runwindow->outPut->append(o); |
401 | //runwindow->outPut->setCursorPosition(0, runwindow->outPut->contentsHeight()); | 399 | //runwindow->outPut->setCursorPosition(0, runwindow->outPut->contentsHeight()); |
402 | //runwindow->outPut->setText( runwindow->outPut->text()+o ); | 400 | //runwindow->outPut->setText( runwindow->outPut->text()+o ); |
403 | runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight()); | 401 | runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight()); |
404 | } | 402 | } |
405 | 403 | ||
406 | 404 | ||
407 | void PmIpkg::showButtons(bool b) | 405 | void PmIpkg::showButtons(bool b) |
408 | { | 406 | { |
409 | if ( b ) | 407 | if ( b ) |
410 | { | 408 | { |
411 | runwindow->cancelButton->hide(); | 409 | runwindow->cancelButton->hide(); |
412 | runwindow->doItButton->hide(); | 410 | runwindow->doItButton->hide(); |
413 | runwindow->removeButton->hide(); | 411 | runwindow->removeButton->hide(); |
414 | runwindow->installButton->hide(); | 412 | runwindow->installButton->hide(); |
415 | }else{ | 413 | }else{ |
416 | runwindow->cancelButton->show(); | 414 | runwindow->cancelButton->show(); |
417 | runwindow->doItButton->show(); | 415 | runwindow->doItButton->show(); |
418 | runwindow->removeButton->show(); | 416 | runwindow->removeButton->show(); |
419 | runwindow->installButton->show(); | 417 | runwindow->installButton->show(); |
420 | 418 | ||
421 | } | 419 | } |
422 | } | 420 | } |
423 | 421 | ||
424 | void PmIpkg::show(bool b) | 422 | void PmIpkg::show(bool b) |
425 | { | 423 | { |
426 | if (!runwindow->isVisible()) | 424 | if (!runwindow->isVisible()) |
427 | runwindow->showMaximized(); | 425 | runwindow->showMaximized(); |
428 | showButtons(b); | 426 | showButtons(b); |
429 | if ( !b ) | 427 | if ( !b ) |
430 | runwindow->progress->hide(); | 428 | runwindow->progress->hide(); |
431 | else | 429 | else |
432 | runwindow->progress->show(); | 430 | runwindow->progress->show(); |
433 | } | 431 | } |
434 | 432 | ||
435 | void PmIpkg::installFile(const QString &fileName, const QString &dest) | 433 | void PmIpkg::installFile(const QString &fileName, const QString &dest) |
436 | { | 434 | { |
437 | 435 | ||
438 | to_install.clear(); | 436 | to_install.clear(); |
439 | to_remove.clear(); | 437 | to_remove.clear(); |
440 | pvDebug( 2,"PmIpkg::installFile "+ fileName); | 438 | pvDebug( 2,"PmIpkg::installFile "+ fileName); |
441 | Package *p = new Package(fileName,settings); | 439 | Package *p = new Package(fileName,settings); |
442 | if ( dest!="") p->setDest( dest ); | 440 | if ( dest!="") p->setDest( dest ); |
443 | to_install.append( p ); | 441 | to_install.append( p ); |
444 | startDialog(); | 442 | startDialog(); |
445 | delete p; | 443 | delete p; |
446 | } | 444 | } |
447 | 445 | ||
448 | void PmIpkg::removeFile(const QString &fileName, const QString &dest) | 446 | void PmIpkg::removeFile(const QString &fileName, const QString &dest) |
449 | { | 447 | { |
450 | 448 | ||
451 | to_install.clear(); | 449 | to_install.clear(); |
452 | to_remove.clear(); | 450 | to_remove.clear(); |
453 | pvDebug( 2,"PmIpkg::removeFile "+ fileName); | 451 | pvDebug( 2,"PmIpkg::removeFile "+ fileName); |
454 | Package *p = new Package(fileName,settings); | 452 | Package *p = new Package(fileName,settings); |
455 | if ( dest!="") p->setDest( dest ); | 453 | if ( dest!="") p->setDest( dest ); |
456 | to_remove.append( p ); | 454 | to_remove.append( p ); |
457 | startDialog(); | 455 | startDialog(); |
458 | delete p; | 456 | delete p; |
459 | } | 457 | } |
460 | 458 | ||
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index 0625032..2b89023 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -1,64 +1,66 @@ | |||
1 | #ifndef PMIPKG_H | 1 | #ifndef PMIPKG_H |
2 | #define PMIPKG_H | 2 | #define PMIPKG_H |
3 | 3 | ||
4 | 4 | ||
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | #include <qlist.h> | 6 | #include <qlist.h> |
7 | #include <qstring.h> | 7 | #include <qstring.h> |
8 | #include <qwidget.h> | 8 | #include <qwidget.h> |
9 | #include "pksettings.h" | 9 | #include "pksettings.h" |
10 | #include "runwindow.h" | 10 | #include "runwindow.h" |
11 | #include "packagelist.h" | 11 | #include "packagelist.h" |
12 | #include "debug.h" | 12 | #include "debug.h" |
13 | 13 | ||
14 | #define createLink 0 | 14 | #define createLink 0 |
15 | #define removeLink 1 | 15 | #define removeLink 1 |
16 | 16 | ||
17 | class Package; | 17 | class Package; |
18 | class PmIpkg : public QObject | 18 | class PmIpkg : public QObject |
19 | { | 19 | { |
20 | Q_OBJECT | 20 | Q_OBJECT |
21 | public: | 21 | public: |
22 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 22 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
23 | ~PmIpkg(); | 23 | ~PmIpkg(); |
24 | 24 | ||
25 | int linkOpp; | 25 | int linkOpp; |
26 | void loadList( PackageList ); | ||
26 | void commit( PackageList ); | 27 | void commit( PackageList ); |
27 | void update(); | 28 | void update(); |
28 | // PackageList* getPackageList(); | 29 | // PackageList* getPackageList(); |
29 | void showButtons(bool b=true); | 30 | void showButtons(bool b=true); |
30 | void show( bool buttons=true ); | 31 | void show( bool buttons=true ); |
31 | 32 | ||
32 | public slots: | 33 | public slots: |
33 | void doIt(); | 34 | void doIt(); |
34 | void install(); | 35 | void install(); |
35 | void remove(); | 36 | void remove(); |
36 | void installFile(const QString &fileName, const QString &dest=""); | 37 | void installFile(const QString &fileName, const QString &dest=""); |
37 | void removeFile(const QString &fileName, const QString &dest=""); | 38 | void removeFile(const QString &fileName, const QString &dest=""); |
38 | void createLinks( const QString &dest ); | 39 | void createLinks( const QString &dest ); |
39 | void removeLinks( const QString &dest ); | 40 | void removeLinks( const QString &dest ); |
40 | 41 | ||
41 | private: | 42 | private: |
43 | int sizecount; | ||
42 | PackageManagerSettings* settings; | 44 | PackageManagerSettings* settings; |
43 | RunWindow *runwindow; | 45 | RunWindow *runwindow; |
44 | QDialog *installDialog; | 46 | QDialog *installDialog; |
45 | QList<Package> to_remove; | 47 | QList<Package> to_remove; |
46 | QList<Package> to_install; | 48 | QList<Package> to_install; |
47 | bool runwindowopen; | 49 | bool runwindowopen; |
48 | QString fileNameToInstall; | 50 | QString fileNameToInstall; |
49 | QCheckBox *_force_reinstall; | 51 | QCheckBox *_force_reinstall; |
50 | QCheckBox *_force_remove; | 52 | QCheckBox *_force_remove; |
51 | QCheckBox *_force_depends; | 53 | QCheckBox *_force_depends; |
52 | void startDialog(); | 54 | void startDialog(); |
53 | void makeLinks(Package*); | 55 | void makeLinks(Package*); |
54 | void linkPackage( QString, QString ); | 56 | void linkPackage( QString, QString ); |
55 | void processLinkDir( QString , QString ); | 57 | void processLinkDir( QString , QString ); |
56 | int runIpkg(const QString& args, const QString& dest="" ); | 58 | int runIpkg(const QString& args, const QString& dest="" ); |
57 | void out( QString ); | 59 | void out( QString ); |
58 | QStringList* getList( QString, QString ); | 60 | QStringList* getList( QString, QString ); |
59 | void processFileList( QStringList*, QString ); | 61 | void processFileList( QStringList*, QString ); |
60 | 62 | ||
61 | 63 | ||
62 | }; | 64 | }; |
63 | 65 | ||
64 | #endif | 66 | #endif |
diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h index e2072f1..3be4334 100644 --- a/noncore/unsupported/oipkg/settings.h +++ b/noncore/unsupported/oipkg/settings.h | |||
@@ -1,63 +1,67 @@ | |||
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 <qintdict.h> | 5 | #include <qintdict.h> |
6 | 6 | ||
7 | 7 | ||
8 | class PackageManagerSettings : public PackageManagerSettingsBase | 8 | class PackageManagerSettings : public PackageManagerSettingsBase |
9 | //class PackageManagerSettings : private PackageManagerSettingsBase | 9 | //class PackageManagerSettings : private PackageManagerSettingsBase |
10 | { | 10 | { |
11 | // Q_OBJECT | 11 | // Q_OBJECT |
12 | public: | 12 | public: |
13 | PackageManagerSettings( QWidget* , const char* , WFlags ); | 13 | PackageManagerSettings( QWidget* , const char* , WFlags ); |
14 | ~PackageManagerSettings(); | 14 | ~PackageManagerSettings(); |
15 | 15 | ||
16 | bool showDialog( int ) ; | 16 | bool showDialog( int ) ; |
17 | QString getDestinationUrl(); | 17 | QString getDestinationUrl(); |
18 | QString getDestinationName(); | 18 | QString getDestinationName(); |
19 | QString getLinkDestinationName(); | 19 | QString getLinkDestinationName(); |
20 | bool createLinks(); | 20 | bool createLinks(); |
21 | QStringList getActiveServers(); | 21 | QStringList getActiveServers(); |
22 | QStringList getDestinationUrls(); | 22 | QStringList getDestinationUrls(); |
23 | 23 | ||
24 | public slots: | 24 | public slots: |
25 | void writeInstallationSettings(); | 25 | void writeInstallationSettings(); |
26 | void readInstallationSettings(); | 26 | void readInstallationSettings(); |
27 | void writeCurrentInstallationSetting(); | 27 | void writeCurrentInstallationSetting(); |
28 | void readInstallationSetting(int); | 28 | void readInstallationSetting(int); |
29 | void installationSettingSetName(const QString &); | 29 | void installationSettingSetName(const QString &); |
30 | void activeDestinationChange(int) | 30 | void activeDestinationChange(int) |
31 | void newServer(); | 31 | void newServer(); |
32 | void editServer(int); | 32 | void editServer(int); |
33 | void removeDestination(); | 33 | void removeDestination(); |
34 | void newDestination(); | 34 | void newDestination(); |
35 | void editDestination(int); | 35 | void editDestination(int); |
36 | void linkEnabled(bool); | 36 | void linkEnabled(bool); |
37 | void removeServer(); | 37 | void removeServer(); |
38 | void serverNameChanged(const QString&); | 38 | void serverNameChanged(const QString&); |
39 | void serverUrlChanged(const QString&); | 39 | void serverUrlChanged(const QString&); |
40 | void destNameChanged(const QString&); | 40 | void destNameChanged(const QString&); |
41 | void destUrlChanged(const QString&); | 41 | void destUrlChanged(const QString&); |
42 | void installationSettingChange(int); | 42 | void installationSettingChange(int); |
43 | void newInstallationSetting(); | 43 | void newInstallationSetting(); |
44 | void removeInstallationSetting(); | 44 | void removeInstallationSetting(); |
45 | void renameInstallationSetting(); | 45 | void renameInstallationSetting(); |
46 | 46 | ||
47 | private: | 47 | private: |
48 | QIntDict<QString> serverurlDic; | 48 | QIntDict<QString> serverurlDic; |
49 | QIntDict<QString> destinationurlDic; | 49 | QIntDict<QString> destinationurlDic; |
50 | int ipkg_old; | 50 | int ipkg_old; |
51 | int editedserver; | 51 | int editedserver; |
52 | int editeddestination; | 52 | int editeddestination; |
53 | int currentSetting; | 53 | int currentSetting; |
54 | int installationSettingsCount; | 54 | int installationSettingsCount; |
55 | bool changed; | 55 | bool changed; |
56 | 56 | ||
57 | bool readIpkgConfig(const QString&); | 57 | bool readIpkgConfig(const QString&); |
58 | void writeIpkgConfig(const QString&); | 58 | void writeIpkgConfig(const QString&); |
59 | void writeSettings(); | 59 | void writeSettings(); |
60 | void readSettings(); | 60 | void readSettings(); |
61 | }; | 61 | }; |
62 | 62 | ||
63 | #endif | 63 | #endif |
64 | /** No descriptions */ | ||
65 | void createLinks(); | ||
66 | /** No descriptions */ | ||
67 | void removeLinks(); | ||