author | tille <tille> | 2002-05-03 19:08:09 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-03 19:08:09 (UTC) |
commit | 4eddfebd1b4f70bbfe9106a16e9a3eeb6601f653 (patch) (unidiff) | |
tree | 66d77ffe196c448782ce0d04877641280e74890d | |
parent | 6bf450ac622d22ba7e9156e474a7abb714167eba (diff) | |
download | opie-4eddfebd1b4f70bbfe9106a16e9a3eeb6601f653.zip opie-4eddfebd1b4f70bbfe9106a16e9a3eeb6601f653.tar.gz opie-4eddfebd1b4f70bbfe9106a16e9a3eeb6601f653.tar.bz2 |
fixes
-rw-r--r-- | noncore/unsupported/oipkg/TODO | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/main.cpp | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistdoclnk.cpp | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistremote.cpp | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 127 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 2 |
8 files changed, 74 insertions, 77 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO index b1ae6e3..6de54ec 100644 --- a/noncore/unsupported/oipkg/TODO +++ b/noncore/unsupported/oipkg/TODO | |||
@@ -1,14 +1,15 @@ | |||
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 | 10 | * create dest if it does not exist |
11 | * allow reinstalling | 11 | * allow reinstalling |
12 | * different types of filters and searches | 12 | * different types of filters and searches |
13 | i.e. name, desc, files etc | 13 | i.e. name, desc, files etc |
14 | * mark packages from doclnk and ipkgfind installed if installed \ No newline at end of file | 14 | * mark packages from doclnk and ipkgfind installed if installed |
15 | * show if different version is installed \ No newline at end of file | ||
diff --git a/noncore/unsupported/oipkg/main.cpp b/noncore/unsupported/oipkg/main.cpp index bacc973..4af11df 100644 --- a/noncore/unsupported/oipkg/main.cpp +++ b/noncore/unsupported/oipkg/main.cpp | |||
@@ -1,23 +1,24 @@ | |||
1 | 1 | ||
2 | #include "mainwindow.h" | 2 | #include "mainwindow.h" |
3 | 3 | ||
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qstring.h> | 5 | #include <qstring.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | int debugLevel; | 7 | int debugLevel; |
8 | 8 | ||
9 | int main( int argc, char ** argv ) | 9 | int main( int argc, char ** argv ) |
10 | { | 10 | { |
11 | 11 | ||
12 | debugLevel = 2; | 12 | debugLevel = 2; |
13 | if (argc > 0) | 13 | if (argc > 0) |
14 | { | 14 | { |
15 | debugLevel = QString ( argv[1] ).toInt(); | 15 | debugLevel = QString ( argv[1] ).toInt(); |
16 | qDebug("setting debug level to %i",debugLevel); | ||
16 | } | 17 | } |
17 | QPEApplication a( argc, argv ); | 18 | QPEApplication a( argc, argv ); |
18 | MainWindow mw; | 19 | MainWindow mw; |
19 | if (debugLevel < 4) | 20 | if (argc > 2) |
20 | QMessageBox::information( &mw, "oipkg","While ipkg is working\noipkg is hanging.\nPlease be patient!"); | 21 | QMessageBox::information( &mw, "oipkg","While ipkg is working\noipkg is hanging.\nPlease be patient!"); |
21 | a.showMainDocumentWidget( &mw ); | 22 | a.showMainDocumentWidget( &mw ); |
22 | return a.exec(); | 23 | return a.exec(); |
23 | } | 24 | } |
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 259a789..4f6e4cc 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -1,487 +1,489 @@ | |||
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 <qpushbutton.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | 28 | ||
29 | #include "pksettingsbase.h" | 29 | #include "pksettingsbase.h" |
30 | #include "utils.h" | 30 | #include "utils.h" |
31 | #include "packagelistitem.h" | 31 | #include "packagelistitem.h" |
32 | 32 | ||
33 | 33 | ||
34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | 34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : |
35 | QMainWindow( parent, name, f ) | 35 | QMainWindow( parent, name, f ) |
36 | { | 36 | { |
37 | setCaption( tr("Package Manager") ); | 37 | setCaption( tr("Package Manager") ); |
38 | settings = new PackageManagerSettings(this,0,TRUE); | 38 | settings = new PackageManagerSettings(this,0,TRUE); |
39 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); | 39 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); |
40 | setCentralWidget( listViewPackages ); | 40 | setCentralWidget( listViewPackages ); |
41 | listViewPackages->addList( tr("feeds"), &packageListServers ); | 41 | listViewPackages->addList( tr("feeds"), &packageListServers ); |
42 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); | 42 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); |
43 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); | 43 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); |
44 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); | 44 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); |
45 | //wait = new QMessageBox(this); | 45 | //wait = new QMessageBox(this); |
46 | // wait->setText(tr("Please wait")); | 46 | // wait->setText(tr("Please wait")); |
47 | ipkg = new PmIpkg( settings, this ); | 47 | ipkg = new PmIpkg( settings, this ); |
48 | // settings->setIpkg( ipkg ); | 48 | // settings->setIpkg( ipkg ); |
49 | packageListServers.setSettings( settings ); | 49 | packageListServers.setSettings( settings ); |
50 | packageListSearch.setSettings( settings ); | 50 | packageListSearch.setSettings( settings ); |
51 | packageListDocLnk.setSettings( settings ); | 51 | packageListDocLnk.setSettings( settings ); |
52 | packageListServers.update(); | 52 | packageListServers.update(); |
53 | packageListDocLnk.update(); | 53 | packageListDocLnk.update(); |
54 | makeMenu(); | 54 | makeMenu(); |
55 | makeChannel(); | 55 | makeChannel(); |
56 | //opie is hardcoded default ;) | 56 | //opie is hardcoded default ;) |
57 | for (int i=0;i<section->count();i++) | 57 | for (int i=0;i<section->count();i++) |
58 | if (section->text(i)=="opie") | 58 | if (section->text(i)=="opie") |
59 | section->setCurrentItem(i); | 59 | section->setCurrentItem(i); |
60 | sectionChanged(); | 60 | sectionChanged(); |
61 | 61 | ||
62 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); | 62 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); |
63 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 63 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
64 | 64 | ||
65 | connect( settings->removeLinksButton, SIGNAL( clicked()), | 65 | connect( settings->removeLinksButton, SIGNAL( clicked()), |
66 | SLOT(removeLinks()) ); | 66 | SLOT(removeLinks()) ); |
67 | connect( settings->createLinksButton, SIGNAL( clicked()), | 67 | connect( settings->createLinksButton, SIGNAL( clicked()), |
68 | SLOT(createLinks()) ); | 68 | SLOT(createLinks()) ); |
69 | 69 | ||
70 | displayList(); | 70 | displayList(); |
71 | } | 71 | } |
72 | 72 | ||
73 | void MainWindow::makeMenu() | 73 | void MainWindow::makeMenu() |
74 | { | 74 | { |
75 | 75 | ||
76 | QPEToolBar *toolBar = new QPEToolBar( this ); | 76 | QPEToolBar *toolBar = new QPEToolBar( this ); |
77 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 77 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
78 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); | 78 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); |
79 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 79 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
80 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 80 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
81 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); | 81 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); |
82 | 82 | ||
83 | setToolBarsMovable( false ); | 83 | setToolBarsMovable( false ); |
84 | toolBar->setHorizontalStretchable( true ); | 84 | toolBar->setHorizontalStretchable( true ); |
85 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 85 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
86 | menuBar->insertItem( tr( "View" ), viewMenu ); | 86 | menuBar->insertItem( tr( "View" ), viewMenu ); |
87 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 87 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
88 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); | 88 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); |
89 | 89 | ||
90 | QLabel *spacer = new QLabel( "", toolBar ); | 90 | QLabel *spacer = new QLabel( "", toolBar ); |
91 | spacer->setBackgroundColor( toolBar->backgroundColor() ); | 91 | spacer->setBackgroundColor( toolBar->backgroundColor() ); |
92 | toolBar->setStretchableWidget( spacer ); | 92 | toolBar->setStretchableWidget( spacer ); |
93 | 93 | ||
94 | 94 | ||
95 | runAction = new QAction( tr( "Apply" ), | 95 | runAction = new QAction( tr( "Apply" ), |
96 | Resource::loadPixmap( "oipkg/install" ), | 96 | Resource::loadPixmap( "oipkg/install" ), |
97 | QString::null, 0, this, 0 ); | 97 | QString::null, 0, this, 0 ); |
98 | connect( runAction, SIGNAL( activated() ), | 98 | connect( runAction, SIGNAL( activated() ), |
99 | this, SLOT( runIpkg() ) ); | 99 | this, SLOT( runIpkg() ) ); |
100 | runAction->addTo( toolBar ); | 100 | runAction->addTo( toolBar ); |
101 | runAction->addTo( srvMenu ); | 101 | runAction->addTo( srvMenu ); |
102 | 102 | ||
103 | srvMenu->insertSeparator (); | 103 | srvMenu->insertSeparator (); |
104 | 104 | ||
105 | updateAction = new QAction( tr( "Update" ), | 105 | updateAction = new QAction( tr( "Update" ), |
106 | Resource::loadIconSet( "oipkg/update" ), | 106 | Resource::loadIconSet( "oipkg/update" ), |
107 | QString::null, 0, this, 0 ); | 107 | QString::null, 0, this, 0 ); |
108 | connect( updateAction, SIGNAL( activated() ), | 108 | connect( updateAction, SIGNAL( activated() ), |
109 | this , SLOT( updateList() ) ); | 109 | this , SLOT( updateList() ) ); |
110 | updateAction->addTo( toolBar ); | 110 | updateAction->addTo( toolBar ); |
111 | updateAction->addTo( srvMenu ); | 111 | updateAction->addTo( srvMenu ); |
112 | 112 | ||
113 | QAction *cfgact; | 113 | QAction *cfgact; |
114 | 114 | ||
115 | cfgact = new QAction( tr( "Setups" ), | 115 | cfgact = new QAction( tr( "Setups" ), |
116 | QString::null, 0, this, 0 ); | 116 | QString::null, 0, this, 0 ); |
117 | connect( cfgact, SIGNAL( activated() ), | 117 | connect( cfgact, SIGNAL( activated() ), |
118 | SLOT( showSettings() ) ); | 118 | SLOT( showSettings() ) ); |
119 | cfgact->addTo( cfgMenu ); | 119 | cfgact->addTo( cfgMenu ); |
120 | 120 | ||
121 | cfgact = new QAction( tr( "Servers" ), | 121 | cfgact = new QAction( tr( "Servers" ), |
122 | QString::null, 0, this, 0 ); | 122 | QString::null, 0, this, 0 ); |
123 | connect( cfgact, SIGNAL( activated() ), | 123 | connect( cfgact, SIGNAL( activated() ), |
124 | SLOT( showSettingsSrv() ) ); | 124 | SLOT( showSettingsSrv() ) ); |
125 | cfgact->addTo( cfgMenu ); | 125 | cfgact->addTo( cfgMenu ); |
126 | cfgact = new QAction( tr( "Destinations" ), | 126 | cfgact = new QAction( tr( "Destinations" ), |
127 | QString::null, 0, this, 0 ); | 127 | QString::null, 0, this, 0 ); |
128 | connect( cfgact, SIGNAL( activated() ), | 128 | connect( cfgact, SIGNAL( activated() ), |
129 | SLOT( showSettingsDst() ) ); | 129 | SLOT( showSettingsDst() ) ); |
130 | cfgact->addTo( cfgMenu ); | 130 | cfgact->addTo( cfgMenu ); |
131 | 131 | ||
132 | QAction *a; | 132 | QAction *a; |
133 | 133 | ||
134 | // SECTIONS | 134 | // SECTIONS |
135 | sectionBar = new QPEToolBar( this ); | 135 | sectionBar = new QPEToolBar( this ); |
136 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); | 136 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); |
137 | sectionBar->setHorizontalStretchable( true ); | 137 | sectionBar->setHorizontalStretchable( true ); |
138 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); | 138 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); |
139 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 139 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
140 | sectionBar->setStretchableWidget( label ); | 140 | sectionBar->setStretchableWidget( label ); |
141 | section = new QComboBox( false, sectionBar ); | 141 | section = new QComboBox( false, sectionBar ); |
142 | label = new QLabel( " / ", sectionBar ); | 142 | label = new QLabel( " / ", sectionBar ); |
143 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 143 | label->setBackgroundColor( sectionBar->backgroundColor() ); |
144 | subsection = new QComboBox( false, sectionBar ); | 144 | subsection = new QComboBox( false, sectionBar ); |
145 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 145 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
146 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); | 146 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); |
147 | a->addTo( sectionBar ); | 147 | a->addTo( sectionBar ); |
148 | setSections(); | 148 | setSections(); |
149 | setSubSections(); | 149 | setSubSections(); |
150 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); | 150 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); |
151 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); | 151 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); |
152 | sectionAction->setToggleAction( true ); | 152 | sectionAction->setToggleAction( true ); |
153 | sectionAction->addTo( viewMenu ); | 153 | sectionAction->addTo( viewMenu ); |
154 | 154 | ||
155 | //FIND | 155 | //FIND |
156 | findBar = new QPEToolBar(this); | 156 | findBar = new QPEToolBar(this); |
157 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); | 157 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); |
158 | label = new QLabel( tr("Filter: "), findBar ); | 158 | label = new QLabel( tr("Filter: "), findBar ); |
159 | label->setBackgroundColor( findBar->backgroundColor() ); | 159 | label->setBackgroundColor( findBar->backgroundColor() ); |
160 | findBar->setHorizontalStretchable( TRUE ); | 160 | findBar->setHorizontalStretchable( TRUE ); |
161 | findEdit = new QLineEdit( findBar, "findEdit" ); | 161 | findEdit = new QLineEdit( findBar, "findEdit" ); |
162 | findBar->setStretchableWidget( findEdit ); | 162 | findBar->setStretchableWidget( findEdit ); |
163 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 163 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), |
164 | this, SLOT( displayList() ) ); | 164 | this, SLOT( displayList() ) ); |
165 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 165 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
166 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); | 166 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); |
167 | a->addTo( findBar ); | 167 | a->addTo( findBar ); |
168 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 168 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
169 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 169 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
170 | a->addTo( findBar ); | 170 | a->addTo( findBar ); |
171 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); | 171 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); |
172 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 172 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
173 | findAction->setToggleAction( true ); | 173 | findAction->setToggleAction( true ); |
174 | findAction->addTo( viewMenu ); | 174 | findAction->addTo( viewMenu ); |
175 | 175 | ||
176 | //SEARCH | 176 | //SEARCH |
177 | searchBar = new QPEToolBar(this); | 177 | searchBar = new QPEToolBar(this); |
178 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 178 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
179 | label = new QLabel( tr("ipkgfind: "), searchBar ); | 179 | label = new QLabel( tr("ipkgfind: "), searchBar ); |
180 | label->setBackgroundColor( searchBar->backgroundColor() ); | 180 | label->setBackgroundColor( searchBar->backgroundColor() ); |
181 | searchBar->setHorizontalStretchable( TRUE ); | 181 | searchBar->setHorizontalStretchable( TRUE ); |
182 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 182 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
183 | searchBar->setStretchableWidget( searchEdit ); | 183 | searchBar->setStretchableWidget( searchEdit ); |
184 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 184 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), |
185 | // this, SLOT( displayList() ) ); | 185 | // this, SLOT( displayList() ) ); |
186 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 186 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
187 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); | 187 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); |
188 | a->addTo( searchBar ); | 188 | a->addTo( searchBar ); |
189 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 189 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
190 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); | 190 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); |
191 | searchCommit->addTo( searchBar ); | 191 | searchCommit->addTo( searchBar ); |
192 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 192 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
193 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); | 193 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); |
194 | a->addTo( searchBar ); | 194 | a->addTo( searchBar ); |
195 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); | 195 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); |
196 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); | 196 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); |
197 | searchAction->setToggleAction( true ); | 197 | searchAction->setToggleAction( true ); |
198 | searchAction->addTo( viewMenu ); | 198 | searchAction->addTo( viewMenu ); |
199 | 199 | ||
200 | //DEST | 200 | //DEST |
201 | destBar = new QPEToolBar(this); | 201 | destBar = new QPEToolBar(this); |
202 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); | 202 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); |
203 | label = new QLabel( tr("Destination: "), destBar ); | 203 | label = new QLabel( tr("Destination: "), destBar ); |
204 | label->setBackgroundColor( destBar->backgroundColor() ); | 204 | label->setBackgroundColor( destBar->backgroundColor() ); |
205 | destBar->setHorizontalStretchable( TRUE ); | 205 | destBar->setHorizontalStretchable( TRUE ); |
206 | destination = new QComboBox( false, destBar ); | 206 | destination = new QComboBox( false, destBar ); |
207 | destination->insertStringList( settings->getDestinationNames() ); | 207 | destination->insertStringList( settings->getDestinationNames() ); |
208 | setComboName(destination,settings->getDestinationName()); | 208 | setComboName(destination,settings->getDestinationName()); |
209 | connect( destination, SIGNAL(activated(int)), | 209 | connect( destination, SIGNAL(activated(int)), |
210 | settings, SLOT(activeDestinationChange(int)) ); | 210 | settings, SLOT(activeDestinationChange(int)) ); |
211 | spacer = new QLabel( " ", destBar ); | 211 | spacer = new QLabel( " ", destBar ); |
212 | spacer->setBackgroundColor( destBar->backgroundColor() ); | 212 | spacer->setBackgroundColor( destBar->backgroundColor() ); |
213 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); | 213 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); |
214 | CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); | 214 | CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); |
215 | CheckBoxLink->setChecked( settings->createLinks() ); | 215 | CheckBoxLink->setChecked( settings->createLinks() ); |
216 | connect( CheckBoxLink, SIGNAL(toggled(bool)), | 216 | connect( CheckBoxLink, SIGNAL(toggled(bool)), |
217 | settings, SLOT(linkEnabled(bool)) ); | 217 | settings, SLOT(linkEnabled(bool)) ); |
218 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); | 218 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); |
219 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); | 219 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); |
220 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 220 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
221 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); | 221 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); |
222 | a->addTo( destBar ); | 222 | a->addTo( destBar ); |
223 | destBar->setStretchableWidget( CheckBoxLink ); | 223 | destBar->setStretchableWidget( CheckBoxLink ); |
224 | destAction->setToggleAction( true ); | 224 | destAction->setToggleAction( true ); |
225 | // destAction->addTo( viewMenu ); | 225 | // destAction->addTo( viewMenu ); |
226 | 226 | ||
227 | // configure the menus | 227 | // configure the menus |
228 | Config cfg( "oipkg", Config::User ); | 228 | Config cfg( "oipkg", Config::User ); |
229 | cfg.setGroup( "gui" ); | 229 | cfg.setGroup( "gui" ); |
230 | 230 | ||
231 | findShow( cfg.readBoolEntry( "findBar", true ) ); | 231 | findShow( cfg.readBoolEntry( "findBar", true ) ); |
232 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); | 232 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); |
233 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); | 233 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); |
234 | destShow( cfg.readBoolEntry( "destBar", false ) ); | 234 | destShow( cfg.readBoolEntry( "destBar", false ) ); |
235 | } | 235 | } |
236 | 236 | ||
237 | MainWindow::~MainWindow() | 237 | MainWindow::~MainWindow() |
238 | { | 238 | { |
239 | pvDebug(7,"MainWindow::~MainWindow "); | 239 | pvDebug(7,"MainWindow::~MainWindow "); |
240 | Config cfg( "oipkg", Config::User ); | 240 | Config cfg( "oipkg", Config::User ); |
241 | cfg.setGroup( "gui" ); | 241 | cfg.setGroup( "gui" ); |
242 | cfg.writeEntry( "findBar", !findBar->isHidden() ); | 242 | cfg.writeEntry( "findBar", !findBar->isHidden() ); |
243 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); | 243 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); |
244 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); | 244 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); |
245 | cfg.writeEntry( "destBar", !destBar->isHidden() ); | 245 | cfg.writeEntry( "destBar", !destBar->isHidden() ); |
246 | pvDebug(7,"MainWindow::~MainWindow "); | 246 | pvDebug(7,"MainWindow::~MainWindow "); |
247 | 247 | ||
248 | } | 248 | } |
249 | 249 | ||
250 | void MainWindow::runIpkg() | 250 | void MainWindow::runIpkg() |
251 | { | 251 | { |
252 | packageListServers.allPackages(); | 252 | packageListServers.allPackages(); |
253 | ipkg->loadList( packageListSearch ); | 253 | ipkg->loadList( &packageListSearch ); |
254 | ipkg->loadList( packageListDocLnk ); | 254 | ipkg->loadList( &packageListDocLnk ); |
255 | ipkg->loadList( packageListServers ); | 255 | ipkg->loadList( &packageListServers ); |
256 | ipkg->commit(); | 256 | ipkg->commit(); |
257 | // ##### If we looked in the list of files, we could send out accurate | 257 | // ##### If we looked in the list of files, we could send out accurate |
258 | // ##### messages. But we don't bother yet, and just do an "all". | 258 | // ##### messages. But we don't bother yet, and just do an "all". |
259 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 259 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
260 | QString lf = QString::null; | 260 | QString lf = QString::null; |
261 | e << lf; | 261 | e << lf; |
262 | displayList(); | 262 | displayList(); |
263 | } | 263 | } |
264 | 264 | ||
265 | void MainWindow::updateList() | 265 | void MainWindow::updateList() |
266 | { | 266 | { |
267 | //wait->show(); | 267 | //wait->show(); |
268 | QTimer *t = new QTimer( this ); | 268 | QTimer *t = new QTimer( this ); |
269 | connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); | 269 | connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); |
270 | t->start( 0, false ); | 270 | t->start( 0, false ); |
271 | packageListServers.clear(); | 271 | packageListServers.clear(); |
272 | packageListSearch.clear(); | 272 | packageListSearch.clear(); |
273 | packageListDocLnk.clear(); | 273 | packageListDocLnk.clear(); |
274 | ipkg->update(); | 274 | ipkg->update(); |
275 | packageListServers.update(); | 275 | packageListServers.update(); |
276 | packageListSearch.update(); | 276 | packageListSearch.update(); |
277 | packageListDocLnk.update(); | 277 | packageListDocLnk.update(); |
278 | t->stop(); | 278 | t->stop(); |
279 | // wait->hide(); | 279 | // wait->hide(); |
280 | } | 280 | } |
281 | 281 | ||
282 | void MainWindow::filterList() | 282 | void MainWindow::filterList() |
283 | { | 283 | { |
284 | //wait->show(); | 284 | //wait->show(); |
285 | QString f = ""; | 285 | QString f = ""; |
286 | if ( findAction->isOn() ) f = findEdit->text(); | 286 | if ( findAction->isOn() ) f = findEdit->text(); |
287 | packageListServers.filterPackages( f ); | 287 | packageListServers.filterPackages( f ); |
288 | //wait->hide(); | 288 | //wait->hide(); |
289 | } | 289 | } |
290 | 290 | ||
291 | void MainWindow::displayList() | 291 | void MainWindow::displayList() |
292 | { | 292 | { |
293 | //wait->hide(); | 293 | //wait->hide(); |
294 | filterList(); | 294 | filterList(); |
295 | listViewPackages->display(); | 295 | listViewPackages->display(); |
296 | } | 296 | } |
297 | 297 | ||
298 | void MainWindow::sectionChanged() | 298 | void MainWindow::sectionChanged() |
299 | { | 299 | { |
300 | disconnect( section, SIGNAL( activated(int) ), | 300 | disconnect( section, SIGNAL( activated(int) ), |
301 | this, SLOT( sectionChanged() ) ); | 301 | this, SLOT( sectionChanged() ) ); |
302 | disconnect( subsection, SIGNAL(activated(int) ), | 302 | disconnect( subsection, SIGNAL(activated(int) ), |
303 | this, SLOT( subSectionChanged() ) ); | 303 | this, SLOT( subSectionChanged() ) ); |
304 | subsection->clear(); | 304 | subsection->clear(); |
305 | packageListServers.setSection( section->currentText() ); | 305 | packageListServers.setSection( section->currentText() ); |
306 | setSubSections(); | 306 | setSubSections(); |
307 | connect( section, SIGNAL( activated(int) ), | 307 | connect( section, SIGNAL( activated(int) ), |
308 | this, SLOT( sectionChanged() ) ); | 308 | this, SLOT( sectionChanged() ) ); |
309 | connect( subsection, SIGNAL(activated(int) ), | 309 | connect( subsection, SIGNAL(activated(int) ), |
310 | this, SLOT( subSectionChanged() ) ); | 310 | this, SLOT( subSectionChanged() ) ); |
311 | displayList(); | 311 | displayList(); |
312 | } | 312 | } |
313 | 313 | ||
314 | void MainWindow::subSectionChanged() | 314 | void MainWindow::subSectionChanged() |
315 | { | 315 | { |
316 | disconnect( section, SIGNAL( activated(int) ), | 316 | disconnect( section, SIGNAL( activated(int) ), |
317 | this, SLOT( sectionChanged() ) ); | 317 | this, SLOT( sectionChanged() ) ); |
318 | disconnect( subsection, SIGNAL(activated(int) ), | 318 | disconnect( subsection, SIGNAL(activated(int) ), |
319 | this, SLOT( subSectionChanged() ) ); | 319 | this, SLOT( subSectionChanged() ) ); |
320 | packageListServers.setSubSection( subsection->currentText() ); | 320 | packageListServers.setSubSection( subsection->currentText() ); |
321 | connect( section, SIGNAL( activated(int) ), | 321 | connect( section, SIGNAL( activated(int) ), |
322 | this, SLOT( sectionChanged() ) ); | 322 | this, SLOT( sectionChanged() ) ); |
323 | connect( subsection, SIGNAL(activated(int) ), | 323 | connect( subsection, SIGNAL(activated(int) ), |
324 | this, SLOT( subSectionChanged() ) ); | 324 | this, SLOT( subSectionChanged() ) ); |
325 | displayList(); | 325 | displayList(); |
326 | } | 326 | } |
327 | 327 | ||
328 | void MainWindow::setSections() | 328 | void MainWindow::setSections() |
329 | { | 329 | { |
330 | section->clear(); | 330 | section->clear(); |
331 | section->insertStringList( packageListServers.getSections() ); | 331 | section->insertStringList( packageListServers.getSections() ); |
332 | } | 332 | } |
333 | 333 | ||
334 | void MainWindow::setSubSections() | 334 | void MainWindow::setSubSections() |
335 | { | 335 | { |
336 | subsection->clear(); | 336 | subsection->clear(); |
337 | subsection->insertStringList( packageListServers.getSubSections() ); | 337 | subsection->insertStringList( packageListServers.getSubSections() ); |
338 | } | 338 | } |
339 | 339 | ||
340 | 340 | ||
341 | void MainWindow::showSettings() | 341 | void MainWindow::showSettings() |
342 | { | 342 | { |
343 | if ( settings->showDialog( 0 ) ) | 343 | if ( settings->showDialog( 0 ) ) |
344 | updateList(); | 344 | updateList(); |
345 | } | 345 | } |
346 | void MainWindow::showSettingsSrv() | 346 | void MainWindow::showSettingsSrv() |
347 | { | 347 | { |
348 | if ( settings->showDialog( 1 ) ) | 348 | if ( settings->showDialog( 1 ) ) |
349 | updateList(); | 349 | updateList(); |
350 | } | 350 | } |
351 | void MainWindow::showSettingsDst() | 351 | void MainWindow::showSettingsDst() |
352 | { | 352 | { |
353 | if ( settings->showDialog( 2 ) ) | 353 | if ( settings->showDialog( 2 ) ) |
354 | updateList(); | 354 | updateList(); |
355 | } | 355 | } |
356 | 356 | ||
357 | void MainWindow::sectionShow(bool b) | 357 | void MainWindow::sectionShow(bool b) |
358 | { | 358 | { |
359 | if (b) sectionBar->show(); | 359 | if (b) sectionBar->show(); |
360 | else sectionBar->hide(); | 360 | else sectionBar->hide(); |
361 | sectionAction->setOn( b ); | 361 | sectionAction->setOn( b ); |
362 | } | 362 | } |
363 | 363 | ||
364 | void MainWindow::sectionClose() | 364 | void MainWindow::sectionClose() |
365 | { | 365 | { |
366 | sectionAction->setOn( false ); | 366 | sectionAction->setOn( false ); |
367 | } | 367 | } |
368 | 368 | ||
369 | void MainWindow::findShow(bool b) | 369 | void MainWindow::findShow(bool b) |
370 | { | 370 | { |
371 | if (b) findBar->show(); | 371 | if (b) findBar->show(); |
372 | else findBar->hide(); | 372 | else findBar->hide(); |
373 | findAction->setOn( b ); | 373 | findAction->setOn( b ); |
374 | } | 374 | } |
375 | 375 | ||
376 | void MainWindow::findClose() | 376 | void MainWindow::findClose() |
377 | { | 377 | { |
378 | findAction->setOn( false ); | 378 | findAction->setOn( false ); |
379 | } | 379 | } |
380 | 380 | ||
381 | void MainWindow::searchShow(bool b) | 381 | void MainWindow::searchShow(bool b) |
382 | { | 382 | { |
383 | if (b) searchBar->show(); | 383 | if (b) searchBar->show(); |
384 | else searchBar->hide(); | 384 | else searchBar->hide(); |
385 | searchAction->setOn( b ); | 385 | searchAction->setOn( b ); |
386 | } | 386 | } |
387 | 387 | ||
388 | void MainWindow::searchClose() | 388 | void MainWindow::searchClose() |
389 | { | 389 | { |
390 | searchAction->setOn( false ); | 390 | searchAction->setOn( false ); |
391 | } | 391 | } |
392 | 392 | ||
393 | 393 | ||
394 | void MainWindow::destShow(bool b) | 394 | void MainWindow::destShow(bool b) |
395 | { | 395 | { |
396 | if (b) destBar->show(); | 396 | if (b) destBar->show(); |
397 | else destBar->hide(); | 397 | else destBar->hide(); |
398 | destAction->setOn( b ); | 398 | destAction->setOn( b ); |
399 | } | 399 | } |
400 | 400 | ||
401 | void MainWindow::destClose() | 401 | void MainWindow::destClose() |
402 | { | 402 | { |
403 | destAction->setOn( false ); | 403 | destAction->setOn( false ); |
404 | } | 404 | } |
405 | 405 | ||
406 | void MainWindow::rotateUpdateIcon() | 406 | void MainWindow::rotateUpdateIcon() |
407 | { | 407 | { |
408 | pvDebug(2, "MainWindow::rotateUpdateIcon"); | 408 | pvDebug(2, "MainWindow::rotateUpdateIcon"); |
409 | if ( updateIcon ) | 409 | if ( updateIcon ) |
410 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); | 410 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); |
411 | else | 411 | else |
412 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); | 412 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); |
413 | updateIcon = !updateIcon; | 413 | updateIcon = !updateIcon; |
414 | } | 414 | } |
415 | 415 | ||
416 | 416 | ||
417 | void MainWindow::setDocument(const QString &fileName) | 417 | void MainWindow::setDocument(const QString &fileName) |
418 | { | 418 | { |
419 | installFile(fileName); | 419 | installFile(fileName); |
420 | // ##### If we looked in the list of files, we could send out accurate | 420 | // ##### If we looked in the list of files, we could send out accurate |
421 | // ##### messages. But we don't bother yet, and just do an "all". | 421 | // ##### messages. But we don't bother yet, and just do an "all". |
422 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 422 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
423 | QString lf = QString::null; | 423 | QString lf = QString::null; |
424 | e << lf; | 424 | e << lf; |
425 | displayList(); | 425 | // displayList(); |
426 | exit; | ||
426 | } | 427 | } |
427 | 428 | ||
428 | void MainWindow::installFile(const QString &fileName) | 429 | void MainWindow::installFile(const QString &fileName) |
429 | { | 430 | { |
430 | pvDebug(3, "MainWindow::installFile "+fileName); | 431 | pvDebug(3, "MainWindow::installFile "+fileName); |
431 | if ( !QFile::exists( fileName ) ) return; | 432 | if ( !QFile::exists( fileName ) ) return; |
432 | ipkg->installFile( fileName ); | 433 | ipkg->installFile( fileName ); |
433 | // ##### If we looked in the list of files, we could send out accurate | 434 | // ##### If we looked in the list of files, we could send out accurate |
434 | // ##### messages. But we don't bother yet, and just do an "all". | 435 | // ##### messages. But we don't bother yet, and just do an "all". |
435 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 436 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
436 | QString lf = QString::null; | 437 | QString lf = QString::null; |
437 | e << lf; | 438 | e << lf; |
438 | displayList(); | 439 | displayList(); |
439 | } | 440 | } |
440 | 441 | ||
441 | void MainWindow::makeChannel() | 442 | void MainWindow::makeChannel() |
442 | { | 443 | { |
443 | channel = new QCopChannel( "QPE/Application/oipkg", this ); | 444 | channel = new QCopChannel( "QPE/Application/oipkg", this ); |
444 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 445 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
445 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 446 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
446 | } | 447 | } |
447 | 448 | ||
448 | 449 | ||
449 | 450 | ||
450 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) | 451 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) |
451 | { | 452 | { |
452 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); | 453 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); |
453 | if ( msg == "installFile(QString)" ) | 454 | if ( msg == "installFile(QString)" ) |
454 | { | 455 | { |
455 | ipkg->installFile( QString(arg) ); | 456 | ipkg->installFile( QString(arg) ); |
456 | }else if( msg == "removeFile(QString)" ) | 457 | }else if( msg == "removeFile(QString)" ) |
457 | { | 458 | { |
458 | ipkg->removeFile( QString(arg) ); | 459 | ipkg->removeFile( QString(arg) ); |
459 | }else if( msg == "createLinks(QString)" ) | 460 | }else if( msg == "createLinks(QString)" ) |
460 | { | 461 | { |
461 | ipkg->createLinks( QString(arg) ); | 462 | ipkg->createLinks( QString(arg) ); |
462 | }else if( msg == "removeLinks(QString)" ) | 463 | }else if( msg == "removeLinks(QString)" ) |
463 | { | 464 | { |
464 | ipkg->removeLinks( QString(arg) ); | 465 | ipkg->removeLinks( QString(arg) ); |
465 | }else{ | 466 | }else{ |
466 | pvDebug(2,"Huh what do ya want") | 467 | pvDebug(2,"Huh what do ya want") |
467 | } | 468 | } |
468 | } | 469 | } |
469 | 470 | ||
470 | 471 | ||
471 | void MainWindow::createLinks() | 472 | void MainWindow::createLinks() |
472 | { | 473 | { |
473 | pvDebug(2,"creating links..."); | 474 | pvDebug(2,"creating links..."); |
474 | ipkg->createLinks( settings->destinationurl->text() ); | 475 | ipkg->createLinks( settings->destinationurl->text() ); |
475 | } | 476 | } |
476 | 477 | ||
477 | void MainWindow::removeLinks() | 478 | void MainWindow::removeLinks() |
478 | { | 479 | { |
479 | pvDebug(2,"removing links..."); | 480 | pvDebug(2,"removing links..."); |
480 | ipkg->removeLinks( settings->destinationurl->text() ); | 481 | ipkg->removeLinks( settings->destinationurl->text() ); |
481 | } | 482 | } |
482 | 483 | ||
483 | void MainWindow::remotePackageQuery() | 484 | void MainWindow::remotePackageQuery() |
484 | { | 485 | { |
485 | packageListSearch.query( searchEdit->text() ); | 486 | packageListSearch.query( searchEdit->text() ); |
487 | packageListSearch.update(); | ||
486 | displayList(); | 488 | displayList(); |
487 | } | 489 | } |
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index f6023b0..7c93dad 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -1,98 +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" | 10 | #include "packagelistremote.h" |
11 | #include "packagelistlocal.h" | 11 | #include "packagelistlocal.h" |
12 | #include "packagelistdoclnk.h" | 12 | #include "packagelistdoclnk.h" |
13 | #include "pmipkg.h" | 13 | #include "pmipkg.h" |
14 | #include "pksettings.h" | 14 | #include "pksettings.h" |
15 | #include "packagelistview.h" | 15 | #include "packagelistview.h" |
16 | 16 | ||
17 | class QComboBox; | 17 | class QComboBox; |
18 | class QPEToolBar; | 18 | class QPEToolBar; |
19 | class QLineEdit; | 19 | class QLineEdit; |
20 | class PackageListItem; | 20 | class PackageListItem; |
21 | class QCopChannel; | 21 | class QCopChannel; |
22 | class QMessageBox; | 22 | class QMessageBox; |
23 | class QCheckBox; | 23 | class QCheckBox; |
24 | 24 | ||
25 | class MainWindow : public QMainWindow | 25 | class MainWindow : public QMainWindow |
26 | { | 26 | { |
27 | Q_OBJECT | 27 | Q_OBJECT |
28 | 28 | ||
29 | 29 | ||
30 | public: | 30 | public: |
31 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 31 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
32 | ~MainWindow(); | 32 | ~MainWindow(); |
33 | void makeChannel(); | 33 | void makeChannel(); |
34 | 34 | ||
35 | QCopChannel *channel; | 35 | QCopChannel *channel; |
36 | 36 | ||
37 | protected slots: | 37 | protected slots: |
38 | void runIpkg(); | 38 | void runIpkg(); |
39 | void updateList(); | 39 | void updateList(); |
40 | void displayList(); | 40 | void displayList(); |
41 | void subSectionChanged(); | 41 | void subSectionChanged(); |
42 | void sectionChanged(); | 42 | void sectionChanged(); |
43 | void showSettings(); | 43 | void showSettings(); |
44 | void showSettingsSrv(); | 44 | void showSettingsSrv(); |
45 | void showSettingsDst(); | 45 | void showSettingsDst(); |
46 | 46 | ||
47 | public slots: | 47 | public slots: |
48 | void sectionClose(); | 48 | void sectionClose(); |
49 | void sectionShow(bool); | 49 | void sectionShow(bool); |
50 | void findClose(); | 50 | void findClose(); |
51 | void findShow(bool); | 51 | void findShow(bool); |
52 | void searchClose(); | 52 | void searchClose(); |
53 | void searchShow(bool); | 53 | void searchShow(bool); |
54 | void destClose(); | 54 | void destClose(); |
55 | void destShow(bool); | 55 | void destShow(bool); |
56 | void filterList(); | 56 | void filterList(); |
57 | void createLinks(); | 57 | void createLinks(); |
58 | void removeLinks(); | 58 | void removeLinks(); |
59 | void receive (const QCString &, const QByteArray &); | 59 | void receive (const QCString &, const QByteArray &); |
60 | void setDocument (const QString &); | 60 | void setDocument (const QString &); |
61 | void remotePackageQuery(); | 61 | void remotePackageQuery(); |
62 | 62 | ||
63 | private: | 63 | private: |
64 | void makeMenu(); | 64 | void makeMenu(); |
65 | void setSections(); | 65 | void setSections(); |
66 | void setSubSections(); | 66 | void setSubSections(); |
67 | void installFile(const QString &); | 67 | void installFile(const QString &); |
68 | bool updateIcon; | 68 | bool updateIcon; |
69 | 69 | ||
70 | PmIpkg* ipkg; | 70 | PmIpkg* ipkg; |
71 | PackageManagerSettings *settings; | 71 | PackageManagerSettings *settings; |
72 | PackageListLocal packageListServers; | 72 | PackageListLocal packageListServers; |
73 | PackageListRemote packageListSearch; | 73 | PackageListRemote packageListSearch; |
74 | PackageListDocLnk packageListDocLnk; | 74 | PackageListDocLnk packageListDocLnk; |
75 | PackageListView *listViewPackages; | 75 | PackageListView *listViewPackages; |
76 | QAction *runAction; | 76 | QAction *runAction; |
77 | QAction *updateAction; | 77 | QAction *updateAction; |
78 | QAction *findAction; | 78 | QAction *findAction; |
79 | QPEToolBar *findBar; | 79 | QPEToolBar *findBar; |
80 | QLineEdit *findEdit; | 80 | QLineEdit *findEdit; |
81 | QAction *searchAction; | 81 | QAction *searchAction; |
82 | QAction *searchCommit; | 82 | QAction *searchCommit; |
83 | QPEToolBar *searchBar; | 83 | QPEToolBar *searchBar; |
84 | QLineEdit *searchEdit; | 84 | QLineEdit *searchEdit; |
85 | QAction *sectionAction; | 85 | QAction *sectionAction; |
86 | QPEToolBar *sectionBar; | 86 | QPEToolBar *sectionBar; |
87 | QComboBox *section; | 87 | QComboBox *section; |
88 | QComboBox *subsection; | 88 | QComboBox *subsection; |
89 | QAction *destAction; | 89 | QAction *destAction; |
90 | QPEToolBar *destBar; | 90 | QPEToolBar *destBar; |
91 | QComboBox *destination; | 91 | QComboBox *destination; |
92 | QCheckBox* CheckBoxLink; | 92 | QCheckBox* CheckBoxLink; |
93 | // QMessageBox *wait; | 93 | // QMessageBox *wait; |
94 | private slots: | 94 | private slots: |
95 | void rotateUpdateIcon(); | 95 | void rotateUpdateIcon(); |
96 | }; | 96 | }; |
97 | 97 | ||
98 | #endif | 98 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp index 5787fdf..1d10adf 100644 --- a/noncore/unsupported/oipkg/packagelistdoclnk.cpp +++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp | |||
@@ -1,43 +1,44 @@ | |||
1 | 1 | ||
2 | #include "packagelistdoclnk.h" | 2 | #include "packagelistdoclnk.h" |
3 | 3 | ||
4 | #include <qpe/applnk.h> | 4 | #include <qpe/applnk.h> |
5 | #include <qpe/config.h> | 5 | #include <qpe/config.h> |
6 | #include <qlist.h> | 6 | #include <qlist.h> |
7 | 7 | ||
8 | #include "package.h" | 8 | #include "package.h" |
9 | #include "pksettings.h" | 9 | #include "pksettings.h" |
10 | 10 | ||
11 | PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s) | 11 | PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s) |
12 | : PackageList(s) | 12 | : PackageList(s) |
13 | { | 13 | { |
14 | PackageListDocLnk(); | 14 | PackageListDocLnk(); |
15 | } | 15 | } |
16 | 16 | ||
17 | PackageListDocLnk::PackageListDocLnk() | 17 | PackageListDocLnk::PackageListDocLnk() |
18 | : PackageList() | 18 | : PackageList() |
19 | { | 19 | { |
20 | Config cfg( "oipkg", Config::User ); | 20 | Config cfg( "oipkg", Config::User ); |
21 | cfg.setGroup( "Common" ); | 21 | cfg.setGroup( "Common" ); |
22 | docLnkDir = cfg.readEntry( "docLnkDir", "/root/" ); | 22 | docLnkDir = cfg.readEntry( "docLnkDir", "/root/" ); |
23 | pvDebug(2,"opening DocLnkSet "+docLnkDir); | ||
23 | doclnkset = new DocLnkSet(docLnkDir,"application/ipkg"); | 24 | doclnkset = new DocLnkSet(docLnkDir,"application/ipkg"); |
24 | } | 25 | } |
25 | 26 | ||
26 | PackageListDocLnk::~PackageListDocLnk() | 27 | PackageListDocLnk::~PackageListDocLnk() |
27 | { | 28 | { |
28 | Config cfg( "oipkg", Config::User ); | 29 | Config cfg( "oipkg", Config::User ); |
29 | cfg.setGroup( "Common" ); | 30 | cfg.setGroup( "Common" ); |
30 | cfg.writeEntry( "docLnkDir", docLnkDir ); | 31 | cfg.writeEntry( "docLnkDir", docLnkDir ); |
31 | } | 32 | } |
32 | 33 | ||
33 | 34 | ||
34 | 35 | ||
35 | void PackageListDocLnk::update() | 36 | void PackageListDocLnk::update() |
36 | { | 37 | { |
37 | pvDebug(2,"PackageListDocLnk::update "); | 38 | pvDebug(2,"PackageListDocLnk::update "); |
38 | QList<DocLnk> packlist = doclnkset->children(); | 39 | QList<DocLnk> packlist = doclnkset->children(); |
39 | for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() ) | 40 | for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() ) |
40 | { | 41 | { |
41 | insertPackage( new Package(pack->file(), settings) ); | 42 | insertPackage( new Package(pack->file(), settings) ); |
42 | } | 43 | } |
43 | } | 44 | } |
diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp index 3c6ede7..ee54fca 100644 --- a/noncore/unsupported/oipkg/packagelistremote.cpp +++ b/noncore/unsupported/oipkg/packagelistremote.cpp | |||
@@ -1,47 +1,48 @@ | |||
1 | 1 | ||
2 | #include "packagelistremote.h" | 2 | #include "packagelistremote.h" |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <stdlib.h> | 5 | #include <stdlib.h> |
6 | #include <unistd.h> | 6 | #include <unistd.h> |
7 | 7 | ||
8 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) | 8 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) |
9 | : PackageList(s) | 9 | : PackageList(s) |
10 | { | 10 | { |
11 | PackageListRemote(); | 11 | PackageListRemote(); |
12 | } | 12 | } |
13 | 13 | ||
14 | PackageListRemote::PackageListRemote() | 14 | PackageListRemote::PackageListRemote() |
15 | : PackageList() | 15 | : PackageList() |
16 | { | 16 | { |
17 | } | 17 | } |
18 | 18 | ||
19 | PackageListRemote::~PackageListRemote() | 19 | PackageListRemote::~PackageListRemote() |
20 | { | 20 | { |
21 | } | 21 | } |
22 | 22 | ||
23 | void PackageListRemote::query(QString s) | 23 | void PackageListRemote::query(QString s) |
24 | { | 24 | { |
25 | pvDebug(4,"set query "+s); | ||
25 | searchString = s; | 26 | searchString = s; |
26 | } | 27 | } |
27 | 28 | ||
28 | void PackageListRemote::update() | 29 | void PackageListRemote::update() |
29 | { | 30 | { |
30 | pvDebug(2,"PackageListRemote::update"); | 31 | pvDebug(2,"PackageListRemote::update"); |
31 | int r=0; | 32 | int r=0; |
32 | QString cmd = "wget"; | 33 | QString cmd = "wget"; |
33 | QString redirect = "/tmp/oipkg.query"; | 34 | QString redirect = "/tmp/oipkg.query"; |
34 | 35 | ||
35 | // use file for output | 36 | // use file for output |
36 | cmd += " --output-document="+redirect; | 37 | cmd += " --output-document="+redirect; |
37 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= | 38 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= |
38 | QString server="http://ipkgfind.handhelds.org/"; | 39 | QString server="http://ipkgfind.handhelds.org/"; |
39 | cmd += " \""+server+"/packages.phtml"; | 40 | cmd += " \""+server+"/packages.phtml"; |
40 | cmd += "?format=pda&searchtype=package§ion="; | 41 | cmd += "?format=pda&searchtype=package§ion="; |
41 | cmd += "&query="+searchString; | 42 | cmd += "&query="+searchString; |
42 | cmd += "\""; | 43 | cmd += "\""; |
43 | 44 | ||
44 | pvDebug(4,"search :"+cmd); | 45 | pvDebug(4,"search :"+cmd); |
45 | r = system(cmd.latin1()); | 46 | r = system(cmd.latin1()); |
46 | readFileEntries( redirect ); | 47 | readFileEntries( redirect ); |
47 | } | 48 | } |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index fd8279b..0ae74da 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -1,417 +1,408 @@ | |||
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 | runwindow = new RunWindow( p, name, true, f ); | 33 | runwindow = new RunWindow( p, name, true, f ); |
34 | } | 34 | } |
35 | 35 | ||
36 | PmIpkg::~PmIpkg() | 36 | PmIpkg::~PmIpkg() |
37 | { | 37 | { |
38 | } | 38 | } |
39 | 39 | ||
40 | //#define PROC | 40 | //#define PROC |
41 | #define SYSTEM | 41 | #define SYSTEM |
42 | int PmIpkg::runIpkg(const QString& args, const QString& dest ) | 42 | int PmIpkg::runIpkg(const QString& args, const QString& dest ) |
43 | { | 43 | { |
44 | pvDebug(2,"PmIpkg::runIpkg "+args); | 44 | pvDebug(2,"PmIpkg::runIpkg "+args); |
45 | 45 | ||
46 | #ifdef PROC | 46 | #ifdef PROC |
47 | QStringList cmd = "/usr/bin/ipkg "; | 47 | QStringList cmd = "ipkg "; |
48 | #endif | 48 | #endif |
49 | #ifdef SYSTEM | 49 | #ifdef SYSTEM |
50 | QString cmd = "/usr/bin/ipkg "; | 50 | QString cmd = "/usr/bin/ipkg "; |
51 | #endif | 51 | #endif |
52 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); | 52 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); |
53 | if ( dest == "" ) | 53 | if ( dest == "" ) |
54 | cmd += " -dest "+settings->getDestinationName(); | 54 | cmd += " -dest "+settings->getDestinationName(); |
55 | else | 55 | else |
56 | cmd += " -dest "+ dest; | 56 | cmd += " -dest "+ dest; |
57 | 57 | ||
58 | cmd += " -force-defaults "; | 58 | cmd += " -force-defaults "; |
59 | 59 | ||
60 | if (installDialog->_force_depends) | 60 | if (installDialog->_force_depends) |
61 | { | 61 | { |
62 | if (installDialog->_force_depends->isChecked()) | 62 | if (installDialog->_force_depends->isChecked()) |
63 | cmd += " -force-depends "; | 63 | cmd += " -force-depends "; |
64 | if (installDialog->_force_reinstall->isChecked()) | 64 | if (installDialog->_force_reinstall->isChecked()) |
65 | cmd += " -force-reinstall "; | 65 | cmd += " -force-reinstall "; |
66 | if (installDialog->_force_remove->isChecked()) | 66 | if (installDialog->_force_remove->isChecked()) |
67 | cmd += " -force-removal-of-essential-packages "; | 67 | cmd += " -force-removal-of-essential-packages "; |
68 | } | 68 | } |
69 | 69 | ||
70 | out( "<hr><br>Starting to "+ args+"<br>\n"); | 70 | out( "<hr><br>Starting to "+ args+"<br>\n"); |
71 | cmd += args; | 71 | cmd += args; |
72 | int r = 0; | 72 | int r = 0; |
73 | #ifdef PROC | 73 | #ifdef PROC |
74 | QString o = "start"; | 74 | QString o = "start"; |
75 | Process *ipkg = new Process( cmd ); | 75 | Process *ipkg = new Process( cmd ); |
76 | out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); | 76 | out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); |
77 | QString description; | 77 | QString description; |
78 | ipkg->exec("",o); | 78 | r = ipkg->exec("",o); |
79 | // out( o ); | 79 | out( o ); |
80 | #endif | 80 | #endif |
81 | #ifdef SYSTEM | 81 | #ifdef SYSTEM |
82 | out( "running:<br>\n"+cmd+"<br>\n" ); | 82 | out( "running:<br>\n"+cmd+"<br>\n" ); |
83 | QString redirect = "/tmp/oipkg.pipe"; | 83 | QString redirect = "/tmp/oipkg.pipe"; |
84 | cmd += " 2>&1 | tee "+redirect+" 2>&1"; | 84 | cmd += " 2>&1 | tee "+redirect+" 2>&1"; |
85 | pvDebug(2, "running >"+cmd+"<"); | 85 | pvDebug(2, "running >"+cmd+"<"); |
86 | r = system(cmd.latin1()); | 86 | r = system(cmd.latin1()); |
87 | QFile f( redirect ); | 87 | QFile f( redirect ); |
88 | QString line; | 88 | QString line; |
89 | QString oldLine; | 89 | QString oldLine; |
90 | while ( ! f.open(IO_ReadOnly) ) {}; | 90 | while ( ! f.open(IO_ReadOnly) ) {}; |
91 | QTextStream t( &f ); | 91 | QTextStream t( &f ); |
92 | while ( !t.eof() ) | 92 | while ( !t.eof() ) |
93 | { | 93 | { |
94 | line = t.readLine(); | 94 | line = t.readLine(); |
95 | if ( line != oldLine ) | 95 | if ( line != oldLine ) |
96 | { | 96 | { |
97 | out( line +"<br>" ); | 97 | out( line +"<br>" ); |
98 | oldLine = line; | 98 | oldLine = line; |
99 | } | 99 | } |
100 | } | 100 | } |
101 | f.close(); | 101 | f.close(); |
102 | out( "Finished!<br>"); | 102 | out( "Finished!<br>"); |
103 | #endif | 103 | #endif |
104 | 104 | ||
105 | return r; | 105 | return r; |
106 | } | 106 | } |
107 | 107 | ||
108 | void PmIpkg::makeLinks(Package *pack) | 108 | void PmIpkg::makeLinks(Package *pack) |
109 | { | 109 | { |
110 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); | 110 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); |
111 | linkPackage( pack->name(), pack->dest() ); | 111 | linkPackage( pack->name(), pack->dest() ); |
112 | } | 112 | } |
113 | 113 | ||
114 | QStringList* PmIpkg::getList( QString packFileName, QString d ) | 114 | QStringList* PmIpkg::getList( QString packFileName, QString d ) |
115 | { | 115 | { |
116 | QString dest = settings->getDestinationUrlByName( d ); | 116 | QString dest = settings->getDestinationUrlByName( d ); |
117 | dest = dest==""?d:dest; | 117 | dest = dest==""?d:dest; |
118 | if (dest == "/" ) return 0; | 118 | if (dest == "/" ) return 0; |
119 | { | 119 | { |
120 | Config cfg( "oipkg", Config::User ); | 120 | Config cfg( "oipkg", Config::User ); |
121 | cfg.setGroup( "Common" ); | 121 | cfg.setGroup( "Common" ); |
122 | QString statusDir = cfg.readEntry( "statusDir", "" ); | 122 | QString statusDir = cfg.readEntry( "statusDir", "" ); |
123 | } | 123 | } |
124 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; | 124 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; |
125 | QFile f( packFileName ); | 125 | QFile f( packFileName ); |
126 | if ( ! f.open(IO_ReadOnly) ) | 126 | if ( ! f.open(IO_ReadOnly) ) |
127 | { | 127 | { |
128 | pvDebug(1," Panik! Could not open"); | 128 | pvDebug(1," Panik! Could not open"); |
129 | out( "<b>Panik!</b> Could not open:<br>"+packFileName ); | 129 | out( "<b>Panik!</b> Could not open:<br>"+packFileName ); |
130 | return (QStringList*)0; | 130 | return (QStringList*)0; |
131 | } | 131 | } |
132 | QStringList *fileList = new QStringList(); | 132 | QStringList *fileList = new QStringList(); |
133 | QTextStream t( &f ); | 133 | QTextStream t( &f ); |
134 | while ( !t.eof() ) | 134 | while ( !t.eof() ) |
135 | { | 135 | { |
136 | *fileList += t.readLine(); | 136 | *fileList += t.readLine(); |
137 | } | 137 | } |
138 | return fileList; | 138 | return fileList; |
139 | } | 139 | } |
140 | 140 | ||
141 | void PmIpkg::linkPackage( QString packFileName, QString dest ) | 141 | void PmIpkg::linkPackage( QString packFileName, QString dest ) |
142 | { | 142 | { |
143 | QStringList *fileList = getList( packFileName, dest ); | 143 | QStringList *fileList = getList( packFileName, dest ); |
144 | processFileList( fileList, dest ); | 144 | processFileList( fileList, dest ); |
145 | delete fileList; | 145 | delete fileList; |
146 | } | 146 | } |
147 | 147 | ||
148 | void PmIpkg::processFileList( QStringList *fileList, QString d ) | 148 | void PmIpkg::processFileList( QStringList *fileList, QString d ) |
149 | { | 149 | { |
150 | if (!fileList) return; | 150 | if (!fileList) return; |
151 | for (uint i=0; i < fileList->count(); i++) | 151 | for (uint i=0; i < fileList->count(); i++) |
152 | { | 152 | { |
153 | QString dest = settings->getDestinationUrlByName( d ); | 153 | QString dest = settings->getDestinationUrlByName( d ); |
154 | dest = dest==""?d:dest; | 154 | dest = dest==""?d:dest; |
155 | processLinkDir( (*fileList)[i], dest ); | 155 | processLinkDir( (*fileList)[i], dest ); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | 159 | ||
160 | void PmIpkg::processLinkDir( QString file, QString dest ) | 160 | void PmIpkg::processLinkDir( QString file, QString dest ) |
161 | { | 161 | { |
162 | pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest); | 162 | pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest); |
163 | if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); | 163 | if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); |
164 | if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); | 164 | if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); |
165 | if ( dest == "???" || dest == "" ) return; | 165 | if ( dest == "???" || dest == "" ) return; |
166 | QString destFile = file; | 166 | QString destFile = file; |
167 | file = dest+"/"+file; | 167 | file = dest+"/"+file; |
168 | if (file == dest) return; | 168 | if (file == dest) return; |
169 | QFileInfo fileInfo( file ); | 169 | QFileInfo fileInfo( file ); |
170 | if ( fileInfo.isDir() ) | 170 | if ( fileInfo.isDir() ) |
171 | { | 171 | { |
172 | pvDebug(4, "process dir "+file); | 172 | pvDebug(4, "process dir "+file); |
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 | qDebug( "while %i",list->count()); | ||
181 | while ( (fi=it.current()) ) | 180 | while ( (fi=it.current()) ) |
182 | { | 181 | { |
183 | pvDebug(4, "processLinkDir "+fi->absFilePath()); | 182 | pvDebug(4, "processLinkDir "+fi->absFilePath()); |
184 | processLinkDir( fi->absFilePath(), dest ); | 183 | processLinkDir( fi->absFilePath(), dest ); |
185 | ++it; | 184 | ++it; |
186 | } | 185 | } |
187 | } else | 186 | } else |
188 | if ( fileInfo.isFile() ) | 187 | if ( fileInfo.isFile() ) |
189 | { | 188 | { |
190 | const char *instFile = strdup( (file).ascii() ); | 189 | const char *instFile = strdup( (file).ascii() ); |
191 | const char *linkFile = strdup( (destFile).ascii()); | 190 | const char *linkFile = strdup( (destFile).ascii()); |
192 | if( linkOpp==createLink ) | 191 | if( linkOpp==createLink ) |
193 | { | 192 | { |
194 | pvDebug(4, "linking: "+file+" -> "+destFile ); | 193 | pvDebug(4, "linking: "+file+" -> "+destFile ); |
195 | symlink( instFile, linkFile ); | 194 | symlink( instFile, linkFile ); |
196 | } | 195 | } |
197 | } else { | 196 | } else { |
198 | const char *linkFile = strdup( (destFile).ascii()); | 197 | const char *linkFile = strdup( (destFile).ascii()); |
199 | if( linkOpp==removeLink ) | 198 | if( linkOpp==removeLink ) |
200 | { | 199 | { |
201 | QFileInfo toRemoveLink( destFile ); | 200 | QFileInfo toRemoveLink( destFile ); |
202 | if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) | 201 | if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) |
203 | { | 202 | { |
204 | pvDebug(4,"removing "+destFile+" no "+file); | 203 | pvDebug(4,"removing "+destFile+" no "+file); |
205 | unlink( linkFile ); | 204 | unlink( linkFile ); |
206 | } | 205 | } |
207 | } | 206 | } |
208 | } | 207 | } |
209 | } | 208 | } |
210 | 209 | ||
211 | void PmIpkg::loadList( PackageList pl ) | 210 | void PmIpkg::loadList( PackageList *pl ) |
212 | { | 211 | { |
213 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) | 212 | for( Package *pack = pl->first();pack ; (pack = pl->next()) ) |
214 | { | 213 | { |
215 | if ( pack && (pack->name() != "") && pack) | 214 | if ( pack && (pack->name() != "") && pack) |
216 | { | 215 | { |
217 | if ( pack->toInstall() ) | 216 | if ( pack->toInstall() ) |
218 | to_install.append( pack ); | 217 | to_install.append( pack ); |
219 | if ( pack->toRemove() ) | 218 | if ( pack->toRemove() ) |
220 | to_remove.append( pack ); | 219 | to_remove.append( pack ); |
221 | } | 220 | } |
222 | } | 221 | } |
223 | } | 222 | } |
224 | 223 | ||
225 | void PmIpkg::commit() | 224 | void PmIpkg::commit() |
226 | { | 225 | { |
227 | int sizecount = 0; | 226 | int sizecount = 0; |
228 | for (uint i=0; i < to_remove.count(); i++) | ||
229 | sizecount += 1; | ||
230 | for (uint i=0; i < to_install.count(); i++) | ||
231 | sizecount += to_install.at(i)->size().toInt(); | ||
232 | runwindow->progress->setTotalSteps(sizecount); | ||
233 | startDialog(); | ||
234 | } | ||
235 | |||
236 | void PmIpkg::startDialog() | ||
237 | { | ||
238 | installDialog = new InstallDialog(settings,0,0,true); | 227 | installDialog = new InstallDialog(settings,0,0,true); |
239 | QCheckListItem *toRemoveItem; | 228 | QCheckListItem *toRemoveItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To remove") ); |
240 | toRemoveItem= new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To remove") ); | 229 | QCheckListItem *toInstallItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To install") ); |
241 | toRemoveItem->setOpen( true ); | 230 | toRemoveItem->setOpen( true ); |
242 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | 231 | toInstallItem->setOpen( true ); |
232 | for (uint i=0; i < to_remove.count(); i++) | ||
243 | { | 233 | { |
244 | toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, it,settings) ); | 234 | sizecount += 1; |
235 | toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) ); | ||
245 | } | 236 | } |
246 | QCheckListItem *toInstallItem; | 237 | for (uint i=0; i < to_install.count(); i++) |
247 | toInstallItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To install") ); | ||
248 | toInstallItem->setOpen( true ); | ||
249 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) | ||
250 | { | 238 | { |
251 | toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, it,settings) ); | 239 | sizecount += to_install.at(i)->size().toInt(); |
240 | toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) ); | ||
252 | } | 241 | } |
242 | runwindow->progress->setTotalSteps(sizecount); | ||
243 | qDebug("Install size %i",sizecount); | ||
253 | installDialog->showMaximized(); | 244 | installDialog->showMaximized(); |
254 | if ( installDialog->exec() ) doIt(); | 245 | if ( installDialog->exec() ) doIt(); |
255 | installDialog->close(); | 246 | installDialog->close(); |
247 | runwindow->showMaximized(); | ||
256 | out(tr("<b>All done.</b>")); | 248 | out(tr("<b>All done.</b>")); |
257 | to_install.clear(); | ||
258 | } | 249 | } |
259 | 250 | ||
260 | void PmIpkg::doIt() | 251 | void PmIpkg::doIt() |
261 | { | 252 | { |
262 | show( true ); | 253 | show( true ); |
263 | remove(); | 254 | remove(); |
264 | install(); | 255 | install(); |
265 | } | 256 | } |
266 | 257 | ||
267 | 258 | ||
268 | void PmIpkg::remove() | 259 | void PmIpkg::remove() |
269 | { | 260 | { |
270 | if ( to_remove.count() == 0 ) return; | 261 | if ( to_remove.count() == 0 ) return; |
271 | 262 | ||
272 | out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>"); | 263 | out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>"); |
273 | 264 | ||
274 | QStringList *fileList; | 265 | QStringList *fileList; |
275 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | 266 | for (uint i=0; i < to_remove.count(); i++) |
276 | { | 267 | { |
277 | if ( it->link() )fileList = getList( it->name(), it->dest() ); | 268 | if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); |
278 | if ( runIpkg("remove " + it->name(), it->dest() ) == 0) | 269 | if ( runIpkg("remove " + to_remove.at(i)->name(), to_remove.at(i)->dest() ) == 0) |
279 | { | 270 | { |
280 | runwindow->progress->setProgress( 1 + runwindow->progress->progress() ); | 271 | runwindow->progress->setProgress( 1 ); |
281 | linkOpp = removeLink; | 272 | linkOpp = removeLink; |
282 | if ( it->link() ) | 273 | if ( to_remove.at(i)->link() ) |
283 | { | 274 | { |
284 | out( "<br>removing links<br>" ); | 275 | out( "<br>removing links<br>" ); |
285 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); | 276 | out( "for package "+to_remove.at(i)->name()+" in "+to_remove.at(i)->dest()+"<br>" ); |
286 | processFileList( fileList, it->dest() ); | 277 | processFileList( fileList, to_remove.at(i)->dest() ); |
287 | } | ||
288 | it->processed(); | ||
289 | // to_install.take( it ); | ||
290 | out("<br><hr>"); | ||
291 | }else{ | ||
292 | out("<b>"+tr("Error while removing")+"</b><hr>"+it->name()); | ||
293 | } | 278 | } |
294 | if ( it->link() )delete fileList; | 279 | to_remove.at(i)->processed(); |
280 | to_remove.take( i ); | ||
281 | out("<br><hr>"); | ||
282 | }else{ | ||
283 | out("<b>"+tr("Error while removing")+"</b><hr>"+to_remove.at(i)->name()); | ||
295 | } | 284 | } |
296 | out("<br>"); | 285 | if ( to_remove.at(i)->link() )delete fileList; |
286 | } | ||
287 | to_remove.clear(); | ||
288 | out("<br>"); | ||
297 | } | 289 | } |
298 | 290 | ||
299 | 291 | ||
300 | void PmIpkg::install() | 292 | void PmIpkg::install() |
301 | { | 293 | { |
302 | if ( to_install.count() == 0 ) return; | 294 | if ( to_install.count() == 0 ) return; |
303 | out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); | 295 | out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); |
304 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) | 296 | for (uint i=0; i < to_install.count(); i++) |
305 | { | 297 | { |
306 | 298 | if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ) == 0 ) | |
307 | if ( runIpkg("install " + it->installName(), it->dest() ) == 0 ) | 299 | { |
308 | { | 300 | runwindow->progress->setProgress( to_install.at(i)->size().toInt() ); |
309 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); | 301 | linkOpp = createLink; |
310 | linkOpp = createLink; | 302 | if ( to_install.at(i)->link() ) |
311 | if ( it->link() ) | 303 | { |
312 | { | 304 | out( "<br>creating links<br>" ); |
313 | out( "<br>creating links<br>" ); | 305 | out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"<br>" ); |
314 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); | 306 | makeLinks( to_install.at(i) ); |
315 | makeLinks( it ); | 307 | } |
316 | } | 308 | to_install.at(i)->processed(); |
317 | it->processed(); | 309 | to_install.take( i ); |
318 | // to_install.take( it->name() ); | 310 | out("<br><hr>"); |
319 | out("<br><hr>"); | 311 | }else{ |
320 | }else{ | 312 | out("<b>"+tr("Error while installing")+"</b><hr>"+to_install.at(i)->name()); |
321 | out("<b>"+tr("Error while installing")+"</b><hr>"+it->name()); | ||
322 | } | ||
323 | } | 313 | } |
324 | out("<br>"); | 314 | } |
325 | to_install.clear(); | 315 | out("<br>"); |
316 | to_install.clear(); | ||
326 | } | 317 | } |
327 | 318 | ||
328 | void PmIpkg::createLinks( const QString &dest ) | 319 | void PmIpkg::createLinks( const QString &dest ) |
329 | { | 320 | { |
330 | pvDebug(2,"PmIpkg::createLinks "+dest); | 321 | pvDebug(2,"PmIpkg::createLinks "+dest); |
331 | linkOpp=createLink; | 322 | linkOpp=createLink; |
332 | QString url = settings->getDestinationUrlByName( dest ); | 323 | QString url = settings->getDestinationUrlByName( dest ); |
333 | url = url==""?dest:url; | 324 | url = url==""?dest:url; |
334 | processLinkDir( "/opt", url ); | 325 | processLinkDir( "/opt", url ); |
335 | processLinkDir( "/usr", url ); | 326 | processLinkDir( "/usr", url ); |
336 | } | 327 | } |
337 | 328 | ||
338 | void PmIpkg::removeLinks( const QString &dest ) | 329 | void PmIpkg::removeLinks( const QString &dest ) |
339 | { | 330 | { |
340 | pvDebug(2,"PmIpkg::removeLinks "+dest); | 331 | pvDebug(2,"PmIpkg::removeLinks "+dest); |
341 | linkOpp=removeLink; | 332 | linkOpp=removeLink; |
342 | QString url = settings->getDestinationUrlByName( dest ); | 333 | QString url = settings->getDestinationUrlByName( dest ); |
343 | url = url==""?dest:url; | 334 | url = url==""?dest:url; |
344 | processLinkDir( "/opt", url ); | 335 | processLinkDir( "/opt", url ); |
345 | processLinkDir( "/usr", url ); | 336 | processLinkDir( "/usr", url ); |
346 | } | 337 | } |
347 | 338 | ||
348 | void PmIpkg::update() | 339 | void PmIpkg::update() |
349 | { | 340 | { |
350 | show( false ); | 341 | show( false ); |
351 | runIpkg( "update" ); | 342 | runIpkg( "update" ); |
352 | runwindow->close(); | 343 | runwindow->close(); |
353 | } | 344 | } |
354 | 345 | ||
355 | void PmIpkg::out( QString o ) | 346 | void PmIpkg::out( QString o ) |
356 | { | 347 | { |
357 | runwindow->outPut->append(o); | 348 | runwindow->outPut->append(o); |
358 | //runwindow->outPut->setCursorPosition(0, runwindow->outPut->contentsHeight()); | 349 | //runwindow->outPut->setCursorPosition(0, runwindow->outPut->contentsHeight()); |
359 | //runwindow->outPut->setText( runwindow->outPut->text()+o ); | 350 | //runwindow->outPut->setText( runwindow->outPut->text()+o ); |
360 | runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight()); | 351 | runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight()); |
361 | } | 352 | } |
362 | 353 | ||
363 | 354 | ||
364 | void PmIpkg::showButtons(bool b) | 355 | void PmIpkg::showButtons(bool b) |
365 | { | 356 | { |
366 | if ( b ) | 357 | if ( b ) |
367 | { | 358 | { |
368 | runwindow->cancelButton->hide(); | 359 | runwindow->cancelButton->hide(); |
369 | runwindow->doItButton->hide(); | 360 | runwindow->doItButton->hide(); |
370 | runwindow->removeButton->hide(); | 361 | runwindow->removeButton->hide(); |
371 | runwindow->installButton->hide(); | 362 | runwindow->installButton->hide(); |
372 | }else{ | 363 | }else{ |
373 | runwindow->cancelButton->show(); | 364 | runwindow->cancelButton->show(); |
374 | runwindow->doItButton->show(); | 365 | runwindow->doItButton->show(); |
375 | runwindow->removeButton->show(); | 366 | runwindow->removeButton->show(); |
376 | runwindow->installButton->show(); | 367 | runwindow->installButton->show(); |
377 | 368 | ||
378 | } | 369 | } |
379 | } | 370 | } |
380 | 371 | ||
381 | void PmIpkg::show(bool b) | 372 | void PmIpkg::show(bool b) |
382 | { | 373 | { |
383 | if (!runwindow->isVisible()) | 374 | if (!runwindow->isVisible()) |
384 | runwindow->showMaximized(); | 375 | runwindow->showMaximized(); |
385 | showButtons(b); | 376 | showButtons(b); |
386 | if ( !b ) | 377 | if ( !b ) |
387 | runwindow->progress->hide(); | 378 | runwindow->progress->hide(); |
388 | else | 379 | else |
389 | runwindow->progress->show(); | 380 | runwindow->progress->show(); |
390 | } | 381 | } |
391 | 382 | ||
392 | void PmIpkg::installFile(const QString &fileName, const QString &dest) | 383 | void PmIpkg::installFile(const QString &fileName, const QString &dest) |
393 | { | 384 | { |
394 | 385 | ||
395 | to_install.clear(); | 386 | to_install.clear(); |
396 | to_remove.clear(); | 387 | to_remove.clear(); |
397 | pvDebug( 2,"PmIpkg::installFile "+ fileName); | 388 | pvDebug( 2,"PmIpkg::installFile "+ fileName); |
398 | Package *p = new Package(fileName,settings); | 389 | Package *p = new Package(fileName,settings); |
399 | if ( dest!="") p->setDest( dest ); | 390 | if ( dest!="") p->setDest( dest ); |
400 | to_install.append( p ); | 391 | to_install.append( p ); |
401 | startDialog(); | 392 | commit(); |
402 | delete p; | 393 | delete p; |
403 | } | 394 | } |
404 | 395 | ||
405 | void PmIpkg::removeFile(const QString &fileName, const QString &dest) | 396 | void PmIpkg::removeFile(const QString &fileName, const QString &dest) |
406 | { | 397 | { |
407 | 398 | ||
408 | to_install.clear(); | 399 | to_install.clear(); |
409 | to_remove.clear(); | 400 | to_remove.clear(); |
410 | pvDebug( 2,"PmIpkg::removeFile "+ fileName); | 401 | pvDebug( 2,"PmIpkg::removeFile "+ fileName); |
411 | Package *p = new Package(fileName,settings); | 402 | Package *p = new Package(fileName,settings); |
412 | if ( dest!="") p->setDest( dest ); | 403 | if ( dest!="") p->setDest( dest ); |
413 | to_remove.append( p ); | 404 | to_remove.append( p ); |
414 | startDialog(); | 405 | commit(); |
415 | delete p; | 406 | delete p; |
416 | } | 407 | } |
417 | 408 | ||
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index d2490e8..7bc62f1 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -1,64 +1,64 @@ | |||
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 "installdialog.h" | 12 | #include "installdialog.h" |
13 | #include "debug.h" | 13 | #include "debug.h" |
14 | 14 | ||
15 | #define createLink 0 | 15 | #define createLink 0 |
16 | #define removeLink 1 | 16 | #define removeLink 1 |
17 | 17 | ||
18 | class Package; | 18 | class Package; |
19 | class PmIpkg : public QObject | 19 | class PmIpkg : public QObject |
20 | { | 20 | { |
21 | Q_OBJECT | 21 | Q_OBJECT |
22 | public: | 22 | public: |
23 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 23 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
24 | ~PmIpkg(); | 24 | ~PmIpkg(); |
25 | 25 | ||
26 | int linkOpp; | 26 | int linkOpp; |
27 | void loadList( PackageList ); | 27 | void loadList( PackageList* ); |
28 | void commit(); | 28 | void commit(); |
29 | void update(); | 29 | void update(); |
30 | void showButtons(bool b=true); | 30 | void showButtons(bool b=true); |
31 | void show( bool buttons=true ); | 31 | void show( bool buttons=true ); |
32 | 32 | ||
33 | public slots: | 33 | public slots: |
34 | void doIt(); | 34 | void doIt(); |
35 | void install(); | 35 | void install(); |
36 | void remove(); | 36 | void remove(); |
37 | void installFile(const QString &fileName, const QString &dest=""); | 37 | void installFile(const QString &fileName, const QString &dest=""); |
38 | void removeFile(const QString &fileName, const QString &dest=""); | 38 | void removeFile(const QString &fileName, const QString &dest=""); |
39 | void createLinks( const QString &dest ); | 39 | void createLinks( const QString &dest ); |
40 | void removeLinks( const QString &dest ); | 40 | void removeLinks( const QString &dest ); |
41 | 41 | ||
42 | private: | 42 | private: |
43 | PackageManagerSettings* settings; | 43 | PackageManagerSettings* settings; |
44 | RunWindow *runwindow; | 44 | RunWindow *runwindow; |
45 | InstallDialog *installDialog; | 45 | InstallDialog *installDialog; |
46 | QList<Package> to_remove; | 46 | QList<Package> to_remove; |
47 | QList<Package> to_install; | 47 | QList<Package> to_install; |
48 | QString fileNameToInstall; | 48 | QString fileNameToInstall; |
49 | QCheckBox *_force_reinstall; | 49 | QCheckBox *_force_reinstall; |
50 | QCheckBox *_force_remove; | 50 | QCheckBox *_force_remove; |
51 | QCheckBox *_force_depends; | 51 | QCheckBox *_force_depends; |
52 | void startDialog(); | 52 | void startDialog(); |
53 | void makeLinks(Package*); | 53 | void makeLinks(Package*); |
54 | void linkPackage( QString, QString ); | 54 | void linkPackage( QString, QString ); |
55 | void processLinkDir( QString , QString ); | 55 | void processLinkDir( QString , QString ); |
56 | int runIpkg(const QString& args, const QString& dest="" ); | 56 | int runIpkg(const QString& args, const QString& dest="" ); |
57 | void out( QString ); | 57 | void out( QString ); |
58 | QStringList* getList( QString, QString ); | 58 | QStringList* getList( QString, QString ); |
59 | void processFileList( QStringList*, QString ); | 59 | void processFileList( QStringList*, QString ); |
60 | 60 | ||
61 | 61 | ||
62 | }; | 62 | }; |
63 | 63 | ||
64 | #endif | 64 | #endif |